OpenMind v2 Phase 5: canonical Engineering Knowledge Graph, candidate promotion and Knowledge Bundle 2.0 Draft#11
Merged
Conversation
… promotion and Knowledge Bundle 2.0 Draft Design: docs/v2/phase-5-knowledge-graph.md. Runtime 1.5.0-dev; schema head v0005 -> v0006 (additive, Phase 1-4 data preserved); artifact schema stays 1.1.0; the Knowledge Bundle has its own draft version 2.0.0-draft.1. Canonical graph (openmind/knowledge/): - closed vocabularies for entity/claim/relation types, relation states, lifecycle, authority and origin; unknown values fail typed at write boundaries (no depends-on relation on purpose) - engineering_entities with UNIQUE(workspace, type, canonical_key) identity, aliases (collisions reported, never silent), source bindings, claims with normalized-statement dedup + verified evidence-quote joins, relations with active-tuple idempotency + provenance - one graph transaction = one monotonic per-workspace Knowledge Revision (failed tx = none; concurrent writers serialize on the shared lock); every governance write records an immutable Human Decision with a caller-supplied actor (never inferred) - explicit promotion as the only candidate bridge: plan is a deterministic dry-run; eligibility (confirmed + active + verified + current revisions + unambiguous endpoints + not already promoted) is re-checked inside the transaction; idempotent; no bypass flags; conflict candidates cannot be promoted; classification/revision-status promotions never touch asset types or revision statuses - deterministic model-free projector (assets/segments/containment/call edges with preserved ambiguity/exact facet topics) with incremental sync: unchanged source hash writes nothing and mints no revision - staleness reconciliation (indexed, incremental, revival-capable) hooked after ingest/document commits and worker startup - governance: manual create (evidence required), authority marking, supersede/withdraw, reject/restore, transactional merge (source stays addressable) and explicit split (all-or-nothing) - bounded deterministic traversal (expand/path/subgraph) with honest truncated/no-path outcomes; exact-first graph search over a separate knowledge_<ws> vector collection (code/document collections untouched) - Knowledge Bundle 2.0 Draft exporter + standalone stdlib-only verifier (python -m openmind.bundle_verify) Adapters: graph/promotion/entity/claim/relation/bundle CLI groups + knowledge history subcommands; additive REST routes under /projects/...; exactly nine additive read-only MCP tools (26 + 9 = 35). Tests: 15 new acceptance suites (~360 checks) registered in the manifest; CI full gate + cross-platform knowledge smoke extended; docs updated (README, cli.md, database-migrations.md).
verify_migrations: head v0005 -> v0006 (+ legacy-baseline graph-table checks); verify_adapters / verify_asset_adapters: account for the nine additive read-only graph MCP tools in the accounted-for unions; verify_semantic_adapters: registration total 26 -> 26+9; document CLI + adapter compat checks: schema head 6 and runtime 1.5.0-dev. No production code in this commit — only the accounting the new phase moves.
…zero tables Since v0006 the canonical graph tables legitimately exist; the Phase 3 invariant that candidate association persists NO canonical Claim/Relation is now checked as row emptiness rather than table absence.
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.
What this is
Phase 5 of the v2 enterprise knowledge layer: the first canonical graph on top of the Phase 4 candidate plane. Design document:
docs/v2/phase-5-knowledge-graph.md. Runtime1.4.0-dev -> 1.5.0-dev; schema headv0005 -> v0006(purely additive);.openmindartifact stays frozen at1.1.0; the new Knowledge Bundle carries its own draft version2.0.0-draft.1.What changed
Canonical graph (
openmind/knowledge/, migrationv0006)engineering_entitieswith logical identityUNIQUE(workspace, entity_type, canonical_key), plus aliases (normalized; collisions reported, never silently attached) and source bindings (workspace-validated, staleness-aware).engineering_claimswith normalized-statement dedup and verified evidence-quote joins — a quote that is not a substring of the immutable snapshot is rejected. Corrections supersede; nothing rewrites history.engineering_relationswith closed types (deliberately nodepends-on), statesexplicit/inferred/confirmed/rejected/stale/superseded, active-tuple idempotency, andpossibly-relatednever presented as anything stronger.Promotion — the only bridge from candidates to canon
promotion plan/promotion promote(+ relation variants): plan is a deterministic zero-write dry-run; promotion re-checks review status, staleness, evidence verification and endpoint resolution inside the transaction, is idempotent, and has no bypass flags.semantic review confirmstill changes candidate metadata only. Conflict candidates cannot be promoted (Phase 6). Classification / revision-status promotions never touchassets.asset_typeorasset_revisions.status.Deterministic projection (
graph seed/graph sync)explicit; name-based call edgesinferredwith ambiguity preserved. Incremental: an unchanged source hash writes nothing and mints no revision. Generic documents never become Requirements; test-source methods never become Test Cases.Staleness, governance, search
knowledge_<ws>vector collection with deterministic fusion: exact canonical key > exact alias > exact identifier token > lexical > vector — an exact identifier can never be outranked by similar-looking text. Bounded deterministic expansion, shortest paths with evidence summaries and honestfound/no-path/truncatedoutcomes.Bundle 2.0 Draft
openmind bundle exportwrites a deterministic.openmind-v2/(JSONL + JSON schemas + SHA-256-hashed manifest);python -m openmind.bundle_verifyis a standalone stdlib-only verifier that catches missing endpoints, missing evidence and hash mismatches. No secrets, prompts, provider profiles or absolute paths.Adapters
graph,promotion,entity,claim,relation,bundlegroups +knowledge revisions|revision|decisionsbeside the untouched Phase 3knowledge search./projects/...(graph search lives at/knowledge/graph-search; the Phase 3POST /knowledge/searchis untouched).Verification
main: 48/48 core acceptance scripts.python scripts/run_acceptance.py-> 63 passed, 0 failed, 0 skipped (15 newverify_knowledge_*suites, ~360 checks, all registered in the manifest — a missing registration fails the run).verify_delete_responsive(local tier): 8/8.Notes for review
verify_knowledge_migrationbuilds a real v0005 database, seeds representative rows and migrates it to v0006.semantic_candidates: the promoted candidate id is provenance, not ownership, so canonical history can never be cascade-deleted through the Phase 4 tables.1.5.0-dev, 35 tools, andverify_document_search's canonical-table guard now asserts zero rows rather than zero tables — the tables legitimately exist now, the invariant that candidate association persists nothing canonical is unchanged).graph pathis generic reachability, not formal Requirement Traceability (Phase 6); conflict candidates remain unresolved candidates; the Bundle's--knowledge-revision Nfilters by creation-revision stamps and does not reconstruct point-in-time lifecycle states (stated in the manifest); Bundle 2.0 remains a Draft, not a frozen contract.