Skip to content

Re-measure one-hop related-schema enrichment at higher power (0%->33% at n=9 in #1817) #1834

Closed

Description

@malibio

Overview

Split out of #1817, which measured three context-block enrichment axes and found two clean nulls (field types, relationships) and one candidate signal too underpowered to act on: one-hop related-schema enrichment took node-type selection from 0% to 33% on queries naming no type at all, at n=9.

This issue is a measurement issue, matching #1817's own framing — the goal is enough power to say yes or no with confidence, not to implement the enrichment.

Why this one axis, and not the other two

#1817's field-types and relationships arms are clean, mechanistically-explained nulls (argument shape is governed by tool schemas, not the context block; the model already spawns separate nodes for named counterparties regardless of what the block says). Re-running those would not change the answer.

The related-schema arm is different: it's the only axis where enrichment did what it was designed to do, and the sample is too small to trust the number. 3 hits out of 9 could be sampling noise as easily as a real 33% baseline.

Evidence from #1817

axis baseline targeted arm n
one-hop related schemas 0% (0/9) 33% (3/9) 9

Setup: real E4B via the production OAI-compat tool-calling path, tool descriptions copied verbatim from packages/agent/src/local_agent/tools.rs, scenarios scored on exactly one tool call so a miss is attributable to the block. Harness lives at nodespace-nlp-experiment/src/context_enrichment.rs (--experiment context-enrichment), not committed (separate scratch repo).

Acceptance Criteria

Architecture Impact

None yet — this is confirmatory measurement. If confirmed, the eventual implementation issue would touch packages/core/src/ops/context_ops.rs:150 (currently field-names-only) and would need to weigh the ~2x block-size cost against the resident-prompt-size lesson from ADR-064 (larger context measurably degraded behavior elsewhere in this system).

Activity

  1. malibio commented on Jul 31, 2026

    @malibio
    CollaboratorAuthor

    Re-measured at n=36 — SIGNAL confirmed, filing implementation issue

    Split the harness into a dedicated module (context_enrichment_related.rs, --experiment context-enrichment-related) rather than editing #1817's original context_enrichment.rs in place, so that measurement stays reproducible as-is. Only the two arms relevant to this axis run (baseline, +related) — +types and +relationships are not re-run since #1817 already produced clean, mechanistically-explained nulls for both.

    Decision rule, fixed before running (per this workstream's standing pattern): n >= 30 scored trials, SIGNAL if related-arm accuracy exceeds baseline by >= 20 percentage points, NULL otherwise.

    Harness-validation gate: reused debug_assert_arms_differ (not rebuilt), extended to also assert each scenario's expected type is genuinely one-hop-reachable and absent from the retrieved set. Runs as a #[test], passes clean — 6 tests total including a scenario_count_times_trials_meets_min_n guard against an underpowered run by construction.

    Corpus widened: 8 schemas -> 16. Added a second, independent hub (property_unit, mirroring customer's inbound-only shape in a different domain), an outgoing chain (project -> milestone), and a schema with two distinct outgoing relationships (purchase_order -> vendor, warehouse) — guards against the original result being an artifact of one corpus built around a single hub.

    Scenarios widened: 3 -> 12, spanning 6 distinct retrieved-schema hubs (was 1). 12 scenarios x 3 trials = 36 scored generations, all non-empty.

    Result

    baseline + one-hop related
    accuracy 0.0% (0/36) 27.8% (10/36)
    avg prompt tokens 463 488 (+25, +5%)

    Delta: +27.8pp, clears the 20pp threshold at n=36.

    Token cost is much smaller in absolute terms than #1817's char-count estimate implied (83->168 chars) — the block itself is a small fraction of the full prompt once the fixed system identity and tool schemas are included, so the realized cost is +5% total prompt tokens, not a doubling.

    Replicates #1817's direction (0%->33% at n=9) at 4x the sample size and across hub shapes beyond the original customer corpus.

    Recommendation

    Per acceptance criteria: this is SIGNAL, not a null, so it does not close via the null path. Filing a separate implementation issue for context_ops.rs::format_for_prompt's one-hop traversal, per the issue's own instruction not to implement here. Closing this issue once that's filed.

    Harness: nodespace-nlp-experiment/src/context_enrichment_related.rs (--experiment context-enrichment-related), not committed — same disposable scratch space as #1817's harness.

  2. malibio commented on Jul 31, 2026

    @malibio
    CollaboratorAuthor

    Filed #1837 for the implementation. Closing this measurement issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions