Skip to content

Keep the project notes current, check in the schema and delete dead sample data (app review batch 6b) - #33

Merged
EmotiveImpact merged 6 commits into
mainfrom
claude/app-review-tidy
Oct 12, 2026
Merged

EmotiveImpact merged 6 commits into
mainfrom
claude/app-review-tidy

Conversation

@EmotiveImpact

Copy link
Copy Markdown
Owner

Before: CLAUDE.md and AGENTS.md, which every coding session reads first, listed folders that no longer exist (apps/mobile, apps/landing*), said nothing about tests or CI, and repeated each other. HANDOFF.md had old ports, test counts and migration status, the Supabase-era documents read as current, and .claude/launch.json started servers that are gone. The current version of a database function could only be read from a database, because later migrations patch earlier ones by find-and-replace. Sample data nothing shows, including a sample note with a password-like Wi-Fi string, sat in the app's source, two TypeScript checks were off, and every web test file set up a browser environment, needed or not.

After: CLAUDE.md is true today (folders, stack, migrations, ports, install, tests and CI) and keeps its rules and voice; AGENTS.md points to it. Documents about the earlier app say so at the top, HANDOFF.md and launch.json match what runs, and infra/neon/schema.sql holds the schema the migrations produce with every function in full, regenerated by one command and checked by CI. The unused sample data and exports are gone, strictFunctionTypes and noUnusedLocals are on, and 23 of the 56 web test files run in Node.

This is app review batch 6b, built on #32 (Home and notices), so review that first; the diff here shows only this part. Nothing a person sees in the app changes.

What changed, by finding

Finding Change
63 CLAUDE.md checked against the code: the real folders, Vite 7 and Vitest, Vercel, 39 migrations and the schema dump, the ports and COMMUNE_API_PORT, the pnpm 10 pin and the filtered install, and a new "Tests and CI" section. AGENTS.md now only points to CLAUDE.md, so the two cannot drift apart. docs/GO-LIVE-REVIEW.md, the July go-live plan, the homepage direction brief, two design mock notes and replit.md open with a note that they describe an earlier app. HANDOFF.md has today's ports, test counts and migration status. .claude/launch.json lists commune-web, commune-web-qa, commune-api (new, port 3002), website, website-backup and mobile-v2.
65, schema infra/neon/dump-schema.sh builds a disposable database from the migrations, dumps its schema to infra/neon/schema.sql (133 functions in full, with tables, policies, triggers and grants) and drops it; --check fails and shows the difference while the file is out of date. A new "Schema dump" step in CI runs the check. infra/neon/README.md gains "Writing a migration": copy the function from schema.sql, write its complete body, never replace() over pg_get_functiondef(), and commit the regenerated file with the migration. CLAUDE.md carries the same rule.
65, dead code data/household.ts drops from 858 to 339 lines and data/operations.ts from 499 to 210: the sample notes (with the Wi-Fi password string), sample expenses and status, the sample task seed and the helpers only they used. Also pathOnly, reminderLimitReached and the unused Choose menu. Of the exports nothing else imports, 16 were used nowhere and are deleted; the last, equalShares, goes with the next pull request, which changes its file. Another 49 are used inside their own file, so only their export keyword is spare, and they stay.
65, TypeScript strictFunctionTypes (0 errors) and noUnusedLocals (2, both fixed) are on for the web app and the reminder worker; the local API's strict already covered the first, so it gains the second. They are set per app because the Replit-era packages share tsconfig.base.json.
65, tests 18 test files that render nothing and need no localStorage start with // @vitest-environment node, so 23 of 56 run in Node and the browser environment is built 33 times instead of 56. In alternating runs on a shared 4-CPU machine the suite took 65 to 67 seconds against 74 to 76 before (about 12% less), and the time spent setting up environments fell from 63 seconds to between 37 and 40.
Flaky test (found while checking) The address test read the address before the effect that adds the commune to it had run, and failed about once in thirteen runs under load. It now waits for it.

Not in this pull request: scoping the Vercel install (needs the owner, finding 65), ESLint (needs a lockfile refresh, which the network here blocks), the repository's weight (finding 62, the owner's call), and code splitting, which comes with the styles change after the next pull request.

Releasing

Nothing hosted was touched and there is no migration. schema.sql is for reading only: every database, Neon included, is still built from the migrations in order.

Needs the owner

  • HANDOFF.md now says that nothing it records shows migration 0024 or later applied to the everyday database on your Mac (commune_loading_test_20260927), so back it up and apply 0024 to 0039 in order before running the current local API against it. Say if you know otherwise.
  • .claude/launch.json was rewritten to the servers that exist. If your copy has local additions, merge them in rather than overwriting.
  • replit.md is marked historical because it describes the Replit-era packages, not the app. Say if you still use it.

How it was checked

On this branch:

  • 602 web tests in 56 files (23 of them in Node), the web, local API and worker typechecks, and a production build.
  • 27 database tests through run-local.sh (2 more need a Neon branch), then dump-schema.sh --check.
  • 21 local API suites on a disposable database and port, and the reminder worker's 6 unit tests and 4 database suites.
  • The secret scan over the files and every commit.

The schema dump was built three times from scratch with identical results; a stale file, a missing file, the wrong pg_dump, bad arguments, a non-loopback host and an interrupted run each fail with a clear message and leave no database behind. The new commune-api launch entry was started against a disposable database and answered its health check. The secret scan finds nothing in schema.sql.

How

Every deletion was proved unused by the TypeScript language service across the source, tests, scripts and configs, then by noUnusedLocals for code only those exports used; anything a test reads stays. The dump uses PostgreSQL 16's pg_dump against a PostgreSQL 16 server, as CI does, and leaves out the lines that change from run to run (the random \restrict keys and the version stamps), so the same migrations always produce the same file.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A6P7aTcMBccooYYr4xYnVS


Generated by Claude Code

claude added 6 commits October 9, 2026 19:25
The design fixtures (sample communes, notes with a Wi-Fi password and door
codes, expenses and tasks) and the helpers built on them were no longer read
by the app, its tests or its build. The TypeScript language service found no
reference to any of them from src, tests, scripts or the Vite and Vitest
configs, and the typecheck and every web test pass without them.

HUBS keeps only the three default cover photos, which live/model.ts, the
covers and the tests still read. equalShares in live/model.ts is also unused
but is left for the batch that owns that file.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6P7aTcMBccooYYr4xYnVS
The shared base config switches off strictFunctionTypes and noUnusedLocals.
The web app, the reminder worker and the local API now switch both on (the
local API's strict already covered function types), so a callback with the
wrong parameter type and an import or variable nothing reads fail the
typecheck. The base config is left as it is for the older packages that
extend it.

The web app had two unused locals, both values read from useApp() and never
used: native in the Notes screen and go in Windows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6P7aTcMBccooYYr4xYnVS
Eighteen more test files declare the Node environment, as five already did,
so 23 of the 56 skip starting jsdom: the logic, contract, copy, token and
design reference tests (the last builds its own JSDOM). The 33 that render
components, or read local storage, stay in jsdom, the default.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6P7aTcMBccooYYr4xYnVS
infra/neon/schema.sql is a pg_dump of a database built from the migrations
(the auth stand-ins and every migration, as the database tests build their
stub database), with every function, policy and grant in full, so the
current version of a function can be read without a database.
infra/neon/dump-schema.sh rewrites it in one command; with --check it fails
while the file is out of date, and CI runs that after the database tests.
The script uses a disposable, randomly named database under
SQL_TEST_PREFIX on a loopback PostgreSQL 16 server, drops it afterwards, and
leaves out the lines pg_dump changes on every run.

infra/neon/README.md now says how to write a migration: complete function
bodies copied from schema.sql, never replace() over pg_get_functiondef(),
and the regenerated schema.sql in the same commit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6P7aTcMBccooYYr4xYnVS
CLAUDE.md now matches the code: the folders that exist (apps/mobile and the
landing apps are gone; web-backup and the CI workflow are listed), Vite 7
and Vitest, the 39 migrations and the schema dump, the ports, how each
suite runs and what CI checks. Its rules, principles and voice are kept,
with one new rule: a migration writes complete function bodies and commits
the regenerated schema dump. AGENTS.md now points to CLAUDE.md instead of
repeating it, so the two cannot drift apart.

Documents that describe the earlier Supabase, Mantine or Replit-era code
say so at the top: GO-LIVE-REVIEW.md, the July go-live plan, the
homepage-to-app brief, the Mantine-era design audit and palette, and
replit.md. Their content is unchanged.

docs/HANDOFF.md has today's ports, test counts, migration status (0013 to
0039 for hosted parity) and launch names. .claude/launch.json lists only
servers that exist: the web app, its QA variant, the local API, the website,
its backup and the Expo app, in place of the Supabase, Turborepo, landing
and old mobile entries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6P7aTcMBccooYYr4xYnVS
The test read the address as soon as the expense list appeared, but the
effect that adds the commune to it can run just after. Under load it failed
about once in thirteen runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6P7aTcMBccooYYr4xYnVS
@vercel

vercel Bot commented Oct 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
commune-web Error Error Oct 9, 2026 8:10pm UTC

Copy link
Copy Markdown
Owner Author

The Vercel preview for commune-web shows Error here, as it has on every branch since 6 October. It is the project or account issue explained on #24 (app review finding 45), not this diff: the Web app check, which builds the app, passes on this head (465c63a), as does the new schema dump check. It needs someone with the Vercel login to read a failed deployment's log.


Generated by Claude Code

@EmotiveImpact
EmotiveImpact changed the base branch from claude/app-review-home-notices to main October 12, 2026 02:01
@EmotiveImpact
EmotiveImpact marked this pull request as ready for review October 12, 2026 02:01
@EmotiveImpact
EmotiveImpact merged commit 8573973 into main Oct 12, 2026
6 of 7 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T02:02:28.023221Z 465c63a Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch had an error being deployed

1 failed deployment
Preview — 465c63ae Deployed Oct 9, 2026 by vercel[bot]
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