openpencil/scripts/ab-corpus
Fini f6746eb91c fix(ab-corpus): forbid mixing batch_design with element tools in T
The earlier T instruction split tool selection into PRIMARY / COMPOSITE
(element tools) and FALLBACK (batch_design). FALLBACK was scoped
"when no element tool fits a given component shape" — implying you
could mix per-component. But output-parser.ts silently drops every
batch_design tag whenever any element call is also present (filter
ELEMENT_TOOL_NAME_RE then return). A mixed response

  <op_tool>{"name":"add_section_header_v0",...}</op_tool>
  <op_tool>{"name":"batch_design", ...scaffolding...}</op_tool>

would lose the batch_design half and only run the element call —
the brief is half-applied without anyone noticing. Codex stop-time
review caught the mismatch.

Reframes T as a binary choice:
- STRATEGY A: every component fits an add_*_v0 tool — emit one tag
  per component
- STRATEGY B: at least one component needs batch_design — emit a
  SINGLE batch_design covering the whole brief

Plus an explicit "Do not mix Strategy A and Strategy B" guard line.
Tests assert both strategy markers are present in every T variant
and the dropped per-component-fallback phrase is gone.

The elements.md cookbook still teaches batch_design + element tool
composition for real MCP multi-round usage; the corpus T arm is
single-shot so the trailing T_TOOL_CALL_INSTRUCTIONS overrides via
"last instruction wins".
2026-04-29 09:49:45 +08:00
..
__tests__ fix(ab-corpus): forbid mixing batch_design with element tools in T 2026-04-29 09:49:45 +08:00
clients feat(ab-corpus): exponential backoff + bump retries=2 on ark/deepseek 2026-04-29 09:49:41 +08:00
apply.ts fix(ab-corpus): plumb multi-tool output end-to-end for composite 2026-04-29 08:35:00 +08:00
build-prompt.ts fix(ab-corpus): forbid mixing batch_design with element tools in T 2026-04-29 09:49:45 +08:00
measure-prompt-sizes.ts fix(ab-corpus): allow multi-tool output in T system prompt 2026-04-29 09:49:44 +08:00
real-model.ts feat(ab-corpus): gate elements-cookbook on T arm by difficulty 2026-04-29 09:49:42 +08:00
run.ts feat(ab-corpus): bootstrap ab-v3 with token cost + composite difficulty 2026-04-29 07:45:00 +08:00
stub-model.ts fix(ai-skills): drop invalid section_header subtitle from cookbook + stubs 2026-04-29 09:49:40 +08:00
write-report.ts feat(ab-corpus): bootstrap ab-v3 with token cost + composite difficulty 2026-04-29 07:45:00 +08:00