Repository navigation
feat(compat): add forward-upgrade shield, time-capsule harness, and doc updates - #7152
Merged
Merged
Conversation
…oc updates Establish forward in-place upgrade guarantees ahead of the first nightly on main: - Add atomic Rust data-migration hook (`Migration::with_data`) inside `maka_event_log::migration` so schema and persisted JSON payloads evolve in place within the migration `SAVEPOINT` without legacy read-time branches or external migration scripts. - Add SHA-384 immutable migration ledger verification (`scripts/rust/migration-lock.mjs` + `scripts/rust/migrations.lock.json`), wired into `just migrations`, `just check`, and always-run PR `tooling` CI. - Add full-scenario Time Capsule upgrade compatibility harness (`products/maka/cli/tests/upgrade_compat.rs` + `scripts/rust/compat-capsule.mjs`) exercising Settings, encrypted Vault, Preferences, Sessions/Attachments, Code Mode `SessionData`, Fork, Room, Subagent Presets, Personal Memory/Recall, and Workspace Checkpoints (including portable export/open). - Add post-merge replay workflow (`.github/workflows/compat-post-merge.yml`) and wire hard `compat-gate` + post-release `seal-capsule` jobs into `.github/workflows/nightly.yml`. - Align `AGENTS.md`, `CONTRIBUTING*.md`, `README*.md`, PR template, and Copilot review instructions; remove redundant `.github/skills/code-review/SKILL.md`. Generated-by: Maka (Gemini)
Generated-by: Maka (Gemini)
Generated-by: Maka (Gemini)
…y, deployment upgrades, and verify assertions - Enforce sealed migrations in `migration-lock.mjs check` (`pendingCount > 0` now fails until `seal` is committed) while keeping `seal` validating locked history before appending. - Harden `compat-capsule.mjs`: validate archive `baseDir` matches `CANONICAL_CAPSULE_DIR` before touching any path (never pass archive-supplied paths to `rmSync`), create the `compat-capsules` release atomically with both rolling and `capsule-first-nightly.tar.gz` assets, and require the permanent baseline asset during `verify-release`. - Fix `deployment/store.rs` pre-migration schema validation so writer opens accept a verified historical prefix before running `migrate()` and enforce the complete ledger afterward (with v1->v2 regression test). - Tighten `upgrade_compat.rs`: deduplicate Host lifecycle via `tests/support/host.rs`, assert pre-upgrade conversation context strictly on the first post-upgrade request before emitting any tool call, verify exact `agent.memory` ID/body, `receipts.read` operation persistence, and online `maka checkpoint export` + `open` on the upgraded Root, and fix Vault wording. Generated-by: Maka (Gemini)
M4n5ter
force-pushed
the
feat/upgrade-compat-shield
branch
from
November 22, 2026 04:46
e0fb6ff to
4d6712a
Compare
…r_version - Advance PRAGMA user_version atomically inside store::migrate_with's savepoint and require PRAGMA user_version to match the latest applied _sqlx_migrations version in validate_schema_with so writers and strict readers share one rule. - Route lease-held host update/reconcile reads through store::read_for_update and allow verified historical prefixes when opening the update writer, keeping schema migration and pending-intent insertion atomic in updates::prepare. - Add an end-to-end v1 -> v2 deployment update regression test covering failed prepare rollback and strict post-migration reopen, and tighten upgrade_compat personal memory assertions to exact id/body equality. Generated-by: Maka (Gemini)
…ated stores - Add store::read_handoff so an older scheduled auto-update executable can still locate and validate the newer pending/active executor when updates::prepare has already migrated deployment.sqlite (e.g. after returning ActiveTasks), without ever writing to the newer schema. - Validate the known historical migration prefix and package path bounds before handing off, and keep HandoffRecord tolerant of forward-added JSON fields. - Pin both v1 -> v2 upgrade regression tests to an explicit v1 catalog so future production migrations do not break the baseline fixture, and extend coverage to v1 scheduler handoff recovery. Generated-by: Maka (Gemini)
M4n5ter
added a commit
that referenced
this pull request
Nov 22, 2026
#7127 merged onto rust-preview right before #7152, adding plugins/agent/state/migrations/0052_room_overhaul.sql without the new Migration::data field or migrations.lock.json entry introduced in #7152. - Initialize data: None on migration 52 in plugins/agent/state/src/lib.rs. - Seal 0052_room_overhaul.sql into scripts/rust/migrations.lock.json. Generated-by: Maka (Gemini)
M4n5ter
added a commit
that referenced
this pull request
Nov 22, 2026
#7127 merged onto rust-preview right before #7152, adding plugins/agent/state/migrations/0052_room_overhaul.sql without the new Migration::data field or migrations.lock.json entry introduced in #7152. - Initialize data: None on migration 52 in plugins/agent/state/src/lib.rs. - Seal 0052_room_overhaul.sql into scripts/rust/migrations.lock.json. Generated-by: Maka (Gemini)
4 tasks done
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.
Summary
Prepares
rust-previewfor the upcomingmainswitch and first nightly release by establishing forward in-place upgrade compatibility guarantees and cleaning up contributor/release docs:1. Forward In-Place Data Migration & Immutable Ledger Lock
platform/event-log/src/migration.rs): addedMigration::with_data(fn(&Connection) -> Result<(), StoreError>)executed inside the sameSAVEPOINT maka_schema_migrationsright aftermigration.sql, so schema and JSON payload rewrites upgrade old SQLite databases directly to the current shape instead of accumulating legacy read branches or relying on external scripts.scripts/rust/migration-lock.mjs,scripts/rust/migrations.lock.json): seals SHA-384 digests of all 55 baseline migrations across the 4 ledgers (rootshared byevent-log+agent/state,checkpoint-repository,settings,deployment), rejecting edits, deletions, duplicate versions, and backdated versions. Wired intojust migrations,just check, and always-run PRtoolingCI.2. Full-Scenario Time Capsule Harness & CI/Release Gates
products/maka/cli/tests/upgrade_compat.rs: drives the realmakabinary end-to-end across Settings, encrypted Vault credential decryption (verified on the wire viaAuthorization: Bearer), Assistant Preferences, primary Session + Attachment + Code Modeexec/Shell/store, Fork, Room, Subagent Preset, Personal Memory/Recall, and Workspace Checkpoint publish + portable archive export/open.MAKA_COMPAT_PRODUCE_CAPSULE, andMAKA_COMPAT_VERIFY_CAPSULE(cold startup + migrations -> exhaustive read/deserialization sweep -> live continuation +maka inspect+ SQLitePRAGMA integrity_check+ monotonic migration ledger check).scripts/rust/compat-capsule.mjs:produce,verify,verify-release, andpublish(permanently pinningcapsule-first-nightly.tar.gzand keeping a rolling window of the newestcapsule-nightly-*.tar.gzassets on thecompat-capsulespre-release)..github/workflows/compat-post-merge.yml: runs after commits merge tomain(not on ordinary PRs) to verify the migration lock, run the current-HEAD self-roundtrip, and replay every published historical capsule..github/workflows/nightly.yml: adds a hardcompat-gatejob (blockspublish-npmandrelease) running the real builtlinux-x64-gnumakabinary against self-roundtrip and all historical capsules, plusseal-capsuleafterreleasesucceeds.3. Docs & Review Cleanup
AGENTS.md: kept@.agents/AGENTS.mdlocal override hook; added concise persisted-state & forward-upgrade rules pointing agents toupgrade_compat.rs.CONTRIBUTING.md&CONTRIBUTING.zh-CN.md: replaced outdated SQLx migration wording with forwardmaka_event_log::migration::Migration+upgrade_compat.rsrules.README.md&README.zh-CN.md: added Apache0.2.2 (incubating)official source release & download page note..github/skills/code-review/SKILL.md, updated.github/copilot-instructions.md, and added a breaking-change / persisted-data migration check in.github/pull_request_template.md.Verification
node scripts/ci.mjs check format— pass (552 files, 0 issues)node scripts/ci.mjs check licenses— pass (2607 covered, 3433 excluded)node scripts/ci.mjs check migrations— pass (55 locked, 0 pending)node scripts/ci.mjs check tooling-tests— pass (351/351)cargo test --locked -p maka-event-log --lib migration— pass (6/6)cargo nextest run --locked -p maka-cli --test upgrade_compat— pass (self-roundtrip)compat-capsule.mjs produce(9.7 MiB) -> fresh mountverify— passYAML.load_fileAI-Assisted Contribution
Checklist
Does this PR entail a breaking change or persisted-data migration?
Does this PR entail a change in behavior?