docs: adversarial codebase audit (2026-07-03) — assertions, parser, benchmark-stats integrity - #1
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgVgoUZPub3bKYkz6J28yn
Fix correctness, parser, transport, stats, docs, and DX findings from .harness/qa/adversarial-audit-2026-07-03.md. - assertions: type-gate scalar matching (F-1); derive non-Latin script set from one table so Georgian/Ethiopic are covered (F-2); require kana for ja (F-3); report in-script ratio (F-4); sequence near-miss detail (F-6) - transport: new target_error failure mode kept out of behavioral stats, --timeout + AbortSignal, surface malformed responses, send agent in POST (F-5,17,21,22) - parser: quote-aware oneOf split, line-numbered errors for tabs/indent/block scalars, scoped nested lookups, reject duplicate locales and nameless list items (F-7..F-11) - cli/gate: stop -v/-h hijacking run, validate target URL, warn on unknown allow-fail, directory always emits matrix, extract shouldFail to gate.ts (F-18,19,20,23) - stats: wilsonInterval to src/stats.ts with tests, emit CI in JSON report, derive benchmark failure modes from FAILURE_MODES, SIGKILL/iteration resilience (F-12,15,16) - lint: duplicate scenario id and non-determinable responseLanguage warnings (F-24,29) - translate: serialize oneOf correctly, emit responseLanguage, warn on dropped locales (F-30,31) - reports: markdown Detail column, highlight failures, escape pipes (F-35) - noToolCall accepts an anyOf list of forbidden tools (F-28) - docs/config: CLI-only note, Node>=22, health route + wait-on tcp, script caveats, Yoruba Monday fix, CI build step, release-script guards, ship CHANGELOG, remove stale gitignore path (F-26,27,32,33,34,36,37,39) - RESEARCH.md: complete failing-locale lists (fix zh omission), CI appendix computed from committed counts (F-13,14) - tests: httpTarget/runner/lint/translate/stats/gate coverage + audit regressions (F-38) Claude-Session: https://claude.ai/code/session_013Fo9pRgzPKwEqCERinVA4z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a full adversarial audit at
.harness/qa/adversarial-audit-2026-07-03.md: system map, severity-ranked findings (file:line, CONFIRMED/PLAUSIBLE, concrete scenario), design tensions, expectation gaps, and open questions. Build/typecheck/lint/tests are all green.Highest-severity findings
String()scalar coercion passes non-scalars —["duplicate_charge"],null, and objects all satisfy scalar/oneOfargument assertions (src/assertions.ts:285). CONFIRMED by execution.NON_LATIN_PATTERNomits Georgian and Ethiopic althoughSCRIPT_PATTERNSsupportska/am; a fully Amharic or Georgian reply passesresponseLanguage: en(src/assertions.ts:62). CONFIRMED.no_tool_call— a dead/erroring target is reported with the product's headline behavioral failure mode and flows into benchmarkno_tool_callcounts (src/runner.ts:41-47). CONFIRMED.translateemitsreason: [object Object]for any scenario using the 0.3.0oneOffeature (src/translate.ts:150), and silently drops locales the LLM omits. CONFIRMED against a mock LLM server.RESEARCH.md:19-50). CONFIRMED by recount.95% CIcolumn RESEARCH.md points readers to; the benchmark table also omitswrong_languageentirely (examples/benchmark/run.ts:201). CONFIRMED.noToolCall:steals the nexttoolCall's name creating an unsatisfiable assertion; quoted commas mangleoneOf; duplicate locales last-win silently (src/scenario.ts). All CONFIRMED by execution.src/httpTarget.ts:20). CONFIRMED by trace.shouldFailisn't exported;tests/ci.test.ts:22re-implements it, so gate regressions can't fail tests; CI also never runspnpm buildfor the shipped artifact. CONFIRMED.main/exports/typesinpackage.json; nothing is importable; the requiredagent:scenario field is read by nothing (the repo's own scenario sets it wrong). CONFIRMED.Positive verifications worth noting: all 18 benchmark headline pass rates match the artifacts, the Wilson interval math is correct (checked against reference values), the fake-agent 30-second demo works exactly as the README shows.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MgVgoUZPub3bKYkz6J28yn
Generated by Claude Code