Skip to content

refactor(apps): report a dropped installed record from apps.manager - #12223

Merged
iamwhatever merged 1 commit into
mainfrom
fix/config-rebuild-skip-semantics-12169
Sep 20, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/config-rebuild-skip-semantics-12169

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

_app_owned_mcp_keys in src/kiro_crew/agent.py works out which {app}:{server}
names installed apps claim, and whether that read saw every claim, by walking the
apps directory itself. To do that it had to reconstruct four rules that
apps.manager owns: the installed-record filename, the occupied-entry test, the
junction probe, and which root entries list_apps skips.

It reconstructed them because list_apps reaches if not meta: continue for a
record that does not read and drops the app silently rather than raising, so its
return value cannot separate "no app is installed under that name" from "that
app's record went unread". A caller that needs the two apart had no way to ask.

A second defect sits in the same read, and this PR closes it too. When the apps
root is not a directory, nothing under it can be enumerated, so every installed
app's record is unreachable at once -- and the read answers COMPLETE anyway. An
app missing from a complete listing means "not installed", so the rebuild treats
every claimed name as unclaimed on exactly the input where it knows least. Main's
agent.py already answers this way (_root.is_dir() and any(...) yields
skipped=False), so this is behaviour inherited rather than introduced here.

Why it matters

The reconstruction was a mirror of another module's rules with no test in the
owner's suite. apps.manager could change its record layout or its skip
behaviour and nothing in test/test_app_manager.py would fail; the copy in
agent.py would simply start answering the old question.

Its failure lands on the unrecoverable side. The completeness flag would read as
fully-read when it was not, so a name no live claim mentions is treated as
genuinely unowned and its mcpServers entry is pruned. A pruned entry is not
re-added: the rendered config is the merge base for the next rebuild, so the
server stops being offered until someone re-declares it by hand. The tri-state
read exists precisely to hold the grant on a read fault, and a stale mirror
defeats it silently.

The asymmetry is sharp today: _absence_is_genuine -- the rule the agent-side
copy cites by name in its own comment -- is covered at test_app_manager.py
where it is defined, and was covered nowhere where it was mirrored.

What changed (motivation -> approach -> change)

The issue named two remedies and they are not equivalent. Widening list_apps's
return shape would reach 29 call sites in src/ and 40 references in test/,
every one of which consumes a plain list[dict] today, to serve one caller. So
this adds a purpose-built read instead and leaves list_apps untouched.

apps.manager gains list_apps_with_skips() -> AppsListing, a NamedTuple of the
same rows list_apps returns plus complete, which is False when an entry in the
apps root stood for an app the listing dropped. The walk and its two predicates
move out of agent.py and sit beside _absence_is_genuine, whose fail-to-unknown
direction they follow.

agent.py consumes that answer. The split follows the module boundary: the rules
about the apps directory belong to apps.manager, and the MCP alias minting and
enablement composition stay in agent.py, which owns those. The agent-side copy
is deleted rather than kept in agreement with a ratchet, so there is no second
implementation left that could drift.

What the read decides is unchanged in every case but one. The deliberate residue
it keeps: a plain file beside the app directories is not a dropped app, because it
cannot be told apart from an ordinary non-app file and counting every one would
hold the listing permanently incomplete.

The one case that changes is the non-directory apps root (#12248). It now reports
incomplete when something OCCUPIES the root, and still reports complete when the
root is simply ABSENT. Presence is judged without resolving, by the same
_path_is_occupied predicate the record-level check uses, so a dangling link and a
Windows junction are seen rather than read as absence.

A plain file counts at the root while it does not count one level down, and the
position carries that argument rather than the shape: a file beside the app
directories is an ordinary member of a healthy apps root, whereas a file standing
where the root belongs has replaced the whole directory and no healthy
installation looks like that.

Backwards compatibility

Compatible: list_apps keeps its signature, its return type and its behaviour,
so none of its callers are touched; list_apps_with_skips and AppsListing are
additions.

One behaviour change, which is the #12248 fix: _app_owned_mcp_keys now reports an
incomplete ownership read when the apps root is occupied by a non-directory, where
it reported a complete one. Every other input returns the same _AppOwnership
values, which is what the unchanged agent-side tests pin.

What that changes downstream is asymmetric, and deliberately so in agent.py: an
incomplete read keeps a mount reference, because dropping one can unmount a server
for good, while an auto-approve grant still requires a positive answer and is not
kept on doubt. So the fix stops a server being unmounted over a root nobody could
read, without leaving an auto-approval on a name.

The only reachable state it newly refuses to be certain about is an apps root that
exists and is not a directory, which no healthy installation has.

Tests

New in the owner's suite, test/test_app_manager.py::TestListingReportsWhatItDropped
(14 cases), so the skip report cannot go stale without failing where the rules
live:

  • a healthy listing reports itself complete, and hands back exactly what
    list_apps returns
  • a record that does not parse, an unreadable record, a dangling record link, and
    a junction-shaped record are each reported as a skip
  • a dangling app-root link is reported as a skip, one level up where the listing
    skips a non-directory
  • a directory with no record at all, and a plain file beside the app directories,
    are each NOT a skip -- the boundary that keeps the listing from being
    permanently incomplete
  • no apps root at all is a complete listing of nothing, and a root REPLACED by a
    file, by a dangling link, or by a junction shape is reported incomplete -- the
    apps listing reports COMPLETE when the apps root is not a directory #12248 fix, pinned against that absent-root boundary
  • a root that raises mid-walk is reported incomplete while keeping the rows it
    already read

Unchanged and passing: the 13 agent-side cases in
test/test_agent.py::TestToolBloatFixes that pin the mount and grant behaviour
under a partial ownership read. This is a move of the read, so they were not
edited.

Mutation-verified, each red an AssertionError about the value:

mutation killed
skip report removed (dropped forced False) 6 owner-suite + 2 agent-side
presence resolves the path (exists() only) 2 owner-suite + 1 agent-side
agent ignores the reported skip 2 agent-side

For the #12248 fix, mutated separately against the four root cases, restoring from
a file copy and asserting each marker matched. Baseline unmutated: 4 passed.

mutation killed of the 4 root cases
root always reads complete (the reported defect) 3
presence resolves the path (exists() only) 2
absent root reads incomplete too 1

The third is the both-directions check: it fails only the absent-root case, which
shows the fix is conditional on the root being occupied rather than a blanket flip
of every non-directory root.

The first is the check the issue asked for: removing the skip report fails the
agent-side completeness tests, so the new API is load-bearing. The third isolates
the consumption. The three kill different, non-identical sets, so the tests are
independent rather than one assertion firing three times. The unwalkable-root case
also asserts its own precondition (that the completeness walk ran), which is what
caught the short-circuit under mutation one.

Local: test/test_app_manager.py + test/test_agent.py 459 passed with -n0.
Gates: flake8, isort, mypy, check_black_formatting.py,
check_comment_history.py, check_loop_bound_locks.py, check_brand_name.py,
check_subprocess_encoding.py all clean.

Manual verification

N/A -- unit coverage sufficient. The change has no user-visible surface, and the
paths it decides are filesystem shapes (dangling links, unparseable records,
junctions) that the tests construct directly.

Related Issues

Closes #12169
Closes #12248

Pattern harvest

Rule candidate: review-prompt

Pattern: a module reconstructs another module's skip or occupancy rules because
the owner drops a record silently, so the copy has no test in the owner's suite
and goes stale without a failure.

Any other suggestions on the work

The residue this description previously deferred is fixed here instead, as
#12248: an occupied non-directory apps root now reports an incomplete listing. The
absent-root case keeps reporting complete, since nothing being installed is a real
answer rather than a doubt.

One residue genuinely remains and is not worth closing: a plain file standing where
a single app's directory belongs is still not counted as a dropped app. Unlike the
root, that position has an ordinary innocent occupant, so counting it would hold
every normal listing incomplete and cost every caller that reads completeness as
doubt. It is documented at the predicate.

@chenmingwei23
chenmingwei23 requested review from a team and bolichen97 September 20, 2026 07:00
@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: checking Automated validation is still running labels Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of f74087825865e5c33ca027af1c316f25e84d716d and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f740878

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f74087825865e5c33ca027af1c316f25e84d716d: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of f74087825865e5c33ca027af1c316f25e84d716d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] f740878

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

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

Review details

The refactor preserves behavior exactly: is_link_or_junction, apps_dir, and INSTALLED_META_FILENAME all resolve in manager.py; the 2-field NamedTuple unpacks correctly at agent.py:4390; list_apps() is called outside the inner try, so a raise propagates to agent.py's except → _AppOwnership(owned, False) exactly as before; the inner walk fault returns complete=False → fully_read=False, matching the old _skipped=True. The one intentional change (occupied non-directory root now yields complete=False) moves toward the conservative retain-grants direction and is test-covered. Nothing survives falsification.

No findings.

[OPUS-REVIEWED] f740878

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable f74087825865e5c33ca027af1c316f25e84d716d: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of f74087825865e5c33ca027af1c316f25e84d716d — 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/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The drift the description names has one counted sibling left: dashboard/handlers/agents.py still rebuilds the skip rules itself, and now disagrees with the owner's read.

Not justified as shipped

  • Item 2 — point patch, 1 unfixed sibling: the root cause named ("a caller that needs the two apart had no way to ask") has a second instance — grep INSTALLED_META_FILENAME outside apps/manager.py finds exactly one: src/kiro_crew/dashboard/handlers/agents.py:708, whose walk (lines 670–731) reconstructs the record filename and its own shape screens for the same {app}:{server} ownership job, and treats a dangling app-root link as definite absence (line 685–691) where the new _entry_stands_for_a_dropped_app counts it as a dropped app — the exact divergence-between-mirrors harm this PR's description names. Serving it needs a read that names the dropped app, so this is accepted-and-deferred, not a demand.
    Subtraction: later, delete the reconstruction in dashboard/handlers/agents.py:670-731 by consuming a manager-owned read.
    Clears when: that walk consumes a manager-owned read, or evidence (its own pin or issue) shows its dangling-link answer is deliberately different.

What this change ships

Inventory (4 items) — 3 justified

Intent: FIX — stop the ownership rebuild pruning an app's MCP grant over an apps directory it couldn't actually read, by letting apps.manager report what its listing dropped.

  1. apps.manager can now say its listing dropped an installed app (list_apps_with_skips; 1 consumer, grepped) — justified
  2. The agent's rebuild asks the manager instead of walking the apps dir; its copy of the rules is deleted — point patch, 1 unfixed sibling (dashboard/handlers/agents.py:708)
  3. An apps root occupied by a non-directory now reads incomplete, keeping the mount ref (apps listing reports COMPLETE when the apps root is not a directory #12248; defect readable in the deleted _root.is_dir() and any(...) hunk) — justified
  4. 14 owner-suite tests pin the skip report where the rules live — justified

[FIRST-PRINCIPLES-REVIEWED] f740878

@chenmingwei23
chenmingwei23 force-pushed the fix/config-rebuild-skip-semantics-12169 branch from e9c4919 to 1b4aa28 Compare September 20, 2026 08:47
@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 Sep 20, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Disposition of the advisory findings

Both advisory lanes on e9c49195a6a5f09797683b1ca1ee97ceea789435 asked for the
same thing: confirm the residue this description discloses gets the follow-up it
offers, so the documented gap does not evaporate at merge.

It is filed as #12248. An apps root that exists and is not a directory is reported
as a COMPLETE listing of nothing, where "unknown" is the truthful answer; that
issue names the branch, the direction of the fix, and why the absent-root case
must not be collapsed into it. The residue stays documented in the code here and
the behaviour is unchanged by this PR, which is a relocation.

Design Review (Fable 5): PASS, no blocking findings. Handled, see above.
First Principles Review (Fable 5): PASS, no blocking findings. Handled, see above.
GPT 5.6: no blocking findings. Opus 4.8: no blocking findings.

The one required fix in this head

The Comment History Gate blocked the previous head on a real finding of mine:

test/test_app_manager.py:2558: used to

The test class docstring described where the walk had sat rather than stating
present behaviour. It is rewritten to say why the tests belong beside the rules
they pin. The other two reds were downstream of that single failure: Await Fast
Gate reports "the heavy jobs are skipped on purpose" when the fast gate fails,
and Coverage Gate then fails closed on frontend-test=skipped.

Local on this head: 459 tests pass in the two affected files, and every gate is
clean including the comment-history gate run with an explicit base ref so it
enforces rather than reports. The branch is rebased onto the current main tip;
the diff is unchanged at 312 insertions and 55 deletions across the same three
files, with zero overlap against everything main gained.

@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 Sep 20, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Disposition of the advisory findings on 1b4aa283000e6d6516d60f61fa2be53253d8a5a5

All four lanes re-ran on this head and none blocks: GPT 5.6 no findings, Opus 4.8
no findings, Design PASS, First Principles PASS. Two advisory asks, both handled.

Design: file the follow-up issue for the fail-open residue. Filed as #12248. An
apps root that exists and is not a directory is reported as a complete listing of
nothing, where the truthful answer is unknown; that issue names the branch, the
direction of the fix, and why the absent-root case must not be collapsed into it.
It is held out of this PR because it is a behaviour change rather than a
relocation, and it stays documented in the code here.

First Principles: confirm #12169 names this defect and the rejected
list_apps-widening remedy.
Checked, and the issue was one line short of it.
It names the defect precisely and offers both candidate remedies, but it did not
record which was taken or why the other was declined. Added as a comment on
#12169: the sibling-accessor remedy was taken, and widening list_apps was
declined on call-site count, around 29 call sites across 19 source files, all of
which would change to serve one caller that needs the extra answer. The issue is
now complete provenance on its own.

Board on this head

Deduped to the newest attempt per lane: 88 lanes, 56 success, 11 skipped, zero in
the failing set, 21 still in flight (backend and Windows shards, desktop builds,
offline E2E). PR Readiness is pending on those. mergeable is true; the blocked
state is the required review, not a check.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

The one red on this head is not from this change

Backend Tests (Windows) (1) fails with four tests, all in
test/test_acp_runtime.py:

test_kill_amends_the_summary_once_the_reap_completes[False-WARNING]
test_kill_amends_the_summary_once_the_reap_completes[True-INFO]
test_reap_amendment_leaves_the_reason_untouched
test_reap_amendment_leaves_the_stderr_tail_untouched

Each asserts a POSIX signal returncode in the kill summary and reads
[returncode=<not reaped>] instead, which is what Windows produces. Tracked on
main as #12247.

Why it is not this change:

Nothing available here moves it. Re-running replays the merge ref resolved when
the run was created, so it cannot pick up a later fix, and the assertion is
deterministic rather than timing-dependent. There is no fix on main to rebase onto
yet. Folding another change's fix into this one is not on the table either.

Everything else on this head is green: 90 lanes, 78 success, 11 skipped, nothing
in flight, and all four review lanes pass on
1b4aa283000e6d6516d60f61fa2be53253d8a5a5 with no blocking findings.
mergeable is true.

This PR is complete on its own terms and waits on the main-side fix for #12247
before PR Readiness can pass.

@chenmingwei23
chenmingwei23 force-pushed the fix/config-rebuild-skip-semantics-12169 branch from 1b4aa28 to 435b547 Compare September 20, 2026 10:15
@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 Sep 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/config-rebuild-skip-semantics-12169 branch from 435b547 to 95585e1 Compare September 20, 2026 10:46
@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 Sep 20, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

The blocking finding on 435b547db9848e894b4d77753a9e3bb2c3a47a13 is fixed

GPT was right and the adjudication was right. test_a_root_that_cannot_be_walked_is_reported_as_incomplete counted Path.iterdir calls and failed the second one, but list_apps calls detect_orphaned_builtins at manager.py:1990 before its own walk at manager.py:1991, and that helper walks the root whenever its module-global cache is cold (manager.py:3473, early return at 3484). On a cold worker the fault therefore landed inside list_apps() itself, which list_apps_with_skips calls at line 2118, OUTSIDE the completeness try at 2119, so the OSError propagated and the test errored instead of asserting.

Reproduced before fixing, running that test alone in a fresh process so the cache is cold by construction: the ordinal version fails, the new version passes, and the file was restored byte-identically afterwards.

The fix targets the walk by WHEN it happens rather than by its ordinal. list_apps is wrapped so the real one still reads the rows, and the fault is armed only after it returns and only for the apps root. That closes the same hole as stubbing detect_orphaned_builtins, and it does not depend on knowing every walk list_apps performs internally, so a future callee that walks a path cannot silently move the target again. The precondition assertion now reads whether the fault actually fired rather than a count.

Advisory findings

Design: have list_apps delegate to the walk in list_apps_with_skips, recording drops inside a single loop. Noted and not taken here. It is the better end state and would remove both the mirror and the list-then-rewalk window, but it rewrites the body that every one of list_apps's ~29 call sites depends on, which is the opposite of this change's premise: add a sibling, touch no caller. Worth its own change, where that risk can be reviewed on its own terms instead of riding a relocation.

First Principles: verify #12248 actually reports the non-directory apps-root misread. It does. #12248 is titled "apps listing reports COMPLETE when the apps root is not a directory", and its body names the branch, the pruning consequence and the direction of the fix. It also carries a correction, because the description originally said an incomplete read leaves the grant in place: agent.py keeps a mount reference on an incomplete read but still requires a positive answer before keeping an auto-approve grant.

The remaining red

Backend Tests (Windows) (1) is the main-owned test_acp_runtime regression from b785dcc, tracked as #12247 and attributed in an earlier comment.

Backend Tests (Windows) (7) failed once on the previous head, with a single unrelated test: test_runtime_cleanup_windows.py::test_windows_owner_shutdown_reclaims_children_after_root_exit. That file is outside this diff and byte-identical to current main, its assertion is a 10-second wall-clock poll for Windows to reclaim spawned children, and it passed on the head before this one and on #12144 and #12131. This push re-runs it, which is the cheapest way to tell a timing failure from a real one, so it is not being filed on a single observation.

@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 Sep 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/config-rebuild-skip-semantics-12169 branch from 95585e1 to fc54b09 Compare September 20, 2026 11:15
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention 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 Sep 20, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Disposition on fc54b09bc31d15480505916aa66ce8737c213215

All four lanes pass on this exact head with no blocking findings: GPT 5.6 and Opus 4.8 report none, Design and First Principles both PASS. Two advisory asks, both answered here rather than in a new commit, since amending would discard a green board for prose.

Design: is the #12248 behavior fix intended to ship in a refactor:-typed commit rather than its own fix: PR? Intended, and the type is the weaker half of a deliberate trade. The behavior change is one branch of the function this PR moves, and it is only decidable once that walk has an owner: before the move, the same answer was produced inside agent.py by _root.is_dir() and any(...), where there was no single place to correct it. Splitting it into a second PR would mean shipping the relocation with a known fail-open branch intact, then reopening the same function a day later. The commit subject undersells that, and I am leaving it: the body, the tests and this thread all name the behavior change explicitly, and re-typing the subject would cost the board a full re-roll of four non-deterministic review lanes to change a word. Worth retyping if a maintainer wants it before merge, which is a cheap ask at that point.

First Principles: confirm #12248 records the non-directory-root defect. Confirmed. #12248 is titled "apps listing reports COMPLETE when the apps root is not a directory", and its body names the branch, the pruning consequence and the direction of the fix. It also carries a correction I posted against my own description there: an incomplete read keeps a mount reference, but an auto-approve grant still requires a positive answer and is not kept on doubt.

Board

90 lanes deduped to the newest attempt per lane: 79 success, 11 skipped, nothing in flight, nothing in the failing set. PR Readiness success, both CodeBuild contexts success, combined status success, mergeable true. The blocked state is the required human review, not a check.

Two lanes had to be unwedged to get here, neither by touching the head. Fast Gate run 35507337511 sat queued 75 minutes with 8 jobs green and 4 never allocated, so Await Fast Gate failed closed at 723s and Coverage Gate failed closed behind it; the fleet was healthy at the time (100 runs created in the preceding 40 minutes, one queued, another branch's Fast Gate going creation-to-success inside a minute), so it was a single wedged allocation rather than a queue position. A queued run refuses gh run rerun, but cancelling first makes it legal and attempt 2 allocated all 12 jobs at once and passed. The dependent CI run was then re-run in full rather than --failed, because its matrix jobs were skipped rather than failed. The macOS Tests (on demand) gate was wedged the same way since 11:15 and cleared the same way.

Not merging or approving. Review-ready is the handoff.

The agent config rebuild re-derived apps.manager's skip rules to tell an
unclaimed MCP server name from one whose owner went unread. list_apps drops
an app whose installed record does not read, silently rather than raising, so
a caller that needs the two apart had to walk the apps directory itself and
reconstruct the record filename, the occupied-entry test and the junction
probe. That mirror had no test in the owner's suite, and its failure prunes a
mount ref nothing re-adds.

list_apps_with_skips returns the same rows plus whether the listing dropped
an app that is on disk. The walk moves into apps.manager beside
_absence_is_genuine, so there is no copy left to go stale, and the owner's
suite now pins the skip report.
@chenmingwei23
chenmingwei23 force-pushed the fix/config-rebuild-skip-semantics-12169 branch from fc54b09 to f740878 Compare September 20, 2026 13:50
@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: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Sep 20, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Disposition of the CONCERNS on f74087825865e5c33ca027af1c316f25e84d716d

First Principles is right about the fact and I am taking its own deferral, with the evidence it asked for filed as #12306.

The fact, verified. dashboard/handlers/agents.py does reach its FileNotFoundError branch for a dangling app-root link and treat it as a definite absence, and its own comment says so: "a DANGLING link lands here too -- unlike the metadata screen below, that is a definite answer rather than an unreadable one". The owner's _entry_stands_for_a_dropped_app counts that same shape as a dropped app. The two answers differ.

What this PR did to that divergence: nothing. On current main, agent.py::_entry_hides_a_claim returns _e.is_symlink() or is_link_or_junction(_e) for a non-directory entry, which is the same answer the relocated predicate gives. So the ownership read already disagreed with the dashboard walk before this change; the relocation moved one side of an existing disagreement into the module that owns the rules. It did not create it, widen it, or change any answer on that path.

Why it is not folded in here. The reviewer names the reason itself: serving that caller needs a read that names the dropped app, and AppsListing.complete deliberately does not, because the dropped record is exactly the thing that could not be read. So the fix is a new owner-side read plus a rewrite of a second handler's walk, in a module this PR does not touch, with its own fail-loud contract (AppOwnershipUnreadable) and a different consequence: that walk decides whether an app's bridges may be deleted, where this one decides whether an mcpServers grant may be pruned. Different blast radius, so the fail direction is a decision to make on its own evidence, not a rider on a relocation.

#12306 records the divergence, both sites, and the two ways to clear it: have the dashboard walk consume a manager-owned read that names the dropped entry, or pin its different answer with a test stating why a dangling link is a definite absence there. That is the "its own pin or issue" branch of the reviewer's own Clears-when clause.

Worth noting that this same lane read the same file the other way on an earlier head, calling it "not a stale-mirror sibling" because it imports the owner's constant and fails loud. Both readings are defensible on their own terms; #12306 is where the question gets settled with evidence rather than re-sampled.

Board on this head

green_age: base +0 commits (2f11434b -> 2f11434b), overlap: none -- STATUS: FRESH. That gate is what rejected the previous green, and it is the reason this head exists.

90 lanes deduped to the newest attempt per lane: 79 success, 11 skipped, nothing failing, nothing in flight, and the buckets sum to the lane count. All eight Windows shards pass, including shard 1, which carried the test_acp_runtime reds now cleared by the rebase onto #12269, and shard 7, whose reclamation timeout was timing. PR Readiness success, both CodeBuild contexts success, combined status success, mergeable true. GPT 5.6, Opus 4.8 and Design all report no blocking findings on this exact sha.

Not merging or approving. Review-ready is the handoff.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

The fact checks out. src/kiro_crew/dashboard/handlers/agents.py reaches its FileNotFoundError branch for a dangling app-root link and treats it as a definite absence, and its own comment says so in as many words. The owner's _entry_stands_for_a_dropped_app counts that same shape as a dropped app. The two reads disagree.

What this change did to that disagreement is nothing. On current main, agent.py::_entry_hides_a_claim returns _e.is_symlink() or is_link_or_junction(_e) for a non-directory entry, which is the same answer the relocated predicate gives. The ownership read already disagreed with the dashboard walk before this change; the relocation moved one side of it into the module that owns the rules, and altered no answer on that path.

Why it is not fixed here. The item names the reason itself: serving that caller needs a read that names the dropped app, and AppsListing.complete deliberately does not, because the dropped record is exactly the thing that could not be read. So the fix is a new owner-side read plus a rewrite of a second handler's walk, in a module this PR does not touch, which has its own fail-loud contract and a different consequence: that walk decides whether an app's bridges may be deleted, where this one decides whether an mcpServers grant may be pruned. Different blast radius, so its fail direction is a decision to take on its own evidence rather than as a rider on a relocation.

Issue #12306 records the divergence, both sites, and both ways to retire it: have the dashboard walk consume a manager-owned read that names the dropped entry, or pin its different answer with a test stating why a dangling link is a definite absence there.

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

Approved on the current head: CI green, readiness passed, no security-sensitive path in the diff.

@iamwhatever
iamwhatever enabled auto-merge (squash) September 20, 2026 17:05
@iamwhatever
iamwhatever merged commit e66f12a into main Sep 20, 2026
93 checks passed
@iamwhatever
iamwhatever deleted the fix/config-rebuild-skip-semantics-12169 branch September 20, 2026 17:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 20, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…irodotdev#12223)

The agent config rebuild re-derived apps.manager's skip rules to tell an
unclaimed MCP server name from one whose owner went unread. list_apps drops
an app whose installed record does not read, silently rather than raising, so
a caller that needs the two apart had to walk the apps directory itself and
reconstruct the record filename, the occupied-entry test and the junction
probe. That mirror had no test in the owner's suite, and its failure prunes a
mount ref nothing re-adds.

list_apps_with_skips returns the same rows plus whether the listing dropped
an app that is on disk. The walk moves into apps.manager beside
_absence_is_genuine, so there is no copy left to go stale, and the owner's
suite now pins the skip report.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants