Skip to content

fix(therapies): stop the catalogue generator consuming its own output (#180) and serve aliases by rewrite (#177) - #1886

Merged
BigSimmo merged 20 commits into
mainfrom
claude/therapy-catalogue-alias-rewrite
Aug 13, 2026
Merged

fix(therapies): stop the catalogue generator consuming its own output (#180) and serve aliases by rewrite (#177)#1886
BigSimmo merged 20 commits into
mainfrom
claude/therapy-catalogue-alias-rewrite

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • #180 — the generator consumed its own output. build-therapies-index.mjs read public/therapy-compass-data/therapies.json as its source and also wrote that same path as legacyFullTarget. This was not merely untidy: curatedFull nulls every tag-echo modality (curatedModality), so the first run overwrote the author's raw modality values with the scrubbed ones and every later run re-read the scrubbed copy. It survived only because the scrub happens to be idempotent — the raw input was still destroyed, recoverable from git history alone. The hand-edited catalogue moves to src/data/therapies-source.json, outside the directory this generator writes; public/therapy-compass-data/ is now output only.
  • #177 — the aliases duplicated every payload. therapies.json, therapies-index.json and therapies-home.json were written byte-identical to their content-addressed twin, costing a second copy in the working tree and in every Docker image — 2.81 MB, and 5.34 MB while the one-deploy grace generation is retained. They are now served by next.config.ts rewrites onto the current hashed filename, exactly the remediation the row specified. public/therapy-compass-data/ drops 8.0M → 5.3M.
  • The alias URLs are preserved, not dropped — the row's explicit stop condition. useTherapyData falls back to them when a bundle older than the grace generation names a hashed file that no longer exists, so the URLs must keep working; only the duplicated bytes are gone.
  • Ledger: closes #180 and #177, and corrects three rows that cited the moved paths (docs:check-links caught them). #175 mattered most — it instructed a future reader to curate modality values in public/therapy-compass-data/therapies.json, which no longer exists; it now names src/data/therapies-source.json.

Two notes on judgement calls. The two rows interact in a way neither acknowledges — the therapies.json alias was the generator's source, so #180 could not be fixed without deciding #177's question; fixing #180 alone briefly makes the duplication worse (four copies), which is why both land together. And .prettierignore needed a new entry: at its old path the source was covered by public/therapy-compass-data/, and without one Prettier expands the compact 2.5 MB catalogue to ~17k lines — the churn #179 fixed on the generated side.

Verification

  • npm run verify:pr-local
PR-local verification summary:
- completed: check:runtime, check:installed-lock-parity, format:changed, sitemap:check,
  docs:check-index, docs:check-inventory, docs:check-scripts, docs:check-links,
  check:branch-review-ledger, check:outstanding-issues, lint, typecheck, test, build,
  check:rag:fixtures
- failed: (none)
- not reached: (none)

 Test Files  564 passed (564)
      Tests  6149 passed | 4 skipped (6153)

Behavioural proof, against a running server:

/therapy-compass-data/therapies.json        200  Cache-Control: public, max-age=0, must-revalidate
/therapy-compass-data/therapies-index.json  200  Cache-Control: public, max-age=0, must-revalidate
/therapy-compass-data/therapies-home.json   200  Cache-Control: public, max-age=0, must-revalidate
full alias == hashed asset (byte-identical);  index alias == hashed asset;  home alias == hashed asset
hashed URL: 200  Cache-Control: public, max-age=31536000, immutable
retained grace generation: 200

The alias does not inherit the destination's immutable policy — that was the main risk of serving it by rewrite. The compiled production .next/routes-manifest.json carries all three afterFiles rewrites onto the current hashed assets plus both header rules, so this is not dev-only behaviour.

Also verified: hashed filenames are unchanged by the refactor, proving the direct-write path is byte-identical to the previous copy-a-written-file path; the source stays byte-identical across repeated regenerations; check:therapy-data-index passes and its new stray-alias guard fires (Therapy alias therapies-index.json is a duplicate file, exit 1).

UI verification not run in full: npm run verify:ui was not run. The change is to how a static asset is served, and it was proven directly at the URL level (status, bytes, cache headers) plus 25 therapy loader/data-recovery DOM tests and the mode-wiring contract, which is more targeted evidence for this diff than a browser journey. Flagging it since classifyPullRequestFiles reports ui: true.

Provider access: none. npm run start refuses to boot without real Supabase env, so production serving was confirmed from the compiled routes manifest rather than by pointing a server at the live project.

Risk and rollout

  • Risk: Moderate and contained to Therapy Compass data loading. The failure mode if the rewrite were wrong is a 404 on the alias URLs, which would surface as a catalogue load failure on therapy screens; that path is directly covered by the URL-level proof above and by therapy-compass-data-recovery.dom.test.tsx. Rewrite destinations are baked into the routes manifest at build time from generated-assets.ts, so a catalogue regeneration must be accompanied by a build — which deploy always does.
  • Rollback: git revert each commit independently; they share no file except the ledger. Reverting only the #177 commit restores the alias files and the duplicated bytes; reverting only the #180 commit restores the old source path.
  • Provider or production effects: None. No Supabase, OpenAI, Railway or hosted CI access. No schema, migration, RLS, auth or privacy surface is touched, and no clinical content changed — the catalogue payload bytes are identical before and after.

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Every item holds trivially: this changes where catalogue bytes are stored and how a static URL resolves, not what the catalogue says. The served payloads are byte-identical before and after, verified by cmp on all three assets and by unchanged content hashes.

Notes

  • RAG impact: line omitted deliberately — classifyPullRequestFiles reports ragRanking: false, and no retrieval, ranking, selection or scoring surface is touched.
  • #175 (therapy modality curation) remains open and is now correctly pointed at src/data/therapies-source.json. That row is the clinical follow-up: 205/205 records still carry no curated modality, and deciding between curating values and dropping the field needs the psychiatrist.

Generated by Claude Code

Summary by CodeRabbit

  • Improvements

    • Therapy catalogue assets now use content-addressed files with stable aliases served through cache-controlled routing.
    • Runtime deployments reliably include generated therapy catalogue assets.
    • Catalogue generation now uses the maintained source catalogue and validates canonical output, stale assets, and duplicate aliases.
  • Documentation

    • Recorded known therapy catalogue modality and mobile performance considerations.
    • Improved validation of outstanding-issue documentation updates.
  • Tests

    • Added coverage for runtime asset inclusion and alias rewrite configuration.

claude added 3 commits August 12, 2026 20:43
build-therapies-index.mjs read public/therapy-compass-data/therapies.json as
its source and also wrote that same path as legacyFullTarget. Source and target
were one file, so every run consumed its own output.

That was not merely untidy. curatedFull nulls every tag-echo modality
(curatedModality), so the first run overwrote the author's raw modality values
with the scrubbed ones, and every later run re-read the scrubbed copy. It
survived only because the scrub happens to be idempotent — the raw input was
still destroyed, recoverable from git history alone.

Move the hand-edited catalogue to src/data/therapies-source.json, outside the
directory this generator writes, and read only from there. The file in
public/therapy-compass-data/ is now output, never input.

Also add the new path to .prettierignore. At its old path it was covered by the
public/therapy-compass-data/ entry; without an entry Prettier pretty-prints the
compact single-line catalogue into ~17k lines, which is the churn #179 fixed on
the generated side.

Verified: regenerated output is byte-identical to the previous alias (hashed
filenames unchanged), the source stays byte-identical to its original across
two further re-runs, check:therapy-data-index passes, and the 28 therapy
contract tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STG6AU5J4gxrFJagP4pRti
…ating bytes

public/therapy-compass-data/ shipped each catalogue twice: therapies.json,
therapies-index.json and therapies-home.json were written byte-identical to
their content-addressed twin. Git stores one blob per identical pair, so history
was unaffected, but the working tree and every Docker image carried both — 2.81
MB, and 5.34 MB while the one-deploy grace generation is retained.

The alias URLs themselves are load-bearing: useTherapyData falls back to them
when a bundle older than the grace generation names a hashed file that no longer
exists, so they cannot simply be dropped. Serve them from next.config.ts
rewrites onto the current hashed filename instead, and stop writing the files.

afterFiles rather than beforeFiles: no file exists at the alias paths now, so
the rewrite is reached once the static handler finds nothing, and nothing
legitimate is shadowed. build-therapies-index.mjs --check now fails if an alias
file reappears, since a real file would win over an afterFiles rewrite and then
go stale at the next regeneration.

The generator writes content-addressed assets directly from the generated bytes
rather than copying a just-written alias, so projectionBytes/fullCatalogueBytes
are now the single definition of each payload's exact bytes.

Verified against a running server: all three alias URLs return 200 with content
byte-identical to their hashed asset; aliases keep Cache-Control max-age=0,
must-revalidate while the hashed asset keeps max-age=31536000, immutable, so the
alias does not inherit the destination's immutable policy; the retained grace
generation still returns 200. Hashed filenames are unchanged by this refactor,
proving the direct-write path is byte-identical. public/therapy-compass-data/
drops from 8.0M to 5.3M. npm run build succeeds and the stray-alias guard fires.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STG6AU5J4gxrFJagP4pRti
Both rows are resolved by the two preceding commits. Also corrects three rows
that cited the catalogue paths this work moved — docs:check-links caught them.

#175 mattered most: it instructed a future reader to curate modality values in
public/therapy-compass-data/therapies.json, which no longer exists. It now names
src/data/therapies-source.json, the only hand-edited catalogue file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STG6AU5J4gxrFJagP4pRti
@supabase

supabase Bot commented Aug 12, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b1883426-a614-4f05-a654-5767f0c60794

📥 Commits

Reviewing files that changed from the base of the PR and between 9e711f1 and e24eacf.

📒 Files selected for processing (5)
  • docs/outstanding-issues-inbox/02278dd9-cc4d-4114-8d5e-84414910b886.json
  • docs/outstanding-issues-inbox/3f38592b-8346-48dc-87d9-acc585ffe5b8.json
  • docs/outstanding-issues-inbox/7336de95-160e-4255-b2c0-abcfd7f4e093.json
  • docs/outstanding-issues-inbox/976c4c7a-5c74-47e3-975b-046718c54859.json
  • scripts/check-docs-links.mjs

📝 Walkthrough

Walkthrough

The PR moves the therapy catalogue source outside generated output, creates content-addressed assets, routes stable aliases through Next.js rewrites, packages generated mappings in Docker, and validates projected documentation ledger content.

Changes

Therapy catalogue asset pipeline

Layer / File(s) Summary
Catalogue generation and validation
.prettierignore, scripts/build-therapies-index.mjs
The generator reads src/data/therapies-source.json, centralizes serialization, writes hashed assets, removes physical aliases, and validates canonical bytes and stale alias files.
Stable alias rewrites
next.config.ts
Stable full, index, and home catalogue paths rewrite to generated content-addressed assets with cache-controlled headers.
Runtime packaging and wiring validation
Dockerfile, tests/railway-config.test.ts, tests/therapy-compass-mode-wiring.test.ts
The runtime image copies generated asset mappings. Tests verify Docker packaging and rewrite-based alias routing.

Documentation ledger projection

Layer / File(s) Summary
Projected ledger validation
scripts/check-docs-links.mjs, docs/outstanding-issues-inbox/*
The link checker validates and applies sorted inbox requests before scanning projected outstanding-issue content. The inbox records document catalogue findings and completed issue resolutions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: ⚪ Minimal · up to e24ea

The change separates catalogue source data from generated output and serves legacy aliases through rewrites while preserving URLs and payload bytes. Normal checks and targeted asset verification pass, so no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant NextConfig
  participant HashedAssets
  Client->>NextConfig: request therapies.json alias
  NextConfig->>HashedAssets: rewrite to generated hashed asset
  HashedAssets-->>Client: return catalogue response
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies both primary changes: separating the catalogue source from generated output and serving aliases through rewrites.
Description check ✅ Passed The description follows the template, documents scope and risks, records verification results, and explains why full UI verification was not run.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/therapy-catalogue-alias-rewrite

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STG6AU5J4gxrFJagP4pRti

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4935d26a30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread next.config.ts
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch claude/therapy-catalogue-alias-rewrite at starting commit 31c8d0d; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:claude/therapy-catalogue-alias-rewrite, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 31c8d0ddd7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BigSimmo
BigSimmo enabled auto-merge August 12, 2026 21:22
@BigSimmo
BigSimmo disabled auto-merge August 12, 2026 21:25

Copy link
Copy Markdown
Owner Author

Addressed the review finding on the current head 50ce160bb57731c5baf983101b3e0f96943d2347: the app runner now copies src/components/therapy-compass/data/generated-assets.ts, and tests/railway-config.test.ts asserts that dependency is shipped with the other next.config.ts imports.

Copy link
Copy Markdown
Owner Author

@claude Work only the current unresolved P1 review finding on this PR at head 6e3e1ddd1c791c053b9c6d56706ea48b2850fc08. Verify that next.config.ts now imports src/components/therapy-compass/data/generated-assets.ts and that the production Docker/Railway runner does not copy that module, causing config load to fail with MODULE_NOT_FOUND. If valid, minimally update the runner copy contract so every local module imported by next.config.ts is present at runtime, add/adjust a focused contract test covering this local config import, run the narrowest format/type/test/build checks needed, push to this PR branch, reply with pushed SHA and verification, and resolve the satisfied thread. Do not merge, close, rebase, force-push, deploy, alter auto-merge, or broaden scope.

@claude

claude Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @BigSimmo — thanks for the @claude mention.

Open this in Claude Code on the web to continue here: https://claude.ai/code

Context: BigSimmo/Database · #1886

Automated backlink from the Claude backlink workflow. Claude Code can pick up the mention and push a scoped fix to the branch.

Copy link
Copy Markdown
Owner Author

@claude The P1 Docker/Next-config fix is already verified on head 50ce160bb57731c5baf983101b3e0f96943d2347 and its review thread is resolved, but the PR is now mergeable_state: dirty against current main. Fetch current main and merge it into this PR branch without rebasing or force-pushing. Resolve only merge conflicts, preserving the generated-assets runner-copy fix and all newer main changes. Run conflict-adjacent format/typecheck plus the focused therapy-data/config runner contracts, push the merge-resolution commit, and report the pushed SHA and verification. Do not merge or close the PR, deploy, alter auto-merge, or broaden scope.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @BigSimmo — thanks for the @claude mention.

Open this in Claude Code on the web to continue here: https://claude.ai/code

Context: BigSimmo/Database · #1886

Automated backlink from the Claude backlink workflow. Claude Code can pick up the mention and push a scoped fix to the branch.

@claude

claude Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@BigSimmo
BigSimmo enabled auto-merge August 12, 2026 21:42
@BigSimmo
BigSimmo disabled auto-merge August 12, 2026 21:50
@BigSimmo
BigSimmo enabled auto-merge August 12, 2026 21:54
@BigSimmo
BigSimmo disabled auto-merge August 12, 2026 22:05
@BigSimmo
BigSimmo enabled auto-merge August 12, 2026 22:07
@BigSimmo
BigSimmo disabled auto-merge August 12, 2026 22:49
@BigSimmo
BigSimmo enabled auto-merge (squash) August 12, 2026 23:07
@BigSimmo
BigSimmo disabled auto-merge August 12, 2026 23:17
@BigSimmo
BigSimmo enabled auto-merge August 12, 2026 23:37
@BigSimmo
BigSimmo disabled auto-merge August 13, 2026 01:07
@BigSimmo
BigSimmo enabled auto-merge August 13, 2026 01:37
@BigSimmo
BigSimmo disabled auto-merge August 13, 2026 01:59
@BigSimmo
BigSimmo enabled auto-merge (squash) August 13, 2026 02:07

Copy link
Copy Markdown
Owner Author

@claude Please main-sync this PR from exact head 50ce160bb57731c5baf983101b3e0f96943d2347: merge the latest main once (never rebase), resolve all conflicts minimally, commit and push. Do not merge/close the PR, force-push, alter auto-merge, or touch unrelated files.

Preserve the Therapy catalogue alias rewrite and its generated-asset contract. Retain the already-resolved production runner fix: every local module imported by next.config.ts, including the generated Therapy asset module, must be copied into the Docker runner, and tests/railway-config.test.ts must continue pinning that closure. For docs/branch-review-ledger.md and docs/outstanding-issues.md, current main is authoritative; do not rewrite history or revive stale work. Preserve newer main Therapy catalogue/navigation/alias changes when resolving source and generated files, then regenerate only from the canonical source/build script.

Run the Therapy index build/drift checks, focused mode-wiring and railway-config tests, typecheck, production build or the smallest deployment boot/config gate, and format. Report the new head and exact outcomes.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @BigSimmo — thanks for the @claude mention.

Open this in Claude Code on the web to continue here: https://claude.ai/code

Context: BigSimmo/Database · #1886

Automated backlink from the Claude backlink workflow. Claude Code can pick up the mention and push a scoped fix to the branch.

@claude

claude Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

Copy link
Copy Markdown
Owner Author

@copilot Merge main at 0709965e66e04173ec0b0de1d121e85ac1ff7e04 into current head 50ce160bb57731c5baf983101b3e0f96943d2347, resolve conflicts minimally, and push the merge commit to claude/therapy-catalogue-alias-rewrite. Never rebase or force-push. Do not merge/close the PR, deploy, alter auto-merge, or touch unrelated files.

Preserve the Therapy catalogue canonical-source move, generated-asset drift contract and alias rewrites. Retain the resolved production-runner requirement: every local next.config.ts import, including generated Therapy assets, must be copied into the Docker runner and pinned by tests/railway-config.test.ts. Current main is authoritative for ledgers/issues and all newer Therapy source/catalogue/navigation changes; regenerate outputs only from the canonical source/build script and do not hand-edit generated assets.

Run Therapy index build/drift checks, focused mode-wiring and railway-config tests, ledger/issues integrity/write-discipline, typecheck, production build or smallest deployment boot/config gate, and format. Report the pushed 40-character SHA and exact outcomes.

Preserve the canonical Therapy source move, rewrite-served aliases, Docker runner closure and focused regressions while retaining current-main ledgers and issue history.
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Static PR checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #10417 (cancelled).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex is this PR safe and is it deleting any valuable code?

@BigSimmo
BigSimmo merged commit b189fb5 into main Aug 13, 2026
26 checks passed
@BigSimmo
BigSimmo deleted the claude/therapy-catalogue-alias-rewrite branch August 13, 2026 07:17
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: e0f2e604ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

Codex review-and-fix final summary

  • Final state: PR fix(therapies): stop the catalogue generator consuming its own output (#180) and serve aliases by rewrite (#177) #1886 was externally auto-merged after the final required checks passed. Final reviewed head: e0f2e604efa94eeece93a818bdb654fd44fa3dda. Final base before merge: 36a06476e65e5d9a8acb670988bd898beb2ad55d. Merge commit: b189fb57d326d7a05770c0e4be8b0a4b1abfadf6.
  • Sync decision / merge-tree: one late merge of current main was performed because main moved independently after the first repaired head had gone green and GitHub then reported the PR as behind. The base delta touched only the document-source redirect/proxy files and did not overlap this PR. After the sync, the PR was 20 commits ahead / 0 behind with the merge-base exactly at the latest base. No rebase, force-push, history rewrite, deployment, release, or auto-merge change was performed.
  • Confirmed defect fixed: the prior docs-link repair had edited docs/outstanding-issues.md directly, which violated the repository's newer immutable-inbox ledger discipline and caused Static PR checks to fail. Commit e24eacfd6f1e19d0729d8cec3de31883c0887a2e restored the canonical ledger to the base version, queued immutable updates/closures for Codify live retrieval RPCs, reclaim dead vector indexes, unify schema health #117, Harden auth and ingestion privacy/reliability paths #175, Fix repo-wide prettier format:check drift on main #177 and ci: enforce prettier format:check + stop tracking hook cache #180, and made docs:check-links validate the deterministic projected ledger produced from pending inbox requests. This preserves both the docs-link contract and the conflict-free ledger contract.
  • Other review findings: the existing P1 Docker/runtime-config issue was independently checked and is already fixed: the runner includes the generated therapy asset mapping and its focused contract test. No additional high-confidence defect was found in the therapy source move, alias rewrites, generator canonical-byte checks, Docker packaging, cache semantics, or focused wiring tests.
  • Out of scope / intentionally still open: Codify live retrieval RPCs, reclaim dead vector indexes, unify schema health #117 remains a Therapy Compass mobile-LCP performance recommendation. Harden auth and ingestion privacy/reliability paths #175 remains the separate clinical decision about curating modality values versus removing the field. This PR only corrects their ledger references. Fix repo-wide prettier format:check drift on main #177 and ci: enforce prettier format:check + stop tracking hook cache #180 have immutable done requests queued for normal post-merge reconciliation.
  • Independent adversarial review: I performed a distinct manual adversarial pass across correctness, regressions, compatibility, runtime packaging, cache behaviour, generated-asset contracts, and ledger interactions. CodeRabbit's latest completed incremental review of the repair generated no actionable comments. Its separate ESLint-install warning was a bot-tooling limitation, not a repository failure; the repository's exact-head lint and typecheck passed.
  • Review threads: 0 unresolved actionable threads. The one prior P1 thread on next.config.ts is resolved.
  • Verification limitation: I could not claim a local exact-checkout test run because this execution environment had no usable repository checkout and its container could not resolve GitHub for a fresh clone. I therefore used exact-head GitHub Actions as the decisive execution proof rather than fabricating local results.
  • Exact-head required CI on e0f2e604…: CI ✅, Secret Scan ✅, SAST ✅, and the PR required aggregate ✅. Within CI: Static PR checks ✅ including ledger integrity/write discipline, docs scripts/links, format, lint, typecheck, therapy-data drift and design-system guards; Build ✅; Safety/config ✅; Unit coverage ✅; Production UI critical ✅; Production UI shards 1/2/3 ✅; Container build-and-verify ✅ including provider-free app smoke, network-isolated worker validation and HIGH/CRITICAL vulnerability scan.
  • Advisory/scoped checks: Lighthouse budget ✅. Advisory UI, visual baselines, migration replay, release-browser-matrix, and other scope-inapplicable jobs were skipped rather than treated as green required checks.
  • Ledger status: the outstanding-issue ledger changes are correctly represented through immutable inbox requests and all ledger discipline/integrity gates passed. I did not append a new branch-review record because the repository requires ledger:append from a real checkout, this environment could not run that workflow, and adding a ledger-only/self-referential tip would violate the review protocol. The PR is now merged, so no further branch edits are appropriate.
  • Residual risk: no confirmed code or CI blocker remains. The remaining process follow-up is normal post-merge reconciliation of the queued issue requests, plus the separate open work in Codify live retrieval RPCs, reclaim dead vector indexes, unify schema health #117 and Harden auth and ingestion privacy/reliability paths #175.
  • Monitoring: the active run monitored the PR through the initial failure, focused repair, first green run, independent base movement, the one authorised base sync, the restarted exact-head CI, and external merge. The external-merge stop condition is now met.

I did not merge or close the PR. GitHub's pre-existing auto-merge was left untouched and merged the PR externally after the final exact-head required checks passed.

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