fix: tier 1 correctness and cleanup fixes from architecture audit#58
fix: tier 1 correctness and cleanup fixes from architecture audit#58nojibe wants to merge 10 commits into
Conversation
…dex pages
The index pages linked to top-level /redlines/{configId} and /ndeltas/{modelId},
which don't exist — the detail routes live under /experiments/.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
…d pilot v1, dangling scripts - src/app/v2: duplicate homepage prototype, no inbound links anywhere - NavBarV2: imported only by the deleted v2 layout - SearchAutocomplete: zero importers - pilot/india-multilingual/_archive_v1: explicitly archived, unreferenced - package.json scripts test:personality / compare:personality / test:preference / test:self-preference pointed at CLI files that no longer exist Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
yaml-generator, json-response-parser (+ tests) and useMobile were physically located under src/app/sandbox but imported by the live analysis viewer, the story API routes, and the shared textarea UI primitive. Relocate them so the sandbox route no longer owns cross-surface code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
The push webhook parsed blueprints with a raw single-document yaml.load and required an embedded 'id' field, while the PR webhook and scheduled evals use the canonical parser with path-derived IDs. Consequences: multi-document blueprints that passed PR staging silently never ran after merge, embedded-id policy was contradicted, model-less blueprints failed downstream, and dedupe hashes never matched the cron path's resolved-config hashes. Extract a shared parseSubmittedBlueprint() into src/lib/blueprint-ingestion (canonical parse, canonical schema validation, path-derived ID, CORE model default) and use it in the push webhook, resolving model collections before hashing for cross-path dedupe consistency. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
Canonical JSON-Schema validation was warn-only, so structurally invalid blueprints proceeded into paid staging runs and failed late. Validate after parsing and report Ajv errors in the PR validation comment instead. Per-file parse errors now also surface as validation errors rather than failing the whole webhook. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
…eter FORCE_EXPERIMENTAL=true silently overrode the per-blueprint useExperimentalScale flag, so opting out of the 9-point scale did nothing. The default remains the experimental scale; an explicit useExperimentalScale: false now selects the classic 5-point scale. judgeMode was threaded into evaluateSinglePoint but never read — scoring is always consensus (mean of successful judges). Remove the dead parameter and mark the config field deprecated, and document that custom judge panels disable the automatic backup judge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
buildCoreData deleted excludedModels from core.json with a comment saying it would be 'recalculated client-side' — but core.json ships null placeholder response matrices, so the client scan (undefined/empty-string check) could never fire and the 'Models Automatically Excluded' alert was silently dead on all new-format runs. Compute excludedModels server-side at save time, while the full response text is still available, using the same missing-or-whitespace rule the client applies to legacy monoliths. Applies to newly saved runs; older core.json artifacts predate the field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
…-N truncation applyPREvalLimits staged large blueprints by slicing the first 10 prompts, so PR review of a several-hundred-prompt blueprint only ever exercised the opening block (e.g. one language of a multilingual suite). Sample deterministically and evenly across the prompt list instead — full-file coverage with the same staging-run hash for identical PR content. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Viewport captures of the public weval.org pages touched by the audit (removed, fixed, and orphaned surfaces), referenced from the PR discussion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
📸 Site tour: every surface this audit touched, as it looks in production todayCaptured 2026-07-16 from the live site. Three groups: what this PR removes, the links it fixes, and the orphaned pages it deliberately leaves alone pending a product decision (issues #56 / #57 have the code-level detail). 🗑 Removed by this PR (live until merge)
|













Summary
Lands the "Tier 1" batch from the July architecture review: six correctness fixes across blueprint ingestion, the LLM-judge config surface, PR staging, and the analysis UI, plus a dead-code sweep (net −4,432 lines) and relocation of shared utils out of the sandbox route.
Motivation / context
A code audit following the architecture discussion with the founding engineer surfaced silent divergences between the platform's five blueprint-ingestion paths, dead configuration knobs that mislead blueprint authors, a broken UI alert, and ~4.8k lines of verified-dead code. Findings are catalogued in #56 and #57.
Changes
src/app/api/webhooks/github-push/route.ts)parseSubmittedBlueprint()insrc/lib/blueprint-ingestion.tsso ingestion behavior is defined onceuseExperimentalScaleis honored (default behavior unchanged: 9-point scale); theFORCE_EXPERIMENTALoverride is gone; the ignoredjudgeModeparameter is removed and the config field documented as deprecated (src/cli/evaluators/llm-coverage-evaluator.ts,src/types/shared.ts)src/lib/pr-eval-limiter.ts)excludedModelsis computed server-side at save time intocore.json, restoring the "Models Automatically Excluded" alert for artifact-format runs (src/lib/storageService.ts); applies to newly saved runs/v2(duplicate homepage prototype),NavBarV2,SearchAutocomplete,pilot/india-multilingual/_archive_v1/, and four danglingpackage.jsonscriptsyaml-generator,json-response-parser(+ tests) tosrc/lib/anduseMobiletosrc/hooks/— the sandbox route no longer owns code used by live surfacesparseSubmittedBlueprint, exclusion-computation cases added to the artefact round-trip suite, sampling tests forsampleEvenlySpaced, and the test asserting first-N truncation updated to the new intended behaviorTest plan
pnpm typecheck✅ 0 errors ·pnpm test:web✅ 564 passed ·pnpm test:cli✅ 570 passed (includes all new tests)pnpm lintnext lintprompts for interactive migration (pre-existing onmain; worth a follow-up ticket)/v2return 404, homepage renders cleanly after the deletionsRisks / rollback
Plain revert undoes everything — no migrations. Reviewer attention:
excludedModelsonly appears in newly saved runs; old core.json artifacts predate the field (alert stays inert for them unless backfilled).Screenshots not committed: the changed routes are data-driven (
/experiments/*), so captures were taken against a secret-free local dev server with mock fixtures and shared with the maintainer directly rather than embedding permanent raw URLs in a public branch.Related Issues
Closes #56
Closes #57
🤖 Generated with Claude Code
https://claude.ai/code/session_017bEpzahprA9rLt1wxxTKgy
Generated by Claude Code