instar 1.3.304 → 1.3.306

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 (56) hide show
  1. package/dist/commands/init.d.ts.map +1 -1
  2. package/dist/commands/init.js +32 -30
  3. package/dist/commands/init.js.map +1 -1
  4. package/dist/core/Config.d.ts.map +1 -1
  5. package/dist/core/Config.js +2 -0
  6. package/dist/core/Config.js.map +1 -1
  7. package/dist/core/MessageSentinel.d.ts +11 -0
  8. package/dist/core/MessageSentinel.d.ts.map +1 -1
  9. package/dist/core/MessageSentinel.js +43 -1
  10. package/dist/core/MessageSentinel.js.map +1 -1
  11. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  12. package/dist/core/PostUpdateMigrator.js +6 -1
  13. package/dist/core/PostUpdateMigrator.js.map +1 -1
  14. package/dist/core/SessionManager.d.ts.map +1 -1
  15. package/dist/core/SessionManager.js +3 -0
  16. package/dist/core/SessionManager.js.map +1 -1
  17. package/dist/core/types.d.ts +4 -0
  18. package/dist/core/types.d.ts.map +1 -1
  19. package/dist/core/types.js.map +1 -1
  20. package/dist/scheduler/JobScheduler.d.ts.map +1 -1
  21. package/dist/scheduler/JobScheduler.js +10 -6
  22. package/dist/scheduler/JobScheduler.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/data/builtin-manifest.json +58 -58
  25. package/src/scaffold/templates/jobs/instar/commitment-detection.md +2 -1
  26. package/src/scaffold/templates/jobs/instar/correction-analyzer.md +5 -1
  27. package/src/scaffold/templates/jobs/instar/evolution-overdue-check.md +1 -1
  28. package/src/scaffold/templates/jobs/instar/evolution-proposal-evaluate.md +1 -1
  29. package/src/scaffold/templates/jobs/instar/evolution-proposal-implement.md +1 -1
  30. package/src/scaffold/templates/jobs/instar/failure-analyzer.md +5 -1
  31. package/src/scaffold/templates/jobs/instar/identity-review.md +5 -4
  32. package/src/scaffold/templates/jobs/instar/initiative-digest-review.md +3 -1
  33. package/src/scaffold/templates/jobs/instar/insight-harvest.md +1 -1
  34. package/src/scaffold/templates/jobs/instar/mentor-onboarding.md +7 -4
  35. package/src/scaffold/templates/jobs/instar/org-intent-drift-audit.md +6 -4
  36. package/src/scaffold/templates/jobs/instar/overseer-development.md +4 -1
  37. package/src/scaffold/templates/jobs/instar/overseer-guardian.md +4 -1
  38. package/src/scaffold/templates/jobs/instar/overseer-infrastructure.md +4 -1
  39. package/src/scaffold/templates/jobs/instar/overseer-learning.md +4 -1
  40. package/src/scaffold/templates/jobs/instar/overseer-maintenance.md +4 -1
  41. package/src/scaffold/templates/jobs/instar/release-readiness-check.md +2 -1
  42. package/src/templates/hooks/compaction-recovery.sh +11 -6
  43. package/src/templates/hooks/session-start.sh +11 -3
  44. package/src/templates/hooks/slack-channel-context.sh +5 -0
  45. package/src/templates/hooks/telegram-topic-context.sh +6 -0
  46. package/src/templates/scripts/emit-session-clock.sh +3 -3
  47. package/src/templates/scripts/imessage-reply.sh +10 -0
  48. package/src/templates/scripts/instar-watchdog.sh +12 -6
  49. package/src/templates/scripts/secret-drop-retrieve.mjs +10 -2
  50. package/src/templates/scripts/slack-reply.sh +5 -0
  51. package/src/templates/scripts/whatsapp-reply.sh +5 -0
  52. package/upgrades/1.3.305.md +20 -0
  53. package/upgrades/1.3.306.md +22 -0
  54. package/upgrades/sentinel-pause-length-guard.eli16.md +12 -0
  55. package/upgrades/side-effects/sentinel-pause-length-guard.md +43 -0
  56. package/upgrades/side-effects/template-agent-id-header.md +48 -0
@@ -0,0 +1,43 @@
1
+ # Side-Effects Review — MessageSentinel: long-message pause downgrade
2
+
3
+ **Version / slug:** `sentinel-pause-length-guard`
4
+ **Date:** `2026-06-05`
5
+ **Author:** `instar-echo`
6
+
7
+ ## Summary
8
+
9
+ New `downgradeLongPause()` applied to the LLM layer's result in `classify()`: a 'pause' classification on a message longer than `MAX_PAUSE_DIRECTIVE_WORDS` (25) becomes `normal`/pass-through, logged, with the original reason preserved inside the downgrade reason. Emergency-stop, redirect, and all short-message behavior unchanged.
10
+
11
+ ## Decision-point inventory
12
+
13
+ - `MAX_PAUSE_DIRECTIVE_WORDS` — added (25) — a genuine natural-language pause directive is well under this; the two live victims were ~200 words.
14
+ - `downgradeLongPause()` — added — pure function of (classification, message); only transforms `pause`.
15
+ - `classify()` LLM branch — modified — result passes through the guard. Fast path untouched (its 4-word gate already excludes long messages from patterns; slash commands are exact-match short).
16
+ - The forward-route intercept, pause action semantics, stats recording — untouched (stats record the post-downgrade category, which is the truthful one).
17
+
18
+ ## Direction of failure
19
+
20
+ - Old failure: a long task message classified 'pause' was CONSUMED — session paused, content destroyed, no trace in any queue/ledger (the delivery stack's only loss path with zero record).
21
+ - New behavior: long messages always deliver; only short messages can pause.
22
+ - Conservative failure direction: content is preserved. The worst new case is a user writing a >25-word pause request that now passes through as conversation — the session still RECEIVES it and can comply conversationally; nothing is destroyed. Compare old worst case: silent destruction of instructions.
23
+
24
+ ## Side-effects checklist
25
+
26
+ 1. **Over-deliver (missed pause):** a verbose pause directive (>25 words) no longer auto-pauses. Mitigations already in place: the message is delivered (the agent reads "please pause" and can stop itself), and /pause + short forms still work. Pause is politeness, not safety — the safety category (emergency-stop) is untouched.
27
+ 2. **Under-deliver:** none — no path consumes more than before.
28
+ 3. **Asymmetry justification:** emergency-stop on a long message remains possible by design (the prompt's own safety-first rule: better to stop unnecessarily than continue destructively). Length-gating it would trade safety for content; not taken.
29
+ 4. **Level-of-abstraction fit:** the guard lives in MessageSentinel (the classifier), not the forward route (the consumer) — every consumer of classify() (route intercept, TelegramAdapter.processUpdate, /sentinel/classify API) gets the same corrected verdict; no consumer-side divergence.
30
+ 5. **Signal vs authority:** the LLM keeps proposing; the structural gate bounds its authority over the destructive action. Exactly the signal-vs-authority pattern.
31
+ 6. **External surfaces:** `/sentinel/classify` responses for long pause-ish messages change category to `normal` with an explanatory reason — truthful, observable, and carried in `/metrics/features` stats as the post-guard category.
32
+ 7. **Rollback cost:** revert the commit; no state, config, or migration.
33
+
34
+ ## Scope not taken
35
+
36
+ - No change to emergency-stop classification (deliberate, documented asymmetry).
37
+ - No configurability of the 25-word ceiling (constant; make it config only if a real false-negative shows up).
38
+ - No retroactive recovery of the two eaten messages (both manually resent during diagnosis).
39
+ - No prompt changes (the prompt's guidance stays as a first line; the guard is the backstop).
40
+
41
+ ## Rollback
42
+
43
+ Revert the commit. Long messages classified 'pause' are consumed again.
@@ -0,0 +1,48 @@
1
+ # Side-Effects Review — Template Agent-ID Header
2
+
3
+ **Version / slug:** `template-agent-id-header`
4
+ **Date:** `2026-06-05`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary of the change
9
+
10
+ This change updates the fleet-installed local API client surface so bearer-authenticated template calls also send `X-Instar-AgentId`. It adds `INSTAR_AGENT_ID` env propagation from `Config` -> `JobScheduler` and `SessionManager`, updates built-in job templates, hook/script templates, and selected migrator inline hook content, and adds a template scanner regression test.
11
+
12
+ ## Decision-point inventory
13
+
14
+ No new decision point is added. Existing server auth remains the authority for missing/mismatched agent-id headers. This change only updates clients/templates to provide identity to that existing authority.
15
+
16
+ ## 1. Over-block
17
+
18
+ No block/allow surface is added. A malformed or missing `projectName` could make a template send an empty or wrong `X-Instar-AgentId`, which the existing server auth would reject. The normal paths use `config.projectName`, and direct-run fallbacks read the same field.
19
+
20
+ ## 2. Under-block
21
+
22
+ This does not remove the server's bearer-only compatibility window. A custom user-authored curl outside shipped templates can still be bearer-only and receive the deprecation warning until the server policy changes.
23
+
24
+ ## 3. Level-of-abstraction fit
25
+
26
+ The fix sits at the client/template layer. The server already owns auth authority and should not be weakened to hide template warnings. Scheduler/session env propagation is the right shared primitive for jobs and hooks.
27
+
28
+ ## 4. Signal vs authority compliance
29
+
30
+ Required reference: `docs/signal-vs-authority.md`
31
+
32
+ No brittle blocking authority is introduced. The change feeds identity into the existing deterministic auth authority; it does not add a new detector or gate.
33
+
34
+ ## 5. Interactions
35
+
36
+ The scheduler now injects `INSTAR_AGENT_ID` alongside `INSTAR_AUTH_TOKEN` for gate and script job shells. `SessionManager` injects the same variable for spawned sessions, so hook and prompt-job examples have it. Fleet watchdog peer requests read the peer project name and bind the peer token to the peer identity.
37
+
38
+ ## 6. External surfaces
39
+
40
+ Installed agents get quieter logs and future-compatible local API calls after template refresh/migration. No public API response shapes change. No persistent state is written.
41
+
42
+ ## 7. Rollback cost
43
+
44
+ Rollback is a source/template revert and patch release. Existing agents would fall back to the current accepted-but-deprecated bearer-only behavior until a corrected template ships.
45
+
46
+ ## Conclusion
47
+
48
+ Clear to ship as Tier 1. The change aligns installed templates with the existing auth contract and pins the class with a scanner test.