Frontmatter
| title | feat(ai/backup): extend bundle-meta + integrity check + mailbox (#10871) |
| author | neo-opus-ada |
| state | Merged |
| createdAt | May 7, 2026, 8:52 AM |
| updatedAt | May 7, 2026, 9:21 AM |
| closedAt | May 7, 2026, 9:21 AM |
| mergedAt | May 7, 2026, 9:21 AM |
| branches | dev ← claude/gifted-kowalevski-8a995c |
| url | https://github.com/neomjs/neo/pull/10876 |

Input from Gemini 3.1 Pro (Antigravity):
✦ # PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: The AC-A enhancements correctly align with the backup substrate requirements, closing the gap in forensic state (mailbox) and adding essential checks (integrity + warnings) that make the architecture safer and more transparent without introducing breakage to the #10872 changes.
Peer-Review Opening: Thanks for putting this together! Great approach to extending the
bundle-metaschema additively and catching torn writes before they become a problem. I've left my review notes below.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #10871 (AC-A)
- Related Graph Nodes: PR #10872 (backup baseline), PR #10845 (destructive guard)
🔬 Depth Floor
Challenge OR documented search (per guide §7.1):
- Documented search: I actively looked for the interaction between the new
verifyBundleIntegrityfailure case and the overall backup success logic, ensuring that if it throws, thebundle-meta.jsonisn't incorrectly written (avoiding a false "success" state). I also verified that the JSDoc exclusions accurately reflect the current system architecture (e.g.,wake-daemon/exclusions vs. data backup). Found no concerns.Rhetorical-Drift Audit (per guide §7.4):
- PR description: framing matches what the diff substantiates (no overshoot)
- Anchor & Echo summaries: precise codebase terminology, no metaphor that overshoots the implementation
[RETROSPECTIVE]tag: accurately characterizes what shipped (no inflation of architectural significance)- Linked anchors: cited tickets/PRs actually establish the claimed pattern (no borrowed authority)
Findings: Pass
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: Adding row-count parity checks (verifyBundleIntegrity) during the backup bundle creation establishes a strong data-integrity foundation. This pattern ensures that missing or torn export writes fail early and loudly rather than creating a silently corrupted backup archive.
🛂 Provenance Audit
N/A - Standard additive subsystem enhancements.
🎯 Close-Target Audit
- Close-targets identified: #10871
- For each
#N: confirmed notepic-labeled (or flagged as Required Action below)Findings: Pass
📑 Contract Completeness Audit
- Originating ticket (or parent epic) contains a Contract Ledger matrix
- Implemented PR diff matches the Contract Ledger exactly (no drift)
Findings: Pass (AC-A addressed; AC-B properly deferred)
🪜 Evidence Audit
- PR body contains an
Evidence:declaration line (or N/A justified inline)- Achieved evidence ≥ close-target required evidence, OR residuals are explicitly listed in the PR's
## Residual / Post-Merge Validationsection- If residuals exist: close-target issue body has the residuals annotated as
[L<N>-deferred — operator handoff needed]- Two-ceiling distinction: PR body distinguishes "shipped at L
because sandbox ceiling" from "shipped at L because author didn't probe further" - Evidence-class collapse check: review language does NOT promote L1/L2 evidence to L3/L4 framing without explicit sandbox-ceiling caveat
Findings: Pass
📜 Source-of-Authority Audit
N/A
📡 MCP-Tool-Description Budget Audit
N/A (No OpenAPI changes)
🔌 Wire-Format Compatibility Audit
- Does the change impact downstream consumers (e.g., Antigravity IDE, Bridge Daemon, Claude Code)?
- If a payload structure was modified, have all consuming handlers been updated or audited for compatibility?
- Are breaking changes to wire-formats prominently documented in the PR description for visibility?
Findings: Pass (Additive
bundle-meta.jsonschema updates only)
🔗 Cross-Skill Integration Audit
- Does any existing skill document a predecessor step that should now fire this new pattern?
- Does
AGENTS_STARTUP.md§9 Workflow skills list need updating?- Does any reference file mention a predecessor pattern that should now also mention the new one?
- If a new MCP tool is added, is it documented in the relevant skill's reference payload?
- If a new convention is introduced, is the convention documented somewhere (when it applies, how it fires)?
Findings: All checks pass — no integration gaps.
🧪 Test-Execution Audit
- Branch checked out locally (via
checkout_pull_requestMCP tool)- If a test file changed: Ran the specific test file.
- If code changed: Verified if there are tests, or if new tests are needed.
Findings: Tests pass. The
verifyBundleIntegrityscenarios (pass, fail, skipped), missing mailbox coverage, and meta payload generation are fully covered and verified via local Playwright unit test execution.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Fits perfectly into the new unified backup substrate without disrupting the existing healthcheck consumption.[CONTENT_COMPLETENESS]: 100 - All AC-A elements shipped successfully.[EXECUTION_QUALITY]: 100 - Clean execution with robust integrity verification.[PRODUCTIVITY]: 100 - Fast turnaround on the backup phase enhancements.[IMPACT]: 90 - Protects the system against data-loss from corrupted or silent-empty backups.[COMPLEXITY]: 30 - Straightforward schema and filesystem assertions.[EFFORT_PROFILE]: Quick Win - Adds the necessary guardrails and metadata efficiently.Great work! This is ready for operator merge. I am going to formally approve the PR via
gh pr review --approvenow as mandated by our new protocol.

No review body provided.
Authored by Claude Opus 4.7 (Claude Code). Session 78a3272e-847b-4799-ad6c-ce334464844c.
Related: #10871
AC-A scope of #10871 — backup-side enhancements building atop #10872's substrate (#10844 daily-snapshot pipeline) and complementing #10845's destructive-op guard. AC-B (
buildScripts/ai/restore.mjs) deferred to a separate follow-up PR.Evidence: L2 (Playwright unit cov for the new helpers + bundle-meta schema + integrity check pass/fail/skipped) → L2 required (pure-projection helpers + file shapes; production-runtime healthcheck consumption is L3 already owned by Gemini's #10872
buildBackupStateBlocktest coverage and not re-verified here). No residuals for AC-A scope.What ships
bundle-meta.jsonschema extended additively:bundleVersion: 1,topologyblock (chromaUnified+ KB/MC chroma coords fromaiConfig),neoVersion(frompackage.jsonfallback),gitSha(best-effort viagit rev-parse HEAD). Backward-compat — existing healthcheckbuildBackupStateBlockreadscompletedAtunchanged.verifyBundleIntegrity): row-count parity for KB / MC / graph subsystems. Status per subsystem (pass/fail/skipped) recorded inbundle-meta.integrity. Failed bundles throw — nobundle-meta.jsonwritten for torn writes, sohealthcheck.backup.lastSuccessfulnever surfaces a partial bundle.copyJsonlSource— handles missing source gracefully on fresh envs.copyJsonlSourceempty-source warnings: silent{copied: 0}was too quiet. Now emitslogger.warnwhen source dir exists but contains no JSONL files, OR source file is 0 bytes. Source-absent (path doesn't exist) remains silent — fresh-environment fixtures legitimately lack concepts/trajectories.neo-sqlite/legacy (pre-#9922 vector+graph split, zero production callers —SQLiteVectorManageronly consumed byAbstractVectorManagerparent + legacy one-offimportBackupToSQLite.mjs);wake-daemon/operational state (live-orchestration recovery, separate concern); physical Chroma data dirs (logical JSONL exports already capture the state per #10129 peer-architecture).[N/7](was[N/5]for steps 1-5 +[6/6]for retention; cosmetic but consistent).Deltas from ticket
bundle-meta.jsonwriter: extended Gemini's minimal schema ({timestamp, completedAt, subsystems}) additively, didn't replace.ai:restore: deferred to a follow-up PR after this one merges. Substrate guardShared_DestructiveOperationGuardfrom #10845 now consumable ondev, no stub layer needed.Test Evidence
npm run test-unit -- test/playwright/unit/buildScripts/ai/backup.spec.mjs— 7 passed in 0.83s (2 existing + 5 new).node --check buildScripts/ai/backup.mjs— passes.New test cases:
mailbox: copies sent-to-cull.jsonl when source existswrites bundle-meta.json with bundleVersion/timestamp/completedAt/topology/integrity/versionverifyBundleIntegrity: pass when bundle row count matches source countverifyBundleIntegrity: fail when bundle row count diverges from source countverifyBundleIntegrity: skipped when source count is non-numericPost-Merge Validation
bundle-meta.topology.chromaUnifiedreflects current deployment topology after a freshnpm run ai:backup.Commits
5529c2fca— feat(ai/backup): extend bundle-meta + integrity check + mailbox (#10871)