Repository navigation
fix(cli): fix large-app smoke-test defects in routes, migrate and verify - #559
Merged
Merged
Conversation
…ter advisories Building one large app on the generated stack turned up six defects: - Generated routes on Postgres answered 500 for ordinary bad uuid input. `?search=` ILIKEd a uuid FK (no `uuid ~~* text` operator); a malformed uuid `:id` reached Postgres as a literal. The search now skips formatted string rules, `coerceIdForColumn` rejects a malformed uuid (400 invalid_id), and the generated Zod schemas check a field.uuid's shape (400 validation). A new integration test runs the stock `routesFile()` output against Postgres with uuid keys and a uuid FK. - `meta migrate` now warns when a view still names a column the migration renames, since the recreate then fails at apply. - The index-name examples are table-scoped and say names are schema-wide; the list-hook name rule is stated correctly everywhere. - `meta verify` advisories: comments are skipped, money-float needs a money-named operand, UI `.reduce` sums are not aggregates, unindexed FKs are one finding, and a structured run does not repeat findings on stderr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
?search=skips string rules that carry aformat(uuid FKs no longer 500). A malformed uuid in:idor a body FK now answers 400invalid_idor validation error instead of 500. Zod insert/update schemas checkfield.uuidagainst an 8-4-4-4-12 hex regex; read schemas keep a barez.string(). Owned template copies and examples are resynced and regenerated.meta migrate: newview-names-renamed-columnschema advisory (warning, not a block) when a recreated view's@sqlnames a column the same change set renames. The "recreated only because it reads an altered table" note excludes such views.meta verifyadvisories: the anti-pattern scanner skips comment lines; money-float fires only on money-named operands;.reducecounts as a hand-rolled aggregate only when it accumulates into its first parameter with+, and not in.tsx/.jsx; all unindexed foreign keys collapse into one finding that names each key and itsindex.lookup; with a structured--formatpayload on stdout, advisory sections print a header and pointer on stderr. The requirement gate output is unchanged. Advisories never affect exit codes.Validation
Risk Assessment
✅ Low: Each of the six fixes is narrowly scoped and matches the stated intent. I traced the search skip, uuid id and body validation, rename advisory, scanner narrowing, FK collapse and stderr pointer through the code and found no wrong-result path. Behavior changes are the ones the intent calls for, advisories never touch exit codes, and regression tests run the stock routes against Postgres.
Testing
The six fixes were driven live. Postgres uuid routes passed through the stock generated routes, and that test fails on the base commit with the exact reported Postgres errors.
meta migrateprinted the new renamed-column view warning and dropped the "recreated only because" note.meta verifywas silent on comment lines,totalHours.toFixed(2), a max reduce and a .tsx reduce. It still flaggedtotalAmount.toFixed(2),price * 100and a+reduce. Three unindexed FKs collapsed into one advisory naming every key and its index.lookup. On stderr the structured mode printed headers plus a pointer, and the exit code stayed 0. The CHANGELOG was not read; the doc changes for 5.4 and 5.5 were checked via the diff and theci-local.sh --quickdrift gates only. The completeci-local.sh --quickrun passed. Not run: the C#/Java/Python/Kotlin conformance lanes, the java-reactor, the integration-tests matrix and the cube live check (all skipped under--quick; this change is TS-only apart from regenerated agent-context fixtures and doc text).operator does not exist: uuid ~~* unknown; stock-uuid-routes-pg.loginvalid input syntax for type uuid500smeta migrate --dry-runon Postgres renaming a column that a view's @SQL still names: warning names view, column and new name; recreate note excludes that viewmeta verifyadvisory noise: comments skipped; totalHours.toFixed(2) silent; money-named math,+reduce still flagged; max-reduce and .tsx reduce silentEvidence: Stock routes uuid-on-Postgres test run
Evidence: meta migrate --dry-run with a renamed column named by a view (warning present, recreate note excluded)
Evidence: meta verify structured stdout (one FK finding, comment/toFixed/max-reduce/tsx silent)
Evidence: meta verify stderr (headers plus pointer)
Evidence: scripts/ci-local.sh --quick full log (exit 0)
Validated in one no-mistakes run.
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
operator does not exist: uuid ~~* unknown; stock-uuid-routes-pg.loginvalid input syntax for type uuid500smeta migrate --dry-runon Postgres renaming a column that a view's @SQL still names: warning names view, column and new name; recreate note excludes that viewmeta verifyadvisory noise: comments skipped; totalHours.toFixed(2) silent; money-named math,+reduce still flagged; max-reduce and .tsx reduce silentscripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchainsbun test test/generated-uuid-routes-pg.test.tsin integration-tests (stock routesFile() output on Postgres 18, uuid keys + uuid FK): 7 pass. Rerun with runtime-ts/codegen-ts/test-generators src reverted to the base commit: search and :id cases fail withoperator does not exist: uuid ~~* unknown/invalid input syntax for type uuid; restored afterwards, worktree cleanMETAOBJECTS_TEST_PG_URL=... bun test test/uuid-input-pg.test.ts test/drizzle-fastify/filter-parser.test.tsin runtime-ts (Hono + Fastify adapters, real Postgres): 45 passbun testfor codegen-ts zod-validators-execution (39 pass), migrate-ts view-names-renamed-column (3 pass), cli anti-patterns, verify-fk-index-lint, view-recreate-note-renamed-column, advisory-structured-output (59 pass)Live CLI: temp project on a real Postgres,meta migrate --applycreated time_entries and v_hours, then the column was renamed withmeta migrate --dry-run --rename-column time_entries.hours=duration_hours, with the view@sqlstill naminghoursLive CLI: temp project withmeta verify(default text and structured stdout/stderr) over comment lines,totalHours.toFixed(2),totalAmount.toFixed(2),price * 100, a+reduce, a max reduce, a .tsx reduce, and three unindexed FKsscripts/ci-local.sh --quick: PASSED, exit 0, 19m30s (hygiene gates, owned template copies current, site payload true, requirements ledger, shipped doc examples, TS conformance and agent-context fixtures)Baseline already ran:scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchains✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.