@telora/daemon 0.17.70 → 0.17.75

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 (41) hide show
  1. package/build-info.json +3 -2
  2. package/dist/cascade-restatement.d.ts +7 -0
  3. package/dist/cascade-restatement.d.ts.map +1 -1
  4. package/dist/cascade-restatement.js +52 -3
  5. package/dist/cascade-restatement.js.map +1 -1
  6. package/dist/cli/backfill-frt-prose.d.ts +25 -13
  7. package/dist/cli/backfill-frt-prose.d.ts.map +1 -1
  8. package/dist/cli/backfill-frt-prose.js +45 -41
  9. package/dist/cli/backfill-frt-prose.js.map +1 -1
  10. package/dist/focus-executor.d.ts +9 -0
  11. package/dist/focus-executor.d.ts.map +1 -1
  12. package/dist/focus-executor.js +10 -1
  13. package/dist/focus-executor.js.map +1 -1
  14. package/dist/listener.d.ts.map +1 -1
  15. package/dist/listener.js +23 -3
  16. package/dist/listener.js.map +1 -1
  17. package/dist/queries/deliveries.d.ts +12 -0
  18. package/dist/queries/deliveries.d.ts.map +1 -1
  19. package/dist/queries/deliveries.js +9 -0
  20. package/dist/queries/deliveries.js.map +1 -1
  21. package/dist/queries/index.d.ts +1 -1
  22. package/dist/queries/index.d.ts.map +1 -1
  23. package/dist/queries/index.js +1 -1
  24. package/dist/queries/index.js.map +1 -1
  25. package/dist/queries/schemas.d.ts +2 -0
  26. package/dist/queries/schemas.d.ts.map +1 -1
  27. package/dist/queries/schemas.js +5 -0
  28. package/dist/queries/schemas.js.map +1 -1
  29. package/dist/retire-aware-restatement.d.ts +83 -0
  30. package/dist/retire-aware-restatement.d.ts.map +1 -0
  31. package/dist/retire-aware-restatement.js +137 -0
  32. package/dist/retire-aware-restatement.js.map +1 -0
  33. package/dist/supabase.d.ts +1 -1
  34. package/dist/supabase.d.ts.map +1 -1
  35. package/dist/supabase.js +1 -1
  36. package/dist/supabase.js.map +1 -1
  37. package/dist/templates/claude-md.d.ts +1 -1
  38. package/dist/templates/claude-md.d.ts.map +1 -1
  39. package/dist/templates/claude-md.js +6 -0
  40. package/dist/templates/claude-md.js.map +1 -1
  41. package/package.json +2 -2
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Retire-aware FRT desired-effect prose authoring.
3
+ *
4
+ * The eager cascade-prose path (`cascade-restatement.ts`) authors `frt_statement`
5
+ * by reading `reality_tree_derive_frt`, whose server handler loads ONLY
6
+ * status='active' nodes. An injection retires (status='retired',
7
+ * injectionStatus='verified') the moment its anchoring delivery verifies -- the
8
+ * terminal state of every COMPLETED focus -- so derive_frt no longer sees it.
9
+ * Any UDE that a close-loop sweep flipped with no supplied restatement is left
10
+ * with its base `statement` unchanged (still the present-tense problem text) and
11
+ * `frt_statement` null. The cascade path can never repair that hole because the
12
+ * injection is gone from its active set.
13
+ *
14
+ * This module is the retire-aware authoring path. Given a tree it finds the UDEs
15
+ * that VERIFIED/RETIRED injections flipped and authors any missing
16
+ * `frt_statement` -- mirroring Ship Log Pass 2's intent (surface the realized
17
+ * differential of a completed focus) but on the AUTHORING side.
18
+ *
19
+ * SOURCE OF THE INJECTION->UDE LINK. `reality_tree_verify_injection` DELETES an
20
+ * injection's `targets` edges at retirement (graph-verification.ts:240-245), so
21
+ * a completed focus retains NONE of them -- reading targets edges would find
22
+ * zero. The only durable record is `reality_tree_node_history`
23
+ * (injection_id, node_id, previous_statement), snapshotted at verify
24
+ * (graph-verification.ts:347-353,383-391). We reach it through the existing
25
+ * node-keyed `reality_tree_injection_history` action -- no new server action.
26
+ *
27
+ * Overlay-only: only `frt_statement` is written (matching the `frtStatement ??
28
+ * statement` display contract); node_type and the base statement are untouched.
29
+ *
30
+ * Idempotent + safe: a candidate is authored only when (a) it is a
31
+ * `desired_effect` node with a blank `frt_statement`, (b) a verified-injection
32
+ * history row references it, and (c) its base `statement` still equals the
33
+ * snapshotted pre-flip UDE text. (c) skips nodes whose base statement was
34
+ * already promoted to positive prose at verify (a restatement was supplied), and
35
+ * combined with (a) makes re-runs a no-op once `frt_statement` is written.
36
+ *
37
+ * Reuses `authorRestatement` (injection-conditioned) -- it does NOT duplicate the
38
+ * prompt/model logic. Best-effort per node: a per-node failure is swallowed (that
39
+ * node is recorded skipped) so one failure never aborts the tree.
40
+ *
41
+ * @module retire-aware-restatement
42
+ */
43
+ import type { CallApiFn, AuthorRestatementFn } from './cascade-restatement.js';
44
+ /**
45
+ * A node whose `frt_statement` should be authored from a verified/retired
46
+ * injection. `statement` is the original UDE text to restate; `injectionStatements`
47
+ * condition the prose.
48
+ */
49
+ export interface RetiredInjectionCandidate {
50
+ nodeId: string;
51
+ /** The original (pre-flip) UDE text -- the thing to restate positively. */
52
+ statement: string;
53
+ /** Verified injection statement(s) that flipped this node, for conditioning. */
54
+ injectionStatements: string[];
55
+ }
56
+ export interface RetireAwareDeps {
57
+ callApi?: CallApiFn;
58
+ authorRestatement?: AuthorRestatementFn;
59
+ }
60
+ /**
61
+ * Find the retire-aware authoring candidates for one tree: `desired_effect`
62
+ * nodes with a blank `frt_statement` that a VERIFIED/RETIRED injection flipped
63
+ * (per node history) and whose base `statement` is still the raw pre-flip UDE
64
+ * text. Read-only -- no model calls, no writes. The dry-run preview and the
65
+ * write path share this selection so they never diverge.
66
+ */
67
+ export declare function findRetiredInjectionRestatementCandidates(treeId: string, deps?: {
68
+ callApi?: CallApiFn;
69
+ }): Promise<RetiredInjectionCandidate[]>;
70
+ /**
71
+ * Author missing `frt_statement` prose for the UDEs that verified/retired
72
+ * injections flipped on one tree. Delegates candidate selection to
73
+ * `findRetiredInjectionRestatementCandidates`, then authors one positive
74
+ * future-state sentence per candidate (injection-conditioned) and writes it via
75
+ * `reality_tree_node_update`.
76
+ *
77
+ * Best-effort per node; idempotent (already-authored nodes are not candidates).
78
+ */
79
+ export declare function authorRetiredInjectionRestatements(treeId: string, deps?: RetireAwareDeps): Promise<{
80
+ authored: string[];
81
+ skipped: string[];
82
+ }>;
83
+ //# sourceMappingURL=retire-aware-restatement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retire-aware-restatement.d.ts","sourceRoot":"","sources":["../src/retire-aware-restatement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AA0B/E;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;CACzC;AAED;;;;;;GAMG;AACH,wBAAsB,yCAAyC,CAC7D,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,SAAS,CAAA;CAAO,GACjC,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAyDtC;AAED;;;;;;;;GAQG;AACH,wBAAsB,kCAAkC,CACtD,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAgCpD"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Retire-aware FRT desired-effect prose authoring.
3
+ *
4
+ * The eager cascade-prose path (`cascade-restatement.ts`) authors `frt_statement`
5
+ * by reading `reality_tree_derive_frt`, whose server handler loads ONLY
6
+ * status='active' nodes. An injection retires (status='retired',
7
+ * injectionStatus='verified') the moment its anchoring delivery verifies -- the
8
+ * terminal state of every COMPLETED focus -- so derive_frt no longer sees it.
9
+ * Any UDE that a close-loop sweep flipped with no supplied restatement is left
10
+ * with its base `statement` unchanged (still the present-tense problem text) and
11
+ * `frt_statement` null. The cascade path can never repair that hole because the
12
+ * injection is gone from its active set.
13
+ *
14
+ * This module is the retire-aware authoring path. Given a tree it finds the UDEs
15
+ * that VERIFIED/RETIRED injections flipped and authors any missing
16
+ * `frt_statement` -- mirroring Ship Log Pass 2's intent (surface the realized
17
+ * differential of a completed focus) but on the AUTHORING side.
18
+ *
19
+ * SOURCE OF THE INJECTION->UDE LINK. `reality_tree_verify_injection` DELETES an
20
+ * injection's `targets` edges at retirement (graph-verification.ts:240-245), so
21
+ * a completed focus retains NONE of them -- reading targets edges would find
22
+ * zero. The only durable record is `reality_tree_node_history`
23
+ * (injection_id, node_id, previous_statement), snapshotted at verify
24
+ * (graph-verification.ts:347-353,383-391). We reach it through the existing
25
+ * node-keyed `reality_tree_injection_history` action -- no new server action.
26
+ *
27
+ * Overlay-only: only `frt_statement` is written (matching the `frtStatement ??
28
+ * statement` display contract); node_type and the base statement are untouched.
29
+ *
30
+ * Idempotent + safe: a candidate is authored only when (a) it is a
31
+ * `desired_effect` node with a blank `frt_statement`, (b) a verified-injection
32
+ * history row references it, and (c) its base `statement` still equals the
33
+ * snapshotted pre-flip UDE text. (c) skips nodes whose base statement was
34
+ * already promoted to positive prose at verify (a restatement was supplied), and
35
+ * combined with (a) makes re-runs a no-op once `frt_statement` is written.
36
+ *
37
+ * Reuses `authorRestatement` (injection-conditioned) -- it does NOT duplicate the
38
+ * prompt/model logic. Best-effort per node: a per-node failure is swallowed (that
39
+ * node is recorded skipped) so one failure never aborts the tree.
40
+ *
41
+ * @module retire-aware-restatement
42
+ */
43
+ import { callApi as defaultCallApi } from './queries/shared.js';
44
+ import { authorRestatement as defaultAuthorRestatement, needsRestatement, } from './de-restatement.js';
45
+ /**
46
+ * Find the retire-aware authoring candidates for one tree: `desired_effect`
47
+ * nodes with a blank `frt_statement` that a VERIFIED/RETIRED injection flipped
48
+ * (per node history) and whose base `statement` is still the raw pre-flip UDE
49
+ * text. Read-only -- no model calls, no writes. The dry-run preview and the
50
+ * write path share this selection so they never diverge.
51
+ */
52
+ export async function findRetiredInjectionRestatementCandidates(treeId, deps = {}) {
53
+ const callApi = deps.callApi ?? defaultCallApi;
54
+ // Active nodes: a flipped UDE becomes an ACTIVE desired_effect node (the
55
+ // injection auto-flips node_type at verify; only crt_only nodes are retired).
56
+ const nodesResp = await callApi('reality_tree_node_list', {
57
+ treeId,
58
+ status: 'active',
59
+ });
60
+ const nodes = nodesResp.items ?? [];
61
+ // Cheap pre-filter: desired_effect nodes still missing positive overlay prose.
62
+ const preCandidates = nodes.filter((n) => n.nodeType === 'desired_effect' && needsRestatement(n.frtStatement));
63
+ const candidates = [];
64
+ for (const node of preCandidates) {
65
+ let history;
66
+ try {
67
+ history = await callApi('reality_tree_injection_history', {
68
+ nodeId: node.id,
69
+ });
70
+ }
71
+ catch {
72
+ // No durable history reachable -> cannot establish injection provenance; skip.
73
+ continue;
74
+ }
75
+ // Only promotions by a VERIFIED (retired) injection qualify. An active
76
+ // injection's flip is the cascade path's job; a native desired_effect has no
77
+ // history row at all.
78
+ const verifiedRows = (history.history ?? []).filter((h) => h.injection?.injectionStatus === 'verified' &&
79
+ typeof h.injection?.statement === 'string' &&
80
+ h.injection.statement.trim() !== '');
81
+ if (verifiedRows.length === 0)
82
+ continue;
83
+ // The latest verified promotion carries the pre-flip UDE text to restate.
84
+ const latest = verifiedRows[verifiedRows.length - 1];
85
+ const originalUde = (latest.previousStatement ?? '').trim();
86
+ if (originalUde === '')
87
+ continue;
88
+ // If the base statement no longer equals the pre-flip UDE text, a restatement
89
+ // was already promoted into it at verify -> display is already positive -> skip.
90
+ if (!needsRestatement(node.statement, originalUde))
91
+ continue;
92
+ const injectionStatements = [
93
+ ...new Set(verifiedRows.map((h) => h.injection.statement.trim())),
94
+ ];
95
+ candidates.push({ nodeId: node.id, statement: originalUde, injectionStatements });
96
+ }
97
+ return candidates;
98
+ }
99
+ /**
100
+ * Author missing `frt_statement` prose for the UDEs that verified/retired
101
+ * injections flipped on one tree. Delegates candidate selection to
102
+ * `findRetiredInjectionRestatementCandidates`, then authors one positive
103
+ * future-state sentence per candidate (injection-conditioned) and writes it via
104
+ * `reality_tree_node_update`.
105
+ *
106
+ * Best-effort per node; idempotent (already-authored nodes are not candidates).
107
+ */
108
+ export async function authorRetiredInjectionRestatements(treeId, deps = {}) {
109
+ const callApi = deps.callApi ?? defaultCallApi;
110
+ const author = deps.authorRestatement ?? defaultAuthorRestatement;
111
+ const authored = [];
112
+ const skipped = [];
113
+ const candidates = await findRetiredInjectionRestatementCandidates(treeId, { callApi });
114
+ for (const candidate of candidates) {
115
+ try {
116
+ const text = await author({
117
+ udeStatement: candidate.statement,
118
+ injectionStatements: candidate.injectionStatements.length > 0 ? candidate.injectionStatements : undefined,
119
+ });
120
+ if (!text || text.trim() === '') {
121
+ skipped.push(candidate.nodeId);
122
+ continue;
123
+ }
124
+ await callApi('reality_tree_node_update', {
125
+ nodeId: candidate.nodeId,
126
+ frtStatement: text.trim(),
127
+ });
128
+ authored.push(candidate.nodeId);
129
+ }
130
+ catch {
131
+ // best-effort: skip this node, keep going.
132
+ skipped.push(candidate.nodeId);
133
+ }
134
+ }
135
+ return { authored, skipped };
136
+ }
137
+ //# sourceMappingURL=retire-aware-restatement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retire-aware-restatement.js","sourceRoot":"","sources":["../src/retire-aware-restatement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACL,iBAAiB,IAAI,wBAAwB,EAC7C,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AA6C7B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,yCAAyC,CAC7D,MAAc,EACd,OAAgC,EAAE;IAElC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,cAAc,CAAC;IAE/C,yEAAyE;IACzE,8EAA8E;IA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AAE,KAAK,EAAE,EAAE,CAAC;gBAChC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/B,SAAS;YACX,CAAC;YACD,MAAM,OAAO,CAAC,0BAA0B,EAAE;gBACxC,MAAM,EAAE,SAAS,CAAC,MAAM;gBACxB,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE;aAC1B,CAAC,CAAC;YACH,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,2CAA2C;YAC3C,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC"}
@@ -11,7 +11,7 @@ export { initSupabase, validateTrackerAuth } from './queries/shared.js';
11
11
  export { getAgentRoles, getAgentRole } from './queries/roles.js';
12
12
  export { getActiveSessions, getActiveSessionCountByRole, getCompletedSessionAggregates, createSession, updateSession, } from './queries/sessions.js';
13
13
  export type { CreateSessionParams, SessionAggregates } from './queries/sessions.js';
14
- export { getReadyDeliveries, getDeliveryContext, updateDeliveryStatus, recordDeliveryTransition, markDeliveryAutoApproved, updateDeliveryMergeCommitSha, getDoneDeliveries, getReadyFocuses, getActiveFocuses, getMergeConflictDeliveries, reportGitState, recordFocusMerge, } from './queries/deliveries.js';
14
+ export { getReadyDeliveries, getDeliveryContext, updateDeliveryStatus, recordDeliveryTransition, markDeliveryAutoApproved, updateDeliveryMergeCommitSha, getDoneDeliveries, getReadyFocuses, getActiveFocuses, getMergeConflictDeliveries, reportGitState, recordFocusMerge, clearAnswerRearm, } from './queries/deliveries.js';
15
15
  export type { TransitionRecord } from './queries/deliveries.js';
16
16
  export { fetchEffectiveWorkflow, fetchEffectiveWorkflowWithTransitions } from './queries/workflows.js';
17
17
  export { getDeliveryIssues, getDeliverySessionCount, updateIssueStatus, createEscalation, hasOpenEscalationForDelivery, createIssue, } from './queries/issues.js';
@@ -1 +1 @@
1
- {"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../src/supabase.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACb,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAGpF,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,0BAA0B,EAC1B,cAAc,EACd,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAAE,sBAAsB,EAAE,qCAAqC,EAAE,MAAM,wBAAwB,CAAC;AAGvG,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,qCAAqC,GACtC,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EACL,kBAAkB,EAClB,cAAc,E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,CAAC,CAGtF;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,KAAK,CAEnC"}
package/dist/supabase.js CHANGED
@@ -14,7 +14,7 @@ export { getAgentRoles, getAgentRole } from './queries/roles.js';
14
14
  // -- Agent Sessions --
15
15
  export { getActiveSessions, getActiveSessionCountByRole, getCompletedSessionAggregates, createSession, updateSession, } from './queries/sessions.js';
16
16
  // -- Deliveries & Focuses --
17
- export { getReadyDeliveries, getDeliveryContext, updateDeliveryStatus, recordDeliveryTransition, markDeliveryAutoApproved, updateDeliveryMergeCommitSha, getDoneDeliveries, getReadyFocuses, getActiveFocuses, getMergeConflictDeliveries, reportGitState, recordFocusMerge, } from './queries/deliveries.js';
17
+ export { getReadyDeliveries, getDeliveryContext, updateDeliveryStatus, recordDeliveryTransition, markDeliveryAutoApproved, updateDeliveryMergeCommitSha, getDoneDeliveries, getReadyFocuses, getActiveFocuses, getMergeConflictDeliveries, reportGitState, recordFocusMerge, clearAnswerRearm, } from './queries/deliveries.js';
18
18
  // -- Workflows --
19
19
  export { fetchEffectiveWorkflow, fetchEffectiveWorkflowWithTransitions } from './queries/workflows.js';
20
20
  // -- Issues & Escalations --
@@ -1 +1 @@
1
- {"version":3,"file":"supabase.js","sourceRoot":"","sources":["../src/supabase.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,mCAAmC;AACnC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAExE,oBAAoB;AACpB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,uBAAuB;AACvB,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACb,aAAa,GACd,MAAM,uBAAuB,CAAC;AAG/B,6BAA6B;AAC7B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,E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,CAAC;AAG9B,uBAAuB;AACvB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAGhC,sBAAsB;AACtB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAGpC,iBAAiB;AACjB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,8CAA8C;AAE9C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,eAAuB;IAClE,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC7F,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;AAC3F,CAAC"}
@@ -29,7 +29,7 @@ export declare const TELORA_CLAUDE_MD_END = "<!-- END TELORA SEED -->";
29
29
  * For Codex: the MCP server is registered in `~/.codex/config.toml` (global).
30
30
  */
31
31
  export declare const SEED_MCP_REGISTRATION_SENTENCE = "The Telora MCP server is registered in `.mcp.json`.";
32
- export declare const SEED_BODY = "# Telora workstation context\n\nThis repo is connected to Telora -- a differential control plane for\nsoftware delivery. Intent and reality are paired signals; the meaningful\nwork happens at the difference.\n\n## Before you write any code (read this first)\n\nDEFAULT: on a Telora-connected workstation, a new capability starts as\n**declared intent** before any code. When the user says \"I want to build\nX\", your first move is NOT to scaffold X -- it is to declare it: create\n(or select) a Focus -> delivery -> issue and move an issue to **In\nProgress**. Code is written only after intent is anchored above it.\n\nThis polarity is deliberate and easy to get backwards. Building directly\nin the working tree -- scaffolding, installing dependencies, starting a\ndev server, writing application files -- is the **exception**, taken ONLY\nwhen the user explicitly asks for it. Recognized bypass phrases:\n\"build locally\", \"just write it\", \"skip Telora\", \"don't track this\",\n\"throwaway\". Absent an explicit signal like these, treat any build\nrequest as a request to declare intent in Telora first.\n\nAsking good clarifying questions about stack, scope, or dependencies is\nNOT a substitute for this step -- that is execution-layer scoping, and it\ncomes *after* the capability is declared, not instead of it. Scoping is\nagent work; declaring that a capability matters is the part that must\nland in Telora first.\n\n**Surface the fork; do not silently pick it.** The common failure is\nresolving an ambiguous request toward the path of least resistance --\ne.g. reading \"a web app I run locally on my LAN\" (a deployment target) as\n\"build locally\" (skip Telora). When intent is not already explicit, your\nFIRST response to a build request names the choice rather than assuming\nit: \"I'll scope this in Telora unless you want it built locally -- which?\"\nOne question, once, at the start. Let the user pick; never pick for them\nby starting to type code.\n\n**First action rule.** On a build / new-capability request, your first\ntool call is a Telora planning call (telora_product_focus / _delivery /\n_issue) OR the fork question above -- never Write, Edit, or a code-running\nBash command. If the first move cannot be code, building-before-intent\ncannot happen.\n\nWhy: an artifact with no declared intent above it is reality moving with\nnothing to measure it against -- pure noise to the differential loop. The\nwhole system is built to compute intent-minus-reality; code that skips\nthe intent half defeats the instrument.\n\n## Planning hierarchy\n\n- **Focus** = the context that defines an area of work -- not \"one\n capability.\" All phases of building within that area belong in one\n focus; if a \"focus\" is really just one phase, fold it back in.\n- **Delivery** = a shippable phase or major component of a capability.\n- **Context Group** = optional grouping of related issues that share\n meaningful context (relevant files, architectural notes). A CG earns its\n existence by carrying context, not by being a folder.\n- **Task** = one discrete implementable unit. Bounded files, focused\n session. Multiple \"and\" clauses across different concerns means split.\n\nScope by purpose, not count. The right number of deliveries is however\nmany phases the work naturally has.\n\n## PRD: \"build a working app in one run\"\n\nA **PRD** sits one altitude above Focus (Product -> PRD -> Focus): a\nbounded, verifiable, retire-able milestone carrying a **Prerequisite Tree**\nof `goal` / `obstacle` / `overcome` nodes. Each `overcome` materializes\nas a focus; the daemon progressively arms the **frontier** of foci as\nupstream obstacles clear. This is the entry point a user means by \"build a\nfully working app in one go.\"\n\nIt is NOT big-bang generation: you author the tree once, commit a path,\nand the differential loop walks the frontier to completion -- the execution\nunderneath is still the normal focus -> delivery -> issue + review loop.\n\nThe PRD tools are **lazy-loaded** -- they do not exist until you load the\ndomain. If you don't see `telora_prd` / `telora_prd_tree`, run:\n\n```\ntelora_discover { action: \"load\", domain: \"prd\" }\n```\n\nThen: `telora_prd` create (referencing a Vision) -> `telora_prd_tree`\nauthor nodes (obstacles carry a verifiable `clearancePredicate`) + edges ->\ncommit a pathway -> `materialize_overcome` each into a focus -> arm the\ndaemon PRD loop. All authoring is harness+MCP; there is no Telora authoring UI.\n\n## Issue workflow\n\n`To Do` -> `In Progress` -> `In Review` / `Blocked` -> `Done`.\n\nIssue types: **Context Group**, **Task**, **Bug**.\n\nMovement rules:\n\n- An issue MUST be set to `In Progress` before any work begins on it.\n- Never skip `In Progress`. Never move directly from `To Do` to `Done`.\n- Set status with `telora_product_issue` action=update.\n\nDelivery and focus stages advance automatically based on issue\nactivity. Agents never set delivery executionStatus directly.\n\n## MCP tool surface (what's available in this session)\n\nThe Telora MCP server is registered in `.mcp.json`. Core tool families:\n\n- `telora_product` -- list/get/create/update products\n- `telora_product_focus` -- focuses under a product\n- `telora_product_delivery` -- deliveries under a focus\n- `telora_product_issue` -- issues (Context Groups, Tasks, Bugs) under a delivery\n- `telora_agent` -- agent roles, escalation requests\n- `telora_loop_*` -- loop documents, questions, answers\n- `telora_discover` -- on-demand registration of deferred tool domains\n\nResolve the live tool list at runtime via `telora_discover` rather than\nhard-coding a list that drifts.\n\n## Human-vs-agent boundaries\n\n- Humans own **intent** and **completion**.\n - Intent: what capability matters, what changes when. Pre-handoff.\n - Completion: closing the loop on whether a focus is done. Post-handoff.\n- Agents own **scoping** and **execution**.\n - Scoping: decomposing a focus into deliveries, deliveries into\n issues, restructuring mid-flight as the agent learns more.\n - Execution: writing code, running tests, committing, reporting.\n\nDo not ask humans for operational details they expect the agent to figure\nout. Do not silently complete a focus on the human's behalf. Escalate\nwhen stuck via `telora_agent` action=escalate.\n\n## Differential signaling\n\nTelora is asymmetric: it moves reality toward intent, never the reverse.\nAgents do not lower the bar to make signals look better -- they escalate.\nEvery artifact (commit, work summary, gate result) is signal toward the\ndeclared intent; raw activity without intent reduction is noise.\n\nA short corrective comment from the user is high-signal -- treat brief\npushback as the most important input in the session.\n\n## Workflows and policies\n\n- **Workflow**: stage directives shape agent behavior at discrete\n transitions. What context the agent sees (assembly recipes), what tools\n it can use, how it thinks (prompt + model). Live in Telora's\n `workflow_stages.agent_directive` JSONB.\n- **Policy** (organizational, deferred): cross-cutting constraints that\n feed into stage directives.\n\nWhen you cross a stage transition, the daemon may inject context or spawn\na fresh sub-agent per the directive. Don't override that flow without a\nclear reason.\n";
32
+ export declare const SEED_BODY = "# Telora workstation context\n\nThis repo is connected to Telora -- a differential control plane for\nsoftware delivery. Intent and reality are paired signals; the meaningful\nwork happens at the difference.\n\n## Before you write any code (read this first)\n\nDEFAULT: on a Telora-connected workstation, a new capability starts as\n**declared intent** before any code. When the user says \"I want to build\nX\", your first move is NOT to scaffold X -- it is to declare it: create\n(or select) a Focus -> delivery -> issue and move an issue to **In\nProgress**. Code is written only after intent is anchored above it.\n\nThis polarity is deliberate and easy to get backwards. Building directly\nin the working tree -- scaffolding, installing dependencies, starting a\ndev server, writing application files -- is the **exception**, taken ONLY\nwhen the user explicitly asks for it. Recognized bypass phrases:\n\"build locally\", \"just write it\", \"skip Telora\", \"don't track this\",\n\"throwaway\". Absent an explicit signal like these, treat any build\nrequest as a request to declare intent in Telora first.\n\nAsking good clarifying questions about stack, scope, or dependencies is\nNOT a substitute for this step -- that is execution-layer scoping, and it\ncomes *after* the capability is declared, not instead of it. Scoping is\nagent work; declaring that a capability matters is the part that must\nland in Telora first.\n\n**Surface the fork; do not silently pick it.** The common failure is\nresolving an ambiguous request toward the path of least resistance --\ne.g. reading \"a web app I run locally on my LAN\" (a deployment target) as\n\"build locally\" (skip Telora). When intent is not already explicit, your\nFIRST response to a build request names the choice rather than assuming\nit: \"I'll scope this in Telora unless you want it built locally -- which?\"\nOne question, once, at the start. Let the user pick; never pick for them\nby starting to type code.\n\n**First action rule.** On a build / new-capability request, your first\ntool call is a Telora planning call (telora_product_focus / _delivery /\n_issue) OR the fork question above -- never Write, Edit, or a code-running\nBash command. If the first move cannot be code, building-before-intent\ncannot happen.\n\nWhy: an artifact with no declared intent above it is reality moving with\nnothing to measure it against -- pure noise to the differential loop. The\nwhole system is built to compute intent-minus-reality; code that skips\nthe intent half defeats the instrument.\n\n## Planning hierarchy\n\n- **Focus** = the context that defines an area of work -- not \"one\n capability.\" All phases of building within that area belong in one\n focus; if a \"focus\" is really just one phase, fold it back in.\n- **Delivery** = a shippable phase or major component of a capability.\n- **Context Group** = optional grouping of related issues that share\n meaningful context (relevant files, architectural notes). A CG earns its\n existence by carrying context, not by being a folder.\n- **Task** = one discrete implementable unit. Bounded files, focused\n session. Multiple \"and\" clauses across different concerns means split.\n\nScope by purpose, not count. The right number of deliveries is however\nmany phases the work naturally has.\n\n## PRD: \"build a working app in one run\"\n\nA **PRD** sits one altitude above Focus (Product -> PRD -> Focus): a\nbounded, verifiable, retire-able milestone carrying a **Prerequisite Tree**\nof `goal` / `obstacle` / `overcome` nodes. Each `overcome` materializes\nas a focus; the daemon progressively arms the **frontier** of foci as\nupstream obstacles clear. This is the entry point a user means by \"build a\nfully working app in one go.\"\n\nIt is NOT big-bang generation: you author the tree once, commit a path,\nand the differential loop walks the frontier to completion -- the execution\nunderneath is still the normal focus -> delivery -> issue + review loop.\n\nThe PRD tools are **lazy-loaded** -- they do not exist until you load the\ndomain. If you don't see `telora_prd` / `telora_prd_tree`, run:\n\n```\ntelora_discover { action: \"load\", domain: \"prd\" }\n```\n\nThen: `telora_prd` create (referencing a Vision) -> `telora_prd_tree`\nauthor nodes (obstacles carry a verifiable `clearancePredicate`) + edges ->\ncommit a pathway -> `materialize_overcome` each into a focus -> arm the\ndaemon PRD loop. All authoring is harness+MCP; there is no Telora authoring UI.\n\n## Issue workflow\n\n`To Do` -> `In Progress` -> `In Review` / `Blocked` -> `Done`.\n\nIssue types: **Context Group**, **Task**, **Bug**.\n\nMovement rules:\n\n- An issue MUST be set to `In Progress` before any work begins on it.\n- Never skip `In Progress`. Never move directly from `To Do` to `Done`.\n- Set status with `telora_product_issue` action=update.\n\nDelivery and focus stages advance automatically based on issue\nactivity. Agents never set delivery executionStatus directly.\n\n## MCP tool surface (what's available in this session)\n\nThe Telora MCP server is registered in `.mcp.json`. Core tool families:\n\n- `telora_product` -- list/get/create/update products\n- `telora_product_focus` -- focuses under a product\n- `telora_product_delivery` -- deliveries under a focus\n- `telora_product_issue` -- issues (Context Groups, Tasks, Bugs) under a delivery\n- `telora_agent` -- agent roles, escalation requests\n- `telora_loop_*` -- loop documents, questions, answers\n- `telora_discover` -- on-demand registration of deferred tool domains\n\nResolve the live tool list at runtime via `telora_discover` rather than\nhard-coding a list that drifts.\n\n## Human-vs-agent boundaries\n\n- Humans own **intent** and **completion**.\n - Intent: what capability matters, what changes when. Pre-handoff.\n - Completion: closing the loop on whether a focus is done. Post-handoff.\n- Agents own **scoping** and **execution**.\n - Scoping: decomposing a focus into deliveries, deliveries into\n issues, restructuring mid-flight as the agent learns more.\n - Execution: writing code, running tests, committing, reporting.\n\nDo not ask humans for operational details they expect the agent to figure\nout. Do not silently complete a focus on the human's behalf. Escalate\nwhen stuck via `telora_agent` action=escalate.\n\nWhen communicating with a human, refer to focuses, deliveries, and issues\nby their **title**, never their UUID. UUIDs are for tool calls only and must\nnot be surfaced in chat. MCP tool results carry both, so this is a\ncommunication choice, not a data-availability problem: keep the id in the\ntool call, name the work by its title in the conversation.\n\n## Differential signaling\n\nTelora is asymmetric: it moves reality toward intent, never the reverse.\nAgents do not lower the bar to make signals look better -- they escalate.\nEvery artifact (commit, work summary, gate result) is signal toward the\ndeclared intent; raw activity without intent reduction is noise.\n\nA short corrective comment from the user is high-signal -- treat brief\npushback as the most important input in the session.\n\n## Workflows and policies\n\n- **Workflow**: stage directives shape agent behavior at discrete\n transitions. What context the agent sees (assembly recipes), what tools\n it can use, how it thinks (prompt + model). Live in Telora's\n `workflow_stages.agent_directive` JSONB.\n- **Policy** (organizational, deferred): cross-cutting constraints that\n feed into stage directives.\n\nWhen you cross a stage transition, the daemon may inject context or spawn\na fresh sub-agent per the directive. Don't override that flow without a\nclear reason.\n";
33
33
  /**
34
34
  * Render a fresh-repo CLAUDE.md.
35
35
  *
@@ -1 +1 @@
1
- {"version":3,"file":"claude-md.d.ts","sourceRoot":"","sources":["../../src/templates/claude-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AACnE,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,wDACY,CAAC;AAExD,eAAO,MAAM,SAAS,6qOA0JrB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CASjE"}
1
+ {"version":3,"file":"claude-md.d.ts","sourceRoot":"","sources":["../../src/templates/claude-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AACnE,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,wDACY,CAAC;AAExD,eAAO,MAAM,SAAS,mhPAgKrB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CASjE"}
@@ -161,6 +161,12 @@ Do not ask humans for operational details they expect the agent to figure
161
161
  out. Do not silently complete a focus on the human's behalf. Escalate
162
162
  when stuck via \`telora_agent\` action=escalate.
163
163
 
164
+ When communicating with a human, refer to focuses, deliveries, and issues
165
+ by their **title**, never their UUID. UUIDs are for tool calls only and must
166
+ not be surfaced in chat. MCP tool results carry both, so this is a
167
+ communication choice, not a data-availability problem: keep the id in the
168
+ tool call, name the work by its title in the conversation.
169
+
164
170
  ## Differential signaling
165
171
 
166
172
  Telora is asymmetric: it moves reality toward intent, never the reverse.
@@ -1 +1 @@
1
- {"version":3,"file":"claude-md.js","sourceRoot":"","sources":["../../src/templates/claude-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAE/D;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GACzC,qDAAqD,CAAC;AAExD,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0JxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,WAA0B;IACvD,MAAM,WAAW,GAAG,WAAW;QAC7B,CAAC,CAAC,kCAAkC,WAAW,SAAS;QACxD,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,KAAK,GACT,GAAG,sBAAsB,IAAI;QAC7B,GAAG,WAAW,GAAG,SAAS,EAAE;QAC5B,GAAG,oBAAoB,IAAI,CAAC;IAC9B,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"claude-md.js","sourceRoot":"","sources":["../../src/templates/claude-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAE/D;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GACzC,qDAAqD,CAAC;AAExD,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,WAA0B;IACvD,MAAM,WAAW,GAAG,WAAW;QAC7B,CAAC,CAAC,kCAAkC,WAAW,SAAS;QACxD,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,KAAK,GACT,GAAG,sBAAsB,IAAI;QAC7B,GAAG,WAAW,GAAG,SAAS,EAAE;QAC5B,GAAG,oBAAoB,IAAI,CAAC;IAC9B,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telora/daemon",
3
- "version": "0.17.70",
3
+ "version": "0.17.75",
4
4
  "description": "Agent orchestration daemon for Telora - spawns and manages Claude Code instances",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "//testRunner": "Uses Node.js built-in test runner (node:test) via tsx for TypeScript support. The root package uses Vitest; this is a deliberate choice for the daemon package to avoid framework dependencies. See src/__tests__/ for test files.",
38
38
  "dependencies": {
39
39
  "@telora/daemon-core": "^0.2.42",
40
- "@telora/mcp-products": "^0.22.61",
40
+ "@telora/mcp-products": "^0.22.62",
41
41
  "commander": "^14.0.3",
42
42
  "yaml": "^2.4.0",
43
43
  "zod": "^4.3.6"