Spec Studio

The agent's last message is exactly the harness's final answer

spec:cc-agents.exact-answerUse Case / Behavior · featureready floor ready

Packs: none

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

Findings: no errors, no warnings

specs/runner/exact-answer.sdp.md

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

Intent
actor
A Workflow script or a parent agent that reads the report of a foreign agent.
problem
A Claude model that restates a foreign model's answer can alter it, and a Workflow reads the subagent's last message as the answer.
outcome
The turn ends with the harness's final text alone, byte for byte, and a failed turn says why.
value
A script can parse the answer, and a reader can trust it is the foreign model's own.

Open questions

  • non-blocking · question.endNotes line 23 · specs/runner/exact-answer.sdp.md:23 · An interrupted turn ends with a note that it was interrupted, and a completed turn that returned no text ends with a note saying so; both are built and no test pins their wording.Decider: delegatedProvisional: The notes are as built.
Behavior
rule.finalAlone line 29 · specs/runner/exact-answer.sdp.md:29
When the harness turn has ended, its final answer is delivered in a step of its own, as that step's only text, so a Workflow receives exactly it.

no example exercises it

rule.handbackWhereAsked line 30 · specs/runner/exact-answer.sdp.md:30
Where the agent's transcript tells it to hand its report back through SubagentHandback, the answer goes through that tool unchanged, and the turn counts as delivered only when the tool's result succeeded.

no example exercises it

rule.handbackTwiceRefused line 31 · specs/runner/exact-answer.sdp.md:31
A hand-back refused twice ends in the plain answer with the refusal appended, never a claim of delivery.

no example exercises it

rule.harnessTokens line 32 · specs/runner/exact-answer.sdp.md:32
No step reports usage to Claude Code; the harness's tokens appear as a text line naming the model, input, cached input and output tokens.

no example exercises it

rule.failureSaysWhy line 33 · specs/runner/exact-answer.sdp.md:33
A turn that did not complete ends with a bracketed note naming the harness, the status, the error kind and its message, plus a hint for quota, sign-in, capacity and rate-limit failures.

no example exercises it

rule.lateMessageGetsATurn line 34 · specs/runner/exact-answer.sdp.md:34
A message that reaches the agent as its harness turn ends is answered in a new turn before the hand-back.

no example exercises it

0 unkeyed rules.

Design
tokensLine line 38 · specs/runner/exact-answer.sdp.md:38
<model>: <n> input tokens (<n> cached), <n> output

no citation recorded

failureNote line 39 · specs/runner/exact-answer.sdp.md:39
[the <harness> turn <status> (<kind>): <message> <hint>]

no citation recorded

Verification

Verifier bindings

  • test:cc-agents.mod-suite · the mod against a scripted sidecar · anchored · test anchor binding present · plugin/tests/mod.test.ts:4
Design view

Requirement drawing

  • Declared verifying examples: no declared verifying example.
Requirement drawing for spec:cc-agents.exact-answer
The diagram as text
  • spec:cc-agents.exact-answer: The agent's last message is exactly the harness's final answer · declared Spec
  • spec:cc-agents.runner: Other model families run as real Claude Code agents · declared Spec
  • impl:cc-agents.mod: answers each step of an agent from the sidecar's events, hands back the exact answer, steers and stops, and returns the job state block · anchored code · plugin/hooks/register.js:9
  • test:cc-agents.mod-suite: the mod against a scripted sidecar · anchored test binding · binding present · plugin/tests/mod.test.ts:4
  • spec:cc-agents.exact-answer refines spec:cc-agents.runner · declared
  • impl:cc-agents.mod satisfies spec:cc-agents.exact-answer · anchored
  • test:cc-agents.mod-suite verifies spec:cc-agents.exact-answer · 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
  • impl:cc-agents.mod · answers each step of an agent from the sidecar's events, hands back the exact answer, steers and stops, and returns the job state block · plugin/hooks/register.js:9

    Uses

    None.

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:cc-agents.exact-answer
The diagram as text
  • spec:cc-agents.exact-answer: The agent's last message is exactly the harness's final answer
  • spec:cc-agents.mod-layer: The mod answers an agent's steps from the sidecar and never calls a model
  • spec:cc-agents.runner: Other model families run as real Claude Code agents
  • spec:cc-agents.exact-answer dependsOn spec:cc-agents.mod-layer · declared — the final step is one of the steps the mod answers
  • spec:cc-agents.exact-answer refines spec:cc-agents.runner · 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
dependsOn · outgoingThe mod answers an agent's steps from the sidecar and never calls a model
spec:cc-agents.mod-layer · resolves
declaredthe final step is one of the steps the mod answersNone
refines · outgoingOther model families run as real Claude Code agents
spec:cc-agents.runner · resolves
declaredNoneNone

Bindings

Implementation binding: present

  • impl:cc-agents.mod · answers each step of an agent from the sidecar's events, hands back the exact answer, steers and stops, and returns the job state block · plugin/hooks/register.js:9

Design reference: none

Verifier binding: present

  • test:cc-agents.mod-suite · the mod against a scripted sidecar · anchored · plugin/tests/mod.test.ts:4 · 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.