baldart 4.59.0 → 4.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -2
- package/README.md +1 -1
- package/VERSION +1 -1
- package/framework/.claude/agents/REGISTRY.md +2 -0
- package/framework/.claude/agents/codebase-architect.md +9 -0
- package/framework/.claude/agents/doc-reviewer.md +11 -0
- package/framework/.claude/agents/plan-auditor.md +11 -0
- package/framework/.claude/agents/senior-researcher.md +10 -0
- package/framework/agents/index.md +2 -0
- package/framework/agents/return-contract-protocol.md +130 -0
- package/framework/templates/agent-return-contract.snippet.md +30 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,7 @@ All notable changes to BALDART will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [4.
|
|
8
|
+
## [4.60.0] - 2026-06-21
|
|
9
9
|
|
|
10
10
|
**`/new` cost + autonomy release — born from a forensic post-mortem of a real `-full` epic run** (224M orchestrator cache_read over 543 turns, context grown to ~670k, 9 improvised on-context fix agents, Codex completing only 2/7 reviews). The dominant cost is mechanical — turn-count × monotonically-growing context, confirmed against Anthropic's current prompt-caching docs — and the back half of the run was the expensive half because the final-review fix cascade and the deploy phase ran ON the orchestrator context at ~670k/turn. Two adversarial review passes shaped and verified the change set (several proposed items were refuted as already-shipped or redundant; four blockers found in pre-release review were fixed before tagging).
|
|
11
11
|
|
|
@@ -21,7 +21,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
21
21
|
- **`framework/.claude/workflows/new-card-review.js`** (+ the final-review Fix phase) — collision-safe `finding_id` reconciliation. A writer that echoes only the human-readable id tail no longer drops applied fixes into residual (the empty-coder re-spawn bug): `resolveId` maps a returned token to its canonical prefixed id by exact or UNIQUE colon-tail match, logging any unmatched. Also a light-tier test gate: after the Fix phase at light tier (where qa-sentinel was skipped), a diff-scoped qa-sentinel pass now catches a fix-introduced test regression via the existing gateTable gate (graceful SKIP when no diff-scoped runner).
|
|
22
22
|
- **`framework/.claude/skills/new/` references** — autonomous gate coverage + turn economy. Every `AskUserQuestion`/HALT gate across SKILL.md + `implement.md`, `setup.md`, `review-cycle.md`, `team-mode.md`, `completeness.md`, `merge-cleanup.md`, `commit.md`, `codex-gate.md`, `final-review.md`, `production-readiness.md` cites the AUTONOMOUS rule (so none silently blocks under `-auto` and none auto-approves a deferral); a sequential-path coverage assertion (review-cycle.md) catches a silently-skipped test-only card review; one concrete batching example added to the turn-economy HARD RULE.
|
|
23
23
|
|
|
24
|
-
**MINOR** — additive: two new flags (`-auto`/`-auto-ship`) + an opt-in workflow Fix phase + one new `baldart.config.yml` key (`git.auto_deploy`, schema-change propagation applied) + reference-prose gate coverage. No new agent/skill/command/routine; no install/layout change. With the flags/args absent and `applyFixes` not opted in, every path is byte-identical to v4.
|
|
24
|
+
**MINOR** — additive: two new flags (`-auto`/`-auto-ship`) + an opt-in workflow Fix phase + one new `baldart.config.yml` key (`git.auto_deploy`, schema-change propagation applied) + reference-prose gate coverage. No new agent/skill/command/routine; no install/layout change. With the flags/args absent and `applyFixes` not opted in, every path is byte-identical to v4.59.0 (`new2` unaffected).
|
|
25
|
+
|
|
26
|
+
## [4.59.0] - 2026-06-20
|
|
27
|
+
|
|
28
|
+
**Subagent return contracts — every orchestrator-facing agent now bounds its *final message* so a long body doesn't flood the spawning context.** Outcome of studying the [headroom](https://github.com/chopratejas/headroom) context-compression tool against BALDART's existing context-economy stack. The study's verdict: headroom is **not** adopted as a dependency — it is a heavyweight Python+Rust runtime (proxy/wrapper) that contradicts BALDART's "thin CLI + authored markdown, zero runtime" identity, is explicitly unsuitable for the ephemeral cloud sandboxes these sessions run in, and applies *lossy* compression to code/tool output (risky in a code-gen framework). Its techniques already have prompt-level analogues here: verbosity steering L0–L4 ≈ the Terse / Terse Ultra output styles, effort routing ≈ `effort-protocol`, AST/code compression ≈ the LSP + Graphify retrieval layers (which filter input *losslessly*).
|
|
29
|
+
|
|
30
|
+
The one real gap headroom surfaced is the **verbosity of subagent return messages**: when free-form analysts (`codebase-architect`, `doc-reviewer`, `plan-auditor`, `senior-researcher`) finish, their entire reasoning body lands verbatim in the orchestrator's context — and the orchestrator pays for it on *every* subsequent turn of a batch. A subagent's final message is the only text that costs the spawning context tokens (its intermediate reading/thinking is discarded), so the whole optimization reduces to one rule: **persist the long form, return the short form.** This is implemented natively — zero dependencies, portable across Claude + Codex, works inside sandboxes — as the input-side twin of the effort protocol: effort governs how *deeply* an agent reasons, the return contract governs how *compactly* it reports back.
|
|
31
|
+
|
|
32
|
+
The contract: COMPACT (default) = bounded headline/verdict + key points as `path:line` references (no reasoning dump, no pasted code) + `Report: <path>` when the long form is on disk; FULL narrative only when the user invoked the agent directly for prose. It reuses the existing pooled YAML findings schema (never a new one) and explicitly does **not** truncate substance — it cuts ceremony/narration/echo, not real findings. Agents already structured this way (`qa-sentinel` Return Protocol, `visual-fidelity-verifier` JSON, the verdict+pooled-YAML reviewers `code-reviewer` / `security-reviewer` / `api-perf-cost-auditor`) are the reference exemplars and were left untouched.
|
|
33
|
+
|
|
34
|
+
**MINOR** — adds a protocol module + a template snippet (additive capability); no new `baldart.config.yml` key, so the schema-change propagation rule does not apply (same class as `effort-protocol`). No install/layout change.
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- **`framework/agents/return-contract-protocol.md`** — new SSOT protocol module: COMPACT vs FULL return modes, the persist-then-summarize rule, findings-schema reuse, honest limits, and the canonical `## Return Contract` body block. Modeled on `effort-protocol.md`.
|
|
39
|
+
- **`framework/templates/agent-return-contract.snippet.md`** — copy-paste starter for the `## Return Contract` block (twin of `skill-effort.snippet.md`), with placement guidance and the "skip agents already structured" carve-out.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **`framework/.claude/agents/{codebase-architect,doc-reviewer,plan-auditor,senior-researcher}.md`** — added an explicit `## Return Contract` block (tailored per agent: architect → file/symbol/pattern/risk map as `path:line`; doc-reviewer → condensed verdict + docs on disk; plan-auditor → verdict + pooled YAML, 10-section narrative is FULL-only; senior-researcher → §0–§11 report written to disk, return the Executive Summary + pointer).
|
|
44
|
+
- **`framework/agents/index.md`** — added the return-contract routing rule and a Modules-list entry.
|
|
45
|
+
- **`framework/.claude/agents/REGISTRY.md`** — added the return-contract convention note (exemplars + "paste the block for new analysis/audit/research agents").
|
|
25
46
|
|
|
26
47
|
## [4.58.0] - 2026-06-20
|
|
27
48
|
|
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ No additional activation steps needed — once installed, Claude Code (and Codex
|
|
|
82
82
|
### Core Protocol
|
|
83
83
|
|
|
84
84
|
- **AGENTS.md**: Mandatory coordination rules (MUST/SHOULD/OPTIONAL)
|
|
85
|
-
- **agents/**:
|
|
85
|
+
- **agents/**: 25 domain modules (architecture, workflows, testing, security, card-schema, i18n-protocol, return-contract-protocol, etc.)
|
|
86
86
|
- **Routing**: If you touch X, read Y - minimize context loading
|
|
87
87
|
|
|
88
88
|
### AI Agents (29 specialized agents)
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.60.0
|
|
@@ -6,6 +6,8 @@ Quick-reference for all custom agents. Use this to route tasks to the right spec
|
|
|
6
6
|
|
|
7
7
|
> **Machine-readable source of truth (since v3.20.0)**: the filesystem directory `framework/.claude/agents/` is authoritative for the list of BALDART agents. The `agent-discovery-gate.js` PreToolUse hook, the `agent-discovery-info.sh` SessionStart hook, and `baldart doctor` enumerate the directory directly (every `<name>.md` except this file is an agent — no manifest JSON is shipped). Adding a new agent means dropping `<name>.md` here; no other touchpoint.
|
|
8
8
|
|
|
9
|
+
> **Return contract (since v4.59.0)**: every orchestrator-facing subagent bounds its **final message** so a long body doesn't flood the spawning context — COMPACT return (headline/verdict + `path:line` findings + disk pointer), long form persisted to disk. Agents already structured this way are the exemplars (`qa-sentinel` Return Protocol, `visual-fidelity-verifier` JSON, the verdict+pooled-YAML reviewers — `code-reviewer` / `security-reviewer` / `api-perf-cost-auditor`); free-form analysts carry an explicit `## Return Contract` block (`codebase-architect`, `doc-reviewer`, `plan-auditor`, `senior-researcher`). When adding a new analysis/audit/research agent, paste the block from `framework/templates/agent-return-contract.snippet.md`. Protocol: `framework/agents/return-contract-protocol.md`.
|
|
10
|
+
|
|
9
11
|
## Agent Map
|
|
10
12
|
|
|
11
13
|
| Agent | Category | When to Use | Specialization | Can Edit Code | Key Tools |
|
|
@@ -27,6 +27,15 @@ Per the project's AGENTS.md MUST rules, all agents must invoke you (codebase-arc
|
|
|
27
27
|
|
|
28
28
|
4. **Pattern Recognition**: Identify and explain established patterns in the codebase, including coding standards, architectural decisions (from ADRs), and implementation conventions.
|
|
29
29
|
|
|
30
|
+
## Return Contract
|
|
31
|
+
|
|
32
|
+
**Mode:** COMPACT (default). Your final message to the orchestrator is bounded —
|
|
33
|
+
a structured file / symbol / pattern / risk map as `path:line` references, NOT a
|
|
34
|
+
narrative essay. Lead with the headline answer; cite locations, don't paste code
|
|
35
|
+
or restate what you read. Return only what the spawning agent needs to plan. FULL
|
|
36
|
+
prose only when the user invoked you directly for an explanation. Mode definitions
|
|
37
|
+
and the persist-then-summarize rule: `framework/agents/return-contract-protocol.md`.
|
|
38
|
+
|
|
30
39
|
**Project-Specific Context:**
|
|
31
40
|
|
|
32
41
|
This codebase follows strict protocols defined in AGENTS.md. Key architectural references you should consult:
|
|
@@ -36,6 +36,17 @@ Notes: [one-liner if any]
|
|
|
36
36
|
|
|
37
37
|
For cards exceeding 3 files or triggering invariants, use the full Required Deliverables format (sections A-H, summarized under "Required Deliverables" below). If `.claude/skills/doc-reviewer-support/references/deliverables-format.md` exists, read it for the detailed section spec; otherwise use the inline summary.
|
|
38
38
|
|
|
39
|
+
## Return Contract
|
|
40
|
+
|
|
41
|
+
**Mode:** COMPACT (default). Your docs are written to disk; your final message to
|
|
42
|
+
the orchestrator is bounded — the condensed verdict line (Verdict / invariants /
|
|
43
|
+
docs written / SSOT updated) + violated rows + any `path:line` notes. Persist the
|
|
44
|
+
long form (the docs themselves), return the short form. Never paste full doc bodies
|
|
45
|
+
or the A–H narrative back into the orchestrator context. The Fast-Mode condensed
|
|
46
|
+
format above IS the COMPACT return; use it as the ceiling even for larger cards
|
|
47
|
+
(point to the docs on disk instead of inlining them). Mode definitions and the
|
|
48
|
+
persist-then-summarize rule: `framework/agents/return-contract-protocol.md`.
|
|
49
|
+
|
|
39
50
|
## Parallel Safety (MUST)
|
|
40
51
|
|
|
41
52
|
When running in parallel with other agents (code-reviewer, security-reviewer):
|
|
@@ -22,6 +22,17 @@ You receive an existing implementation plan (created by another agent, a human,
|
|
|
22
22
|
|
|
23
23
|
You review ANY development plan: frontend, backend, mobile, infra, data pipelines, AI/ML, integrations. Assume the plan may be incomplete or optimistic. You must expose gaps.
|
|
24
24
|
|
|
25
|
+
## Return Contract
|
|
26
|
+
|
|
27
|
+
**Mode:** COMPACT (default, orchestrator-spawned). Your final message is bounded —
|
|
28
|
+
verdict line + the pooled YAML findings (the FINDINGS YAML SCHEMA below) + a
|
|
29
|
+
`path:line`-referenced one-liner per BLOCKER. The 10-section narrative (OUTPUT
|
|
30
|
+
FORMAT — FULL mode only) is **FULL mode**: emit it only when invoked directly by a
|
|
31
|
+
human for an interactive audit, and when it is large, persist it and return the
|
|
32
|
+
pointer. Don't paste the 10 sections back to an orchestrator that only needs the
|
|
33
|
+
findings. Mode definitions, findings-schema reuse, and persist-then-summarize:
|
|
34
|
+
`framework/agents/return-contract-protocol.md`.
|
|
35
|
+
|
|
25
36
|
## AUDIT MODE (read your invocation prompt FIRST)
|
|
26
37
|
|
|
27
38
|
You operate in one of two declared modes. Detect which from your invocation prompt:
|
|
@@ -35,6 +35,16 @@ The report will be read by an AI model with finite context. Therefore:
|
|
|
35
35
|
- Use consistent terminology and define aliases once (glossary).
|
|
36
36
|
- Use citation-friendly formatting: `[Author Year]` consistently throughout.
|
|
37
37
|
|
|
38
|
+
## Return Contract
|
|
39
|
+
|
|
40
|
+
**Mode:** COMPACT return, FULL deliverable-on-disk. The §0–§11 report below is your
|
|
41
|
+
deliverable — **write it to disk** (a research file under the project's docs/wiki
|
|
42
|
+
path). Your final message to the orchestrator is bounded: the Executive Summary
|
|
43
|
+
headline + the recommendation line + `Report: <path>`. Do NOT paste the full
|
|
44
|
+
§0–§11 body back into the orchestrator context — that is exactly the "finite
|
|
45
|
+
context" cost the CRITICAL CONSTRAINT above warns about. Persist the long form,
|
|
46
|
+
return the short form: `framework/agents/return-contract-protocol.md`.
|
|
47
|
+
|
|
38
48
|
## OUTPUT (DELIVERABLE)
|
|
39
49
|
A detailed research report containing these sections in order:
|
|
40
50
|
|
|
@@ -36,6 +36,7 @@ Route agents to the right module with minimal reading.
|
|
|
36
36
|
- If touching performance limits or scaling -> read `agents/performance.md`.
|
|
37
37
|
- If touching monitoring/logging -> read `agents/observability.md`.
|
|
38
38
|
- If tuning reasoning depth — setting a skill's `effort:` baseline or honoring an inline `effort=<level>` override -> read `agents/effort-protocol.md`.
|
|
39
|
+
- If authoring/auditing a subagent whose return would flood the orchestrator context (free-form analysis/audit/research) -> read `agents/return-contract-protocol.md` and bound its final message: COMPACT headline + `path:line` findings + disk pointer, persist the long form. The input-side twin of the effort protocol.
|
|
39
40
|
- If building or maintaining a derived LLM wiki overlay (`${paths.wiki_dir}/`) -> read `agents/llm-wiki-methodology.md` and invoke `wiki-curator` / `/capture`.
|
|
40
41
|
- For day-to-day status -> read and update `${paths.references_dir}/project-status.md`.
|
|
41
42
|
- For legacy context -> read `archive/project_full_legacy.md` if it exists.
|
|
@@ -71,6 +72,7 @@ When adding or updating agents, update REGISTRY.md — not this file.
|
|
|
71
72
|
- `agents/i18n-protocol.md` — Internationalization discipline: no hardcoded user-facing strings, context registry (`paths.i18n_registry`) + ICU + context-aware translation; BLOCKING anti-hardcoded lint gate (since v4.52.0, gated on `features.has_i18n`)
|
|
72
73
|
- `agents/design-system-protocol.md` — Registry-first discipline for UI work: BLOCKING cascade on `INDEX.md` + `tokens-reference.md` + `components/<Name>.md` (since v3.11.0, gated on `features.has_design_system`)
|
|
73
74
|
- `agents/card-schema.md` — Atomic Card Baseline Schema: the universal, profile-aware (epic/child/standalone) field contract every backlog card satisfies, plus the consumer HALT/BACK-FILL/WARN contract (since v4.35.0)
|
|
75
|
+
- `agents/return-contract-protocol.md` — Subagent return-message economy: COMPACT (bounded headline + `path:line` findings + disk pointer) vs FULL, persist-then-summarize — the input-side twin of `effort-protocol.md` (since v4.59.0)
|
|
74
76
|
|
|
75
77
|
## Where to Document (Decision Tree)
|
|
76
78
|
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<!-- contamination-scan: skip
|
|
2
|
+
The only token the scanner flags here is the substring "fidelity" inside the
|
|
3
|
+
framework agent name `visual-fidelity-verifier` (a real BALDART agent cited as
|
|
4
|
+
a return-shape exemplar). It is framework content, not consumer project-leak. -->
|
|
5
|
+
# Return Contract Protocol
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Define how a BALDART **subagent** shapes the *final message* it returns to the
|
|
10
|
+
orchestrator that spawned it. The goal is **context economy of the orchestrator**:
|
|
11
|
+
a subagent's full reasoning is often large (analysis, audits, research, doc
|
|
12
|
+
sweeps), and when that whole body lands verbatim in the orchestrator's context it
|
|
13
|
+
crowds out everything else and inflates token cost for every subsequent turn. The
|
|
14
|
+
contract is simple — **persist the long form, return the short form**: the
|
|
15
|
+
deliverable lives on disk (or as structured findings), and the message back to the
|
|
16
|
+
orchestrator is a bounded headline + pointers, never a reasoning dump.
|
|
17
|
+
|
|
18
|
+
This is the input-side twin of the `effort-protocol`: effort governs how *deeply*
|
|
19
|
+
an agent reasons; this governs how *compactly* it reports back.
|
|
20
|
+
|
|
21
|
+
## Scope
|
|
22
|
+
|
|
23
|
+
**In**: The shape and size ceiling of a subagent's *return message* (its last
|
|
24
|
+
action before yielding to the orchestrator), the COMPACT vs FULL distinction, and
|
|
25
|
+
where the long-form body goes instead.
|
|
26
|
+
**Out**: What an agent writes to disk (that is the agent's own deliverable format —
|
|
27
|
+
docs, reports, locale files, cards), the native effort knob (see
|
|
28
|
+
`effort-protocol.md`), and runtime/wire-level token compression (BALDART does not
|
|
29
|
+
ship a runtime; this is a prompt-level authoring convention, not a proxy).
|
|
30
|
+
|
|
31
|
+
## Background — why the return message is the lever
|
|
32
|
+
|
|
33
|
+
A subagent invoked via the `Task` tool runs in its own context window; only its
|
|
34
|
+
**final message** is injected back into the orchestrator's context. So the only
|
|
35
|
+
text that costs the orchestrator tokens is that final message — not the agent's
|
|
36
|
+
intermediate reading, thinking, or tool calls. Therefore the entire optimization
|
|
37
|
+
reduces to one rule: **make the final message bounded and structured.** Everything
|
|
38
|
+
the agent needed to reason over stays in its own (discarded) context; the
|
|
39
|
+
durable long-form output, when it is a deliverable, goes to disk where the
|
|
40
|
+
orchestrator can read it on demand instead of paying for it on every turn.
|
|
41
|
+
|
|
42
|
+
## The two modes
|
|
43
|
+
|
|
44
|
+
### COMPACT (default for every orchestrator-facing subagent)
|
|
45
|
+
|
|
46
|
+
The final message is bounded and consists only of:
|
|
47
|
+
|
|
48
|
+
1. **Headline / verdict** — one line: the outcome (`PASS | FAIL`, "analysis
|
|
49
|
+
ready", "3 findings", "report written").
|
|
50
|
+
2. **Findings or key points** — as `path:line` references, not pasted code or
|
|
51
|
+
prose. If the agent emits review findings, use the shared pooled YAML findings
|
|
52
|
+
schema (see "Reuse the existing findings schema" below) — do not invent a new
|
|
53
|
+
one.
|
|
54
|
+
3. **Disk pointer** — `Report: <path>` (or `Doc: <path>`, `Cards: <path>`) when
|
|
55
|
+
the full analysis was persisted, so the orchestrator can read the long form
|
|
56
|
+
only if it needs to.
|
|
57
|
+
|
|
58
|
+
Keep it tight — model the ceiling on `qa-sentinel`'s "Return Protocol" (a short
|
|
59
|
+
final message, *not* the full report) and `visual-fidelity-verifier`'s strict
|
|
60
|
+
JSON. A good COMPACT return is tens of lines, not hundreds. **No preamble, no
|
|
61
|
+
restating the task, no narrating what you read.**
|
|
62
|
+
|
|
63
|
+
### FULL (opt-in, narrow)
|
|
64
|
+
|
|
65
|
+
The agent returns extended narrative **only** when:
|
|
66
|
+
- the agent was invoked **directly by the user** (not by an orchestrator) for an
|
|
67
|
+
explanation/exploration where the prose *is* the answer; or
|
|
68
|
+
- the agent's deliverable is inherently the long-form text AND there is no disk to
|
|
69
|
+
persist it to.
|
|
70
|
+
|
|
71
|
+
Even in FULL mode, prefer **persist-then-summarize**: if the agent can write the
|
|
72
|
+
long form to disk (a report, a doc, a research file), do that and return COMPACT
|
|
73
|
+
with the pointer. FULL is the exception, not the fallback.
|
|
74
|
+
|
|
75
|
+
## Persist-then-summarize (the guiding rule)
|
|
76
|
+
|
|
77
|
+
If your reasoning is a deliverable, **write it to disk and return the pointer.**
|
|
78
|
+
The orchestrator's context is not an archive — it is a working set. An agent that
|
|
79
|
+
writes its report to `/qa/<CARD-ID>.md`, `${paths.references_dir}/...`, or a
|
|
80
|
+
research file and returns a three-line pointer has done its job better than one
|
|
81
|
+
that pastes 800 lines back, because the orchestrator pays for those 800 lines on
|
|
82
|
+
*every* subsequent turn of the batch.
|
|
83
|
+
|
|
84
|
+
## Reuse the existing findings schema
|
|
85
|
+
|
|
86
|
+
Review/audit agents that emit findings already share one pooled YAML schema
|
|
87
|
+
(`finding_id / title / source / category / severity / confidence /
|
|
88
|
+
evidence{file,lines,quote ≤8} / minimal_fix_direction / …`), parsed by
|
|
89
|
+
`/codexreview` and the `/new` review fan-in. The COMPACT return **reuses that
|
|
90
|
+
schema** — it is already terse and machine-readable. Never define a per-agent
|
|
91
|
+
findings shape.
|
|
92
|
+
|
|
93
|
+
## Honest limits
|
|
94
|
+
|
|
95
|
+
This is a **prompt-level authoring convention**, best-effort — not a parser that
|
|
96
|
+
truncates output. It works because the agent follows its own contract, exactly
|
|
97
|
+
like the thinking-keyword escalation in `effort-protocol.md`. Two consequences:
|
|
98
|
+
|
|
99
|
+
1. **Don't drop signal to hit a line count.** COMPACT means *no ceremony and no
|
|
100
|
+
dumps*, not lossy omission of a real BLOCKER. If the findings genuinely need 60
|
|
101
|
+
lines, use 60 — the win is cutting preamble/narration/echo, not truncating
|
|
102
|
+
substance. (This mirrors headroom's verbosity L1–L3: remove ceremony and echo
|
|
103
|
+
first; "caveman" L4 fragmentation is for prose, never for findings.)
|
|
104
|
+
2. **Agents already structured stay as they are.** `qa-sentinel` (Return
|
|
105
|
+
Protocol), `visual-fidelity-verifier` (JSON schema), `code-reviewer` /
|
|
106
|
+
`security-reviewer` / `api-perf-cost-auditor` (verdict line + pooled YAML
|
|
107
|
+
findings, capped narrative) already satisfy this contract — they are the
|
|
108
|
+
reference exemplars, not edit targets.
|
|
109
|
+
|
|
110
|
+
## The canonical body block
|
|
111
|
+
|
|
112
|
+
Every orchestrator-facing subagent that returns free-form analysis pastes a short
|
|
113
|
+
`## Return Contract` section into its body (after `## Core Responsibilities` /
|
|
114
|
+
`## Mission`, or after the role preamble). Keep it dense — cite this module, do
|
|
115
|
+
not re-explain the modes:
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
## Return Contract
|
|
119
|
+
|
|
120
|
+
**Mode:** COMPACT (default). Your final message to the orchestrator is bounded —
|
|
121
|
+
headline/verdict + key points as `path:line` (no reasoning dump, no pasted code) +
|
|
122
|
+
`Report: <path>` when the full analysis is on disk. Persist the long form, return
|
|
123
|
+
the short form. FULL narrative only when the user invoked you directly for prose.
|
|
124
|
+
Findings schema, mode definitions, and the persist-then-summarize rule:
|
|
125
|
+
`framework/agents/return-contract-protocol.md`.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
A copy-paste starter lives at `framework/templates/agent-return-contract.snippet.md`.
|
|
129
|
+
When adding a new orchestrator-facing agent, paste this block — the convention is
|
|
130
|
+
recorded in `framework/.claude/agents/REGISTRY.md` (the agent SSOT).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!-- contamination-scan: skip
|
|
2
|
+
The only token the scanner flags is "fidelity" inside the framework agent name
|
|
3
|
+
`visual-fidelity-verifier` (cited as an exemplar) — framework content, not leak. -->
|
|
4
|
+
<!--
|
|
5
|
+
RETURN CONTRACT HEADER — paste this into any orchestrator-facing BALDART
|
|
6
|
+
subagent that would otherwise return free-form analysis/audit/research prose.
|
|
7
|
+
|
|
8
|
+
Paste the `## Return Contract` block below right after `## Core Responsibilities`
|
|
9
|
+
/ `## Mission` (or after the role preamble). It bounds the agent's FINAL MESSAGE
|
|
10
|
+
to the orchestrator so a long body doesn't flood the orchestrator's context —
|
|
11
|
+
the long form goes to disk, the return is a short headline + pointers.
|
|
12
|
+
|
|
13
|
+
Skip for agents that ALREADY have a tight return shape (qa-sentinel's Return
|
|
14
|
+
Protocol, visual-fidelity-verifier's JSON, the verdict+pooled-YAML reviewers) —
|
|
15
|
+
they are the reference exemplars, not edit targets.
|
|
16
|
+
|
|
17
|
+
Full protocol: framework/agents/return-contract-protocol.md
|
|
18
|
+
|
|
19
|
+
Keep this header DENSE (4-5 lines). Do not re-explain the modes —
|
|
20
|
+
cite framework/agents/return-contract-protocol.md instead.
|
|
21
|
+
-->
|
|
22
|
+
|
|
23
|
+
## Return Contract
|
|
24
|
+
|
|
25
|
+
**Mode:** COMPACT (default). Your final message to the orchestrator is bounded —
|
|
26
|
+
headline/verdict + key points as `path:line` (no reasoning dump, no pasted code) +
|
|
27
|
+
`Report: <path>` when the full analysis is on disk. Persist the long form, return
|
|
28
|
+
the short form. FULL narrative only when the user invoked you directly for prose.
|
|
29
|
+
Findings schema, mode definitions, and the persist-then-summarize rule:
|
|
30
|
+
`framework/agents/return-contract-protocol.md`.
|