refactor(bench): use runtime candidate workspaces#540
Conversation
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — 6b9e166a
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: drewstone_author · 2026-07-13T01:36:25Z
tangletools
left a comment
There was a problem hiding this comment.
🟢 Value Audit — sound
| Verdict | sound |
| Concerns | 0 (none) |
| Heuristic | 0.0s |
| Duplication | 0.0s |
| Interrogation | 116.0s (2 bridge agents) |
| Total | 116.0s |
💰 Value — sound
Deletes bench's duplicate pier-workspace-archive implementation and routes Pier outcome capture/materialization through the runtime's newly-standardized candidate-workspace primitive — a textbook consumer-side follow-through to the substrate standardization.
- What it does: Removes bench/src/pier-workspace-archive.ts (182 lines) and its test (58 lines), then points capturePierTaskOutcome and the verify-pier-agent script at @tangle-network/agent-runtime/candidate-execution's captureAgentCandidateWorkspaceFiles and createAgentCandidateWorkspacePort. It also threads an optional artifactPersistence option (executionId + AgentCandidateOutputArtifactPort) through capturePi
- Goals it achieves: (1) Eliminate the second, parallel workspace-archive implementation that bench maintained beside the runtime. Commit 51a9d27 ('feat(runtime): standardize candidate workspace archives', #538) introduced captureAgentCandidateWorkspaceFiles/createAgentCandidateWorkspacePort as the single canonical primitive; this PR is the consumer-side completion of that standardization for the Pier path. (2) Gain t
- Assessment: Good change, firmly in the grain of the codebase. The runtime was explicitly built to own this format (src/candidate-execution/workspace-archive.ts:1-986, re-exported at src/candidate-execution/index.ts:111-119), and bench was the last holdout running a duplicate. The separation of concerns after the refactor is correct: the Pier-specific git-tree reconstruction from a binary patch (capturePierTas
- Better / existing approach: none — this is the right approach. Searched: (a) grepped the whole repo for any surviving consumer of the deleted createPierWorkspaceArchive/materializePierWorkspaceArchive/PierWorkspaceArchive* symbols — zero hits, so nothing else needs migrating; (b) confirmed the runtime primitive is the single canonical implementation (src/candidate-execution/workspace-archive.ts, public via the /candidate-exe
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 2
- Bridge warning: opencode/kimi-for-coding/k2p7: bridge stream ended without value-audit content
🎯 Usefulness — sound
Deletes a duplicate JSON-based workspace archive in bench and routes Pier outcome capture through the runtime's canonical tar-based primitive, preserving content-addressed persistence for oversized archives.
- Integration: Fully wired and reachable today. capturePierTaskOutcome is called from the executor stopAndCapture path (pier-agent.ts:590) and returns the runtime's AgentCandidateExecutorTaskOutcomeCapture type, which execute.ts:384 consumes, verifies, and persists. createAgentCandidateWorkspacePort is constructed at verify-pier-agent.mts:444 and is the same port the runtime itself uses to re-materialize and ver
- Fit with existing patterns: Follows the codebase's grain exactly. PR #538 (commit 51a9d27) introduced the runtime's captureAgentCandidateWorkspaceFiles/createAgentCandidateWorkspacePort precisely to be the single archive implementation; this PR is the consumer-side migration that retires the second one. Bench now owns only its Pier-specific responsibility (reconstruct the result tree from a binary patch in an isolated git ob
- Real-world viability: Holds up under realistic paths. The large-archive case is exercised by the new 'externalizes workspace evidence above the embedded limit' test (pier-task-outcome.test.mts:80-128) which writes a 1 MiB+1 payload, confirms it lands in the content-addressed store, and verifies the round-tripped bytes. The capture→materialize round-trip is covered by the existing deterministic test, now asserting equal
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 1
No concerns — sound change, no better or existing approach found. ✅
What this audit checks
It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.
| Pass | What it asks |
|---|---|
| Heuristic | Vague title? Whitespace-only or cruft-bearing diff? (content signals only) |
| Duplication | Do added function/class names already exist elsewhere in the repo? |
| Value Audit | What does it do? What goal does it achieve? Is it good? Better architecture or already-exists? |
| Usefulness Audit | Does it integrate and fit? Will it hold up in real use and actually get used? |
Findings are concerns, not blocks — the human reviewer decides what to do with them.
Problem
@tangle-network/agent-benchmaintained a second candidate-workspace archive implementation beside the runtime primitive.Change
@tangle-network/agent-runtime@0.94.6@tangle-network/agent-benchto0.3.0because the old archive exports are intentionally removed@tangle-network/agent-evalto0.115.2Verification
pnpm typecheck:publicpnpm test— 22/22 TypeScript files plus Pier bridgepnpm verify:package— packed consumer verified with runtime 0.94.6git diff --checkorigin/main: clean