3 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
a74c98576e Merge origin/dev into yaml-audit
Sync the yaml-audit branch with the latest dev work since the previous
sync (5c5af75ed). Brings in 73 commits including:

  - CI security fixes: postcss XSS bump, uuid bounds bump, codeql
    paths-ignore for vendored bundles, read-only token on
    staffml-validate-vault workflow
  - kits/ dark mode polish: code-block readability, dropdown contrast
  - vault-cli/: pre-commit ruff hook + 20 ruff fixes, all-contributors
    auto-credit workflow change to pull_request_target
  - dev's earlier merge of yaml-audit (836d481b5) carrying the
    pre-trailer-strip Phase 1/2/3 history; this merge harmonises that
    with the current trailer-clean yaml-audit tip
  - misc bug fixes (tinytorch perceptron seed, infra workflows,
    socratiq vite dev injector)

Conflicts resolved (if any) preserve the yaml-audit-side authoritative
state for vault/* files (we own those) and the dev-side authoritative
state for .github/workflows/* and other shared infrastructure.

# Conflicts:
#	.github/workflows/all-contributors-auto-credit.yml
#	.github/workflows/staffml-preview-dev.yml
#	interviews/staffml/src/data/corpus-summary.json
#	interviews/staffml/src/data/vault-manifest.json
#	interviews/staffml/tests/chain-and-vault-smoke.mjs
#	interviews/vault-cli/README.md
#	interviews/vault-cli/docs/CHAIN_ROADMAP.md
#	interviews/vault-cli/scripts/build_chains_with_gemini.py
#	interviews/vault-cli/scripts/generate_question_for_gap.py
#	interviews/vault-cli/scripts/merge_chain_passes.py
#	interviews/vault-cli/scripts/validate_drafts.py
#	interviews/vault-cli/src/vault_cli/legacy_export.py
#	interviews/vault-cli/tests/test_chain_validation.py
#	interviews/vault/.gitignore
#	interviews/vault/ARCHITECTURE.md
#	interviews/vault/chains.json
#	interviews/vault/id-registry.yaml
#	interviews/vault/questions/edge/optimization/edge-2536.yaml
#	interviews/vault/questions/mobile/deployment/mobile-2147.yaml
#	tinytorch/src/03_layers/03_layers.py
2026-05-02 11:06:43 -04:00
Vijay Janapa Reddi
615d3484ad fix(vault-cli): audit_math.py — handle output path outside REPO_ROOT
The "wrote {path}" line at end-of-run called Path.relative_to(REPO_ROOT)
unconditionally, which raised when --output was set to a /tmp/ path
(e.g., during smoke-testing). Same fix as validate_drafts.py earlier:
fall back to displaying the absolute path when relative_to fails.

Surfaced while smoke-testing audit_math.py with --output /tmp/...
before pointing it at the real _pipeline/ destination.
2026-05-02 10:53:39 -04:00
Vijay Janapa Reddi
cd37a5290c feat(vault-cli): format compliance gate + audit_math.py verifier
Two additions to the Phase 3 verification stack:

1. validate_drafts.py: new gate_format_compliance (Gate 1.5).
   Cheap regex check — no Gemini call. Verifies that the prose-block
   conventions our schema doesn't enforce are present:
     - common_mistake (when present): Pitfall / Rationale / Consequence
     - napkin_math (when present):    Assumptions / Calculations / Conclusion
   Either field is optional in the schema; the gate only flags
   present-but-malformed cases. Smoke-tested against 5 cases (clean,
   missing-pitfall, missing-calculations, no-fields, optional-absent).

2. New scripts/audit_math.py: standalone, focused math verifier.
   For each question, runs ONE Gemini call to re-derive every
   napkin_math calculation from scratch and compare against what's
   written. Returns a verdict on:
     - arithmetic_correct
     - unit_conversions_correct
     - conclusion_follows
     - errors[] (specific issues with quoted lines)
   Use cases: pre-promotion gate on Phase 3 drafts, retroactive
   audit of any subset of the published corpus.
   Internal parallelism via ThreadPoolExecutor (default 4 workers,
   capped at 8 to stay under typical Gemini RPM limits). Modes:
   --drafts-only, --files <paths...>, --sample-track + --sample-size.
2026-05-02 10:10:08 -04:00