@telora/daemon 0.20.57 → 0.20.78

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 (114) hide show
  1. package/build-info.json +4 -3
  2. package/dist/audit-phase.d.ts +12 -18
  3. package/dist/audit-phase.d.ts.map +1 -1
  4. package/dist/audit-phase.js +17 -60
  5. package/dist/audit-phase.js.map +1 -1
  6. package/dist/audit-prompt.d.ts +44 -0
  7. package/dist/audit-prompt.d.ts.map +1 -0
  8. package/dist/audit-prompt.js +194 -0
  9. package/dist/audit-prompt.js.map +1 -0
  10. package/dist/ci-sensor-loop.d.ts +38 -1
  11. package/dist/ci-sensor-loop.d.ts.map +1 -1
  12. package/dist/ci-sensor-loop.js +49 -5
  13. package/dist/ci-sensor-loop.js.map +1 -1
  14. package/dist/delivery-reconciler.d.ts +3 -0
  15. package/dist/delivery-reconciler.d.ts.map +1 -1
  16. package/dist/delivery-reconciler.js +16 -0
  17. package/dist/delivery-reconciler.js.map +1 -1
  18. package/dist/focus-engine.d.ts.map +1 -1
  19. package/dist/focus-engine.js +12 -1
  20. package/dist/focus-engine.js.map +1 -1
  21. package/dist/focus-executor.d.ts.map +1 -1
  22. package/dist/focus-executor.js +4 -1
  23. package/dist/focus-executor.js.map +1 -1
  24. package/dist/focus-merge.d.ts.map +1 -1
  25. package/dist/focus-merge.js +37 -3
  26. package/dist/focus-merge.js.map +1 -1
  27. package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -1
  28. package/dist/focus-stage-lifecycle/wedge-watchdog.js +9 -1
  29. package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -1
  30. package/dist/listener-auto-advance.d.ts.map +1 -1
  31. package/dist/listener-auto-advance.js +58 -10
  32. package/dist/listener-auto-advance.js.map +1 -1
  33. package/dist/merge-back-loop.d.ts +8 -2
  34. package/dist/merge-back-loop.d.ts.map +1 -1
  35. package/dist/merge-back-loop.js +17 -11
  36. package/dist/merge-back-loop.js.map +1 -1
  37. package/dist/merge-failure-classify.d.ts +39 -0
  38. package/dist/merge-failure-classify.d.ts.map +1 -0
  39. package/dist/merge-failure-classify.js +58 -0
  40. package/dist/merge-failure-classify.js.map +1 -0
  41. package/dist/prompt-sections/execution-sections.d.ts +20 -14
  42. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  43. package/dist/prompt-sections/execution-sections.js +53 -138
  44. package/dist/prompt-sections/execution-sections.js.map +1 -1
  45. package/dist/prompt-sections/scoping-sections.d.ts +30 -0
  46. package/dist/prompt-sections/scoping-sections.d.ts.map +1 -0
  47. package/dist/prompt-sections/scoping-sections.js +179 -0
  48. package/dist/prompt-sections/scoping-sections.js.map +1 -0
  49. package/dist/prompt-sections/shared.d.ts +7 -0
  50. package/dist/prompt-sections/shared.d.ts.map +1 -1
  51. package/dist/prompt-sections/shared.js.map +1 -1
  52. package/dist/queries/agent-resolvable-promotion.d.ts +87 -0
  53. package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -0
  54. package/dist/queries/agent-resolvable-promotion.js +152 -0
  55. package/dist/queries/agent-resolvable-promotion.js.map +1 -0
  56. package/dist/queries/cause-key.d.ts +64 -0
  57. package/dist/queries/cause-key.d.ts.map +1 -0
  58. package/dist/queries/cause-key.js +79 -0
  59. package/dist/queries/cause-key.js.map +1 -0
  60. package/dist/queries/escalation-suppression.d.ts +89 -0
  61. package/dist/queries/escalation-suppression.d.ts.map +1 -0
  62. package/dist/queries/escalation-suppression.js +98 -0
  63. package/dist/queries/escalation-suppression.js.map +1 -0
  64. package/dist/queries/holds.d.ts +177 -0
  65. package/dist/queries/holds.d.ts.map +1 -0
  66. package/dist/queries/holds.js +232 -0
  67. package/dist/queries/holds.js.map +1 -0
  68. package/dist/queries/issues.d.ts +41 -99
  69. package/dist/queries/issues.d.ts.map +1 -1
  70. package/dist/queries/issues.js +57 -137
  71. package/dist/queries/issues.js.map +1 -1
  72. package/dist/queries/verification.d.ts +11 -0
  73. package/dist/queries/verification.d.ts.map +1 -1
  74. package/dist/queries/verification.js.map +1 -1
  75. package/dist/resolvers/shared/git-diff.d.ts +24 -3
  76. package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
  77. package/dist/resolvers/shared/git-diff.js +41 -3
  78. package/dist/resolvers/shared/git-diff.js.map +1 -1
  79. package/dist/spawn/prompt-assembly.d.ts +3 -0
  80. package/dist/spawn/prompt-assembly.d.ts.map +1 -1
  81. package/dist/spawn/prompt-assembly.js +2 -1
  82. package/dist/spawn/prompt-assembly.js.map +1 -1
  83. package/dist/spawn/worktree-session.d.ts +2 -0
  84. package/dist/spawn/worktree-session.d.ts.map +1 -1
  85. package/dist/spawn/worktree-session.js +20 -1
  86. package/dist/spawn/worktree-session.js.map +1 -1
  87. package/dist/staleness-sensor.d.ts +24 -1
  88. package/dist/staleness-sensor.d.ts.map +1 -1
  89. package/dist/staleness-sensor.js +31 -4
  90. package/dist/staleness-sensor.js.map +1 -1
  91. package/dist/stall-detectors.d.ts +46 -13
  92. package/dist/stall-detectors.d.ts.map +1 -1
  93. package/dist/stall-detectors.js +78 -18
  94. package/dist/stall-detectors.js.map +1 -1
  95. package/dist/team-prompt-base.d.ts +1 -1
  96. package/dist/team-prompt-base.d.ts.map +1 -1
  97. package/dist/team-prompt-base.js +4 -2
  98. package/dist/team-prompt-base.js.map +1 -1
  99. package/dist/verification-default-on.d.ts.map +1 -1
  100. package/dist/verification-default-on.js +5 -0
  101. package/dist/verification-default-on.js.map +1 -1
  102. package/dist/verification-engine.d.ts +8 -0
  103. package/dist/verification-engine.d.ts.map +1 -1
  104. package/dist/verification-engine.js +8 -75
  105. package/dist/verification-engine.js.map +1 -1
  106. package/dist/verification-evidence.d.ts +74 -0
  107. package/dist/verification-evidence.d.ts.map +1 -0
  108. package/dist/verification-evidence.js +116 -0
  109. package/dist/verification-evidence.js.map +1 -0
  110. package/dist/verification-feedback.d.ts +8 -7
  111. package/dist/verification-feedback.d.ts.map +1 -1
  112. package/dist/verification-feedback.js +49 -39
  113. package/dist/verification-feedback.js.map +1 -1
  114. package/package.json +3 -3
package/build-info.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "commitSha": "96805df9b",
3
- "builtAt": "2026-07-26T17:35:25.517Z",
2
+ "commitSha": "335c08d4e",
3
+ "builtAt": "2026-07-27T19:58:07.358Z",
4
4
  "expectedMigrations": [
5
5
  "20250829113330_create_org_nodes_table.sql",
6
6
  "20250829113402_fix_function_security_search_path.sql",
@@ -735,6 +735,7 @@
735
735
  "20260723215016_add_audit_runs_status.sql",
736
736
  "20260726112530_get_product_issue_counts_drop_iteration_exclusion.sql",
737
737
  "20260726125024_agent_escalations_kind_verify_evidence_unavailable.sql",
738
- "20260726164235_add_operator_stopped_at_to_product_focuses.sql"
738
+ "20260726164235_add_operator_stopped_at_to_product_focuses.sql",
739
+ "20260727183918_agent_escalations_kind_agent_resolvable_promoted.sql"
739
740
  ]
740
741
  }
@@ -35,10 +35,10 @@ export declare const AUDIT_ASSEMBLY_RECIPE: readonly string[];
35
35
  export declare const AUDIT_MCP_TOOLS: readonly string[];
36
36
  /**
37
37
  * Default Claude model for the audit assessor. Override via deps.
38
- * Opus: the audit authors a navigable causal tree + injection plan a human
39
- * reviews before any fix runs -- the reasoning depth (root-cause attribution,
40
- * FRT self-validation) warrants the stronger model. Matched as a substring by
41
- * the telemetry pricing table (see spawner/lifecycle AUDIT_CAPTURE_MODEL).
38
+ * Opus: the audit authors a navigable causal tree + injection plan -- the
39
+ * reasoning depth (root-cause attribution, FRT self-validation) warrants the
40
+ * stronger model. Matched as a substring by the telemetry pricing table (see
41
+ * spawner/lifecycle AUDIT_CAPTURE_MODEL).
42
42
  */
43
43
  export declare const AUDIT_DEFAULT_MODEL = "opus";
44
44
  /** Default timeout for the assessor session (15 minutes). */
@@ -50,20 +50,14 @@ export declare const AUDIT_DEFAULT_TIMEOUT_MS: number;
50
50
  */
51
51
  export declare const AUDIT_LINEAGE = "audit";
52
52
  /**
53
- * Audit prompt: the tree-authoring discipline for the read-only audit
54
- * assessor. The assessor authors a CRT + an FRT of injections and anchors a
55
- * navigable plan a human reviews BEFORE any fix runs -- it never emits a flat
56
- * remediation task checklist.
57
- *
58
- * CANONICAL SOURCE OF TRUTH for this guidance is the MCP-package constant
59
- * AUDIT_TREE_AUTHORING_GUIDE in
60
- * mcp/telora-products/src/handlers/auditTreeAuthoringGuide.ts (surfaced inline
61
- * by telora_discover when the reality-tree domain loads). The daemon cannot
62
- * runtime-import the MCP package (no cross-package runtime import), so the
63
- * prose is duplicated here; keep the two in sync. The audit-summary tail block
64
- * is daemon-specific (parsed by parseAuditSummary) and lives only here.
53
+ * Audit prompt surface. The prompt text and its posture composition live in
54
+ * audit-prompt.ts (dependency-free string constants); this module owns the
55
+ * phase orchestration around it. Re-exported here so existing importers and
56
+ * tests that reference AUDIT_PROMPT / buildAuditPrompt / AuditPosture through
57
+ * audit-phase keep resolving.
65
58
  */
66
- export declare const AUDIT_PROMPT: string;
59
+ export { buildAuditPrompt, AUDIT_PROMPT, type AuditPosture, } from './audit-prompt.js';
60
+ import type { AuditPosture } from './audit-prompt.js';
67
61
  export interface AuditPhaseResult {
68
62
  outcome: FocusPhaseOutcome;
69
63
  rationale?: string;
@@ -173,5 +167,5 @@ export declare const defaultAuditDeps: AuditPhaseDeps;
173
167
  * returns 'continue' so the focus loop advances regardless of audit
174
168
  * outcome -- the row + metadata.errors describe what happened.
175
169
  */
176
- export declare function runAuditPhase(focusId: string, deps?: AuditPhaseDeps): Promise<AuditPhaseResult>;
170
+ export declare function runAuditPhase(focusId: string, deps?: AuditPhaseDeps, posture?: AuditPosture): Promise<AuditPhaseResult>;
177
171
  //# sourceMappingURL=audit-phase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit-phase.d.ts","sourceRoot":"","sources":["../src/audit-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,sCAA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I,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnF;AAMD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CA4C9D;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,SAAS,iBAAiB,EAAE,EACxC,OAAO,EAAE,cAAc,GAAG,IAAI,GAC7B,OAAO,CAaT;AA+BD,eAAO,MAAM,gBAAgB,EAAE,cA6B9B,CAAC;AAMF;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,cAAiC,EACvC,OAAO,GAAE,YAAqB,GAC7B,OAAO,CAAC,gBAAgB,CAAC,CAsQ3B"}
@@ -58,10 +58,10 @@ export const AUDIT_MCP_TOOLS = [
58
58
  ];
59
59
  /**
60
60
  * Default Claude model for the audit assessor. Override via deps.
61
- * Opus: the audit authors a navigable causal tree + injection plan a human
62
- * reviews before any fix runs -- the reasoning depth (root-cause attribution,
63
- * FRT self-validation) warrants the stronger model. Matched as a substring by
64
- * the telemetry pricing table (see spawner/lifecycle AUDIT_CAPTURE_MODEL).
61
+ * Opus: the audit authors a navigable causal tree + injection plan -- the
62
+ * reasoning depth (root-cause attribution, FRT self-validation) warrants the
63
+ * stronger model. Matched as a substring by the telemetry pricing table (see
64
+ * spawner/lifecycle AUDIT_CAPTURE_MODEL).
65
65
  */
66
66
  export const AUDIT_DEFAULT_MODEL = 'opus';
67
67
  /** Default timeout for the assessor session (15 minutes). */
@@ -73,59 +73,15 @@ export const AUDIT_DEFAULT_TIMEOUT_MS = 15 * 60 * 1000;
73
73
  */
74
74
  export const AUDIT_LINEAGE = 'audit';
75
75
  /**
76
- * Audit prompt: the tree-authoring discipline for the read-only audit
77
- * assessor. The assessor authors a CRT + an FRT of injections and anchors a
78
- * navigable plan a human reviews BEFORE any fix runs -- it never emits a flat
79
- * remediation task checklist.
80
- *
81
- * CANONICAL SOURCE OF TRUTH for this guidance is the MCP-package constant
82
- * AUDIT_TREE_AUTHORING_GUIDE in
83
- * mcp/telora-products/src/handlers/auditTreeAuthoringGuide.ts (surfaced inline
84
- * by telora_discover when the reality-tree domain loads). The daemon cannot
85
- * runtime-import the MCP package (no cross-package runtime import), so the
86
- * prose is duplicated here; keep the two in sync. The audit-summary tail block
87
- * is daemon-specific (parsed by parseAuditSummary) and lives only here.
76
+ * Audit prompt surface. The prompt text and its posture composition live in
77
+ * audit-prompt.ts (dependency-free string constants); this module owns the
78
+ * phase orchestration around it. Re-exported here so existing importers and
79
+ * tests that reference AUDIT_PROMPT / buildAuditPrompt / AuditPosture through
80
+ * audit-phase keep resolving.
88
81
  */
89
- export const AUDIT_PROMPT = [
90
- 'You are the read-only reality-tree audit assessor for a Telora focus.',
91
- '',
92
- 'A safe audit emits a TREE and a PLAN, never a task checklist. You are READ-ONLY with respect to code: discovery only. You author the intent structure -- the current reality, its root causes, and the leverage points -- and you anchor a plan a human reviews BEFORE any fix runs. You do NOT fix anything, and you do NOT file remediation Task or Bug issues. Remediation is scoped LATER, one root cause at a time, from the injections you anchor here -- so there is no flat checklist to complete with completion-vigor and churn stays bounded to the real defects.',
93
- '',
94
- 'Work in rounds:',
95
- '',
96
- '1. Facts -> CRT. Author the current reality. Create the focus reality tree if none exists (telora_reality_tree action=create), then add an entity node per real component/observation and an undesired_effect (UDE) node per observed problem (telora_reality_tree_node action=create). State what IS, in evidence terms -- not a fix.',
97
- '',
98
- '2. Relationships -> causal edges. Wire cause -> effect with telora_reality_tree_edge action=create (cause node -> effect node). This is the load-bearing round: edges turn a list of symptoms into a causal structure, so a single deep cause feeding many surface UDEs across different audit areas becomes visible as ONE root in ONE tree -- which stops "one delivery per area" sprawl.',
99
- '',
100
- '3. Leverage -> injections. Propose injection nodes at the LOWEST / root causes (the nodes with the most downstream UDEs), not at the symptoms. One injection at a root can clear a whole subtree of UDEs.',
101
- '',
102
- '4. Self-validate -> derive_frt. Call telora_reality_tree action=derive_frt with the treeId. This is read-only: it returns the cleared/flipped UDE sets the injections produce. Confirm each injection flips the UDEs you targeted. If a UDE is left unresolved by your injection set, REPORT it in the summary -- do not hide it and do not lower the bar to make the tree look clean.',
103
- '',
104
- '5. Anchor the plan -> injection-anchored deliveries. For each injection, create a remediation delivery with telora_product_delivery action=create, passing injectionNodeId=<the injection node> and executionStatus="planning". Set its acceptance to the FRT desired effect -- the future-state the injection produces (what becomes true once the root cause is cleared), NOT a list of edits. This is the navigable plan the human reviews before anything executes.',
105
- '',
106
- 'Statement quality (Goldratt Categories of Legitimate Reservation). Hold every node to three statement-quality reservations AS YOU WRITE IT -- inline with the rounds above, not a separate pass:',
107
- '- Clarity. Each statement is ONE unambiguous declarative sentence that reads standalone -- no jargon or pronoun a reviewer must guess at.',
108
- '- Entity Existence. Each entity / UDE names a COMPLETE, REAL state that actually exists, not a sentence fragment or a vague gesture. Prefer a grounded observation over an invented abstraction.',
109
- '- Tautology. In the relationships round, no cause -> effect pair may be circular: an effect must NOT be offered as the reason its own cause exists.',
110
- 'A node that fails any of these radiates unearned certainty; fix the statement before you wire it. These reservations cost no extra call -- they are how you write each node, not a gate you run afterward.',
111
- '',
112
- 'Two hard integrity gates (deterministic; the tree dump computes them and a tree must pass to present, so unearned certainty cannot hide):',
113
- '- Connectivity (NO ORPHANS). A node with zero edges of ANY type AND no `evidence` is an ORPHAN -- neither wired into the causal graph nor folded into its own evidence. A single orphan makes the tree NOT presentable (the dump names the orphan seqs). Fix it: wire the node to a cause/effect with an edge, or ground it by setting `evidence`. An orphan is reality with nothing to measure it against -- it must not survive to review.',
114
- '- Evidence-or-assumed. An `entity` / `undesired_effect` with empty/null `evidence` renders an `[assumed]` marker; with evidence it renders `(evidence)`. Assumed is NOT a violation -- it is an honest hedge that the claim is unearned certainty until grounded. Set `evidence` on the nodes you can actually observe; leave the rest visibly `[assumed]` rather than dressing a guess up as a proven cause.',
115
- '',
116
- 'Explicitly: your output is the tree + the anchored planning deliveries ONLY. Do NOT create remediation Task or Bug issues during the audit. Do NOT create one delivery per audit area -- unify the audit into ONE focus tree and let each injection (each root cause) anchor exactly one planning delivery. Do NOT mutate workflow state beyond creating those planning deliveries, and do NOT attempt fixes.',
117
- '',
118
- 'When you are done, emit ONE fenced markdown block as the very last thing in your output, exactly in this shape (do not skip any field):',
119
- '',
120
- '```audit-summary',
121
- 'nodes_touched: <integer>',
122
- 'edges_touched: <integer>',
123
- 'summary: |',
124
- ' <markdown narrative -- one bullet per UDE/injection/anchored delivery, with seq numbers; call out any UDE left unresolved by derive_frt>',
125
- '```',
126
- '',
127
- 'If you author nothing (the tree already reflects reality and needs no new injections), still emit the block with nodes_touched: 0 / edges_touched: 0 and a one-line summary explaining why.',
128
- ].join('\n');
82
+ export { buildAuditPrompt, AUDIT_PROMPT, } from './audit-prompt.js';
83
+ // Also imported for use below (a re-export does not bind these locally).
84
+ import { buildAuditPrompt } from './audit-prompt.js';
129
85
  // ---------------------------------------------------------------------------
130
86
  // Summary parser
131
87
  // ---------------------------------------------------------------------------
@@ -277,9 +233,9 @@ export const defaultAuditDeps = {
277
233
  * returns 'continue' so the focus loop advances regardless of audit
278
234
  * outcome -- the row + metadata.errors describe what happened.
279
235
  */
280
- export async function runAuditPhase(focusId, deps = defaultAuditDeps) {
236
+ export async function runAuditPhase(focusId, deps = defaultAuditDeps, posture = 'live') {
281
237
  const errors = [];
282
- const metadata = {};
238
+ const metadata = { posture };
283
239
  let cycleNumber = 1;
284
240
  try {
285
241
  cycleNumber = await deps.getCurrentCycleNumber(focusId);
@@ -383,9 +339,10 @@ export async function runAuditPhase(focusId, deps = defaultAuditDeps) {
383
339
  errors.push(`assembly: ${err.message}`);
384
340
  }
385
341
  const config = deps.getConfig();
342
+ const auditPrompt = buildAuditPrompt(posture);
386
343
  const prompt = assembled
387
- ? `${assembled}\n\n---\n\n${AUDIT_PROMPT}`
388
- : AUDIT_PROMPT;
344
+ ? `${assembled}\n\n---\n\n${auditPrompt}`
345
+ : auditPrompt;
389
346
  // Resolve the prior audit-lineage session id to resume (INJ-E). Best-effort:
390
347
  // a lookup failure or an empty slot (first cycle) just yields a fresh session.
391
348
  let resumeSessionId = null;
@@ -1 +1 @@
1
- {"version":3,"file":"audit-phase.js","sourceRoot":"","sources":["../src/audit-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AACnF,oEAAoE;AACpE,OAAO,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,GAE9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,GAIlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EACL,eAAe,IAAI,sBAAsB,GAG1C,MAAM,oBAAoB,CAAC;AAG5B,8EAA8E;AAC9E,0CAA0C;AAC1C,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,eAAe;IACf,oBAAoB;IACpB,+CAA+C;IAC/C,uBAAuB;IACvB,yBAAyB;IACzB,mBAAmB;IACnB,uBAAuB;CACxB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,2CAA2C;IAC3C,gDAAgD;IAChD,gDAAgD;IAChD,gDAAgD;IAChD,+CAA+C;CAChD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,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AM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,eAAe,WAAW,mBAAmB,MAAM,CAAC,MAAM,WAAW;YAChF,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE,eAAe,WAAW,OAAO,OAAO,CAAC,YAAY,mBAAmB,OAAO,CAAC,YAAY,gBAAgB;QACvH,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Audit assessor PROMPT construction.
3
+ *
4
+ * Split out of audit-phase.ts (which owns the phase's orchestration: spawn,
5
+ * session lineage, audit_runs persistence, summary parsing). This module is the
6
+ * prompt half and is deliberately dependency-free -- pure string constants and
7
+ * composition, no imports -- so the phase logic and the prompt text can be read
8
+ * and changed independently.
9
+ *
10
+ * The posture-neutral discipline block below is kept BYTE-IDENTICAL to the MCP
11
+ * package's copy and is gated by audit-guide-sync.test.ts (which reads THIS
12
+ * file); see the sentinel comment above the const.
13
+ *
14
+ * Re-exported from audit-phase.ts, so existing importers are unaffected.
15
+ */
16
+ /**
17
+ * Audit posture: what actually happens to the remediation deliveries the
18
+ * assessor anchors. `read_only` is the audit/ratify posture -- deliveries rest
19
+ * at `planning` behind the human ratify gate. `live` is a past-planning,
20
+ * non-read-only focus -- deliveries are created `queued` and execute
21
+ * autonomously through the normal review gate, with NO human step before they
22
+ * run. The prompt tells the assessor the TRUTH for its posture so it never
23
+ * manufactures a human-review hold that does not exist (Bell CSN 2026-07-27).
24
+ */
25
+ export type AuditPosture = 'read_only' | 'live';
26
+ /**
27
+ * Compose the audit assessor prompt for a given posture. The read-only and live
28
+ * postures differ ONLY in the posture section; the discipline (AUDIT_GUIDE_SHARED)
29
+ * and the daemon summary tail are posture-independent.
30
+ */
31
+ export declare function buildAuditPrompt(posture: AuditPosture): string;
32
+ /**
33
+ * Back-compat default: the read-only-posture prompt. Retained so existing
34
+ * importers/tests that reference a static AUDIT_PROMPT keep working. The live
35
+ * call site (runAuditPhase) composes the prompt per-posture via buildAuditPrompt.
36
+ *
37
+ * CANONICAL SOURCE OF TRUTH for the posture-neutral discipline is the
38
+ * MCP-package constant AUDIT_TREE_AUTHORING_GUIDE in
39
+ * mcp/telora-products/src/handlers/auditTreeAuthoringGuide.ts (surfaced inline
40
+ * by telora_discover when the reality-tree domain loads); the AUDIT_GUIDE_SHARED
41
+ * block above mirrors it byte-for-byte, pinned by audit-guide-sync.test.ts.
42
+ */
43
+ export declare const AUDIT_PROMPT: string;
44
+ //# sourceMappingURL=audit-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-prompt.d.ts","sourceRoot":"","sources":["../src/audit-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,CAAC;AA8JhD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAQ9D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,QAAgC,CAAC"}
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Audit assessor PROMPT construction.
3
+ *
4
+ * Split out of audit-phase.ts (which owns the phase's orchestration: spawn,
5
+ * session lineage, audit_runs persistence, summary parsing). This module is the
6
+ * prompt half and is deliberately dependency-free -- pure string constants and
7
+ * composition, no imports -- so the phase logic and the prompt text can be read
8
+ * and changed independently.
9
+ *
10
+ * The posture-neutral discipline block below is kept BYTE-IDENTICAL to the MCP
11
+ * package's copy and is gated by audit-guide-sync.test.ts (which reads THIS
12
+ * file); see the sentinel comment above the const.
13
+ *
14
+ * Re-exported from audit-phase.ts, so existing importers are unaffected.
15
+ */
16
+ /**
17
+ * Posture-independent intro. The first line is stable across postures (a spawn
18
+ * test asserts the composed prompt begins with it). "READ-ONLY with respect to
19
+ * code" is true in EVERY posture -- the assessor never writes code -- and is
20
+ * distinct from the delivery-execution posture, which the section below states.
21
+ */
22
+ const AUDIT_INTRO = [
23
+ 'You are the read-only reality-tree audit assessor for a Telora focus.',
24
+ '',
25
+ 'A safe audit emits a TREE and a PLAN, never a task checklist. You are READ-ONLY with respect to code: discovery only. You author the intent structure -- the current reality, its root causes, and the leverage points -- and you anchor a plan of injection-anchored remediation deliveries. You do NOT fix anything, and you do NOT file remediation Task or Bug issues. Remediation is scoped LATER, one root cause at a time, from the injections you anchor here -- so there is no flat checklist to complete with completion-vigor and churn stays bounded to the real defects.',
26
+ ];
27
+ /**
28
+ * Posture-aware section: the truth about what happens to the deliveries the
29
+ * assessor anchors, in THIS focus's posture. This is the fix at the source for
30
+ * the Bell CSN incident -- an assessor on a live focus was told the read-only
31
+ * "a human reviews before any fix runs" model and manufactured the missing hold
32
+ * in prose. Never claim a human gate the posture does not provide.
33
+ */
34
+ function auditPostureSection(posture) {
35
+ if (posture === 'read_only') {
36
+ return [
37
+ '',
38
+ 'POSTURE -- read-only audit. This focus is a read-only audit: the remediation deliveries you anchor rest at `planning` behind the human ratify gate. Nothing executes until a human reviews your plan and ratifies it -- on this posture your anchored plan IS reviewed before any fix runs.',
39
+ ];
40
+ }
41
+ return [
42
+ '',
43
+ 'POSTURE -- live focus. This focus is live (past planning): the remediation deliveries you anchor are created `queued` and execute AUTONOMOUSLY through the normal review gate. There is NO human review step before they run. Do not author anything -- least of all acceptance criteria -- expecting a human to read it before execution; if you believe work must not run, escalate (see below), never write a hold into the plan.',
44
+ ];
45
+ }
46
+ /**
47
+ * Daemon-specific audit-summary tail block. Parsed by parseAuditSummary; lives
48
+ * ONLY here, not in the shared guide, and survives any restructuring.
49
+ */
50
+ const AUDIT_SUMMARY_TAIL = [
51
+ '',
52
+ 'When you are done, emit ONE fenced markdown block as the very last thing in your output, exactly in this shape (do not skip any field):',
53
+ '',
54
+ '```audit-summary',
55
+ 'nodes_touched: <integer>',
56
+ 'edges_touched: <integer>',
57
+ 'summary: |',
58
+ ' <markdown narrative -- one bullet per UDE/injection/anchored delivery, with seq numbers; call out any UDE left unresolved by derive_frt>',
59
+ '```',
60
+ '',
61
+ 'If you author nothing (the tree already reflects reality and needs no new injections), still emit the block with nodes_touched: 0 / edges_touched: 0 and a one-line summary explaining why.',
62
+ ];
63
+ // The const below is the posture-NEUTRAL tree-authoring discipline. It is kept
64
+ // BYTE-IDENTICAL to the AUDIT_GUIDE_SHARED constant in the MCP handler
65
+ // (mcp/telora-products/src/handlers/auditTreeAuthoringGuide.ts); the daemon
66
+ // cannot runtime-import the MCP package (no cross-package runtime import), so
67
+ // the prose is duplicated. The required-sync invariant is held MECHANICALLY,
68
+ // not by this comment: audit-guide-sync.test.ts extracts the text between the
69
+ // begin/end sentinel lines in both files and fails on any drift. The sentinel
70
+ // lines wrap ONLY the const declaration, so the extracted region is identical.
71
+ // Edit both, or the build goes red.
72
+ // SHARED-AUDIT-GUIDE:BEGIN
73
+ const AUDIT_GUIDE_SHARED = `## Rounds (distinct jobs -- not "find more")
74
+ 1. **Facts -> CRT.** Author the current reality. Create the focus's reality
75
+ tree if none exists (\`telora_reality_tree action=create\`), then add an
76
+ **entity** node per real component/observation and an **undesired_effect**
77
+ (UDE) node per observed problem (\`telora_reality_tree_node action=create\`).
78
+ State what IS, in evidence terms -- not a fix.
79
+ 2. **Relationships -> causal edges.** Wire cause -> effect with
80
+ \`telora_reality_tree_edge action=create\` (cause node -> effect node). This
81
+ is the load-bearing round: edges turn a list of symptoms into a causal
82
+ structure, so a single deep cause feeding many surface UDEs across different
83
+ audit areas becomes visible as ONE root in ONE tree -- which is exactly what
84
+ stops the "one delivery per area" sprawl.
85
+ 3. **Leverage -> injections.** Propose **injection** nodes at the LOWEST / root
86
+ causes (the nodes with the most downstream UDEs), not at the symptoms.
87
+ One injection at a root can clear a whole subtree of UDEs; that leverage is
88
+ the whole reason for the tree.
89
+ 4. **Self-validate -> derive_frt.** Call
90
+ \`telora_reality_tree action=derive_frt\` with the treeId. This is read-only:
91
+ it returns the cleared/flipped UDE sets the injections produce. Confirm each
92
+ injection flips the UDEs you targeted. If a UDE is left unresolved by your
93
+ injection set, REPORT it -- do not hide it and do not lower the bar to make
94
+ the tree look clean. An honest "this UDE has no injection yet" is signal; a
95
+ silently dropped UDE is noise.
96
+ 5. **Anchor the plan -> injection-anchored deliveries.** For each injection,
97
+ create a remediation delivery with
98
+ \`telora_product_delivery action=create\`, passing
99
+ \`injectionNodeId=<the injection node>\` and \`executionStatus="planning"\`.
100
+ Set its acceptance to the **FRT desired effect** -- the future-state the
101
+ injection produces (what becomes true once the root cause is cleared), NOT a
102
+ list of edits and NOT process instructions.
103
+
104
+ Explicitly, in the audit phase your output is **the tree + the anchored
105
+ planning deliveries only.** Do NOT create remediation Task or Bug issues. Do
106
+ NOT create one delivery per audit area -- unify the audit into ONE focus tree
107
+ and let each injection (each root cause) anchor exactly one planning delivery.
108
+ Do NOT attempt fixes.
109
+
110
+ ## Acceptance criteria carry the future state ONLY -- never a hold
111
+ A remediation delivery's acceptanceCriteria state ONLY the **FRT desired
112
+ effect**: the future-state that becomes true once the root cause is cleared.
113
+ AcceptanceCriteria are NOT workflow state and NOT a channel to a human. Never
114
+ write into acceptanceCriteria:
115
+ - process instructions or step-by-step directions to the executing team,
116
+ - a hold, a pause, or an approval requirement (e.g. "HOLD FOR HUMAN REVIEW
117
+ BEFORE EXECUTING", "do not execute until ...", "wait for sign-off"),
118
+ - status commentary or notes about what you think should happen next.
119
+
120
+ Prose is invisible to the workflow: a hold written into acceptanceCriteria
121
+ gates nothing, and on a live focus the executing team either obeys a stop the
122
+ machine never enforces or is misled by an instruction it should never have been
123
+ given. If you believe the work must NOT run yet -- a dependency is missing, or
124
+ the decision needs human intent -- the ONLY channel for that belief is an
125
+ escalation via \`telora_agent action=escalate\`. Raise the doubt as an
126
+ escalation; never encode it as acceptance-criteria text.
127
+
128
+ ## Statement quality (Goldratt Categories of Legitimate Reservation)
129
+ Hold every node to three statement-quality reservations AS YOU WRITE IT --
130
+ inline with the rounds above, not a separate pass:
131
+ - **Clarity.** Each statement is ONE unambiguous declarative sentence that
132
+ reads standalone -- no jargon or pronoun a reviewer must guess at.
133
+ - **Entity Existence.** Each entity / UDE names a COMPLETE, REAL state that
134
+ actually exists, not a sentence fragment or a vague gesture. Prefer a
135
+ grounded observation over an invented abstraction.
136
+ - **Tautology.** In the relationships round, no cause -> effect pair may be
137
+ circular: an effect must NOT be offered as the reason its own cause exists.
138
+
139
+ A node that fails any of these radiates unearned certainty; fix the statement
140
+ before you wire it. These reservations cost no extra call -- they are how you
141
+ write each node, not a gate you run afterward.
142
+
143
+ ## Two hard integrity gates (deterministic; a tree must pass to present)
144
+ The tree dump (\`telora_reality_tree action=dump\`) computes and surfaces two
145
+ deterministic doubt-revealer gates near its header, so unearned certainty
146
+ cannot hide:
147
+ - **Connectivity (NO ORPHANS).** A node with zero edges of ANY type AND no
148
+ \`evidence\` is an ORPHAN -- it floats, neither wired into the causal graph nor
149
+ folded into its own evidence. A single orphan makes the tree **NOT
150
+ presentable**; the dump names the orphan seqs. Fix it: wire the node to a
151
+ cause/effect with an edge, or ground it by setting \`evidence\`. An orphan is
152
+ reality with nothing to measure it against -- it must not survive to review.
153
+ - **Evidence-or-assumed.** An \`entity\` / \`undesired_effect\` with empty/null
154
+ \`evidence\` renders an \`[assumed]\` marker; with evidence it renders
155
+ \`(evidence)\`. Assumed is NOT a violation -- it is an honest hedge that the
156
+ claim is unearned certainty until grounded. Set \`evidence\` on the nodes you
157
+ can actually observe; leave the rest visibly \`[assumed]\` rather than dressing
158
+ a guess up as a proven cause.
159
+
160
+ ## Why this shape (the discipline it enforces)
161
+ A flat checklist invites an agent to "complete" it -- to keep going until every
162
+ box is ticked, which churns code well beyond the real defects. An
163
+ injection-anchored plan inverts that: remediation is scoped one root cause at a
164
+ time from an injection, with acceptance pinned to a desired effect, so there is
165
+ nothing to over-complete. The structured CRT + FRT make a wrong root cause
166
+ legible as a plan -- catchable up front rather than only after code has moved.`;
167
+ // SHARED-AUDIT-GUIDE:END
168
+ /**
169
+ * Compose the audit assessor prompt for a given posture. The read-only and live
170
+ * postures differ ONLY in the posture section; the discipline (AUDIT_GUIDE_SHARED)
171
+ * and the daemon summary tail are posture-independent.
172
+ */
173
+ export function buildAuditPrompt(posture) {
174
+ return [
175
+ ...AUDIT_INTRO,
176
+ ...auditPostureSection(posture),
177
+ '',
178
+ AUDIT_GUIDE_SHARED,
179
+ ...AUDIT_SUMMARY_TAIL,
180
+ ].join('\n');
181
+ }
182
+ /**
183
+ * Back-compat default: the read-only-posture prompt. Retained so existing
184
+ * importers/tests that reference a static AUDIT_PROMPT keep working. The live
185
+ * call site (runAuditPhase) composes the prompt per-posture via buildAuditPrompt.
186
+ *
187
+ * CANONICAL SOURCE OF TRUTH for the posture-neutral discipline is the
188
+ * MCP-package constant AUDIT_TREE_AUTHORING_GUIDE in
189
+ * mcp/telora-products/src/handlers/auditTreeAuthoringGuide.ts (surfaced inline
190
+ * by telora_discover when the reality-tree domain loads); the AUDIT_GUIDE_SHARED
191
+ * block above mirrors it byte-for-byte, pinned by audit-guide-sync.test.ts.
192
+ */
193
+ export const AUDIT_PROMPT = buildAuditPrompt('read_only');
194
+ //# sourceMappingURL=audit-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-prompt.js","sourceRoot":"","sources":["../src/audit-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH;;;;;GAKG;AACH,MAAM,WAAW,GAAsB;IACrC,uEAAuE;IACvE,EAAE;IACF,ujBAAujB;CACxjB,CAAC;AAEF;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,OAAqB;IAChD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QAC5B,OAAO;YACL,EAAE;YACF,6RAA6R;SAC9R,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE;QACF,saAAsa;KACva,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,kBAAkB,GAAsB;IAC5C,EAAE;IACF,yIAAyI;IACzI,EAAE;IACF,kBAAkB;IAClB,0BAA0B;IAC1B,0BAA0B;IAC1B,YAAY;IACZ,4IAA4I;IAC5I,KAAK;IACL,EAAE;IACF,6LAA6L;CAC9L,CAAC;AAEF,+EAA+E;AAC/E,uEAAuE;AACvE,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,oCAAoC;AACpC,2BAA2B;AAC3B,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA6FoD,CAAC;AAChF,yBAAyB;AAEzB;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAqB;IACpD,OAAO;QACL,GAAG,WAAW;QACd,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC/B,EAAE;QACF,kBAAkB;QAClB,GAAG,kBAAkB;KACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC"}
@@ -19,11 +19,47 @@ import type { DaemonConfig } from './types.js';
19
19
  import { type CiStatusReader } from './ci-status.js';
20
20
  /** escalation_kind for a red CI run on integration. */
21
21
  export declare const CI_RUN_RED_ESCALATION_KIND = "ci_run_red";
22
+ /** Minimal open-escalation row shape the sensor's dedup / resolve reads. */
23
+ interface CiEscalationRow {
24
+ id: string;
25
+ status?: string | null;
26
+ escalationKind?: string | null;
27
+ productId?: string | null;
28
+ metadata?: Record<string, unknown> | null;
29
+ }
30
+ /**
31
+ * Whether a re-file for THIS red sha must be suppressed. Two ways it is:
32
+ * - an OPEN or DISMISSED row already carries the same cause key (sha+branch) --
33
+ * the cause-keyed path with DISMISSAL MEMORY. This is what fixes the incident
34
+ * where an operator dismissed a ci_run_red for a sha and the daemon re-filed
35
+ * the SAME sha on the next scan: a dismissed cause_key now keeps it silent
36
+ * until a NEW sha (a different cause key) goes red.
37
+ * - a legacy OPEN product+kind row with no cause_key exists (deployment-window
38
+ * back-compat for rows filed before this change).
39
+ *
40
+ * A new sha yields a different cause key with no matching open/dismissed row and
41
+ * re-files; a later green run resolves the open row via resolveCiRedEscalations.
42
+ */
43
+ /**
44
+ * Pure suppression predicate over already-fetched rows. A re-file for this red
45
+ * sha is suppressed when an open/dismissed row carries the same cause key
46
+ * (dismissal memory), or a legacy open product+kind row exists. Exported for
47
+ * direct unit testing (no callApi mocking needed).
48
+ */
49
+ export declare function isCiRedRefileSuppressed(rows: readonly CiEscalationRow[], params: {
50
+ productId: string;
51
+ sha: string;
52
+ branch: string;
53
+ }): boolean;
22
54
  /** Injected IO for the sensor tick. Defaults reach for the real implementations. */
23
55
  export interface CiSensorDeps {
24
56
  getCiStatus: CiStatusReader;
25
57
  resolveIntegrationTip: (config: DaemonConfig) => string | null;
26
- hasOpenCiRedEscalation: (productId: string) => Promise<boolean>;
58
+ hasOpenCiRedEscalation: (params: {
59
+ productId: string;
60
+ sha: string;
61
+ branch: string;
62
+ }) => Promise<boolean>;
27
63
  fileCiRedEscalation: (params: {
28
64
  organizationId: string;
29
65
  productId: string;
@@ -44,4 +80,5 @@ export interface CiSensorTickCounts {
44
80
  * failure on one product never aborts the others.
45
81
  */
46
82
  export declare function runCiSensorTick(config: DaemonConfig, deps?: CiSensorDeps): Promise<CiSensorTickCounts>;
83
+ export {};
47
84
  //# sourceMappingURL=ci-sensor-loop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ci-sensor-loop.d.ts","sourceRoot":"","sources":["../src/ci-sensor-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK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