instar 1.3.344 → 1.3.346
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/commands/reflect.d.ts.map +1 -1
- package/dist/commands/reflect.js +7 -0
- package/dist/commands/reflect.js.map +1 -1
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +84 -8
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +64 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionManager.d.ts +130 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +510 -9
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/types.d.ts +70 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/messaging/SpawnRequestManager.d.ts +14 -0
- package/dist/messaging/SpawnRequestManager.d.ts.map +1 -1
- package/dist/messaging/SpawnRequestManager.js +17 -0
- package/dist/messaging/SpawnRequestManager.js.map +1 -1
- package/dist/monitoring/ApprenticeshipCycleStore.d.ts +59 -1
- package/dist/monitoring/ApprenticeshipCycleStore.d.ts.map +1 -1
- package/dist/monitoring/ApprenticeshipCycleStore.js +77 -2
- package/dist/monitoring/ApprenticeshipCycleStore.js.map +1 -1
- package/dist/monitoring/PresenceProxy.d.ts +8 -0
- package/dist/monitoring/PresenceProxy.d.ts.map +1 -1
- package/dist/monitoring/PresenceProxy.js +28 -9
- package/dist/monitoring/PresenceProxy.js.map +1 -1
- package/dist/monitoring/ReapLog.d.ts +6 -0
- package/dist/monitoring/ReapLog.d.ts.map +1 -1
- package/dist/monitoring/ReapLog.js +1 -0
- package/dist/monitoring/ReapLog.js.map +1 -1
- package/dist/monitoring/StuckSignatureClassifier.d.ts +52 -0
- package/dist/monitoring/StuckSignatureClassifier.d.ts.map +1 -0
- package/dist/monitoring/StuckSignatureClassifier.js +133 -0
- package/dist/monitoring/StuckSignatureClassifier.js.map +1 -0
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +2 -1
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/scheduler/JobScheduler.d.ts.map +1 -1
- package/dist/scheduler/JobScheduler.js +22 -0
- package/dist/scheduler/JobScheduler.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +10 -3
- package/dist/server/routes.js.map +1 -1
- package/dist/threadline/PipeSessionSpawner.d.ts +23 -0
- package/dist/threadline/PipeSessionSpawner.d.ts.map +1 -1
- package/dist/threadline/PipeSessionSpawner.js +27 -0
- package/dist/threadline/PipeSessionSpawner.js.map +1 -1
- package/package.json +2 -2
- package/scripts/lint-no-direct-destructive.js +3 -0
- package/scripts/lint-no-unfunneled-headless-launch.js +128 -0
- package/src/data/builtin-manifest.json +65 -65
- package/src/scaffold/templates.ts +2 -1
- package/upgrades/1.3.345.md +154 -0
- package/upgrades/1.3.346.md +57 -0
- package/upgrades/honest-turn-receipts.eli16.md +47 -0
- package/upgrades/side-effects/apprenticeship-layer-balance.md +50 -0
- package/upgrades/side-effects/honest-turn-receipts.md +90 -0
- package/upgrades/side-effects/june15-headless-spawn-reroute.md +105 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostUpdateMigrator.d.ts","sourceRoot":"","sources":["../../src/core/PostUpdateMigrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAsCH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AAejC,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,UA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qB;IAyN7B,OAAO,CAAC,6BAA6B;IAkLrC,OAAO,CAAC,0BAA0B;IAgClC,OAAO,CAAC,gBAAgB;IAmJxB,OAAO,CAAC,6BAA6B;CAoCtC"}
|
|
@@ -2774,11 +2774,26 @@ The standing program that each apprenticeship/mentorship instance plugs into (e.
|
|
|
2774
2774
|
- Transition status (the ONLY way it changes — runs the gate): \`POST /apprenticeship/instances/:id/transition\` \`{"to":"active"}\` (refused + 409 on a failed gate or illegal transition; \`complete\` is terminal). Preview without mutating: \`.../can-start\` · \`.../can-complete\`.
|
|
2775
2775
|
- Record a manual cycle: \`POST /apprenticeship/cycles\` with \`instanceId\`, positive \`cycleNumber\`, \`task\`, \`menteeOutput\`, optional \`mentorFlagged\` / \`overseerDifferential\` / \`coaching\` / \`infraItems\`, \`kind\` (\`mentor-mentee-differential\`, \`overseer-apprentice-devreview\`, \`overseer-mentee-direct\`), and \`channel\` (\`telegram-playwright\`, \`threadline-backup\`, \`direct-shortcut\`, \`unknown\`). A \`telegram-playwright\` cycle additionally REQUIRES a \`transcriptAudit\` block — \`{ topicIds, window: {start,end}, summary, findingDedupKeys, generatedAt, ledger: 'local'|'remote'|'dry-run'|'failed' }\` — built from \`instar dev:post-drive-transcript-audit\` run over the drive window (use \`--history-base-url\` when the transcript lives on the mentee's server; \`ledger:'local'\` claims are cross-checked against the real framework ledger). Use this when the overseer or manual loop found a differential outside the automated mentor tick.
|
|
2776
2776
|
- **When to use** (PROACTIVE): when starting or closing a mentorship/apprenticeship instance, drive it through the registry + transitions so the retro-harvest is reviewed before the next instance starts and the lessons are captured before this one closes — never track the lifecycle by memory.
|
|
2777
|
+
- Layer-balance health: \`GET /apprenticeship/instances/:id/role-coverage\` returns a \`keystoneBalance\` block — \`{ keystoneAxis, keystoneCycleCount, lastKeystoneAt, oversightSinceKeystone, starved, reason }\` — answering "is my deepest layer (the real mentor→mentee drive) actually firing, or have I drifted into just reviewing/overseeing?" \`starved:true\` = the mentee layer is under-firing relative to ongoing activity (the silent "mentor-heavy/mentee-light" drift). Observe-only; tune via \`?oversightStarvationThreshold=N\`. **When to use** (PROACTIVE): before deciding the loop is healthy — if starved, drive the mentee layer (a real \`mentor-mentee-differential\` cycle through the dogfooded channel), not another review.
|
|
2777
2778
|
`;
|
|
2778
2779
|
content += '\n' + apprenticeshipSection;
|
|
2779
2780
|
patched = true;
|
|
2780
2781
|
result.upgraded.push('CLAUDE.md: added Apprenticeship Program section');
|
|
2781
2782
|
}
|
|
2783
|
+
// Layer-balance signal (2026-06-06): agents that ALREADY carry the
|
|
2784
|
+
// Apprenticeship Program section need the keystoneBalance health line — an
|
|
2785
|
+
// agent that doesn't know to CHECK the balance can't notice the mentee
|
|
2786
|
+
// layer starving. Content-sniffed insertion; idempotent (only when the
|
|
2787
|
+
// section exists AND the line is absent).
|
|
2788
|
+
if (content.includes('**Apprenticeship Program**') && !content.includes('keystoneBalance')) {
|
|
2789
|
+
const anchor = '- **When to use** (PROACTIVE): when starting or closing a mentorship/apprenticeship instance, drive it through the registry + transitions so the retro-harvest is reviewed before the next instance starts and the lessons are captured before this one closes — never track the lifecycle by memory.';
|
|
2790
|
+
if (content.includes(anchor)) {
|
|
2791
|
+
const balanceLine = '\n- Layer-balance health: `GET /apprenticeship/instances/:id/role-coverage` returns a `keystoneBalance` block — `{ keystoneAxis, keystoneCycleCount, lastKeystoneAt, oversightSinceKeystone, starved, reason }` — answering "is my deepest layer (the real mentor→mentee drive) actually firing, or have I drifted into just reviewing/overseeing?" `starved:true` = the mentee layer is under-firing relative to ongoing activity (the silent "mentor-heavy/mentee-light" drift). Observe-only; tune via `?oversightStarvationThreshold=N`. **When to use** (PROACTIVE): before deciding the loop is healthy — if starved, drive the mentee layer (a real `mentor-mentee-differential` cycle through the dogfooded channel), not another review.';
|
|
2792
|
+
content = content.replace(anchor, anchor + balanceLine);
|
|
2793
|
+
patched = true;
|
|
2794
|
+
result.upgraded.push('CLAUDE.md: added apprenticeship layer-balance (keystoneBalance) awareness');
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2782
2797
|
// Transcript-audit gate (#864 follow-through): agents that ALREADY carry the
|
|
2783
2798
|
// Apprenticeship Program section have the pre-gate "Record a manual cycle"
|
|
2784
2799
|
// line, which no longer teaches the full required shape — telegram-playwright
|
|
@@ -2930,6 +2945,34 @@ Your internal background LLM calls (sentinels, gates, extractors) normally run a
|
|
|
2930
2945
|
patched = true;
|
|
2931
2946
|
result.upgraded.push('CLAUDE.md: added Anthropic Subscription-Path Routing (/providers/registry) awareness (provider-substrate-live-wiring)');
|
|
2932
2947
|
}
|
|
2948
|
+
// subscription-path SCOPE correction (june15-headless-spawn-reroute,
|
|
2949
|
+
// review finding F2): PR 1's block scoped the lever to "internal
|
|
2950
|
+
// background LLM calls" — after PR 2 the SAME mode key also reroutes
|
|
2951
|
+
// headless job / A2A / dispatch spawns, so the deployed wording is
|
|
2952
|
+
// factually incomplete. The PR-1 sniff ('/providers/registry') is
|
|
2953
|
+
// already satisfied on every deployed agent and CANNOT gate this patch —
|
|
2954
|
+
// sniff on the NEW phrase instead, and splice the corrected scope line
|
|
2955
|
+
// into the existing section. Idempotent: skips once the phrase exists.
|
|
2956
|
+
if (content.includes('/providers/registry') &&
|
|
2957
|
+
!content.includes('headless job / agent-to-agent / dispatch spawns')) {
|
|
2958
|
+
// PR 1 shipped TWO wordings: the migrator section said "routes them",
|
|
2959
|
+
// the fresh-init template said "can route them" — match either.
|
|
2960
|
+
const oldScopeSentences = [
|
|
2961
|
+
'Your internal background LLM calls (sentinels, gates, extractors) normally run as \`claude -p\` one-shots, which bill the Agent SDK credit pot after 2026-06-15. The subscription-path lever routes them through a pool of long-lived interactive Claude sessions instead — the path that keeps working when the pot is empty.',
|
|
2962
|
+
'Your internal background LLM calls (sentinels, gates, extractors) normally run as \`claude -p\` one-shots, which bill the Agent SDK credit pot after 2026-06-15. The subscription-path lever can route them through a pool of long-lived interactive Claude sessions instead — the path that keeps working when the pot is empty.',
|
|
2963
|
+
];
|
|
2964
|
+
const newScopeSentence = 'Your internal background LLM calls (sentinels, gates, extractors) AND your headless job / agent-to-agent / dispatch spawns normally run as \`claude -p\` one-shots, which bill the Agent SDK credit pot after 2026-06-15. The subscription-path lever routes BOTH through interactive Claude sessions instead — the path that keeps working when the pot is empty. (Rerouted job/A2A spawns run as normal interactive sessions with a completion marker, a concurrency cap, and quota backpressure — each session\'s \`launchLane\` in \`GET /sessions\` shows which billing lane it used.)';
|
|
2965
|
+
for (const oldScopeSentence of oldScopeSentences) {
|
|
2966
|
+
if (content.includes(oldScopeSentence)) {
|
|
2967
|
+
content = content.replace(oldScopeSentence, newScopeSentence);
|
|
2968
|
+
patched = true;
|
|
2969
|
+
result.upgraded.push('CLAUDE.md: corrected Subscription-Path Routing scope — lever now covers job/A2A/dispatch spawns too (june15-headless-spawn-reroute)');
|
|
2970
|
+
break;
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
// A hand-edited section that no longer carries either PR-1 sentence is
|
|
2974
|
+
// left untouched — never clobber user-customized wording.
|
|
2975
|
+
}
|
|
2933
2976
|
// session-clock (Agent Awareness + Migration Parity): existing agents must
|
|
2934
2977
|
// learn they can ask how long they've been running / how much is left,
|
|
2935
2978
|
// instead of guessing. Content-sniff on the route marker.
|
|
@@ -3115,6 +3158,27 @@ If a user asks "are my sentinels alerting?" or "why isn't the watchdog notifying
|
|
|
3115
3158
|
else {
|
|
3116
3159
|
result.skipped.push('CLAUDE.md: Sentinel Notifications section already present');
|
|
3117
3160
|
}
|
|
3161
|
+
// Honest turn-receipts — the standby (🔭) system now classifies a
|
|
3162
|
+
// live-but-failing session honestly instead of saying "actively working".
|
|
3163
|
+
// Tells the agent what the standby tells the user now + that stale
|
|
3164
|
+
// "conversation too long" noise is fixed. Idempotent via marker.
|
|
3165
|
+
if (!content.includes('Honest standby (turn-receipts)')) {
|
|
3166
|
+
const section = `
|
|
3167
|
+
## Honest standby (turn-receipts)
|
|
3168
|
+
|
|
3169
|
+
When a user message goes unanswered, the standby (🔭) system reports on the session. A session can be ALIVE (its process is running) yet failing every turn — rate-limited, stuck on a content-policy error, on a corrupted-context error, or out of context window. Previously the live process made the standby say "🔭 actively working" — a lie, the exact reason a user sees delivery receipts but no reply. The standby now classifies the session's LIVE tmux tail and surfaces the REAL reason instead: "I've hit the usage limit (resets …)", "my session got stuck on a content-policy error — resend your last message", etc. (\`StuckSignatureClassifier\`, tail-gated, signal-only — recovery still belongs to the sentinels, and when a sentinel already owns a session's recovery the standby stays silent so the user hears one voice).
|
|
3170
|
+
|
|
3171
|
+
The same change tail-gates the "conversation too long" check: it only fires when that is the session's LIVE state, not a stale mention scrolled up in the buffer (which previously fired as noise on healthy sessions).
|
|
3172
|
+
|
|
3173
|
+
If a user asks "why did I see 'actively working' when you were stuck?" or "why do those 'conversation too long' messages come up when nothing's wrong?" — explain the above: the standby is now honest about WHY a turn failed, and the stale-scrollback false signal is gone.
|
|
3174
|
+
`;
|
|
3175
|
+
content += '\n' + section;
|
|
3176
|
+
patched = true;
|
|
3177
|
+
result.upgraded.push('CLAUDE.md: added Honest standby (turn-receipts) section');
|
|
3178
|
+
}
|
|
3179
|
+
else {
|
|
3180
|
+
result.skipped.push('CLAUDE.md: Honest standby section already present');
|
|
3181
|
+
}
|
|
3118
3182
|
// Topic-Flood Guard (2026-05-28 lockdown) — the structural backstop that
|
|
3119
3183
|
// caps how many forum topics a single attention source may spawn. Without
|
|
3120
3184
|
// this section an agent asked "why are my notices grouped / where did topic
|