Skip to content

fix: log one warning while adoption waits for a pending config review - #36586

Merged
bolichen97 merged 1 commit into
mainfrom
fix/adoption-pending-edit-noise
Nov 14, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/adoption-pending-edit-noise

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: While config.json has a change made outside Kiro Crew waiting for review, each gateway start logs one warning about the waiting built-in adoptions instead of an ERROR traceback per app.

Edit config.json by hand on a host where the sandbox seals it, so the change waits for Apply or Discard in Settings > Security. Every gateway start then logs ERROR Adoption of <app> failed; the built-in keeps running with a full PendingEditBlocksSave traceback, once for each pinned former built-in. Five pins give five tracebacks per start. Nothing is actually wrong: the built-in keeps running, the staged ledger is untouched (attempts 0), and the next start tries again.

Why it matters

The log reads as a crash on every start for anyone with a pending config review, which is the normal state between an outside edit and the person's Apply or Discard. Real adoption errors are hard to spot among the tracebacks, and the log never says what would clear them.

Not a goal

  • Changing when adoption retries, or what it does while the review is pending. The ledger stays as it was and the next start retries, as today.
  • Letting adoption write through a pending review. Only the person's Apply or Discard may write a pending file.
  • The default-install pass, which already logs one line with no traceback for the same refusal.

What changed (motivation → approach → change)

Symptom → cause. The APPLY pass's trust write goes through the config writer, which refuses a save while the file is pending review. The pass classifies a trust-overlay refusal and an unreadable file, but not this one, so it reached the pass's catch-all and was logged with logger.exception.

Change. apply_all treats the refusal as the expected state it is: that app's outcome is waiting_for_review, its ledger is left as it was, and after the loop the pass logs one warning naming every waiting app and the pending file, with the remedy (Apply or Discard in Settings > Security). Each refusal's trace goes to DEBUG. Recording the legacy nav of an app that is already adopted waits the same way, logged at DEBUG only, since it is display state. The app-kit-platform spec describes the outcome.

Backwards compatibility

Compatible: the same pins are retried at the same time from the same ledger state; only the log level, the line count and the outcome label in the boot's Built-in adoption: {...} INFO line change.

Removes nothing: no path, record, key or retry is taken away.

Tests

  • test_a_pending_outside_edit_logs_one_warning_and_adopts_once_resolved: with config.json pending review, the boot returns waiting_for_review, logs exactly one WARNING with no trace, naming the app and config.json, keeps the trace at DEBUG, leaves the ledger staged with 0 attempts and the built-in in place; after a Discard the next boot adopts.
  • test_a_pending_outside_edit_records_no_nav_and_logs_no_warning: an adopted app whose nav record is missing logs no warning while the review is pending, and its nav is recorded once the review is resolved.

Proof: PROVEN test/test_builtin_adoption_apply.py::test_a_pending_outside_edit_logs_one_warning_and_adopts_once_resolved, test/test_builtin_adoption_apply.py::test_a_pending_outside_edit_records_no_nav_and_logs_no_warning (head 6c60319)

Determinism: the two new tests passed 20 of 20 runs at -n0, in a hand-reordered run (new tests first and last), and the whole file passed at -n 4 --dist loadgroup. The 16 test files that exercise built-in adoption passed: 475 passed, 2 skipped. The flake-pattern ratchet passed.

Manual verification

N/A: unit coverage drives the real config writer against a real pending config.json, which is the boot path the logs came from.

Related Issues

Part of #26967

Sibling sweep

Swept: git grep -n "mutate_trust_settings|mutate_agent_marker" -- src/kiro_crew/apps/
Sibling: src/kiro_crew/apps/builtin_adoption_apply.py:652 -- changed here
Sibling: src/kiro_crew/apps/default_installs.py:367 -- not affected -- it already logs one line with no traceback and retries next boot
Sibling: src/kiro_crew/apps/local_trust_switch.py:216 -- not affected -- a person's own action, not a boot pass, and its handler answers the refusal

Pattern harvest

Rule candidate: review-prompt
Pattern: a boot pass that writes a protected config file must classify PendingEditBlocksSave as an expected wait, not let it reach a logger.exception catch-all.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 13, 2026 11:32
@bolichen97
bolichen97 enabled auto-merge (squash) November 13, 2026 11:32
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 6c6031935eb4da7fafaed3d574b18c0dd117c5ca 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 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 6c6031935eb4da7fafaed3d574b18c0dd117c5ca — 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

Nothing blocks. The fix classifies PendingEditBlocksSave where apply_all catches it, so a pending config.json review no longer reaches the logger.exception catch-all. Retries and ledger state are unchanged, and the new tests show the defect on base.

What this change ships

Inventory (5 items) — 5 justified

Intent: While a hand edit to config.json waits for review, each gateway start should log one clear warning instead of an ERROR traceback per app. This is a FIX.

  1. Each gateway start logs one WARNING that names the waiting apps, the pending file and the remedy (Apply or Discard), instead of one ERROR traceback per app — justified
  2. The boot's Built-in adoption: {...} INFO line shows waiting_for_review instead of error for these apps — justified
  3. Each refusal's traceback now goes to DEBUG — justified
  4. A nav record held back by the pending review is logged at DEBUG, no longer as a WARNING with a traceback — justified
  5. The app-kit-platform spec describes the waiting_for_review outcome — justified

[FIRST-PRINCIPLES-REVIEWED] 6c60319

Description read

[DESCRIPTION-READ] bebbe12fbe07b6b37a561b94024463c1d9fae9e0136dc853073145096728ffb0

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 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the boot pass now handles the expected pending-review refusal as a wait, with no change to retries or ledger state, and only the log output changes.

[DESIGN-REVIEWED] 6c60319

Description read

[DESCRIPTION-READ] 46dd6276b681d297109293aa8d0f5f498066322f30246f69190715248c445629

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 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 6c60319

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

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

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 6c60319

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

@bolichen97

Copy link
Copy Markdown
Contributor Author

Backend Tests (3.12, 7) red on 0dfa79b is test/test_denied_commands_security_cost.py::TestSelfModuleIndexIsLinear::test_the_scan_is_linear_not_quadratic (2k tokens took 0.521s against its 0.5 s wall-clock bound), the loaded-runner flake tracked in #28212. This diff does not touch the deny gate. The first attempt of the same job was a lost self-hosted runner. Re-running the failed jobs once.

@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 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

The re-run of Backend Tests (3.12, 7) on 0dfa79b went red on two different tests, neither near this diff: test/test_testing_determinism_helpers.py::test_the_helper_modules_import_without_pytest (a subprocess TimeoutExpired) and test/test_transcribe.py::TestPcmFromWav::test_other_sample_widths_defer_to_ffmpeg[4] (xdist worker gw1 crashed). Every other test in the shard passed (31412 passed). The same shard also lost its self-hosted runner on another PR's head this hour, so this reads as an overloaded shard-7 runner, not this change. No further push here; the next re-run of that one job should clear it.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/config.md, src/kiro_crew/apps/routes_enable.py, src/kiro_crew/dashboard/handlers/computer_use.py, test/test_apps_routes_coverage_enable_disable.py, test/test_registry_refresh.py and 6 system-spec docs since this head went green (a45e97a -> 1ca713c); CI re-running.

@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 13, 2026
@KiroCrewCaptain

KiroCrewCaptain commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates a 7% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

Log-only fix: the APPLY pass now catches PendingEditBlocksSave as a waiting_for_review outcome. The config writer refuses before anything is written, so the grant and marker write leaves no partial state, and the ledger is untouched as on main. One WARNING replaces one ERROR traceback per app. CancelledError and PlatformCompositionError are still re-raised. The only consumer of the outcome dict is an INFO log line. Two new tests drive a real pending config.json, would fail on main, and confirm adoption and nav recording resume after Discard. The spec paragraph matches the code.

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 6c6031935e · 88 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Backend Tests (3.12, 7) red on 275d6e7 is test/test_denied_commands_security_cost.py::TestSelfModuleIndexIsLinear::test_the_scan_is_linear_not_quadratic (2k tokens took 0.522s against 0.5 s), the loaded-runner flake #28212. This diff does not touch the deny gate. Coverage Gate follows from that shard. Re-running the failed jobs once.

@bolichen97

Copy link
Copy Markdown
Contributor Author

The re-run of Backend Tests (3.12, 7) on 275d6e7 did not reach a test verdict: its self-hosted runner ran out of memory (the job annotation reads Out of memory., the log blob is missing and every step after setup has no conclusion). That is a lost runner, not a red test, so it gets its own single re-run of the failed jobs. Coverage Gate follows from that shard.

@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 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

The lost-runner re-run of Backend Tests (3.12, 7) on 275d6e7 lost its self-hosted runner again (The self-hosted runner lost communication with the server.), so no test verdict exists for this shard on this head. Across this PR's heads that shard has now failed on a lost runner three times and on unrelated recorded flakes (#28212, #36407, #36408) three times, every other shard green. I am not re-running it again; the next re-run should wait until the shard-7 runner pool is healthy.

@bolichen97
bolichen97 force-pushed the fix/adoption-pending-edit-noise branch from 275d6e7 to 4e1a52d Compare November 13, 2026 19:10
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/app-kit-platform.md and 64 other files in the same directories since this head went green (1ca713c -> 39fd360); CI re-running.

The patch is byte-identical after the rebase (new head 4e1a52d). Locally on the rebased tree: the 9 built-in adoption test files pass (333 passed, 1 skipped), the flake-pattern ratchet passes, and the black, isort, flake8, mypy, comment-history, brand and line-cap gates pass. prove.py re-proved both new tests on 4e1a52d, and the body's Proof: line names that head.

Backend Tests (3.12, 7) and Coverage Gate on 275d6e7 never reached a test verdict, because the self-hosted runner ran out of memory. That is the shard-7 runner problem tracked in #36261, with the fix in #36653, which is still open. It is not this diff. The rebase gives the shard one fresh run; if it loses its runner again, it waits for #36653.

While config.json has a change made outside Kiro Crew pending review,
every trust write the built-in adoption APPLY pass makes is refused
with PendingEditBlocksSave. The pass caught it as an unexpected error
and logged a full traceback at ERROR for each pinned app on every
boot, although nothing is wrong: the built-in keeps running and the
staged ledger is retried at the next start.

Treat that refusal as the expected state it is. The pin's outcome is
waiting_for_review, its ledger is left untouched, and the pass logs one
warning naming the pending file and every waiting app, with each trace
at DEBUG. Recording the legacy nav of an already adopted app waits the
same way, at DEBUG only.

Part of #26967
@bolichen97
bolichen97 force-pushed the fix/adoption-pending-edit-noise branch from 4e1a52d to 6c60319 Compare November 13, 2026 22:51
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main 6d61070 to pick up the Coverage Gate red-main fix #36804 (agent_ipc_client.py per-file floor; not this diff). Old head 4e1a52d's other reds were the installation-token rate limit (Dependency License Gate, Publish readiness signal, GPT pass-2 unpublished) and the CodeQL actions upload; new head 6c60319 re-runs them. Diff unchanged; prove.py re-run: PROVEN at 6c60319.

@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 13, 2026

@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.

Review of this head:

  • A refused config write now reaches the new except PendingEditBlocksSave arms in apply_all and _record_missing_nav.
  • CancelledError and PlatformCompositionError are still re-raised ahead of the new arms.
  • The ledger stays (staged, 0) while the review is pending.
  • The only reader of the outcome label is the boot INFO log.
  • The two new tests pass, and removing any of the new except arms, the aggregate warning, the leaf collection or the DEBUG trace makes one of them fail.

Done well: the tests use the real config writer against a real pending config.json, and they also prove the recovery half: after Discard, the next boot adopts the app.

Optional:

  • The tests only cover one pin. A per-pin warning would still pass. Adding a second pin and asserting one WARNING that names both apps would cover the "one warning per pass" claim.
  • _rollback (builtin_adoption_apply.py:564) still logs an ERROR traceback for the same refusal on the rare crash-recovery path. You could route it to DEBUG the same way, or say in the sibling sweep why it stays.
  • The new spec paragraph says "the built-in keeps running". That is not true when finalize_marker refuses after the swap, where the swapped record keeps running until the next boot finalizes it.

@bolichen97
bolichen97 merged commit 4579388 into main Nov 14, 2026
137 of 143 checks passed
@bolichen97
bolichen97 deleted the fix/adoption-pending-edit-noise branch November 14, 2026 01:21
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 14, 2026
buluoray pushed a commit that referenced this pull request Nov 14, 2026
…#36586)

While config.json has a change made outside Kiro Crew pending review,
every trust write the built-in adoption APPLY pass makes is refused
with PendingEditBlocksSave. The pass caught it as an unexpected error
and logged a full traceback at ERROR for each pinned app on every
boot, although nothing is wrong: the built-in keeps running and the
staged ledger is retried at the next start.

Treat that refusal as the expected state it is. The pin's outcome is
waiting_for_review, its ledger is left untouched, and the pass logs one
warning naming the pending file and every waiting app, with each trace
at DEBUG. Recording the legacy nav of an already adopted app waits the
same way, at DEBUG only.

Part of #26967

(cherry picked from commit 4579388)
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.

2 participants