---
schema_version: "newruntime-agent-readable-v0.2"
type: "project_build_brief"
stable_id: "project_build_brief:coding-agent-cost-controls"
project_slug: "coding-agent-cost-controls"
project_title: "Coding Agent Cost Controls"
buildability_class: "B2"
verification_status: "locally-reproduced"
proof_artifact_count: 6
buildability_axis_count: 7
replay_evidence_count: 2
project_status: "candidate"
last_verified: "2026-08-15"
record_date: "2026-08-15"
date_kind: "last_verified"
routes: {"html":"https://newruntime.com/projects/coding-agent-cost-controls/","project_markdown":"https://newruntime.com/projects/coding-agent-cost-controls.md","project_json":"https://newruntime.com/projects/coding-agent-cost-controls.json","acceptance":"https://newruntime.com/projects/coding-agent-cost-controls/acceptance.md"}
---

# Build brief: Coding Agent Cost Controls

## Desired outcome

Reduce cost per completed coding task without relying on every prompt to say 'read less'.

## Wow moment

The agent sees smaller logs, targeted repo context, and stable rules before the expensive model call happens.

## Known inputs

- One repository with runnable checks
- Recent agent transcripts or command logs with obvious high-noise sections
- Existing agent instruction file, if the repo has one

## Available tools

- Shell
- Repo search
- Test runner
- Agent CLI configuration

## Proof status

- Verification status: locally-reproduced.
- Last verified: 2026-08-15.
- Expected artifacts: 3.
- Provider scopes: 2.

## Fixture outputs

- Built project JSON: dist/projects/coding-agent-cost-controls.json (https://newruntime.com/projects/coding-agent-cost-controls.json). Check: The route contains proof, handoff, permissions, source URLs, and agent-readable routes for this project.
- Agent acceptance checklist: dist/projects/coding-agent-cost-controls/acceptance.md (https://newruntime.com/projects/coding-agent-cost-controls/acceptance.md). Check: The checklist repeats required checks, provider scopes, reproduction commands, and failure conditions.
- Build brief handoff: dist/projects/coding-agent-cost-controls/build-brief.md (https://newruntime.com/projects/coding-agent-cost-controls/build-brief.md). Check: The build brief can be handed to another agent without private context or hidden source dependencies.
- Clean-room replay fixture: scripts/project-proof-depth-v2-fixture-test.mjs. Check: The fixture replays the bounded log-trimming task in a temporary directory, proves that the initial implementation hides the failure and warning lines, proves the final pass, and verifies that an unrelated file is unchanged.
- Independent replay kit: scripts/project-proof-independent-replay-kit.mjs. Check: The kit starts with a trim function that hides failures, exposes no ready solution, protects every out-of-scope file by checksum, and refuses to emit a receipt without a non-author attestation and a passing final check.
- Independent agent replay receipt: src/data/project-proof-receipts/coding-agent-cost-controls-independent-agent-v1.json (https://newruntime.com/projects/coding-agent-cost-controls.json). Check: A separately spawned agent received only the isolated kit, observed the hidden-failure regression, changed only src/trim-log.mjs, passed the final check, and produced an attestation that the primary verifier accepted.

## Reproduction commands

1. npm run project-proof:replay:test
2. npm run project-proof:replay:prepare -- --project=coding-agent-cost-controls
3. npm run validate:content
4. npm run build
5. npm run validate:agent-indexes

## Expected artifacts

- A before/after measurement note with command, token or output-size signal, elapsed time, and pass/fail result.
- A focused repo-map or wrapper-script diff that trims noisy output without hiding actionable failures.
- A cleanup note for any temporary local logs used to measure the workflow.

## Buildability breakdown

Assessment level: non-author-replayed. Assessed at: 2026-08-15.

| Axis | Level | Evidence | Bottleneck |
| --- | --- | --- | --- |
| time | high | The clean-room log-trimming task reaches a checked result in one bounded local run, while the public blueprint targets a half day for one narrow repository. | Real before/after cost measurement still needs repeated agent runs on the chosen repository. |
| code burden | medium | The replay needs one focused filter edit plus the existing test, and the public blueprint needs only repo maps, wrapper scripts, and config rather than a bespoke application. | A nontechnical owner still needs an agent or engineer to identify which output paths are noisy but safe to trim. |
| integration burden | medium | The replay uses only Node, a test runner, and one deterministic filter function with no external service. | Each target repository needs its own noisy-output inventory and repo-specific hooks before the controls transfer. |
| operational burden | high | The first proof is local and temporary, requires no server, and deletes no shared or production state. | Continuous cost monitoring across many repositories would need scheduled measurement and log-retention rules. |
| permission clarity | high | Read and local-write scopes are named separately, the Git remote scope is explicitly none for the first pass, and commit, push, and deploy stay behind a separate owner command. | Deploying trimmed-output wrappers into shared CI would reopen the approval question. |
| reproducibility | high | A separately spawned agent received only the isolated public kit, reproduced the initial check where the trim function hid the failure and warning lines, changed the one allowed filter file, and passed the same acceptance check without inspecting the author solution. | A replay on a real noisy repository with token measurements would strengthen the savings claim beyond this bounded fixture. |
| failure recovery | high | The replay records the initial failing check, preserves an unrelated file byte-for-byte, performs no remote action, and leaves explicit residual-risk and approval sections. | Restoring hidden diagnostics inside a production agent pipeline is outside this local proof. |

## Replay evidence

### clean-room-bounded-edit-v1

- Date: 2026-08-15.
- Kind: automated-clean-room.
- Instructions: public-build-brief-and-acceptance.
- Environment: Temporary local directory with a bounded Node fixture and no network or remote writes.
- Outcome: passed.

Artifacts:

- Task brief: task-brief.json. Check: Names the allowed filter file, acceptance command, non-goals, and approval-gated actions.
- Focused implementation: src/trim-log.mjs. Check: Changes only the named filter file while the unrelated note retains its original checksum.
- Real test: test/trim-log.test.mjs. Check: Fails while the initial trim function hides the failure and warning lines, and passes after the focused edit keeps them.
- Structured handoff: handoff.json. Check: Separates implemented files, verification evidence, residual risk, and approval-gated actions.

Limitations:

- This replay proves the deterministic diagnostic-preserving output contract, not a real external repository integration or measured token savings.
- No human or separately operated agent independently interpreted the brief in this clean-room replay.

### independent-claude-replay-v1

- Date: 2026-08-15.
- Kind: independent-agent.
- Instructions: public-build-brief-and-acceptance.
- Environment: Isolated temporary replay kit; the executor was a separately spawned agent session that received only the kit path, no parent conversation or main-repository context, and used no network or remote writes.
- Outcome: passed.

Artifacts:

- Independent attestation: reviewer-attestation.json. Check: Names an independent agent, records initial failure and final pass, lists only src/trim-log.mjs as changed, and attests that the author solution was not inspected.
- Verified replay receipt: src/data/project-proof-receipts/coding-agent-cost-controls-independent-agent-v1.json (https://newruntime.com/projects/coding-agent-cost-controls.json). Check: The primary verifier checked protected-file hashes, rejected unexpected files, reran the acceptance test, and recorded zero unexpected files.

Limitations:

- This proves a bounded non-author replay of the public workflow contract, not integration into a production repository.
- Reviewer identity is a local agent attestation and is not cryptographically verified.

## Provider scopes

| Provider | Access | Minimum scope | Approval gate |
| --- | --- | --- | --- |
| Local repository | write | Selected repo-map, wrapper-script, or agent-config files only. | Human names the repository and approves the exact files before edits. |
| Git remote | none | No remote write access is required for the first proof pass. | Commit, push, or deploy require a separate explicit owner command. |

## Privacy constraints

- Data touched: Repository metadata, command output, logs.
- Use only publishable public source URLs in public output.
- Do not expose private discovery feeds, raw exports, credentials, drafts, or internal handoff artifacts.

## Required approvals

- Local config and scripts only until explicitly deployed
- read: Human names the repo and task before inspection.
- write: Human approves the exact files before edits are applied.

## Build steps

1. Pick one narrow task type that currently produces noisy logs or broad context reads.
2. Add or update a repo map that names the high-signal files, test commands, and ignored generated paths.
3. Trim one noisy command output path while preserving failures, warnings, and changed-file evidence.
4. Run the same task before and after the change and record token, time, and check-result differences.

## Acceptance checks

- A failing test still shows the failing file, assertion, command, and exit status.
- The agent can identify the intended files without reading the whole repository first.
- The cost-control change reduces irrelevant output without hiding actionable diagnostics.
- The handoff report includes before/after command evidence, changed files, and residual risk.

## Explicit non-goals

- Do not hide warnings, stack traces, or test output just to lower token count.
- Do not change production behavior or deployment configuration in the first pass.
- Do not rely on prompt wording alone when a deterministic script or config can enforce the boundary.

## Questions before external systems

- Which repo and task type should be used as the measurement target?
- Which command output is known to be noisy but still safe to summarize?
- Is any private log data allowed in the local measurement artifact?

## Related routes

- html: https://newruntime.com/projects/coding-agent-cost-controls/
- project_markdown: https://newruntime.com/projects/coding-agent-cost-controls.md
- project_json: https://newruntime.com/projects/coding-agent-cost-controls.json
- acceptance: https://newruntime.com/projects/coding-agent-cost-controls/acceptance.md
