Repository navigation
feat(sdk): persist fenced logical owner deletion dispositions - #6339
Conversation
Saved-session deletion and replay preserve original authority and actual native outcomes before transcript completion. Pass the live scope inspector without serializing it. Deferring owner retirement cannot bypass sibling/protocol preflight before artifact effects; the real SDK alias regression exposed and now guards that shared storage boundary. Lore-id: 610bfd2a Constraint: producer/admission stays off until all consumers install Constraint: native payload retirement does not imply physical reclamation Tested: real SDK unknown-protocol alias preserves artifacts owner transcript and unrelated session Tested: deferred storage refuses without actual protocol inspector Tested: six SDK managed journal storage suites and full coding-agent check exit0 Not-tested: fresh cross-platform runtime and final cumulative gates Confidence: high Scope-risk: bounded Reversibility: revert
probepark
left a comment
There was a problem hiding this comment.
Review (head 6677b6c, gajae-reviewer on behalf of probepark)
CI: green. Every planned check passed at this head, including Affected path validation / check:@gajae-code/coding-agent (biome + check:types), the five targeted test shards (sdk-task-artifact-owner-deletion, task-artifact-owner-storage, sdk-broker-lifecycle-e2e, sdk-broker-restart, session-manager-resident-cache), and Virtual integration validation. Approve gate: ALLOW, with no pending, failed, or need-local checks.
Scope: +1361 / -71, 5 files. Gross size is over 800 lines, but only 725 lines are reviewable: sdk/broker/lifecycle.ts +622/-62 and sdk/broker/broker.ts +41. The other lines are two test files and a changelog fragment.
Conventions: changelog fragment changelog.d/sdk-task-owner-deletion.md (### Fixed) is present. No generated files, no released CHANGELOG section edits, no console.*, no new Worker.
Notable:
broker.ts:866-877:session.deleterejects any client-suppliedtaskArtifactOwner*field on the input, the target, orinput.cleanup. Owner cleanup state therefore can only come from the broker ledger, which is the right trust boundary.lifecycle.tsvalidateDeletePathreplay arm: the replay used to return the stored receipt as-is. It now re-resolves the managed scope (managedOwnerScopeFromInventorycompares all ten scope fields), requires the receipt transcript to sit under the currentsessionsRoot, and decodes owner fields against the fresh owner context. Any mismatch fails closed withterminal_uncertain.lifecycle.tsreplayDeleteTarget: an artifacts-phase receipt withartifactsRemoved: trueused to be rejected outright. It is now accepted only together with immutable owner evidence, which matches the new artifacts -> owner -> transcript ordering. A receipt without evidence is still refused.lifecycle.tspersistFreshTaskArtifactOwnerRetirement: runs the transcript identity check (or the logical-retirement check after transcript deletion) and the sibling-transcript check beforeretireTaskArtifactOwner. The ledger transition is written before any later effect.payload_retiredkeeps the phase atartifacts, so DTO completion is never treated as physical proof.- Note (non-blocking): the
evidence_changed_during_deleteguard compares the two evidence objects withJSON.stringify. That comparison depends on key order. Both objects come from the same codec today, but a field-wise or canonical comparison would not break if one producer ever reorders its keys.
Blocking: none
Body verdict line count=0, not updated. Suggested verdict line: gajae.pr-review-verdict.v1 merge-approved sha256:7c6889cfe8fc5aadb9ccd6e70ecdde555c45688f8d59abd61c051078a1a7a196 reviewer:human reviewer-id:probepark evidence:ci-green;affected-coding-agent-check-pass;owner-fields-client-rejected;replay-scope-revalidated;phase-ordering-checked
Verdict: gajae.pr-review-verdict.v1 merge-approved sha256:7c6889cfe8fc5aadb9ccd6e70ecdde555c45688f8d59abd61c051078a1a7a196 reviewer:human reviewer-id:probepark evidence:ci-green;affected-coding-agent-check-pass;owner-fields-client-rejected;replay-scope-revalidated;phase-ordering-checked
|
Merged to dev: approved at 6677b6c, checks green, no open concerns. |
|
Actual immutable merged dev |
|
@snowykr @probepark dev is red on 3 tests in
Failing tests (
This PR's CI only ran its touched test files, so — |
…cation Fixes two regressions in sdk-broker deletion: 1. Cleanup replay path now handles managed scope verification failures gracefully. When replaying a deletion with existing cleanup evidence, the managed scope security verification is no longer mandatory. If it fails (e.g., due to directory movements), the replay continues without owner scope information, since the cleanup plan is already established from the previous attempt. 2. Artifact reappearance detection now works correctly. The transition response messages for artifact removal were changed from 'were removed' to 'are removed', breaking the test fixture that injects artifacts to verify reappearance handling. Reverted message tense to match expected behavior. Changes: - Modified validateDeletePath cleanup replay path to be lenient about managed scope verification failures - Updated artifact removal response messages to use 'were removed' tense to match test expectations and previous behavior Fixes #6339 regressions affecting legacy session deletion and artifact reappearance detection.
…regression test(sdk-broker): align two delete-replay fixtures with #6339 contract
…an-Heo#6339 PR Yeachan-Heo#6339 added a new authority gate for artifact owners, which unconditionally required resolving and verifying the managed scope directory. However, for legacy sessions that haven't been migrated to the managed scope structure, this directory may not exist yet, causing the deletion to fail. This fix makes the authority check conditional: - For managed (non-legacy) sessions, the authority check is required as before - For legacy sessions, if the authority can't be established (because the directory doesn't exist), we continue without it since legacy sessions are unlikely to have artifact owners The fix also updates managedOwnerScopeFromInventory to fall back to basic scope resolution when the managed scope directory doesn't exist, allowing legacy sessions to be properly analyzed. Fixes Yeachan-Heo#6339 regression where legacy session deletions were rejected with 'Managed task-artifact-owner authority could not be established'. Closes Yeachan-Heo#6339
Complete SDK deletion consumer on installed dependencies
Actual dev base
693114765f3ff95958136de808416a5725820810, including externally installed helper #6335 and managed #6337 plus ACP terminal-grace test contract #6336. Exact head6677b6ca965005b32d4c57cba673696869d8fb16.Owned AND actual dev production additions+deletions: 725: broker +41, lifecycle +622/-62. Five files; tests/changelog excluded, no generated/native production changes. No previous-branch base or oversized cumulative stack PR.
Behavior
Fresh exact-head qualification
Independent clean detached QA
14-independent-after6337-base69311476, strict genuine unchanged 0.18.7 native addon8d1/source261/buildafbb/tree413/descriptor untouched:Current dev has unrelated OpenCodex formatting errors from #6334; independent format-only PR #6338 repairs them (production4). Current standalone package checks above are fresh; root failure and cancelled Rust are preserved, not waived. Separate fully integrated c93+formatting consumer generation63b716 passed491/15/2534 and fresh root735.27s, not transferred as this new6677/693 head's execution or approval.
Darwin runtime only, not cumulative Linux/Windows proof. Fresh code-event CI/exact-head write-access approval/posted verdict/external installation required. No #6335/#6337 approval transfer; leader does not merge. Original protected44/reference7e5/PR6240 unchanged; whole-goal activation/cohort/critic/allstory closure unfinished.