instar 0.28.47 → 0.28.49

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 (44) hide show
  1. package/README.md +3 -0
  2. package/dist/cli.js +0 -0
  3. package/dist/commands/init.js +19 -19
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/commands/server.js +1 -1
  6. package/dist/commands/server.js.map +1 -1
  7. package/dist/core/Config.d.ts.map +1 -1
  8. package/dist/core/Config.js +3 -0
  9. package/dist/core/Config.js.map +1 -1
  10. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  11. package/dist/core/PostUpdateMigrator.js +15 -7
  12. package/dist/core/PostUpdateMigrator.js.map +1 -1
  13. package/dist/core/SessionManager.d.ts.map +1 -1
  14. package/dist/core/SessionManager.js +14 -2
  15. package/dist/core/SessionManager.js.map +1 -1
  16. package/dist/core/types.d.ts +6 -0
  17. package/dist/core/types.d.ts.map +1 -1
  18. package/dist/core/types.js.map +1 -1
  19. package/dist/memory/TopicMemory.d.ts +18 -3
  20. package/dist/memory/TopicMemory.d.ts.map +1 -1
  21. package/dist/memory/TopicMemory.js +71 -11
  22. package/dist/memory/TopicMemory.js.map +1 -1
  23. package/dist/messaging/imessage/IMessageAdapter.d.ts +35 -0
  24. package/dist/messaging/imessage/IMessageAdapter.d.ts.map +1 -1
  25. package/dist/messaging/imessage/IMessageAdapter.js +121 -1
  26. package/dist/messaging/imessage/IMessageAdapter.js.map +1 -1
  27. package/dist/messaging/imessage/types.d.ts +33 -0
  28. package/dist/messaging/imessage/types.d.ts.map +1 -1
  29. package/dist/scheduler/JobScheduler.d.ts.map +1 -1
  30. package/dist/scheduler/JobScheduler.js +8 -0
  31. package/dist/scheduler/JobScheduler.js.map +1 -1
  32. package/dist/server/routes.d.ts.map +1 -1
  33. package/dist/server/routes.js +9 -3
  34. package/dist/server/routes.js.map +1 -1
  35. package/package.json +1 -1
  36. package/scripts/attachments-sync/go.mod +8 -0
  37. package/scripts/attachments-sync/go.sum +4 -0
  38. package/scripts/attachments-sync/main.go +253 -0
  39. package/scripts/setup-imessage-hardlink.sh +73 -0
  40. package/src/data/builtin-manifest.json +93 -93
  41. package/upgrades/0.28.49.md +52 -0
  42. package/upgrades/side-effects/0.28.48.md +90 -0
  43. package/upgrades/NEXT.md +0 -53
  44. /package/upgrades/side-effects/{0.28.47-reflection-trigger-signal.md → 0.28.47.md} +0 -0
@@ -0,0 +1,52 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: patch -->
4
+
5
+ ## What Changed
6
+
7
+ The job scheduler now injects `$INSTAR_AUTH_TOKEN` into the environment of any
8
+ gate shell it runs when `scheduler.authToken` is configured. Four built-in
9
+ gate scripts (evolution-proposal-evaluate, evolution-proposal-implement,
10
+ evolution-overdue-check, insight-harvest) have been updated to send
11
+ `Authorization: Bearer $INSTAR_AUTH_TOKEN` with their curl calls to the local
12
+ Instar HTTP API.
13
+
14
+ Previously these gates curled `http://127.0.0.1:4041/evolution/...` without
15
+ authentication. `authMiddleware` returned 401, the downstream
16
+ `python3 -c 'json.load(stdin)'` crashed on invalid JSON, and the job was
17
+ skipped every cycle with no error surface. The fix is additive: when
18
+ `authToken` is unset the env var is absent and gates remain identical to
19
+ their prior behavior; when it IS set (the default post-`instar init` state)
20
+ the four affected gates begin succeeding immediately on next scheduler tick.
21
+
22
+ A new optional field `authToken?: string` was added to `JobSchedulerConfig`,
23
+ wired through from `instar.json` via `Config.ts`. No migration required.
24
+
25
+ ## What to Tell Your User
26
+
27
+ - **Evolution pipeline unblocked**: "Your evolution jobs start firing real work again — proposal evaluation, proposal implementation, overdue-check, and insight harvesting have all been silently skipping every cycle, and this release fixes that."
28
+
29
+ ## Summary of New Capabilities
30
+
31
+ | Capability | How to Use |
32
+ |-----------|-----------|
33
+ | Authenticated gate calls | automatic — gates inherit auth token from scheduler config |
34
+ | Evolution proposal evaluation | automatic — fires on scheduler tick when proposals queued |
35
+ | Evolution proposal implementation | automatic — fires on scheduler tick when proposals approved |
36
+ | Overdue action check | automatic — fires on scheduler tick when actions overdue |
37
+ | Insight harvest | automatic — fires on scheduler tick when learnings accumulated |
38
+
39
+ ## Evidence
40
+
41
+ Reproduction: on any instance with `authToken` configured (default post-
42
+ `instar init`), tail `logs/job-scheduler.log` for an evolution job's next
43
+ scheduled tick. Before fix: gate execution stderr contains
44
+ `json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`
45
+ or a silent 10s timeout, and the job is skipped with no command execution.
46
+ After fix: gate logs show `HTTP/1.1 200 OK` from the authenticated
47
+ localhost call, gate returns 0, command proceeds.
48
+
49
+ Verified in unit tests: `tests/unit/JobScheduler.test.ts` — 2 new tests
50
+ assert the env var is present when authToken configured (`token=<value>`)
51
+ and absent when unset (`token=`), exercising both branches. All 47 tests
52
+ in the scheduler suite pass.
@@ -0,0 +1,90 @@
1
+ # 0.28.48 — Evolution Gate Auth Injection
2
+
3
+ ## What Changed
4
+
5
+ Four built-in gate scripts that call the local Instar HTTP API now receive an
6
+ `$INSTAR_AUTH_TOKEN` environment variable when the scheduler runs them, and
7
+ send `Authorization: Bearer $INSTAR_AUTH_TOKEN` with their curl requests.
8
+
9
+ Affected gates: `evolution-proposal-evaluate`, `evolution-proposal-implement`,
10
+ `evolution-overdue-check`, `insight-harvest`.
11
+
12
+ Behind it: `JobScheduler.runGateAsync()` now builds a per-call env object,
13
+ merging `process.env` with `INSTAR_AUTH_TOKEN` when `scheduler.authToken` is
14
+ configured. `JobSchedulerConfig` gained an optional `authToken` field, wired
15
+ up from `instar.json` via `Config.ts`.
16
+
17
+ ## Why
18
+
19
+ Three evolution jobs (`evolution-proposal-evaluate`,
20
+ `evolution-proposal-implement`, `evolution-overdue-check`) plus insight-harvest
21
+ were silently failing every gate check: they curled a localhost endpoint,
22
+ `authMiddleware` returned 401, and the downstream `python3 -c 'json.load(...)'`
23
+ crashed on invalid JSON. The job was then skipped — every cycle, no error
24
+ surface, no telemetry signal other than "this job never does anything."
25
+
26
+ The research cluster
27
+ `cluster-evolution-pipeline-jobs-permanently-skip-gate-scripts-missin` traced
28
+ this to the missing Authorization header and proposed the env-var injection
29
+ pattern.
30
+
31
+ ## Side-Effects Review
32
+
33
+ ### Intended
34
+ - Gates that depend on authenticated localhost endpoints now succeed when an
35
+ `authToken` is configured.
36
+ - Four evolution-pipeline jobs begin firing actual work on next scheduler tick.
37
+
38
+ ### Unintended — Risks Considered
39
+
40
+ **Env leak.** The auth token is exposed to gate shell commands via environment
41
+ variable. Any gate command inherits it. Gate commands are defined in
42
+ `src/commands/init.ts` (built-in) or `instar.json` (user-defined). In a
43
+ single-user local deployment the scope is identical to `process.env` — a gate
44
+ already has full shell access to the machine. No elevation.
45
+
46
+ **Gates that don't need auth.** Unaffected. The env var is present but unused
47
+ when the gate doesn't reference it. Curl without a bearer header still hits
48
+ allowlisted endpoints (`/health`, `/ping`) without issue.
49
+
50
+ **Configs without authToken.** The env var is not set. Gates that reference
51
+ `$INSTAR_AUTH_TOKEN` send `Authorization: Bearer ` (empty bearer), which
52
+ `authMiddleware` treats as unauthorized — same as before. No regression, no
53
+ new failure mode. Public-mode deployments still work because they don't have
54
+ `authToken` configured and the server doesn't require one.
55
+
56
+ **Token visibility in process listings.** `ps -eE` on Linux can expose
57
+ environment variables of running processes. The token is only present in the
58
+ gate child process for the duration of the gate (<10s, enforced by timeout).
59
+ The same token is already in `instar.json` on disk; `ps` leakage is a lesser
60
+ exposure than filesystem read.
61
+
62
+ ### Not Unintended
63
+ - No breaking change for users without `authToken` configured.
64
+ - No schema migration — `JobSchedulerConfig.authToken` is optional.
65
+ - No change to gate timing, retry semantics, or failure-handling.
66
+ - No change to non-gate code paths (the token is only injected in
67
+ `runGateAsync`, not in `runCommandAsync` or the main job command execution).
68
+
69
+ ## Compatibility
70
+
71
+ - Backwards compatible. Existing `instar.json` without `authToken` unchanged
72
+ behavior.
73
+ - Forwards compatible. When `instar init` runs, it generates `instar.json`
74
+ with a fresh `authToken`, so new installations work out of the box.
75
+
76
+ ## Verification Artifacts
77
+
78
+ - Build: `npm run build` — passes (tsc clean + manifest regenerated).
79
+ - Tests: `npm test -- JobScheduler.test.ts` — 47 tests pass including 2 new:
80
+ 1. Gate sees `token=<configured-value>` when `authToken` is set.
81
+ 2. Gate sees empty `token=` when `authToken` is unset.
82
+ - Manual: built-in manifest shows 4 updated gate definitions with the
83
+ Authorization header.
84
+
85
+ ## Summary of New Capabilities
86
+
87
+ Evolution pipeline jobs and insight-harvest now run to completion when an
88
+ auth token is configured — which is the default post-`instar init` state.
89
+ Previously-silent failures become visible work. No new user-facing commands
90
+ or config fields beyond the documented optional `authToken`.
package/upgrades/NEXT.md DELETED
@@ -1,53 +0,0 @@
1
- # Upgrade Guide — vNEXT
2
-
3
- <!-- bump: patch -->
4
- <!-- Valid values: patch, minor, major -->
5
- <!-- patch = bug fixes, refactors, test additions, doc updates -->
6
- <!-- minor = new features, new APIs, new capabilities (backwards-compatible) -->
7
- <!-- major = breaking changes to existing APIs or behavior -->
8
-
9
- ## What Changed
10
-
11
- <!-- Describe what changed technically. What new features, APIs, behavioral changes? -->
12
- <!-- Write this for the AGENT — they need to understand the system deeply. -->
13
-
14
- ## What to Tell Your User
15
-
16
- <!-- Write talking points the agent should relay to their user. -->
17
- <!-- This should be warm, conversational, user-facing — not a changelog. -->
18
- <!-- Focus on what THEY can now do, not internal plumbing. -->
19
- <!-- -->
20
- <!-- PROHIBITED in this section (will fail validation): -->
21
- <!-- camelCase config keys: silentReject, maxRetries, telegramNotify -->
22
- <!-- Inline code backtick references like silentReject: false -->
23
- <!-- Fenced code blocks -->
24
- <!-- Instructions to edit files or run commands -->
25
- <!-- -->
26
- <!-- CORRECT style: "I can turn that on for you" not "set X to false" -->
27
- <!-- The agent relays this to their user — keep it human. -->
28
-
29
- - **[Feature name]**: "[Brief, friendly description of what this means for the user]"
30
-
31
- ## Summary of New Capabilities
32
-
33
- | Capability | How to Use |
34
- |-----------|-----------|
35
- | [Capability] | [Endpoint, command, or "automatic"] |
36
-
37
- ## Evidence
38
-
39
- <!-- REQUIRED if this release claims to fix a bug. -->
40
- <!-- Unit tests passing is NOT evidence. Provide ONE of: -->
41
- <!-- (a) Reproduction steps + observed before/after on a live system. -->
42
- <!-- Include log excerpts, observed command output, or behavior -->
43
- <!-- description. Make it specific enough that a future reader can -->
44
- <!-- re-run it and see the same thing. -->
45
- <!-- (b) "Not reproducible in dev — [concrete reason]" if the failure -->
46
- <!-- mode truly can't be exercised locally (race conditions, -->
47
- <!-- event-driven paths requiring external signals, etc). -->
48
- <!-- -->
49
- <!-- If this release doesn't claim a bug fix (pure feature / refactor), -->
50
- <!-- leave this section blank or delete it — it's only enforced when -->
51
- <!-- "What Changed" describes a fix. -->
52
-
53
- [Describe reproduction + verified fix, OR "Not reproducible in dev — [concrete reason]"]