instar 1.3.290 → 1.3.292

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 (45) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +2 -0
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/types.d.ts +9 -0
  5. package/dist/core/types.d.ts.map +1 -1
  6. package/dist/core/types.js.map +1 -1
  7. package/dist/monitoring/PromptGate.d.ts +9 -0
  8. package/dist/monitoring/PromptGate.d.ts.map +1 -1
  9. package/dist/monitoring/PromptGate.js +29 -0
  10. package/dist/monitoring/PromptGate.js.map +1 -1
  11. package/dist/scheduler/AgentMdJobLoader.d.ts +3 -0
  12. package/dist/scheduler/AgentMdJobLoader.d.ts.map +1 -1
  13. package/dist/scheduler/AgentMdJobLoader.js +6 -0
  14. package/dist/scheduler/AgentMdJobLoader.js.map +1 -1
  15. package/dist/scheduler/InstallBuiltinJobs.d.ts.map +1 -1
  16. package/dist/scheduler/InstallBuiltinJobs.js +5 -0
  17. package/dist/scheduler/InstallBuiltinJobs.js.map +1 -1
  18. package/dist/scheduler/JobScheduler.d.ts.map +1 -1
  19. package/dist/scheduler/JobScheduler.js +5 -0
  20. package/dist/scheduler/JobScheduler.js.map +1 -1
  21. package/dist/scheduler/buildPerSlugManifest.d.ts +2 -0
  22. package/dist/scheduler/buildPerSlugManifest.d.ts.map +1 -1
  23. package/dist/scheduler/buildPerSlugManifest.js +2 -0
  24. package/dist/scheduler/buildPerSlugManifest.js.map +1 -1
  25. package/package.json +1 -1
  26. package/src/data/builtin-manifest.json +3 -3
  27. package/src/scaffold/templates/jobs/instar/commitment-detection.md +1 -0
  28. package/src/scaffold/templates/jobs/instar/correction-analyzer.md +1 -0
  29. package/src/scaffold/templates/jobs/instar/docs-coverage-audit.md +1 -0
  30. package/src/scaffold/templates/jobs/instar/evolution-overdue-check.md +1 -0
  31. package/src/scaffold/templates/jobs/instar/evolution-proposal-evaluate.md +1 -0
  32. package/src/scaffold/templates/jobs/instar/failure-analyzer.md +1 -0
  33. package/src/scaffold/templates/jobs/instar/health-check.md +1 -0
  34. package/src/scaffold/templates/jobs/instar/identity-review.md +1 -0
  35. package/src/scaffold/templates/jobs/instar/initiative-digest-review.md +1 -0
  36. package/src/scaffold/templates/jobs/instar/insight-harvest.md +1 -0
  37. package/src/scaffold/templates/jobs/instar/org-intent-drift-audit.md +1 -0
  38. package/src/scaffold/templates/jobs/instar/reflection-trigger.md +1 -0
  39. package/src/scaffold/templates/jobs/instar/relationship-maintenance.md +1 -0
  40. package/src/scaffold/templates/jobs/instar/release-readiness-check.md +1 -0
  41. package/upgrades/1.3.291.md +26 -0
  42. package/upgrades/1.3.292.md +22 -0
  43. package/upgrades/job-mcp-access.eli16.md +5 -0
  44. package/upgrades/side-effects/job-mcp-access.md +51 -0
  45. package/upgrades/side-effects/promptgate-auto-dismiss-memory.md +91 -0
@@ -14,6 +14,7 @@ tags:
14
14
  gate: "curl -sf -H \"Authorization: Bearer $INSTAR_AUTH_TOKEN\" http://localhost:${INSTAR_PORT:-4042}/evolution/proposals?status=proposed 2>/dev/null | python3 -c \"import sys,json; d=json.load(sys.stdin); exit(0 if len(d.get('proposals',[])) > 0 else 1)\""
15
15
  toolAllowlist: "*"
16
16
  unrestrictedTools: true
17
+ mcpAccess: none
17
18
  ---
18
19
  Review pending evolution proposals: curl -s http://localhost:${INSTAR_PORT:-4042}/evolution/proposals?status=proposed
19
20
 
@@ -12,6 +12,7 @@ tags:
12
12
  - audit
13
13
  toolAllowlist: "*"
14
14
  unrestrictedTools: true
15
+ mcpAccess: none
15
16
  ---
16
17
  Run the weekly Failure-Learning analysis. This job exists because individual failures get fixed and forgotten — this turns the accumulated, attributed record into process-level insight, and closes the loop all the way to a human-approved fix and a verification that the fix worked.
17
18
 
@@ -10,5 +10,6 @@ tags:
10
10
  - cat:guardian
11
11
  toolAllowlist: "*"
12
12
  unrestrictedTools: true
13
+ mcpAccess: none
13
14
  ---
14
15
  Run a quick health check: verify the instar server is responding (curl http://localhost:${INSTAR_PORT:-4042}/health), check disk space (df -h), and report any issues. Only send a message if something needs attention — silence means healthy. IMPORTANT: If you find issues, describe them in plain conversational language. Never dump raw JSON, field names, error codes, or structured data. The user reads these on their phone — write like you're texting them a quick heads-up. If the health response includes a degradationSummary array, relay those narrative strings directly.
@@ -13,6 +13,7 @@ tags:
13
13
  gate: curl -sf http://localhost:${INSTAR_PORT:-4042}/health >/dev/null 2>&1 && test -f .instar/soul.md
14
14
  toolAllowlist: "*"
15
15
  unrestrictedTools: true
16
+ mcpAccess: none
16
17
  ---
17
18
  Identity review — check your identity coherence and growth.
18
19
 
@@ -12,6 +12,7 @@ tags:
12
12
  - rollout
13
13
  toolAllowlist: "*"
14
14
  unrestrictedTools: true
15
+ mcpAccess: none
15
16
  ---
16
17
  You are running the twice-weekly initiative digest review (Mondays and Thursdays). This is the self-driving half of the InitiativeTracker: it makes sure nothing in flight stalls or is forgotten, and it drives ships-staged features toward default-on — without you (the human) ever having to remember. Be concise; post AT MOST one consolidated, conversational Telegram message, and only when there is genuinely something to decide.
17
18
 
@@ -12,6 +12,7 @@ tags:
12
12
  gate: "curl -sf -H \"Authorization: Bearer $INSTAR_AUTH_TOKEN\" http://localhost:${INSTAR_PORT:-4042}/evolution/learnings?applied=false 2>/dev/null | python3 -c \"import sys,json; d=json.load(sys.stdin); exit(0 if len(d.get('learnings',[])) > 0 else 1)\""
13
13
  toolAllowlist: "*"
14
14
  unrestrictedTools: true
15
+ mcpAccess: none
15
16
  ---
16
17
  Harvest and synthesize learnings: curl -s http://localhost:${INSTAR_PORT:-4042}/evolution/learnings?applied=false
17
18
 
@@ -12,6 +12,7 @@ tags:
12
12
  - org-intent
13
13
  toolAllowlist: "*"
14
14
  unrestrictedTools: true
15
+ mcpAccess: none
15
16
  ---
16
17
  Run a weekly drift audit against your organizational intent. This job exists because the per-message Coherence Gate from Phase 1 catches individual constraint violations, but it can't catch the slow accumulation of borderline-passing messages that collectively drift from intent. That's the Klarna failure mode — every individual review passes the gate's threshold, but the agent has gradually optimized for the wrong objective.
17
18
 
@@ -10,6 +10,7 @@ tags:
10
10
  - cat:learning
11
11
  toolAllowlist: "*"
12
12
  unrestrictedTools: true
13
+ mcpAccess: none
13
14
  ---
14
15
  AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json')).get('authToken',''))" 2>/dev/null)
15
16
 
@@ -12,5 +12,6 @@ tags:
12
12
  - exec:prompt
13
13
  toolAllowlist: "*"
14
14
  unrestrictedTools: true
15
+ mcpAccess: none
15
16
  ---
16
17
  Review all relationship files in .instar/relationships/. Note anyone you haven't heard from in over 2 weeks who has significance >= 3. If there are observations worth surfacing, report them. If everything looks fine, do nothing.
@@ -13,6 +13,7 @@ tags:
13
13
  gate: curl -sf http://localhost:${INSTAR_PORT:-4042}/health >/dev/null 2>&1
14
14
  toolAllowlist: "*"
15
15
  unrestrictedTools: true
16
+ mcpAccess: none
16
17
  ---
17
18
  Run the release-readiness check once. This is a mechanical, near-silent watchdog — do NOT message the user.
18
19
 
@@ -0,0 +1,26 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ Fixed PromptGate auto-dismiss repeats for deterministic prompts whose stale text remains visible in the terminal capture after the dismiss key is sent. PromptGate now records successful auto-dismisses separately from normal prompt dedup, keeps that memory across the input reset, and clears it only when the captured pane content changes.
9
+
10
+ The server records dismiss memory only when the key send reports success. Failed sends do not poison the cache, so a prompt can still be retried if the key was not delivered.
11
+
12
+ ## What to Tell Your User
13
+
14
+ - **Less repeated modal handling**: "When I dismiss a known-safe terminal prompt for another agent, I should stop pressing the same stale prompt every few seconds while the terminal catches up."
15
+
16
+ ## Summary of New Capabilities
17
+
18
+ | Capability | How to Use |
19
+ |-----------|-----------|
20
+ | PromptGate successful auto-dismiss memory | Automatic for deterministic auto-dismiss prompts such as known Gemini CLI modals. |
21
+
22
+ ## Evidence
23
+
24
+ Observed before: after PromptGate successfully auto-dismissed the Gemini package-runner install modal, the stale prompt text remained inside the capture window and PromptGate fired the same auto-dismiss again roughly every monitor cycle.
25
+
26
+ Observed after: focused PromptGate regression tests verify that a successfully auto-dismissed prompt does not re-fire while pane content is unchanged, that failed sends do not create dismiss memory, and that changed pane content re-arms the same prompt shape.
@@ -0,0 +1,22 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ `JobDefinition.mcpAccess?: 'project' | 'none'` flows frontmatter → InstallBuiltinJobs → per-slug manifest (validateManifest enforces the closed set) → JobScheduler.spawnJobSession → the existing `disableProjectMcp` spawn option (`--strict-mcp-config --mcp-config '{"mcpServers":{}}'`). Out-of-set frontmatter values fail safe to legacy at the installer and fail loud at manifest validation.
9
+
10
+ ## What to Tell Your User
11
+
12
+ Scheduled background jobs (like the every-5-minutes health check) now start faster and leaner: they no longer boot the project's full MCP toolset (browser automation, remote connectors) that they never use. Jobs that need MCP keep it; nothing changes for your own custom jobs.
13
+
14
+ ## Summary of New Capabilities
15
+
16
+ - `mcpAccess: none` in a job's frontmatter/manifest spawns its session with zero project MCP servers (claude-code spawns; reuses the proven mentor-loop no-MCP flag). `project` or absent = unchanged legacy behavior.
17
+ - 14 shipped utility jobs (health-check, commitment-detection, correction-analyzer, release-readiness-check, and friends) now declare it; the orchestration jobs (mentor/overseer/evolution-implement) deliberately keep full MCP this round.
18
+ - Existing agents pick the change up automatically on update — built-in job manifests regenerate from the shipped templates.
19
+
20
+ ## Evidence
21
+
22
+ Grounded census (2026-06-05, live box): 81 standing MCP processes across 14 long-lived sessions — every session boots the full project .mcp.json complement; 14 playwright-mcp nodes ≈1.75GB RSS while exactly ONE session actually drives a browser. Zero shipped job templates reference any MCP tool (grep `mcp__|threadline_|playwright|browser|chrome` across `src/scaffold/templates/jobs/instar/*.md` — no matches). The headless hang hazard this removes is the live-verified mentor-loop stall (~4.5 min at 0.1% CPU on auth-required remote MCP boot → ~9s with the flag, docs/specs/LOOP-SESSION-NO-MCP-SPEC.md). Pinned by `tests/unit/scheduler/job-mcp-access.test.ts` (20 tests: closed-set validation both sides, constructor pass-through/omission, installer derivation incl. typo fail-safe, loader round-trip onto JobDefinition, spawn plumbing all three states, and the 14-template declarations + orchestration-family exclusions); 145 adjacent loader/installer/scheduler/flag tests pass unchanged.
@@ -0,0 +1,5 @@
1
+ # Job sessions stop hauling browser tooling they never use
2
+
3
+ Every scheduled job (the health check, the commitment scan, and friends) runs as a small one-shot Claude session. Until now, every one of those sessions booted with the project's FULL set of MCP servers attached — the browser-automation server, remote connectors that need interactive login, all of it — even though the shipped jobs only ever use bash and curl. That's wasted startup time on every single run (the health check spawns every five minutes), extra standing processes on the box, and a known hazard: a remote MCP server that wants an interactive login can stall a headless session for minutes (this exact stall already bit the mentor loop once, and that fix is what we reuse here).
4
+
5
+ A job can now declare `mcpAccess: none` in its definition, which makes its session spawn with zero project MCP servers — the same proven no-MCP spawn flag the mentor loop already uses. Fourteen shipped utility jobs declare it; jobs that don't declare anything behave exactly as before, and any job that genuinely needs MCP just leaves the field off (or says `project`). The orchestration jobs that drive other sessions were deliberately left unchanged this round. A typo'd value never silently changes behavior: the installer treats it as undeclared, and a hand-written bad manifest fails loudly at validation.
@@ -0,0 +1,51 @@
1
+ # Side-Effects Review — per-job MCP access scoping (`mcpAccess`)
2
+
3
+ **Version / slug:** `job-mcp-access`
4
+ **Date:** `2026-06-05`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `self-review under the Tier-1 lite lane; the capability-loss question (does any job need MCP?) is addressed explicitly below`
7
+
8
+ ## Summary of the change
9
+
10
+ `JobDefinition.mcpAccess?: 'project' | 'none'`. When `'none'`, `spawnJobSession` passes the EXISTING `disableProjectMcp` option to `spawnSession` (shipped + verified by the mentor autonomous-fix loop, docs/specs/LOOP-SESSION-NO-MCP-SPEC.md), which emits `--strict-mcp-config --mcp-config '{"mcpServers":{}}'` on claude-code spawns and nothing on other frameworks. The field flows frontmatter → InstallBuiltinJobs → per-slug manifest → validateManifest → manifestToJobDefinition. 14 shipped utility templates declare `mcpAccess: none`.
11
+
12
+ ## Decision-point inventory
13
+
14
+ - `types.ts JobDefinition.mcpAccess` — add — optional, absent = legacy.
15
+ - `AgentMdJobLoader.ALLOWED_FRONTMATTER_KEYS` — modified — `mcpAccess` joins the closed-set whitelist (deliberate, per the set's own doc).
16
+ - `PerSlugManifest.mcpAccess` + `validateManifest` — add — closed two-value enum, loud throw otherwise.
17
+ - `buildPerSlugManifest` — modified — carries the field; omits the key when undefined.
18
+ - `InstallBuiltinJobs` — modified — derives from frontmatter; out-of-set values → undefined (fail-safe to legacy), then validateManifest re-checks the generated manifest.
19
+ - `JobScheduler.spawnJobSession` — modified — `disableProjectMcp: job.mcpAccess === 'none' ? true : undefined`.
20
+ - 14 templates — modified — `mcpAccess: none` added to frontmatter.
21
+
22
+ ## 1. Direction-of-failure analysis (capability loss)
23
+
24
+ The risk: a job whose body NEEDS an MCP tool gets spawned without MCP and fails mid-run.
25
+
26
+ - **Grounding:** zero shipped templates reference `mcp__*`, `threadline_*`, playwright, browser, or chrome (grep across `src/scaffold/templates/jobs/instar/*.md`). The marked 14 are bash/curl-only by construction.
27
+ - **Deliberately unmarked:** the orchestration family (`mentor-onboarding`, all `overseer-*`, `evolution-proposal-implement`) keeps project MCP — they drive sessions/build code and are the apprenticeship machinery; this slice does not touch their spawn behavior.
28
+ - **Custom/user jobs:** never affected — the field is opt-in and absent on every existing user job.
29
+ - **Worst NEW case:** a future template author marks a job `none` then writes a body that wants MCP — the session still runs (built-in tools work; MCP tools are simply absent), the job degrades visibly in its own output rather than hanging. That is strictly better than the current failure direction (auth-required remote MCP can hang the headless boot silently).
30
+
31
+ ## 2. Over-permit
32
+
33
+ None — the change only ever REMOVES servers from a spawn, never adds; and only for jobs that explicitly opt in.
34
+
35
+ ## 3. Scope deliberately NOT taken
36
+
37
+ - No default flip: absent stays legacy full-MCP. A future slice may flip instar-origin jobs by default after this one soaks.
38
+ - Topic/chat sessions untouched (capability matters there; the standing-cost problem for those is the idle-reap path, fixed separately by the meaningful-tail work).
39
+ - No per-job CUSTOM MCP subset (`--mcp-config` with a real server list) — only the binary none/project. Subset selection is a follow-up if a real job needs it.
40
+
41
+ ## 4. Migration parity
42
+
43
+ Built-in templates are re-installed by `installBuiltinJobs()` on every update via `refreshHooksAndSettings()`, and the per-slug manifests are REGENERATED from the templates — existing agents pick up the 14 `mcpAccess: none` declarations on their next update without a dedicated migration. Operator-disabled jobs keep their disabled state (existing `existingEnabled` preservation). No config/hook/skill/CLAUDE.md surface changes.
44
+
45
+ ## 5. Token/cost impact
46
+
47
+ Strictly negative (saves): every marked job spawn skips MCP server boot (playwright-mcp alone ≈125MB + node startup per spawn; health-check spawns 288×/day). No new LLM calls.
48
+
49
+ ## 6. Rollback
50
+
51
+ Revert the commit. Manifests regenerate without the field on the next install pass; spawns return to full-project-MCP.
@@ -0,0 +1,91 @@
1
+ # Side-Effects Review — PromptGate auto-dismiss memory
2
+
3
+ **Version / slug:** `promptgate-auto-dismiss-memory`
4
+ **Date:** `2026-06-05`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `self-review required by PromptGate/session-input surface; concur`
7
+
8
+ ## Summary of the change
9
+
10
+ PromptGate deterministic auto-dismiss prompts were repeatedly firing when the terminal kept the same dismissed prompt text visible after the dismiss key was sent. The server called `onInputSent()` after auto-dismiss to clear normal cooldown/dedup for the next real prompt, but that also allowed the identical stale prompt to re-emit. This change adds a separate in-memory successful-auto-dismiss cache in `src/monitoring/PromptGate.ts`, records into it from the auto-dismiss consumer in `src/commands/server.ts` only when `sendKey` returns true, and clears it when the captured pane content changes or the session is cleaned up.
11
+
12
+ ## Decision-point inventory
13
+
14
+ - PromptGate auto-dismiss emission — **modify** — suppresses a previously successful auto-dismiss fingerprint while the pane content is unchanged.
15
+ - Server auto-dismiss consumer — **modify** — records successful auto-dismisses in the detector before resetting normal input state.
16
+ - Normal prompt detection/dedup — **pass-through** — unchanged for prompts without `autoDismissKey`.
17
+ - LLM `NO_PROMPT` cache — **pass-through** — unchanged; this fix is separate from the prior token-burn cache.
18
+
19
+ ---
20
+
21
+ ## 1. Over-block
22
+
23
+ Legitimate repeated auto-dismiss prompts with byte-identical prompt text in byte-identical pane content will be suppressed until the pane content changes. That is intentional: if the pane has not changed after a successful key send, the visible prompt is stale terminal text, not a new modal. Failed key sends do not enter the cache, so delivery failures can still retry.
24
+
25
+ ---
26
+
27
+ ## 2. Under-block
28
+
29
+ If the terminal redraws the same prompt with any content change, the cache clears and PromptGate may auto-dismiss again. This is the intended re-arm boundary because a changed pane can represent a real new modal or a re-rendered still-blocking state. The change does not attempt cursor-position analysis; it uses the existing captured-text boundary.
30
+
31
+ ---
32
+
33
+ ## 3. Level-of-abstraction fit
34
+
35
+ The memory lives inside PromptGate because PromptGate owns prompt fingerprints and dedup semantics. The server remains the right place to decide whether the key send succeeded, so it records successful auto-dismisses after `sendKey` returns true. This avoids placing delivery-success knowledge inside the detector and avoids teaching the server how to fingerprint prompt text.
36
+
37
+ ---
38
+
39
+ ## 4. Signal vs authority compliance
40
+
41
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
42
+
43
+ - [ ] No — this change produces a signal consumed by an existing smart gate.
44
+ - [ ] No — this change has no block/allow surface.
45
+ - [x] Yes — but this is deterministic dedup/memoization of a prior successful deterministic auto-dismiss, not a brittle semantic classifier.
46
+ - [ ] Yes, with brittle logic — STOP. Reshape the design.
47
+
48
+ PromptGate already held authority to emit deterministic auto-dismiss prompts. This change narrows repeat emission for the exact prompt fingerprint after a successful key send. It does not add a new modal detector, approve any new action, or change LLM classification authority.
49
+
50
+ ---
51
+
52
+ ## 5. Interactions
53
+
54
+ - **Shadowing:** the successful-auto-dismiss cache runs before normal emitted-prompt dedup. It only applies when the match has `autoDismissKey`.
55
+ - **Double-fire:** reduces double-fire by preventing the same stale prompt from re-emitting after `onInputSent()` clears normal dedup.
56
+ - **Races:** if pane content changes before the next tick, the cache clears and the prompt can re-arm. If `sendKey` fails, no cache entry is recorded.
57
+ - **Feedback loops:** no persistent feedback loop. State is per-process and per-session.
58
+
59
+ ---
60
+
61
+ ## 6. External surfaces
62
+
63
+ Visible behavior changes for agents using PromptGate: repeated auto-dismiss log lines for the same unchanged stale prompt should stop. No API, config, persistent state, migration, Telegram route, dashboard route, or model behavior changes. The server log still records the original auto-dismiss with `sent=true/false`.
64
+
65
+ ---
66
+
67
+ ## 7. Rollback cost
68
+
69
+ Rollback is a pure code revert and patch release. No state migration or cleanup is needed because dismiss memory is in-memory only. During rollback, the prior repeated auto-dismiss behavior can return for stale terminal captures.
70
+
71
+ ---
72
+
73
+ ## Conclusion
74
+
75
+ The fix is narrow and tied to the observed failure: successful deterministic auto-dismisses now get a memory layer that survives the normal input reset and is invalidated by real pane-content changes. Focused tests cover successful suppression, failed-send retry, and re-arm on content change.
76
+
77
+ ---
78
+
79
+ ## Second-pass review
80
+
81
+ **Reviewer:** instar-codey self-review
82
+ **Independent read of the artifact:** concur
83
+
84
+ I re-read the change as a PromptGate/session-input reviewer. The main risk was suppressing a real prompt after a failed key send; recording only when `sendKey` returns true addresses that. The other risk was never re-arming; clearing on captured content change and cleanup bounds the memory.
85
+
86
+ ---
87
+
88
+ ## Evidence pointers
89
+
90
+ - Focused unit gate: `npx vitest run tests/unit/PromptGate.test.ts` — 62 tests passed.
91
+ - Regression cases added: successful auto-dismiss suppresses unchanged stale pane text; failed send does not suppress; changed pane content re-arms.