Repository navigation
Per-kind ids: schema 3 and docket migrate - #28
Merged
Merged
Conversation
Schema 3 renumbers per kind and keeps each record's schema-2 id in a field; the migration rewrites feature citations and stays cheap for agents; old ids stay history only. How an unmigrated project's ledger is read stays open. Signed-off-by: NovusEdge <novusedge0@gmail.com>
A schema-2 ledger is refused until migrated, and the session hook passes the migrate instruction to the agent instead of failing on stderr. Signed-off-by: NovusEdge <novusedge0@gmail.com>
Migrate chains schema steps, the merge driver and rebase migrate a schema-2 side in memory, and --rewrite fixes citations in named files. Signed-off-by: NovusEdge <novusedge0@gmail.com>
migrated_from is an audit field hidden like legacy; the renumber rewrites structured ids and id mentions in record prose. Signed-off-by: NovusEdge <novusedge0@gmail.com>
Chained steps, a single file-order renumber pass, features moved under a schema bump, and record keys that ignore id tokens in headlines. Signed-off-by: NovusEdge <novusedge0@gmail.com>
The merge driver and rebase upgrade a schema-2 side in memory, and merges rewrite prose mentions with the migration's translation. Signed-off-by: NovusEdge <novusedge0@gmail.com>
Per-kind validation and allocation, a per-kind check, a migrate instruction from the session hook, and the rescope script removed. Signed-off-by: NovusEdge <novusedge0@gmail.com>
This repository's docs cite illustrative ids, so its migration runs without --rewrite, and legacy audit blocks stay untouched because the validator no longer checks them. Signed-off-by: NovusEdge <novusedge0@gmail.com>
Each branch migrates itself and merges require matching schemas, merge matching ignores migrated_from and prose id tokens, migrate survives a crash at any point, and prose resolution uses legacy source ids. Signed-off-by: NovusEdge <novusedge0@gmail.com>
A schema refusal keeps the merge driver's conflict markers, and this repository's ledger migrates right before the 0.26.0 release. Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
…map on schema 2 Signed-off-by: NovusEdge <novusedge0@gmail.com>
…, takes --rewrite Signed-off-by: NovusEdge <novusedge0@gmail.com>
…dger Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
…r against late writes and odd input list --where was: includes retired records. The merge driver refuses a non-UTF-8 or non-object BASE with markers. migrate refuses a non-object features line and a ledger that changed since it was read, names a remedy for another branch's backup, and tells users not to commit the backup. renumber_per_kind no longer rebuilds a set per record. docket rebase prints its schema error once. Signed-off-by: NovusEdge <novusedge0@gmail.com>
…at to abort Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
was: includes retired records, the migration backup stays uncommitted, migrate refuses a ledger changed mid-run, schema-1 rewrites use schema-1 ids, and false positives are fixed after migrating. Signed-off-by: NovusEdge <novusedge0@gmail.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (52)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ed_from Signed-off-by: NovusEdge <novusedge0@gmail.com>
…ration Corrects c138, q139, d187 and d197 and restates d185 so the dry run no longer rewrites ids quoted from the stoat and nimblefox ledgers or illustrative ids as this ledger's citations. Signed-off-by: NovusEdge <novusedge0@gmail.com>
…an follow it pyrefly rejected calling build_records and renumber_step through one dict, and could not prove a correction's target was bound where renumber_per_kind used it. Signed-off-by: NovusEdge <novusedge0@gmail.com>
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.
Schema 3 gives claims, decisions and questions independent id counters (
c1,d1,q1) and adds a one-run migration from schema 1 or 2.What changes
Ids and validation. Ids count per kind, allocated as that kind's highest number plus one. Every line carries
schema: 3. Readers refuse an older ledger with an instruction to rundocket migrate, and the session hook passes that instruction to the agent in place of a briefing (stdout, exit 0).docket checkcompares order per kind.docket migrate. Schema 1 and 2 both reach 3 in one run, in one file-order pass:migrated_fromfield;legacy.source_id;.docket/features.jsonland its archive are remapped and move to features schema 2.Writes are crash-safe: features and named files are replaced first, the original ledger is hard-linked to
ledger.jsonl.schemaN, and the ledger is swapped in oneos.replace. A rerun finishes an interrupted run, and the migration refuses if the ledger changed underneath it.--dry-runlists every prose rewrite and every unresolved id token.--rewrite FILE...rewrites citations in tracked, clean files.Merges. Each branch migrates itself. The merge driver and
docket rebaserefuse mixed schemas, and the driver leaves conflict markers naming the side that is behind. A pre-migration BASE is upgraded in memory for matching only. Matching ignoresmigrated_fromand id tokens in prose, so two branches migrated separately merge without duplicates.Finding old ids.
docket list --where was:IDfinds the record that carried an old id, retired records included.docket show OLDpoints at that search.Docs. A new
docs/schemas.mdpage covers the schema versions and the upgrade procedure.docs/ledger.md, the skill and the changelog are updated.Testing
python3 -m unittest discover -s tests -p 'test_*.py': 1252 tests, OK, 9 skipped. Three of the skips are temporary guards for tests that read this repository's own ledger, which stays at schema 2 until it is migrated after this merges.ruff 0.16.7format and check are clean.was:and context. It also merged two branches migrated separately through the driver, with no duplicates and a clean check.After merge
mainand commitledger.jsonlandfeatures.jsonl, not the backup.just release 0.26.0, then install 0.26.0.Between the migration and the install, the installed 0.25.1 hook cannot read the ledger.
Summary by CodeRabbit
New Features
was:IDsearches for records by their pre-migration IDs.Bug Fixes
Documentation