test: broaden leaf coverage — escape/identifier units + 2.1.169 golden snapshot#6
test: broaden leaf coverage — escape/identifier units + 2.1.169 golden snapshot#6dividedby wants to merge 2 commits into
Conversation
Adds direct unit coverage for the previously-untested exported helpers that
carry the extract → map → apply prompt-customization pipeline, plus a golden
digest locking the extractor's output for the pinned in-matrix version.
- systemPromptCustomization.test.ts: buildRegexFromPieces regex-metachar /
${VAR}-literal escaping, extractUserCustomizations + buildHumanToRealMapping
round-trip and conflict/skip paths, reconstructContentFromPieces, and the
whitespace extract/apply pair.
- promptsGolden.test.ts (+ snapshot): pins prompts-2.1.169.json structural
shape and a digest (prompt count, unique-id sha, duplicate-id groups,
unmapped-identifier prompts, identifier-value surface) so a version bump
cannot silently drop, rename, or re-shape a prompt without flipping review.
Tests only; no patch/extraction logic changed. The snapshot captures two
pre-existing extractor quirks (4 duplicate-id groups; 3 skill-code-review
prompts whose identifier index has no identifierMap entry) as candidate
findings rather than asserting them away.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…zed covered (#68) Inventory posted + tweakcc-fixed test PR prepared (skrabe/tweakcc-fixed#6: escape/identifier units + 2.1.169 golden). Lobotomized per-override coverage resolved as covered by tools/auditMisbinds.mjs — no parallel harness (ADR 0001). Row → Blocked, owner human, ready-for-human (awaiting skrabe merge of #6). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
Marking this draft — it's an optional contribution and I'd rather check it maps onto how you want tests to look before it's a merge ask. Two independent pieces, different value/cost:
So: do you want test contributions like this at all, and if so in what form? Happy to drop the golden and keep only the unit helpers, rework it to track latest instead of a pinned version, or close this and leave testing to your own gates. Your call — no pressure to merge. |
|
Thanks — and good instinct marking it draft. Where I land: Taking Dropping the golden + snapshot. Three reasons, none about the quality of the work:
So: drop |
Per skrabe's review on skrabe#6 — the pinned golden duplicates the showtime no-regression check plus auditMisbinds plus the capture/read-consistency tests, and costs a regen every bump for a narrow catch-window. Keep systemPromptCustomization.test.ts (version-independent helper coverage). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Done — dropped Your reasoning on the golden is right — it duplicates gates you already run and pins you to a regen every bump for a narrow catch-window. The helper units are the part worth keeping. On the flip-flop the snapshot surfaced: agreed it's an extractor finding to root-cause, not lock in — leaving it with you. For the record, what we saw was the |
Tests-only coverage broadening (control-plane Piebald-AI#8 — leaf test broadening). No patch/extraction logic touched; merge is yours.
What
Two new vitest files closing the highest-value gaps a version bump could slip through:
src/systemPromptCustomization.test.ts— direct units for the previously-untested exported helpers carrying the extract → map → apply customization pipeline:buildRegexFromPieces— regex-metacharacter and${VAR}-literal escaping (pieces that look like regex / interpolation must match literally)extractUserCustomizations+buildHumanToRealMapping— round-trip recovery, conflict-throw, and unmapped-identifier skip pathsreconstructContentFromPieces— human-name interleave +UNKNOWN_<idx>fallbackextractOriginalWhitespace/applyOriginalWhitespace— boundary-whitespace preservationsrc/tests/promptsGolden.test.ts(+ snapshot) — golden digest over the pinned in-matrixprompts-2.1.169.json(the extractor's committed output): prompt count, unique-id sha, identifier-value surface, plus the duplicate-id groups and unmapped-identifier prompts. A bump that silently drops, renames, or re-shapes a prompt flips the snapshot in review.Scope notes
escapeNonAsciiForRegex,hexAlt,buildSearchRegexFromPieces,applyIdentifierMapping) are not exported, so they're out of scope here — covering them would need an export decision from you.idgroups (system-reminder-cross-session-peer-message-authority-warningappears 4×).skill-code-review-phase-*prompts whose identifier index has noidentifierMapentry → reconstruct asUNKNOWN_<idx>.pnpm testgreen (343 passed, +17),pnpm lintclean.🤖 Generated with Claude Code