Repository navigation
fix(mods): retire legacy Goal turn snapshot triggers - #2378
Conversation
Databases touched by the withdrawn independent Goal candidate can retain a builtin-only execution ledger at schema 32. Valid custom modes then fail when a turn starts even after sessions.mode has been widened. Add a backed-up schema-33 compatibility migration that retires only the obsolete writer, preserves historical data, and repairs schema-version collisions atomically.
The installed rows already expose supported plugin panels. Replace the\nstale absence assertion so the integration gate checks the current action\nand its handler without changing product behavior.
|
Independent review: confirmed the compatibility defect with an isolated baseline Host: selecting the custom mode succeeds but session.beginTurn fails with the builtin-only mode CHECK. The candidate retires the obsolete writer in a backed-up transaction and retains the historical ledger. Local verification: 11/11 session-mode migration tests, 66/66 database tests, all three real-Host legacy migration scenarios (31, unconstrained 32, constrained 32), and both existing staged-mode / production IPC coordinator scenarios passed. cargo build --locked, cargo fmt --all -- --check and diff checks passed. JS artifacts/dependencies were reused from the primary checkout; no live provider or user database was used. I added a minimal landing repair in 9253fa1: the existing extension-row source contract incorrectly forbade the already-restored open-panel action. It now checks the supported panel action and handler. That suite reproduced 15/16 before and passes 16/16 after; no product behavior changed. Waiting for the refreshed CI and latest integration candidate before merging. |
vastsa
left a comment
There was a problem hiding this comment.
Root cause independently reproduced on the baseline Host; candidate migration, database regressions and real Host workflows pass. The stale plugin action contract was minimally repaired in 9253fa1. All six CI checks are green on 9253fa1. Latest main is unchanged and integration tree matches the tested candidate. Approved for merge.
Problem
Databases previously opened by the withdrawn independent Goal candidate (#2141,
c150b817002df2a28d88d81043a8cf7fbcced8cc) can retainturn_execution_snapshot, anAFTER INSERT ON turnstrigger. It copiessessions.modeinto the oldturn_executionledger, whose mode CHECK accepts onlyagent,plan, andgoal.#2359 correctly repairs the legacy
sessions.modeconstraint. It does not retire this separate writer: selecting a validated custom mode can succeed, butsession.beginTurnthen fails with:This is a compatibility defect for databases carrying the experimental schema, not a failure of custom-mode definition parsing or a claim that all current databases are affected. The withdrawn candidate also stamped schema 32, so a database already marked 32 may still contain either or both old constraints.
Fix
turn_execution_snapshottrigger. Preserve historicalturn_execution,goal_turns, andsession_goalstables and records, indexes, and unrelated triggers; the archived ledger no longer receives new turns.sessions.moderepair if its builtin-only CHECK remains. Do not rebuild an already-unconstrained sessions table.The Host verifies
pi.sqlite.v32.bakbefore migrating. Older schema-32 Hosts cannot open schema 33; rollback requires the compatible backup, not deleting data or loweringuser_version. Mode snapshots, permissions, RPC contracts, and the staged Goal architecture are unchanged. This PR does not revive the withdrawn Goal backend or include local installer/version changes.Verification
Candidate:
9253fa12de19d1899f4754e7f7f4446f0ac6d967(repair commit733b753883e584b38ecf9cd8828e25d22f9cdd82), based on29043af3371122e256bf265db31651da125d38e3.session_mode_migration11 passed;mode_runs::45 passed;rpc::modes_rpc::tests9 passed;rpc::session_mode_create_tests3 passed. These groups are not all disjoint.db::: 63 passed with the previously reproduced local Windowspath_repair_is_atomic_and_can_run_inside_an_import_transactionpath-prefix baseline failure explicitly excluded. The unchanged base fails that same case (D:/...versus//?/D:/...); no test was altered to suppress it.cargo fmt --all -- --check, locked/offline all-target Clippy, and Host build passed. Clippy retains five existing warnings in untouched code.node scripts/e2e-legacy-goal-migration.mjs: all three isolated real-Host scenarios passed (schema 31, schema 32 with unconstrained sessions, and schema 32 with the old sessions CHECK). Each verifies a stagedgoal-3turn, retained ledger history, a verified backup, and restart.node scripts/e2e-mode-definitions.mjs: both existing staged workflow and production IPC/coordinator-to-Host paths passed against the candidate Host.No live provider or running user Desktop was used, and no real user database was modified. The general smoke suite is not claimed green: an earlier isolated comparison reproduced its unrelated
revision not foundfailure on the unchanged installed baseline as well.CI follow-up: the initial JS run exposed an existing source-contract contradiction: main
438a1a364restored the installed-card Open panel button, whileextensions-page.test.mjsstill required its label to be absent. Maintainer commit9253fa12daligns the assertion with the supported-panel guard and callback. Both relevant test files pass (30 tests); no production plugin UI was changed. The three migration scenarios and existing mode-definition E2E paths were rerun successfully at this PR head.