Repository navigation
Description
Overview
Make NodeSpace's assembly line produce the tuned golden prompts in packages/agent/goldens/ (#2122). Done when #2119's snapshot gate passes.
This issue is the plumbing side. It does not decide what the prompt should say — that is settled in #2122 by measurement. The target already exists byte-exact; the work is making assembly emit it.
What this is actually about (revised after #2122)
This issue was originally scoped as "retarget guidance and tool-schema examples to the dev domain." That framing is now wrong and would send an implementer looking for invoice strings to find-and-replace. The domain swap is nearly incidental. The substantive change is how a write tool's value parameter is declared to the model.
The wire format does not change
The model still sends {"id": "...", "properties": {"status": "ready_for_review"}}. UpdateNodeParams deserializes the same map; NodeService writes the same way. No call site, handler, param struct, or storage path changes.
What changes is the parameters_schema JSON — the declaration the model reads.
The change: declare fields, delete the prose that stood in for them
Today def_update_node() declares a bare object plus a ~200-word paragraph explaining what may go inside:
"properties": {
"type": "object",
"description": "Properties to merge/update — ... Use a key the node's type
already defines, copied character for character — ...
When a field lists allowed_values, use one of those values exactly. ..."
}The measured pattern (packages/agent/goldens/PATTERN.toml) declares each field of the operated-on type as a typed sub-property, with enums rendered as enum = [...]:
[turn.tool.parameters_schema.properties.field_values.properties.status]
type = "string"
enum = ["ready_for_dev", "in_dev", "ready_for_review", "in_review", "done"]
Deletion is part of the edit, not a follow-up. Arm 6 measured a declared sub-property plus the prose it replaces and FAILED; the same declaration with that prose removed passes. Adding structure while leaving the instruction it supersedes is measurably not the same edit (ADR-064's deletion-not-substitution rule, now with a control).
Why — eight arms of evidence
dev-instance-creation dropped a user-supplied value 3/3 across eight arms spanning every prose channel ADR-064 defines: candidate instructions, a schema description, three shapes of worked example, a content boundary rule, an ordered procedure, and that procedure with its enumeration forced to print.
The printed enumeration diagnosed it: the model listed five particulars and the dropped one was never among them. The value was gone before any instruction could act on it — which is why every wording-level arm was inert. They all operate downstream of the loss.
Declaring the field closed it immediately, 3/3.
Two probes bound the failure: asked directly whether the type had a field for the value, the model answered correctly and unprompted (not ignorance); offered a route_clarify tool and told to use it when a value has nowhere to go, it wrote the record anyway, 3/3, silently (does not surface the gap). Knowledge available under a reasoning prompt, absent under an action prompt — a selection failure, not addressable by instruction.
This requires per-turn generation
def_update_node() returns a static ToolDefinition. Declaring a user-created type's fields means building the parameter schema per request from the retrieved schemas — the same data that already renders the RELEVANT NODE TYPES line, so no new source of truth is required.
dev-unseen-schema is the proof this generalizes: its release type appears in no example, so the declarations must be generated from the schema rather than recognised from training. 3/3.
Scope rule for which tools get declarations
Declare the fields of any write tool the turn can legitimately call. A tool present only to be rejected does not need them (dev-schema-creation deliberately keeps a bare field_values on its distractor create_node).
Declare the fields of the type the case actually operates on — putting ticket fields on an ADR case is an incoherent surface.
The risk that was measured and did not materialize
Declaring fields makes the write tool easier to use, so it could pull the model toward writing where a write is the wrong answer. Measured across the corpus: it does not. dev-ambiguous-clarify still asks rather than writing, and dev-relationship-creation still picks create_relationship over a field write — and that case got harder, since its supersedes field is now explicitly declared, making the wrong answer more available. Still not taken.
Blocked on #2123
Production's value parameter is named properties, which the Gemma-4 template deletes wholesale. Declarations inside a deleted parameter reach the model no more than its description does. The rename must land before any of this is reproducible.
This also reframes the ~200-word paragraph being deleted: per #2123 it has never reached the model at all. It is not prose that underperformed — it is prose that was never delivered.
Scope
packages/agent/src/local_agent/tools.rs— write-tool parameter declarations (generated), and deletion of the prose they replacepackages/agent/src/skill_pipeline.rs— seeded skill guidance, worked examples, skilldescriptionindex keyspackages/agent/src/agent_guidance.rs— resident prosepackages/agent/src/local_agent/routing.rs/prompt_assembler.rs— only if the golden's structure requires it
Out of scope: deciding prompt content (#2122), the snapshot gate (#2119), eval fixtures (#1977), SKILL.md propagation (#1958), the search_nodes.filters read-path gap (its own issue).
Acceptance Criteria
- Prompt-assembly snapshot gate: assert production reproduces the tuned golden prompt (zero model calls) #2119's snapshot gate passes: assembly reproduces the Author and tune the golden prompt corpus: production-shaped, dev-domain prompt strings #2122 goldens
- Write-tool value parameters declare the operated-on type's fields as typed sub-properties, with enums, generated per request from the retrieved schemas
- The prose those declarations replace is deleted, not left alongside (arm 6 measured the combination failing)
- Wire format unchanged — no param struct, handler, or storage change
- Generation works for a type absent from every example (
dev-unseen-schemais the reference case) - Distractor tools not given declarations
- No prompt content invented here that is not in a tuned golden — an unresolvable divergence goes back to Author and tune the golden prompt corpus: production-shaped, dev-domain prompt strings #2122 for measurement
- Full golden corpus re-run after landing; no case regresses
- Matrix re-run, results recorded, no regression against the recorded baseline
Reference
Reproduce any target string without a daemon or DB:
NODESPACE_PROMPT_DUMP=/tmp/target.jsonl \
./target/release/golden_runner --reps 1 packages/agent/goldens/<case>.tomlpackages/agent/goldens/PATTERN.toml is the normative statement of the rule, including the exceptions and the re-measurement of every case it was applied to.
Notes
- Seeded guidance reaches existing installs via Seeded content never reaches an existing install: replace type-level skip with per-node versioned re-seed #1812's per-node
_seed{key, version, tier}reconciliation. Evals still need a daemon rebuild, since guidance is compiled in. - Markdown list bullets are lossy through the skill-guidance seed/render round-trip #1974 (lossy markdown bullets through seed/render) touches this path; fold in if convenient.
- The propagation rule applies on landing: seeded skill guidance changes carry to
packages/skill/SKILL.md(Make the graph the source of truth for the NodeSpace skill, and decide how guidance reaches external agents #1958).
Activity
malibio commentedon Aug 17, 2026
Sequencing: #2118 → #2120 → #2119 → #1977
These four are one line of work. Recording the order and the reasoning so it survives a context reset.
Why the snapshot gate is third, not first
It was initially argued for first, on the grounds that snapshotting today's assembly turns four independently-edited surfaces (
agent_guidance.rs,tools.rs,skill_pipeline.rs,routing.rs) into a reviewable diff — which is real, and would have caught thecoreValues/core_valuescontradiction ADR-064 records as shipped.But the snapshot would capture today's invoice-flavored prompt, and #2120 then rewrites it wholesale. Nearly every diff during that window is intended, so the gate's actual value — catching unintended drift — is thin exactly when it would be running. Capturing the golden once, after the rewrite settles, is cleaner than regenerating it through two rounds of deliberate change.
The risk this ordering carries, and its mitigation
The failure mode is the #1917 pattern repeating: tune by hand, get a good result, close the issue, never build the gate. That is not hypothetical — it is what happened, and
live_stage1_golden_prompts.rsstill carries the header comment saying the snapshot tests are "not yet written."Mitigation is in #2120's acceptance criteria rather than in the ordering: every tuned prompt is checked in as a #2118 case file. The work is durable whether or not #2119 lands promptly, and #2119 becomes the step that converts those case files into a production contract rather than the only thing standing between tuning and lost work.
For reading the current assembled prompt while deciding what to cut,
NODESPACE_PROMPT_DUMPalready dumps it at the native-path chokepoint — the gate is not needed for that.Adjacent, not blocking
friendly_namein schema tools) — independent_seedreconciliation, though evals still need a daemon rebuild since guidance is compiled inmalibio commentedon Aug 17, 2026
Target domain: dev workflow, and the schema definitions must move too
Direction from the user, refining this issue's scope.
The corpus domain
Build the guidance and worked examples around dev-workflow entities in the shape a Jira/Linear user would recognize:
Status enums must be workflow-shaped, not toy values:
ready_for_dev,in_dev,ready_for_review,in_review,done— the vocabulary of the tools the target user already lives in.The load-bearing point: schema definitions are a channel, not decoration
Swapping only the user-facing prompts is insufficient. The schema definitions handed to the model — worked examples in skill guidance,
create_schemafield examples, theRELEVANT ENTITY TYPESblock, enumcoreValuessamples — teach the model what a well-formed schema looks like. If those stay invoice-shaped while the user prompts go dev-shaped, the model is being taught to pattern-match business entities against dev requests.This follows directly from ADR-038 Finding 2: rendering a skill's instruction subtree is what produces correct nested structured output, because the model reproduces the worked example's pattern. The example IS the template.
Concretely, what changes:
title_template = "Invoice #{{invoice_number}}""ADR-{{number}}: {{title}}"Invoiceschema withinvoice_number, linked tocustomerTicketschema withstatusenum, linked tosprintresolve_query: "Mark the $500 invoice as paid"update_node: "the invoice cleared" →{"isPaid": false}{"status": "ready_for_review"}The
update_nodecase is worth calling out: its current example teaches enum-free boolean flipping (isPaid: false → true). A workflow-status enum is the harder and more representative operation — the model must pick a valid value fromallowed_valuesrather than negate a boolean. Teaching the easier shape and testing the harder one is part of why that surface is fragile.Why enums specifically
The enum path has repeatedly been where structured output breaks here:
coreValuescasing (ADR-064's decisive contradiction), enum values being invented rather than selected, andallowed_valuesnot being consulted. A status enum with five workflow values exercises exactly that path, in the domain the product targets.Interaction with a known instability
The runner work on #2118 measured that
node_typeis not stable across sessions when nothing in the prompt says what types exist — the same case produced"equipment"in one session and"Product"in another, each 3/3 internally. The tool name is the reliable signal; the argument value is not.Consequence for authoring: any case whose expected behavior depends on a specific type or enum value must put the available types and their
allowed_valuesin the prompt. That is not a workaround — it mirrors production, where theRELEVANT ENTITY TYPESblock does exactly this.Additional acceptance criteria
ready_for_dev,in_dev,ready_for_review,in_review,done)update_node's state-change example demonstrates selecting a valid enum value, not flipping a booleantitle_templateexamples use dev-entity token patternscreate_schemafield examples, and any entity-type block — not only the user-facing promptsmalibio commentedon Aug 17, 2026
Goldens must reproduce production's prompt ENVIRONMENT, not just a working prompt
Clarification from the user on what "golden prompt string" means here, and it tightens the brief:
The distinction
A hand-authored minimal prompt — short system text, two hand-written tool defs, no candidate block, no entity-types block, no tool-call records in history — answers "can the model do this task under favorable conditions?" That is a useful control, and it is what
scenario6-zero-history-control.tomlis.It is not the string NodeSpace pumps. Production sends, in one request:
PromptAssembler::assemble()over seededpromptnodes)render_candidates_for_prompt())RELEVANT ENTITY TYPESblock (from the candidate block'sschema_metadataand/or resident workspace context)stage2_tools())That gap is not hypothetical — it is precisely where scenario 6 died. Hand-authored got
resolve_query3/3; production fired it 0/8. The hand-authored prompt was not wrong, it was a different environment.The requirement
A golden must be structurally what production sends — same blocks, same sections, same ordering, same tool surface — with the content of those blocks being what is under tuning. Otherwise:
The tuning question is "what should the resident prompt SAY, and how short can it be," not "what happens if we delete the resident prompt entirely."
Two golden tiers, and both are needed
scenario6-zero-history-control.tomlis already this, and its own notes call it "the harness's own canary." Keep as-is.The existing "authored fresh, no
STAGE1_SYSTEM_PROMPT/ noskill_pipeline.rs" discipline still holds for tier 2, and is not in tension with it: fresh content in production's structure. A golden assembled from production's current text cannot be the target production is engineered toward — but a golden missing production's blocks cannot be that target either.How to obtain the production shape
NODESPACE_PROMPT_DUMPcaptures the exact assembled string at thegenerate_blockingchokepoint (confirmed working through the golden runner). Run a real session, dump the prompt, and use it as the structural reference for what blocks appear and in what order. Then author fresh content into that structure rather than copying the text.Acceptance criteria to add
RELEVANT ENTITY TYPES, full scoped tool surface, and realistic history including tool-call recordsNODESPACE_PROMPT_DUMPcapture, documented in the casenotes, so the shape is verifiable rather than assumed[-]Retarget agent guidance and tool-schema examples to the dev domain, and trim their length[/-][+]Make the assembly line reproduce the tuned golden prompts[/+]malibio commentedon Aug 17, 2026
Revised sequencing: #2118 → #2122 → #2119 → #2120 → #1977
Supersedes the earlier sequencing comment. The chain gained a step and #2120 was rescoped, because the previous plan had no issue that actually produced the golden corpus — #2119 would have asserted against goldens nobody authored.
The split that matters
#2120 previously mixed what should the prompt say with edit the files that emit it. That is the exact conflation this effort exists to remove — a failure could be a bad prompt or bad plumbing, indistinguishable.
Now:
A failure in #2122 is a prompt failure. A failure in #2120 is a plumbing failure. By construction.
Why #2119 moved ahead of #2120
The gate is what defines #2120's done condition. "Make plumbing match" has no test without it.
The governing requirement across all of them
Goldens must be production-shaped: same blocks, same structure, same tool surface as what NodeSpace actually sends — with the content of those blocks being what is tuned. A minimal hand-authored prompt is a useful control but not a target; scenario 6 is the cautionary case, at 3/3 hand-authored vs 0/8 in production for the same task.
Make the two-site entity-types shape uniform across every turn (#2122)
Head the block EXISTING SCHEMAS — a constraint, not a label (#2122)
Address re-review: fix 3 accuracy defects, correct a claim I overstat…
Golden prompt corpus: dev-workflow cases + context ablation (closes #…
malibio commentedon Aug 18, 2026
The corpus this issue targets now exists — what changed since this issue was written
#2122 merged as
44ef2f1f. This issue predates it and does not mention any of the findings below, several of which change what "done" means here. Orientation for whoever picks it up.Where the target lives, byte-exact
packages/agent/goldens/— 8 dev-workflow cases, 2 minimal controls, 3 ablation arms, andPATTERN.tomlrecording the rule that makes them work. All measured 5/5 byte-identical against the locked native model, with argument values asserted rather than tool names.Reproduce any target string without a daemon or DB:
dev-status-change-enumis 2681 and 4401 chars post-template across its two turns. Diff assembly output against that directly — no interpretation required.Four requirements the corpus establishes that this issue does not mention
1. Write tools must declare each field as a typed sub-property, enums inline. This is the largest behavioural requirement, not a style preference.
dev-instance-creationdropped a user-supplied value 3/3 across eight arms spanning every prose channel ADR-064 defines — candidate instructions, schema descriptions, three shapes of worked example, acontentboundary rule, an ordered procedure, and that procedure with its enumeration forced to be printed. Declaring the field closed it immediately.The diagnostic is the useful part: with the enumeration printed, the model listed five particulars and the dropped one was not among them. The value was already gone before any instruction could act on it, which is why every wording-level fix was inert — they all operate downstream of the loss. Two further probes bound it: asked directly, the model correctly identifies that no field exists; offered a clarification tool and told to use it, it writes anyway and says nothing.
Generatable from the same schema data that renders the type line, so no new source of truth.
2. Delete the prose the declarations replace. An arm carrying both a declared sub-property and the prose telling the model to invent keys failed; the declaration alone passes. Adding structure while leaving the instruction it supersedes is measurably not the same edit.
3. Two rendering sites, differently scoped. The resident block carries the retrieved schemas; the per-candidate block carries only that candidate's own types (
routing.rsrendersc.schema_metadata). An early draft of the corpus copied the resident list into the candidate block and reproduced production's structure while violating its scoping — the exact contaminationrouting.rsdocuments at that call site. All 15 turns now render the block exactly twice, correctly scoped.4. Keep the heading's parenthetical. The corpus heads the block
EXISTING SCHEMAS (do not recreate these; …)rather thanRELEVANT ENTITY TYPES (…). Read the measurement carefully: production's constant atcontext_ops.rs:118is already constraint-framed, so the arms compared two constraint-framed headings differing in noun. Both scored 5/5; the two arms that scored 0/5 dropped the parenthetical and changed the noun together.So the supported claim is "keep the parenthetical". The
ENTITY→SCHEMASrename is a consistency fix with no measured cost —ENTITYhas no referent in storage (node_type == "schema"), in the 44node_typetool params, or in the API — but it is not a measured improvement. The isolating arm is recorded as NOT RUN.What the ablation says about how much of this is worth reproducing
On
dev-status-change-enumonly, at 5 reps:Two mechanisms bought nothing measurable on that case. One case is not the workload —
ablation/README.tomlcarries that caveat and it should travel with any decision. But if effort has to be prioritised, the schemas block is the one with evidence behind it.Note the last row changed after the declared-field pattern landed: with enums declared on the write tool, deleting the schemas block no longer breaks the write, only the read —
search_nodes.filtersdeclares no enum. Not-yet-run: declaring enums on a read tool's filter parameter. If that works, the block may be redundant for reads too.Blocked on #2123
Production's value parameter is named
properties, which the Gemma-4 template deletes wholesale. Declarations inside a deleted parameter reach the model no better than its description does, so none of requirement 1 is reproducible until that rename lands. The corpus usesfield_valuesfor exactly this reason, which is also why it is not production-shaped today — every affected case says so in its own notes.Sequencing: #2123 → #2119 → #2120.
One methodological note, learned twice the hard way
Measurements transcribed into prose drift from the files they describe. It happened twice in #2122 — caught once in review, once self-caught after a heading change invalidated recorded character counts. Derive them, don't transcribe them. That is directly #2119's problem.
Relatedly: 3 reps is not enough for heading- or block-level changes. A 3/3 run wrongly cleared a change of causing a regression during #2122; only a 5-rep comparison settled it. The corpus files declare
reps = 5.🤖 Generated with Claude Code
[-]Make the assembly line reproduce the tuned golden prompts[/-][+]Generate write-tool field declarations from retrieved schemas, and delete the prose they replace[/+]malibio commentedon Aug 18, 2026
Issue rewritten — the framing changed, read before starting
Retitled and rewritten against #2122's merged findings. If you read this issue before 2026-08-18, the old framing ("retarget guidance and tool-schema examples to the dev domain") would send you looking for invoice strings to find-and-replace. That is not the work.
Three things that changed:
The wire format does not change. The model still sends
{"id": ..., "properties": {...}};UpdateNodeParams,NodeService, and storage are untouched. What changes is theparameters_schemathe model reads.The substantive change is declaring the operated-on type's fields as typed sub-properties with enums, generated per request from the retrieved schemas — replacing the bare
"type": "object"plus a ~200-word prose paragraph. Backed by eight measured arms; every prose channel ADR-064 defines was tried and was inert, because the value was already lost before any instruction could act on it.Deletion is part of the edit. Arm 6 measured a declared sub-property plus the prose it replaces and FAILED; the same declaration with the prose removed passes. Adding structure while leaving the instruction it supersedes is measurably not the same edit.
Still blocked on #2123 — declarations inside a parameter the Gemma-4 template deletes reach the model no more than its description does.
Split out: the read-path gap is now #2147.
search_nodes'sfiltersdeclares no enum, so allowed values never reach the model on a read — the same request succeeds on the write and fails on the filter in one run. Not in scope here.packages/agent/goldens/PATTERN.tomlis the normative statement of the rule, including its exceptions and the re-measurement of every case it was applied to.mstomar125 commentedon Aug 18, 2026
PR #2150 opened, addressing the revised scope (write-tool field declarations generated per request from retrieved schemas, plus the dev-domain retargeting).
Summary:
routing::declare_write_tool_fields(new) generatescreate_node/update_node'sfield_valuessub-properties from retrievedschema_metadata, perpackages/agent/goldens/PATTERN.toml's measured pattern — declaring fields, not describing them in prose. Selection rule: source from the highest-scoring cleared candidate(s) whitelisting a given tool; ties unioned; a lower-scoring candidate's tool stays undeclared (reproducesdev-schema-creation.toml's distractor case). Gated behind!session.routing_disabled, the same waycandidate_blockprompt injection already is, since this is the same class of retrieved-schema content the routing-reliability matrix measured suppressing tool-calling on some models — now reachable through the tool-schema channel too.RELEVANT ENTITY TYPESrenamed toEXISTING SCHEMASeverywhere.cargo test -p nodespace-agent --test prompt_assembly_snapshot5/5.route_clarifytool, so ambiguity resolution isn't prose-only).Full details, prompt-size deltas, and matrix data in the PR description.
Address final review: fix enum-leftover-on-type-conflict bug, restore…
Retarget prompt assembly to dev-workflow domain; generate write-tool …
Measure declaring enums on search_nodes filters: does not recover cle…