Monotonic create timestamps, future-dated guard, codegen_on_up, hardened skill - #2
Closed
heryr wants to merge 1 commit into
Closed
Monotonic create timestamps, future-dated guard, codegen_on_up, hardened skill#2heryr wants to merge 1 commit into
heryr wants to merge 1 commit into
Conversation
- migrate::create stamps new files after the latest migration on disk, so a hand-written future-dated name can never make new files sort before an applied migration - migrate::status returns future_dated; migrate::up warns before applying a future-dated file (5-minute clock-skew tolerance) - codegen_on_up config (default: enabled when types_out is set) runs migrate::codegen after an up that applied migrations; migrate::up returns the written path as types_path - SKILL.md rewritten: triggers on any database/schema work and states the hard rules (always migrate::create, one migration per change, never edit applied files) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Merged manually into main as adf9782 (squash) — the GitHub API kept reporting the pre-amend head SHA after a force-push, blocking |
heryr
added a commit
that referenced
this pull request
Jul 23, 2026
) - migrate::create stamps new files after the latest migration on disk, so a hand-written future-dated name can never make new files sort before an applied migration - migrate::status returns future_dated; migrate::up warns before applying a future-dated file (5-minute clock-skew tolerance) - codegen_on_up config (default: enabled when types_out is set) runs migrate::codegen after an up that applied migrations; migrate::up returns the written path as types_path - SKILL.md rewritten: triggers on any database/schema work and states the hard rules (always migrate::create, one migration per change, never edit applied files)
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.
Hardens miiigrate against hand-written migration file names and closes the type-drift gap, following a real incident where an agent bypassed
migrate::createand forged a future-dated timestamp (…120000).Changes
migrate::create— new files are stamped after the latest migration on disk, so a future-dated hand-written name can never make subsequent files sort before an applied migration. Warns when it has to skip ahead of the clock.migrate::statusreturns a newfuture_datedlist;migrate::uplogs a warning before applying such a file. 5-minute clock-skew tolerance.codegen_on_up— new config knob (default: enabled whentypes_outis set) that runsmigrate::codegenafter an up that applied at least one migration;migrate::upreturns the written path astypes_path. Codegen failures are logged and never fail the run.migrate::create, one migration per logical change, never edit applied files, checktypes_pathafter up.Validation
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(52 tests) all green.