@telora/daemon 0.18.40 → 0.18.55
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.
- package/build-info.json +12 -3
- package/dist/completion/advanceability.d.ts +66 -0
- package/dist/completion/advanceability.d.ts.map +1 -0
- package/dist/completion/advanceability.js +112 -0
- package/dist/completion/advanceability.js.map +1 -0
- package/dist/completion/event.d.ts +28 -52
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +79 -99
- package/dist/completion/event.js.map +1 -1
- package/dist/completion/progress-snapshot.d.ts +15 -4
- package/dist/completion/progress-snapshot.d.ts.map +1 -1
- package/dist/completion/progress-snapshot.js +20 -4
- package/dist/completion/progress-snapshot.js.map +1 -1
- package/dist/completion/team-completion.d.ts.map +1 -1
- package/dist/completion/team-completion.js +32 -2
- package/dist/completion/team-completion.js.map +1 -1
- package/dist/crash-recovery.d.ts +48 -0
- package/dist/crash-recovery.d.ts.map +1 -1
- package/dist/crash-recovery.js +166 -30
- package/dist/crash-recovery.js.map +1 -1
- package/dist/delivery-advance-block.d.ts +17 -1
- package/dist/delivery-advance-block.d.ts.map +1 -1
- package/dist/delivery-advance-block.js +31 -8
- package/dist/delivery-advance-block.js.map +1 -1
- package/dist/escalation-provenance.d.ts +5 -1
- package/dist/escalation-provenance.d.ts.map +1 -1
- package/dist/escalation-provenance.js +46 -4
- package/dist/escalation-provenance.js.map +1 -1
- package/dist/focus-executor.d.ts +7 -2
- package/dist/focus-executor.d.ts.map +1 -1
- package/dist/focus-executor.js +21 -9
- package/dist/focus-executor.js.map +1 -1
- package/dist/focus-lifecycle.d.ts.map +1 -1
- package/dist/focus-lifecycle.js +20 -0
- package/dist/focus-lifecycle.js.map +1 -1
- package/dist/git-activity.d.ts +15 -0
- package/dist/git-activity.d.ts.map +1 -1
- package/dist/git-activity.js +24 -0
- package/dist/git-activity.js.map +1 -1
- package/dist/git-genesis.d.ts +100 -0
- package/dist/git-genesis.d.ts.map +1 -0
- package/dist/git-genesis.js +231 -0
- package/dist/git-genesis.js.map +1 -0
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +28 -5
- package/dist/git.js.map +1 -1
- package/dist/loop-engine-types.d.ts +40 -0
- package/dist/loop-engine-types.d.ts.map +1 -0
- package/dist/loop-engine-types.js +11 -0
- package/dist/loop-engine-types.js.map +1 -0
- package/dist/loop-engine.d.ts +52 -0
- package/dist/loop-engine.d.ts.map +1 -1
- package/dist/loop-engine.js +91 -10
- package/dist/loop-engine.js.map +1 -1
- package/dist/loop-llm-flag.d.ts +32 -0
- package/dist/loop-llm-flag.d.ts.map +1 -0
- package/dist/loop-llm-flag.js +35 -0
- package/dist/loop-llm-flag.js.map +1 -0
- package/dist/loop-operational-block.d.ts +44 -0
- package/dist/loop-operational-block.d.ts.map +1 -0
- package/dist/loop-operational-block.js +47 -0
- package/dist/loop-operational-block.js.map +1 -0
- package/dist/merge-back-loop.d.ts.map +1 -1
- package/dist/merge-back-loop.js +1 -0
- package/dist/merge-back-loop.js.map +1 -1
- package/dist/nexus-intake.d.ts +26 -3
- package/dist/nexus-intake.d.ts.map +1 -1
- package/dist/nexus-intake.js +62 -10
- package/dist/nexus-intake.js.map +1 -1
- package/dist/output-monitor.js +5 -8
- package/dist/output-monitor.js.map +1 -1
- package/dist/prd-controller.d.ts +0 -2
- package/dist/prd-controller.d.ts.map +1 -1
- package/dist/prd-controller.js +14 -35
- package/dist/prd-controller.js.map +1 -1
- package/dist/prd-divergence.d.ts +19 -8
- package/dist/prd-divergence.d.ts.map +1 -1
- package/dist/prd-divergence.js +7 -26
- package/dist/prd-divergence.js.map +1 -1
- package/dist/prd-viability.d.ts +14 -15
- package/dist/prd-viability.d.ts.map +1 -1
- package/dist/prd-viability.js +21 -34
- package/dist/prd-viability.js.map +1 -1
- package/dist/queries/prd.d.ts +24 -2
- package/dist/queries/prd.d.ts.map +1 -1
- package/dist/queries/prd.js +17 -0
- package/dist/queries/prd.js.map +1 -1
- package/dist/queries/schemas.d.ts +28 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +26 -0
- package/dist/queries/schemas.js.map +1 -1
- package/dist/queries/sessions.d.ts +14 -0
- package/dist/queries/sessions.d.ts.map +1 -1
- package/dist/queries/sessions.js +19 -0
- package/dist/queries/sessions.js.map +1 -1
- package/dist/queries/starter-repo.d.ts +27 -0
- package/dist/queries/starter-repo.d.ts.map +1 -0
- package/dist/queries/starter-repo.js +32 -0
- package/dist/queries/starter-repo.js.map +1 -0
- package/dist/session-lineage.d.ts +25 -0
- package/dist/session-lineage.d.ts.map +1 -1
- package/dist/session-lineage.js +23 -0
- package/dist/session-lineage.js.map +1 -1
- package/dist/session-stamp.d.ts +63 -0
- package/dist/session-stamp.d.ts.map +1 -0
- package/dist/session-stamp.js +65 -0
- package/dist/session-stamp.js.map +1 -0
- package/dist/spawner/helpers.d.ts.map +1 -1
- package/dist/spawner/helpers.js +5 -8
- package/dist/spawner/helpers.js.map +1 -1
- package/dist/supabase.d.ts +2 -2
- package/dist/supabase.d.ts.map +1 -1
- package/dist/supabase.js +1 -1
- package/dist/supabase.js.map +1 -1
- package/dist/templates/claude-md.d.ts +1 -1
- package/dist/templates/claude-md.d.ts.map +1 -1
- package/dist/templates/claude-md.js +6 -3
- package/dist/templates/claude-md.js.map +1 -1
- package/dist/types/focus.d.ts +24 -0
- package/dist/types/focus.d.ts.map +1 -1
- package/dist/types/session.d.ts +24 -0
- package/dist/types/session.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/crash-recovery-cleanup.d.ts +0 -21
- package/dist/crash-recovery-cleanup.d.ts.map +0 -1
- package/dist/crash-recovery-cleanup.js +0 -205
- package/dist/crash-recovery-cleanup.js.map +0 -1
- package/dist/crash-recovery-scan.d.ts +0 -19
- package/dist/crash-recovery-scan.d.ts.map +0 -1
- package/dist/crash-recovery-scan.js +0 -145
- package/dist/crash-recovery-scan.js.map +0 -1
- package/dist/crash-recovery-types.d.ts +0 -49
- package/dist/crash-recovery-types.d.ts.map +0 -1
- package/dist/crash-recovery-types.js +0 -13
- package/dist/crash-recovery-types.js.map +0 -1
- package/dist/prd-clearance-engine.d.ts +0 -121
- package/dist/prd-clearance-engine.d.ts.map +0 -1
- package/dist/prd-clearance-engine.js +0 -164
- package/dist/prd-clearance-engine.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/spawner/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,EACL,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/spawner/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,EACL,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OA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IAC3E,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;IAE3B,sCAAsC;IACtC,IAAI,CAAC;QAAC,MAAM,eAAe,CAAC,UAAU,EAAE,CAAC;IAAC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QAAC,OAAO,CAAC,IAAI,CAAC,qDAAqD,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;IAAC,CAAC;IAExJ,mBAAmB;IACnB,kBAAkB,CAAC,OAAO,EAAE,CAAC;IAC7B,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC;IAC3B,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;IACxB,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;IACvB,cAAc,EAAE,CAAC;IAEjB,MAAM,oBAAoB,CAAC;QACzB,MAAM,EAAE,GAAG;QACX,SAAS;QACT,SAAS;QACT,IAAI;QACJ,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
|
package/dist/supabase.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { initSupabase, validateTrackerAuth } from './queries/shared.js';
|
|
11
11
|
export { getAgentRoles, getAgentRole } from './queries/roles.js';
|
|
12
|
-
export { getActiveSessions, getActiveSessionCountByRole, getCompletedSessionAggregates, createSession, updateSession, } from './queries/sessions.js';
|
|
13
|
-
export type { CreateSessionParams, SessionAggregates } from './queries/sessions.js';
|
|
12
|
+
export { getActiveSessions, getActiveSessionCountByRole, getCompletedSessionAggregates, createSession, updateSession, closePass, } from './queries/sessions.js';
|
|
13
|
+
export type { CreateSessionParams, SessionAggregates, SessionType } from './queries/sessions.js';
|
|
14
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';
|
package/dist/supabase.d.ts.map
CHANGED
|
@@ -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,
|
|
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,EACb,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGjG,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,EAChB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAAE,sBAAsB,EAAE,qCAAqC,EAAE,MAAM,wBAAwB,CAAC;AA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,7 +12,7 @@ export { initSupabase, validateTrackerAuth } from './queries/shared.js';
|
|
|
12
12
|
// -- Agent Roles --
|
|
13
13
|
export { getAgentRoles, getAgentRole } from './queries/roles.js';
|
|
14
14
|
// -- Agent Sessions --
|
|
15
|
-
export { getActiveSessions, getActiveSessionCountByRole, getCompletedSessionAggregates, createSession, updateSession, } from './queries/sessions.js';
|
|
15
|
+
export { getActiveSessions, getActiveSessionCountByRole, getCompletedSessionAggregates, createSession, updateSession, closePass, } from './queries/sessions.js';
|
|
16
16
|
// -- Deliveries & Focuses --
|
|
17
17
|
export { getReadyDeliveries, getDeliveryContext, updateDeliveryStatus, recordDeliveryTransition, markDeliveryAutoApproved, updateDeliveryMergeCommitSha, getDoneDeliveries, getReadyFocuses, getActiveFocuses, getMergeConflictDeliveries, reportGitState, recordFocusMerge, clearAnswerRearm, } from './queries/deliveries.js';
|
|
18
18
|
// -- Workflows --
|
package/dist/supabase.js.map
CHANGED
|
@@ -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,
|
|
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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C,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
|
|
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 (an obstacle's `clearancePredicate` is OPTIONAL and advisory --\nthe frontier advances as upstream obstacles clear via focus-completion, i.e.\neach overcome's focus finishing its deliveries' verify gates, not via a\nper-obstacle predicate) + edges -> commit a pathway -> `materialize_overcome`\neach into a focus -> arm the daemon PRD loop. All authoring is harness+MCP;\nthere 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,
|
|
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,+sPAmKrB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CASjE"}
|
|
@@ -113,9 +113,12 @@ telora_discover { action: "load", domain: "prd" }
|
|
|
113
113
|
\`\`\`
|
|
114
114
|
|
|
115
115
|
Then: \`telora_prd\` create (referencing a Vision) -> \`telora_prd_tree\`
|
|
116
|
-
author nodes (
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
author nodes (an obstacle's \`clearancePredicate\` is OPTIONAL and advisory --
|
|
117
|
+
the frontier advances as upstream obstacles clear via focus-completion, i.e.
|
|
118
|
+
each overcome's focus finishing its deliveries' verify gates, not via a
|
|
119
|
+
per-obstacle predicate) + edges -> commit a pathway -> \`materialize_overcome\`
|
|
120
|
+
each into a focus -> arm the daemon PRD loop. All authoring is harness+MCP;
|
|
121
|
+
there is no Telora authoring UI.
|
|
119
122
|
|
|
120
123
|
## Issue workflow
|
|
121
124
|
|
|
@@ -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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmKxB,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/dist/types/focus.d.ts
CHANGED
|
@@ -174,6 +174,19 @@ export interface FocusTeamState {
|
|
|
174
174
|
* Escalates and terminates when it reaches SCOPE_COVERAGE_NO_PROGRESS_LIMIT.
|
|
175
175
|
*/
|
|
176
176
|
noProgressCycles: number;
|
|
177
|
+
/**
|
|
178
|
+
* Re-wake (commit-nudge) attempts spent in the CURRENT dirty episode before
|
|
179
|
+
* the no-progress guard is allowed to terminate the team. When the no-progress
|
|
180
|
+
* watchdog is about to escalate+terminate a team that has produced
|
|
181
|
+
* uncommitted work (a dirty focus worktree) AND a live lead is still
|
|
182
|
+
* reachable, the daemon instead nudges the lead to commit -- keeping the
|
|
183
|
+
* producing team alive so it commits its own work and the delivery advances
|
|
184
|
+
* out of coding without a manual commit. This counter bounds those nudges by
|
|
185
|
+
* the auto-remediation budget so a team that will never commit still
|
|
186
|
+
* eventually escalates. Reset to 0 on any measurable progress, and whenever
|
|
187
|
+
* the worktree is observed clean (the episode is over).
|
|
188
|
+
*/
|
|
189
|
+
commitNudgeAttempts: number;
|
|
177
190
|
/**
|
|
178
191
|
* SHA-256 hash of the last spawn directive consumed by this team
|
|
179
192
|
* (computed over { prompt, assembly, model } -- not the assembled output
|
|
@@ -211,6 +224,17 @@ export interface ProgressSnapshot {
|
|
|
211
224
|
* a moving count is forward motion the daemon drove, not a team stall.
|
|
212
225
|
*/
|
|
213
226
|
deliveryIterations: Record<string, number>;
|
|
227
|
+
/**
|
|
228
|
+
* Git-activity dimension: the focus worktree's HEAD sha at snapshot time, or
|
|
229
|
+
* null when no worktree is registered / git could not be read. A moving HEAD
|
|
230
|
+
* on the focus branch is forward motion even when delivery/issue STATE is
|
|
231
|
+
* flat -- a team that wrote and committed real code this cycle produced
|
|
232
|
+
* progress the status/issue/gate axes cannot see. Including the head sha in
|
|
233
|
+
* snapshotsEqual makes a fresh commit reset the no-progress counter through
|
|
234
|
+
* the existing snapshot-comparison machinery, so a producing team is not
|
|
235
|
+
* killed as "idle" purely because no DB state moved this cycle.
|
|
236
|
+
*/
|
|
237
|
+
focusHeadSha: string | null;
|
|
214
238
|
}
|
|
215
239
|
/**
|
|
216
240
|
* Summary info about a delivery within the focus.
|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,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oEAAoE;IACpE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B"}
|
package/dist/types/session.d.ts
CHANGED
|
@@ -48,6 +48,30 @@ export interface AgentSession {
|
|
|
48
48
|
files_modified: string[];
|
|
49
49
|
commits: string[];
|
|
50
50
|
workflow_stage_id: string | null;
|
|
51
|
+
pass_id: string | null;
|
|
52
|
+
claude_session_id: string | null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Pass-grain session entity (agent_session_passes). A pass is one logical
|
|
56
|
+
* session = (focus, lineage); agent_sessions rows are continuation SEGMENTS
|
|
57
|
+
* under it (linked via AgentSession.pass_id). Rollup columns (token_count,
|
|
58
|
+
* cost_estimate, commits, files_modified) aggregate across the pass's segments.
|
|
59
|
+
*/
|
|
60
|
+
export interface AgentSessionPass {
|
|
61
|
+
id: string;
|
|
62
|
+
organization_id: string;
|
|
63
|
+
focus_id: string | null;
|
|
64
|
+
agent_role_id: string | null;
|
|
65
|
+
session_type: string;
|
|
66
|
+
branch_name: string | null;
|
|
67
|
+
status: 'open' | 'closed';
|
|
68
|
+
started_at: string | null;
|
|
69
|
+
ended_at: string | null;
|
|
70
|
+
token_count: number;
|
|
71
|
+
cost_estimate: number;
|
|
72
|
+
commits: string[];
|
|
73
|
+
files_modified: string[];
|
|
74
|
+
claude_session_id: string | null;
|
|
51
75
|
}
|
|
52
76
|
/**
|
|
53
77
|
* Running agent process info
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/types/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,SAAS,GACT,WAAW,GACX,QAAQ,GAER,WAAW,GAKX,SAAS,GACT,WAAW,CAAC;AAKhB,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,kBAAkB,GAClB,SAAS,GACT,cAAc,GACd,iBAAiB,GACjB,UAAU,GACV,eAAe,GACf,aAAa,GACb,SAAS,GACT,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C;IACzB,iDAAiD;IACjD,WAAW,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,eAAe,CAAC;IAC9D,yDAAyD;IACzD,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,gDAAgD;IAChD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC1C,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,WAAW,CAAC;IAC7B,YAAY,EAAE,WAAW,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telora/daemon",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.55",
|
|
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.49",
|
|
40
|
-
"@telora/mcp-products": "^0.22.
|
|
40
|
+
"@telora/mcp-products": "^0.22.83",
|
|
41
41
|
"commander": "^14.0.3",
|
|
42
42
|
"yaml": "^2.4.0",
|
|
43
43
|
"zod": "^4.3.6"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Orphan cleanup and stale branch pruning for crash recovery.
|
|
3
|
-
*
|
|
4
|
-
* Processes orphaned worktrees (safety-commit, merge check, remove/preserve)
|
|
5
|
-
* and prunes stale agent branches with no worktree and no unmerged commits.
|
|
6
|
-
*/
|
|
7
|
-
import type { DaemonConfig } from './types.js';
|
|
8
|
-
import type { OrphanedWorktree, CleanupAction, RecoveryDeps } from './crash-recovery-types.js';
|
|
9
|
-
/**
|
|
10
|
-
* Clean up all orphaned worktrees. Returns actions taken and
|
|
11
|
-
* any preserved orphans that need escalation.
|
|
12
|
-
*/
|
|
13
|
-
export declare function cleanupOrphanedWorktrees(orphans: OrphanedWorktree[], config: DaemonConfig, deps?: RecoveryDeps): Promise<CleanupAction[]>;
|
|
14
|
-
/**
|
|
15
|
-
* Prune stale agent branches that have no worktree and no unmerged commits.
|
|
16
|
-
*/
|
|
17
|
-
export declare function pruneStaleAgentBranches(config: DaemonConfig): {
|
|
18
|
-
pruned: string[];
|
|
19
|
-
preserved: string[];
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=crash-recovery-cleanup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crash-recovery-cleanup.d.ts","sourceRoot":"","sources":["../src/crash-recovery-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAS/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAmG/F;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,gBAAgB,EAAE,EAC3B,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,YAA0B,GAC/B,OAAO,CAAC,aAAa,EAAE,CAAC,CA2E1B;AAgBD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,GACnB;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAwC3C"}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Orphan cleanup and stale branch pruning for crash recovery.
|
|
3
|
-
*
|
|
4
|
-
* Processes orphaned worktrees (safety-commit, merge check, remove/preserve)
|
|
5
|
-
* and prunes stale agent branches with no worktree and no unmerged commits.
|
|
6
|
-
*/
|
|
7
|
-
import { existsSync } from 'node:fs';
|
|
8
|
-
import { runGitSync } from './git.js';
|
|
9
|
-
import { worktreeHasUncommittedChanges, branchHasUnmergedCommits, safetyCommitWorktree, removeWorktree, } from './worktree.js';
|
|
10
|
-
import { ESCALATION_REASONS, ESCALATION_DISPOSITIONS } from '@telora/daemon-core';
|
|
11
|
-
import { defaultDeps } from './crash-recovery-types.js';
|
|
12
|
-
import { parseWorktreeList } from './crash-recovery-scan.js';
|
|
13
|
-
// ── Helpers ──────────────────────────────────────────────────────
|
|
14
|
-
/**
|
|
15
|
-
* Count unmerged commits on a branch relative to integration.
|
|
16
|
-
*/
|
|
17
|
-
function countUnmergedCommits(branchName, integrationBranch, repoPath) {
|
|
18
|
-
const result = runGitSync(['log', '--oneline', `${integrationBranch}..${branchName}`, '--'], repoPath);
|
|
19
|
-
if (!result.success)
|
|
20
|
-
return 0;
|
|
21
|
-
const lines = result.output.trim();
|
|
22
|
-
if (lines.length === 0)
|
|
23
|
-
return 0;
|
|
24
|
-
return lines.split('\n').length;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Process a single orphaned worktree: safety-commit if dirty,
|
|
28
|
-
* then remove if merged or preserve if unmerged.
|
|
29
|
-
*
|
|
30
|
-
* Returns the action taken.
|
|
31
|
-
*/
|
|
32
|
-
function cleanupSingleOrphan(orphan, config) {
|
|
33
|
-
const { worktreePath, branchName } = orphan;
|
|
34
|
-
const { repoPath, integrationBranch } = config;
|
|
35
|
-
let commitHash;
|
|
36
|
-
// Step 1: Safety-commit if dirty
|
|
37
|
-
if (existsSync(worktreePath) && worktreeHasUncommittedChanges(worktreePath)) {
|
|
38
|
-
const deliveryName = branchName.split('/').slice(2).join('/') || 'unknown';
|
|
39
|
-
console.log(`[crash-recovery] Safety-committing dirty worktree: ${worktreePath}`);
|
|
40
|
-
const hash = safetyCommitWorktree(worktreePath, deliveryName);
|
|
41
|
-
if (hash) {
|
|
42
|
-
commitHash = hash.trim();
|
|
43
|
-
console.log(`[crash-recovery] Safety commit created: ${commitHash.slice(0, 8)} on ${branchName}`);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
console.warn(`[crash-recovery] Safety commit failed for ${worktreePath}, preserving as-is`);
|
|
47
|
-
return {
|
|
48
|
-
worktreePath,
|
|
49
|
-
branchName,
|
|
50
|
-
action: 'preserved',
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// Step 2: Check if branch is already merged to integration
|
|
55
|
-
const hasUnmerged = branchHasUnmergedCommits(branchName, integrationBranch, repoPath);
|
|
56
|
-
if (!hasUnmerged) {
|
|
57
|
-
// Fully merged -- safe to remove
|
|
58
|
-
console.log(`[crash-recovery] Removing merged orphan: ${worktreePath} [${branchName}]`);
|
|
59
|
-
removeWorktree(repoPath, worktreePath, {
|
|
60
|
-
branchName,
|
|
61
|
-
integrationBranch,
|
|
62
|
-
mergeSucceeded: true,
|
|
63
|
-
});
|
|
64
|
-
// Also delete the branch since it's merged
|
|
65
|
-
const deleteResult = runGitSync(['branch', '-d', branchName], repoPath);
|
|
66
|
-
if (deleteResult.success) {
|
|
67
|
-
console.log(`[crash-recovery] Deleted merged branch: ${branchName}`);
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
worktreePath,
|
|
71
|
-
branchName,
|
|
72
|
-
action: commitHash ? 'safety-committed-and-removed' : 'removed',
|
|
73
|
-
commitHash,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
// Step 3: Unmerged commits -- preserve
|
|
77
|
-
const unmergedCount = countUnmergedCommits(branchName, integrationBranch, repoPath);
|
|
78
|
-
console.log(`[crash-recovery] Preserving orphan with ${unmergedCount} unmerged commit(s): ${worktreePath} [${branchName}]`);
|
|
79
|
-
return {
|
|
80
|
-
worktreePath,
|
|
81
|
-
branchName,
|
|
82
|
-
action: commitHash ? 'safety-committed' : 'preserved',
|
|
83
|
-
commitHash,
|
|
84
|
-
unmergedCommitCount: unmergedCount,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
// ── Orphan cleanup ───────────────────────────────────────────────
|
|
88
|
-
/**
|
|
89
|
-
* Clean up all orphaned worktrees. Returns actions taken and
|
|
90
|
-
* any preserved orphans that need escalation.
|
|
91
|
-
*/
|
|
92
|
-
export async function cleanupOrphanedWorktrees(orphans, config, deps = defaultDeps) {
|
|
93
|
-
const actions = [];
|
|
94
|
-
// Mark orphaned sessions as failed in DB
|
|
95
|
-
for (const orphan of orphans) {
|
|
96
|
-
if (orphan.session) {
|
|
97
|
-
try {
|
|
98
|
-
await deps.updateSession(orphan.session.id, {
|
|
99
|
-
status: 'failed',
|
|
100
|
-
exit_reason: 'Daemon crash recovery: session was active when daemon restarted',
|
|
101
|
-
exit_category: 'recovery_cleanup',
|
|
102
|
-
ended_at: new Date().toISOString(),
|
|
103
|
-
});
|
|
104
|
-
console.log(`[crash-recovery] Marked session ${orphan.session.id} as failed (crash recovery)`);
|
|
105
|
-
}
|
|
106
|
-
catch (err) {
|
|
107
|
-
console.warn(`[crash-recovery] Failed to update session ${orphan.session.id}: ${err instanceof Error ? err.message : String(err)}`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
// Process each orphan
|
|
112
|
-
for (const orphan of orphans) {
|
|
113
|
-
try {
|
|
114
|
-
const action = cleanupSingleOrphan(orphan, config);
|
|
115
|
-
actions.push(action);
|
|
116
|
-
}
|
|
117
|
-
catch (err) {
|
|
118
|
-
console.error(`[crash-recovery] Error cleaning up orphan ${orphan.worktreePath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
// Escalate preserved orphans
|
|
122
|
-
const preserved = actions.filter((a) => a.action === 'preserved' || a.action === 'safety-committed');
|
|
123
|
-
if (preserved.length > 0) {
|
|
124
|
-
const lines = preserved.map((a) => `- ${a.branchName} (${a.worktreePath})` +
|
|
125
|
-
(a.unmergedCommitCount ? ` -- ${a.unmergedCommitCount} unmerged commit(s)` : '') +
|
|
126
|
-
(a.commitHash ? ` -- safety commit: ${a.commitHash.slice(0, 8)}` : ''));
|
|
127
|
-
const description = `Daemon crash recovery found ${preserved.length} orphaned worktree(s) with unmerged work:\n\n` +
|
|
128
|
-
lines.join('\n') +
|
|
129
|
-
'\n\nThese worktrees have been preserved for manual inspection.';
|
|
130
|
-
try {
|
|
131
|
-
await deps.createEscalation({
|
|
132
|
-
organizationId: config.organizationId,
|
|
133
|
-
sessionId: preserved[0].branchName, // No session available, use branch as context
|
|
134
|
-
issueId: null,
|
|
135
|
-
reasonType: ESCALATION_REASONS.NEEDS_CLARIFICATION,
|
|
136
|
-
// Operator triage: an operator inspects the preserved branches and
|
|
137
|
-
// decides to merge or delete -- not an intent-owner decision.
|
|
138
|
-
disposition: ESCALATION_DISPOSITIONS.NEEDS_OPERATOR,
|
|
139
|
-
// Best-effort provenance from the preserved branch (resolved via a
|
|
140
|
-
// session row carrying it, when one exists).
|
|
141
|
-
anchor: { branch: preserved[0].branchName },
|
|
142
|
-
description,
|
|
143
|
-
whatWasTried: 'Daemon crash recovery scanned for orphaned worktrees and preserved those with unmerged commits.',
|
|
144
|
-
helpNeeded: 'Inspect the preserved branches and either merge them to integration or delete them.',
|
|
145
|
-
});
|
|
146
|
-
console.log(`[crash-recovery] Created escalation for ${preserved.length} preserved orphan(s)`);
|
|
147
|
-
}
|
|
148
|
-
catch (err) {
|
|
149
|
-
console.warn(`[crash-recovery] Failed to create escalation: ${err instanceof Error ? err.message : String(err)}`);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return actions;
|
|
153
|
-
}
|
|
154
|
-
// ── Stale branch pruning ─────────────────────────────────────────
|
|
155
|
-
/**
|
|
156
|
-
* List all local branches matching the agent/* pattern.
|
|
157
|
-
*/
|
|
158
|
-
function listAgentBranches(repoPath) {
|
|
159
|
-
const result = runGitSync(['branch', '--list', 'agent/*'], repoPath);
|
|
160
|
-
if (!result.success)
|
|
161
|
-
return [];
|
|
162
|
-
return result.output
|
|
163
|
-
.split('\n')
|
|
164
|
-
.map((line) => line.replace(/^[*+]?\s+/, '').trim())
|
|
165
|
-
.filter(Boolean);
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Prune stale agent branches that have no worktree and no unmerged commits.
|
|
169
|
-
*/
|
|
170
|
-
export function pruneStaleAgentBranches(config) {
|
|
171
|
-
const { repoPath, integrationBranch } = config;
|
|
172
|
-
const branches = listAgentBranches(repoPath);
|
|
173
|
-
const pruned = [];
|
|
174
|
-
const preserved = [];
|
|
175
|
-
if (branches.length === 0) {
|
|
176
|
-
console.log('[crash-recovery] No stale agent branches found');
|
|
177
|
-
return { pruned, preserved };
|
|
178
|
-
}
|
|
179
|
-
// Get set of branches that have active worktrees
|
|
180
|
-
const worktreeMap = parseWorktreeList(repoPath);
|
|
181
|
-
const worktreeBranches = new Set(worktreeMap.values());
|
|
182
|
-
for (const branch of branches) {
|
|
183
|
-
// Skip branches with active worktrees
|
|
184
|
-
if (worktreeBranches.has(branch))
|
|
185
|
-
continue;
|
|
186
|
-
// Check for unmerged commits
|
|
187
|
-
if (branchHasUnmergedCommits(branch, integrationBranch, repoPath)) {
|
|
188
|
-
console.log(`[crash-recovery] Preserving stale branch with unmerged commits: ${branch}`);
|
|
189
|
-
preserved.push(branch);
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
// Safe to delete
|
|
193
|
-
const deleteResult = runGitSync(['branch', '-D', branch], repoPath);
|
|
194
|
-
if (deleteResult.success) {
|
|
195
|
-
console.log(`[crash-recovery] Pruned stale branch: ${branch}`);
|
|
196
|
-
pruned.push(branch);
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
console.warn(`[crash-recovery] Failed to prune branch ${branch}: ${deleteResult.error}`);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
console.log(`[crash-recovery] Branch pruning: ${pruned.length} pruned, ${preserved.length} preserved with unmerged work`);
|
|
203
|
-
return { pruned, preserved };
|
|
204
|
-
}
|
|
205
|
-
//# sourceMappingURL=crash-recovery-cleanup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crash-recovery-cleanup.js","sourceRoot":"","sources":["../src/crash-recovery-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,oEAAoE;AAEpE;;GAEG;AACH,SAAS,oBAAoB,CAC3B,UAAkB,EAClB,iBAAyB,EACzB,QAAgB;IAEhB,MAAM,MAAM,GAAG,UAAU,CACvB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,iBAAiB,KAAK,UAAU,EAAE,EAAE,IAAI,CAAC,EACjE,QAAQ,CACT,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,KAAK,CAA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CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,SAAS;QAE3C,6BAA6B;QAC7B,IAAI,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC;YAClE,OAAO,CAAC,GAAG,CAAC,mEAAmE,MAAM,EAAE,CAAC,CAAC;YACzF,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvB,SAAS;QACX,CAAC;QAED,iBAAiB;QACjB,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;QACpE,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,yCAAyC,MAAM,EAAE,CAAC,CAAC;YAC/D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,2CAA2C,MAAM,KAAK,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CACT,oCAAoC,MAAM,CAAC,MAAM,YAAY,SAAS,CAAC,MAAM,+BAA+B,CAC7G,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Worktree scanning for crash recovery.
|
|
3
|
-
*
|
|
4
|
-
* Parses `git worktree list` output and reconciles against DB sessions
|
|
5
|
-
* and active focuses to classify worktrees as active or orphaned.
|
|
6
|
-
*/
|
|
7
|
-
import type { DaemonConfig } from './types.js';
|
|
8
|
-
import type { OrphanedWorktree, RecoveryDeps } from './crash-recovery-types.js';
|
|
9
|
-
/**
|
|
10
|
-
* Parse `git worktree list --porcelain` to build a map of
|
|
11
|
-
* worktree path -> branch name for all registered worktrees.
|
|
12
|
-
*/
|
|
13
|
-
export declare function parseWorktreeList(repoPath: string): Map<string, string>;
|
|
14
|
-
/**
|
|
15
|
-
* Scan the worktree directory and reconcile against active DB sessions
|
|
16
|
-
* to classify each worktree as active or orphaned.
|
|
17
|
-
*/
|
|
18
|
-
export declare function detectOrphanedWorktrees(config: DaemonConfig, deps?: RecoveryDeps): Promise<OrphanedWorktree[]>;
|
|
19
|
-
//# sourceMappingURL=crash-recovery-scan.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crash-recovery-scan.d.ts","sourceRoot":"","sources":["../src/crash-recovery-scan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAgBhF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBvE;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,YAA0B,GAC/B,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA+G7B"}
|