instar 1.3.521 → 1.3.523

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 (54) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +100 -1
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +16 -1
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/MeshRpc.d.ts +5 -0
  8. package/dist/core/MeshRpc.d.ts.map +1 -1
  9. package/dist/core/MeshRpc.js +8 -0
  10. package/dist/core/MeshRpc.js.map +1 -1
  11. package/dist/core/StoreSnapshot.d.ts +455 -0
  12. package/dist/core/StoreSnapshot.d.ts.map +1 -0
  13. package/dist/core/StoreSnapshot.js +786 -0
  14. package/dist/core/StoreSnapshot.js.map +1 -0
  15. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  16. package/dist/core/devGatedFeatures.js +6 -0
  17. package/dist/core/devGatedFeatures.js.map +1 -1
  18. package/dist/core/stateSyncConfig.js +1 -1
  19. package/dist/core/stateSyncConfig.js.map +1 -1
  20. package/dist/core/storeSnapshotBuild.worker.d.ts +2 -0
  21. package/dist/core/storeSnapshotBuild.worker.d.ts.map +1 -0
  22. package/dist/core/storeSnapshotBuild.worker.js +32 -0
  23. package/dist/core/storeSnapshotBuild.worker.js.map +1 -0
  24. package/dist/core/types.d.ts +17 -0
  25. package/dist/core/types.d.ts.map +1 -1
  26. package/dist/core/types.js.map +1 -1
  27. package/dist/monitoring/OrphanedWorkSentinel.d.ts +148 -0
  28. package/dist/monitoring/OrphanedWorkSentinel.d.ts.map +1 -0
  29. package/dist/monitoring/OrphanedWorkSentinel.js +177 -0
  30. package/dist/monitoring/OrphanedWorkSentinel.js.map +1 -0
  31. package/dist/monitoring/guardManifest.d.ts.map +1 -1
  32. package/dist/monitoring/guardManifest.js +14 -0
  33. package/dist/monitoring/guardManifest.js.map +1 -1
  34. package/dist/monitoring/orphanedWorkGit.d.ts +30 -0
  35. package/dist/monitoring/orphanedWorkGit.d.ts.map +1 -0
  36. package/dist/monitoring/orphanedWorkGit.js +124 -0
  37. package/dist/monitoring/orphanedWorkGit.js.map +1 -0
  38. package/dist/server/AgentServer.d.ts +3 -0
  39. package/dist/server/AgentServer.d.ts.map +1 -1
  40. package/dist/server/AgentServer.js +1 -0
  41. package/dist/server/AgentServer.js.map +1 -1
  42. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  43. package/dist/server/CapabilityIndex.js +1 -0
  44. package/dist/server/CapabilityIndex.js.map +1 -1
  45. package/dist/server/routes.d.ts +3 -0
  46. package/dist/server/routes.d.ts.map +1 -1
  47. package/dist/server/routes.js +11 -0
  48. package/dist/server/routes.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/data/builtin-manifest.json +47 -47
  51. package/upgrades/1.3.522.md +25 -0
  52. package/upgrades/1.3.523.md +31 -0
  53. package/upgrades/side-effects/hlc-step3-snapshot-tail.md +133 -0
  54. package/upgrades/side-effects/orphaned-work-sentinel.md +40 -0
@@ -0,0 +1,40 @@
1
+ # Side-effects review — OrphanedWorkSentinel (silent-uncommitted-death backstop)
2
+
3
+ ## 1. What changed
4
+
5
+ A new dark, dev-gated, signal-only monitoring sentinel that detects agent worktrees with uncommitted work whose owning session is dead + settled, records them durably, and raises ONE deduped agent-health attention item. Optional off-by-default non-destructive preservation patch.
6
+
7
+ - `src/monitoring/OrphanedWorkSentinel.ts` — class + pure classifier + config.
8
+ - `src/monitoring/orphanedWorkGit.ts` — git/fs-backed deps (reuses `agentWorktreeGit` helpers).
9
+ - Config type (`src/core/types.ts`), default with `enabled` OMITTED (`src/config/ConfigDefaults.ts`).
10
+ - Dev-gate registration (`src/core/devGatedFeatures.ts`).
11
+ - Server wiring (`src/commands/server.ts`), route ctx + `GET /orphaned-work` (`src/server/AgentServer.ts`, `src/server/routes.ts`).
12
+ - Route classification in `src/server/CapabilityIndex.ts` (INTERNAL — observability the agent reads).
13
+ - 3-tier tests: unit (classifier + real-git deps), integration (route), e2e (feature alive).
14
+
15
+ ## 2. Blast radius
16
+
17
+ Read-only on the fleet (dark; route 503s). On a dev agent: a background timer runs one git/lsof scan per `scanIntervalMs` (default 10 min) over the agent's `.worktrees/`, records to `state/orphaned-work.jsonl`, and may raise ONE agent-health attention item per stranded worktree episode (deduped on path+content-signature; the agent-health lane routes to the calm "🩺 Agent Health" topic — never a per-item topic flood).
18
+
19
+ ## 3. Destructive actions
20
+
21
+ None by default. The only mutation is the optional `preserveWork` sub-flag (off for everyone): it writes a patch FILE under the state dir from `git diff HEAD` (read-only) + the untracked file list. It never touches the worktree, its index, or any ref, and never deletes anything.
22
+
23
+ ## 4. Reversibility
24
+
25
+ Fully reversible: it ships dark; disabling the dev-gate (or `enabled: false`) stops it. No data migration, no schema change. The durable jsonl + patch files are additive and bounded.
26
+
27
+ ## 5. Failure modes
28
+
29
+ - `lsof`/git read failure → empty/clean signal → SKIP (never a false orphan). Recording/attention are best-effort (wrapped) and never throw the scan pass. Server wiring is wrapped in try/catch (non-fatal). Episode dedupe prevents re-alert spam; `maxFlagsPerPass` bounds blast radius.
30
+
31
+ ## 6. Operator-surface quality
32
+
33
+ N/A — this change touches NO operator surface (no dashboard renderer/markup, no approval/grant/secret form). The only user-facing output is a plain-language agent-health attention item, authored in plain English ("a build died here with uncommitted changes — open the worktree to finish it, or discard"). No raw internals are surfaced to the user.
34
+
35
+ ## 7. Standards
36
+
37
+ - Dev-agent dark-gate: `enabled` OMITTED + registered in `DEV_GATED_FEATURES` (lint + wiring test green).
38
+ - Migration Parity: default added to `ConfigDefaults.ts` → `applyDefaults` propagates to existing agents automatically.
39
+ - Testing Integrity: all 3 tiers + real-git wiring-integrity test.
40
+ - Capability discoverability: route prefix classified INTERNAL.