Repository navigation
Release gate: doctor --release, generate --check, update-API keyword contract - #272
Merged
Merged
Conversation
raco rivet generate --check regenerates all client files in memory and fails when the tree differs, closing the hand-edited-version-stamp class (taskly 8c34ed5, fulcrum 973df6b, syncpilot, pdfgist) — the writer and the gate share one regeneration so they can never disagree about what a fresh tree looks like. raco rivet doctor --release validates in one command: generated files are fresh, the committed schema baseline accepts the backend, hand- written host sources call fetch-update-manifest/select-update/ download-update/fetch-sibling-asset only with keywords the installed rivet accepts (procedure-keywords against the live functions, catching the payback #:redirections class in CI instead of on user machines), and every rivet.git# pin in the repository is non-empty and consistent with the installed rivet release (the autarx empty-ref incident). Documented the update API keyword contract as a stable surface in docs/release-and-updates.md, guarded by a documentation test that parses the bullets against the installed procedures so the contract cannot drift in either direction. Warned about the empty-ref footgun in docs/ci.md and docs/ci.zh-CN.md. Closes #245. Closes #255.
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.
Closes #245. Closes #255.
What
raco rivet generate --checkregenerates every client file in memory and fails when the tree differs. The writer (generate-clients!) and the gate (check-generated-clients) share one regeneration (client-outputs), so they can never disagree about what a fresh tree looks like. Because regenerated content always carries the currentrivet.rktdversion/build stamp, a hand-edited literal or a forgotten regeneration shows up as stale — closing the taskly8c34ed5, fulcrum973df6b, syncpilot, and pdfgist stamp-drift class. The generator itself already rewrote files unconditionally, so issue #245's second proposal (rewrite when only the stamp changes) is satisfied by construction; the missing piece was the gate.raco rivet doctor --releasevalidates in one command and one exit code:fetch-update-manifest/select-update/download-update/fetch-sibling-assetonly with keywords the installed rivet accepts — checked viaprocedure-keywordsagainst the live functions, so the contract is read from the running rivet instead of duplicated as literals. This is the compile-time defense against the payback#:redirectionsclass (five shipped releases whose update check failed only on user machines),rivet.git#...pin in the repository is non-empty and consistent with the installed rivet release (the autarxv0.4.1empty-ref incident:URL#silently resolves to the default branch).Docs: the update API keyword contract is now a documented stable surface in
docs/release-and-updates.md, guarded by a documentation test that parses those bullets against the installed procedures' own contracts, so it cannot drift in either direction.docs/ci.mdanddocs/ci.zh-CN.mdwarn about the empty-ref footgun next to the pin examples.Notes for reviewers
rivet.rktd; there is no VERSION file and product-internal fallback literals (e.g. a productversion.rkt) stay product-owned — the generated-file freshness check proves the generated constants equal the manifest, which is the part rivet can know.installed-rivet-release-versionresolves the package root by stepping one level up from therivetsub-collection (collection-file-path only resolves sub-collection dirs); returns #f for packaged CLI copies and the check reports that explicitly.#langreader line plainreadcannot parse, and prunes.rivet,compiled,dist,node_modules,stagetrees.Tests
rivet/tests/codegen.rkt: fresh/stale/missing/repaired round-trip on a real scaffolded project.rivet/tests/doctor.rkt: green project passes all five checks; hand-edited stamp, drifted keyword, and empty pin ref each fail with cause-naming detail; the exported scanner reports the live violation.rivet/tests/documentation.rkt: contract bullets must list exactly the installed keyword sets, and only scannable functions.