Skip to content

docs: adversarial codebase audit (2026-07-03) — assertions, parser, benchmark-stats integrity - #1

Merged
RubenGlez merged 2 commits into
mainfrom
claude/codebase-adversarial-audit-wo8pbw
Jul 3, 2026
Merged

docs: adversarial codebase audit (2026-07-03) — assertions, parser, benchmark-stats integrity#1
RubenGlez merged 2 commits into
mainfrom
claude/codebase-adversarial-audit-wo8pbw

Conversation

@RubenGlez

Copy link
Copy Markdown
Owner

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/oneOf argument assertions (src/assertions.ts:285). CONFIRMED by execution.
  • Wrong-script replies pass Latin-locale checksNON_LATIN_PATTERN omits Georgian and Ethiopic although SCRIPT_PATTERNS supports ka/am; a fully Amharic or Georgian reply passes responseLanguage: en (src/assertions.ts:62). CONFIRMED.
  • Transport failures masquerade as no_tool_call — a dead/erroring target is reported with the product's headline behavioral failure mode and flows into benchmark no_tool_call counts (src/runner.ts:41-47). CONFIRMED.
  • translate emits reason: [object Object] for any scenario using the 0.3.0 oneOf feature (src/translate.ts:150), and silently drops locales the LLM omits. CONFIRMED against a mock LLM server.
  • RESEARCH.md failing-locale lists are silently incomplete — all 18 headline pass rates verified correct, but per-row lists omit failing cells with no stated rule; haiku ecommerce-track omits zh (2/10) while listing en (3/10) (RESEARCH.md:19-50). CONFIRMED by recount.
  • Writeup cites Wilson CIs that exist in no committed artifact — results span three generator schemas; none has the 95% CI column RESEARCH.md points readers to; the benchmark table also omits wrong_language entirely (examples/benchmark/run.ts:201). CONFIRMED.
  • Hand-rolled YAML parser traps — 4-space/tab indents and block scalars rejected with misleading errors; empty noToolCall: steals the next toolCall's name creating an unsatisfiable assertion; quoted commas mangle oneOf; duplicate locales last-win silently (src/scenario.ts). All CONFIRMED by execution.
  • No HTTP timeout — one hung locale hangs the whole serial run/CI job forever (src/httpTarget.ts:20). CONFIRMED by trace.
  • CI-gate logic tested via a copy-paste duplicateshouldFail isn't exported; tests/ci.test.ts:22 re-implements it, so gate regressions can't fail tests; CI also never runs pnpm build for the shipped artifact. CONFIRMED.
  • Published package is CLI-only despite library posture — no main/exports/types in package.json; nothing is importable; the required agent: 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

claude and others added 2 commits July 3, 2026 12:19
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
@RubenGlez
RubenGlez merged commit d62866e into main Jul 3, 2026
1 check passed
@RubenGlez
RubenGlez deleted the claude/codebase-adversarial-audit-wo8pbw branch July 3, 2026 18:31
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.

2 participants