Skip to content

feat(core): semantic archive preflight before target access (NEXT-33) - #112

Merged
ArefinAlter merged 9 commits into
mainfrom
codex/semantic-archive-preflight
Nov 3, 2026
Merged

ArefinAlter merged 9 commits into
mainfrom
codex/semantic-archive-preflight

Conversation

@happinessisreal

Copy link
Copy Markdown
Collaborator

Summary

This PR implements NEXT-33: semantic verification before touching the target.

  • Async semantic preflight: Uses a private disposable LocalRepository in the staging directory to validate complete typed reconstructions, recovery plans, and same-file merge evidence using existing import_objects/import_commit validators.
  • Fail-closed destination protection: Preflight runs before creating, opening, or upgrading any destination repository in archive-import.
  • Offline verifier routing: Both offline verifier entry points (engine-cli archive-verify and engine-cli repo archive-verify) run through full semantic verification without opening or modifying target repository databases.
  • Strict structural verification: Rejects hash-valid graphs with invalid typed structure, non-state roots, or false recovery/merge evidence.
  • Target invariant guarantee: An invalid archive leaves absent target repositories absent and existing target repositories completely untouched.

Checks Performed

  • task lint: clean
  • task test: 82 targets, 1514 passed, 0 failed, 4 ignored
  • task docs: clean
  • openapi.yaml: unchanged

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@happinessisreal
happinessisreal force-pushed the codex/bounded-archive-export branch from 8afd442 to d9ff528 Compare October 31, 2026 05:28
@happinessisreal
happinessisreal force-pushed the codex/semantic-archive-preflight branch from a020eb9 to 275c379 Compare October 31, 2026 05:28
@happinessisreal
happinessisreal force-pushed the codex/bounded-archive-export branch from d9ff528 to 2f17ce8 Compare October 31, 2026 12:00
@happinessisreal
happinessisreal force-pushed the codex/semantic-archive-preflight branch from 275c379 to f241145 Compare October 31, 2026 12:00
@happinessisreal
happinessisreal force-pushed the codex/bounded-archive-export branch from 2f17ce8 to 7dfdf5f Compare October 31, 2026 12:12
@happinessisreal
happinessisreal force-pushed the codex/semantic-archive-preflight branch from f241145 to 95b5138 Compare October 31, 2026 12:13
- set Unix 0600/0700 during exclusive creation via OpenOptionsExt/DirBuilderExt
- reject pre-existing scratch paths and avoid create_dir_all for private roots
- reuse Windows ACL restriction with fail-closed cleanup
- cleanup guard AutoRemoveFile removes newly owned files unless committed
- separate serialization from path ownership via Write-based writer
- use iterative dependency-first traversal with explicit visiting/done states
- verify commit signatures, address/project and dependency availability during walk
- retain bounded addresses/metadata rather than retaining payload bytes
- collect scoped object keys and stream read/validate one payload at a time
- enforce max_commits, max_objects, max_frame_bytes and max_total_bytes in ArchiveWriter
- test deep histories, shared subgraphs, exact byte limits, corrupt rows, and large payloads
@happinessisreal
happinessisreal force-pushed the codex/bounded-archive-export branch from 7dfdf5f to c061809 Compare October 31, 2026 12:48
- add async semantic preflight using disposable LocalRepository to validate complete typed states, recovery and same-file merge evidence
- complete preflight before creating, opening, or upgrading destination repository
- route archive import and both offline verifier entry points through semantic preflight
- reject invalid typed structures, non-state roots, and false recovery/merge evidence
- test absent target stays absent and existing target stays unchanged on invalid archive
@happinessisreal
happinessisreal force-pushed the codex/semantic-archive-preflight branch from 95b5138 to f215a54 Compare October 31, 2026 12:49
@ArefinAlter
ArefinAlter changed the base branch from codex/bounded-archive-export to main November 3, 2026 11:04
@ArefinAlter
ArefinAlter merged commit 7b54e32 into main Nov 3, 2026
8 checks passed
@ArefinAlter
ArefinAlter deleted the codex/semantic-archive-preflight branch November 3, 2026 15:21
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