Skip to content

feat(apps): add an opt-in to never adopt a backend listener this run did not start - #35334

Merged
bolichen97 merged 1 commit into
mainfrom
fix/13403-adopt-recorded-spawn
Nov 15, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/13403-adopt-recorded-spawn

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An operator can tell the gateway to never adopt or re-bind an app backend listener it did not start in this run.

When the declared port answers its health path, the gateway adopts whatever holds the port. A backend that survived an uninstall (or any other process on that port) is then treated as the app's backend: addressed, health-reported and signalled as that app. There is no way to ask the gateway not to do that.

Why it matters

Anyone with an app that declares a fixed port plus a detached child outliving uninstall gets the next install of that name bound to a process the install never started. Operators who want that closed need a switch; operators who run externally managed backends need the current behaviour to stay.

Not a goal

  • Changing the default: with the setting off, adoption, re-bind and stop behave exactly as on main.
  • Adopting a backend this run did not start, even a trustworthy one, when the setting is on.
  • The single-instant uninstall port probe.
  • A sandbox-floor fence record, or binding the listener to the installed artifact.
  • Re-weaving the larger approach in fix(apps): adopt a backend only when the gateway can attribute it #13650 into the rewritten lifecycle.

What changed (motivation -> approach -> change)

A new opt-in setting, agent.apps_never_adopt_backend_listener (default false), is read by one helper, _adoption_allowed in backend_runtime/ports.py.

  • Setting off (default): main's behaviour, unchanged.
  • Setting on: adoption in _start_app_backend_body and the recovery re-bind in _rebind_adopted_owners are refused. A listener found at start was not started by this run, and a recovered adopted record is not a child of this run either, so in practice every such listener is refused. The refusal logs a warning and writes an audit row with outcome refused_not_spawned_this_run.
  • The ceiling-revocation retry never asks for the check, so a revoked backend can always be re-bound and stopped.
  • A config that cannot be read (load error, or an unreadable base or overlay file) adopts as main does and logs one warning. A malformed section that was repaired is read normally.

The setting is registered in sections_agent.py and loader_builders.py, config-baseline.json is regenerated, and config.md and app-kit-platform.md describe it. The default wording in app-kit-platform.md is unchanged. Stopping an adopted backend is untouched.

Backwards compatibility

None for existing installs: the setting defaults to off and the default behaviour is unchanged.

Tests

  • test_the_start_path_writes_one_sel_row_with_the_decision pins the start-path audit row for both settings; test_a_listener_this_run_did_not_start_is_not_adopted_when_required and test_a_listener_this_run_did_not_start_is_not_rebound_when_required run with the setting on; the second also asserts the audit row.
  • test_a_listener_is_adopted_by_default, test_the_setting_alone_decides_whether_a_listener_may_be_adopted, the unreadable-config cases and test_the_ceiling_retry_rebinds_a_listener_this_run_did_not_start_so_it_can_be_stopped cover the default, fallback and revocation paths.
  • Related backend, config and app test files pass at -n 2 except test_protected_app_state.py and test_app_staged_grants.py, which fail identically without this change in this environment. flake8, isort, mypy on the source files, the comment-history gate, docs_lint and check_file_line_cap are clean.

Manual verification

N/A - covered by the unit tests.

Related Issues

Refs #13403

Pattern harvest

Not generalizable: the defect is that adoption trusted a health answer with no way to opt out, which is specific to this one adoption branch.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision fa318c7cb874b83742172587fa667a2663cad828 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of fa318c7cb874b83742172587fa667a2663cad828 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

The switch is off by default and adds no product shape. Two parts are worth trimming: the recovery-path gate only matters if the setting is turned on mid-run, and that path also writes a new audit row when the setting is off.

Notes

  • Item 3 — oversized: an adopted record is only ever built in _start_app_backend_body (backend.py:643, 1 site found with grep adopted_pids=), and with the setting on that path now refuses. So the require_attribution gate in _rebind_adopted_owners only fires when the setting is turned on after an adoption already happened. Subtraction: delete require_attribution, its SEL block and the sel import from supervision.py, and keep only the start-path refusal.
  • Item 5 — undeclared: the description says "with the setting off, adoption, re-bind and stop behave exactly as on main". But require_attribution=True runs on every sweep re-bind, so a default install now gets an adopted SEL row and a config load on each recovery. The test pins this: (False, "adopted"). Subtraction: the same deletion as item 3.

What this change ships

Inventory (8 items) — 6 justified

Intent: an operator can stop the gateway from adopting an app backend listener it did not start in this run. This is an ADDITION.

  1. New opt-in setting agent.apps_never_adopt_backend_listener, shown in Settings, default off — justified
  2. With it on, a healthy listener found when an app starts is refused, with a warning — justified
  3. With it on, the recovery sweep refuses to re-bind an adopted backend — oversized
  4. The start-path audit row now records the refusal outcome — justified
  5. Each adopted recovery writes a new audit row and reads config, even with the setting off — undeclared
  6. A config that cannot be read falls back to adopting, with a warning — justified
  7. The ceiling-revocation retry stays exempt, so a revoked backend can still be stopped — justified
  8. Spec, config doc and baseline entries — justified

[FIRST-PRINCIPLES-REVIEWED] fa318c7

Description read

[DESCRIPTION-READ] 5f3a5d6d2941802a697c8baff0235f3c764b1bd2f93404c59c06d601dde391d2

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of fa318c7cb874b83742172587fa667a2663cad828 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the switch is off by default, read where it is used, and turning it off undoes it.

Notes

  • With the setting on, the start path refuses every healthy listener it finds, including a backend that a previous gateway run left running. After a gateway restart, that app stays down until someone kills the old process, and the only sign is a log warning. Say this in the config.md help text so operators know what they are opting into.
  • The default still adopts an uninstall survivor, so App-backend adoption has no provenance: an uninstall survivor is adopted by the next install of the same name #13403 stays open for anyone who hasn't opted in. Keep the issue open, not closed by this PR.

[DESIGN-REVIEWED] fa318c7

Description read

[DESCRIPTION-READ] d3abc85f746341f5c3e2aabee3a467907ab2fcfc04a54f869188086863d54dc1

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed fa318c7cb874b83742172587fa667a2663cad828 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] fa318c7

Verdict parsed from the review's SHA-scoped output markers for commit fa318c7cb874b83742172587fa667a2663cad828.

False positive or not applicable? A repository writer can comment:
/ai-review override fable fa318c7cb874b83742172587fa667a2663cad828 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of fa318c7cb874b83742172587fa667a2663cad828 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fa318c7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt fa318c7cb874b83742172587fa667a2663cad828 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 11, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/13403-adopt-recorded-spawn branch from efe536d to 7c06420 Compare November 11, 2026 15:44
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 11, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/13403-adopt-recorded-spawn branch from 7c06420 to 549f585 Compare November 12, 2026 14:04
@chenmingwei23
chenmingwei23 marked this pull request as ready for review November 12, 2026 14:04
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Maintainer decision (Mingwei, via lead): removing adoption of externally managed backends is accepted for safety, because a pid alone cannot prove ownership. The spec (app-kit-platform.md) and the backend.py comment are updated in the same commit, 549f585. Refs #13403.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 12, 2026
@KiroCrewCaptain

KiroCrewCaptain commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 25% chance that this change introduces a defect, above the 12% limit for approving on its own.

The PR adds an opt-in setting, off by default, that refuses a healthy listener on an app's port at start and refuses the recovery re-bind of an adopted backend. The ceiling-revocation retry is exempt, so a revoked backend can still be re-bound and stopped. The refusal path releases the placeholder and port claim the same way main's unhealthy-port branch does. Both places that create or re-bind adopted records are gated, the setting is read live like its neighbouring settings, and the new tests cover both settings, the refusal audit rows and the fallback cases. Remaining issues, none blocking: on the default path every adopted recovery now writes an audit row and loads the config, which the description doesn't mention; a failed config load still adopts, which is declared; repeated refusals log every sweep; and the restart behaviour isn't documented.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit fa318c7cb8 · 312 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 12, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/13403-adopt-recorded-spawn branch from 549f585 to 9dabf97 Compare November 12, 2026 16:06
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Re the Opus 5.5 finding on _rebind_adopted_owners: fixed in 9dabf97. The spawn-record check is now one helper, _spawn_is_recorded (backend_runtime/pidfile.py), called from both the adoption branch in _start_app_backend_body and _rebind_adopted_owners. The rebind returns False, so nothing is promoted, when the recorded leader pid is not among the captured owners with a matching start time. New test: test_an_unrecorded_listener_taking_the_port_is_not_rebound. No other path sets adopted_pids.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 12, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Maintainer decision (Mingwei): accept Removal 1 of rfc-app-backend-adoption-provenance.md for this PR. The gateway adopts only backends whose spawn it recorded; a pid alone cannot prove the gateway owns a process. A backend an operator runs under their own supervisor is no longer re-adopted on start and should be started through the gateway. The spec is updated in this PR.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Re KiroCrewCaptain's 03:45Z review, item by item, now at head dd9951f:

  1. _agent_unreadable is deleted with its kwarg, the clause and its test case. loader_config.py and loader_pipeline.py are back to base, so they leave the PR. A repaired section is read normally (test_a_repaired_agent_section_with_the_setting_on_refuses_adoption still passes).
  2. Rename: the key is agent.apps_never_adopt_backend_listener, the label "Never Adopt App Backend Listener", and the SEL outcome refused_not_spawned_this_run. The title is now "feat(apps): add an opt-in to never adopt a backend listener this run did not start".
  3. The help text, config.md and app-kit-platform.md each say that with the setting on, an unreadable config file still adopts, as main does.
  4. test_the_start_path_writes_one_sel_row_with_the_decision pins the start-path row for both settings. The adopt row is back where main writes it, before the owner capture, so a failed capture with the setting off writes the row as on main.

Not changed: the per-sweep warning and SEL row on a refused re-bind, left as an optional follow-up.

@chenmingwei23
chenmingwei23 force-pushed the fix/13403-adopt-recorded-spawn branch from dd9951f to b65e358 Compare November 13, 2026 05:09

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the careful rework. The default path now matches main, and the start path refuses before it captures owners. One thing still blocks merge on this head.

  1. src/kiro_crew/apps/backend_runtime/ports.py:159-160: say an operator sets agent.apps_never_adopt_backend_listener: true in a readable config.json, and config.local.json holds invalid JSON. The loader keeps the base value, so the setting loads as true. The _base_unreadable or _overlay_unreadable check then raises, and _adoption_allowed returns True. backend.py:609 adopts the healthy survivor on the app's port, and supervision.py:173 re-binds it, even though the operator turned the refusal on. This is the security-class BLOCK on this head. Smallest fix: delete those two lines and decide from the loaded value, keeping the except fallback. An unreadable file adds only the default false, so with the setting off every case still adopts, as on main. With the setting on, a true read from a readable file is honored. Then drop the overlay_unreadable and base_unreadable cases from the parametrize in test_an_unreadable_config_adopts_as_main_does and keep raises. Finally, narrow "a config file that cannot be read still adopts" to "a config that fails to load still adopts" in the docstring, sections_agent.py, config-baseline.json, config.md and app-kit-platform.md.

My review on b38c649 read the earlier maintainer request as covering the setting-on case, and that note led to the current wording. I misread it. That request was about the default, off. Its suggested code (... is True inside a try/except) honors a readable true and has no unreadable-flag check. bolichen97, please confirm which reading you meant.

Earlier items from my review on b38c649:

  • _agent_unreadable never changes the decision: fixed. The field, the kwarg, the clause and the test case are gone, and the loader files left the PR.
  • Key, label, SEL outcome and title described a spawn-record check: fixed.
  • Docs did not name the unreadable-config exception: addressed, but item 1 above narrows that clause.
  • Start-path SEL row not pinned, and moved after the owner capture: fixed. test_the_start_path_writes_one_sel_row_with_the_decision pins both settings, and the row is back where main writes it.
  • Refused re-bind writes a WARNING and a SEL row every 15 s sweep: deferred by the author. Still optional.

Optional:

  • A refused start is retried by the 300 s backstop and writes a WARNING plus two SEL rows each time while a foreign listener holds the port. A follow-up issue for this and the re-bind noise would keep the deferral tracked.
  • The warning at ports.py:164 says "adopting as main does". Operators do not know what "main" refers to. "adopting, as when the setting is off" reads better. The single commit is still titled "fix(apps): adopt a backend only when the gateway recorded its spawn". Please reword it to match the PR title.
  • require_attribution (supervision.py:143) and the test helper _require_recorded_spawn, which is defined in two test files, still name the removed spawn-record check.

@chenmingwei23
chenmingwei23 marked this pull request as draft November 13, 2026 08:37
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Parked for the maintainer under the stop rule: this is a new blocker after the declared final push, so there is no code change here until Mingwei rules. KiroCrewCaptain review 5887996179 (08:13Z, head b65e358): src/kiro_crew/apps/backend_runtime/ports.py:159-160. With agent.apps_never_adopt_backend_listener: true in a readable config.json and invalid JSON in config.local.json, the _base_unreadable / _overlay_unreadable check makes _adoption_allowed return True, so backend.py:609 adopts and supervision.py:173 re-binds a listener the operator asked to refuse. Captain suggests deciding from the loaded value instead and asks @bolichen97 to confirm which reading of the earlier request was meant.

@chenmingwei23
chenmingwei23 force-pushed the fix/13403-adopt-recorded-spawn branch from b65e358 to 47ba560 Compare November 14, 2026 10:15
@chenmingwei23
chenmingwei23 marked this pull request as ready for review November 14, 2026 10:15
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Re the 08:13Z review, point by point, now at head 47ba560 ("feat(apps): add an opt-in to never adopt a backend listener this run did not start"):

  1. ports.py:159-160: fixed in 47ba560. The _base_unreadable or _overlay_unreadable check is deleted and _adoption_allowed decides from the loaded value, with the except fallback kept. A true in a readable config.json now refuses adoption even when config.local.json holds invalid JSON. The new test test_a_true_setting_in_a_readable_config_survives_an_invalid_overlay failed on b65e358 and passes on 47ba560.
  2. Tests: fixed in 47ba560. The overlay_unreadable and base_unreadable cases are dropped; the raises case remains as test_a_config_that_fails_to_load_adopts_as_when_the_setting_is_off.
  3. Wording: fixed in 47ba560. The clause now reads "a config that fails to load still adopts" in the _adoption_allowed docstring, sections_agent.py, config-baseline.json, config.md and app-kit-platform.md.
  4. Warning at ports.py:164: now says "adopting, as when the setting is off" (47ba560).
  5. Commit title: the single commit is now titled exactly like the PR, "feat(apps): add an opt-in to never adopt a backend listener this run did not start" (47ba560). The branch is rebased onto current main.

Deferred as accepted: the re-bind and refused-start log noise, and the require_attribution / _require_recorded_spawn names.

@bolichen97, could you confirm that your earlier request about the unreadable-config case meant the default (setting off) case? With the setting off, every config state adopts as before. With the setting on, a true read from a readable file is honored.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 14, 2026
@chenmingwei23
chenmingwei23 marked this pull request as draft November 14, 2026 10:38
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Parked as a draft for a maintainer decision after the declared final push 47ba560. Nothing further is pushed from this PR until a maintainer rules.

State: the points in KiroCrewCaptain's 08:13Z review are addressed in 47ba560 (see the reply above).

Open blocker: GPT 6.1 flagged supervision.py:173 on this head. With the setting off, a recovery re-bind (require_attribution=True) allows adoption without writing an audit event, and only the refusal branch is audited. Its suggested fix is to audit both the allowed and the refused decision when require_attribution=True.

The question to @bolichen97 in the previous comment still stands: does the earlier request about the unreadable-config case mean the default (setting off) case?

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 14, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Thanks for the careful rework. This head addresses what I asked for on b65e358, and I found no new blocking defect. I cannot approve yet, because two things need a maintainer.

Earlier items from my review on b65e358:

  • ports.py:159-160, an unreadable overlay reopening adoption: fixed. _adoption_allowed now decides from the loaded value and keeps the except fallback. test_a_true_setting_in_a_readable_config_survives_an_invalid_overlay pins it.
  • Narrowing the "fails to load" wording in the docstring, help text, baseline and both specs: fixed.
  • The warning text and the commit title: fixed.
  • The re-bind and refused-start log noise, and the require_attribution and _require_recorded_spawn names: deferred by you. These were optional and still are.

What waits for a maintainer:

  1. The security-class lane BLOCK at src/kiro_crew/apps/backend_runtime/supervision.py:173 still stands on this head. With the setting off, an allowed recovery re-bind writes no app_backend_adopt row. The re-bind on main writes no row either, so this review does not count it as a defect the PR introduces. Only a code change or a maintainer override can clear the lane. The smallest code change: when require_attribution=True, write one row before branching, adopted or refused_not_spawned_this_run. Keep the ceiling retry exempt. Then add a test parametrized on the setting, shaped like test_the_start_path_writes_one_sel_row_with_the_decision.
  2. An earlier maintainer change request on this PR is still open, and your question about the unreadable-config case is still waiting for that maintainer. On this head, every config state adopts when the setting is off. With the setting on, a true read from a readable file is honored. That matches the code suggested in that request.

The base of this head does not include #37171, which fixes the tracing test on main. A rebase should bring that fix in.

Optional:

  • The help text in sections_agent.py and the spec lines say "a listener it did not start in this run". With the setting on, the code refuses every listener already holding the port, including one this run started. Wording like "never adopts a listener already holding the app's port at start, and never re-binds an adopted backend that recovers" would match the code.
  • The "What changed" bullet in the PR body still says an unreadable base or overlay file adopts. That describes b65e358. Editing that bullet does not touch the frozen Goal sections.
  • The config.md entry could say that the setting is read on each adoption and re-bind with no restart. It could also say that an already adopted healthy backend stays bound until it next recovers.

@KiroCrewCaptain
KiroCrewCaptain dismissed their stale review November 14, 2026 11:22

Withdrawn: every item in this review is fixed or answered on the current head (see the follow-up comment). Other holds on this PR are listed there.

…did not start

With agent.apps_never_adopt_backend_listener on, the gateway neither adopts nor re-binds a healthy listener it did not start in this run. Off (the default) keeps adopting any healthy listener, and so does a config that fails to load. Refs #13403
@chenmingwei23
chenmingwei23 force-pushed the fix/13403-adopt-recorded-spawn branch from 47ba560 to fa318c7 Compare November 15, 2026 11:17
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Pushed fa318c7 (rebased onto current main, still one commit). It addresses the GPT 6.1 finding at supervision.py:173: a recovery re-bind with require_attribution now writes exactly one app_backend_adopt row either way, outcome adopted or refused_not_spawned_this_run, before the branch. The ceiling-revocation retry is unchanged and writes no row. New test test_a_recovery_rebind_audits_one_row_whichever_way_it_decides covers the setting on and off, and was red with the setting off on the previous head.

@bolichen97: yes, the unreadable-config case is the default case with the setting off. A config that fails to load adopts as main does, with one warning.

@chenmingwei23
chenmingwei23 marked this pull request as ready for review November 15, 2026 11:17
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 15, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Thanks for the rework. I found no blocking defect on this head. I cannot approve yet, because bolichen97's change request on f1e6367 is still open and only that maintainer can clear it. This head answers that request. With the setting off, _adoption_allowed (ports.py:148) adopts in every config state. A config that fails to load also adopts, with one warning, which is the shape that review suggested.

What this review checked on fa318c7:

  • The start-path refusal (backend.py:609) returns before the owner capture and reuses the existing cleanup, so a refused start leaks no placeholder or port claim.
  • The ceiling-revocation retry (supervision.py:356) skips the check, so a revoked backend can always be re-bound and stopped.
  • Each new refusal line has a test that goes red when the line is removed. The tests are parametrized on the setting, and one runs an invalid overlay through the real loader.

Earlier items from my review on b65e358 and my comment on 47ba560:

  • ports.py:159-160, an unreadable overlay reopening adoption: fixed in 47ba560, and still fixed here.
  • The audit gap at supervision.py:173: fixed. A recovery re-bind now writes one app_backend_adopt row whichever way it decides, and test_a_recovery_rebind_audits_one_row_whichever_way_it_decides pins that.
  • The maintainer change request: still open. bolichen97, please re-review this head.
  • Log noise from repeated refusals, and the require_attribution names: you deferred these, and they are still optional.

Optional:

  • The "What changed" bullet still says an unreadable base or overlay file adopts. At this head, a true read from a readable config.json is honored even when config.local.json is invalid, and test_a_true_setting_in_a_readable_config_survives_an_invalid_overlay pins that. That section is not frozen, so you can edit the bullet.
  • With the setting off, each recovery re-bind of an adopted backend now loads config and writes one adopted audit row. Main writes no row there. The addition is reasonable, but "Backwards compatibility: None" does not mention it. Please name it under "Backwards compatibility". The "Not a goal" line is frozen, so a maintainer should accept this departure in a comment.
  • A refused re-bind writes a warning and an audit row on every 15 s sweep. A follow-up issue would keep that deferral tracked.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, my point from f1e6367 is fixed, and I read the whole diff at fa318c7.

  • Unreadable config adopts, as on main. _adoption_allowed in ports.py now refuses only when KiroCrewConfig.load() returns apps_never_adopt_backend_listener is True. If the load raises, it logs one warning and returns True. test_a_config_that_fails_to_load_adopts_as_when_the_setting_is_off pins that.
  • Default is main. The setting is False in sections_agent.py, config.md and config-baseline.json (a new key only, defaulting off). With it off, the start path in backend.py and the recovery re-bind in supervision.py adopt exactly as before; the only addition there is one SEL row with the decision.
  • Opt-in is honored. A true read from a readable config.json survives an invalid config.local.json, and a repaired agent section still reads the setting. The ceiling-revocation retry keeps require_attribution off, so a revoked backend can always be re-bound and stopped.
  • No regex added. 101 checks pass, 0 red.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants