OpenMind v2 Phase 7: Git Change Intelligence, Branch/PR Overlays and Evidence-Bound Impact Analysis#13
Merged
Merged
Conversation
…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.
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.
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 headv0007 → v0008;.openmindstays1.1.0; Knowledge Bundle stays2.0.0-draft.2; new Change Impact Packet1.0.0-draft.1.What changed & why
openmind/git/— the Git reader. Onesubprocess.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-optionsso a hostile value can never become a Git option; no command contacts a remote. Plus repository discovery (portablegit:<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 (reusessegment_source, no parser duplication), immutableoev_before/after Evidence, composed Base+overlay search with masked superseded paths, a read-onlyGraphViewport withCanonicalGraphView/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 (unknownnever 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_projectextended to wipe overlay data.Adapters —
git/overlay/pr/impactCLI groups, 23 additive REST routes, 8 read-only MCP tools (43 → 51), and a standalonepython -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
verify_git_security(38),verify_overlay_model(26, incl. measured zero canonical drift),verify_impact_packet(27),verify_overlay_adapters(41). Registered inrun_acceptance.py, the CI Ubuntu gate, and a cross-platform overlay smoke.v0008head (they pinned 43 tools /v0007/1.6.0-dev).Reviewer notes
OverlayService(fully functional); thegit_overlay_*job types are not yet wired to the worker.docs/v2/phase-7-progress.md.Design and full guarantees:
docs/v2/phase-7-git-overlays.md.