Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/gates/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Check these before believing any result.
for exactly this reason — if installed packages do not match `package-lock.json`, treat any test,
lint, or typecheck result as void until `npm ci` has run. Its own failure message says as much.
- **`verify:cheap` stops at the first failing check.** Everything after that point never ran. Do not
describe the change as broadly verified when the gate died at check 2 of 31.
describe the change as broadly verified when the gate died at check 2 of 32.
- **`format:check` is required in CI but is not part of `verify:cheap`.** A locally green
`verify:cheap` can still fail CI on formatting. Run `npx prettier --write <changed files>` before
pushing — scoped to your files, never `prettier --write .`, which sweeps the whole tree.
Expand Down
112 changes: 112 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#!/bin/sh
# Keep generated documentation synchronized before relevant commits. The hook
# writes generated outputs but never stages them: if anything changes, the
# commit stops so the author can review and stage the exact diff.
set -eu

if [ "${SKIP_DOCS_SYNC_HOOK:-}" = "1" ]; then
exit 0
fi

staged_files=$(git diff --cached --name-only --diff-filter=ACMRD)
working_files=$(
{
git diff --name-only --diff-filter=ACMRD
git ls-files --others --exclude-standard
} | sort -u
)

matches_staged() {
printf '%s\n' "$staged_files" | grep -Eq "$1"
}

sync_sitemap=0
sync_inventory=0
check_module_map=0

if matches_staged '^(src/app/|mockups/|src/lib/(app-modes|document-flow-routes|differentials|dsm|formulation|forms|services|specifiers|therapies)\.ts$|scripts/generate-site-map\.ts$|docs/site-map\.md$)'; then
sync_sitemap=1
fi
if matches_staged '^(scripts/|package\.json$|docs/scripts-index\.md$)'; then
sync_inventory=1
fi
if matches_staged '^(src/app/|src/lib/|supabase/schema\.sql$|docs/codebase-index\.md$)'; then
check_module_map=1
fi
if [ "$sync_sitemap" = "0" ] && [ "$sync_inventory" = "0" ] && [ "$check_module_map" = "0" ]; then
exit 0
fi

# Generators read the working tree. Refuse to combine staged inputs with other
# unstaged inputs that could make the generated docs describe the wrong commit.
mixed_inputs=""
if [ "$sync_sitemap" = "1" ]; then
mixed_inputs=$(printf '%s\n' "$working_files" | grep -E '^(src/app/|mockups/|src/lib/(app-modes|document-flow-routes|differentials|dsm|formulation|forms|services|specifiers|therapies)\.ts$|scripts/generate-site-map\.ts$)' || true)
fi
if [ "$sync_inventory" = "1" ]; then
inventory_inputs=$(printf '%s\n' "$working_files" | grep -E '^(scripts/|package\.json$)' || true)
mixed_inputs=$(printf '%s\n%s\n' "$mixed_inputs" "$inventory_inputs" | sed '/^$/d' | sort -u)
fi
if [ "$check_module_map" = "1" ]; then
module_inputs=$(printf '%s\n' "$working_files" | grep -E '^(src/app/|src/lib/|supabase/schema\.sql$)' || true)
mixed_inputs=$(printf '%s\n%s\n' "$mixed_inputs" "$module_inputs" | sed '/^$/d' | sort -u)
fi
if [ -n "$mixed_inputs" ]; then
echo "[pre-commit] Documentation inputs have unstaged or untracked changes:" >&2
printf '%s\n' "$mixed_inputs" >&2
echo "[pre-commit] Stage or separate these inputs before regenerating commit documentation." >&2
exit 1
fi

docs_to_check=""
if [ "$sync_sitemap" = "1" ]; then
docs_to_check="$docs_to_check docs/site-map.md"
fi
if [ "$sync_inventory" = "1" ]; then
docs_to_check="$docs_to_check docs/scripts-index.md"
fi
if [ "$check_module_map" = "1" ]; then
docs_to_check="$docs_to_check docs/codebase-index.md"
fi

# Generators rewrite whole files. Refuse before running them when a selected
# output has an unstaged edit, otherwise regeneration can erase local work and
# leave the hook looking clean afterward.
dirty_generated_docs=$(git diff --name-only -- $docs_to_check)
if [ -n "$dirty_generated_docs" ]; then
echo "[pre-commit] Generated documentation has unstaged changes:" >&2
printf '%s\n' "$dirty_generated_docs" >&2
echo "[pre-commit] Stage or separate these outputs before regeneration." >&2
exit 1
fi

if ! command -v npm >/dev/null 2>&1; then
echo "[pre-commit] npm is required for documentation synchronization." >&2
echo "[pre-commit] Install the repository toolchain, or bypass once with SKIP_DOCS_SYNC_HOOK=1." >&2
exit 1
fi

repo_root=$(git rev-parse --show-toplevel)
cd "$repo_root"

echo "[pre-commit] Synchronizing generated documentation..."
if [ "$sync_sitemap" = "1" ]; then
npm run sitemap:update
Comment thread
BigSimmo marked this conversation as resolved.
fi
if [ "$sync_inventory" = "1" ]; then
node scripts/update-docs-inventory.mjs
npm run docs:check-inventory
fi
if [ "$check_module_map" = "1" ]; then
npm run docs:check-index
fi

unstaged_docs=$(git diff --name-only -- $docs_to_check)
if [ -n "$unstaged_docs" ]; then
echo "[pre-commit] Documentation changed or remains unstaged:" >&2
printf '%s\n' "$unstaged_docs" >&2
echo "[pre-commit] Review and stage these files, then commit again." >&2
exit 1
fi

echo "[pre-commit] Documentation is synchronized."
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ jobs:
- name: Codebase index coverage
run: npm run docs:check-index

- name: Documentation inventory drift
run: npm run docs:check-inventory

- name: Check docs scripts
run: npm run docs:check-scripts
- name: Check docs links
Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ action must perform one; a page that ships must be reachable.
(`src/lib/app-modes.ts`, `src/lib/tools-catalog.ts`, `src/lib/universal-search.ts`), not
hardcoded strings scattered across components.
- **New-route checklist.** Add the page → link it from real nav (sidebar / launcher / mode home /
search) → `npm run sitemap:update` → document it in `docs/codebase-index.md` → add a
search) → `npm run docs:update` → document it in `docs/codebase-index.md` → add a
reachability/coverage assertion. A production page route with no inbound link is an orphan.
The committed pre-commit hook runs this synchronization for relevant staged changes and stops
when generated docs need review/staging; it never stages files automatically.
- **Gates.** `eslint-rules/require-button-wiring.mjs` (in `npm run lint`) fails on an un-wired
`<button>`; `tests/route-reachability.test.ts` (in `npm run test`) fails when a production page
route has no inbound nav link unless it is consciously added to that test's documented
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Verification pyramid — run the **smallest gate that covers the change**, then
| Gate | What it is |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `npm run test:focused -- --files <paths>` | Source-only iteration. Fails closed for deleted files and test infrastructure — then run `npm run test`. |
| `npm run verify:cheap` | The broad local gate: 28 static/consistency gates + `lint` + `typecheck` + full offline unit suite |
| `npm run verify:cheap` | The broad local gate: 29 static/consistency gates + `lint` + `typecheck` + full offline unit suite |
| `npm run verify:pr-local` | Closest local mirror of the PR gate; adds format and conditional build / client-bundle scan / RAG fixture validation. `-- --dry-run --files <paths>` shows selection without running. |
| `npm run verify:ui` | Chromium production journeys. Run `npm run ensure` first. |
| `npm run verify:phone-chrome` | Phone-chrome changes; selects affected owners/journeys before escalating to `verify:ui` |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Full categorized index: `docs/README.md` (maintained docs vs point-in-time
records vs archive). The most load-bearing entries:

- `docs/codebase-index.md` — architecture and module map (start here)
- `docs/site-map.md` — generated route map (`npm run sitemap:update`)
- `docs/site-map.md` — generated route map (`npm run docs:update`)
- `docs/process-hardening.md` — verification gates, CI expectations, known limits
- `docs/testing.md` — local test safety, focused/live commands, Playwright ownership, flake policy
- `docs/codex-cloud.md` — reproducible provider-free Codex Cloud setup and acceptance check
Expand Down
14 changes: 7 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ npm run docs:check-links

## Start here

| Doc | What it is |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [codebase-index.md](codebase-index.md) | Structured architecture map: layout, module map, Supabase schema, scripts, domain concepts |
| [site-map.md](site-map.md) | **Generated** route map — regenerate with `npm run sitemap:update`, verify with `npm run sitemap:check` |
| [agents-guide.md](agents-guide.md) | Human onboarding pointer; authoritative agent rules live in the root `AGENTS.md` |
| [scripts-index.md](scripts-index.md) | Curated map of `scripts/` and the `package.json` command surface by purpose |
| [codex-cloud.md](codex-cloud.md) | Codex Cloud setup, access profiles, platform settings, and acceptance checks |
| Doc | What it is |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [codebase-index.md](codebase-index.md) | Structured architecture map: layout, module map, Supabase schema, scripts, domain concepts |
| [site-map.md](site-map.md) | **Generated** route map — regenerate with `npm run docs:update`, verify with `npm run sitemap:check` |
| [agents-guide.md](agents-guide.md) | Human onboarding pointer; authoritative agent rules live in the root `AGENTS.md` |
| [scripts-index.md](scripts-index.md) | Curated map of `scripts/` and the `package.json` command surface by purpose |
| [codex-cloud.md](codex-cloud.md) | Codex Cloud setup, access profiles, platform settings, and acceptance checks |

## Architecture

Expand Down
9 changes: 7 additions & 2 deletions docs/branch-review-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,17 @@ Records before 2026-07-28 were written by hand and had drifted: 146 lines carrie
| 2026-07-30 | claude/outstanding-issues-triage-24c8ow | 8d2710fd6cbdc84e8c50a6c9bc0a1e1a0cd612c8 | open PR changed-scope review | APPROVE: completed items 095, 096, 104, 109, and 115 move to archive with no deletion, duplicate ID, or stale next-id. | check:outstanding-issues PASS; check:branch-review-ledger PASS; diff review; no unresolved threads |
| 2026-07-30 | claude/latency-findings-impl-s8g01v | e7ff5e933ba1f34d5adbd46dd77c38aced11ed44 | open PR changed-scope review | APPROVE: ordering-risk documentation is accurate and the near-bottom refusal guard now proves its geometry is non-vacuous before asserting no hide. | diff check PASS; focused test review; no unresolved threads; exact-head Production UI required |
| 2026-07-30 | claude/ci-testing-review-2l8klp | 2e2160bc8b9d2d824209c217c67cb9cac1be3a8d | open PR changed-scope review | APPROVE: three-way UI sharding, critical-first gating, measured drag travel, and gate-manifest updates preserve required-check aggregation and deterministic Playwright settings. | check:github-actions PASS; check:ci-scope PASS; check:gate-manifest PASS; ledger guards PASS; exact-head sharded Production UI required |
| 2026-07-30 | codex/docs-sync-automation | 76d7372d8aa886008e2fb637e5911e9c00bb33e3 | documentation synchronization automation review | APPROVE after deletion-path fix; no remaining P0-P2 findings | docs/update and static gates pass; focused Vitest admission blocked |
| 2026-07-30 | PR #1430 | a9ae22ac4915e86d51ee05787059382a39bd8ba8 | phone chrome diagnostics and merge repair | fixed and ready for CI | issues guard; ledger guard; 37 focused tests; phone-chrome dry-run |
| 2026-07-30 | PR-1434 | f6bebf2a8c658df8b3840c1b1133be5c94a977b0 | PR #1434 Codex Cloud setup consolidation and prompt perfector | fixed Cloud runtime verification gaps and reconciled duplicate implementation after #1438; no remaining findings | check:codex-cloud pass; codex-cloud-setup Vitest 4/4; outstanding-issues and ledger guards pass |
| 2026-07-30 | PR-1442 | 35fc11a2665ecd0464a23949babbbddba8055dcd | PR #1442 documentation synchronization automation | hook is fail-closed for mixed staged inputs and does not auto-stage; generated inventories remain deterministic; no findings | docs update/checks pass; focused Vitest 4 passed; issue and ledger guards pass |
| 2026-07-30 | PR-1440 | f7260cc6a0da87cb4df1ac95ef962967e667c3f0 | PR #1440 issue #102 ordering correction | accurately restores the two canary-gated retrieval ordering constraints; no findings | outstanding-issues and ledger guards pass; documentation-only diff |
| 2026-07-30 | PR-1445 | 07933e08cff6c7d81345e02c03727032ccf522b6 | PR #1445 close duplicate issue | correctly archives duplicate #140 while preserving #133 as the surviving open conflict-frequency record; no findings | outstanding-issues and docs-link guards pass; docs-only diff |
| 2026-07-30 | PR-1434 | f6bebf2a8c658df8b3840c1b1133be5c94a977b0 | PR #1434 Codex Cloud setup consolidation and prompt perfector | fixed Cloud runtime verification gaps and reconciled duplicate implementation after #1438; no remaining findings | check:codex-cloud pass; codex-cloud-setup Vitest 4/4; outstanding-issues and ledger guards pass |
| 2026-07-30 | PR #1432 | a2b53c815b3c060dec2619af2855a63f9f496858 | Playwright browser preflight review and repair | fixed; focused tests pending coordinator | Prettier PASS; issues guard PASS; focused Vitest blocked by active Playwright lease |
| 2026-07-30 | PR #1432 | f85995ade3a19513a531713724813adc742c360d | Playwright browser preflight verification | focused tests pass; typecheck lease-blocked | 16 focused tests PASS; Prettier PASS; typecheck admission blocked |
| 2026-07-30 | PR-1432 | 7c7b63cf40d59652954e539ce1b3027005916bf1 | PR #1432 Playwright browser preflight final exact-head review | fixed existing project-isolation contract after preflight refactor; no remaining findings | preflight and isolation Vitest 9/9; typecheck pass; Prettier and diff checks pass |
| 2026-07-30 | PR-1432 | a5d234302b57be6f7ce5d1957c9ec00bc7f191f0 | PR #1432 Playwright preflight and phone-scroll reliability | cross-platform preflight fails closed and production focus-restore race is removed from the phone-scroll proof; no remaining findings | preflight tests 9 passed; focused Chromium journey 2 passed; formatting and ledger guards pass |
| 2026-07-30 | PR-1432 | 330086eff76f704ce6b9cf5405aeecfdd375027c | PR #1432 visual-config preflight follow-up | visual runs now preflight chromium-artifacts instead of the unrelated main browser matrix; unknown configs fail closed | config-selection tests added; formatting passes; exact-head CI pending |
| 2026-07-30 | PR-1445 | 07933e08cff6c7d81345e02c03727032ccf522b6 | PR #1445 close duplicate issue | correctly archives duplicate #140 while preserving #133 as the surviving open conflict-frequency record; no findings | outstanding-issues and docs-link guards pass; docs-only diff |
| 2026-07-30 | claude/organize-local-worktree-d22bc3 | 2f26a53b5aeb3df451cf7b1d04f80b07edf0d6fe | docs organisation: dated-record filing, docs index gaps, orientation maps | PR #1436 opened — 5 dated docs filed into docs/audit and docs/archive, root codex-cloud-review moved under docs/prompts, 17 docs README index gaps closed, root data/ documented in CLAUDE.md + codebase-index; no product code, schema or RAG surface touched | docs:check-links 1368 refs pass; docs:check-scripts 378 pass; docs:check-index OK; format:check whole-tree clean; verify:cheap 26 static gates + lint + typecheck pass, unit 4562 pass / 1 pre-existing Windows path-separator failure in tests/repo-hygiene.test.ts |
| 2026-07-30 | PR-1436 | 9d8e081f3e7003d4f2210b00a7b7e54bf7ca2f0b | PR #1436 documentation organization and link repair | fixed stale no-driver wording and renumbered three union-collided issue records; no remaining findings | docs index, links, scripts, outstanding-issues, and ledger guards pass |
| 2026-07-30 | cursor/ci-hygiene-gates-1bf5 | b660dbc5a10d7ca3da03541028017f0abc6b5bd3 | ci-hygiene-gates-merge-readiness | NOT READY: cancel-to-green behavior still allowed required PR CI to pass incorrectly; fixed at subsequent head 8f3283d00da274dee507a1b8e9b611321d1f35be | check:ci-scope; check:gitleaks-pinned; scope-classify PR files ui_changed=false; cancelled-as-neutral simulation exposed #095 |
Expand All @@ -200,4 +202,7 @@ Records before 2026-07-28 were written by hand and had drifted: 146 lines carrie
| 2026-07-30 | codex/issue-ledger-upload-parity | f35a4ca178724ff59e7a876c4d819bed0b786662 | PR #1441 final current-main sync | approved after merging #1457 without overlap; upload parity and repository guards remain green | upload self-test pass; issues 141; ledger 141+1206; actions pin, format, diff pass |
| 2026-07-30 | codex/issue-ledger-upload-parity | dc8068590d5be469ff30789b8b345896a3f1cdb9 | PR #1441 sync after PR #1470 | approved; catalogue payload disposition and upload-limit closures both preserved | upload self-test, issues, ledger, diff pass |
| 2026-07-30 | codex/cloud-readiness-consolidation-20260730 | 8ff0a7ec309c80379bd8a9a76ab107a65ac7b837 | PR #1434 Codex Cloud setup and isolation tooling | approved after current-main sync, helper typing repair, static Cloud contracts, and isolation review | codex-cloud, skills, docs, maintainability, issues, ledger, format, isolation 14/14 pass; focused Vitest coordinator-blocked; shell runtime acceptance deferred to hosted Linux |
| 2026-07-30 | codex/docs-sync-automation | fba8ab4af465c96b8aa318f25d792fefd10e9ada | PR #1442 documentation synchronization automation | approved after current-main conflict resolution, generated inventory refresh, and dirty-output preservation review | docs inventory 194/209; focused 5/5; index, links 1417, scripts 405, issues, ledger, format, diff pass; pre-commit executed successfully |
| 2026-07-30 | codex/docs-sync-automation | 1c80a938f27af80df323fb1d6063ef9077f55fdf | PR #1442 hosted gate-count follow-up | approved after static CI exposed and corrected verify:cheap count drift | gate manifest, docs inventory, format, diff pass |
| 2026-07-30 | claude/latency-findings-impl-s8g01v | fd3753b4c8cc041889c39f74a0f763edc358c183 | PR #1459 final docs issue review | PASS - no P0-P2 findings; restores open issue 105 and records deletion-guard gap | outstanding-issues, ledger guard, docs links, diff-check |
| 2026-07-30 | codex/docs-sync-automation | e1c514f289a864bc741841accae5352a419fbb59 | PR #1442 sync after PR #1459 | approved; issue-evidence correction and docs automation closures preserved | issues, ledger, inventory, gate manifest, diff pass |
Loading
Loading