openpencil/scripts/ab-corpus
Fini f0a575e210 fix(ab-corpus): preserve markdown structure across kept @domain blocks
Codex stop-time review caught that the Phase 2 domain filter
corrupted output when two adjacent kept blocks abutted: the regex's
trailing `\s*` consumed every character of whitespace BEFORE the next
match's leading `\s*`, so block N's body ended on its closing ``` and
block N+1's body started on its `### heading` with no separator at
all. Output: ` ```### Audit / activity feed` on a single line — fence
left unclosed, heading swallowed.

Replace the greedy `\s*` on both sides of each marker with a literal
`\n`, so the regex only consumes the single newline immediately
adjoining the comment. Surrounding blank lines stay in the
surrounding text where they belong, separating adjacent kept blocks
naturally.

Adds a regression guard test that searches the output for ` ```###`
(closing fence directly followed by a level-3 heading on the same
line). Codex effectively asked for it.

3767 vitest pass, format clean. Side effect: dropped blocks now
leave their surrounding blank lines intact, so dropped-block savings
shrink by ~3-5 chars per block; total Phase 2 savings stay within
the 500-char floor the existing test asserts.
2026-04-29 09:49:50 +08:00
..
__tests__ fix(ab-corpus): preserve markdown structure across kept @domain blocks 2026-04-29 09:49:50 +08:00
clients feat(ab-corpus): bump minimax max_tokens to 8192 (defensive) 2026-04-29 09:49:48 +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): preserve markdown structure across kept @domain blocks 2026-04-29 09:49:50 +08:00
measure-prompt-sizes.ts feat(ab-corpus): per-domain cookbook filter (Phase 2 of token diet) 2026-04-29 09:49:49 +08:00
real-model.ts feat(ab-corpus): per-domain cookbook filter (Phase 2 of token diet) 2026-04-29 09:49:49 +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