Skip to content

OpenMind v2 Phase 7: Git Change Intelligence, Branch/PR Overlays and Evidence-Bound Impact Analysis#13

Merged
HelloThisWorld merged 2 commits into
mainfrom
feat/v2-phase7-git-overlays
Jul 23, 2026
Merged

OpenMind v2 Phase 7: Git Change Intelligence, Branch/PR Overlays and Evidence-Bound Impact Analysis#13
HelloThisWorld merged 2 commits into
mainfrom
feat/v2-phase7-git-overlays

Conversation

@HelloThisWorld

Copy link
Copy Markdown
Owner

Summary

Phase 7 adds an isolated, read-only Git Overlay plane: it projects a branch, pull request, commit-range or working-tree change onto a coherent snapshot of the canonical Base Workspace and reports evidence-cited impact — without ever mutating Git, contacting a remote, or writing a single canonical row.

Runtime 1.6.0-dev → 1.7.0-dev; migration head v0007 → v0008; .openmind stays 1.1.0; Knowledge Bundle stays 2.0.0-draft.2; new Change Impact Packet 1.0.0-draft.1.

What changed & why

openmind/git/ — the Git reader. One subprocess.run(shell=False) boundary with a read-only allow-list (rev-parse, diff, cat-file, merge-base, …); forbidden families (checkout/reset/merge/fetch/push/config/…) are denied before a process spawns. Refs are validated and resolved via --verify --end-of-options so a hostile value can never become a Git option; no command contacts a remote. Plus repository discovery (portable git:<rel> keys; absolute roots stay machine-local), coherent Git baselines, and diff/hunk/content extraction covering rename/copy/binary/symlink/submodule/Git-LFS.

openmind/overlays/ — the overlay plane. Overlay store/builder, bytes-based segmentation (reuses segment_source, no parser duplication), immutable oev_ before/after Evidence, composed Base+overlay search with masked superseded paths, a read-only GraphView port with CanonicalGraphView/OverlayGraphView, a graph-delta projector keyed on the exact canonical identity functions, Requirement/Test/Trace/Gap impact (reverse Base traceability revalidated against the virtual graph), Conflict impact (Phase 6 comparable-fact detectors over changed subjects only), deterministic rule-based risk (unknown never downgraded), a byte-deterministic Change Impact Report + Packet, and explicit post-merge reconciliation (never merges, never auto-promotes).

Migration v0008 — 13 additive tables. FKs cascade only within an overlay; none into any canonical table. delete_project extended to wipe overlay data.

Adaptersgit/overlay/pr/impact CLI groups, 23 additive REST routes, 8 read-only MCP tools (43 → 51), and a standalone python -m openmind.impact_verify.

Isolation is the headline guarantee

Building an overlay changes zero canonical rows — assets/graph/trace/conflict tables and the Knowledge Revision ledger are provably untouched (measured drift: NONE). Overlay delete cascades only overlay data. Projected gaps/conflicts are never written to canonical tables; tests are recommended, never executed.

Testing

  • New CORE suites: verify_git_security (38), verify_overlay_model (26, incl. measured zero canonical drift), verify_impact_packet (27), verify_overlay_adapters (41). Registered in run_acceptance.py, the CI Ubuntu gate, and a cross-platform overlay smoke.
  • Updated the adapter/migration compatibility tests for the additive MCP tools and the v0008 head (they pinned 43 tools / v0007 / 1.6.0-dev).
  • Full acceptance suite: 83 passed, 0 failed, 0 skipped (all tiers) — 79 Phase 1–6 (regression-free) + 4 Phase 7.

Reviewer notes

  • All 43 existing MCP tools keep their names/args/behavior; the 8 new tools are read-only and provisional (docstrings say so). CI's MCP smoke now asserts 51.
  • The overlay build runs synchronously in OverlayService (fully functional); the git_overlay_* job types are not yet wired to the worker.
  • Requirement/Conflict impact depth is bounded by what the canonical graph records — on a minimal graph it correctly reports empty rather than inventing links. The mechanism is validated end-to-end; a richer requirement→code fixture for finer-grained impact assertions is noted as follow-up in docs/v2/phase-7-progress.md.
  • No Git mutation, no remote contact, no provider call anywhere in the overlay build/impact path.

Design and full guarantees: docs/v2/phase-7-git-overlays.md.

…Evidence-Bound Impact Analysis

Add an isolated, read-only Git Overlay plane that projects a branch, PR,
commit-range or working-tree change onto a coherent snapshot of the canonical
Base Workspace and reports evidence-cited impact — without ever mutating Git,
contacting a remote, or writing a single canonical row.

What's new
- openmind/git/: one subprocess boundary (shell=False, read-only allow-list,
  forbidden families denied before spawn, controlled env, bounded output/
  timeout, no remote), ref validation via --verify --end-of-options, repository
  discovery with portable git:<rel> keys (absolute roots stay machine-local),
  coherent Git baselines, diff/hunk/content extraction (rename/copy/binary/
  symlink/submodule/LFS), and GitService.
- openmind/overlays/: overlay store/builder, bytes-based segmentation (reuses
  segment_source), immutable oev_ before/after Evidence, composed search, a
  read-only GraphView port with Canonical/Overlay views, graph-delta projector,
  Requirement/Test/Trace/Gap/Conflict impact, deterministic rule-based risk,
  byte-deterministic Change Impact Report + Packet, post-merge reconciliation,
  and OverlayService.
- Migration v0008: 13 additive tables; FKs cascade only within an overlay, none
  into canonical tables; delete_project extended to wipe overlay data.
- Adapters: git/overlay/pr/impact CLI groups, 23 additive REST routes, 8
  read-only MCP tools (43 -> 51), standalone openmind.impact_verify.
- Runtime 1.6.0-dev -> 1.7.0-dev; .openmind stays 1.1.0; Bundle stays
  2.0.0-draft.2; Change Impact Packet 1.0.0-draft.1.

Isolation is the headline guarantee: building an overlay changes zero canonical
rows (assets/graph/trace/conflict tables and the revision ledger are provably
untouched), and overlay delete cascades only overlay data.

Tests
- New CORE suites: verify_git_security (38), verify_overlay_model (26,
  incl. measured zero canonical drift), verify_impact_packet (27),
  verify_overlay_adapters (41). Registered in run_acceptance.py + CI Ubuntu gate
  and a cross-platform overlay smoke.
- Updated the adapter/migration compatibility tests for the additive tools and
  the v0008 head.
- Full acceptance suite: 83 passed, 0 failed, 0 skipped (all tiers).

Docs: design (docs/v2/phase-7-git-overlays.md), progress ledger, README, cli.md
and database-migrations.md.
canonical toplevel differ

On macOS a temp workspace root is /var/folders/... but `git --show-toplevel`
returns the canonicalized /private/var/folders/... (the /var -> /private/var
symlink); on Windows a short 8.3 name or drive-case can diverge similarly.
`machine.relativize` then can't strip the workspace root, so the full absolute
path leaked into the repository key instead of yielding `git:.` — which broke
baseline capture (macOS) and overlay creation's `git:.` lookup (Windows) in the
cross-platform CI smoke.

Discovery now canonicalizes BOTH the workspace root and the Git toplevel via
realpath before computing the portable key and relative root, and resolve_root
gains a realpath fallback for the symlinked-root case. Ubuntu was unaffected
(no such divergence). Verified: differing spellings collapse to git:. /
git:services/x; verify_overlay_model + verify_git_security still green.
@HelloThisWorld
HelloThisWorld merged commit b35b0db into main Jul 23, 2026
6 checks passed
@HelloThisWorld
HelloThisWorld deleted the feat/v2-phase7-git-overlays branch July 23, 2026 19:30
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.

1 participant