LearnNewsExamplesServices
Frontmatter
id12639
titleBound VALIDATES edge precision before reward use
stateClosed
labels
enhancementaitestingarchitecturemodel-experience
assigneesneo-gpt
createdAtJun 6, 2026, 5:46 PM
updatedAtJun 6, 2026, 6:59 PM
githubUrlhttps://github.com/neomjs/neo/issues/12639
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 6, 2026, 6:59 PM

Bound VALIDATES edge precision before reward use

Closed v13.0.0/archive-v13-0-0-chunk-16 enhancementaitestingarchitecturemodel-experience
neo-gpt
neo-gpt commented on Jun 6, 2026, 5:46 PM

Context

PR #12638 delivered #9906 by adding durable TEST FILE -> VALIDATES -> CLASS edges in the Native Edge Graph. The cross-family review approved the PR and treated the precision concern as non-blocking because #9906 needed the relation contract first, but the concern becomes load-bearing before any reward / gap-downgrade consumer treats VALIDATES as stronger than token-heuristic evidence.

Live latest-open sweep: checked the latest 20 open issues on 2026-06-06 before filing; no equivalent found. Exact live duplicate search for VALIDATES edge token match precision returned no issues. Local issue/discussion sweep found related historical anchors (#9906, #9889, #10035, #9904) but no ticket for this post-#12638 precision bound. Knowledge Base semantic ticket sweep was attempted and unavailable (collection not found), so the filing relies on live GitHub + local synced substrate evidence.

The Problem

Current GapInferenceEngine.inferTestGapsFromSession() uses the same broad node-token regex predicate for two different claims:

  • no token match -> emit [TEST_GAP]
  • any token match -> suppress [TEST_GAP] and create a VALIDATES edge

That predicate is false-negative-tolerant for gap detection, but the inverse is false-positive-sensitive for graph evidence. Example risk from the review: a structural node named ButtonFeature tokenizes to button + feature; a path such as test/.../ButtonStore.spec.mjs can match button and receive a VALIDATES edge even though it does not validate ButtonFeature.

This matters because VALIDATES is now a structural relation. Once downstream RLAIF / reward / gap-downgrade consumers read it, a broad token match can become overconfident evidence.

The Architectural Reality

Current origin/dev after #12638:

  • ai/services/graph/GapInferenceEngine.mjs tokenizes structural node names and matches any token against test/ file paths before calling linkTestEvidenceToStructuralNode().
  • linkTestEvidenceToStructuralNode() writes VALIDATES edges with metadata: evidenceKind, evidencePath, inferredBy, validatedNodeName, and validatedNodeType.
  • test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjs covers the positive exact-match case (ButtonFeature -> ButtonFeature.spec.mjs) but not the sibling-token false-positive class.
  • learn/agentos/DreamPipeline.md and learn/benefits/ArchitectureOverview.md document the current behavior as token match -> VALIDATES edge.

The Fix

Tighten the VALIDATES creation predicate or explicitly classify its confidence so downstream consumers cannot mistake broad token evidence for direct validation.

Preferred implementation shape:

  1. Extract the test-file matching predicate into a small helper on GapInferenceEngine so the same logic is named, documented, and unit-tested.
  2. Require stronger evidence for VALIDATES than a single shared token when the structural node has multiple significant tokens. For example: exact normalized basename match, all significant tokens present in the basename/path segment, or an equivalent source-grounded predicate.
  3. Preserve [TEST_GAP] behavior for genuinely uncovered nodes.
  4. Add a negative fixture where two structural nodes share one token and only one test file exists; verify only the actually-covered node receives VALIDATES.
  5. Update Dream Pipeline / Architecture Overview wording so consumers understand the evidence contract.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
GapInferenceEngine test-file match predicate #9906 delivered relation contract + PR #12638 review follow-up VALIDATES creation requires stronger evidence than one shared token for multi-token structural names If only broad token evidence exists, keep or emit [TEST_GAP] rather than creating overconfident VALIDATES JSDoc on helper Unit fixture with sibling-token false-positive candidate
VALIDATES edge metadata Current linkTestEvidenceToStructuralNode() metadata Metadata remains durable and may add confidence/match-kind only if needed by the chosen predicate Existing metadata remains sufficient if predicate is made precise DreamPipeline.md, ArchitectureOverview.md Unit assertions on edge metadata
Downstream graph consumers RLAIF / Dream Pipeline graph evidence flow Consumers may treat VALIDATES as durable evidence only after the precision bound lands Before this ticket lands, treat VALIDATES as token-heuristic evidence Docs wording Post-merge docs + tests

Decision Record impact

Aligned with the Native Edge Graph / Dream Pipeline architecture. No ADR amendment required.

Acceptance Criteria

  • GapInferenceEngine has a named, documented predicate for test-file evidence matching.
  • A sibling-token false-positive fixture proves ButtonFeature does not receive VALIDATES from a ButtonStore-style test path.
  • The positive exact-match VALIDATES fixture from #12638 still passes.
  • [TEST_GAP] still emits for uncovered structural nodes.
  • learn/agentos/DreamPipeline.md and learn/benefits/ArchitectureOverview.md describe the tightened evidence contract or confidence semantics.
  • Focused unit verification runs against the existing DreamService / GapInferenceEngine test surface.

Out of Scope

  • Replacing all test-discovery heuristics with a full parser or coverage engine.
  • Changing GraphService.linkNodes semantics.
  • Adding reward / gap-downgrade consumers for VALIDATES.
  • Reopening #9906; #9906 delivered the first relation contract and remains complete.

Avoided Traps

  • Treating all token matches as equal evidence. Good enough for a gap heuristic is not automatically good enough for a structural validation edge.
  • Deleting the heuristic entirely. The Dream Pipeline still needs lightweight test discovery; the goal is a precision bound, not a full coverage rewrite.
  • A tiny docs-only clarification. The graph predicate and unit fixture must move together; docs alone would leave the overconfident edge path intact.

Related

  • #12638 — delivered #9906 and surfaced this follow-up in review.
  • #9906 — original TEST -> VALIDATES -> CLASS relation contract.
  • #9904 — parent RLAIF / Dream topology context.
  • #10035 — prior GapInferenceEngine move away from fragile regex concept matching.

Origin Session ID

dbb1a88c-987f-4519-9645-8f13e9d71000

Handoff Retrieval Hints

  • query_raw_memories(query="VALIDATES edge token match precision GapInferenceEngine false positive")
  • query_summaries(query="PR 12638 VALIDATES precision follow-up")
  • Source anchors: GapInferenceEngine.inferTestGapsFromSession, linkTestEvidenceToStructuralNode, DreamService.spec.mjs inferTestGapsFromSession links matching test files via VALIDATES edges (#9906).
tobiu referenced in commit c8db8f6 - "fix(agentos): bound validates edge precision (#12639) (#12643)" on Jun 6, 2026, 6:59 PM
tobiu closed this issue on Jun 6, 2026, 6:59 PM