@telora/daemon 0.22.169 → 0.22.187

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 (254) hide show
  1. package/build-info.json +9 -3
  2. package/dist/audit/audit-floor-policy.d.ts +188 -0
  3. package/dist/audit/audit-floor-policy.d.ts.map +1 -0
  4. package/dist/audit/audit-floor-policy.js +353 -0
  5. package/dist/audit/audit-floor-policy.js.map +1 -0
  6. package/dist/audit/audit-prompt.d.ts +4 -177
  7. package/dist/audit/audit-prompt.d.ts.map +1 -1
  8. package/dist/audit/audit-prompt.js +6 -329
  9. package/dist/audit/audit-prompt.js.map +1 -1
  10. package/dist/completion/commit-verdict-release.d.ts +37 -1
  11. package/dist/completion/commit-verdict-release.d.ts.map +1 -1
  12. package/dist/completion/commit-verdict-release.js +90 -15
  13. package/dist/completion/commit-verdict-release.js.map +1 -1
  14. package/dist/completion/escalations.d.ts.map +1 -1
  15. package/dist/completion/escalations.js +3 -1
  16. package/dist/completion/escalations.js.map +1 -1
  17. package/dist/completion/review-exit-verdict-gate.d.ts +11 -5
  18. package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -1
  19. package/dist/completion/review-exit-verdict-gate.js +6 -3
  20. package/dist/completion/review-exit-verdict-gate.js.map +1 -1
  21. package/dist/delivery/commit-verdict-hold.d.ts.map +1 -1
  22. package/dist/delivery/commit-verdict-hold.js +2 -1
  23. package/dist/delivery/commit-verdict-hold.js.map +1 -1
  24. package/dist/directive/stranded-review-reroute.js +1 -1
  25. package/dist/directive/stranded-review-reroute.js.map +1 -1
  26. package/dist/focus/focus-executor.d.ts.map +1 -1
  27. package/dist/focus/focus-executor.js +2 -0
  28. package/dist/focus/focus-executor.js.map +1 -1
  29. package/dist/focus/pending-review-approved-head.d.ts +1 -1
  30. package/dist/focus/pending-review-approved-head.d.ts.map +1 -1
  31. package/dist/focus/pending-review-approved-head.js +4 -3
  32. package/dist/focus/pending-review-approved-head.js.map +1 -1
  33. package/dist/focus/session-health.d.ts.map +1 -1
  34. package/dist/focus/session-health.js +2 -1
  35. package/dist/focus/session-health.js.map +1 -1
  36. package/dist/focus-stage-lifecycle/planning-release.d.ts +52 -17
  37. package/dist/focus-stage-lifecycle/planning-release.d.ts.map +1 -1
  38. package/dist/focus-stage-lifecycle/planning-release.js +58 -70
  39. package/dist/focus-stage-lifecycle/planning-release.js.map +1 -1
  40. package/dist/focus-stage-lifecycle/ratify-bar-gate.d.ts +108 -0
  41. package/dist/focus-stage-lifecycle/ratify-bar-gate.d.ts.map +1 -0
  42. package/dist/focus-stage-lifecycle/ratify-bar-gate.js +174 -0
  43. package/dist/focus-stage-lifecycle/ratify-bar-gate.js.map +1 -0
  44. package/dist/git/merge-to-main.d.ts.map +1 -1
  45. package/dist/git/merge-to-main.js.map +1 -1
  46. package/dist/nexus/index.d.ts.map +1 -1
  47. package/dist/nexus/index.js +2 -1
  48. package/dist/nexus/index.js.map +1 -1
  49. package/dist/nexus/intake-prompt-sections.d.ts +70 -0
  50. package/dist/nexus/intake-prompt-sections.d.ts.map +1 -0
  51. package/dist/nexus/intake-prompt-sections.js +145 -0
  52. package/dist/nexus/intake-prompt-sections.js.map +1 -0
  53. package/dist/nexus/intake-spawn.d.ts +49 -13
  54. package/dist/nexus/intake-spawn.d.ts.map +1 -1
  55. package/dist/nexus/intake-spawn.js +45 -122
  56. package/dist/nexus/intake-spawn.js.map +1 -1
  57. package/dist/nexus/intake.d.ts +55 -0
  58. package/dist/nexus/intake.d.ts.map +1 -1
  59. package/dist/nexus/intake.js +62 -1
  60. package/dist/nexus/intake.js.map +1 -1
  61. package/dist/prd/arm-readiness.d.ts +93 -0
  62. package/dist/prd/arm-readiness.d.ts.map +1 -0
  63. package/dist/prd/arm-readiness.js +254 -0
  64. package/dist/prd/arm-readiness.js.map +1 -0
  65. package/dist/prd/arm-refusal.d.ts +149 -0
  66. package/dist/prd/arm-refusal.d.ts.map +1 -0
  67. package/dist/prd/arm-refusal.js +219 -0
  68. package/dist/prd/arm-refusal.js.map +1 -0
  69. package/dist/prd/controller-shared.d.ts +111 -0
  70. package/dist/prd/controller-shared.d.ts.map +1 -1
  71. package/dist/prd/controller-shared.js +3 -1
  72. package/dist/prd/controller-shared.js.map +1 -1
  73. package/dist/prd/controller.d.ts +16 -10
  74. package/dist/prd/controller.d.ts.map +1 -1
  75. package/dist/prd/controller.js +28 -35
  76. package/dist/prd/controller.js.map +1 -1
  77. package/dist/prd/frontier-arming.d.ts +151 -0
  78. package/dist/prd/frontier-arming.d.ts.map +1 -0
  79. package/dist/prd/frontier-arming.js +315 -0
  80. package/dist/prd/frontier-arming.js.map +1 -0
  81. package/dist/prd/index.d.ts +10 -1
  82. package/dist/prd/index.d.ts.map +1 -1
  83. package/dist/prd/index.js +9 -1
  84. package/dist/prd/index.js.map +1 -1
  85. package/dist/prd/scoping-prompt.d.ts +68 -0
  86. package/dist/prd/scoping-prompt.d.ts.map +1 -0
  87. package/dist/prd/scoping-prompt.js +86 -0
  88. package/dist/prd/scoping-prompt.js.map +1 -0
  89. package/dist/prompt/prompt-contradictions.d.ts +20 -1
  90. package/dist/prompt/prompt-contradictions.d.ts.map +1 -1
  91. package/dist/prompt/prompt-contradictions.js +35 -0
  92. package/dist/prompt/prompt-contradictions.js.map +1 -1
  93. package/dist/prompt/team-prompt-base.d.ts +18 -0
  94. package/dist/prompt/team-prompt-base.d.ts.map +1 -1
  95. package/dist/prompt/team-prompt-base.js +56 -11
  96. package/dist/prompt/team-prompt-base.js.map +1 -1
  97. package/dist/prompt-sections/persona-sections.d.ts +36 -13
  98. package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
  99. package/dist/prompt-sections/persona-sections.js +93 -16
  100. package/dist/prompt-sections/persona-sections.js.map +1 -1
  101. package/dist/prompt-sections/scoping-sections.d.ts +19 -5
  102. package/dist/prompt-sections/scoping-sections.d.ts.map +1 -1
  103. package/dist/prompt-sections/scoping-sections.js +45 -38
  104. package/dist/prompt-sections/scoping-sections.js.map +1 -1
  105. package/dist/prompt-sections/shared.d.ts +8 -0
  106. package/dist/prompt-sections/shared.d.ts.map +1 -1
  107. package/dist/prompt-sections/shared.js.map +1 -1
  108. package/dist/queries/delivery-gate-state.js +1 -1
  109. package/dist/queries/focus-criteria-standing.d.ts +170 -7
  110. package/dist/queries/focus-criteria-standing.d.ts.map +1 -1
  111. package/dist/queries/focus-criteria-standing.js +143 -8
  112. package/dist/queries/focus-criteria-standing.js.map +1 -1
  113. package/dist/queries/focus-ratify-release.d.ts +43 -0
  114. package/dist/queries/focus-ratify-release.d.ts.map +1 -0
  115. package/dist/queries/focus-ratify-release.js +45 -0
  116. package/dist/queries/focus-ratify-release.js.map +1 -0
  117. package/dist/queries/focuses.d.ts +0 -10
  118. package/dist/queries/focuses.d.ts.map +1 -1
  119. package/dist/queries/focuses.js +2 -15
  120. package/dist/queries/focuses.js.map +1 -1
  121. package/dist/queries/prd.d.ts +31 -0
  122. package/dist/queries/prd.d.ts.map +1 -1
  123. package/dist/queries/prd.js +26 -1
  124. package/dist/queries/prd.js.map +1 -1
  125. package/dist/queries/shared.js +1 -1
  126. package/dist/resolvers/focus-criteria-standing.d.ts.map +1 -1
  127. package/dist/resolvers/focus-criteria-standing.js +324 -25
  128. package/dist/resolvers/focus-criteria-standing.js.map +1 -1
  129. package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -1
  130. package/dist/resolvers/shared/review-window-commits.js +2 -1
  131. package/dist/resolvers/shared/review-window-commits.js.map +1 -1
  132. package/dist/security/security-auto-inject.d.ts +51 -0
  133. package/dist/security/security-auto-inject.d.ts.map +1 -1
  134. package/dist/security/security-auto-inject.js +101 -11
  135. package/dist/security/security-auto-inject.js.map +1 -1
  136. package/dist/security/security-scan-engine.d.ts +4 -4
  137. package/dist/security/security-scan-engine.d.ts.map +1 -1
  138. package/dist/security/security-scan-engine.js +6 -0
  139. package/dist/security/security-scan-engine.js.map +1 -1
  140. package/dist/session/session-lineage.d.ts.map +1 -1
  141. package/dist/session/session-lineage.js +2 -0
  142. package/dist/session/session-lineage.js.map +1 -1
  143. package/dist/shell/constants.d.ts +5 -0
  144. package/dist/shell/constants.d.ts.map +1 -1
  145. package/dist/shell/constants.js +5 -0
  146. package/dist/shell/constants.js.map +1 -1
  147. package/dist/shell/daemon-instance.d.ts +74 -64
  148. package/dist/shell/daemon-instance.d.ts.map +1 -1
  149. package/dist/shell/daemon-instance.js +16 -121
  150. package/dist/shell/daemon-instance.js.map +1 -1
  151. package/dist/shell/health-events.js +1 -1
  152. package/dist/shell/health-events.js.map +1 -1
  153. package/dist/shell/instance-liveness.d.ts +112 -0
  154. package/dist/shell/instance-liveness.d.ts.map +1 -0
  155. package/dist/shell/instance-liveness.js +205 -0
  156. package/dist/shell/instance-liveness.js.map +1 -0
  157. package/dist/shell/schema-version-gate.d.ts +22 -0
  158. package/dist/shell/schema-version-gate.d.ts.map +1 -1
  159. package/dist/shell/schema-version-gate.js +116 -6
  160. package/dist/shell/schema-version-gate.js.map +1 -1
  161. package/dist/shell/worker-pidfile.d.ts +21 -8
  162. package/dist/shell/worker-pidfile.d.ts.map +1 -1
  163. package/dist/shell/worker-pidfile.js +38 -9
  164. package/dist/shell/worker-pidfile.js.map +1 -1
  165. package/dist/spawn/lead-launch.d.ts.map +1 -1
  166. package/dist/spawn/lead-launch.js +2 -1
  167. package/dist/spawn/lead-launch.js.map +1 -1
  168. package/dist/spawn/one-shot-scoping-spawn.d.ts +51 -0
  169. package/dist/spawn/one-shot-scoping-spawn.d.ts.map +1 -0
  170. package/dist/spawn/one-shot-scoping-spawn.js +156 -0
  171. package/dist/spawn/one-shot-scoping-spawn.js.map +1 -0
  172. package/dist/spawn/process-spawn.d.ts +12 -0
  173. package/dist/spawn/process-spawn.d.ts.map +1 -1
  174. package/dist/spawn/process-spawn.js +1 -1
  175. package/dist/spawn/process-spawn.js.map +1 -1
  176. package/dist/spawn/prompt-assembly.d.ts +8 -0
  177. package/dist/spawn/prompt-assembly.d.ts.map +1 -1
  178. package/dist/spawn/prompt-assembly.js +15 -3
  179. package/dist/spawn/prompt-assembly.js.map +1 -1
  180. package/dist/spawn/worktree-session.d.ts +24 -6
  181. package/dist/spawn/worktree-session.d.ts.map +1 -1
  182. package/dist/spawn/worktree-session.js +37 -14
  183. package/dist/spawn/worktree-session.js.map +1 -1
  184. package/dist/testing/arm-coverage-model.d.ts +75 -0
  185. package/dist/testing/arm-coverage-model.d.ts.map +1 -0
  186. package/dist/testing/arm-coverage-model.js +114 -0
  187. package/dist/testing/arm-coverage-model.js.map +1 -0
  188. package/dist/testing/fixtures/index.js +1 -1
  189. package/dist/types/index.js +1 -1
  190. package/dist/verify/commit-gate-configured.d.ts.map +1 -1
  191. package/dist/verify/commit-gate-configured.js +1 -1
  192. package/dist/verify/commit-gate-configured.js.map +1 -1
  193. package/dist/verify/commit-verdict-pull.d.ts +48 -0
  194. package/dist/verify/commit-verdict-pull.d.ts.map +1 -0
  195. package/dist/verify/commit-verdict-pull.js +148 -0
  196. package/dist/verify/commit-verdict-pull.js.map +1 -0
  197. package/dist/verify/commit-verdict-record.js +1 -1
  198. package/dist/verify/credit-rearm.js +1 -1
  199. package/dist/verify/credit-rearm.js.map +1 -1
  200. package/dist/verify/default-on-guards.d.ts +74 -0
  201. package/dist/verify/default-on-guards.d.ts.map +1 -0
  202. package/dist/verify/default-on-guards.js +305 -0
  203. package/dist/verify/default-on-guards.js.map +1 -0
  204. package/dist/verify/explicit-rearm.d.ts.map +1 -1
  205. package/dist/verify/explicit-rearm.js +1 -0
  206. package/dist/verify/explicit-rearm.js.map +1 -1
  207. package/dist/verify/gate-run-registry.d.ts.map +1 -1
  208. package/dist/verify/gate-run-registry.js +1 -0
  209. package/dist/verify/gate-run-registry.js.map +1 -1
  210. package/dist/verify/judged-ancestor.d.ts +41 -0
  211. package/dist/verify/judged-ancestor.d.ts.map +1 -0
  212. package/dist/verify/judged-ancestor.js +101 -0
  213. package/dist/verify/judged-ancestor.js.map +1 -0
  214. package/dist/verify/no-own-delta-verdict.d.ts +7 -2
  215. package/dist/verify/no-own-delta-verdict.d.ts.map +1 -1
  216. package/dist/verify/no-own-delta-verdict.js +14 -17
  217. package/dist/verify/no-own-delta-verdict.js.map +1 -1
  218. package/dist/verify/rework-attribution.d.ts +71 -0
  219. package/dist/verify/rework-attribution.d.ts.map +1 -0
  220. package/dist/verify/rework-attribution.js +263 -0
  221. package/dist/verify/rework-attribution.js.map +1 -0
  222. package/dist/verify/shortfall-rulings.d.ts.map +1 -1
  223. package/dist/verify/shortfall-rulings.js +3 -2
  224. package/dist/verify/shortfall-rulings.js.map +1 -1
  225. package/dist/verify/verification-boundary-env.d.ts +70 -17
  226. package/dist/verify/verification-boundary-env.d.ts.map +1 -1
  227. package/dist/verify/verification-boundary-env.js +88 -14
  228. package/dist/verify/verification-boundary-env.js.map +1 -1
  229. package/dist/verify/verification-commit-sharing.d.ts.map +1 -1
  230. package/dist/verify/verification-commit-sharing.js +2 -1
  231. package/dist/verify/verification-commit-sharing.js.map +1 -1
  232. package/dist/verify/verification-config.d.ts.map +1 -1
  233. package/dist/verify/verification-config.js +1 -0
  234. package/dist/verify/verification-config.js.map +1 -1
  235. package/dist/verify/verification-default-on.d.ts +0 -32
  236. package/dist/verify/verification-default-on.d.ts.map +1 -1
  237. package/dist/verify/verification-default-on.js +10 -234
  238. package/dist/verify/verification-default-on.js.map +1 -1
  239. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  240. package/dist/verify/verification-deps-default.js +9 -0
  241. package/dist/verify/verification-deps-default.js.map +1 -1
  242. package/dist/verify/verification-engine.d.ts +2 -1
  243. package/dist/verify/verification-engine.d.ts.map +1 -1
  244. package/dist/verify/verification-engine.js +12 -4
  245. package/dist/verify/verification-engine.js.map +1 -1
  246. package/dist/verify/verification-feedback.d.ts +1 -1
  247. package/dist/verify/verification-feedback.d.ts.map +1 -1
  248. package/dist/verify/verification-feedback.js +5 -0
  249. package/dist/verify/verification-feedback.js.map +1 -1
  250. package/dist/verify/verification-rework-issue.d.ts +48 -7
  251. package/dist/verify/verification-rework-issue.d.ts.map +1 -1
  252. package/dist/verify/verification-rework-issue.js +111 -9
  253. package/dist/verify/verification-rework-issue.js.map +1 -1
  254. package/package.json +2 -2
@@ -0,0 +1,174 @@
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-stage-lifecycle/ratify-bar-gate.test.ts
3
+ // PINNED-BY-END
4
+ /**
5
+ * THE RATIFY CROSSING STATES A BAR, OR IT DOES NOT HAPPEN.
6
+ *
7
+ * WHY THIS EXISTS. A read_only (audit) focus is armed in order to go and
8
+ * DISCOVER what its tree should say, so its role arm states no bar and the
9
+ * database does not refuse it -- it stamps an honest empty `[]`. That empty
10
+ * stamp used to be treated as harmless, on the reasoning that nothing waits on
11
+ * an audit focus's bar. It is not harmless: `releaseRatifiedReadOnlyFocus`
12
+ * (planning-release.ts) later releases the focus's held 'planning' deliveries
13
+ * to 'queued' and flips read_only=false with NO new arm and NO re-stamp, so
14
+ * execution proceeded under a bar that stated nothing and no reviewer could
15
+ * hold the work against anything (review finding, delivery 3e6bacf5).
16
+ *
17
+ * So the rule binds the write that IS the audit focus's go-signal. Migration
18
+ * 20260922173056 refuses the read_only TRUE -> FALSE crossing when the focus
19
+ * states no bar, and re-stamps the whole baseline from the CURRENT tree when it
20
+ * does. This module is the daemon's half of that: ASK FIRST, so the refusal
21
+ * never has to arrive in the middle of a crossing that has already queued
22
+ * deliveries.
23
+ *
24
+ * WHY ASKING FIRST MATTERS HERE and not merely as politeness: the crossing is
25
+ * deliberately ordered release-then-flip, so that a partial release retries
26
+ * (see planning-release.ts). A refusal landing on the flip would therefore
27
+ * leave the deliveries queued and read_only still true -- released work under
28
+ * an audit flag, the worst of both. Holding BEFORE the release keeps the focus
29
+ * exactly where it was.
30
+ *
31
+ * FAIL CLOSED = HOLD. An unreadable bar holds the crossing, because crossing on
32
+ * an unproven bar spends the human's ratification on a run nobody can judge,
33
+ * and only a new ratification restores it. A hold costs one poll tick.
34
+ *
35
+ * WHAT IS RECORDED, AND WHERE. The same `focus_debug_artifacts` section the PRD
36
+ * frontier's refused arm uses (`arm_refused`, one row per focus, rendered on
37
+ * the focus Debug tab, read by NOTHING in the machine's decision path) through
38
+ * the same writer (`prd/arm-refusal.ts` `recordArmRefusalSection`), so there is
39
+ * one row and one since-when line rather than two vocabularies for "this focus
40
+ * states no future". Only a READABLE refusal is recorded: "the tree says this
41
+ * focus states nothing" is a finding an operator acts on, while "I could not
42
+ * read the tree" is a transient the next tick retries, and recording the second
43
+ * as the first would put a permanent-looking note on a healthy focus.
44
+ *
45
+ * NOTHING HERE ESCALATES. An audit whose findings state no future is a waiting
46
+ * state whose fix is a restatement on a tree node -- work an agent does, not a
47
+ * question for a human queue.
48
+ *
49
+ * @module focus-stage-lifecycle/ratify-bar-gate
50
+ */
51
+ import { readFocusStatesABar as defaultReadFocusStatesABar, } from '../prd/arm-readiness.js';
52
+ import { ARM_CRITERIA_REQUIRED_PREFIX, REFUSED_SINCE_PREFIX, classifyArmFailure, clearArmRefusal as defaultClearArmRefusal, recordArmRefusalSection as defaultRecordArmRefusalSection, } from '../prd/arm-refusal.js';
53
+ import { createLogger } from '../shell/log.js';
54
+ const log = createLogger({ module: 'focus-stage-lifecycle' });
55
+ /** Production wiring. */
56
+ export const defaultRatifyBarGateDeps = {
57
+ readFocusStatesABar: defaultReadFocusStatesABar,
58
+ recordArmRefusalSection: defaultRecordArmRefusalSection,
59
+ clearArmRefusal: defaultClearArmRefusal,
60
+ now: () => new Date(),
61
+ };
62
+ /**
63
+ * Render the operator-facing record. PURE.
64
+ *
65
+ * `detail` is whatever named the refusal: the daemon's own reading of the tree
66
+ * when it held the crossing, or the DATABASE's verbatim message when a refusal
67
+ * arrived anyway. Neither is re-worded -- the node list is the half a human
68
+ * needs and only the reader that produced it could resolve.
69
+ */
70
+ export function renderRatifyBarRefusalArtifact(args, since) {
71
+ const { focusName, focusId, detail, observedAt, refusedByDatabase } = args;
72
+ return [
73
+ '# Ratify held: this focus states no future to judge the released work against',
74
+ '',
75
+ 'A human ratified this audit focus, so its held remediation deliveries are due to',
76
+ 'be released into execution. They have NOT been released, and the focus is still',
77
+ 'read-only: ratification is this focus\'s go-signal, and a go-signal that states',
78
+ 'no bar would put work into execution that no review could measure.',
79
+ '',
80
+ 'Nothing is lost and nothing is frozen. Write the futures below, and the next',
81
+ 'poll crosses on its own -- this record clears when it does.',
82
+ '',
83
+ `${REFUSED_SINCE_PREFIX}${since}`,
84
+ `Last held: ${observedAt}`,
85
+ `Focus: ${focusName} (${focusId})`,
86
+ `Held by: ${refusedByDatabase ? 'the database, at the crossing' : 'the daemon, before releasing anything'}`,
87
+ '',
88
+ '## What states no future',
89
+ '',
90
+ detail,
91
+ '',
92
+ '## What clears it',
93
+ '',
94
+ 'Anchor the remediation delivery to an injection that targets an undesired effect,',
95
+ 'and give every covered undesired effect an frt_statement -- the future the world',
96
+ 'reads as once the remediation has landed.',
97
+ ].join('\n');
98
+ }
99
+ /** Record the held crossing. NEVER throws (see `recordArmRefusalSection`). */
100
+ async function recordRatifyBarRefusal(focus, detail, refusedByDatabase, deps) {
101
+ const observedAt = deps.now().toISOString();
102
+ await deps.recordArmRefusalSection({
103
+ focusId: focus.focusId,
104
+ observedAt,
105
+ detail,
106
+ render: (since) => renderRatifyBarRefusalArtifact({ focusName: focus.focusName, focusId: focus.focusId, detail, observedAt, refusedByDatabase }, since),
107
+ });
108
+ }
109
+ /**
110
+ * Should the ratify crossing be held? Answered BEFORE anything is released.
111
+ *
112
+ * `true` => hold: release nothing, leave read_only=true, and the next tick asks
113
+ * again. The reason is logged, and a readable refusal is also recorded durably.
114
+ * `false` => the focus states a bar; any stale record is cleared and the
115
+ * crossing proceeds.
116
+ */
117
+ export async function holdRatifyForUnstatedBar(focus, deps = defaultRatifyBarGateDeps) {
118
+ let standing;
119
+ try {
120
+ standing = await deps.readFocusStatesABar(focus.focusId);
121
+ }
122
+ catch (err) {
123
+ // readFocusStatesABar does not throw; a dep that does still holds, never
124
+ // crosses. Fail closed, exactly as an unreadable bar does.
125
+ log.warn(`[focus-stage-lifecycle] Ratify-release: could not read whether "${focus.focusName}" ` +
126
+ `states a bar (${err.message}); holding the crossing.`);
127
+ return true;
128
+ }
129
+ if (standing.statesABar) {
130
+ // The crossing is going ahead: a record from an earlier held tick is stale.
131
+ await deps.clearArmRefusal(focus.focusId);
132
+ return false;
133
+ }
134
+ if (!standing.readable) {
135
+ log.warn(`[focus-stage-lifecycle] Ratify-release: holding "${focus.focusName}" -- ` +
136
+ `${standing.reason}. Retrying next tick.`);
137
+ return true;
138
+ }
139
+ log.warn(`[focus-stage-lifecycle] Ratify-release: HELD for "${focus.focusName}" -- ` +
140
+ `${standing.reason}. Nothing released, read_only left true; the crossing runs ` +
141
+ `once every covered effect states its future.`);
142
+ await recordRatifyBarRefusal(focus, standing.reason, false, deps);
143
+ return true;
144
+ }
145
+ /**
146
+ * The backstop: a refusal that arrived ANYWAY, on the read_only flip itself.
147
+ *
148
+ * The pre-check and the trigger read the tree at two different instants and
149
+ * through two different paths (the injection bundle's `nowTargets` vs the
150
+ * `targets` edges), so they CAN disagree without either being wrong. When they
151
+ * do, the crossing degrades to "held, recorded" -- never to a crash and never
152
+ * to a silent log line -- and the next tick re-asks. A failure that is NOT the
153
+ * criteria refusal is logged as before and records nothing: it is an ordinary
154
+ * transient, not a statement about this focus's bar.
155
+ *
156
+ * RECOGNITION DEPENDS ON THE EDGE CARRYING THE TEXT. `daemon_update_focus_status`
157
+ * answers a refused flip with the database's message verbatim and
158
+ * `code: 'arm_criteria_required'`. In the deploy-order window -- migration live,
159
+ * edge function not -- the same refusal comes back as an opaque 500, so it is
160
+ * logged and held but not recorded. That degradation is deliberate: the
161
+ * alternative is recording every transient as a statement about the bar.
162
+ */
163
+ export async function noteRatifyFlipFailure(focus, err, deps = defaultRatifyBarGateDeps) {
164
+ const failure = classifyArmFailure(err);
165
+ const isRefusal = failure.kind === 'criteria_required' ||
166
+ failure.detail.includes(ARM_CRITERIA_REQUIRED_PREFIX);
167
+ log.warn(`[focus-stage-lifecycle] Ratify-release: held deliveries queued for ` +
168
+ `"${focus.focusName}" but failed to flip read_only=false (will retry next tick): ` +
169
+ `${failure.detail}`);
170
+ if (!isRefusal)
171
+ return;
172
+ await recordRatifyBarRefusal(focus, failure.detail, true, deps);
173
+ }
174
+ //# sourceMappingURL=ratify-bar-gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ratify-bar-gate.js","sourceRoot":"","sources":["../../src/focus-stage-lifecycle/ratify-bar-gate.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+EAA+E;AAC/E,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EACL,mBAAmB,IAAI,0BAA0B,GAElD,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,IAAI,sBAAsB,EACzC,uBAAuB,IAAI,8BAA8B,GAC1D,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAgB9D,yBAAyB;AACzB,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACzD,mBAAmB,EAAE,0BAA0B;IAC/C,uBAAuB,EAAE,8BAA8B;IACvD,eAAe,EAAE,sBAAsB;IACvC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,8BAA8B,CAC5C,IAOC,EACD,KAAa;IAEb,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC;IAC3E,OAAO;QACL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,CAAC,SAAS;QAAE,OAAO;IACvB,MAAM,sBAAsB,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"merge-to-main.d.ts","sourceRoot":"","sources":["../../src/git/merge-to-main.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,aAAa,EAAwB,MAAM,YAAY,CAAC;AAIpG,OAAO,EAGL,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAU5B,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,YAAY,CAAC;IACrB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,YAAY,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;;;;;;;;;OAYG;IACH,WAAW,EAAE,cAAc,GAAG,SAAS,CAAC;CACzC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAAC,MAAM,CAAC,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAoPtF"}
1
+ {"version":3,"file":"merge-to-main.d.ts","sourceRoot":"","sources":["../../src/git/merge-to-main.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OA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file":"index.d.ts","sourceRoot":"","sources":["../../src/nexus/index.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nexus/index.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;GAYG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC"}
@@ -2,7 +2,8 @@
2
2
  // Pinned by: packages/daemon/src/nexus/nexus-e2e.test.ts,
3
3
  // packages/daemon/src/nexus/nexus-escalation-bridge.test.ts,
4
4
  // packages/daemon/src/nexus/nexus-incoming.test.ts, packages/daemon/src/nexus/nexus-intake.test.ts,
5
- // packages/daemon/src/nexus/nexus-return.test.ts
5
+ // packages/daemon/src/nexus/nexus-return.test.ts,
6
+ // packages/daemon/src/nexus/release-order-capability.test.ts
6
7
  // PINNED-BY-END
7
8
  /**
8
9
  * Nexus subsystem barrel (cross-product request intake / routing / return).
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nexus/index.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0DAA0D;AAC1D,+DAA+D;AAC/D,sGAAsG;AACtG,mDAAmD;AACnD,gBAAgB;AAEhB;;;;;;;;;;;;GAYG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nexus/index.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0DAA0D;AAC1D,+DAA+D;AAC/D,sGAAsG;AACtG,oDAAoD;AACpD,+DAA+D;AAC/D,gBAAgB;AAEhB;;;;;;;;;;;;GAYG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The sections the Nexus intake scoping prompt is composed from.
3
+ *
4
+ * Extracted from intake-spawn.ts because the composer would otherwise cross the
5
+ * 100-line function ceiling. Each function here returns TEXT; none of them is
6
+ * the contract. What the scoping agent actually receives is whatever
7
+ * buildIntakeScopingPrompt concatenates, which is why every regression test in
8
+ * this area asserts on the COMPOSED prompt and not on these return values --
9
+ * a section can be correct and never reach the agent.
10
+ *
11
+ * @module nexus/intake-prompt-sections
12
+ */
13
+ import type { IntakeObservation } from './intake.js';
14
+ /**
15
+ * The observation the requester carried: the undesired effect they asked to
16
+ * have cleared, and the causes upstream of it in THEIR tree.
17
+ *
18
+ * Returns the EMPTY STRING when there is no observation -- an endpoint-typed
19
+ * request, or one raised from an MCP that predates source nodes. Deliberately
20
+ * not a "(none supplied)" placeholder: a placeholder is content, and a scoping
21
+ * agent handed content will scope against it. Absence must read as absence.
22
+ */
23
+ export declare function renderObservationSection(observation: IntakeObservation | null | undefined): string;
24
+ /**
25
+ * The ordered scoping steps.
26
+ *
27
+ * TWO corrections live in this order, from two different focuses, and they are
28
+ * independent -- do not collapse either back.
29
+ *
30
+ * WHAT the CRT is built FROM. Step 3 used to read "set the FRT goal /
31
+ * desired-effect FROM the acceptance contract". That single clause produced tree
32
+ * 24a042b1: the contract named a mechanism (detect the collision, refuse it at
33
+ * the merge), the tree was built downward from it, the CRT correctly found the
34
+ * real root -- both branches claim the same numbers -- and then declared that
35
+ * root out of reach CITING the contract. Three commits landed and the cause was
36
+ * never touched. So the CRT is built from the OBSERVATION, injections go at the
37
+ * ROOT, and the contract is applied afterwards as the BAR the derived future
38
+ * must clear.
39
+ *
40
+ * WHEN the focus is armed. The arm used to be step 1, before the tree existed.
41
+ * An arm covers exactly the effects the anchored deliveries' injections target
42
+ * AT THE INSTANT IT LANDS, so arming first covers nothing and strands every
43
+ * later delivery at 'planning'. It is now the LAST step, after the tree, the
44
+ * deliveries and the second materialize. What keeps a second scoping agent from
45
+ * spawning is the first materialize STAMP, not the arm -- which is why that
46
+ * stamp stays at step 2, long before the focus is armed.
47
+ *
48
+ * The restatement paragraph in step 3 is not advice: the database REFUSES an arm
49
+ * that covers an undesired effect stating no future, naming the unstated nodes.
50
+ * A prompt that omitted it would send every scoping agent into that refusal.
51
+ */
52
+ export declare function renderScopingSteps(params: {
53
+ requestId: string;
54
+ title: string;
55
+ targetProductId: string;
56
+ roleId: string;
57
+ marker: string;
58
+ hasObservation: boolean;
59
+ }): string;
60
+ /**
61
+ * The two rules that keep the contract from becoming a wall.
62
+ *
63
+ * Both exist because of one observed run. The CRT found the real root and
64
+ * declared it out of reach, citing acceptance-contract item 3; the return
65
+ * channel (a question entry) existed the whole time and was never used. So the
66
+ * prompt now names the return channel as the ACT to take, and forbids the
67
+ * contract as an out-of-reach reason outright.
68
+ */
69
+ export declare function renderContractRules(requestId: string, hasObservation: boolean): string;
70
+ //# sourceMappingURL=intake-prompt-sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intake-prompt-sections.d.ts","sourceRoot":"","sources":["../../src/nexus/intake-prompt-sections.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAS5E;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CA8BlG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;CACzB,GAAG,MAAM,CA6BT;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,GAAG,MAAM,CA4BtF"}
@@ -0,0 +1,145 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: none -- no test imports this module directly (baselined; see lint:pinned-by)
3
+ // PINNED-BY-END
4
+ /** One observation node as a prompt line: what it says, and what backs it. */
5
+ function renderNode(node, label) {
6
+ const lines = [`- ${label} (#${node.seq}, ${node.nodeType}): ${node.statement}`];
7
+ if (node.evidence)
8
+ lines.push(` evidence: ${node.evidence}`);
9
+ return lines;
10
+ }
11
+ /**
12
+ * The observation the requester carried: the undesired effect they asked to
13
+ * have cleared, and the causes upstream of it in THEIR tree.
14
+ *
15
+ * Returns the EMPTY STRING when there is no observation -- an endpoint-typed
16
+ * request, or one raised from an MCP that predates source nodes. Deliberately
17
+ * not a "(none supplied)" placeholder: a placeholder is content, and a scoping
18
+ * agent handed content will scope against it. Absence must read as absence.
19
+ */
20
+ export function renderObservationSection(observation) {
21
+ if (!observation)
22
+ return '';
23
+ const lines = [
24
+ `## The observation (what the REQUESTER sees -- build your CRT from THIS)`,
25
+ ``,
26
+ `This request was born from an undesired effect in the requesting product's`,
27
+ `reality tree, not from prose. The effect and its upstream causes travel with`,
28
+ `the request so you never have to read back into their tree.`,
29
+ ``,
30
+ ...renderNode(observation.sourceNode, 'The effect this request asks to have cleared'),
31
+ ];
32
+ if (observation.sourceNode.frtStatement) {
33
+ lines.push(` its stated future (this IS the acceptance contract below): ${observation.sourceNode.frtStatement}`);
34
+ }
35
+ if (observation.upstreamCauses.length > 0) {
36
+ lines.push(``, `Upstream causes in the requester's tree, nearest first:`);
37
+ for (const cause of observation.upstreamCauses)
38
+ lines.push(...renderNode(cause, 'cause'));
39
+ }
40
+ else {
41
+ lines.push(``, `The requester recorded no upstream causes: in their tree this effect is a root.`);
42
+ }
43
+ if (observation.truncated) {
44
+ lines.push(``, `NOTE: this fragment was truncated at a size cap -- the requester's tree has`, `more upstream than is shown. Treat what is here as a starting point, not as`, `the complete causal picture.`);
45
+ }
46
+ lines.push(``);
47
+ return lines.join('\n');
48
+ }
49
+ /**
50
+ * The ordered scoping steps.
51
+ *
52
+ * TWO corrections live in this order, from two different focuses, and they are
53
+ * independent -- do not collapse either back.
54
+ *
55
+ * WHAT the CRT is built FROM. Step 3 used to read "set the FRT goal /
56
+ * desired-effect FROM the acceptance contract". That single clause produced tree
57
+ * 24a042b1: the contract named a mechanism (detect the collision, refuse it at
58
+ * the merge), the tree was built downward from it, the CRT correctly found the
59
+ * real root -- both branches claim the same numbers -- and then declared that
60
+ * root out of reach CITING the contract. Three commits landed and the cause was
61
+ * never touched. So the CRT is built from the OBSERVATION, injections go at the
62
+ * ROOT, and the contract is applied afterwards as the BAR the derived future
63
+ * must clear.
64
+ *
65
+ * WHEN the focus is armed. The arm used to be step 1, before the tree existed.
66
+ * An arm covers exactly the effects the anchored deliveries' injections target
67
+ * AT THE INSTANT IT LANDS, so arming first covers nothing and strands every
68
+ * later delivery at 'planning'. It is now the LAST step, after the tree, the
69
+ * deliveries and the second materialize. What keeps a second scoping agent from
70
+ * spawning is the first materialize STAMP, not the arm -- which is why that
71
+ * stamp stays at step 2, long before the focus is armed.
72
+ *
73
+ * The restatement paragraph in step 3 is not advice: the database REFUSES an arm
74
+ * that covers an undesired effect stating no future, naming the unstated nodes.
75
+ * A prompt that omitted it would send every scoping agent into that refusal.
76
+ */
77
+ export function renderScopingSteps(params) {
78
+ const { requestId, title, targetProductId, roleId, marker, hasObservation } = params;
79
+ const step3 = hasObservation
80
+ ? [
81
+ `3. telora_reality_tree create on the focus, then author the CRT FROM THE OBSERVATION above -- in this order:`,
82
+ ` a. Bring the observation into THIS product's terms: the requester's effect and its upstream causes become entities and undesired effects in your tree, carrying the evidence that travelled with them. You are not copying their tree; you are stating, in your product's causal terms, what produces the effect they see.`,
83
+ ` b. Create the MIRROR of the requested undesired effect: one node whose statement is the requester's effect and which carries their evidence. This is the node the whole request is judged against, so it must exist as its own node.`,
84
+ ` c. Wire the causes, then keep asking "and what causes THAT?" until you reach roots inside this product -- something your team can act on. The effect the requester named is a SYMPTOM in your tree; it is almost never where the injection goes.`,
85
+ ` d. Place your injections at the ROOTS you found. Not at the items the acceptance contract lists: those describe a future, and an injection is an act. Draw a \`targets\` edge from each injection to the node(s) it flips.`,
86
+ ` e. derive_frt, then read the derived cascade AGAINST the acceptance contract. The contract is the BAR -- does the future your injections produce clear it? If not, the plan is short, not the contract wrong.`,
87
+ ` The contract tells you what must become TRUE. It does not tell you where the tree starts, which mechanism to build, or what is beyond reach.`,
88
+ ]
89
+ : [
90
+ `3. telora_reality_tree create on the focus, then author the CRT: capture the undesired effects this request implies in THIS product, wire their causes down to roots you can act on, and place injections at those roots, drawing a \`targets\` edge from each injection to the node(s) it flips. Then derive_frt and read the derived cascade against the acceptance contract as the BAR it must clear. This request carries no observation (it is endpoint-typed, or was raised before requests carried one), so the contract is all you have to judge against -- but it is still a bar on the future, never a description of the tree to build.`,
91
+ ];
92
+ return [
93
+ `## Steps (do these in order, verifying each with a follow-up read)`,
94
+ `1. telora_product_focus create -- name the focus from the request title ("${title}"), productId = ${targetProductId}. The description MUST include, verbatim, the marker line "${marker}" AND the full acceptance contract above (so any follow-up team has the goal even if the tree is not yet built). Leave assignedAgentRoleId UNSET here -- the arm is the last step, not the first.`,
95
+ `2. telora_product_request materialize -- requestId = ${requestId}, materializedFocusId = <the focus id you created>. Do this NOW, immediately after the focus exists -- BEFORE building the tree or deliveries, and long before the arm. This stamps the focus back on the request (accepted -> in_progress) so it leaves the intake-pending set and a second scoping agent can never be spawned for it. The stamp is what guarantees that -- not the arm, which has not happened yet. If your run crashes after this point, the per-request focus already exists and the normal loop finishes scoping it; if it crashed before this point, the idempotency check above reuses the focus.`,
96
+ ...step3,
97
+ ` RESTATEMENT IS REQUIRED ON EVERY INJECTION TARGET: each undesired effect an injection targets MUST carry a non-blank frtStatement -- the future that node reads as once this work lands -- together with its frtNodeType (what the node becomes: desired_effect). Set both with telora_reality_tree_node update (frtStatement + frtNodeType) on EVERY target, then re-read the nodes and confirm not one of them is blank.`,
98
+ ` This is not decoration, and it is not optional. The arm in step 5 is REFUSED BY THE DATABASE when any undesired effect it covers states no future: the call fails with an "arm_criteria_required:" error that NAMES the unstated nodes, because an arm that covers an unstated effect would stamp a bar nobody wrote down. If you see that refusal, state the futures it names and issue the arm again -- do not work around it, and do not skip the arm.`,
99
+ `4. telora_product_delivery create -- decompose the work into one or more deliveries, EACH anchored to an injection (injectionNodeId) and carrying a workFacing label ("outward" for new ground / a capability not had before, "inward" for improving existing ground). Scope deliveries by the phases the work naturally has. These MUST exist and be injection-anchored BEFORE the arm in step 5: an arm covers exactly the effects the deliveries' injections target at the instant it lands, so arming an empty or tree-less focus covers nothing and strands everything you scope afterwards at 'planning'.`,
100
+ ` Then call telora_product_request materialize ONCE MORE with the SAME materializedFocusId, plus materializedDeliveryId = <the representative delivery id>${hasObservation ? `, plus mirroredNodeId = <the id of the mirror node you created in step 3b>` : ''}. The request is already in_progress at this point, which is fine -- materialize is idempotent for the same focus and just records the delivery the return-path loop watches to resolve this request when it reaches done.${hasObservation ? ` Recording the mirror is what lets this call check that your plan actually reaches the effect the requester observed; a plan whose injections do not flip that node is not a plan for this request.` : ''}`,
101
+ `5. telora_product_focus update to set assignedAgentRoleId = ${roleId} so the spawn loop will pick the focus up (no dead-letter). Do this LAST, after the tree and the anchored deliveries exist and after the second materialize, so the arm you request covers stated effects. This arm is NOT you judging your own scoping ready -- an agent does not arm its own focus. It is the human go-signal that the accepted intake request DURABLY DELEGATED to this flow (accepting the request IS the go-signal), which is why you may issue it at all, and it goes here, last, so that delegated go-signal lands on a focus whose effects are stated. Declare it in the same call: pass armNote = "durably-delegated arm: accepted intake request ${requestId}".`,
102
+ ``,
103
+ `Then STOP. Do NOT begin implementing the deliveries -- the armed focus runs the normal differential loop after you exit.`,
104
+ ].join('\n');
105
+ }
106
+ /**
107
+ * The two rules that keep the contract from becoming a wall.
108
+ *
109
+ * Both exist because of one observed run. The CRT found the real root and
110
+ * declared it out of reach, citing acceptance-contract item 3; the return
111
+ * channel (a question entry) existed the whole time and was never used. So the
112
+ * prompt now names the return channel as the ACT to take, and forbids the
113
+ * contract as an out-of-reach reason outright.
114
+ */
115
+ export function renderContractRules(requestId, hasObservation) {
116
+ if (!hasObservation)
117
+ return '';
118
+ return [
119
+ `## When your tree and the contract disagree`,
120
+ ``,
121
+ `You will sometimes find that the root cause your CRT reaches is NOT what the`,
122
+ `contract's wording addresses, or that the contract names a MECHANISM your tree`,
123
+ `says will not clear the effect. That is a normal and useful finding: the`,
124
+ `requester wrote from where the pain was felt; you are looking at where it comes`,
125
+ `from. It is not a reason to stop, and it is not a reason to scope their`,
126
+ `mechanism instead.`,
127
+ ``,
128
+ `Do this:`,
129
+ `- SEND IT BACK. telora_product_request send, requestId = ${requestId}, entryType = "question",`,
130
+ ` content = the root you found, the evidence for it, and what you intend to scope`,
131
+ ` toward instead. Name the disagreement plainly.`,
132
+ `- KEEP GOING. The question is not a gate on your own work. Do not wait for an`,
133
+ ` answer, do not park the focus, and do not hold the materialize call. Scope`,
134
+ ` toward the EFFECT the requester observed, using the root you actually found.`,
135
+ ``,
136
+ `And one prohibition, because this is exactly how the last request failed:`,
137
+ `- An out-of-reach declaration on an undesired effect may NOT cite the acceptance`,
138
+ ` contract as its reason. "The contract does not mention this" is not a boundary`,
139
+ ` on your reach -- it is a disagreement, and a disagreement goes back through the`,
140
+ ` question channel above. Out of reach means YOUR PRODUCT cannot act on it, and`,
141
+ ` that claim stands on what your product can do, never on what the requester wrote.`,
142
+ ``,
143
+ ].join('\n');
144
+ }
145
+ //# sourceMappingURL=intake-prompt-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intake-prompt-sections.js","sourceRoot":"","sources":["../../src/nexus/intake-prompt-sections.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0FAA0F;AAC1F,gBAAgB;AAiBhB,8EAA8E;AAC9E,SAAS,UAAU,CAAC,IAA2B,EAAE,KAAa;IAC5D,MAAM,KAAK,GAAG,CAAC,KAAK,KAAK,MAAM,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACjF,IAAI,IAAI,CAAC,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9D,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAiD;IACxF,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAa;QACtB,0EAA0E;QAC1E,EAAE;QACF,4EAA4E;QAC5E,8EAA8E;QAC9E,6DAA6D;QAC7D,EAAE;QACF,GAAG,UAAU,CAAC,WAAW,CAAC,UAAU,EAAE,8CAA8C,CAAC;KACtF,CAAC;IACF,IAAI,WAAW,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QACxC,KAAK,CAAC,IAAI,CAAC,gEAAgE,WAAW,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;IACD,IAAI,WAAW,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,yDAAyD,CAAC,CAAC;QAC1E,KAAK,MAA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AAS,IAAI;QAChuB,EAAE;QACF,0HAA0H;KAC3H,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB,EAAE,cAAuB;IAC5E,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAC/B,OAAO;QACL,6CAA6C;QAC7C,EAAE;QACF,8EAA8E;QAC9E,gFAAgF;QAChF,0EAA0E;QAC1E,iFAAiF;QACjF,yEAAyE;QACzE,oBAAoB;QACpB,EAAE;QACF,UAAU;QACV,4DAA4D,SAAS,2BAA2B;QAChG,mFAAmF;QACnF,kDAAkD;QAClD,+EAA+E;QAC/E,8EAA8E;QAC9E,gFAAgF;QAChF,EAAE;QACF,2EAA2E;QAC3E,kFAAkF;QAClF,kFAAkF;QAClF,mFAAmF;QACnF,iFAAiF;QACjF,qFAAqF;QACrF,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -1,27 +1,63 @@
1
+ /**
2
+ * Nexus intake scoping-agent spawn.
3
+ *
4
+ * Spawns a short-lived, single-purpose Claude Code agent that authors a focus
5
+ * from an accepted cross-product request -- the work the materialize edge
6
+ * handler structurally could not do. The agent is seeded with the request + its
7
+ * acceptanceContract and the role UUID to assign; its sole job is:
8
+ *
9
+ * 1. telora_product_focus create -- a per-request focus named from the request,
10
+ * left UN-ARMED (no assignedAgentRoleId).
11
+ * 2. telora_product_request materialize -- stamp the new focus back on the
12
+ * request so it leaves the intake-pending set (accepted -> in_progress) and
13
+ * a second scoping agent can never be spawned. The stamp, not the arm, is
14
+ * the anti-double-spawn guarantee.
15
+ * 3. telora_reality_tree create + author nodes/edges -- the acceptanceContract
16
+ * becomes the goal / desired-effect the tree drives toward, and EVERY node
17
+ * an injection targets is restated (frtStatement + frtNodeType). The arm at
18
+ * step 5 is refused outright when one of its covered effects states no
19
+ * future, so the restatement is a precondition of the arm, not a polish
20
+ * step -- and the prompt says so, because the prompt is the only thing that
21
+ * reaches the agent doing the authoring.
22
+ * 4. telora_product_delivery create -- injection-anchored deliveries, then
23
+ * materialize once more to record the representative delivery.
24
+ * 5. telora_product_focus update -- assign the intake role LAST, so the arm
25
+ * covers the effects the anchored deliveries state. Arming first covers
26
+ * nothing and strands every later delivery at 'planning'.
27
+ * 6. exit.
28
+ *
29
+ * THE PROCESS MACHINERY LIVES IN `spawn/one-shot-scoping-spawn.ts` and is
30
+ * SHARED with the PRD frontier's scoping agent: the one-shot `--print` Claude
31
+ * Code process, prompt passed as a CLI arg, cleaned env, the kill timeout, the
32
+ * fire-and-forget resolve-on-'spawn' contract (the agent runs for minutes, so
33
+ * the daemon poll loop is never blocked) and the close/error logging. What
34
+ * stays here is what is genuinely intake's: the PURE prompt builder below, and
35
+ * the `intake_scoping_started_at` in-flight guard its caller stamps -- that
36
+ * stamp, never the returned promise, is what prevents a re-spawn until the
37
+ * staleness window.
38
+ */
1
39
  import type { DaemonConfig } from '../types/index.js';
2
40
  import type { IntakePendingRequest } from './intake.js';
3
- /** Kill the scoping agent if it has not exited within this window (15 minutes). */
41
+ import { type ScopingSpawnSeam } from '../spawn/one-shot-scoping-spawn.js';
42
+ /**
43
+ * Kill the scoping agent if it has not exited within this window (15 minutes).
44
+ *
45
+ * An alias of the shared one-shot timeout, kept under its original name because
46
+ * DEFAULT_INTAKE_STALE_MS is documented and tested as strictly greater than it
47
+ * (`nexus-intake.test.ts`) -- the relation is intake's, the number is shared.
48
+ */
4
49
  export declare const INTAKE_SCOPING_TIMEOUT_MS: number;
50
+ export type { ScopingSpawnSeam };
5
51
  /**
6
52
  * Build the scoping prompt seeded with the request + acceptanceContract + the
7
53
  * role to assign. Pure (string) so it is unit-tested without spawning a process.
8
54
  */
9
55
  export declare function buildIntakeScopingPrompt(req: IntakePendingRequest, roleId: string): string;
10
- /** Injectable process spawn seam (overridable in tests). */
11
- export interface ScopingSpawnSeam {
12
- spawnProcess: (command: string, args: string[], cwd: string, env: NodeJS.ProcessEnv) => {
13
- pid?: number;
14
- on: (event: string, cb: (arg?: unknown) => void) => void;
15
- stdin?: {
16
- end: () => void;
17
- } | null;
18
- };
19
- }
20
56
  /**
21
57
  * Spawn the intake scoping agent for one accepted request. Resolves once the
22
58
  * process has SPAWNED (fire-and-forget -- the agent runs for minutes); rejects
23
- * only if the process fails to spawn. The close/error handlers log the outcome
24
- * and the kill timeout bounds a hung agent.
59
+ * only if the process fails to spawn. The shared seam logs the outcome and its
60
+ * kill timeout bounds a hung agent.
25
61
  */
26
62
  export declare function spawnScopingAgent(config: DaemonConfig, req: IntakePendingRequest, roleId: string, seam?: ScopingSpawnSeam): Promise<void>;
27
63
  //# sourceMappingURL=intake-spawn.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"intake-spawn.d.ts","sourceRoot":"","sources":["../../src/nexus/intake-spawn.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAMxD,mFAAmF;AACnF,eAAO,MAAM,yBAAyB,QAAiB,CAAC;AAExD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAsC1F;AAED,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,KAAK;QACtF,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;QACzD,KAAK,CAAC,EAAE;YAAE,GAAG,EAAE,MAAM,IAAI,CAAA;SAA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