Skip to content

fix(acp): reclaim per-run work dirs and report refused alias unlinks - #13974

Merged
bolichen97 merged 1 commit into
mainfrom
fix/skill-view-workdir-gc
Sep 27, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/skill-view-workdir-gc

Conversation

@bolichen97

@bolichen97 bolichen97 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

~/.kiro/agents/ keeps growing with kirocrew-skill-view-*.json files until kiro-cli's session/new takes over 90 seconds. #13225 stopped the prune from keying on "does the work dir still exist"; #13282 made kirocrew doctor count the pile; #13431 bounded the prune's critical section. #13502 (merged) takes the alias backlog itself (one copy per agent, drained at boot). This PR takes the layer none of them touch, plus one silence that made the whole thing hard to diagnose:

  1. Nothing ever deleted a run's work directory. Every subagent and every stateless cron run made workspace_root()/subagent_<id> or cron_<job>_<run>, wrote one file into it (.kiro/settings/cli.json), and left it. Field counts: 2387 subagent_* dirs on one machine, 17221 cron_* on another (9901 from one job).
  2. An alias unlink the OS refused (read-only mount, foreign owner) returned False with no log, exactly like a deliberate keep.

Why it matters

Every derived-cwd spawn re-enumerates the workspace root, and thousands of one-file directories are inode and listing cost that nothing ever pays back. The silent unlink failure sent an outside report chasing the wrong root cause (the sandbox's read-only ~/.kiro/agents seal, which never applied to the gateway process).

What changed (motivation → approach → change)

Layer What happens now
Work dir at run end The provider removes its own run directory when the run ends, once its process tree is confirmed dead, the registry holds no other owner, and the directory holds only Crew's residue.
Work dirs a crash left At gateway boot (after the pid-ledger reap) and on the hourly wake, this data home reclaims its own dead predecessor gateways' marked, residue-only, >1h-idle directories. Other data homes' directories are never touched.
Refused unlink One rate-limited warning names the file, the operation and the errno; only a permission-class errno is called "not writable".

Chosen approach: delete at run end, not one shared directory per job. A shared directory would change every run's cwd and the skill-view alias hash; deleting the run's own directory changes nothing a live run observes. Safe by shape: session_work_dir.py unlinks only Crew's own names (cli.json, its lock sidecar, the marker) and removes directories with rmdir, so a run that wrote anything keeps its whole directory.

The invariant. A reclaim decision uses only evidence the deciding process owns: its session registry for its own runs, and its own data home's pid ledger (kiro_session_pids.txt, reaped at boot by cleanup_orphaned_sessions) for a dead predecessor gateway. It never probes the liveness of a pid another process wrote to decide a deletion, and it never judges a directory marked by another data home. Five review rounds each added a guard to the sweep's inference about foreign processes; the retrospective deleted the inference instead.

One shape table in session_work_dir.py generates both the key predicate and the name filter: generated run ids only -- subagent:<16 hex> (eight hex on shipped builds) and stateless cron:<8 hex>:<8 hex>. Reused cron:<job> and cron:<job>:<agent> keys hold the effort overlay and are never disposable. The factory in config/loader.py marks a work dir only when it DERIVED it from such a key, never an explicit cwd.

AcpProvider.start (providers/acp.py) writes a .kirocrew-run-dir marker -- <data_home_id> (sha256 of the real config_dir() path) and <gateway_pid> -- before any other writer: idempotent for this gateway, replacing a same-home predecessor's (one gateway per data home holds the GatewayLock), never touching another home's, malformed left alone. Shutdown reclaim (_reclaim_work_dir) needs three fail-closed facts: the client's process_tree_confirmed_dead (new property in acp/client.py, acp/runtime.py, acp/session_provider.py); a marker that names this home and this pid, or none (the flag is provenance); and registry ownership -- at registration session_allocation.py installs a claim (LLMProvider.set_work_dir_claim_probe, providers/base.py) holding the registry lock from the no-other-holder check through the off-loop removal (a cancellation mid-reclaim waits for the worker before the lock is released), so a successor cannot register in between; arms that already know a provider lost its key call disown_work_dir first (session_compaction.py).

sweep_predecessor_work_dirs (slack/gateway.py, boot right after the ledger reap and before any session writer, and the hourly wake) reclaims a marked, residue-only, >1h-idle directory only when the marker names this data home and a gateway pid that is not ours and has no entry left in the ledger (session_pid.py's new read-only retained_gateway_pids); anything the ledger still retains, another home's marker, or a malformed one is kept. Streamed, bounded per wake (5000 entries, 20 s). Unmarked directories from older builds are never deleted; kirocrew doctor (cli_doctor.py) reports unmarked legacy directories and marked directories this home cannot reclaim in one line, via workspace_root(create=False).

Warning. pinned_fs.py's unlink_verified gains an on_error callback fired only when the unlink raises; acp/skill_projection.py's alias and lease unlinks report through one rate-limited reporter naming file kind, operation and errno, saying "not writable" only for EACCES/EPERM/EROFS.

The system spec docs/system-specs/modules/acp-client.md describes all of it. Nothing in sandbox.py changes.

Backwards compatibility

Compatible: no config key, CLI flag or file format changes. unlink_verified's on_error, workspace_root's create and LLMProvider.disown_work_dir are additive with defaults that keep every existing caller's behaviour. A run directory that holds anything besides Crew's overlay is left exactly as before.

Tests

test/test_session_work_dir.py (new): residue-only directories are removed on both the pinned and the by-name form; planted content of five kinds keeps the whole tree byte-for-byte; grace window and mtime renewal; links at every level refused; the marker is the only provenance the sweep accepts; mark_run_dir creates, is idempotent for this gateway, replaces a same-home predecessor, refuses another home's and a malformed one; the sweep reclaims a dead predecessor with no ledger entry and keeps one the ledger retains, another home's, own-pid, young, live, unmarked-legacy and person-named entries; no pid liveness is probed anywhere (pinned); the sweep is bounded, streams its listing and finishes over later wakes; the doctor's two figures are exact and report their floor; only the generated run-id key shapes are disposable and the name filter agrees; the factory marks generated keys and never dashboard keys, persistent or agent-sequence cron: keys or an explicit cwd; shutdown reclaims a confirmed-dead tree with a matching marker or none, keeps a surviving or unknown tree, a foreign marker, and a run that wrote a file, and never fails on a reclaim error; no claim or a raising claim keeps the directory; a successor that registers during the predecessor's shutdown keeps its directory; the registry leaves a live sibling's directory in the lost-race, recycled-successor and bootstrap arms, while a recycle with no successor still reclaims; the boot sweep follows the ledger reap and precedes every session writer.

test/test_native_skill_projection.py (added): a refused alias unlink and a refused lease unlink report once per interval through the same throttle with the count; permission-class errnos are diagnosed as unwritable, others worded neutrally; end to end through a write-protected agents directory.

test/test_cli_doctor.py (added): the doctor does not create a missing workspace root and still counts an existing one. test/test_session.py, test/test_session_more_coverage.py, test/test_session_core_audit.py: provider doubles gain the synchronous disown_work_dir.

Manual verification

Ran the resolved prepare-pr backend gate floor locally: black (fresh cache), isort, flake8, mypy, comment-history, brand, harness-parity, feature-map and the related backend test set (34,486 passed; the 4 failures reproduce identically on pristine origin/main in this environment and touch no changed file). Frontend gates not run locally: the diff touches no website/ file.

Related Issues

no linked issue: follow-up to #13225 / #13282 / #13431 and a sibling of #13502, which owns the alias backlog; no open tracking issue names the work-dir layer.

Pattern harvest

Rule candidate: review-prompt
Pattern: a cleanup that returns False on OSError with no log makes a permission failure indistinguishable from a deliberate keep; every "refuse to delete" path that can be hit by an environment fault should say so once.

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 buluoray September 25, 2026 20:43
@bolichen97

Copy link
Copy Markdown
Contributor Author

Intent: Stop subagent and stateless-cron run directories under workspace_root() from piling up: a run reclaims its own residue-only work dir at shutdown, and the hourly sweep reclaims marked leftovers a crash or restart left behind -- never a file a run wrote, never a directory Crew did not mark. Make an OS-refused skill-view alias unlink visible with one rate-limited warning.
Not a goal: Draining or re-keying the skill-view alias backlog itself (#13502 owns that); deleting unmarked directories older builds left (kirocrew doctor counts them and names the manual remedy); any change to sandbox.py's read-only seal on ~/.kiro/agents.

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

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

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

Design-Verdict: PASS

Confirm the doctor's manual remedy suffices for existing hosts: the motivating 17k-dir legacy piles are counted, never auto-drained.

[DESIGN-REVIEWED] 45e07ef

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/dashboard/chat_voice.py, test/test_chat_voice.py since this head went green (4926e50 -> 8a2d0ab); this push also restores the test's directory mode from the mode it read rather than a literal, which is what SAST flagged. CI re-running.

@bolichen97
bolichen97 force-pushed the fix/skill-view-workdir-gc branch from c29a0a9 to 716c614 Compare September 25, 2026 20:51
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ human override accepted

Human judgment by @bolichen97 overrides the GPT 5.6 finding for 45e07ef73f8e66ed1b69f4d934b05e21d3302eaf; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] 45e07ef

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

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

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of 45e07ef73f8e66ed1b69f4d934b05e21d3302eaf — 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: PASS

Verify the "one gateway per data home (GatewayLock)" premise on every path that reaches mark_run_dir — it alone licenses replacing a same-home marker and the sweep's "any same-home pid not ours is a dead predecessor" rule.

What this change ships

Inventory (10 items) — 10 justified

Intent: stop per-run work directories and refused-unlink silence from accumulating undiagnosable garbage that slows session start — a FIX (field-counted: 2387/17221 dirs; tests added in this PR).

  1. A subagent's or stateless cron run's directory is deleted when its run ends — justified
  2. Boot and hourly sweeps delete residue-only dirs a dead same-home predecessor gateway left — justified
  3. Every derived run dir now carries a .kirocrew-run-dir provenance marker — justified
  4. A refused alias/lease unlink now logs one rate-limited warning with errno — justified
  5. kirocrew doctor gains a "run dirs" line with two counts and a manual remedy — justified
  6. Unmarked legacy dirs are deliberately never auto-deleted, only counted — justified
  7. LLMProvider.disown_work_dir / set_work_dir_claim_probe base surface (4 + 2 counted call sites) — justified
  8. workspace_root(create=False) read-only resolution — justified
  9. pinned_fs.unlink_verified on_error callback (2 consumers) — justified
  10. session_pid.retained_gateway_pids() (2 consumers) — justified

List capped at 10; the disposable_work_dir factory flag and the process_tree_confirmed_dead property (one read site, both client paths — counted) are also justified. Checked: work_root/agent_scratch sweep different trees under different contracts (no duplicate); cron key uuid4().hex[:8] and subagent 16-hex/8-hex history verified in cron.py:1158 and subagent.py:3685; session-sharing subagents use the pool cwd, so no unhandled sibling; no deleted pins anywhere in the diff; not product shape (internal residue hygiene, no default a user chose changes).

[FIRST-PRINCIPLES-REVIEWED] 45e07ef

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 45e07ef

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

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

@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 25, 2026
@bolichen97
bolichen97 force-pushed the fix/skill-view-workdir-gc branch from 716c614 to ee31e34 Compare September 25, 2026 22:12
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • fixed: Workspace resolution runs on the event loop span=e51cd2330ac2

workspace_root() now resolves inside the worker callable (_sweep_disposable_session_work_dirs, run via asyncio.to_thread); the coroutine only reads in-memory provider cwds. Landed in ee31e34.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • fixed: Persistent cron directories are classified as disposable span=861066665e9c

is_disposable_session_key accepts only subagent:<id> and the three-segment stateless cron:<job>:<run>; the stable cron:<job> key is never marked, never swept. The sweep's name filter matches the same shapes. Tests pin all four key shapes. Landed in ee31e34.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • fixed: Reclamation proceeds without confirmed process death span=25513d154ea8

_reclaim_work_dir now requires the client's process_tree_confirmed_dead to be exactly True; the property (AcpClient, AcpRuntime, AcpSessionProvider) is set only when the root's returncode is known and no tracked descendant survived, and is reset on every spawn/shutdown. Unknown or surviving trees leave the directory for the sweep. Tests: survivor kept, unknown kept, confirmed dead reclaimed. Landed in ee31e34.

@bolichen97

bolichen97 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author
  • fixed: workspace_root() evaluated on the event loop in the hourly sweep span=0fd893e5865c

Same defect the GPT lane raised; resolved inside the worker callable run via asyncio.to_thread. Landed in ee31e34.

@bolichen97

bolichen97 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author
  • fixed: discarded duplicate provider reclaims a live sibling's derived work dir span=0e1e220e22e7

A marker nonce was rejected: whichever provider wrote the marker can be the one torn down while the other lives. Ownership is a registry fact, so the registry decides: new LLMProvider.disown_work_dir() (no-op base, AcpProvider clears its flag) is called before shutdown in the lost-race arm (session_allocation duplicate_provider), the open_task_session lost-race arm, the run-runtime bootstrap arm, and session_compaction._recycle_held whenever a successor holds the key. Census: 15 shutdown arms, 4 have another live holder at decision time, 4/4 covered; the other 11 pop their own holder first. Tests cover each arm plus a no-successor control. Landed in ee31e34.

@bolichen97

bolichen97 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author
  • fixed: refusal warning asserts "not writable" for every errno span=4d7760c8e43d

The reporter now names the operation and the errno (EACCES (Permission denied)) and claims unwritability only for EACCES/EPERM/EROFS; ENOENT, EMFILE and others are worded neutrally. One throttle, one counter. Tests pin both wordings. Landed in ee31e34.

@bolichen97

bolichen97 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author
  • fixed: read-only doctor helper creates the workspace tree span=f44ebe40eb24

workspace_root(create=False) (additive keyword, default unchanged) resolves without mkdir; the doctor prints one line and returns when the root does not exist. Test: a fresh root is not created. Landed in ee31e34.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • fixed: the harvest rule is applied to one of the two refuse-to-delete paths span=c0a900a8a69e

_unlink_projection_lease_if_unchanged now reports through the same rate-limited reporter as the alias path (own lease record and holder, stale lease record and holder, ownership sidecar -- all five call sites labelled), same throttle and counter. Test: a refused lease unlink reports through the shared throttle and its count. Landed in ee31e34.

@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 25, 2026
@bolichen97
bolichen97 force-pushed the fix/skill-view-workdir-gc branch from ee31e34 to cc774f0 Compare September 25, 2026 22:58
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • fixed: Sweep ignores live runs owned by another gateway span=861066665e9c

The marker now names the deriving gateway's pid, written with the bounded owner-marker discipline agent_scratch uses (no link, regular file, 4 KiB, exactly one pid in 1..2**31-1; anything else keeps the directory). The sweep reclaims a foreign gateway's directory only when that pid is confirmed dead (platform_compat.pid_liveness == PID_DEAD) and defers to its own registry for its own pid; mark_run_dir never overwrites a marker whose owner is alive. Both the pinned and the by-name form. Landed in cc774f0.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • fixed: Stable sequential-cron keys are classified as disposable span=861066665e9c

One shape table now generates both the key predicate and the directory-name filter: only generated run ids qualify -- subagent:<16 hex> (eight hex on shipped builds, verified against _mint_agent_id on origin/main and the directories a running host holds) and stateless cron:<8 hex>:<8 hex>. cron:<job>:<agent>, cron:<job> and any named segment are not disposable. Landed in cc774f0.

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

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt ecdb2cb: The adjudicator flagged the path extreme (swallowed ledger-append failure + crash + orphan surviving the boot reap + residue-only for an hour), and the residue-only/rmdir gate bounds any loss to Crew's own regenerable cli.json, lock sidecar and marker -- no run or user data.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 3beaa7fe1613a2fd3596c1481b56c453a39b9395.

The adjudicator flagged the path extreme (swallowed ledger-append failure + crash + orphan surviving the boot reap + residue-only for an hour), and the residue-only/rmdir gate bounds any loss to Crew's own regenerable cli.json, lock sidecar and marker -- no run or user data.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: ecdb2cb30d405675d265f3296924e5de10002e8e is not the current PR head. Re-run the command with 3beaa7fe1613a2fd3596c1481b56c453a39b9395.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 26, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • answered: registry-lock hold time under the shielded reclaim span=f16a303f2f4f

The work held under the claim is bounded by construction, not by wall clock: reclaim_session_work_dir walks exactly the three-level chain Crew creates, refuses at the first level holding anything but the one expected child (so at most a handful of entries are ever listed), unlinks at most three names and rmdirs three directories -- a dozen syscalls on a residue-only tree, none of them on a run's output. A wall-clock bound that abandoned the worker would reopen the r9 finding (lock released while the thread still deletes); a bound that kept the lock changes nothing. The shield is therefore waiting on a dozen syscalls, and a filesystem that stalls those stalls every session's cli.json write on the same path anyway. The listing-cut suggestion (span 1a16055b5b54) is the one further reduction worth making and is noted as a follow-up; a load test is not something this PR can honestly claim.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • deferred: stop the per-level scan after the second entry span=1a16055b5b54

Agreed it shrinks the worst case under the registry lock (a run that filled its cwd is refused after two names instead of a full listing). Deferred from this head to avoid another review round on a PR already at its restructure: it is a local change inside reclaim_session_work_dir with no behaviour change, and will ride the follow-up that carries the doctor's operator action (span a390b7c51925).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • acknowledged: doctor run-dir census rides along span=6c356d25527b

Correct: the census deletes nothing and is not the reclaim fix. It is in this PR because the Design lane's WATCH (cc94c18a31b1) required the operator to be able to see the directories the sweep deliberately keeps, and the count reuses the sweep's own predicate so it cannot drift from it. Read-only, no premise risk, as the lane says.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • acknowledged: workspace_root(create=False) rides along span=fc7edfa69894

Correct: the keyword exists only so the doctor's read-only report does not create a workspace tree on a host where no gateway ever ran. Additive default; every existing caller is unchanged.

@bolichen97
bolichen97 enabled auto-merge (squash) September 26, 2026 06:47
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 26, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/acp/skill_projection.py and test/test_native_skill_projection.py (#12605 bounded the lease/prune scans) plus 35 other commits (694f619 -> 31c291d); conflicts resolved by taking main's scan rewrite and keeping this PR's unlink-warning wiring (the lease call-site what= labels are dropped so #12605's test doubles keep their signature). 227 scoped tests pass. Re-posting the human override for the same GPT finding on this head.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 0f22bd0: The adjudicator flagged the path extreme (swallowed ledger-append failure + crash + orphan surviving the boot reap + residue-only for an hour), and the residue-only/rmdir gate bounds any loss to Crew's own regenerable cli.json, lock sidecar and marker -- no run or user data.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 0f22bd0542ca308971fe05062631e45f620f2f09.

The adjudicator flagged the path extreme (swallowed ledger-append failure + crash + orphan surviving the boot reap + residue-only for an hour), and the residue-only/rmdir gate bounds any loss to Crew's own regenerable cli.json, lock sidecar and marker -- no run or user data.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: GPT 5.6. Re-run the lane's latest workflow run for 0f22bd0542ca308971fe05062631e45f620f2f09 manually from the Actions tab.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto origin/main (7d8eab1) -> head 9dd7edd4e0. One conflict in src/kiro_crew/session_allocation.py: main's ending-fence methods (spawn_in_flight/begin_ending/end_ending/wait_for_ending_fence/_refuse_if_ending) and this PR's _install_work_dir_claim_probe landed in the same region; both kept, no semantic overlap. 620 tests in the touched modules pass locally; black gate green. The GPT override is re-recorded on the new head per the repository writer's standing authorization.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • override (accepted risk): Missing PID-ledger entry authorizes deletion of a live runtime's cwd span=861066665e9c
    self-added: yes
    mechanism: human override re-recorded on the rebased head -- same decision as on 3beaa7f / ecdb2cb / 0f22bd0

The path needs a swallowed ledger-append failure AND a gateway crash whose child survived the boot reap AND that orphan staying residue-only for an hour; the residue-only + rmdir gate that permits the delete proves no run or user data is in the tree, so the worst case is Crew's own regenerable cli.json/lock/marker. Requiring positive reap evidence would leave every crashed gateway's directories unsweepable, re-opening the growth defect this PR fixes. Accepted by the repository writer (bolichen97) via /ai-review override; the doctor's second figure keeps the class visible.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 9dd7edd: The adjudicator flagged the path extreme (swallowed ledger-append failure + crash + orphan surviving the boot reap + residue-only for an hour), and the residue-only/rmdir gate bounds any loss to Crew's own regenerable cli.json, lock sidecar and marker -- no run or user data.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 9dd7edd4e09cf67ec20ed2eed78ceb495e8d7ffa.

The adjudicator flagged the path extreme (swallowed ledger-append failure + crash + orphan surviving the boot reap + residue-only for an hour), and the residue-only/rmdir gate bounds any loss to Crew's own regenerable cli.json, lock sidecar and marker -- no run or user data.

This decision applies only to this commit. A new push requires a new judgment.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto origin/main (5f42e5b) -> head 45e07ef73f, clean (main touched cli_doctor.py, providers/acp.py, session_compaction.py; no conflicts). 871 tests in the touched modules pass locally; black gate green. GPT override re-recorded on this head per the repository writer's standing authorization.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • override (accepted risk): Missing PID-ledger entry authorizes deletion of a live runtime's cwd span=861066665e9c
    self-added: yes
    mechanism: human override re-recorded on the rebased head -- same decision as on 3beaa7f / ecdb2cb / 0f22bd0 / 9dd7edd

The path needs a swallowed ledger-append failure AND a gateway crash whose child survived the boot reap AND that orphan staying residue-only for an hour; the residue-only + rmdir gate that permits the delete proves no run or user data is in the tree, so the worst case is Crew's own regenerable cli.json/lock/marker. Requiring positive reap evidence would leave every crashed gateway's directories unsweepable, re-opening the growth defect this PR fixes. Accepted by the repository writer (bolichen97) via /ai-review override; the doctor's second figure keeps the class visible.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 45e07ef: The adjudicator flagged the path extreme (swallowed ledger-append failure + crash + orphan surviving the boot reap + residue-only for an hour), and the residue-only/rmdir gate bounds any loss to Crew's own regenerable cli.json, lock sidecar and marker -- no run or user data.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 45e07ef73f8e66ed1b69f4d934b05e21d3302eaf.

The adjudicator flagged the path extreme (swallowed ledger-append failure + crash + orphan surviving the boot reap + residue-only for an hour), and the residue-only/rmdir gate bounds any loss to Crew's own regenerable cli.json, lock sidecar and marker -- no run or user data.

This decision applies only to this commit. A new push requires a new judgment.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Review-ready at head 45e07ef73f (one commit on main @ 5f42e5b).

  • PR Readiness: passed. Opus 5: PASS (fresh). Design / First Principles: PASS (fresh). GPT 5.6: overridden by the repository writer for the single remaining span (861066665e9c, adjudicated extreme, loss bounded to Crew's own residue files) -- disposition recorded on this head.
  • 28 disposition comments cover every lane finding raised across 10 review rounds; the r8 retrospective removed the cross-process pid-probing that drew five of them.
  • green_age: origin/main has since gained 7 commits touching only same-directory / import-adjacent files (no file this PR edits); the last two rebases (22:55, 23:00 UTC) were clean. Happy to rebase again on request before merge.

Not merging; awaiting maintainer review.

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