instar 1.3.388 → 1.3.390
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/core/InstarWorktreeManager.d.ts +15 -0
- package/dist/core/InstarWorktreeManager.d.ts.map +1 -1
- package/dist/core/InstarWorktreeManager.js +42 -0
- package/dist/core/InstarWorktreeManager.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +13 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +25 -1
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/server/PeerStreamProxy.d.ts +104 -0
- package/dist/server/PeerStreamProxy.d.ts.map +1 -0
- package/dist/server/PeerStreamProxy.js +270 -0
- package/dist/server/PeerStreamProxy.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +19 -19
- package/upgrades/1.3.389.md +45 -0
- package/upgrades/1.3.390.md +50 -0
- package/upgrades/side-effects/agent-data-spotlight-exclusion.md +46 -0
- package/upgrades/side-effects/dashboard-stream-phase1-proxy.md +61 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Side-Effects Review - Agent runtime-data Spotlight exclusion
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `agent-data-spotlight-exclusion`
|
|
4
|
+
**Date:** `2026-06-06`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Second-pass reviewer:** `not required (Tier 1)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Extends Instar's existing macOS Spotlight exclusion (currently covers `.worktrees/` #588, `node_modules/` #606, and Claude transcripts #903) to the agent's OWN runtime data dir (`<agentHome>/.instar/`). On a box pinned at load average 30 (2026-06-06, Justin's resource investigation), grounding showed the top CPU consumers were `mediaanalysisd` (~72-78% — analyzing the agent's `telegram-images/`) and `mds_stores`/Spotlight (~28-48% — re-indexing the constantly-rewritten `server-data/` SQLite dbs, `logs/`, `state/`). These were the remaining unexcluded churn source. Adds `ensureAgentDataSpotlightExclusion()` (reuses the generic marker-dropper) + a `PostUpdateMigrator` backfill, and gitignores the two runtime dirs that weren't already ignored.
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
- `ensureAgentDataSpotlightExclusion(stateDir)` (new, exported) — drops `.metadata_never_index` in each existing high-churn subdir (`telegram-images`, `server-data`, `logs`, `state`); returns the list created. Reuses `ensureWorktreeSpotlightExclusion` (the dir-agnostic dropper).
|
|
15
|
+
- `PostUpdateMigrator.migrateAgentDataSpotlightExclusion` (new, private) — runs the helper on every update, pushes an `upgraded`/`errors` entry.
|
|
16
|
+
- Wired into the migrate() sequence right after `migrateClaudeTranscriptSpotlightExclusion`.
|
|
17
|
+
- `.gitignore` — adds `.instar/telegram-images/` and `.instar/server-data/` (per-machine runtime data; `logs/`, `state/`, `telegram-inbound/` were already ignored).
|
|
18
|
+
|
|
19
|
+
## 1. Behavior change / gating
|
|
20
|
+
|
|
21
|
+
NONE that affects message flow, sessions, or any gate. The only effect is writing empty marker files into the agent's own `.instar/` data subdirs, telling macOS Spotlight + mediaanalysisd to stop indexing them. No runtime behavior of the agent changes; instar's own reads of these dirs (TokenLedger, server-data DBs, log tailing) are filesystem reads, unaffected by Spotlight indexing.
|
|
22
|
+
|
|
23
|
+
## 2. Over/under-signal
|
|
24
|
+
|
|
25
|
+
N/A — not a signal/gate. The only "decision" is whether each subdir exists (drop the marker) or not (skip). Both branches are covered by tests.
|
|
26
|
+
|
|
27
|
+
## 3. Blast radius
|
|
28
|
+
|
|
29
|
+
Filesystem only, additive, and scoped ENTIRELY INSIDE the agent's own `<agentHome>/.instar/` — unlike #903 it never reaches outside the agent home. Writes up to four empty marker files. No state mutation, no data migration, no config change. On a non-macOS host the markers are inert. The `.gitignore` additions only prevent committing per-machine runtime data (which was never intended to be committed).
|
|
30
|
+
|
|
31
|
+
## 4. Failure modes
|
|
32
|
+
|
|
33
|
+
The underlying `ensureWorktreeSpotlightExclusion` swallows write errors (`@silent-fallback-ok`) and returns false — a failed marker write just means Spotlight keeps indexing (status quo), and can never block the migration or an update. `existsSync` guards each absent subdir (brand-new agent with no data yet → returns `[]`). No throw path.
|
|
34
|
+
|
|
35
|
+
## 5. Migration parity
|
|
36
|
+
|
|
37
|
+
Covered: the `PostUpdateMigrator` backfill means existing agents get the markers on their next update (fast release cadence drops them within minutes). New agents get them once the subdirs exist. No agent-installed config/hooks/skills/CLAUDE.md change — this is internal OS hygiene with no agent-facing surface, consistent with the precedent (#588/#606/#903 also have no CLAUDE.md template line; they are not capabilities the agent surfaces to a user). No init-path call is needed because the data subdirs don't exist at init time — it would no-op; the migration is the correct single mechanism.
|
|
38
|
+
|
|
39
|
+
## 6. Scope honesty (what this is NOT)
|
|
40
|
+
|
|
41
|
+
- One fix in the resource-efficiency initiative (Justin, 2026-06-06). The marker prevents FUTURE indexing/analysis; it does NOT instantly drop `mediaanalysisd`/`mds_stores` — macOS releases already-indexed content on its own schedule, and an immediate purge needs a one-time `sudo mdutil -E` the operator runs (instar cannot run sudo). The durable guarantee is that no agent keeps feeding the churn.
|
|
42
|
+
- Does NOT address the ~300 accumulated worktrees (~100GB) — that is the AgentWorktreeReaper's job, gated separately on operator approval because it deletes checkouts.
|
|
43
|
+
|
|
44
|
+
## 7. Causal autopsy
|
|
45
|
+
|
|
46
|
+
Origin: **latent** (not a prior-PR regression). The agent's `.instar/` runtime data (images, DBs, logs, state) has been indexed by macOS since agents began writing it. The prior Spotlight-exclusion PRs (#588 worktrees, #606 node_modules, #903 transcripts) progressively closed the largest known trees but never extended to the agent's own data dir — which 2026-06-06 grounding (`ps`/`uptime` census during the load-30 incident) showed was the live `mediaanalysisd` + `mds_stores` fuel via `telegram-images/` and `server-data/`. This PR closes that latent gap by reusing the same marker mechanism. No behavior was broken by a prior change; an existing cost was simply never excluded.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Side-Effects Review — Pool dashboard streaming phase 1 (PeerStreamProxy)
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `dashboard-stream-phase1-proxy`
|
|
4
|
+
**Date:** `2026-06-06`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Second-pass reviewer:** `not required`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
A NEW, self-contained module (`PeerStreamProxy`) — phase 1 of the converged
|
|
11
|
+
POOL-DASHBOARD-STREAM-SPEC. The per-peer upstream relay state machine, with all
|
|
12
|
+
external surfaces (transport, timers, clock) injected. NOT wired into the live
|
|
13
|
+
WebSocketManager or server boot in this phase, so it has zero runtime effect
|
|
14
|
+
until phase 2 consumes it.
|
|
15
|
+
|
|
16
|
+
## Decision-point inventory
|
|
17
|
+
|
|
18
|
+
The state machine's transitions: open / multiplex / idle-close / reactivate /
|
|
19
|
+
bounded-reconnect / second-drop-unreachable / reconnect-timeout / url-change /
|
|
20
|
+
no-url. Each is covered both-sides by a deterministic test.
|
|
21
|
+
|
|
22
|
+
## 1. Over-block
|
|
23
|
+
|
|
24
|
+
N/A — no gating; a relay. The conservative reconnect policy (one attempt per
|
|
25
|
+
episode, then machine-unreachable) could declare a flaky-but-recoverable peer
|
|
26
|
+
unreachable, but the user simply re-subscribes (re-click), which opens fresh
|
|
27
|
+
and resets the budget. Storm-proof beats persistent.
|
|
28
|
+
|
|
29
|
+
## 2. Under-block
|
|
30
|
+
|
|
31
|
+
Keystrokes are never queued across a (re)connect — stale input is worse than
|
|
32
|
+
none. Acceptable: the dashboard shows the live link state (phase 3) so the user
|
|
33
|
+
knows when input is live.
|
|
34
|
+
|
|
35
|
+
## 3. Level-of-abstraction fit
|
|
36
|
+
|
|
37
|
+
Pure module under src/server/, no I/O of its own. The WebSocketManager (phase 2)
|
|
38
|
+
owns local clients + the browser WS and injects the transport; this owns only
|
|
39
|
+
the single upstream link + its bookkeeping. Matches the P2 precedent of
|
|
40
|
+
shipping a tested building block before its consumer.
|
|
41
|
+
|
|
42
|
+
## 4. Signal vs authority compliance
|
|
43
|
+
|
|
44
|
+
**Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
|
|
45
|
+
|
|
46
|
+
No authority. A transport relay; all auth (ticket) + input gating
|
|
47
|
+
(allowRemoteInput) live in phase 2 at the WSManager/upgrade boundary per spec
|
|
48
|
+
§2.3.
|
|
49
|
+
|
|
50
|
+
## 5. Interactions
|
|
51
|
+
|
|
52
|
+
- WebSocketManager (phase 2): the future consumer; unaffected now (no import).
|
|
53
|
+
- Local polling loop: untouched — remote subs never enter it (TAP POINT). This
|
|
54
|
+
module does no tmux capture.
|
|
55
|
+
- P19 (No Unbounded Loops): the reconnect is a single bounded attempt; tests
|
|
56
|
+
assert the second-drop and timeout both terminate to machine-unreachable.
|
|
57
|
+
|
|
58
|
+
## 6. External surfaces
|
|
59
|
+
|
|
60
|
+
None in this phase. No routes, config, notifications, or wiring. A new source
|
|
61
|
+
file + its test only.
|