Skip to content

refactor(evaluation-system): compact harness prompts, A/B verified - #38

Closed
cmschuetz wants to merge 1 commit into
mainfrom
strapped/evaluation-system/D4-verified-optimizations
Closed

refactor(evaluation-system): compact harness prompts, A/B verified#38
cmschuetz wants to merge 1 commit into
mainfrom
strapped/evaluation-system/D4-verified-optimizations

Conversation

@cmschuetz

@cmschuetz cmschuetz commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Deliver the empirical payoff: use the eval suite (D1–D3) to find and remove at
least three redundancies in the harness prompts, each backed by an A/B eval
showing no meaningful correctness regression (within tolerance) and a cost or
latency win, and produce a documented, evidence-based verdict on PR #33. The
prompt edits live in src/workflows/strapped-run/**, so the generated
plugins/strapped/workflows/strapped-run.js is rebuilt and the plugin version
is bumped via the version tool (never by hand) — unlike D1–D3, which are not
plugin deployables. The human remains the final judge on PR #33.

Summary

Compacts redundant prompt prose in review-loop.ts and the stages/ files,
adds A/B variant cases capturing each baseline→candidate compaction so the win
is reproducible by bun run eval --ab, regenerates strapped-run.js via
bun run build, and bumps the plugin version through bun tools/version.ts bump. The ≥3 removed redundancies and the PR-#33 verdict, with their
Δcorrectness / Δcost / Δlatency numbers, are recorded in the run-state
optimizations-report.md (kept out of the repo diff).

Acceptance criteria

  • ≥3 distinct prompt redundancies removed from src/workflows/strapped-run/**, each with a recorded A/B eval (Δcorrectness within tolerance, cost or latency improved).
  • plugins/strapped/workflows/strapped-run.js regenerated and in sync (build-sync green).
  • Plugin version bumped via bun tools/version.ts bump and bun run version:check passes.
  • A written PR-fix(learn): canonical stateRoot resolution + scope-routed guideline synthesis #33 verdict — meaningful change or not, with eval numbers behind it — exists in optimizations-report.md.
  • bun run typecheck && bun run lint && bun test and a live bun run eval over the affected cases are green (no regression past tolerance).

Stack

All deliverables target the strapped repo (linear stack, each PR based on its parent's branch).

Deliverable Branch PR
D1 — eval engine strapped/evaluation-system/D1-eval-engine #35
D2 — eval framework strapped/evaluation-system/D2-eval-framework #36
D3 — harness eval suite strapped/evaluation-system/D3-harness-eval-suite #37
D4 — verified optimizations strapped/evaluation-system/D4-verified-optimizations #38

Depends on #37

@@ -40,20 +40,20 @@ ${item.validations.map(v => `- ${v}`).join('\n')}

Commit your work on ${item.branch} with a Conventional-Commits message (\`<type>(${cfg.slug}): <description>\` — scope is the run slug, no \`${item.id}:\` title prefix; reference ${item.id} and the feedback fix in the body). If validations pass, commit and return status "implemented" with validations_green true. If you hit a blocker you cannot resolve (contradictory addendum, validation failure you cannot fix), commit what is safe, return status "blocked" with the blocker described — do NOT loop indefinitely.`

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addendum / fix-agent branch of implementPrompt still carries the redundancies R3 removed from the sibling non-addendum branch: the verbose read-list item and the doubled "commit and return" in this closing paragraph. The compaction is asymmetric — finish it here too (meaning-preserving, same as R3) or the two branches drift. (D4 self-flagged; correctness-safe.)

Base automatically changed from strapped/evaluation-system/D3-harness-eval-suite to main July 28, 2026 22:43
Remove four genuine, meaning-preserving redundancies from the harness stage
prompts, each verified via the D1-D3 eval suite's A/B mode with no correctness
regression:

- planner (stages/plan.ts, steps 3-5): define "meaningful diff" once; state the
  cross-repo base rule + ordering-only consequence once (drop step 4's restatement)
- reviewer (review-loop.ts): collapse the AC-checklist paragraph's doubled
  equal-weight clause
- soundness lens b (review-loop.ts PLAN_LENSES.b): define "meaningful diff" once
  instead of repeating the exclusion phrase twice
- implementer (stages/implement.ts): fold the filler lead-in into the header and
  drop the doubled "commit" in the closing paragraph

The eval cases (planner/reviewer/implementer) now carry baseline->candidate
variants so `bun run eval --suite src/eval/suites/harness --ab` reproduces the
verification (exit 0: correctness held at parity across all cases). End-to-end
envelope cost/latency is below the harness's agentic execution-noise floor, so
the attributable win is the deterministic prompt-text reduction (-302 chars);
the eval's decisive role is certifying zero correctness regression. A written
PR-#33 verdict and full A/B numbers live in the run dir's optimizations-report.md.

Regenerates plugins/strapped/workflows/strapped-run.js; plugin 0.8.0 -> 0.8.1
(patch: prompt compaction, no behavior change).

Implements D4 of the evaluation-system run.
@cmschuetz
cmschuetz force-pushed the strapped/evaluation-system/D4-verified-optimizations branch from 3f57c77 to c27ea41 Compare July 28, 2026 22:45
@cmschuetz

Copy link
Copy Markdown
Owner Author

Closing unmerged.

The four edits total ~302 chars (≈76 tokens), spread across three different prompts — no single invocation saves more than ~40. Against a measured 86k–180k input tokens per harness invocation that's a ~0.02% reduction, and the observed cost deltas swung ±$0.05 with sign flips between runs — roughly 600× larger than the effect. There is no cost win to claim.

The correctness evidence was N=1 per arm at 25% tolerance: a smoke test, not verification of parity.

One edit (stages/plan.ts) was a reordering rather than a dedup — it moved the cross-repo base rule out of step 4, which writes the base field, into step 5. Small but real risk, no power to detect it.

The genuinely useful output of this deliverable was the negative result: the D1–D3 eval suite cannot measure cost/latency effects of prompt edits, because agentic variance (2–17 turns, 86k→180k input context on identical prompts) swamps prompt-length effects by 3–4 orders of magnitude. That reframes the suite as a correctness/regression harness. That finding, and the PR #33 verdict, are preserved in the run state's reviews/optimizations-report.md and don't need this diff to survive.

@cmschuetz cmschuetz closed this Jul 28, 2026
@cmschuetz
cmschuetz deleted the strapped/evaluation-system/D4-verified-optimizations branch July 28, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant