LearnNewsExamplesServices
Frontmatter
id15125
titleRestore Concept Ontology projection fidelity
stateOpen
labels
bugdocumentationaitestingarchitecture
assigneesneo-gpt
createdAt12:45 PM
updatedAt1:21 PM
githubUrlhttps://github.com/neomjs/neo/issues/15125
authorneo-gpt
commentsCount0
parentIssue14472
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
milestonev13.2

Restore Concept Ontology projection fidelity

Open Backlog/active-chunk-5 bugdocumentationaitestingarchitecture
neo-gpt
neo-gpt commented on 12:45 PM

Context

A deep live audit while reconciling Discussion #9739 on 2026-07-13 found that Neo's version-controlled Concept Ontology and its SQLite projection have materially diverged. The architecture is real and load-bearing for Golden Path v2, but the runtime graph no longer faithfully contains the curated relationship set.

This is a bounded repair leaf under #14472, not a new concept-graph architecture. It restores the existing JSONL → Native Edge Graph contract before more GP2 consumers depend on it. The structured Epic-review cap is already satisfied by Euclid's review and Emmy's review.

Live duplicate sweep: latest-open issues, all-state A2A claims, GitHub/Knowledge-Base/Memory-Core history, and the archived #10085 projection-test precedent were checked. No equivalent open ticket exists. #14508 is adjacent but distinct: it decides MEMORY→CONCEPT anchoring and promoted-edge protection; this leaf repairs the already-committed ontology projection.

The Problem

The committed ontology currently declares 65 concept rows and 182 typed relationships. The audited local live SQLite graph contains only 98 matching relationship tuples:

Edge type Declared Live exact matches
PARENT_CONCEPT 53 18
REQUIRES 14 0
EXPLAINED_BY 61 39
IMPLEMENTED_BY 44 36
ANALOGOUS_TO 10 5

Every surviving matching ontology edge has weight 0.8337477621301497 (0.98^9): ambient decay has run while missing relationships were not reconciled.

Five defects compose the drift:

  1. ConceptIngestor.CONCEPT_EDGE_TYPES omits REQUIRES, so all 14 prerequisite relationships are filtered out.
  2. computePayloadHash() hashes concept-node fields only. A matching node hash skips both the node upsert and outbound-edge work, so edge-only JSONL edits and missing live tuples are invisible.
  3. replaceOutboundConceptEdges() deletes every outbound edge whose type belongs to the ontology vocabulary. It has no machine-readable source owner, so unconditional reconciliation could delete same-type relationships from another producer.
  4. Ontology targets use author-facing file:<path> syntax while FileSystemIngestor owns canonical runtime IDs as file-<path>. The live graph contains 63 sampled dual identities across 91 ontology file targets; 13 unique target paths are stale across 16 rows.
  5. Projected edges carry only an optional note; they omit #14422/#14472's graduation-carried four-axis contract (authority, fidelity, extraction provenance, lifecycle).

ADR 0024 §2.7 and learn/agentos/ConceptOntology.md also describe the retired inline per-message extraction path rather than the scheduled bounded harvester shipped by PR #13968.

The Architectural Reality

  • .neo-ai-data/concepts/{nodes,edges}.jsonl is the curated, PR-reviewable source.
  • ConceptIngestor owns projection and source-owned tuple reconciliation.
  • FileSystemIngestor owns canonical runtime file identity.
  • GraphService.decayGlobalTopology() owns independent salience-weight decay and pruning.
  • Gap inference, neighborhood walks, concept-anchored retrieval, and GP2 consumers read the projected graph.
  • Discussion #14422 Matrix-1 already permits source re-derivation while reserving promoted-edge protection for #14508. Membership and salience must therefore stay separate: surviving live edges keep their IDs and decayed weights; a still-declared but missing JSONL-owned tuple is re-derived.

The structure-map gate found the existing ingestion services and focused specs to be the correct owner. No new service or directory is required.

The Fix

  1. Add the complete accepted ontology vocabulary, including REQUIRES, to the projection registry.
  2. Give each projected edge a machine-readable projectionSource: 'concept-ontology-jsonl' plus four separate axes values:
    • authority: {trustTier: 'repo-trusted'}
    • fidelity: {sourceTier: 'curated', degraded: false}
    • extractionProvenance: {source: 'concept-ontology-jsonl', curated: true}
    • lifecycle: {state: 'promoted'}
  3. Replace wholesale edge replacement with tuple-level source-owned reconciliation:
    • compare (source, normalizedTarget, type) on every sync, independently of node payload hashing;
    • preserve the ID and current weight of a matching live tuple;
    • add a missing declared tuple at its initial weight (the source-re-derivation branch);
    • remove a no-longer-declared tuple only when its source ownership is proven;
    • preserve same-type edges explicitly owned by another producer;
    • update notes/axes without reinforcing or resetting weight.
  4. Migrate legacy ingestor output once. A ConceptIngestor-managed source node without the new projection-version marker may adopt its legacy ontology-typed outbound edges because current and historical code has only one producer for those types. After migration, source ownership is explicit and all later deletion is marker-bound.
  5. Move the file-<path> identity calculation behind a reusable FileSystemIngestor method and consume it from ConceptIngestor. Author-facing JSONL keeps file: syntax; runtime projection uses one canonical file- identity. Validate containment, existence, and regular-file status before an edge can become evidence.
  6. Repoint valid legacy file: edges; retire only verified isConceptEdgeStub:true nodes with zero incident edges. Never delete an unproven or still-referenced node.
  7. Correct the 13 unique stale file paths (16 rows) to their verified current locations while retaining the 182-row relationship set.
  8. Amend ADR 0024 §§2.3/2.6/2.7 and the Concept Ontology guide: source-owned relationship membership is re-derived; live weight still decays; scheduled harvesting is the current discovery path.

GraphService.PROTECTED_EDGE_TYPES does not change. GraphService.linkNodes() is not used for reconciliation because it reinforces existing edges and would corrupt both idempotency and decay.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
Curated ontology relationship membership .neo-ai-data/concepts/edges.jsonl; D#14422 source-re-derivation branch One normalized, source-owned live tuple for every valid declared row; matching tuples preserve ID/weight Invalid rows are reported with the exact source row and reason; never claim a full successful sync ADR 0024 + Concept Ontology Edge-only, missing-live, deletion, idempotency, full-fixture specs
Projection ownership + four axes D#14422 OQ6; #14472 carried constraints projectionSource and all four unflattened axes ride every projected edge Unknown/foreign owner is preserved, never silently adopted after migration JSDoc + ADR 0024 Foreign same-type preservation + axis-shape specs
Runtime file identity New internal FileSystemIngestor resolver, specified by this issue; existing file-<path> convention JSONL file: syntax resolves to canonical runtime file- identity Missing/out-of-root/non-file path is an integrity finding and never a coverage witness Concept Ontology Resolver parity, dual-ID migration, missing-path specs
Relationship salience ADR 0024 + D#14422 Matrix-1 Existing weight continues to decay; reconciliation does not reinforce surviving tuples A pruned but still-declared source tuple is recreated; global protection remains #14508-owned ADR 0024 Forced decay/prune plus surviving-weight-preservation specs
Gap evidence admission GapInferenceEngine + canonical graph identity Only canonical, existing targets can clear source/guide gaps Invalid target leaves the gap visible and cites its integrity reason Relevant JSDoc Missing-path false-clear regression

Decision Record Impact

Amends ADR 0024 §§2.3, 2.6, and 2.7. Fresh V-B-A proved that the blanket “concept edges decay” description is incomplete for a committed source projection. This leaf records the distinction already allowed by Discussion #14422: source-owned membership is re-derived while salience weight remains decaying. It does not add ontology types to PROTECTED_EDGE_TYPES, select #14508's MEMORY→CONCEPT anchoring option, or pre-empt promoted-edge protection.

No new Decision Record is needed; the existing ADR is amended in the implementation PR.

Acceptance Criteria

  • REQUIRES projects through the canonical registry; the current 14-row fixture produces 14 live relationships.
  • Node payload hashing remains a node-upsert optimization only; edge-only JSONL changes reconcile while unchanged concept nodes stay skipped.
  • Every projected edge has projectionSource: 'concept-ontology-jsonl' and the four separate axis objects; no composite score exists.
  • A matching live edge retains its ID and decayed weight across sync.
  • Removing a declared live edge and syncing recreates it without changing global protection policy.
  • A same-type edge carrying a foreign projection owner survives reconciliation unchanged.
  • Removing a row from JSONL removes only the proven JSONL-owned tuple.
  • The one-time legacy migration adopts/removes only historically provable ConceptIngestor output and stamps the projection version.
  • All 182 baseline rows retain an explicit disposition; after stale-path corrections every declared row is either a normalized live tuple or a deterministic exact-row integrity result. Silent omission count is zero.
  • JSONL file: references resolve to canonical file- nodes; ConceptIngestor creates no parallel file: FILE stubs.
  • The 13 unique stale paths are corrected to verified current targets across their 16 rows; none can false-clear a gap.
  • Legacy cleanup leaves zero dangling edges and removes only unreferenced verified stubs.
  • Focused specs cover REQUIRES, edge-only mutation, external deletion, post-decay restoration, weight/ID preservation, foreign-owner preservation, canonical file identity, missing-path false-clear, migration cleanup, full-fixture parity, and idempotency.
  • ADR 0024 and learn/agentos/ConceptOntology.md describe scheduled harvesting and the membership-versus-weight contract accurately.
  • PR evidence includes the exact live tuple audit before/after repair and Refs #14472.

Out of Scope

  • Promoting the historical auto-extracted population into the curated hierarchy.
  • Changing guide semantic-adequacy policy.
  • Turning graph gaps into Golden Path ranking authority.
  • Selecting #14508's MEMORY→CONCEPT anchoring or global promoted-edge protection option.
  • A general ontology editor, cycle validator, or graph-schema registry.

Avoided Traps

  • Hash edges and keep the skip: a stored source hash cannot detect a live tuple removed after ingestion.
  • Delete every ontology-typed outbound edge: that erases source ownership and can destroy another producer's data.
  • Reinsert every edge every cycle: resets decay and destroys idempotency.
  • Use GraphService.linkNodes() for reconciliation: its reinforcement semantics increase existing weights.
  • Protect every ontology edge globally: pre-empts #14508 and collapses membership into salience.
  • Keep file: stubs beside file- nodes: preserves split, stale evidence.
  • Call 98/182 an acceptable decay snapshot: deterministic GP2 consumers require an honest source-membership boundary.

Related

Parent: #14472
Decision sibling: #14508
Historical ontology epic: #10030
Historical projection tests: #10085
Prior canonicalization: #14502
Prior coverage repair: #14349
Archaeological source: Discussion #9739
Graduation authority: Discussion #14422

Origin Session ID: 837ad74b-c2d2-413d-9aab-b7165a93a82a

Retrieval Hint: ConceptIngestor source-owned tuple reconciliation REQUIRES decayed weight canonical file identity four axes
Retrieval Hint: Discussion 9739 Concept Ontology projection live audit