Repository navigation
[db] Close the review of the generated schema - #199
Merged
Merged
Conversation
The catalog comparison now covers triggers, row security and policies, collations, identity options, storage parameters and persistence, comments, types and enum labels, privileges, default privileges, views and the columns of every kind of relation, and the rows of every table. A probe test proves each kind is seen. The migrations since the last release now run on a database at that release holding a row in every table. A retained table pinned at the release must keep every row and column across them unless the loss is named in allowed_losses with its decision. The freeze test requires each released migration to be present and pins bookkeeping_sql(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A codec that throws during a run now throws codec_failure, which names it. check --ratchet checks the merge base again without that codec, says so, and counts the codec's findings at HEAD as new, instead of exiting 2 when HEAD adds a library the base lacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
origin() named the last library of the checkout for every template, as it could not look into the checkout. It now gets the checkout's root and names the last library that holds the template, so compass's outputs name share/masd/templates rather than the project library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A generated enum is over std::uint8_t again. - copy_writer::field writes a bool as t or f, and a test covers each overload of field. - compass.bench parses a step outcome with the generated parser, and corpus.cpp parses both integer types with one function. - The model prose no longer says the profiles fix features they do not assign, and the section model shows the tsv expression the insert runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A release build now runs the built compass on the checkout: check --ratchet against the merge commit's first parent on a pull request, plain check elsewhere. It fails on generated drift and diagnostics, so a model or template edited without compass generate no longer passes. The relevance guard builds a change to the models, the MASD library or .compass.org, which it skipped as documentation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main holds 70 findings that only a base excuses, so a plain check on a push or a schedule would always fail; main changes only through pull requests. document_index is off in the check: its output is not committed, so a fresh checkout always lacks it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
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.
Follow-up to #196. This closes the review's should-fix findings 1, 2 and 4 to 7, and nits 3, 11 (enum width only), 12, 13, 14 and 15. The #195 findings on the loader and context builder are left for a later change.
What changes
1. CI checks compass with the compass it built. On a pull request, the release build runs
compass check --no-blame --set document_index.enabled=false --ratchet HEAD^1.HEAD^1is the first parent of the merge commit, which is main as merged, sofetch-depth: 2is enough.document_indexis off because its output goes under the ignoredbuild/output/, so a fresh checkout always lacks it. Pushes and scheduled runs skip the step. Main holds 70 findings that only a base excuses, so a plaincheckthere would always fail, and main changes only through pull requests. The relevance guard now builds a change to amodeling/directory, toshare/, or to.compass.org. Before, it skipped those as documentation, and they are exactly what compass generates from.2.
check --ratchetkeeps going when the merge base cannot run a codec. A codec that throws during a run now throwscodec::types::codec_failure, which names the codec and keeps its message. The ratchet catches it, checks the base again with that codec off, and prints<codec> did not run at the merge base (<why>), so its findings at HEAD are new. Decision: all of that codec's HEAD findings count as new. Nothing at the base can excuse them, and the change that makes the codec runnable owns what it reports. The usual case is a library added together with its generated outputs. That case has no findings, so it passes.4. The catalog comparison covers every kind of object. It adds collation; triggers; row security and policies; persistence and storage parameters; privileges on schemas, relations, columns, functions and types; default privileges; sequence options; enum, domain and range types with their labels; comments; view definitions; columns of every relation kind; extensions; and the rows of every table except
compass.migration. A new probe test buildsschema.sqlwith and without 21 kinds of object and requires the two catalogs to differ.5 and 6. The migrations are tested on rows, against the released schema. The test takes a database to the last release through the released migrations, puts one fully filled row in every table, and requires the later migrations to apply. Each table the release retains is pinned in the test as
released_retained. It must keep every row and every column, with type and collation, unlessallowed_lossesnames the column with the:ID:of the document that decides the loss. I put the allowance in the test, not in a marker in the migration, for three reasons. The check lives in the test. The edit shows in the pull request's diff. And a released migration is frozen, so a marker in it could never be added or removed. Because the set is pinned, a model that drops the retained profile no longer drops its table from the check.7. The freeze test. It now looks up every released version and
REQUIREs it to exist. It also pins the blob ID ofbookkeeping_sql()as v0.0.13 shipped it.Nits.
origin()gets the checkout root and names the library that actually holds the template.compass generatenow printsshare/masd/templates/....: std::uint8_tagain. This needed one token inmasd_context.cppfor the<cstdint>include, plus the template change.copy_writer::field(bool)writest/f. It is a constrained template, so a pointer cannot silently match it.fieldoverload.compass.benchuses the generatedstep_outcome_of, andcorpus.cpphas one integer parser.tsvexpression in the models are fixed.Evidence
The new tests fail on main and pass here:
schema.sqlalone: main's catalog test passes all ten. The new test fails all ten, and also fails an added view and an added partitioned table.NOT NULLcolumn with no default, dropsactivity.run.tester, or deletesactivity.attached's rows (withschema.sqlmatching where needed): main's tests pass. The new rows test or retained test fails.bookkeeping_sql(): main passes. The new freeze test fails.extra/templates/on main's sources andlib/templates/here.--depth 2clone exits 0. After a model column is retyped and a template's org page is edited without regenerating, it exits 1, withcodegen/driftonschema.sqlandtangle/drifton the template.Integration, after merging
origin/main(#197, #198):compass generatewrote nothing committed.compass check --ratchet --no-blame: 0 new, 70 excused.ctest: 1707 of 1707 pass.The task page
task_close_the_schema_review.orgrecords each measurement.🤖 Generated with Claude Code