Repository navigation
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Reuses the resolver the runtime spawn already trusts ( [DESIGN-REVIEWED] c3ff8c5 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of All claims verified against the repo: First-Principles-Verdict: PASS Verify #7704 actually tracks the two remaining bare-name spawns ( Not justified as shipped
What this change shipsIntent: a support bundle from a host with a working off-
The fix sits at cause level (the resolution method, not the observed call site), uses the existing resolver rather than a second one (grepped [FIRST-PRINCIPLES-REVIEWED] c3ff8c5 |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/diagnostics.py:327 -- untrusted resolved binary runs without OS isolation (origin: validation) BLOCKING -- src/kiro_crew/diagnostics.py:323 -- resolver exceptions bypass containment [BLOCK-MERGE] c3ff8c5 Adjudication (Opus 4.8) — is blocking on each finding proportionate?The adjudicable block is empty (0 findings). Two fenced findings, F1 and F2, remain — annotate-only. F1 — F2 — False positive or not applicable? A repository writer can comment: |
98b1bcb to
4120fb7
Compare
|
Disposition of First Principles round-1 CONCERNS (verdict at 98b1bcb):
New head: 4120fb7 (rebased onto current main; 2 commits). |
4120fb7 to
d4307d3
Compare
|
Disposition of GPT 5.6 round-2 BLOCKING finding ("resolved user-bin candidate executes with gateway authority", at 4120fb7): Adopted — the environment half. The probe child now gets Declined — the revert. Reverting to the bare-name spawn reintroduces #7674 and does not remove the execution surface it names: on any host whose gateway PATH contains Declined — full sandbox routing. The audit's own posture for read-only probes (tailnet rationale in New head: d4307d3 (rebased onto current main; 2 commits — round-2 hardening amended into the review commit to hold the PR Hygiene cap). |
d4307d3 to
62b3aa3
Compare
|
Disposition of GPT 5.6 round-3 BLOCKING finding (at d4307d3): ADOPTED — the named fix, in full. The probe now routes through the audited chokepoint exactly as requested: Audit machinery updated in the same commit: the Guard evidence (all executed): a second sentinel test pins the wrapper to its FAIL-OPEN shape — on a sandbox-capable host the OS launcher itself scrubs the env, which would mask a probe that forgot to pass the returned New head: 62b3aa3 (rebased onto current main; 2 commits). |
62b3aa3 to
3e8f87e
Compare
|
Round-4 dispositions (new head 3e8f87e): GPT 5.6 BLOCKING (sandbox prep crashes diagnostics) — ADOPTED, and it went deeper than the named fix. Reproduced empirically on a real enterprise-profile install: Design CONCERNS (strict confinement can itself produce the misreport class) — CONFIRMED EMPIRICALLY, then fixed. On this real install the round-3 probe reported a working First Principles CONCERNS (false "only caller" claim; |
|
Opus 4.8 BLOCKING (at superseded head 62b3aa3) — same defect as GPT round-4, already fixed at current head 3e8f87e: the |
3e8f87e to
0d13b4f
Compare
0d13b4f to
5003e51
Compare
5003e51 to
9a9a14c
Compare
Audit note — #7826 is being closed in favour of this PRTwo independent adjudicators both ruled this the surviving implementation. What the two shared(1) src/kiro_crew/diagnostics.py, same hunk both sides: #7826 Why this oneYes — #7692 is the right survivor. It is the strict superset in production behaviour (non-zero-exit handling, broad containment, scrub_env child environment, run_limited ceiling), it moves the two riders #7826 leaves stale, it carries 6 mutation-checked tests versus 4, and it is the reviewed branch (Design PASS, First Principles PASS, Opus 4.8 clean, four documented review rounds) against #7826's zero reviews and unmet PR-template gate. The apparent counter-argument — #7692's open GPT 5.6 [BLOCK-MERGE] demanding a revert of the resolver-based spawn — does not favour #7826, because #7826 makes the identical resolver-selected spawn with none of the mitigations, so it inherits the same finding in a weaker form. That block is a merge-readiness question about the shared design, not a reason to prefer the unreviewed subset. What #7826 had that this PR does notPlease pick these up (or say they are not wanted): One test, worth porting but not blocking: #7826's From a repository-wide duplicate/overlap audit of every pull request open against |
The support-bundle version probe spawned the bare command name, so it resolved only through the collector process inherited PATH; when that PATH lacked the install directory the probe reported "unavailable" for a working install, in both versions.txt and the prefilled bug-report footer. Route the probe through kiro_cli.resolve_kiro_cli() (fixed install directories first), the same resolver the agent runtime spawn already uses, and spawn the absolute path it returns. "unavailable" now has exactly one producer (resolver found nothing); a resolved binary that fails to spawn or exits non-zero reports the distinct "present but not runnable" instead of collapsing onto "unavailable". Fixes #7674
Round 1 (First Principles, adopted subtraction): drop the three zero-consumer keyword-only test passthrough params; tests pin host layout by rebinding the module resolve_kiro_cli to the real resolver with fixed kwargs. Rounds 2-4 (GPT 5.6 + Design, converged empirically): the probe spawns via run_limited with a scrub_env() child environment — the resolver first candidates live in user-writable install dirs, so the child gets no inherited credentials and a kernel resource ceiling. The round-3 sandboxed_spawn_argv(mode=strict) route was REMOVED after empirical verification on a real install: wrap_argv resolves the governance sandbox floor, which raises PlatformCompositionError outside a booted gateway context (GPT round-4 crash finding, reproduced), and a working kiro-cli 2.21.0 then misreported as "present but not runnable" — the exact defect class this PR eliminates (Design round-4 concern, confirmed). Diagnostics must work precisely when the rest of the system is broken, so the whole spawn including preparation now sits in one broad Exception containment logged at DEBUG, with a regression test for raising spawn machinery.
9a9a14c to
c3ff8c5
Compare
|
Rebased onto main Conflicts: none. Clean rebase, both commits replayed, diff unchanged at +159/-14 across 4 files. Gates run locally (changed files only):
Please review the rebase result. A maintainer push makes the maintainer the last pusher, so under the repo's last-push rule a second approver is needed. Reply if anything looks wrong. |
|
Kiro Crew [operator: chenmingwei23#de330d0c]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
When you've addressed these, the pipeline will re-assess on its next cycle. |
|
Closing as superseded.
Nothing in this diff is still unique on Thanks for the diagnosis -- it is what the tracking issue was filed from. Reopen if you find a probe site still spawning |
Fixes #7674
Symptom
A diagnostics bundle from a host with a working Kiro CLI reports
kiro_cli_version: unavailableinversions.txt, and the prefilled bug-report footer showskiro-cli: unavailable— indistinguishable from "not installed". The motivating evidence is a bundle that contradicts itself: itsversions.txtsaysunavailablewhile its owngateway.log, same host and same collection, logs the gateway spawning the binary from the reporter's home.local/bin— the FIRST fixed entry inknown_kiro_cli_dirs().The triage cost is concrete: the false
unavailablewas named "the strongest remaining signal" in two separate re-triage passes on #3084, and supplied the sole evidence for #7233's "cause 2".Root cause
_kiro_cli_version()spawned the bare command name, so it resolved only through the collector process's inheritedPATH. When thatPATHlacks the install directory, the spawn raisesFileNotFoundErrorand theexcept (OSError, SubprocessError)handler returns"unavailable". The resolution METHOD is the defect: the repo already owns correct resolution inkiro_cli.resolve_kiro_cli(), which searches fixed install directories ahead of the inheritedPATH— — and the collector bypassed it. (A second bare-name version probe exists atslack/gateway.py:2380,_warn_if_kiro_cli_outdated; its silent-suppress symptom is tracked with the other siblings in #7704 and is out of this PR's scope.) (No claim is made about the specificPATHcontents on the reporter's host; what is proven is that the bare-name spawn failed while the binary sat in a fixed resolver directory.)Fix (smallest change,
_kiro_cli_version()only)resolve_kiro_cli()— the same resolver the agent-runtime spawn already uses (acp/client.py:297) — and spawn the absolute path it returns, with the capture/text/timeout/no-check arguments unchanged.resolve_kiro_cli() -> Noneis now the ONLY producer of"unavailable", so that string means genuinely not installed."present but not runnable"instead of collapsing onto"unavailable". The existing exception tuple stays as the containment boundary — the probe degrades to a string, never raises.resolve_kiro_clito the REAL resolver with fixedhome/environ/platform_namekwargs — the resolution logic stays under test with no shipped parameter surface (First Principles round-1 subtraction, adopted in the review commit).test/test_spawn_audit.pyBENIGN_SPAWNSrationale for this probe updated in the same commit ("binary name is a module constant" would otherwise be stale); the probe now trusts exactly what the runtime spawn already trusts.docs/system-specs/modules/*.mddocuments theversions.txtfield values (checked by grep), so no spec-doc update is required.Verification
Red before green — all four new tests fail on unmodified
main(run in agit worktreeatorigin/main): the decisive case plants a fake executable reachable ONLY through a fixedknown_kiro_cli_dirs()entry (a fake home's.local/bin, layout pinned through the real resolver) with a pinnedPATHthat excludes it — a bare-name spawn cannot see it. Green on this branch (4/4).Mutation checks — each direction executed with
sed, test run captured, then reverted:test_binary_absent_from_path_is_still_foundred ('kiro-cli 2.20.2' == 'kiro-cli 9.9.9'— the mutant resolved the test host's REAL install throughPATH, which is precisely the misreport class under fix).Nonebranch onto the found-binary path →test_nothing_resolved_is_exactly_unavailablered ('kiro-cli 2.20.2' == 'unavailable')."present but not runnable"onto"unavailable"→ both not-runnable tests red.Gates —
scripts/local-gate.py --base origin/main(backend-only diff plan: full backend + 194 frontend guard specs):scripts/check_black_formatting.py): passed. isort/flake8/mypy on touched files: clean.Zero-regression proof (both directions) — full backend suite on this branch vs a
git worktreeatorigin/main, sorted failing-id sets diffed:test_release_macos_fail_closed.py, which re-run solo fail IDENTICALLY on both trees (order/environment-dependent, unrelated to this diff).No frontend surface changes.
No screenshot evidence: this is a subprocess-resolution change in the diagnostics collector with no rendered surface; the behavioral delta is only provable by the focus of the regression tests above, not by a still frame.
Review-driven changes
Round 1 (First Principles CONCERNS, advisory): adopted the subtraction — dropped the three zero-consumer keyword-only test passthrough params from
_kiro_cli_version(); tests now pin layout via a resolver rebind with identical decisive coverage. The watch item (two bare-namekiro-cliauto-update spawns incli_server.py/slack/gateway.py, same cause / different symptom) is tracked in Bare-name kiro-cli spawns: auto-update checks and gateway boot version probe miss fixed-dir installs #7704; out of scope here per the task spec's no-opportunistic-widening constraint.Rounds 2-4 (GPT 5.6 BLOCKING ×3 + Design CONCERNS, converged empirically): final probe shape is
run_limited+scrub_env()child environment — no inherited credentials, kernel resource ceiling. The round-3sandboxed_spawn_argv(mode="strict")route was tried and then REMOVED with evidence: GPT round-4 correctly found its preparation sat outside the containment, and reproducing on a real enterprise-profile install showedwrap_argvraisingPlatformCompositionErroroutside a booted gateway context — a workingkiro-cli 2.21.0misreported aspresent but not runnable, the exact defect class this PR eliminates (Design round-4 concern, empirically confirmed, then fixed: the same real-binary check now returns the true version). The whole spawn incl. preparation sits in one broad containment logged at DEBUG; guards: raising-machinery regression test + env sentinel test, each mutation-checked red (narrowed containment / dropped scrub).Pattern harvest
Rule candidate: a version/presence probe of an optional binary must resolve through the component's owning resolver (here the
kiro_cli.resolve_kiro_cli()family) instead of spawning the bare name — a bare-name spawn conflates "not on this process's inherited PATH" with "not installed", and diagnostics surfaces then misreport working installs as absent. Sibling bare-name sites knowingly left out of scope (unrelated flows, per the task spec): the auto-update presence checks incli_server.pyandslack/gateway.py(shutil.which("kiro-cli")+ bare spawn) share the shape and are candidates for the same rule.