refactor(rebuild): journal destructive recovery - #6470
Conversation
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
PR Review Advisor (Nemotron Ultra) — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
🚨 Required before mergeAddress these before merging unless a maintainer explicitly overrides the advisor with rationale.
|
E2E Target RecommendationRequired E2E targets: Dispatch required E2E targets:
Full E2E target advisor summaryE2E Target AdvisorBase: Required E2E targets
Optional E2E targets
Relevant changed files
|
PR Review Advisor — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
Review findings by urgency: 0 required fixes, 3 items to resolve/justify, 0 in-scope improvements
|
…6435-rebuild-destructive-journal # Conflicts: # src/lib/state/rebuild-transaction.test.ts # src/lib/state/rebuild-transaction.ts
…6435-rebuild-destructive-journal
…6435-rebuild-destructive-journal
…6435-rebuild-destructive-journal
…6435-rebuild-destructive-journal
…6435-rebuild-destructive-journal
…6435-rebuild-destructive-journal
…6435-rebuild-destructive-journal # Conflicts: # src/lib/state/rebuild-transaction.ts
…6435-rebuild-destructive-journal
Advisor disposition at
|
Advisor resolution at cc6858aThe GPT required finding about missing durable registry/default ownership is implemented:
The remaining interruption-hook warning is explicitly bounded: it requires all shared E2E gates, a Vitest process, and a fixture marker equal to the child temporary HOME. Forging all variables can only suspend the invoking user process; it cannot signal another process or cross a privilege boundary. The two inert-by-default tests and two real child-process SIGKILL tests protect the boundary. Replace this localized hook when the coordinator exposes a test-only phase observer that can drive a real child process without production environment plumbing. The store module extraction remains a follow-up after this V1 contract settles; validation/concurrency tests and transaction coordination are already separated without moving the audited publication and schema boundary during this safety change. Both PRs remain draft. |
Follow-up Advisor fix at cbdca27The exact-head GPT warning about recreate failure handling is fixed. Errors from the failure-metadata callback are now redacted and contained, so session failure marking, registry and MCP retry recovery, backup location output, retry commands, shields guidance, and the final bail still run. A destructive-boundary regression forces the journal write to fail and proves the transaction remains active at old_deleted while backup guidance is still emitted. The PR remains draft. |
Exact-head advisor disposition at 04089edGPT reports zero required findings and zero new items. Its remaining interruption-hook and store-extraction warnings are covered by the explicit boundary/removal rationale already posted. Nemotron newly labels MCP revalidation as required, but its premise is incorrect. rebuildSandbox holds the per-sandbox cross-process MCP lifecycle lock from before preflight through the delete edge, and every NemoClaw MCP add, remove, restart, destroy, and rebuild path acquires that same lock. In addition, revalidatePreparedRecoveryBeforeDelete deep-compares the complete registry entry, including its MCP markers. The actual provider detach/ownership preparation occurs later inside the locked destroy phase, immediately before deletion; preflightMcpRebuildState only resolves or blocks an already-incomplete destroy transaction. Re-running a second preparation inside prepared-backup validation would duplicate a later phase and widen side effects before the final delete checks. This item is therefore explicitly overridden with the existing lock and registry-drift regressions as proof. The CI shard failure on the preceding head was a stale expectation for the retired registry rewrite call. The final test-only commit now asserts the guarded preserved-row path and unchanged default-selection revision. Both PRs remain draft. |
|
Closing this draft stack as requested while the broader human-and-agent lifecycle architecture is reconsidered. |
Stacked PR
Depends on #6468. Review this PR against
refactor/6434-rebuild-transaction-store; it contains the destructive-boundary integration.Summary
preparedafter validated backup and before MCP detach or sandbox deletionold_deleted,replacement_created, andcompletedpreparedorold_deletedin a fresh process and skip duplicate deletionpreparedjournal when a failed-delete retry finds the old sandbox livedestroyPreparedMCP state non-destructively before rebuild and fail closed for ambiguous/post-delete markersold_deletedwith retry guidanceArchitectural simplification
The registry row remains the primary rebuild source contract instead of being removed during normal rebuild. The journal carries a recovery capsule for the exceptional case where that preserved row disappears. Transaction transitions now live in
RebuildTransactionCoordinator;rebuild-pipeline.tsis 364 lines and focuses on phase sequencing. This removes the 97-line registry rollback participant, its 174-line test, obsolete removal plumbing, and inline journal transition branches.Advisor resolution
preparedtransaction's intent/backup receipts.destroyPreparedmarker with an exact durable ownership manifest is restored non-destructively;destroyPending, absent-sandbox, or incomplete ownership fails before backup/delete.bailpath; a failed retry-metadata write no longer suppresses registry/MCP recovery and backup guidance.replacement_created: remains the explicit refactor(rebuild): journal the destructive boundary and resume absent-sandbox recovery #6435 non-goal, but now reports the validated backup and a concrete snapshot-restore command; crash-after-create coverage proves the fail-closed boundary.Tests
preparedand external-delete-before-journal checkpointsnpm run build:clinpm run checksnpm run check:diffnpx tsc -p tsconfig.cli.json --noEmitLine budget
Against the updated stacked base: +1,704 / -681, net +1,023 total; production is +685 / -220, net +465. The additional safety branches and process/concurrency regression coverage mean this phase is not line-neutral. The coordinator extraction and rollback deletion contain the growth, and later forward-recovery/finalization phases should continue retiring compatibility paths toward epic-level neutrality.
Closes #6435
Signed-off-by: Julie Yaunches jyaunches@nvidia.com