instar 1.3.1088 → 1.3.1089

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 (50) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +40 -30
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/GuardPostureStore.d.ts.map +1 -1
  5. package/dist/core/GuardPostureStore.js +1 -0
  6. package/dist/core/GuardPostureStore.js.map +1 -1
  7. package/dist/core/types.d.ts +2 -0
  8. package/dist/core/types.d.ts.map +1 -1
  9. package/dist/core/types.js.map +1 -1
  10. package/dist/data/standards-guard-index.json +1 -1
  11. package/dist/data/standards-guard-index.meta.json +2 -2
  12. package/dist/data/standards-registry.meta.json +1 -1
  13. package/dist/monitoring/AgentWorktreeReaper.d.ts +69 -4
  14. package/dist/monitoring/AgentWorktreeReaper.d.ts.map +1 -1
  15. package/dist/monitoring/AgentWorktreeReaper.js +135 -18
  16. package/dist/monitoring/AgentWorktreeReaper.js.map +1 -1
  17. package/dist/monitoring/GuardRegistry.d.ts +4 -0
  18. package/dist/monitoring/GuardRegistry.d.ts.map +1 -1
  19. package/dist/monitoring/GuardRegistry.js.map +1 -1
  20. package/dist/monitoring/OrphanedWorkSentinel.d.ts +33 -3
  21. package/dist/monitoring/OrphanedWorkSentinel.d.ts.map +1 -1
  22. package/dist/monitoring/OrphanedWorkSentinel.js +90 -9
  23. package/dist/monitoring/OrphanedWorkSentinel.js.map +1 -1
  24. package/dist/monitoring/WorktreeEnumerationFailureStore.d.ts +13 -0
  25. package/dist/monitoring/WorktreeEnumerationFailureStore.d.ts.map +1 -0
  26. package/dist/monitoring/WorktreeEnumerationFailureStore.js +103 -0
  27. package/dist/monitoring/WorktreeEnumerationFailureStore.js.map +1 -0
  28. package/dist/monitoring/agentWorktreeGit.d.ts.map +1 -1
  29. package/dist/monitoring/agentWorktreeGit.js +18 -3
  30. package/dist/monitoring/agentWorktreeGit.js.map +1 -1
  31. package/dist/monitoring/guardManifest.js +2 -2
  32. package/dist/monitoring/guardManifest.js.map +1 -1
  33. package/dist/monitoring/guardPostureView.d.ts +5 -2
  34. package/dist/monitoring/guardPostureView.d.ts.map +1 -1
  35. package/dist/monitoring/guardPostureView.js +17 -2
  36. package/dist/monitoring/guardPostureView.js.map +1 -1
  37. package/dist/monitoring/orphanedWorkGit.d.ts.map +1 -1
  38. package/dist/monitoring/orphanedWorkGit.js.map +1 -1
  39. package/dist/monitoring/worktreeEnumeration.d.ts +63 -0
  40. package/dist/monitoring/worktreeEnumeration.d.ts.map +1 -0
  41. package/dist/monitoring/worktreeEnumeration.js +37 -0
  42. package/dist/monitoring/worktreeEnumeration.js.map +1 -0
  43. package/package.json +1 -1
  44. package/src/data/builtin-manifest.json +2 -2
  45. package/src/data/standards-guard-index.json +1 -1
  46. package/src/data/standards-guard-index.meta.json +2 -2
  47. package/src/data/standards-registry.meta.json +1 -1
  48. package/src/data/state-coherence-registry.json +17 -0
  49. package/upgrades/1.3.1089.md +34 -0
  50. package/upgrades/side-effects/guard-enumeration-fail-visible.md +78 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8EH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AA0BjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA8H7D,OAAO,KAAK,EAAW,oBAAoB,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAgFtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAA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AAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,GACP,IAAI,CAwtBN;AAgmBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAwwqBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -17712,15 +17712,21 @@ export async function startServer(options) {
17712
17712
  // disabled. Observability at GET /worktrees/agent-reaper.
17713
17713
  const { AgentWorktreeReaper } = await import('../monitoring/AgentWorktreeReaper.js');
17714
17714
  const { makeAgentWorktreeReaperDeps } = await import('../monitoring/agentWorktreeGit.js');
17715
+ const { WorktreeEnumerationFailureStore } = await import('../monitoring/WorktreeEnumerationFailureStore.js');
17715
17716
  const _agentWorktreesDir = path.join(path.dirname(config.stateDir), '.worktrees');
17716
- const agentWorktreeReaper = new AgentWorktreeReaper(makeAgentWorktreeReaperDeps({
17717
- instarRepo: config.projectDir,
17718
- worktreesDir: _agentWorktreesDir,
17719
- // Multi-commit squash-merge detection via GitHub merged-PR state (default
17720
- // on; fail-safe to cherry-only). Off only if explicitly disabled in config.
17721
- githubMergeCheck: config.monitoring?.agentWorktreeReaper?.githubMergeCheck ?? true,
17722
- }), config.monitoring?.agentWorktreeReaper);
17717
+ const _worktreeEnumerationFailureStore = new WorktreeEnumerationFailureStore(path.join(config.stateDir, 'state', 'worktree-enumeration-failures.json'));
17718
+ const agentWorktreeReaper = new AgentWorktreeReaper({
17719
+ ...makeAgentWorktreeReaperDeps({
17720
+ instarRepo: config.projectDir,
17721
+ worktreesDir: _agentWorktreesDir,
17722
+ // Multi-commit squash-merge detection via GitHub merged-PR state (default
17723
+ // on; fail-safe to cherry-only). Off only if explicitly disabled in config.
17724
+ githubMergeCheck: config.monitoring?.agentWorktreeReaper?.githubMergeCheck ?? true,
17725
+ }),
17726
+ failureHistory: _worktreeEnumerationFailureStore.forGuard('agent-worktree-reaper'),
17727
+ }, config.monitoring?.agentWorktreeReaper);
17723
17728
  agentWorktreeReaper.start();
17729
+ guardRegistry.register('monitoring.agentWorktreeReaper.enabled', () => agentWorktreeReaper.guardStatus());
17724
17730
  if (config.monitoring?.agentWorktreeReaper?.enabled) {
17725
17731
  console.log(pc.green(config.monitoring.agentWorktreeReaper.dryRun === false
17726
17732
  ? ' AgentWorktreeReaper enabled (stale-worktree reclaim — LIVE)'
@@ -17926,30 +17932,34 @@ export async function startServer(options) {
17926
17932
  try {
17927
17933
  const { OrphanedWorkSentinel } = await import('../monitoring/OrphanedWorkSentinel.js');
17928
17934
  const { makeOrphanedWorkSentinelDeps } = await import('../monitoring/orphanedWorkGit.js');
17929
- orphanedWorkSentinel = new OrphanedWorkSentinel(makeOrphanedWorkSentinelDeps({
17930
- instarRepo: config.projectDir,
17931
- worktreesDir: _agentWorktreesDir,
17932
- stateDir: path.join(config.stateDir, 'state'),
17933
- raiseAttention: telegram
17934
- ? (event) => {
17935
- const slug = event.path.split('/').filter(Boolean).pop() ?? 'worktree';
17936
- void telegram.createAttentionItem({
17937
- id: `orphaned-work:${slug}:${event.workSig}`,
17938
- title: `Stranded work in worktree "${slug}"`,
17939
- summary: 'A build/session died with uncommitted changes — revive the worktree to finish, or discard.',
17940
- description: `Worktree ${event.path} (branch ${event.branch ?? 'detached'}) has uncommitted changes ` +
17941
- `but its owning session is gone. The work is still on disk` +
17942
- `${event.preserved ? ' and a preservation patch was written' : ''}. ` +
17943
- `Open the worktree to finish + commit, or discard if no longer needed.`,
17944
- category: 'agent-health',
17945
- priority: 'NORMAL',
17946
- sourceContext: `orphaned-work:${slug}`,
17947
- });
17948
- }
17949
- : () => { },
17950
- now: () => Date.now(),
17951
- }), { ...config.monitoring?.orphanedWorkSentinel, enabled: _orphanedWorkEnabled });
17935
+ orphanedWorkSentinel = new OrphanedWorkSentinel({
17936
+ ...makeOrphanedWorkSentinelDeps({
17937
+ instarRepo: config.projectDir,
17938
+ worktreesDir: _agentWorktreesDir,
17939
+ stateDir: path.join(config.stateDir, 'state'),
17940
+ raiseAttention: telegram
17941
+ ? (event) => {
17942
+ const slug = event.path.split('/').filter(Boolean).pop() ?? 'worktree';
17943
+ void telegram.createAttentionItem({
17944
+ id: `orphaned-work:${slug}:${event.workSig}`,
17945
+ title: `Stranded work in worktree "${slug}"`,
17946
+ summary: 'A build/session died with uncommitted changes revive the worktree to finish, or discard.',
17947
+ description: `Worktree ${event.path} (branch ${event.branch ?? 'detached'}) has uncommitted changes ` +
17948
+ `but its owning session is gone. The work is still on disk` +
17949
+ `${event.preserved ? ' and a preservation patch was written' : ''}. ` +
17950
+ `Open the worktree to finish + commit, or discard if no longer needed.`,
17951
+ category: 'agent-health',
17952
+ priority: 'NORMAL',
17953
+ sourceContext: `orphaned-work:${slug}`,
17954
+ });
17955
+ }
17956
+ : () => { },
17957
+ now: () => Date.now(),
17958
+ }),
17959
+ failureHistory: _worktreeEnumerationFailureStore.forGuard('orphaned-work-sentinel'),
17960
+ }, { ...config.monitoring?.orphanedWorkSentinel, enabled: _orphanedWorkEnabled });
17952
17961
  orphanedWorkSentinel.start();
17962
+ guardRegistry.register('monitoring.orphanedWorkSentinel.enabled', () => orphanedWorkSentinel.guardStatus());
17953
17963
  if (_orphanedWorkEnabled) {
17954
17964
  console.log(pc.green(' OrphanedWorkSentinel enabled (silent-uncommitted-death backstop — signal-only)'));
17955
17965
  }