fix(migrations): v1.27 remediation prints a real command instead of a fictional flag

Every skip/failure path referenced '/setup-gbrain --rerun-migration',
which is implemented nowhere, and promised the migration 'will ask
again next upgrade', which the version-window runners make false. All
five sites now print the direct GSTACK_MIGRATE_ASSUME_YES=1 bash
invocation. Runner-side re-offer tracking is filed in TODOS.
This commit is contained in:
Garry Tan
2026-08-14 17:11:48 -07:00
parent fb20ada4ac
commit 800716e9a4
2 changed files with 31 additions and 9 deletions
+12
View File
@@ -190,6 +190,13 @@ describe('v1.27.0.0 migration — #1383 consent + failure-stays-pending contract
expect(r.code).toBe(0);
expect(r.stderr).toContain('skipping for now');
expect(r.stderr).toContain('GSTACK_MIGRATE_ASSUME_YES=1');
// The remediation must be REAL: a direct invocation of this script.
// `/setup-gbrain --rerun-migration` never existed, and the runners'
// version windows never re-select a passed migration, so "will ask
// again next upgrade" was false.
expect(r.stderr).toContain('v1.27.0.0.sh');
expect(r.stderr).not.toContain('--rerun-migration');
expect(r.stderr).not.toContain('ask again');
// Old state untouched, nothing recorded as done.
expect(fs.existsSync(path.join(tmpHome, '.gstack-brain-remote.txt'))).toBe(true);
expect(fs.existsSync(path.join(tmpHome, '.gstack-artifacts-remote.txt'))).toBe(false);
@@ -205,6 +212,11 @@ describe('v1.27.0.0 migration — #1383 consent + failure-stays-pending contract
expect(r.code).toBe(1);
expect(r.stderr).toContain('PENDING');
expect(r.stderr).toContain('INCOMPLETE');
// Honest remediation: direct invocation, not the nonexistent
// /setup-gbrain --rerun-migration flag.
expect(r.stderr).toContain('Re-run manually with:');
expect(r.stderr).toContain('GSTACK_MIGRATE_ASSUME_YES=1');
expect(r.stderr).not.toContain('--rerun-migration');
expect(fs.existsSync(path.join(tmpHome, '.gstack/.migrations/v1.27.0.0.done'))).toBe(false);
const journal = fs.readFileSync(
path.join(tmpHome, '.gstack/.migrations/v1.27.0.0.journal'),