Repository navigation
Description
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
- Re-run the same arm at n≥30, following this workstream's standing decision-rule pattern: fix the threshold and sample size before running
- Reuse the existing harness-validation gate (
debug_assert_arms_differ) rather than rebuilding it — it already caught two real bugs in Measure whether context-block enrichment (types, relationships, related schemas) helps #1817 and should run before any scored generation here too - Report token cost alongside accuracy, same as Measure whether context-block enrichment (types, relationships, related schemas) helps #1817 — the related-schema arm roughly doubled block size (83→168 chars), and a gain has to earn that back
- Widen scenario diversity if practical — Measure whether context-block enrichment (types, relationships, related schemas) helps #1817's 9 scenarios were drawn from one 8-schema corpus; more schemas/relationship shapes would guard against the result being an artifact of that specific corpus
- A null at higher power is an acceptable outcome and closes this issue without implementation — same standing rule as Measure whether context-block enrichment (types, relationships, related schemas) helps #1817
- Only if the effect holds at n≥30: file a separate implementation issue for
context_ops.rs::format_for_prompt's one-hop traversal. Do not implement in this issue.
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
malibio commentedon Jul 31, 2026
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 originalcontext_enrichment.rsin place, so that measurement stays reproducible as-is. Only the two arms relevant to this axis run (baseline,+related) —+typesand+relationshipsare 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 ascenario_count_times_trials_meets_min_nguard against an underpowered run by construction.Corpus widened: 8 schemas -> 16. Added a second, independent hub (
property_unit, mirroringcustomer'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
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
customercorpus.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.malibio commentedon Jul 31, 2026
Filed #1837 for the implementation. Closing this measurement issue.
Add one-hop related-schema traversal to the context block (#1849)