instar 1.3.465 → 1.3.467
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/EnrollmentWizard.d.ts +18 -1
- package/dist/core/EnrollmentWizard.d.ts.map +1 -1
- package/dist/core/EnrollmentWizard.js +22 -2
- package/dist/core/EnrollmentWizard.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +20 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +101 -1
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/ProactiveSwapMonitor.d.ts.map +1 -1
- package/dist/core/ProactiveSwapMonitor.js +7 -0
- package/dist/core/ProactiveSwapMonitor.js.map +1 -1
- package/dist/core/SessionManager.d.ts +10 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +28 -0
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/SessionRefresh.d.ts.map +1 -1
- package/dist/core/SessionRefresh.js +13 -0
- package/dist/core/SessionRefresh.js.map +1 -1
- package/dist/core/ensureInteractiveReady.d.ts +58 -0
- package/dist/core/ensureInteractiveReady.d.ts.map +1 -0
- package/dist/core/ensureInteractiveReady.js +114 -0
- package/dist/core/ensureInteractiveReady.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +20 -20
- package/upgrades/1.3.466.md +97 -0
- package/upgrades/1.3.467.md +80 -0
- package/upgrades/side-effects/deferral-detector-merge-deferral.md +72 -0
- package/upgrades/side-effects/onboarding-safe-pinswap.md +49 -0
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* public code/URL the operator types into the provider's own page.
|
|
21
21
|
*/
|
|
22
22
|
import { PendingLoginStore, type PendingLogin, type LoginFlowKind, type LoginProvider } from './PendingLoginStore.js';
|
|
23
|
+
import { type EnsureInteractiveReadyResult } from './ensureInteractiveReady.js';
|
|
23
24
|
/** The public artifact a framework login yields (no secret). */
|
|
24
25
|
export interface LoginArtifact {
|
|
25
26
|
verificationUrl: string;
|
|
@@ -43,6 +44,14 @@ export interface EnrollmentWizardConfig {
|
|
|
43
44
|
log: (m: string) => void;
|
|
44
45
|
warn: (m: string) => void;
|
|
45
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Onboarding-readiness seeder run when a claude-code enrollment completes
|
|
49
|
+
* (2026-06-09 incident: `claude auth login` is headless-only — it stores
|
|
50
|
+
* tokens but never sets the interactive first-launch flags, so the new
|
|
51
|
+
* home wedges the first interactive session pinned/swapped onto it).
|
|
52
|
+
* Injectable for hermetic tests; production uses the real util.
|
|
53
|
+
*/
|
|
54
|
+
ensureReady?: (configHome: string) => EnsureInteractiveReadyResult;
|
|
46
55
|
}
|
|
47
56
|
export interface StartEnrollmentInput {
|
|
48
57
|
id: string;
|
|
@@ -58,6 +67,7 @@ export declare class EnrollmentWizard {
|
|
|
58
67
|
private readonly store;
|
|
59
68
|
private readonly driveLogin;
|
|
60
69
|
private readonly logger;
|
|
70
|
+
private readonly ensureReady;
|
|
61
71
|
constructor(cfg: EnrollmentWizardConfig);
|
|
62
72
|
/** Default flow kind per provider: Codex/OpenAI = device-code (its endorsed
|
|
63
73
|
* flow); everyone else = url-code-paste (the phone-friendly Claude path). */
|
|
@@ -87,7 +97,14 @@ export declare class EnrollmentWizard {
|
|
|
87
97
|
* abort the sweep.
|
|
88
98
|
*/
|
|
89
99
|
reissueExpired(): Promise<PendingLogin[]>;
|
|
90
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Mark a login completed once the operator approved + the account enrolled.
|
|
102
|
+
* For a claude-code enrollment with a per-account config home, also seed the
|
|
103
|
+
* interactive onboarding flags — the login itself was headless, so without
|
|
104
|
+
* this the freshly-enrolled home wedges the first interactive session that
|
|
105
|
+
* pins/swaps onto it (2026-06-09 incident). Fail-safe: a seeding failure is
|
|
106
|
+
* logged, never blocks completion (the launch paths re-ensure defensively).
|
|
107
|
+
*/
|
|
91
108
|
complete(id: string): PendingLogin | null;
|
|
92
109
|
/** The phone surface: still-valid logins awaiting approval. */
|
|
93
110
|
pending(): PendingLogin[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollmentWizard.d.ts","sourceRoot":"","sources":["../../src/core/EnrollmentWizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"EnrollmentWizard.d.ts","sourceRoot":"","sources":["../../src/core/EnrollmentWizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6BAA6B,CAAC;AAErC,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,8EAA8E;AAC9E,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE;IAC9B,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB;6DACyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;AAE7B,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,iBAAiB,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,CA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— only the
|
|
20
20
|
* public code/URL the operator types into the provider's own page.
|
|
21
21
|
*/
|
|
22
|
+
import { ensureInteractiveReady, } from './ensureInteractiveReady.js';
|
|
22
23
|
export class EnrollmentWizard {
|
|
23
24
|
store;
|
|
24
25
|
driveLogin;
|
|
25
26
|
logger;
|
|
27
|
+
ensureReady;
|
|
26
28
|
constructor(cfg) {
|
|
27
29
|
this.store = cfg.store;
|
|
28
30
|
this.driveLogin = cfg.driveLogin;
|
|
29
31
|
this.logger = cfg.logger ?? { log: () => { }, warn: () => { } };
|
|
32
|
+
this.ensureReady = cfg.ensureReady ?? ensureInteractiveReady;
|
|
30
33
|
}
|
|
31
34
|
/** Default flow kind per provider: Codex/OpenAI = device-code (its endorsed
|
|
32
35
|
* flow); everyone else = url-code-paste (the phone-friendly Claude path). */
|
|
@@ -114,9 +117,26 @@ export class EnrollmentWizard {
|
|
|
114
117
|
}
|
|
115
118
|
return reissued;
|
|
116
119
|
}
|
|
117
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* Mark a login completed once the operator approved + the account enrolled.
|
|
122
|
+
* For a claude-code enrollment with a per-account config home, also seed the
|
|
123
|
+
* interactive onboarding flags — the login itself was headless, so without
|
|
124
|
+
* this the freshly-enrolled home wedges the first interactive session that
|
|
125
|
+
* pins/swaps onto it (2026-06-09 incident). Fail-safe: a seeding failure is
|
|
126
|
+
* logged, never blocks completion (the launch paths re-ensure defensively).
|
|
127
|
+
*/
|
|
118
128
|
complete(id) {
|
|
119
|
-
|
|
129
|
+
const login = this.store.complete(id);
|
|
130
|
+
if (login && login.framework === 'claude-code' && login.configHome) {
|
|
131
|
+
const ready = this.ensureReady(login.configHome);
|
|
132
|
+
if (ready.patched) {
|
|
133
|
+
this.logger.log(`[EnrollmentWizard] made ${login.configHome} interactive-ready (${ready.reason})`);
|
|
134
|
+
}
|
|
135
|
+
else if (ready.reason !== 'already interactive-ready') {
|
|
136
|
+
this.logger.warn(`[EnrollmentWizard] could not verify ${login.configHome} interactive-ready — ${ready.reason}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return login;
|
|
120
140
|
}
|
|
121
141
|
/** The phone surface: still-valid logins awaiting approval. */
|
|
122
142
|
pending() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollmentWizard.js","sourceRoot":"","sources":["../../src/core/EnrollmentWizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"EnrollmentWizard.js","sourceRoot":"","sources":["../../src/core/EnrollmentWizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,OAAO,EACL,sBAAsB,GAEvB,MAAM,6BAA6B,CAAC;AA6CrC,MAAM,OAAO,gBAAgB;IACV,KAAK,CAAoB;IACzB,UAAU,CAAc;IACxB,MAAM,CAA0D;IAChE,WAAW,CAAuD;IAEnF,YAAY,GAA2B;QACrC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;QAC9D,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,IAAI,sBAAsB,CAAC;IAC/D,CAAC;IAED;kFAC8E;IAC9E,MAAM,CAAC,WAAW,CAAC,QAAuB;QACxC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAClE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CAAC,IAAmB;QACnC,IAAI,IAAI,KAAK,gBAAgB,EAAE,CAAC;YAC9B,OAAO,CACL,yEAAyE;gBACzE,8EAA8E;gBAC9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AAC;YACjD,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAClB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,KAAK,CAAC,UAAU,uBAAuB,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YACrG,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,2BAA2B,EAAE,CAAC;gBACxD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,KAAK,CAAC,UAAU,wBAAwB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;YAClH,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,+DAA+D;IAC/D,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -95,6 +95,26 @@ export declare class PostUpdateMigrator {
|
|
|
95
95
|
* each migration is idempotent.
|
|
96
96
|
*/
|
|
97
97
|
migrate(): MigrationResult;
|
|
98
|
+
/**
|
|
99
|
+
* Seed the interactive first-launch onboarding flags into every EXISTING
|
|
100
|
+
* claude-code subscription-pool config home (2026-06-09 incident, topic
|
|
101
|
+
* 20905). Pool homes are enrolled via headless `claude auth login`, which
|
|
102
|
+
* stores OAuth tokens but never sets `hasCompletedOnboarding` /
|
|
103
|
+
* `bypassPermissionsModeAccepted` / `hasTrustDialogAccepted` — so the first
|
|
104
|
+
* interactive session pinned or quota-swapped onto such a home wedged on the
|
|
105
|
+
* first-launch onboarding screens (~8 live sessions at once). New
|
|
106
|
+
* enrollments are seeded by EnrollmentWizard.complete() and every pinned/
|
|
107
|
+
* swapped launch re-ensures defensively; this migration is the one-time
|
|
108
|
+
* sweep that makes homes enrolled BEFORE the fix safe.
|
|
109
|
+
*
|
|
110
|
+
* Idempotent (ensureInteractiveReady only writes missing flags) and
|
|
111
|
+
* fail-safe (the util never throws; per-home failures are reported, never
|
|
112
|
+
* abort the sweep). Only flags are ever written — oauthAccount/tokens are
|
|
113
|
+
* untouched by construction, and an unparseable `.claude.json` is refused,
|
|
114
|
+
* not rewritten. `requireExistingHome` keeps a stale registry entry from
|
|
115
|
+
* littering $HOME with empty credential-less homes.
|
|
116
|
+
*/
|
|
117
|
+
private migrateSubscriptionPoolInteractiveReady;
|
|
98
118
|
/**
|
|
99
119
|
* Regenerate the boot wrapper when it predates the ABI-aware node
|
|
100
120
|
* self-heal (recurring-SQLite-bane fix).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostUpdateMigrator.d.ts","sourceRoot":"","sources":["../../src/core/PostUpdateMigrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"PostUpdateMigrator.d.ts","sourceRoot":"","sources":["../../src/core/PostUpdateMigrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAwCH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AAyBjC,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,kCAAkC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAiB;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,UAAU,CAAiC;gBAEvC,MAAM,EAAE,cAAc;IAIlC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,oBAAoB;IA0B5B;;;;;;;;;;;OAWG;IACH,YAAY,CAAC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,CAAC,qBAAqB;IAyU7B,OAAO,CAAC,uBAAuB;IA8O/B,OAAO,CAAC,oBAAoB;IAgG5B,OAAO,CAAC,qBAAqB;IA8H7B,OAAO,CAAC,2BAA2B;IAoHnC,OAAO,CAAC,iCAAiC;IA6DzC,OAAO,CAAC,4BAA4B;IA0MpC;;;;;;;;;;OAUG;IACH;;;;;;;;;;;OAWG;IAEH,gBAAuB,iCAAiC,EAAE,WAAW,CAAC,MAAM,CAAC,CAgC1E;IAEH;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,8BAA8B;IAiHtC,OAAO,CAAC,uBAAuB;IAwD/B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,sBAAsB;IAwC9B,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,8BAA8B;IA6HtC,OAAO,CAAC,+BAA+B;IAuKvC,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,qBAAqB;IAqO7B,OAAO,CAAC,qBAAqB;IAwI7B,OAAO,CAAC,qBAAqB;IAyN7B,OAAO,CAAC,6BAA6B;IAkLrC,OAAO,CAAC,0BAA0B;IAgClC,OAAO,CAAC,gBAAgB;IAmJxB,OAAO,CAAC,6BAA6B;CAoCtC"}
|
|
@@ -41,6 +41,8 @@ import { appendMigrationEvent, normalizePerEntryAction } from '../scheduler/Migr
|
|
|
41
41
|
import { randomUUID } from 'node:crypto';
|
|
42
42
|
import { ELIGIBILITY_SCHEMA_SQL, ELIGIBILITY_SCHEMA_SQL_SHA256, PUSH_GATE_SH, PUSH_GATE_SH_SHA256, INSTAR_PR_GATE_WORKFLOW_YML, INSTAR_PR_GATE_WORKFLOW_YML_SHA256, PR_GATE_SETUP_MD, PR_GATE_SETUP_MD_SHA256, } from '../data/pr-gate-artifacts.js';
|
|
43
43
|
import { SafeFsExecutor } from './SafeFsExecutor.js';
|
|
44
|
+
import { SubscriptionPool } from './SubscriptionPool.js';
|
|
45
|
+
import { ensureInteractiveReady } from './ensureInteractiveReady.js';
|
|
44
46
|
import { installCodexHooks } from './installCodexHooks.js';
|
|
45
47
|
import { armCodexHooks, makeTmuxTrustDriver } from './codexHookArm.js';
|
|
46
48
|
import { detectCodexPath, detectTmuxPath } from './Config.js';
|
|
@@ -217,8 +219,59 @@ export class PostUpdateMigrator {
|
|
|
217
219
|
this.migrateThreadlineConversationStore(result);
|
|
218
220
|
this.migrateThreadlineAgentInfoIdentity(result);
|
|
219
221
|
this.migrateWorktreeMisplacedFloodItems(result);
|
|
222
|
+
this.migrateSubscriptionPoolInteractiveReady(result);
|
|
220
223
|
return result;
|
|
221
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Seed the interactive first-launch onboarding flags into every EXISTING
|
|
227
|
+
* claude-code subscription-pool config home (2026-06-09 incident, topic
|
|
228
|
+
* 20905). Pool homes are enrolled via headless `claude auth login`, which
|
|
229
|
+
* stores OAuth tokens but never sets `hasCompletedOnboarding` /
|
|
230
|
+
* `bypassPermissionsModeAccepted` / `hasTrustDialogAccepted` — so the first
|
|
231
|
+
* interactive session pinned or quota-swapped onto such a home wedged on the
|
|
232
|
+
* first-launch onboarding screens (~8 live sessions at once). New
|
|
233
|
+
* enrollments are seeded by EnrollmentWizard.complete() and every pinned/
|
|
234
|
+
* swapped launch re-ensures defensively; this migration is the one-time
|
|
235
|
+
* sweep that makes homes enrolled BEFORE the fix safe.
|
|
236
|
+
*
|
|
237
|
+
* Idempotent (ensureInteractiveReady only writes missing flags) and
|
|
238
|
+
* fail-safe (the util never throws; per-home failures are reported, never
|
|
239
|
+
* abort the sweep). Only flags are ever written — oauthAccount/tokens are
|
|
240
|
+
* untouched by construction, and an unparseable `.claude.json` is refused,
|
|
241
|
+
* not rewritten. `requireExistingHome` keeps a stale registry entry from
|
|
242
|
+
* littering $HOME with empty credential-less homes.
|
|
243
|
+
*/
|
|
244
|
+
migrateSubscriptionPoolInteractiveReady(result) {
|
|
245
|
+
const poolPath = path.join(this.config.stateDir, 'subscription-pool.json');
|
|
246
|
+
if (!fs.existsSync(poolPath)) {
|
|
247
|
+
result.skipped.push('subscription-pool interactive-ready: no pool store');
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
try {
|
|
251
|
+
const pool = new SubscriptionPool({ stateDir: this.config.stateDir });
|
|
252
|
+
const claudeAccounts = pool.list().filter((a) => a.framework === 'claude-code');
|
|
253
|
+
if (claudeAccounts.length === 0) {
|
|
254
|
+
result.skipped.push('subscription-pool interactive-ready: no claude-code accounts');
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
for (const acct of claudeAccounts) {
|
|
258
|
+
const ready = ensureInteractiveReady(acct.configHome, { requireExistingHome: true });
|
|
259
|
+
if (ready.patched) {
|
|
260
|
+
result.upgraded.push(`subscription-pool interactive-ready: ${acct.id} (${acct.configHome}) — ${ready.reason}`);
|
|
261
|
+
}
|
|
262
|
+
else if (ready.reason === 'already interactive-ready' ||
|
|
263
|
+
ready.reason.includes('does not exist')) {
|
|
264
|
+
result.skipped.push(`subscription-pool interactive-ready: ${acct.id} — ${ready.reason}`);
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
result.errors.push(`subscription-pool interactive-ready: ${acct.id} (${acct.configHome}) — ${ready.reason}`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
result.errors.push(`subscription-pool interactive-ready: ${err instanceof Error ? err.message : String(err)}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
222
275
|
/**
|
|
223
276
|
* Regenerate the boot wrapper when it predates the ABI-aware node
|
|
224
277
|
* self-heal (recurring-SQLite-bane fix).
|
|
@@ -7682,6 +7735,14 @@ echo "=== END IDENTITY RECOVERY ==="
|
|
|
7682
7735
|
// a doable fix citing "tail of tonight" at 3:41 PM). Unlike orphan-TODOs,
|
|
7683
7736
|
// this is NOT exempted by infrastructure-backing — tracking the work as a
|
|
7684
7737
|
// commitment does not legitimize the time-of-day framing; it launders it.
|
|
7738
|
+
// 5) An agent handing the MERGE decision for a PR IT AUTHORED back to the
|
|
7739
|
+
// operator — "the merge call is yours", "want me to merge?", "ready to
|
|
7740
|
+
// merge?", "your call on whether to merge" (incident 2026-06-09: presented
|
|
7741
|
+
// its own green PR #1040 as "the merge call is yours"). The operator
|
|
7742
|
+
// directed this must NEVER be a blocker: a self-authored green PR is the
|
|
7743
|
+
// agent's to merge, full stop (instar-dev Phase 7 — Auto-merge on green).
|
|
7744
|
+
// Like time/fatigue, NOT exempted by infrastructure-backing — having tracked
|
|
7745
|
+
// the PR does not make handing its merge to the operator legitimate.
|
|
7685
7746
|
//
|
|
7686
7747
|
// SIGNAL ONLY — this hook never blocks. The authority that can hold an
|
|
7687
7748
|
// outbound message is MessagingToneGate (B17_FALSE_BLOCKER).
|
|
@@ -7751,6 +7812,26 @@ process.stdin.on('end', () => {
|
|
|
7751
7812
|
{ re: /(?:defer|queue|leave|save|hold|push|punt) (?:it |this |that |them )?(?:to|for|till|until) (?:tomorrow|the morning|tonight|next session)/i, type: 'defer_to_later_time' },
|
|
7752
7813
|
];
|
|
7753
7814
|
|
|
7815
|
+
// Merge-deferral patterns — handing the MERGE decision for a PR the agent
|
|
7816
|
+
// authored back to the operator. The operator directed this must NEVER be a
|
|
7817
|
+
// blocker (2026-06-09): a self-authored green PR is the agent's to merge
|
|
7818
|
+
// (instar-dev Phase 7). Two shapes: (a) explicitly assigning the call to the
|
|
7819
|
+
// user ("the merge call is yours", "your call to merge"), and (b) asking
|
|
7820
|
+
// permission to merge one's own PR ("want me to merge?", "ready to merge?").
|
|
7821
|
+
// Like time/fatigue, these are NOT exempted by infrastructure-backing —
|
|
7822
|
+
// having tracked the PR does not legitimize handing its merge to the operator.
|
|
7823
|
+
const mergeDeferralPatterns = [
|
|
7824
|
+
// (a) Explicitly assigning the merge decision to the operator.
|
|
7825
|
+
{ re: /(?:the )?merge (?:call |decision )?(?:is |stays |remains |')?s? ?(?:yours|with you|the user'?s|the operator'?s)/i, type: 'merge_call_is_yours' },
|
|
7826
|
+
{ re: /your (?:the )?merge (?:call|decision)/i, type: 'your_merge_call' },
|
|
7827
|
+
{ re: /your (?:final )?call (?:on |to |whether |as to whether )?(?:to )?merge\\b/i, type: 'your_call_to_merge' },
|
|
7828
|
+
{ re: /(?:i'?ll |i will |i'?d |let me )?(?:leave|leaving|let) (?:the merge|you (?:to )?merge|it (?:to|with) you to merge)/i, type: 'leave_merge_to_you' },
|
|
7829
|
+
{ re: /(?:for |up to )you (?:to|whether to) merge\\b/i, type: 'up_to_you_to_merge' },
|
|
7830
|
+
{ re: /(?:merge|merging) (?:is |when )?(?:your|the user'?s|the operator'?s) (?:to (?:make|call|decide)|call|decision)/i, type: 'merge_is_yours_to_make' },
|
|
7831
|
+
// (b) Asking permission to merge one's OWN PR (instar-dev Phase 7 bans this).
|
|
7832
|
+
{ re: /(?:want me to|should i|shall i|ready to|ok to|okay to|good to|safe to|do you want me to|would you like me to) merge\\b/i, type: 'merge_permission_seeking' },
|
|
7833
|
+
];
|
|
7834
|
+
|
|
7754
7835
|
// Anti-trigger: messages that DO back the deferral with infrastructure
|
|
7755
7836
|
// get a pass — they are not orphan TODOs. The same message that mentions
|
|
7756
7837
|
// /schedule, /commit-action, a cron expression, or a tracked deadline
|
|
@@ -7785,7 +7866,12 @@ process.stdin.on('end', () => {
|
|
|
7785
7866
|
// regardless of whether the work was tracked.
|
|
7786
7867
|
const timeFatigueMatches = timeFatiguePatterns.filter(p => p.re.test(command));
|
|
7787
7868
|
|
|
7788
|
-
|
|
7869
|
+
// Merge-deferral is NOT exempted by infrastructure-backing either — handing
|
|
7870
|
+
// the merge of a self-authored PR to the operator is the gravity well
|
|
7871
|
+
// regardless of whether the PR was tracked.
|
|
7872
|
+
const mergeDeferralMatches = mergeDeferralPatterns.filter(p => p.re.test(command));
|
|
7873
|
+
|
|
7874
|
+
const allMatches = [...inabilityMatches, ...orphanMatches, ...timeFatigueMatches, ...mergeDeferralMatches];
|
|
7789
7875
|
if (allMatches.length === 0) process.exit(0);
|
|
7790
7876
|
|
|
7791
7877
|
const checklist = [];
|
|
@@ -7836,6 +7922,20 @@ process.stdin.on('end', () => {
|
|
|
7836
7922
|
);
|
|
7837
7923
|
}
|
|
7838
7924
|
|
|
7925
|
+
if (mergeDeferralMatches.length > 0) {
|
|
7926
|
+
if (checklist.length > 0) checklist.push('');
|
|
7927
|
+
checklist.push(
|
|
7928
|
+
'MERGE-DEFERRAL DETECTED — you are handing the merge decision back to the operator. For a PR YOU authored, that is never the operator\\'s call.',
|
|
7929
|
+
'',
|
|
7930
|
+
' 1. If this is your PR and CI is green, MERGE IT YOURSELF NOW — green CI = mergeable. Use "node scripts/safe-merge.mjs <PR#> --squash --admin" in the instar repo, or "gh pr merge <PR#> --squash" (add --admin if branch protection blocks an otherwise-green PR).',
|
|
7931
|
+
' 2. "want me to merge?" / "should I merge?" / "ready to merge?" / "the merge call is yours" for your own green PR is redundant ceremony that stalls delivery. The operator directed (2026-06-09) that merging a self-authored PR must NEVER be a blocker handed back to them.',
|
|
7932
|
+
' 3. Having TRACKED the PR (a commitment/issue) does NOT make handing its merge to the operator legitimate — that just launders the deferral.',
|
|
7933
|
+
' 4. The ONLY things that stop the merge: CI genuinely RED on this change (fix it + re-run), or it is SOMEONE ELSE\\'s PR (then asking is fine). An unrelated flake is re-run, not escalated.',
|
|
7934
|
+
'',
|
|
7935
|
+
'If it is your PR and green — do not ask, merge it.',
|
|
7936
|
+
);
|
|
7937
|
+
}
|
|
7938
|
+
|
|
7839
7939
|
checklist.push('', 'Detected: ' + allMatches.map(m => m.type).join(', '));
|
|
7840
7940
|
|
|
7841
7941
|
process.stdout.write(JSON.stringify({ decision: 'approve', additionalContext: checklist.join('\\n') }));
|