Spec Studio

A scripted body returns claim-decoded context, pre-shaped by the body

spec:consumers.agent-surface.scripted-context-bodyExample / Scenario · storyready floor ready

Packs: pack:self-hosting-v1

Design: no design entries · no pinned declarations · no decisions

Findings: no errors, no warnings

specs/consumers/agent-surface.scripted-context-body.sdp.md

No open questions and no blocking questions; implementation binding none, verifier binding present, and expected-outcome oracle none.

Intent
outcome
Execute the whole path an agent uses — a root, the extractor, the graph, the injected reader, one scripted body — and read back the decode a hand-rolled join gets wrong.
Behavior

Examples

Given an extraction root the front door derives in process on the invocation
Given the corpus binds the spec {specId: "spec:orders.create-order"} to one anchored verifier and one declared-only verifier
When the agent scripts a body {body: "composing that spec's verifier bindings"} through the front door
Then the front door exits {exitCode: 0} with an empty error stream
Then the printed answer is exactly the body's pre-shaped return {printedAnswer: "spec:orders.create-order.empty-cart is a declared verifier · spec:orders.create-order.valid-cart is an enabled verifier"}
Then the anchored verifier {anchoredVerifierId: "spec:orders.create-order.valid-cart"} decodes as enabled while the declared-only verifier {declaredVerifierId: "spec:orders.create-order.empty-cart"} does not
Verification

Verifier bindings

  • test:protocol.agent-surface.scripted-context-body · the scripted-body point verifies the front door's claim-decoded, pre-shaped return · anchored · test anchor binding present · test/self-hosting-consumers.test.ts:244

    External run evidence from test/self-hosting-consumers.test.ts

    Test anchors: test:protocol.agent-surface.demand-map-entries, test:protocol.agent-surface.scripted-context-body, test:protocol.reader.changeset-entry, test:protocol.reader.concept-entry, test:protocol.reader.file-entry. Specs verified by those bindings: spec:consumers.agent-surface, spec:consumers.agent-surface.demand-map-entries, spec:consumers.agent-surface.scripted-context-body, spec:consumers.reader, spec:consumers.reader.changeset-entry, spec:consumers.reader.concept-entry, spec:consumers.reader.file-entry.

    Run 1: external run evidence from vitest 4.1.10

    Build: CI 391 · Branch: cursor/media-plan-and-articles-09b1 · Commit: 076cd4f1f85640d8236e5cca1bffffa68ab79a33 · Start: 2026-10-31T15:32:20.471Z · Stop: 2026-10-31T15:34:02.073Z

    NameSuiteResultDuration
    executes the bound example against a fresh worldA scripted body returns claim-decoded context, pre-shaped by the body (spec:consumers.agent-surface.scripted-context-body)passed55.11 ms
    executes the bound example against a fresh worldOne body reaches every entry point the demand map names, and no symbol entry (spec:consumers.agent-surface.demand-map-entries)passed17.19 ms
    executes the bound example against a fresh worldA concept recorded only inside a Spec's sections is still reached, and the field is named (spec:consumers.reader.concept-entry)passed29.24 ms
    executes the bound example against a fresh worldA source file reaches the Spec its binding names, and a carrier reaches its own Spec (spec:consumers.reader.file-entry)passed23.41 ms
    executes the bound example against a fresh worldA changeset names what it reaches, why, and what it cannot see (spec:consumers.reader.changeset-entry)passed17.23 ms
Design view

Requirement drawing

  • Satisfying or referencing units: no recorded binding.
Requirement drawing for spec:consumers.agent-surface.scripted-context-body
The diagram as text
  • spec:consumers.agent-surface.scripted-context-body: A scripted body returns claim-decoded context, pre-shaped by the body · declared Spec
  • spec:consumers.agent-surface: Agents script a visible typed graph · declared Spec
  • test:protocol.agent-surface.scripted-context-body: the scripted-body point verifies the front door's claim-decoded, pre-shaped return · anchored test binding · binding present · test/self-hosting-consumers.test.ts:244
  • spec:consumers.agent-surface.scripted-context-body refines spec:consumers.agent-surface · declared
  • spec:consumers.agent-surface.scripted-context-body verifies spec:consumers.agent-surface · declared
  • test:protocol.agent-surface.scripted-context-body verifies spec:consumers.agent-surface.scripted-context-body · anchored
Mermaid source

Copyable source; the Studio draws static SVG.

Preferred and chosen syntax: requirementDiagram; exact refines, satisfies and verifies, with claim words in nodes and per-edge comments.

Decisions

No decision record named.

Runtime

No implementation neighborhood recorded.

Runtime observation: not tracked.

Evidence

Runtime observation: not tracked.

Build attestations: not tracked.

Deployments: not tracked.

Bills of materials: not tracked.

Impact
Relations of spec:consumers.agent-surface.scripted-context-body
  • E2: verifies · declared
The diagram as text
  • spec:consumers.agent-surface: Agents script a visible typed graph
  • spec:consumers.agent-surface.scripted-context-body: A scripted body returns claim-decoded context, pre-shaped by the body
  • spec:consumers.agent-surface.scripted-context-body refines spec:consumers.agent-surface · declared
  • spec:consumers.agent-surface.scripted-context-body verifies spec:consumers.agent-surface · declared
Mermaid source

Copyable source; the Studio draws static SVG.

Preferred syntax: flowchart. Chosen syntax: labelled flowchart, preserving exact relations, claims and folds.

Rests on

Rested on by

No Spec rests on this Spec.

Relations

Relation and directionOther endClaimReasonExercised keys
refines · outgoingAgents script a visible typed graph
spec:consumers.agent-surface · resolves
declaredNoneNone
verifies · outgoingAgents script a visible typed graph
spec:consumers.agent-surface · resolves
declaredNoneNone

Bindings

Implementation binding: none

Design reference: none

Verifier binding: present

  • test:protocol.agent-surface.scripted-context-body · the scripted-body point verifies the front door's claim-decoded, pre-shaped return · anchored · test/self-hosting-consumers.test.ts:244 · test anchor

Expected-outcome oracle: none

Runtime observation: not tracked.

Run results: not recorded in the graph.

Findings

None.

Composing (0)

Composing needs the script.