@telora/daemon 0.22.58 → 0.22.72

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 (100) hide show
  1. package/build-info.json +4 -3
  2. package/dist/completion/settle-injection-sweep.d.ts +7 -2
  3. package/dist/completion/settle-injection-sweep.d.ts.map +1 -1
  4. package/dist/completion/settle-injection-sweep.js +32 -2
  5. package/dist/completion/settle-injection-sweep.js.map +1 -1
  6. package/dist/completion/state-cascade.d.ts.map +1 -1
  7. package/dist/completion/state-cascade.js +35 -4
  8. package/dist/completion/state-cascade.js.map +1 -1
  9. package/dist/directive/directive-executor.d.ts.map +1 -1
  10. package/dist/directive/directive-executor.js +1 -0
  11. package/dist/directive/directive-executor.js.map +1 -1
  12. package/dist/focus/focus-executor.d.ts.map +1 -1
  13. package/dist/focus/focus-executor.js +41 -23
  14. package/dist/focus/focus-executor.js.map +1 -1
  15. package/dist/focus/focus-phase.d.ts.map +1 -1
  16. package/dist/focus/focus-phase.js +2 -1
  17. package/dist/focus/focus-phase.js.map +1 -1
  18. package/dist/focus/listener-spawn.d.ts +0 -44
  19. package/dist/focus/listener-spawn.d.ts.map +1 -1
  20. package/dist/focus/listener-spawn.js +61 -146
  21. package/dist/focus/listener-spawn.js.map +1 -1
  22. package/dist/focus-stage-lifecycle/planning-release.d.ts +3 -2
  23. package/dist/focus-stage-lifecycle/planning-release.d.ts.map +1 -1
  24. package/dist/focus-stage-lifecycle/planning-release.js +3 -2
  25. package/dist/focus-stage-lifecycle/planning-release.js.map +1 -1
  26. package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts +5 -3
  27. package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -1
  28. package/dist/focus-stage-lifecycle/wedge-watchdog.js +8 -5
  29. package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -1
  30. package/dist/queries/escalation-suppression.d.ts.map +1 -1
  31. package/dist/queries/escalation-suppression.js +2 -1
  32. package/dist/queries/escalation-suppression.js.map +1 -1
  33. package/dist/queries/focuses.d.ts +26 -0
  34. package/dist/queries/focuses.d.ts.map +1 -1
  35. package/dist/queries/focuses.js +36 -0
  36. package/dist/queries/focuses.js.map +1 -1
  37. package/dist/queries/shared.js +1 -1
  38. package/dist/queries/verification.d.ts +14 -2
  39. package/dist/queries/verification.d.ts.map +1 -1
  40. package/dist/queries/verification.js +43 -6
  41. package/dist/queries/verification.js.map +1 -1
  42. package/dist/reality/reality-writeback.d.ts +28 -0
  43. package/dist/reality/reality-writeback.d.ts.map +1 -1
  44. package/dist/reality/reality-writeback.js +30 -0
  45. package/dist/reality/reality-writeback.js.map +1 -1
  46. package/dist/shell/control-state.d.ts +6 -5
  47. package/dist/shell/control-state.d.ts.map +1 -1
  48. package/dist/shell/control-state.js +6 -5
  49. package/dist/shell/control-state.js.map +1 -1
  50. package/dist/spawn/null-role-spawn.d.ts +109 -0
  51. package/dist/spawn/null-role-spawn.d.ts.map +1 -0
  52. package/dist/spawn/null-role-spawn.js +94 -0
  53. package/dist/spawn/null-role-spawn.js.map +1 -0
  54. package/dist/spawn/worktree-session.d.ts +16 -10
  55. package/dist/spawn/worktree-session.d.ts.map +1 -1
  56. package/dist/spawn/worktree-session.js +52 -35
  57. package/dist/spawn/worktree-session.js.map +1 -1
  58. package/dist/testing/fixtures/index.js +1 -1
  59. package/dist/types/session.d.ts.map +1 -1
  60. package/dist/types/session.js +1 -2
  61. package/dist/types/session.js.map +1 -1
  62. package/dist/verify/stall-detectors.d.ts.map +1 -1
  63. package/dist/verify/stall-detectors.js +3 -1
  64. package/dist/verify/stall-detectors.js.map +1 -1
  65. package/dist/verify/unreviewed-settle-detector.d.ts +108 -0
  66. package/dist/verify/unreviewed-settle-detector.d.ts.map +1 -0
  67. package/dist/verify/unreviewed-settle-detector.js +213 -0
  68. package/dist/verify/unreviewed-settle-detector.js.map +1 -0
  69. package/dist/verify/verification-boundary-env.d.ts +51 -0
  70. package/dist/verify/verification-boundary-env.d.ts.map +1 -0
  71. package/dist/verify/verification-boundary-env.js +63 -0
  72. package/dist/verify/verification-boundary-env.js.map +1 -0
  73. package/dist/verify/verification-deps-default.js +2 -1
  74. package/dist/verify/verification-deps-default.js.map +1 -1
  75. package/dist/verify/verification-deps.js +1 -1
  76. package/dist/verify/verification-deps.js.map +1 -1
  77. package/dist/verify/verification-deterministic.d.ts +11 -1
  78. package/dist/verify/verification-deterministic.d.ts.map +1 -1
  79. package/dist/verify/verification-deterministic.js +26 -5
  80. package/dist/verify/verification-deterministic.js.map +1 -1
  81. package/dist/verify/verification-engine.d.ts +1 -0
  82. package/dist/verify/verification-engine.d.ts.map +1 -1
  83. package/dist/verify/verification-engine.js +28 -4
  84. package/dist/verify/verification-engine.js.map +1 -1
  85. package/dist/verify/verification-evidence-unavailable-feedback.d.ts +52 -0
  86. package/dist/verify/verification-evidence-unavailable-feedback.d.ts.map +1 -0
  87. package/dist/verify/verification-evidence-unavailable-feedback.js +178 -0
  88. package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -0
  89. package/dist/verify/verification-feedback.d.ts +34 -59
  90. package/dist/verify/verification-feedback.d.ts.map +1 -1
  91. package/dist/verify/verification-feedback.js +64 -172
  92. package/dist/verify/verification-feedback.js.map +1 -1
  93. package/dist/verify/verify-restatement.d.ts.map +1 -1
  94. package/dist/verify/verify-restatement.js +2 -1
  95. package/dist/verify/verify-restatement.js.map +1 -1
  96. package/package.json +2 -2
  97. package/dist/spawn/review-role-fallback.d.ts +0 -141
  98. package/dist/spawn/review-role-fallback.d.ts.map +0 -1
  99. package/dist/spawn/review-role-fallback.js +0 -114
  100. package/dist/spawn/review-role-fallback.js.map +0 -1
@@ -1,114 +0,0 @@
1
- // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
- // Pinned by: packages/daemon/src/focus/listener-operator-stop-drop.test.ts,
3
- // packages/daemon/src/spawn/review-role-fallback.test.ts
4
- // PINNED-BY-END
5
- /**
6
- * Name of the org's auto-seeded, full-codebase agent role used as the reviewer
7
- * fallback. Every organization gets one on creation (migration
8
- * seed_default_agent_roles: 'Developer'). Mirrors nexus intake's
9
- * DEFAULT_INTAKE_ROLE_NAME so review-spawn and intake-spawn share the same
10
- * zero-config fallback identity.
11
- */
12
- export const DEFAULT_REVIEWER_ROLE_NAME = 'Developer';
13
- /**
14
- * Resolve the org's seeded Developer role from an already-loaded roles
15
- * collection (the listener keeps every org agent role in memory). Returns the
16
- * first role named DEFAULT_REVIEWER_ROLE_NAME, or undefined when the org has no
17
- * seeded Developer role (the degenerate case the 'clear' decision handles).
18
- *
19
- * Pure and exported for unit testing.
20
- */
21
- export function resolveReviewerFallbackRole(roles) {
22
- for (const role of roles) {
23
- if (role.name === DEFAULT_REVIEWER_ROLE_NAME)
24
- return role;
25
- }
26
- return undefined;
27
- }
28
- /**
29
- * Decide what to do with a null-role pending spawn directive.
30
- *
31
- * A null assigned_agent_role_id means one of THREE things, and they must be
32
- * told apart:
33
- *
34
- * - An OPERATOR STOP (product_focuses.operator_stopped_at is set): the human
35
- * pulled the Play toggle to halt the focus. This is authoritative and wins
36
- * over everything -- when `operatorStopped` is true we `skip` for EVERY
37
- * sessionType, review included, and regardless of `reopened`. The stop lever
38
- * must never become the trigger for the path it was meant to stop.
39
- * - A LIFECYCLE CLEAR of a FINISHED focus (operator_stopped_at null, work not
40
- * reopened): auto_terminate_focus_team() nulled the role at completion. Here
41
- * a review directive is a SECOND team that must spawn AFTER completion (spawn
42
- * under the fallback role, else clear); a coding directive is the intended
43
- * off-state and is skipped.
44
- * - A LIFECYCLE CLEAR whose work was REOPENED (operator_stopped_at null,
45
- * `reopened` true): a review sent completed work back, so the focus is NOT
46
- * finished -- a coding directive here is NOT the off-state. It must spawn
47
- * under the fallback role (else clear), the same treatment a review
48
- * directive gets, so the reopened work resumes instead of stranding on a
49
- * lifecycle-cleared focus. This is the fact `decideNullRoleSpawn` previously
50
- * lacked: a coding directive was classified by sessionType ALONE, collapsing
51
- * "finished" and "reopened" into one skip.
52
- *
53
- * With `operatorStopped` false AND `reopened` false the behaviour is
54
- * byte-identical to before either fact existed.
55
- *
56
- * Pure and exported for unit testing (peer of resolveReviewerFallbackRole).
57
- */
58
- export function decideNullRoleSpawn(input) {
59
- if (input.operatorStopped)
60
- return { action: 'skip' };
61
- // A review directive spawns the review team under the fallback (unchanged).
62
- if (input.sessionType === 'review') {
63
- return input.fallbackRole
64
- ? { action: 'spawn', role: input.fallbackRole }
65
- : { action: 'clear' };
66
- }
67
- // A coding/undefined directive on reopened work is NOT the off-state: spawn
68
- // the reopened work under the fallback (else clear), just like a review.
69
- if (input.reopened) {
70
- return input.fallbackRole
71
- ? { action: 'spawn', role: input.fallbackRole }
72
- : { action: 'clear' };
73
- }
74
- // A coding/undefined directive on a genuinely finished focus stays the
75
- // intended off-state.
76
- return { action: 'skip' };
77
- }
78
- /**
79
- * Re-announce floor for the null-role "coding off-state" skip warning. The
80
- * warning is emitted on entry and then AT MOST once per this interval while the
81
- * block persists -- long enough that a stopped focus does not spin-log every
82
- * 30s poll, short enough that a block that persists keeps surfacing in the log
83
- * for as long as it lasts (instead of being announced once and then suppressed
84
- * forever, which made a genuinely stuck focus indistinguishable from a finished
85
- * one). 30 minutes.
86
- */
87
- export const NULL_ROLE_SKIP_REANNOUNCE_FLOOR_MS = 30 * 60_000;
88
- /**
89
- * Rate-limited re-announce gate for the null-role "coding off-state" skip
90
- * warning. The listener holds a Map of focus id -> last-announce timestamp (ms)
91
- * for the current continuous blocked episode; this mutates it and returns
92
- * whether to emit the warning now:
93
- *
94
- * - focus never announced this episode -> record `nowMs` and return true
95
- * (warn on entry).
96
- * - last announced >= `floorMs` ago -> record `nowMs` and return true
97
- * (re-announce: the block persists, keep surfacing it).
98
- * - last announced < `floorMs` ago -> return false (suppress the per-poll
99
- * repeat between re-announcements).
100
- *
101
- * The listener removes the focus from the map when it resumes (role assigned,
102
- * directive cleared, or focus leaves the active set), so a later re-entry warns
103
- * immediately again. `nowMs`/`floorMs` are injectable so the decision is
104
- * deterministic under test. Pure w.r.t. its inputs (Map + clock in, boolean
105
- * out) and exported for unit testing without standing up the poll loop.
106
- */
107
- export function shouldWarnNullRoleSkip(lastAnnouncedAt, focusId, nowMs = Date.now(), floorMs = NULL_ROLE_SKIP_REANNOUNCE_FLOOR_MS) {
108
- const prev = lastAnnouncedAt.get(focusId);
109
- if (prev !== undefined && nowMs - prev < floorMs)
110
- return false;
111
- lastAnnouncedAt.set(focusId, nowMs);
112
- return true;
113
- }
114
- //# sourceMappingURL=review-role-fallback.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review-role-fallback.js","sourceRoot":"","sources":["../../src/spawn/review-role-fallback.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,4EAA4E;AAC5E,2DAA2D;AAC3D,gBAAgB;AA2BhB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,WAAW,CAAC;AAmBtD;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAA0B;IAE1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,IAAI,KAAK,0BAA0B;YAAE,OAAO,IAAI,CAAC;IAC5D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAmBnC;IACC,IAAI,KAAK,CAAC,eAAe;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACrD,4EAA4E;IAC5E,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC,YAAY;YACvB,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE;YAC/C,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC1B,CAAC;IACD,4EAA4E;IAC5E,yEAAyE;IACzE,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,OAAO,KAAK,CAAC,YAAY;YACvB,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE;YAC/C,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC1B,CAAC;IACD,uEAAuE;IACvE,sBAAsB;IACtB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,MAAM,CAAC;AAE9D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,sBAAsB,CACpC,eAAoC,EACpC,OAAe,EACf,QAAgB,IAAI,CAAC,GAAG,EAAE,EAC1B,UAAkB,kCAAkC;IAEpD,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,IAAI,KAAK,GAAG,IAAI,GAAG,OAAO;QAAE,OAAO,KAAK,CAAC;IAC/D,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC"}