instar 1.3.248 → 1.3.250

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.
Files changed (34) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +18 -3
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/GeminiCliIntelligenceProvider.d.ts.map +1 -1
  5. package/dist/core/GeminiCliIntelligenceProvider.js +2 -0
  6. package/dist/core/GeminiCliIntelligenceProvider.js.map +1 -1
  7. package/dist/core/PostUpdateMigrator.d.ts +11 -0
  8. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  9. package/dist/core/PostUpdateMigrator.js +38 -1
  10. package/dist/core/PostUpdateMigrator.js.map +1 -1
  11. package/dist/core/intelligenceProviderFactory.d.ts +6 -0
  12. package/dist/core/intelligenceProviderFactory.d.ts.map +1 -1
  13. package/dist/core/intelligenceProviderFactory.js +1 -0
  14. package/dist/core/intelligenceProviderFactory.js.map +1 -1
  15. package/dist/core/types.d.ts +8 -0
  16. package/dist/core/types.d.ts.map +1 -1
  17. package/dist/core/types.js.map +1 -1
  18. package/dist/monitoring/QuotaCollector.d.ts +14 -0
  19. package/dist/monitoring/QuotaCollector.d.ts.map +1 -1
  20. package/dist/monitoring/QuotaCollector.js +16 -0
  21. package/dist/monitoring/QuotaCollector.js.map +1 -1
  22. package/dist/providers/adapters/gemini-cli/observability/geminiCapacityPolicy.d.ts +8 -0
  23. package/dist/providers/adapters/gemini-cli/observability/geminiCapacityPolicy.d.ts.map +1 -1
  24. package/dist/providers/adapters/gemini-cli/observability/geminiCapacityPolicy.js +46 -1
  25. package/dist/providers/adapters/gemini-cli/observability/geminiCapacityPolicy.js.map +1 -1
  26. package/dist/providers/adapters/gemini-cli/transport/oneShotCompletion.d.ts.map +1 -1
  27. package/dist/providers/adapters/gemini-cli/transport/oneShotCompletion.js +2 -0
  28. package/dist/providers/adapters/gemini-cli/transport/oneShotCompletion.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/data/builtin-manifest.json +19 -19
  31. package/upgrades/1.3.249.md +38 -0
  32. package/upgrades/1.3.250.md +39 -0
  33. package/upgrades/side-effects/gemini-quota-state-framework-aware.md +87 -0
  34. package/upgrades/side-effects/instar-dev-build-location-regrounding.md +85 -0
@@ -1 +1 @@
1
- {"version":3,"file":"geminiCapacityPolicy.d.ts","sourceRoot":"","sources":["../../../../../src/providers/adapters/gemini-cli/observability/geminiCapacityPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAWD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAajF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAoB9F;AAOD,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,0BAA0B,GAAG,SAAS,GAC7C,MAAM,CAIR;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC,GAAG,sBAAsB,CA8BzB;AAED,wBAAgB,qBAAqB,CAAC,GAAG,SAAa,GAAG,kBAAkB,CAU1E;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,kBAAkB,CAKrB;AAED,wBAAgB,iCAAiC,IAAI,IAAI,CAGxD"}
1
+ {"version":3,"file":"geminiCapacityPolicy.d.ts","sourceRoot":"","sources":["../../../../../src/providers/adapters/gemini-cli/observability/geminiCapacityPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAWD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAajF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAoB9F;AAOD,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,0BAA0B,GAAG,SAAS,GAC7C,MAAM,CAIR;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC,GAAG,sBAAsB,CA8BzB;AAED,wBAAgB,qBAAqB,CAAC,GAAG,SAAa,GAAG,kBAAkB,CAU1E;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,kBAAkB,CAsBrB;AAoCD,wBAAgB,iCAAiC,IAAI,IAAI,CAGxD"}
@@ -11,7 +11,10 @@
11
11
  * - later calls are refused locally while deferred, avoiding doomed subprocesses;
12
12
  * - fallback models must be in the verified Gemini model set.
13
13
  */
14
- import { isKnownGeminiModel } from '../models.js';
14
+ import { GEMINI_DEFAULT_MODEL, isKnownGeminiModel } from '../models.js';
15
+ import fs from 'node:fs';
16
+ import path from 'node:path';
17
+ import { SafeFsExecutor } from '../../../../core/SafeFsExecutor.js';
15
18
  const DEFAULT_IMMEDIATE_RETRIES = 1;
16
19
  const DEFAULT_IMMEDIATE_RETRY_MAX_MS = 30_000;
17
20
  const DEFAULT_BACKOFF_MS = 5_000;
@@ -102,8 +105,50 @@ export function recordGeminiCapacityDeferral(params) {
102
105
  const now = params.now ?? Date.now();
103
106
  deferredUntil = now + Math.max(1, params.retryAfterMs) + RESET_GRACE_MS;
104
107
  deferredReason = params.reason;
108
+ if (params.quotaStateFile) {
109
+ try {
110
+ writeGeminiQuotaState({
111
+ quotaStateFile: params.quotaStateFile,
112
+ blockedUntil: deferredUntil,
113
+ reason: params.reason,
114
+ model: params.model ?? GEMINI_DEFAULT_MODEL,
115
+ now,
116
+ });
117
+ }
118
+ catch (err) {
119
+ console.warn(`[gemini-capacity-policy] failed to persist quota state: ${err instanceof Error ? err.message : String(err)}`);
120
+ }
121
+ }
105
122
  return getGeminiCapacityGate(now);
106
123
  }
124
+ function writeGeminiQuotaState(params) {
125
+ const state = {
126
+ usagePercent: 0,
127
+ fiveHourPercent: 100,
128
+ source: 'gemini-cli-capacity',
129
+ model: params.model,
130
+ blockedUntil: new Date(params.blockedUntil).toISOString(),
131
+ blockReason: params.reason,
132
+ lastUpdated: new Date(params.now).toISOString(),
133
+ recommendation: 'stop',
134
+ };
135
+ const dir = path.dirname(params.quotaStateFile);
136
+ fs.mkdirSync(dir, { recursive: true });
137
+ const tmp = `${params.quotaStateFile}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
138
+ try {
139
+ fs.writeFileSync(tmp, JSON.stringify(state, null, 2));
140
+ fs.renameSync(tmp, params.quotaStateFile);
141
+ }
142
+ catch (err) {
143
+ try {
144
+ SafeFsExecutor.safeUnlinkSync(tmp, {
145
+ operation: 'geminiCapacityPolicy.writeGeminiQuotaState.cleanup',
146
+ });
147
+ }
148
+ catch { /* best-effort cleanup */ }
149
+ throw err;
150
+ }
151
+ }
107
152
  export function resetGeminiCapacityPolicyForTests() {
108
153
  deferredUntil = 0;
109
154
  deferredReason = null;
@@ -1 +1 @@
1
- {"version":3,"file":"geminiCapacityPolicy.js","sourceRoot":"","sources":["../../../../../src/providers/adapters/gemini-cli/observability/geminiCapacityPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAwB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AA8BxE,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAC9C,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,wBAAwB,GAAG,EAAE,GAAG,MAAM,CAAC;AAC7C,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,IAAI,cAAc,GAAkB,IAAI,CAAC;AAEzC,MAAM,UAAU,qBAAqB,CAAC,OAAkC;IACtE,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAChC,OAAO,CACL,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACjB,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAC7B,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAChC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAChC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7B,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAC/B,6BAA6B,CAAC,IAAI,CAAC,CAAC,CAAC,CACtC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAkC;IACxE,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,CAAC,GAAG,OAAO,CAA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Y,EAAE,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7E,CAAC;IACD,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,aAAa,GAAG,GAAG;QACjC,aAAa;QACb,MAAM,EAAE,cAAc;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,MAI5C;IACC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;IACrC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,cAAc,CAAC;IACxE,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,iCAAiC;IAC/C,aAAa,GAAG,CAAC,CAAC;IAClB,cAAc,GAAG,IAAI,CAAC;AACxB,CAAC"}
1
+ {"version":3,"file":"geminiCapacityPolicy.js","sourceRoot":"","sources":["../../../../../src/providers/adapters/gemini-cli/observability/geminiCapacityPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAoCpE,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAC9C,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,wBAAwB,GAAG,EAAE,GAAG,MAAM,CAAC;AAC7C,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,IAAI,cAAc,GAA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Aa,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACtD,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC;YACH,cAAc,CAAC,cAAc,CAAC,GAAG,EAAE;gBACjC,SAAS,EAAE,oDAAoD;aAChE,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CAAC;QACrC,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iCAAiC;IAC/C,aAAa,GAAG,CAAC,CAAC;IAClB,cAAc,GAAG,IAAI,CAAC;AACxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"oneShotCompletion.d.ts","sourceRoot":"","sources":["../../../../../src/providers/adapters/gemini-cli/transport/oneShotCompletion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,oDAAoD,CAAC;AAG5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA4HpD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB,CAElF"}
1
+ {"version":3,"file":"oneShotCompletion.d.ts","sourceRoot":"","sources":["../../../../../src/providers/adapters/gemini-cli/transport/oneShotCompletion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,oDAAoD,CAAC;AAG5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA8HpD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB,CAElF"}
@@ -80,6 +80,8 @@ class GeminiCliOneShotCompletion {
80
80
  recordGeminiCapacityDeferral({
81
81
  retryAfterMs: capacity.retryAfterMs,
82
82
  reason: capacity.reason ?? mapped.message,
83
+ model: currentModel,
84
+ quotaStateFile: this.config.capacityPolicy?.quotaStateFile,
83
85
  });
84
86
  throw new QuotaError(`${capacity.reason}: ${mapped.message}`, GEMINI_CLI_ID, { retryAfterMs: capacity.retryAfterMs, limitKind: 'unknown', cause: mapped });
85
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oneShotCompletion.js","sourceRoot":"","sources":["../../../../../src/providers/adapters/gemini-cli/transport/oneShotCompletion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAEhF,MAAM,0BAA0B;IAGD;IAFpB,UAAU,GAAG,cAAc,CAAC,iBAAiB,CAAC;IAEvD,YAA6B,MAAuB;QAAvB,WAAM,GAAN,MAAM,CAAiB;IAAG,CAAC;IAExD,KAAK,CAAC,QAAQ,CACZ,MAAc,EACd,OAAkC;QAElC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,uBAAuB,IAAI,MAAM,CAAC;QACtF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,CAAC;wBACH,MAAM,IAAI,UAAU,CAClB,GAAG,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE,EACvC,aAAa,EACb,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAC7E,CAAC;oBACJ,CAAC;oBACD,MAAM,MAAM,CAAC;gBACf,CAAC;gBACD,OAAO;oBACL,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;oBAC1B,KAAK,EAAE,IAAI;oBACX,gBAAgB,EAAE;wBAChB,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE;qBACjF;iBACF,CAAC;YACF,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,UAAU;gBAAE,MAAM,GAAG,CAAC;YACzC,MAAM,KAAK,GAAG,GAA+B,CAAC;YAC9C,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC;gBACxD,MAAM,IAAI,UAAU,CAAC,0BAA0B,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;YACvE,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,CAAE,KAA8B,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;YACpE,MAAM,YAAY,CAChB,KAKC,EACD,MAAM,CACP,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAuB;IAC7D,OAAO,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"}
1
+ {"version":3,"file":"oneShotCompletion.js","sourceRoot":"","sources":["../../../../../src/providers/adapters/gemini-cli/transport/oneShotCompletion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,EAAE,c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oBAC1B,KAAK,EAAE,IAAI;oBACX,gBAAgB,EAAE;wBAChB,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE;qBACjF;iBACF,CAAC;YACF,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,UAAU;gBAAE,MAAM,GAAG,CAAC;YACzC,MAAM,KAAK,GAAG,GAA+B,CAAC;YAC9C,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC;gBACxD,MAAM,IAAI,UAAU,CAAC,0BAA0B,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;YACvE,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,CAAE,KAA8B,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;YACpE,MAAM,YAAY,CAChB,KAKC,EACD,MAAM,CACP,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAuB;IAC7D,OAAO,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.248",
3
+ "version": "1.3.250",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-04T21:08:49.274Z",
5
- "instarVersion": "1.3.248",
4
+ "generatedAt": "2026-06-04T21:48:43.306Z",
5
+ "instarVersion": "1.3.250",
6
6
  "entryCount": 198,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -11,7 +11,7 @@
11
11
  "domain": "identity",
12
12
  "sourcePath": "src/core/PostUpdateMigrator.ts",
13
13
  "installedPath": ".instar/hooks/instar/session-start.sh",
14
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
14
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
15
15
  "since": "2025-01-01"
16
16
  },
17
17
  "hook:dangerous-command-guard": {
@@ -20,7 +20,7 @@
20
20
  "domain": "safety",
21
21
  "sourcePath": "src/core/PostUpdateMigrator.ts",
22
22
  "installedPath": ".instar/hooks/instar/dangerous-command-guard.sh",
23
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
23
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
24
24
  "since": "2025-01-01"
25
25
  },
26
26
  "hook:grounding-before-messaging": {
@@ -29,7 +29,7 @@
29
29
  "domain": "safety",
30
30
  "sourcePath": "src/core/PostUpdateMigrator.ts",
31
31
  "installedPath": ".instar/hooks/instar/grounding-before-messaging.sh",
32
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
32
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
33
33
  "since": "2025-01-01"
34
34
  },
35
35
  "hook:compaction-recovery": {
@@ -38,7 +38,7 @@
38
38
  "domain": "identity",
39
39
  "sourcePath": "src/core/PostUpdateMigrator.ts",
40
40
  "installedPath": ".instar/hooks/instar/compaction-recovery.sh",
41
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
41
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
42
42
  "since": "2025-01-01"
43
43
  },
44
44
  "hook:external-operation-gate": {
@@ -47,7 +47,7 @@
47
47
  "domain": "safety",
48
48
  "sourcePath": "src/core/PostUpdateMigrator.ts",
49
49
  "installedPath": ".instar/hooks/instar/external-operation-gate.js",
50
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
50
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
51
51
  "since": "2025-01-01"
52
52
  },
53
53
  "hook:deferral-detector": {
@@ -56,7 +56,7 @@
56
56
  "domain": "safety",
57
57
  "sourcePath": "src/core/PostUpdateMigrator.ts",
58
58
  "installedPath": ".instar/hooks/instar/deferral-detector.js",
59
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
59
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
60
60
  "since": "2025-01-01"
61
61
  },
62
62
  "hook:self-stop-guard": {
@@ -65,7 +65,7 @@
65
65
  "domain": "coherence",
66
66
  "sourcePath": "src/core/PostUpdateMigrator.ts",
67
67
  "installedPath": ".instar/hooks/instar/self-stop-guard.js",
68
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
68
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
69
69
  "since": "2025-01-01"
70
70
  },
71
71
  "hook:post-action-reflection": {
@@ -74,7 +74,7 @@
74
74
  "domain": "evolution",
75
75
  "sourcePath": "src/core/PostUpdateMigrator.ts",
76
76
  "installedPath": ".instar/hooks/instar/post-action-reflection.js",
77
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
77
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
78
78
  "since": "2025-01-01"
79
79
  },
80
80
  "hook:external-communication-guard": {
@@ -83,7 +83,7 @@
83
83
  "domain": "safety",
84
84
  "sourcePath": "src/core/PostUpdateMigrator.ts",
85
85
  "installedPath": ".instar/hooks/instar/external-communication-guard.js",
86
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
86
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
87
87
  "since": "2025-01-01"
88
88
  },
89
89
  "hook:scope-coherence-collector": {
@@ -92,7 +92,7 @@
92
92
  "domain": "coherence",
93
93
  "sourcePath": "src/core/PostUpdateMigrator.ts",
94
94
  "installedPath": ".instar/hooks/instar/scope-coherence-collector.js",
95
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
95
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
96
96
  "since": "2025-01-01"
97
97
  },
98
98
  "hook:scope-coherence-checkpoint": {
@@ -101,7 +101,7 @@
101
101
  "domain": "coherence",
102
102
  "sourcePath": "src/core/PostUpdateMigrator.ts",
103
103
  "installedPath": ".instar/hooks/instar/scope-coherence-checkpoint.js",
104
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
104
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
105
105
  "since": "2025-01-01"
106
106
  },
107
107
  "hook:free-text-guard": {
@@ -110,7 +110,7 @@
110
110
  "domain": "safety",
111
111
  "sourcePath": "src/core/PostUpdateMigrator.ts",
112
112
  "installedPath": ".instar/hooks/instar/free-text-guard.sh",
113
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
113
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
114
114
  "since": "2025-01-01"
115
115
  },
116
116
  "hook:claim-intercept": {
@@ -119,7 +119,7 @@
119
119
  "domain": "coherence",
120
120
  "sourcePath": "src/core/PostUpdateMigrator.ts",
121
121
  "installedPath": ".instar/hooks/instar/claim-intercept.js",
122
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
122
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
123
123
  "since": "2025-01-01"
124
124
  },
125
125
  "hook:claim-intercept-response": {
@@ -128,7 +128,7 @@
128
128
  "domain": "coherence",
129
129
  "sourcePath": "src/core/PostUpdateMigrator.ts",
130
130
  "installedPath": ".instar/hooks/instar/claim-intercept-response.js",
131
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
131
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
132
132
  "since": "2025-01-01"
133
133
  },
134
134
  "hook:stop-gate-router": {
@@ -137,7 +137,7 @@
137
137
  "domain": "safety",
138
138
  "sourcePath": "src/core/PostUpdateMigrator.ts",
139
139
  "installedPath": ".instar/hooks/instar/stop-gate-router.js",
140
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
140
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
141
141
  "since": "2025-01-01"
142
142
  },
143
143
  "hook:auto-approve-permissions": {
@@ -146,7 +146,7 @@
146
146
  "domain": "safety",
147
147
  "sourcePath": "src/core/PostUpdateMigrator.ts",
148
148
  "installedPath": ".instar/hooks/instar/auto-approve-permissions.js",
149
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
149
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
150
150
  "since": "2025-01-01"
151
151
  },
152
152
  "job:health-check": {
@@ -1530,7 +1530,7 @@
1530
1530
  "type": "subsystem",
1531
1531
  "domain": "updates",
1532
1532
  "sourcePath": "src/core/PostUpdateMigrator.ts",
1533
- "contentHash": "4a7c91baa7cade8a07bfa1c7abf0669511fcf6fc07791403944aede1691567e2",
1533
+ "contentHash": "58605bd8699812a0274a4e2cf6b017ab280a0d32a3a771b28ab603fbaea28e1a",
1534
1534
  "since": "2025-01-01"
1535
1535
  },
1536
1536
  "subsystem:scheduler": {
@@ -0,0 +1,38 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ Gemini quota-state reporting is now framework-aware. Gemini agents no longer run
9
+ the Claude/Anthropic quota collector, so they cannot accidentally display Claude
10
+ usage as Gemini usage. When Gemini CLI itself reports a long model capacity reset,
11
+ the Gemini adapter now writes a Gemini-authored stop-state into the existing quota
12
+ file with source, model, reset-window, and reason metadata. That lets the
13
+ scheduler see the same live capacity block the CLI enforced instead of repeatedly
14
+ spawning doomed Gemini work.
15
+
16
+ ## What to Tell Your User
17
+
18
+ When Gemini is throttled, I now treat the live Gemini CLI limit as the reliable
19
+ signal and stop showing unrelated Claude quota as if it were Gemini's quota. That
20
+ means fewer misleading "looks available" moments when Gemini itself is actually
21
+ waiting for a reset.
22
+
23
+ ## Summary of New Capabilities
24
+
25
+ | Capability | How to Use |
26
+ |-----------|-----------|
27
+ | Gemini quota-state attribution | Automatic. Gemini agents skip Claude quota collection and persist live Gemini CLI capacity blocks into the existing quota gate. |
28
+
29
+ ## Evidence
30
+
31
+ The bug was reproduced during the Codey to Gemini mentorship loop: the quota
32
+ state showed 15% usage, but a live Gemini CLI spawn reported a usage limit for
33
+ the active Gemini model. Source tracing on current main showed the 15% value came
34
+ from the Claude-specific quota collector, while Gemini capacity deferrals only
35
+ lived in memory. After this change, focused unit, integration, and E2E tests
36
+ verify that Gemini capacity deferrals persist a Gemini-authored quota stop-state
37
+ and that the existing quota tracker blocks future low-priority spawns from that
38
+ state.
@@ -0,0 +1,39 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ The instar-dev workflow now requires a build-location re-grounding step during
9
+ Phase 2 planning. Before writing code, the agent must confirm it is building in
10
+ a fresh worktree off current `JKHeadley/main`, verify the git remote, and verify
11
+ the package version. If it uses a fresh clone fallback, it must also set the
12
+ local agent git identity immediately so commits do not fall back to the
13
+ operator's global git config. PostUpdateMigrator backfills this updated skill
14
+ text into existing dev agents when their installed instar-dev skill still
15
+ matches the stock copy.
16
+
17
+ ## What to Tell Your User
18
+
19
+ I added a structural checkpoint to the Instar development workflow so a restarted
20
+ agent is less likely to build from an old checkout. It now has to prove it is
21
+ working from current main before changing source, and fresh-clone fallbacks must
22
+ set agent commit identity before writing code.
23
+
24
+ ## Summary of New Capabilities
25
+
26
+ | Capability | How to Use |
27
+ |-----------|-----------|
28
+ | instar-dev build-location re-grounding | Automatic in the instar-dev workflow; existing stock dev-agent skill files are updated on the next agent update. |
29
+
30
+ ## Evidence
31
+
32
+ The failure was reproduced operationally during mentor onboarding: a respawned
33
+ session built a fleet PR from an old agent-home checkout instead of current
34
+ `JKHeadley/instar`. During this PR, the fresh-clone fallback also exposed a git
35
+ identity gap: without local agent identity, commits fell back to the operator's
36
+ global git config. The fix was dogfooded from a fresh current-main checkout.
37
+ Focused PostUpdateMigrator skill-migration tests verify stock update including
38
+ the identity warning, idempotency, customized-skill preservation, and
39
+ missing-skill no-op behavior.
@@ -0,0 +1,87 @@
1
+ # Side-Effects Review — Gemini quota state framework awareness
2
+
3
+ **Version / slug:** `gemini-quota-state-framework-aware`
4
+ **Date:** `2026-06-04`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary of the change
9
+
10
+ This change fixes the Gemini quota-state mismatch found during the Codey to Gemini mentorship loop. The server no longer starts the Claude-specific quota collector for non-Claude frameworks, so Gemini agents cannot write Anthropic usage into their own quota state. The Gemini CLI capacity policy now persists long CLI-reported capacity blocks into the existing quota-state file, with source/model/reset metadata, so the existing spawn gate sees the same block the Gemini CLI reported. The change touches server wiring, the intelligence provider factory, Gemini live/registry capacity handling, the shared quota state type, the Claude quota collector's source attribution, and focused unit/integration/E2E tests.
11
+
12
+ ## Decision-point inventory
13
+
14
+ - Server quota collector startup — modify — framework-aware: Claude collector starts only for `claude-code`; Gemini/Codex skip until a native usage meter exists.
15
+ - Gemini capacity policy — modify — persists provider capacity deferrals into quota state as a stop recommendation.
16
+ - Quota spawn gate — pass-through — continues to consume `QuotaState`; this change feeds it a Gemini-authored stop-state instead of changing its authority logic.
17
+ - Intelligence source labeling — modify — reports Gemini CLI as Gemini CLI, not Claude CLI subscription.
18
+
19
+ ---
20
+
21
+ ## 1. Over-block
22
+
23
+ Gemini can now write `fiveHourPercent: 100` when the CLI reports a long reset window, which causes the existing quota gate to block low-priority spawns until the reset window passes. A false-positive Gemini CLI error parse could therefore pause Gemini work that might otherwise have succeeded. The parser already distinguishes short retryable capacity failures from long deferrals, and the persisted state is written only after the Gemini capacity classifier chooses `defer`.
24
+
25
+ ---
26
+
27
+ ## 2. Under-block
28
+
29
+ This does not implement a full native Gemini usage meter. If Gemini is near quota but has not yet produced a CLI capacity error, the quota file may still not forecast that future limit. It also does not parse every possible future Gemini/Antigravity wording; it persists the capacity signal only when the existing Gemini classifier recognizes the error as a long quota/capacity reset.
30
+
31
+ ---
32
+
33
+ ## 3. Level-of-abstraction fit
34
+
35
+ The change stays at the framework boundary. Claude usage collection remains in the Claude collector. Gemini capacity persistence happens in the Gemini adapter's capacity policy, where the live CLI error and selected model are available. The existing quota tracker remains the authority for spawn decisions; the Gemini policy produces a framework-specific signal in the format that authority already consumes.
36
+
37
+ ---
38
+
39
+ ## 4. Signal vs authority compliance
40
+
41
+ - [x] No — this change produces a signal consumed by an existing smart gate.
42
+
43
+ The only blocking authority remains the existing quota tracker/spawn gate. The Gemini adapter writes a provider-authored state snapshot when the CLI reports a long capacity block. The deterministic part is limited to translating that provider signal into existing quota-state fields; it does not introduce a parallel block/allow gate.
44
+
45
+ ---
46
+
47
+ ## 5. Interactions
48
+
49
+ - **Shadowing:** Skipping `QuotaCollector` for Gemini removes the previous Claude-specific writer. For Gemini, the new writer only fires after a live CLI capacity failure, so it does not shadow a native Gemini usage meter because none exists in this codebase.
50
+ - **Double-fire:** Claude agents still use the Anthropic collector. Gemini agents write quota state from the capacity policy. A future native Gemini usage meter will need to coordinate with this writer, but today's framework guard prevents Claude and Gemini writers from competing on the same agent.
51
+ - **Races:** The quota-state write is atomic via temp file plus rename. Write failures are logged and fail open so the original CLI quota error is preserved.
52
+ - **Feedback loops:** A persisted Gemini stop-state makes future scheduler/spawn checks stop earlier instead of repeatedly invoking the already-blocked CLI. The state is reset by the existing quota-state lifecycle after the configured window/next successful collection path.
53
+
54
+ ---
55
+
56
+ ## 6. External surfaces
57
+
58
+ Other agents see a quieter and more accurate quota state. Gemini-only agents no longer display Claude/Anthropic usage as their own quota. Persistent state gains optional metadata fields: source, model, blockedUntil, and blockReason. Existing readers tolerate optional fields because the required quota fields remain unchanged. The user-visible effect is that Gemini throttling should be reported as Gemini CLI capacity rather than as a misleading low usage percentage from another provider.
59
+
60
+ ---
61
+
62
+ ## 7. Rollback cost
63
+
64
+ Rollback is a normal code revert. Persisted Gemini quota-state files may retain the optional metadata fields after rollback, but existing code ignores unknown optional fields and still reads the required percentage/timestamp/recommendation values. If a bad persisted stop-state blocks Gemini after rollback, deleting or refreshing that agent's quota-state file clears it; no database migration is involved.
65
+
66
+ ---
67
+
68
+ ## Conclusion
69
+
70
+ The review kept authority in the existing quota gate and moved provider-specific observation to the provider boundary. The main residual gap is deliberate: this is not a complete Gemini usage meter, only correct attribution plus persistence of live CLI capacity blocks. Focused unit, integration, E2E, and typecheck coverage exercise the factory wiring, both Gemini capacity paths, persisted stop-state shape, and quota gate consumption.
71
+
72
+ ---
73
+
74
+ ## Second-pass review (if required)
75
+
76
+ **Reviewer:** not required
77
+ **Independent read of the artifact:** not required
78
+
79
+ Tier-2 implementation against the approved Gemini runtime-adapter spec; no separate second-pass reviewer was required for this scoped fix.
80
+
81
+ ---
82
+
83
+ ## Evidence pointers
84
+
85
+ - Focused Gemini capacity unit/integration/E2E tests passed.
86
+ - TypeScript typecheck passed.
87
+ - Additional quota-manager and quota-collection tests are run before push.
@@ -0,0 +1,85 @@
1
+ # Side-Effects Review — instar-dev build-location re-grounding
2
+
3
+ **Version / slug:** `instar-dev-build-location-regrounding`
4
+ **Date:** `2026-06-04`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary of the change
9
+
10
+ This change hardens the instar-dev workflow against a mentor-onboarding failure mode: a respawned agent built a fleet PR from a stale agent-home checkout instead of current `JKHeadley/instar` main. Phase 2 of the instar-dev skill now requires an explicit build-location re-grounding plan item before code edits: confirm a fresh current-main worktree, verify the remote, and verify the package version. If the agent uses a fresh clone fallback instead of `instar worktree create`, it must immediately set the local agent git identity so commits do not fall back to the operator's global git config. PostUpdateMigrator backfills existing deployed instar-dev skills by content-sniffing for the new marker and replacing only stock skill copies; customized skill text is left untouched.
11
+
12
+ ## Decision-point inventory
13
+
14
+ - `/instar-dev` Phase 2 planning checklist — modify — adds a required self-verification step before build execution, including agent git identity setup for fresh-clone fallbacks.
15
+ - `PostUpdateMigrator` built-in skill migration — modify — updates deployed stock instar-dev skill files during agent update.
16
+ - Commit/push gates — pass-through — unchanged; they continue to enforce side-effects/release metadata after this workflow step has grounded the checkout.
17
+
18
+ ---
19
+
20
+ ## 1. Over-block
21
+
22
+ The skill now requires a planning statement even for small instar-dev changes. That can feel redundant when the agent is already visibly in a correct worktree, but it is intentionally cheap and does not block via code; the enforcement is procedural text plus review artifacts. The migrator only overwrites installed instar-dev skill files that still match the stock fingerprint, so a customized local workflow is not clobbered.
23
+
24
+ ---
25
+
26
+ ## 2. Under-block
27
+
28
+ This does not make a hard shell gate that rejects stale checkouts or misattributed git identity. An agent could still ignore the skill text or lie in the plan, but the expected workflow now requires the check at the right point, and the plan/review trail makes omissions visible. A future stronger gate could validate branch ancestry and local git identity automatically, but this PR focuses on the requested structural skill and migration layer.
29
+
30
+ ---
31
+
32
+ ## 3. Level-of-abstraction fit
33
+
34
+ The change belongs in Phase 2 because that is the last explicit planning checkpoint before `/build` starts edits. It also belongs in PostUpdateMigrator because the instar-dev skill is an agent-installed built-in file; updating only the package copy would leave existing agents on stale instructions.
35
+
36
+ ---
37
+
38
+ ## 4. Signal vs authority compliance
39
+
40
+ - [x] No — this change produces a planning requirement and migration update, not a brittle block/allow authority.
41
+
42
+ No new runtime authority is introduced. The skill text creates a required human/agent-visible checkpoint. PostUpdateMigrator makes the checkpoint available to existing agents but does not make build-location decisions.
43
+
44
+ ---
45
+
46
+ ## 5. Interactions
47
+
48
+ - **Shadowing:** The new checklist item complements the existing worktree convention and pre-commit gates. It does not replace them.
49
+ - **Double-fire:** Fresh installs receive the updated bundled skill; existing installs receive the same text once through the migrator. The marker makes repeated runs no-op.
50
+ - **Races:** The migrator performs a single local file write during update. If the file is already customized or already current, it skips.
51
+ - **Feedback loops:** The change reduces the chance of stale-repo fixes generating follow-up CI/PR cleanup loops.
52
+
53
+ ---
54
+
55
+ ## 6. External surfaces
56
+
57
+ Existing dev agents will see updated instar-dev skill text after update if their installed copy is stock. This is intentionally fleet-visible because the bug came from a respawned development agent. End users do not invoke instar-dev; the surface is limited to infrastructure-development agents and their installed skill files.
58
+
59
+ ---
60
+
61
+ ## 7. Rollback cost
62
+
63
+ Rollback is a normal code revert. Agents that already received the updated skill text would keep a harmless extra planning checklist item until a later migration rewrites it. No persistent database migration is involved.
64
+
65
+ ---
66
+
67
+ ## Conclusion
68
+
69
+ The review confirms the right fix layer is the workflow body plus migration parity, not another ad hoc reminder in a transcript. The remaining gap is deliberate: this PR does not add an automatic stale-checkout or git-identity blocker. It makes the grounding step required and fleet-distributed, with tests covering update, idempotency, customization preservation, and missing-skill no-op behavior.
70
+
71
+ ---
72
+
73
+ ## Second-pass review (if required)
74
+
75
+ **Reviewer:** not required
76
+ **Independent read of the artifact:** not required
77
+
78
+ This changes a dev skill and migration path but does not alter session lifecycle, messaging gates, sentinels, or runtime block/allow logic.
79
+
80
+ ---
81
+
82
+ ## Evidence pointers
83
+
84
+ - Focused PostUpdateMigrator built-in skill migration tests passed.
85
+ - TypeScript typecheck passed.