Repository navigation
Recover interrupted registered log tails with retained exact backups - #98
Merged
Merged
Conversation
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Managed TreeDX could not start because two registered append logs ended in incomplete records. Add and package
treedx_store_recover DATA_DIR REGISTERED_LOG [--apply EXACT_PLAN_DIGEST]to recover only a validated complete prefix while retaining every original byte. Ordinary readers continue refusing corruption.Work authority
Plan and changes
Use the original store registry and shared envelope/checksum validator. Plan under the same OS lock as the managed runtime; apply only the exact planned digest. Stream a verified full-original backup, sync, atomically install the complete prefix, then verify readback. Refuse interior/newline-terminated corruption, wrong kind/checksum, symlinks, escaping backup paths, stale source and active owners. Preserve pending copies across interruption. Document stopped-service operation. The existing entrypoint retains privilege dropping; its OS lock covers managed service and offline command. The pre-existing non-container startup marker remains. Compatible plug_crypto2.2.1 repairs the actual locked2.2.0 Hex advisory. No new storage model, task policy, coordinator host-control MCP tool or execution wrapper.
Verification and commits
Actual recovery/readback
recovered the real audit log using exact digest blake3:7deb454812f988c3ea5fea5036dd055c39259529c57e4dd073a25446e2e7d8f0. Original7119544320bytes were backed up byte-for-byte to treedx://backup/log-tail-7deb454812f988c3ea5fea5036dd055c39259529c57e4dd073a25446e2e7d8f0/original.tdb; installed prefix7119543732bytes contains10875769complete audit events. The588incomplete bytes remain retained unknown history. Token original2714865664bytes/digest9200b14c31a1909aec70484a83c620d7bc41b80055eb28ab4e33bbe0ce3a3c51 remains preserved at its earlier token-tail backup URI. Files /tmp/codex-treedx98-real-audit-{plan,apply}496.{json,stderr}, both native process exits0 and --rm containers removed. Maintenance image82d7ec312a6e2f7ef0a67df184fe71b0ff2a8eaaece1f36ada3db5ad263916a4 was built from clean exactad46 using the existing owning Dockerfile; no alternative runtime or wrapper. Networknone/read-onlyrootfs/4GiB/UID65532 retained; sampled76.68MiB during copy is not a peak or agent usage.
Supported trsd dev rebuild treedx.service --session dev-5007e344-493 succeeded after both repairs; generation12546 ready, actual container healthy from23:14:25UTC. Receipt /tmp/codex-treedx98-restored-development496.{json,stderr}. Native MCP workspace show/diff/content/update/submit succeeded afterward. Workspacecfe77be2-6d10-4bc1-b95a-927b3d6c8c44 publishedv19; integration operation2866e361-e63e-457b-a99d-8e7fa556d3fe succeeded, content commite20f1e7bfa659a82d7a8287414661ab311c63c1d, published revision5f63e4e90ff8f7eedcc1d063ab31cdfc8878cce8. These are real content/control-plane readback, not a complete agent execution proof. All original10claims, retained products and unknown usage preserved.
Risk and rollback
Retain both complete original backups, the original data volume and failed observations. Never interpret incomplete bytes as successful events. Recovery refuses unsupported corruption and does not fix the unproved append-durability/log-growth root cause. Managed development is healthy; sealed release adoption and full meaningful agent/MCP product-release proof remain pending.
Completion summary
Real token and audit recovery, healthy supported development rebuild, and native MCP governed content publication succeeded. Original10retained claims/products/unknownusage preserved. All source PR checks passed and the change merged. Protected release gates and candidate sealing passed. Final installed release adoption, growth prevention and full agent workflow remain unproved.
Submission checklist