@telora/daemon 0.22.189 → 0.22.208
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 +6 -3
- package/dist/backends/index.d.ts.map +1 -1
- package/dist/backends/index.js +2 -0
- package/dist/backends/index.js.map +1 -1
- package/dist/completion/completion-fact-readers.d.ts +35 -0
- package/dist/completion/completion-fact-readers.d.ts.map +1 -0
- package/dist/completion/completion-fact-readers.js +70 -0
- package/dist/completion/completion-fact-readers.js.map +1 -0
- package/dist/completion/event-dep-defaults.d.ts +27 -0
- package/dist/completion/event-dep-defaults.d.ts.map +1 -0
- package/dist/completion/event-dep-defaults.js +30 -0
- package/dist/completion/event-dep-defaults.js.map +1 -0
- package/dist/completion/event-phases.d.ts.map +1 -1
- package/dist/completion/event-phases.js +5 -13
- package/dist/completion/event-phases.js.map +1 -1
- package/dist/completion/event.d.ts +32 -0
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +31 -25
- package/dist/completion/event.js.map +1 -1
- package/dist/completion/session-hold.d.ts +13 -1
- package/dist/completion/session-hold.d.ts.map +1 -1
- package/dist/completion/session-hold.js +18 -0
- package/dist/completion/session-hold.js.map +1 -1
- package/dist/completion/team-phase.d.ts.map +1 -1
- package/dist/completion/team-phase.js +1 -0
- package/dist/completion/team-phase.js.map +1 -1
- package/dist/completion/unclaimed-migration-notice-phase.d.ts +97 -0
- package/dist/completion/unclaimed-migration-notice-phase.d.ts.map +1 -0
- package/dist/completion/unclaimed-migration-notice-phase.js +270 -0
- package/dist/completion/unclaimed-migration-notice-phase.js.map +1 -0
- package/dist/directive/directive-executor.d.ts.map +1 -1
- package/dist/directive/directive-executor.js +1 -20
- package/dist/directive/directive-executor.js.map +1 -1
- package/dist/focus/focus-executor.d.ts +1 -0
- package/dist/focus/focus-executor.d.ts.map +1 -1
- package/dist/focus/focus-executor.js +18 -17
- package/dist/focus/focus-executor.js.map +1 -1
- package/dist/focus/focus-team-state.js +1 -1
- package/dist/focus/listener-spawn.d.ts.map +1 -1
- package/dist/focus/listener-spawn.js +5 -20
- package/dist/focus/listener-spawn.js.map +1 -1
- package/dist/focus/listener-state.d.ts.map +1 -1
- package/dist/focus/listener-state.js +1 -0
- package/dist/focus/listener-state.js.map +1 -1
- package/dist/focus/listener.d.ts +1 -0
- package/dist/focus/listener.d.ts.map +1 -1
- package/dist/focus/listener.js +9 -0
- package/dist/focus/listener.js.map +1 -1
- package/dist/focus/migration-claim-pass.d.ts +50 -0
- package/dist/focus/migration-claim-pass.d.ts.map +1 -0
- package/dist/focus/migration-claim-pass.js +234 -0
- package/dist/focus/migration-claim-pass.js.map +1 -0
- package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -1
- package/dist/focus/pending-spawn-pass-deps.js +2 -1
- package/dist/focus/pending-spawn-pass-deps.js.map +1 -1
- package/dist/focus/team-actionable-work.d.ts +21 -0
- package/dist/focus/team-actionable-work.d.ts.map +1 -1
- package/dist/focus/team-actionable-work.js +3 -0
- package/dist/focus/team-actionable-work.js.map +1 -1
- package/dist/git/types.d.ts.map +1 -1
- package/dist/git/types.js +2 -1
- package/dist/git/types.js.map +1 -1
- package/dist/loops/llm-client.d.ts.map +1 -1
- package/dist/loops/llm-client.js +11 -1
- package/dist/loops/llm-client.js.map +1 -1
- package/dist/migrations/migration-claim-lifecycle.d.ts +166 -0
- package/dist/migrations/migration-claim-lifecycle.d.ts.map +1 -0
- package/dist/migrations/migration-claim-lifecycle.js +198 -0
- package/dist/migrations/migration-claim-lifecycle.js.map +1 -0
- package/dist/migrations/migration-held-set.d.ts +171 -0
- package/dist/migrations/migration-held-set.d.ts.map +1 -0
- package/dist/migrations/migration-held-set.js +295 -0
- package/dist/migrations/migration-held-set.js.map +1 -0
- package/dist/migrations/migration-inventory.d.ts +187 -0
- package/dist/migrations/migration-inventory.d.ts.map +1 -0
- package/dist/migrations/migration-inventory.js +253 -0
- package/dist/migrations/migration-inventory.js.map +1 -0
- package/dist/migrations/migration-manifest.d.ts +114 -0
- package/dist/migrations/migration-manifest.d.ts.map +1 -0
- package/dist/migrations/migration-manifest.js +295 -0
- package/dist/migrations/migration-manifest.js.map +1 -0
- package/dist/prompt/team-prompt-base.js +1 -1
- package/dist/prompt-sections/migration-numbering-section.d.ts +58 -0
- package/dist/prompt-sections/migration-numbering-section.d.ts.map +1 -0
- package/dist/prompt-sections/migration-numbering-section.js +70 -0
- package/dist/prompt-sections/migration-numbering-section.js.map +1 -0
- package/dist/prompt-sections/migration-numbering-state.d.ts +30 -0
- package/dist/prompt-sections/migration-numbering-state.d.ts.map +1 -0
- package/dist/prompt-sections/migration-numbering-state.js +24 -0
- package/dist/prompt-sections/migration-numbering-state.js.map +1 -0
- package/dist/prompt-sections/unclaimed-migration-section.d.ts +38 -0
- package/dist/prompt-sections/unclaimed-migration-section.d.ts.map +1 -0
- package/dist/prompt-sections/unclaimed-migration-section.js +57 -0
- package/dist/prompt-sections/unclaimed-migration-section.js.map +1 -0
- package/dist/queries/claim-pass-focuses.d.ts +19 -0
- package/dist/queries/claim-pass-focuses.d.ts.map +1 -0
- package/dist/queries/claim-pass-focuses.js +72 -0
- package/dist/queries/claim-pass-focuses.js.map +1 -0
- package/dist/queries/daemon-connection.d.ts.map +1 -1
- package/dist/queries/daemon-connection.js +1 -0
- package/dist/queries/daemon-connection.js.map +1 -1
- package/dist/queries/focus-discovery.d.ts +25 -2
- package/dist/queries/focus-discovery.d.ts.map +1 -1
- package/dist/queries/focus-discovery.js +16 -9
- package/dist/queries/focus-discovery.js.map +1 -1
- package/dist/queries/focus-unclaimed-migration.d.ts +146 -0
- package/dist/queries/focus-unclaimed-migration.d.ts.map +1 -0
- package/dist/queries/focus-unclaimed-migration.js +266 -0
- package/dist/queries/focus-unclaimed-migration.js.map +1 -0
- package/dist/queries/live-focus-branches.d.ts +32 -0
- package/dist/queries/live-focus-branches.d.ts.map +1 -0
- package/dist/queries/live-focus-branches.js +66 -0
- package/dist/queries/live-focus-branches.js.map +1 -0
- package/dist/queries/migration-claims.d.ts +25 -0
- package/dist/queries/migration-claims.d.ts.map +1 -0
- package/dist/queries/migration-claims.js +79 -0
- package/dist/queries/migration-claims.js.map +1 -0
- package/dist/queries/schemas.d.ts +2 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +6 -0
- package/dist/queries/schemas.js.map +1 -1
- package/dist/queries/shared.js +1 -1
- package/dist/session/session-lineage.d.ts.map +1 -1
- package/dist/session/session-lineage.js +3 -0
- package/dist/session/session-lineage.js.map +1 -1
- package/dist/shell/heartbeat-metadata.d.ts +48 -2
- package/dist/shell/heartbeat-metadata.d.ts.map +1 -1
- package/dist/shell/heartbeat-metadata.js +80 -3
- package/dist/shell/heartbeat-metadata.js.map +1 -1
- package/dist/shell/heartbeat.d.ts +13 -0
- package/dist/shell/heartbeat.d.ts.map +1 -1
- package/dist/shell/heartbeat.js +31 -10
- package/dist/shell/heartbeat.js.map +1 -1
- package/dist/shell/mcp-resolution.js +1 -1
- package/dist/shell/mcp-resolution.js.map +1 -1
- package/dist/shell/migration-held-set-publish.d.ts +170 -0
- package/dist/shell/migration-held-set-publish.d.ts.map +1 -0
- package/dist/shell/migration-held-set-publish.js +172 -0
- package/dist/shell/migration-held-set-publish.js.map +1 -0
- package/dist/shell/worker-pidfile.d.ts.map +1 -1
- package/dist/shell/worker-pidfile.js +1 -0
- package/dist/shell/worker-pidfile.js.map +1 -1
- package/dist/spawn/helpers.d.ts.map +1 -1
- package/dist/spawn/helpers.js +1 -0
- package/dist/spawn/helpers.js.map +1 -1
- package/dist/spawn/lead-launch.d.ts.map +1 -1
- package/dist/spawn/lead-launch.js +1 -0
- package/dist/spawn/lead-launch.js.map +1 -1
- package/dist/spawn/lead-process-ownership.d.ts.map +1 -1
- package/dist/spawn/lead-process-ownership.js +1 -0
- package/dist/spawn/lead-process-ownership.js.map +1 -1
- package/dist/spawn/process-group-kill.d.ts.map +1 -1
- package/dist/spawn/process-group-kill.js +1 -0
- package/dist/spawn/process-group-kill.js.map +1 -1
- package/dist/spawn/process-spawn.d.ts +18 -1
- package/dist/spawn/process-spawn.d.ts.map +1 -1
- package/dist/spawn/process-spawn.js +11 -6
- package/dist/spawn/process-spawn.js.map +1 -1
- package/dist/spawn/prompt-assembly.d.ts +115 -18
- package/dist/spawn/prompt-assembly.d.ts.map +1 -1
- package/dist/spawn/prompt-assembly.js +121 -2
- package/dist/spawn/prompt-assembly.js.map +1 -1
- package/dist/spawn/spawn-and-acknowledge.d.ts +61 -0
- package/dist/spawn/spawn-and-acknowledge.d.ts.map +1 -0
- package/dist/spawn/spawn-and-acknowledge.js +117 -0
- package/dist/spawn/spawn-and-acknowledge.js.map +1 -0
- package/dist/spawn/spawn-cooldown.js +1 -1
- package/dist/spawn/spawn-decision.d.ts +10 -10
- package/dist/spawn/spawn-decision.d.ts.map +1 -1
- package/dist/spawn/spawn-decision.js +33 -5
- package/dist/spawn/spawn-decision.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 +24 -0
- package/dist/templates/claude-md.js.map +1 -1
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/testing/fixtures/migration-namespace-repo.d.ts +63 -0
- package/dist/testing/fixtures/migration-namespace-repo.d.ts.map +1 -0
- package/dist/testing/fixtures/migration-namespace-repo.js +164 -0
- package/dist/testing/fixtures/migration-namespace-repo.js.map +1 -0
- package/dist/testing/fixtures/stubborn-lead-process.d.ts.map +1 -1
- package/dist/testing/fixtures/stubborn-lead-process.js +1 -0
- package/dist/testing/fixtures/stubborn-lead-process.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/verify/no-own-delta-verdict.d.ts +16 -2
- package/dist/verify/no-own-delta-verdict.d.ts.map +1 -1
- package/dist/verify/no-own-delta-verdict.js +18 -2
- package/dist/verify/no-own-delta-verdict.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
+
// Pinned by: packages/daemon/src/queries/claim-pass-focuses.test.ts
|
|
3
|
+
// PINNED-BY-END
|
|
4
|
+
/**
|
|
5
|
+
* Which focuses the claim-lifecycle pass considers, and whether each has ENDED.
|
|
6
|
+
*
|
|
7
|
+
* WHY NOT `getActiveFocuses`. That read returns focuses with `status='active'`
|
|
8
|
+
* AND an assigned agent role -- the spawn set. Every exit release exists for is
|
|
9
|
+
* outside it: a completed focus, a cancelled one, and an un-armed one are all
|
|
10
|
+
* excluded by exactly the filters that make it the spawn set. A pass built on
|
|
11
|
+
* it could confirm claims and would never release one, which is the failure
|
|
12
|
+
* mode that leaks numbers.
|
|
13
|
+
*
|
|
14
|
+
* So this reads the product's focuses regardless of status or arm, and reports
|
|
15
|
+
* for each the reason -- if any -- that its claims should be released.
|
|
16
|
+
*
|
|
17
|
+
* THE THREE EXITS, AND WHY UN-ARMING IS ONE
|
|
18
|
+
* -----------------------------------------
|
|
19
|
+
* - `focus_completed` -- status complete
|
|
20
|
+
* - `focus_cancelled` -- status cancelled
|
|
21
|
+
* - `arm_cleared` -- still active, but no assigned agent role
|
|
22
|
+
*
|
|
23
|
+
* The third looks premature: an un-armed focus may be re-armed. The trade is
|
|
24
|
+
* asymmetric and the cheap side wins -- re-claiming costs the next team ONE MCP
|
|
25
|
+
* call, while a held-but-unused number on a dense sequential scheme costs every
|
|
26
|
+
* later claimant, permanently.
|
|
27
|
+
*
|
|
28
|
+
* A focus that is active AND armed is LIVE: its claims are neither released nor
|
|
29
|
+
* judged abandoned, because absence of a file there means "not written yet".
|
|
30
|
+
*
|
|
31
|
+
* @module queries/claim-pass-focuses
|
|
32
|
+
*/
|
|
33
|
+
import { scanAllFocuses } from './focuses.js';
|
|
34
|
+
/** Why this focus's claims should be released, or null while it is live. */
|
|
35
|
+
export function endedBecause(row) {
|
|
36
|
+
if (row.status === 'complete')
|
|
37
|
+
return 'focus_completed';
|
|
38
|
+
if (row.status === 'cancelled')
|
|
39
|
+
return 'focus_cancelled';
|
|
40
|
+
// Active (or proposed) with no role: the arm was cleared, or never made.
|
|
41
|
+
if (!row.assignedAgentRoleId)
|
|
42
|
+
return 'arm_cleared';
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Every focus on the product, with its branch and its ended-reason.
|
|
47
|
+
*
|
|
48
|
+
* Focuses with no branch name are included and skipped by the pass: a focus
|
|
49
|
+
* that never got a branch holds no files, and a claim under it -- if any -- is
|
|
50
|
+
* released by its ended-reason like any other.
|
|
51
|
+
*/
|
|
52
|
+
export async function listClaimPassFocuses(productId, deps = {}) {
|
|
53
|
+
const result = await scanAllFocuses({
|
|
54
|
+
productId,
|
|
55
|
+
detail: 'summary',
|
|
56
|
+
...(deps.callApi ? { callApi: deps.callApi } : {}),
|
|
57
|
+
});
|
|
58
|
+
return result.focuses
|
|
59
|
+
.map((row) => {
|
|
60
|
+
const focusId = row.focusId ?? row.id;
|
|
61
|
+
if (!focusId)
|
|
62
|
+
return null;
|
|
63
|
+
return {
|
|
64
|
+
focusId,
|
|
65
|
+
focusName: row.name ?? focusId,
|
|
66
|
+
branchName: row.branchName ?? null,
|
|
67
|
+
endedBecause: endedBecause(row),
|
|
68
|
+
};
|
|
69
|
+
})
|
|
70
|
+
.filter((focus) => focus !== null);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=claim-pass-focuses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-pass-focuses.js","sourceRoot":"","sources":["../../src/queries/claim-pass-focuses.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,oEAAoE;AACpE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAe9C,4EAA4E;AAC5E,MAAM,UAAU,YAAY,CAAC,GAG5B;IACC,IAAI,GAAG,CAAC,MAAM,KAAK,UAAU;QAAE,OAAO,iBAAiB,CAAC;IACxD,IAAI,GAAG,CAAC,MAAM,KAAK,WAAW;QAAE,OAAO,iBAAiB,CAAC;IACzD,yEAAyE;IACzE,IAAI,CAAC,GAAG,CAAC,mBAAmB;QAAE,OAAO,aAAa,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,OAAqC,EAAE;IAEvC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAoB;QACrD,SAAS;QACT,MAAM,EAAE,SAAS;QACjB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnD,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,OAAO;SAClB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACX,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,OAAO;YACL,OAAO;YACP,SAAS,EAAE,GAAG,CAAC,IAAI,IAAI,OAAO;YAC9B,UAAU,EAAE,GAAG,CAAC,UAAU,IAAI,IAAI;YAClC,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC;SAChC,CAAC;IACJ,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAA2B,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-connection.d.ts","sourceRoot":"","sources":["../../src/queries/daemon-connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daemon-connection.d.ts","sourceRoot":"","sources":["../../src/queries/daemon-connection.ts"],"names":[],"mappings":"AAcA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AAE,CAAC,CAKnD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
2
|
// Pinned by: packages/daemon/src/shell/heartbeat-draining-status.test.ts,
|
|
3
|
+
// packages/daemon/src/shell/heartbeat-migration-held-set.test.ts,
|
|
3
4
|
// packages/daemon/src/shell/heartbeat-shutdown-guard.test.ts,
|
|
4
5
|
// packages/daemon/src/shell/heartbeat-team-phases.test.ts,
|
|
5
6
|
// packages/daemon/src/shell/retention-observation-heartbeat.test.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-connection.js","sourceRoot":"","sources":["../../src/queries/daemon-connection.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0EAA0E;AAC1E,gEAAgE;AAChE,6DAA6D;AAC7D,sEAAsE;AACtE,gBAAgB;AAEhB;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAoBtC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,aAAqB,EACrB,QA2BC,EACD,QAAkC;IAElC,OAAO,OAAO,CAAoB,kBAAkB,EAAE;QACpD,MAAM,EAAE;YACN,GAAG;YACH,QAAQ;YACR,QAAQ;YACR,aAAa;YACb,GAAG,QAAQ;YACX,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClC;KACF,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,MAAM,OAAO,CAAC,mBAAmB,EAAE;QACjC,MAAM,EAAE,EAAE,GAAG,EAAE;KAChB,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,SAAiB,EACjB,QAAgB;IAEhB,OAAO,OAAO,CAA2C,sBAAsB,EAAE;QAC/E,SAAS;QACT,MAAM,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE;KACrC,CAAC,CAAC;AACL,CAAC"}
|
|
1
|
+
{"version":3,"file":"daemon-connection.js","sourceRoot":"","sources":["../../src/queries/daemon-connection.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0EAA0E;AAC1E,oEAAoE;AACpE,gEAAgE;AAChE,6DAA6D;AAC7D,sEAAsE;AACtE,gBAAgB;AAEhB;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAoBtC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,aAAqB,EACrB,QA2BC,EACD,QAAkC;IAElC,OAAO,OAAO,CAAoB,kBAAkB,EAAE;QACpD,MAAM,EAAE;YACN,GAAG;YACH,QAAQ;YACR,QAAQ;YACR,aAAa;YACb,GAAG,QAAQ;YACX,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClC;KACF,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,MAAM,OAAO,CAAC,mBAAmB,EAAE;QACjC,MAAM,EAAE,EAAE,GAAG,EAAE;KAChB,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,SAAiB,EACjB,QAAgB;IAEhB,OAAO,OAAO,CAA2C,sBAAsB,EAAE;QAC/E,SAAS;QACT,MAAM,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE;KACrC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { PipelineConfig } from '../types/index.js';
|
|
9
9
|
import { type CallApiDeps } from './shared.js';
|
|
10
|
+
import { type ReadyFocusSchema } from './schemas.js';
|
|
11
|
+
import type { z } from 'zod';
|
|
12
|
+
/** One validated focus from the backend's ready-focuses response. */
|
|
13
|
+
type ReadyFocus = z.infer<typeof ReadyFocusSchema>;
|
|
10
14
|
import type { DeliveryAdvancementStatePersisted } from './schemas.js';
|
|
11
15
|
/**
|
|
12
16
|
* Get focuses with agent assignments that have ready deliveries.
|
|
@@ -15,7 +19,8 @@ import type { DeliveryAdvancementStatePersisted } from './schemas.js';
|
|
|
15
19
|
* delivery_id and delivery_name are null when the focus has zero
|
|
16
20
|
* deliveries -- the team is expected to scope deliveries as its first act.
|
|
17
21
|
*/
|
|
18
|
-
|
|
22
|
+
/** One focus the backend reports as ready, in the shape the spawn loop reads. */
|
|
23
|
+
export interface ReadyFocusRow {
|
|
19
24
|
focus_id: string;
|
|
20
25
|
focus_name: string;
|
|
21
26
|
delivery_id: string | null;
|
|
@@ -63,6 +68,13 @@ export declare function getReadyFocuses(_organizationId: string, productId?: str
|
|
|
63
68
|
* (bypassing findActionableDeliveries) and clears the flag for idempotency.
|
|
64
69
|
*/
|
|
65
70
|
answer_rearm_requested_at: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* See schemas.ts: the focus owes its team an unclaimed-migration notice.
|
|
73
|
+
* Optional on the ROW (a hand-built test fixture predating it reads as not
|
|
74
|
+
* owed) though the mapper always supplies it; every consumer compares
|
|
75
|
+
* `=== true`, so an absent field is never an accidental force-spawn.
|
|
76
|
+
*/
|
|
77
|
+
unclaimed_migration_notice_owed?: boolean;
|
|
66
78
|
/**
|
|
67
79
|
* Pinned git branch identity (product_focuses.branch_name). Non-null => read
|
|
68
80
|
* this instead of re-deriving agent/<role>/<name>-<id> from the live role, so
|
|
@@ -71,7 +83,17 @@ export declare function getReadyFocuses(_organizationId: string, productId?: str
|
|
|
71
83
|
* derives-and-pins on first creation.
|
|
72
84
|
*/
|
|
73
85
|
branch_name: string | null;
|
|
74
|
-
}
|
|
86
|
+
}
|
|
87
|
+
export declare function getReadyFocuses(_organizationId: string, productId?: string): Promise<ReadyFocusRow[]>;
|
|
88
|
+
/**
|
|
89
|
+
* One validated backend focus, as the spawn loop's row.
|
|
90
|
+
*
|
|
91
|
+
* Named and exported rather than inlined in the `.map` above because the
|
|
92
|
+
* MAPPING is load-bearing in its own right: a signal the schema parses and this
|
|
93
|
+
* function then drops is a spawn decision that silently never fires, and an
|
|
94
|
+
* inline arrow gives a test nothing to hold.
|
|
95
|
+
*/
|
|
96
|
+
export declare function toReadyFocusRow(s: ReadyFocus): ReadyFocusRow;
|
|
75
97
|
/**
|
|
76
98
|
* Clear the escalation answer re-arm signal on a focus once the daemon has
|
|
77
99
|
* spawned/handled the re-arm. Set-once write (answer path) + clear-on-handle
|
|
@@ -264,4 +286,5 @@ export interface ActiveFocusRow {
|
|
|
264
286
|
* orphan worktree cleanup to avoid incorrectly removing active worktrees.
|
|
265
287
|
*/
|
|
266
288
|
export declare function getActiveFocuses(_organizationId: string, productId?: string): Promise<ActiveFocusRow[]>;
|
|
289
|
+
export {};
|
|
267
290
|
//# sourceMappingURL=focus-discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-discovery.d.ts","sourceRoot":"","sources":["../../src/queries/focus-discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focus-discovery.d.ts","sourceRoot":"","sources":["../../src/queries/focus-discovery.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAA2D,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9G,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,qEAAqE;AACrE,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK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|
@@ -5,21 +5,27 @@
|
|
|
5
5
|
// packages/daemon/src/focus/listener-auto-advance-team-presence.test.ts,
|
|
6
6
|
// packages/daemon/src/focus/listener-auto-advance-teamless-wedge.test.ts,
|
|
7
7
|
// packages/daemon/src/focus/recorded-delivery-auto-advance.test.ts,
|
|
8
|
+
// packages/daemon/src/focus/unclaimed-notice-coding-precedence.test.ts,
|
|
8
9
|
// packages/daemon/src/integration/advancement-path-parity.test.ts,
|
|
9
|
-
// packages/daemon/src/nexus/nexus-return-path-e2e.test.ts,
|
|
10
|
+
// packages/daemon/src/nexus/nexus-return-path-e2e.test.ts,
|
|
11
|
+
// packages/daemon/src/queries/answer-rearm-respawn.test.ts, packages/daemon/src/shell/disarm-reaper.test.ts
|
|
10
12
|
// PINNED-BY-END
|
|
11
13
|
import { callApi, callApiValidated } from './shared.js';
|
|
12
14
|
import { ReadyFocusesResponseSchema, ActiveFocusesResponseSchema } from './schemas.js';
|
|
15
|
+
export async function getReadyFocuses(_organizationId, productId) {
|
|
16
|
+
const result = await callApiValidated('daemon_get_ready_focuses', ReadyFocusesResponseSchema, productId ? { productId } : {});
|
|
17
|
+
return result.focuses.map(toReadyFocusRow);
|
|
18
|
+
}
|
|
13
19
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Returns the next ready delivery per focus.
|
|
20
|
+
* One validated backend focus, as the spawn loop's row.
|
|
16
21
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
22
|
+
* Named and exported rather than inlined in the `.map` above because the
|
|
23
|
+
* MAPPING is load-bearing in its own right: a signal the schema parses and this
|
|
24
|
+
* function then drops is a spawn decision that silently never fires, and an
|
|
25
|
+
* inline arrow gives a test nothing to hold.
|
|
19
26
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
return result.focuses.map((s) => ({
|
|
27
|
+
export function toReadyFocusRow(s) {
|
|
28
|
+
return ({
|
|
23
29
|
focus_id: s.focusId,
|
|
24
30
|
focus_name: s.focusName,
|
|
25
31
|
delivery_id: s.deliveryId,
|
|
@@ -39,9 +45,10 @@ export async function getReadyFocuses(_organizationId, productId) {
|
|
|
39
45
|
assigned_agent_role_id: s.assignedAgentRoleId,
|
|
40
46
|
agent_role_name: s.agentRoleName,
|
|
41
47
|
answer_rearm_requested_at: s.answerRearmRequestedAt ?? null,
|
|
48
|
+
unclaimed_migration_notice_owed: s.unclaimedMigrationNoticeOwed ?? false,
|
|
42
49
|
armed_baseline_delivery_ids: s.armedBaselineDeliveryIds ?? null,
|
|
43
50
|
branch_name: s.branchName ?? null,
|
|
44
|
-
})
|
|
51
|
+
});
|
|
45
52
|
}
|
|
46
53
|
/**
|
|
47
54
|
* Clear the escalation answer re-arm signal on a focus once the daemon has
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-discovery.js","sourceRoot":"","sources":["../../src/queries/focus-discovery.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+EAA+E;AAC/E,qDAAqD;AACrD,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,sEAAsE;AACtE,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"focus-discovery.js","sourceRoot":"","sources":["../../src/queries/focus-discovery.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+EAA+E;AAC/E,qDAAqD;AACrD,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,sEAAsE;AACtE,0EAA0E;AAC1E,qEAAqE;AACrE,6DAA6D;AAC7D,8GAA8G;AAC9G,gBAAgB;AAWhB,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAyB,MAAM,cAAc,CAAC;AAgF9G,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,eAAuB,EACvB,SAAkB;IAElB,MAAM,MAAM,GAAG,MAAM,gBAAgB,CACnC,0BAA0B,EAC1B,0BAA0B,EAC1B,SAAS,CAAC,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C,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The focus's durable record of "my branch holds a migration I never claimed",
|
|
3
|
+
* and its clear.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS IS STATE AND NOT AN ESCALATION. It names no human-only act: the team
|
|
6
|
+
* that wrote the file is the one that can claim the number or remove it. An
|
|
7
|
+
* escalation would be a row in a human queue that can only wait for the same
|
|
8
|
+
* team to act, and a routine triage pass could resolve it while the file is
|
|
9
|
+
* still unclaimed. So it is a fact about the focus that clears itself when the
|
|
10
|
+
* fact stops being true.
|
|
11
|
+
*
|
|
12
|
+
* WHY focus_debug_artifacts, and not the deliveries' git_state: the same reason
|
|
13
|
+
* `focus-integration-conflict.ts` gives. `org_nodes.git_state` is a
|
|
14
|
+
* forward-only ladder with one slot per delivery, and this is a fact about the
|
|
15
|
+
* focus BRANCH shared by every delivery on it -- with no room for the number or
|
|
16
|
+
* the path. A debug section is one row per (focus, kind), rendered with its own
|
|
17
|
+
* stamp, read by nothing in the machine's decision path, and cleared by
|
|
18
|
+
* DELETING the row, which is exactly what "until the team claims or removes it"
|
|
19
|
+
* wants.
|
|
20
|
+
*
|
|
21
|
+
* SINCE-WHEN SURVIVES THE RE-RECORD. `updated_at` moves on every write and the
|
|
22
|
+
* record is re-written on every pass that still sees the file, so `updated_at`
|
|
23
|
+
* alone would always read "just now" and hide a file unclaimed for a week. The
|
|
24
|
+
* content carries `Unclaimed since:` explicitly and a re-record reads the
|
|
25
|
+
* existing section and carries the value forward; a failed read degrades to
|
|
26
|
+
* "since now" rather than losing the record.
|
|
27
|
+
*
|
|
28
|
+
* @module queries/focus-unclaimed-migration
|
|
29
|
+
*/
|
|
30
|
+
import { type CallApiDeps } from './shared.js';
|
|
31
|
+
import type { UnclaimedFile } from '../migrations/migration-claim-lifecycle.js';
|
|
32
|
+
/** The focus_debug_artifacts section the record lives in. */
|
|
33
|
+
export declare const UNCLAIMED_MIGRATION_SECTION_KIND = "unclaimed_migration";
|
|
34
|
+
/** The line carrying the first-observed timestamp across re-records. */
|
|
35
|
+
export declare const UNCLAIMED_SINCE_PREFIX = "Unclaimed since: ";
|
|
36
|
+
/**
|
|
37
|
+
* The line recording that this record has been PUT IN FRONT OF THE TEAM.
|
|
38
|
+
*
|
|
39
|
+
* WHY THE RECORD IS NOT ENOUGH ON ITS OWN. A record that nobody reads before
|
|
40
|
+
* the branch merges is a note written to an empty room: the file lands on
|
|
41
|
+
* integration holding a number no claim knows about, and the team that wrote it
|
|
42
|
+
* has finished. So an unnamed record is TEAM-ACTIONABLE WORK -- the completion
|
|
43
|
+
* path treats it the way it treats an outstanding merge-conflict resolution,
|
|
44
|
+
* and the team is not torn down before it has been handed the file.
|
|
45
|
+
*
|
|
46
|
+
* WHY IT IS MARKED, AND WHY THAT BOUNDS IT. The hold lasts exactly one coding
|
|
47
|
+
* turn: once the record has been composed into a spawn prompt, this line is
|
|
48
|
+
* written and the hold lifts, whether or not the team acted. A hold that
|
|
49
|
+
* persisted until the team complied would be a wedge -- the record clears only
|
|
50
|
+
* on a claim or a removal, and neither is something the daemon can force.
|
|
51
|
+
* Telling the team once is what was missing; compelling it is not this
|
|
52
|
+
* mechanism's business.
|
|
53
|
+
*/
|
|
54
|
+
export declare const UNCLAIMED_NAMED_PREFIX = "Named to the team at: ";
|
|
55
|
+
/** Render the human-facing record. */
|
|
56
|
+
export declare function renderUnclaimedMigrationArtifact(args: {
|
|
57
|
+
focusName: string;
|
|
58
|
+
branchName: string;
|
|
59
|
+
files: readonly UnclaimedFile[];
|
|
60
|
+
since: string;
|
|
61
|
+
/** When the team was handed this record, if it has been. */
|
|
62
|
+
namedAt?: string | null;
|
|
63
|
+
}): string;
|
|
64
|
+
/** When an existing record was last put in front of the team, or null. */
|
|
65
|
+
export declare function parseUnclaimedNamedAt(content: string | null | undefined): string | null;
|
|
66
|
+
/** Read the first-observed timestamp back out of an existing record. */
|
|
67
|
+
export declare function parseUnclaimedSince(content: string | undefined): string | null;
|
|
68
|
+
/**
|
|
69
|
+
* Record that this focus's branch holds unclaimed migrations, carrying forward
|
|
70
|
+
* the first-observed timestamp when one is already on record.
|
|
71
|
+
*/
|
|
72
|
+
export declare function recordUnclaimedMigrations(args: {
|
|
73
|
+
focusId: string;
|
|
74
|
+
focusName: string;
|
|
75
|
+
branchName: string;
|
|
76
|
+
files: readonly UnclaimedFile[];
|
|
77
|
+
detectedAt: string;
|
|
78
|
+
}, deps?: CallApiDeps): Promise<void>;
|
|
79
|
+
/** Clear the record. Idempotent: deleting a section that is not there is a no-op. */
|
|
80
|
+
export declare function clearUnclaimedMigrations(focusId: string, deps?: CallApiDeps): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Read the record back, for the spawn prompt.
|
|
83
|
+
*
|
|
84
|
+
* Returns the rendered content, or null when the focus has no such record.
|
|
85
|
+
* The section is stored as prose because it is also a human-facing Debug-tab
|
|
86
|
+
* artifact; the prompt carries the same text rather than re-rendering it, so a
|
|
87
|
+
* team and a human read the identical account.
|
|
88
|
+
*/
|
|
89
|
+
export declare function readUnclaimedMigrationRecord(focusId: string, deps?: CallApiDeps): Promise<string | null>;
|
|
90
|
+
/**
|
|
91
|
+
* The same read, but a FAILURE THROWS.
|
|
92
|
+
*
|
|
93
|
+
* Two callers need the difference. A spawn must never be failed by a debug-tab
|
|
94
|
+
* read, so it takes the lenient form above. The completion path must not read
|
|
95
|
+
* a failed read as "there is nothing to tell" -- that is the destructive
|
|
96
|
+
* direction, the one that lets a team go with an unclaimed migration still on
|
|
97
|
+
* its branch -- so it takes this one and fails closed. Swallowing inside the
|
|
98
|
+
* query made both callers the same, and quietly defeated the second one's
|
|
99
|
+
* fail-closed handler: it could never see the failure it was written for.
|
|
100
|
+
*/
|
|
101
|
+
export declare function readUnclaimedMigrationRecordStrict(focusId: string, deps?: CallApiDeps): Promise<string | null>;
|
|
102
|
+
/**
|
|
103
|
+
* The ordinals an existing record names.
|
|
104
|
+
*
|
|
105
|
+
* Read back so the lifecycle can keep an ordinal NAMED until the team resolves
|
|
106
|
+
* it. Without this the record clears the moment the branch merges -- its own
|
|
107
|
+
* unclaimed file then reads as inherited from integration, the detection goes
|
|
108
|
+
* quiet, and the record reports success for a problem that only moved.
|
|
109
|
+
*
|
|
110
|
+
* Parsed from the rendered lines rather than stored twice: one text is what a
|
|
111
|
+
* human reads on the Debug tab AND what the team is shown, and a second
|
|
112
|
+
* machine-readable copy is a second thing to keep in step.
|
|
113
|
+
*/
|
|
114
|
+
export declare function parseUnclaimedOrdinals(content: string | null | undefined): string[];
|
|
115
|
+
/** One migration an existing record names: its number and the file it named. */
|
|
116
|
+
export interface RecordedUnclaimedEntry {
|
|
117
|
+
ordinal: string;
|
|
118
|
+
path: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The record's entries, WITH their paths.
|
|
122
|
+
*
|
|
123
|
+
* The ordinals alone are not enough to re-render the record. When integration
|
|
124
|
+
* cannot be read, an ordinal the branch no longer shows can be neither proved
|
|
125
|
+
* merged nor proved removed -- so it must be carried forward verbatim, and
|
|
126
|
+
* carrying it forward needs the file it named. Reading it back from the record
|
|
127
|
+
* (rather than storing a second machine-readable copy) keeps one text as both
|
|
128
|
+
* what a human reads and what the lifecycle reasons over.
|
|
129
|
+
*/
|
|
130
|
+
export declare function parseUnclaimedEntries(content: string | null | undefined): RecordedUnclaimedEntry[];
|
|
131
|
+
/**
|
|
132
|
+
* Mark this focus's record as having been handed to the team.
|
|
133
|
+
*
|
|
134
|
+
* Called when the record is composed into a spawn prompt -- the moment the team
|
|
135
|
+
* is actually told. Writing it earlier (at detection) would lift the hold
|
|
136
|
+
* before anyone read it; writing it later (after the session ends) would hold a
|
|
137
|
+
* second turn for a file already named.
|
|
138
|
+
*
|
|
139
|
+
* Best effort by construction: a spawn is never failed by this write. The cost
|
|
140
|
+
* of losing it is one extra coding turn, and the cost of the whole mechanism
|
|
141
|
+
* failing is what it was before -- the team is still shown the record on every
|
|
142
|
+
* spawn while it stands, because the section renders on the record's existence,
|
|
143
|
+
* not on this marker.
|
|
144
|
+
*/
|
|
145
|
+
export declare function markUnclaimedMigrationNamed(focusId: string, namedAt: string, deps?: CallApiDeps): Promise<void>;
|
|
146
|
+
//# sourceMappingURL=focus-unclaimed-migration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-unclaimed-migration.d.ts","sourceRoot":"","sources":["../../src/queries/focus-unclaimed-migration.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,6DAA6D;AAC7D,eAAO,MAAM,gCAAgC,wBAAwB,CAAC;AAEtE,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAQ/D,sCAAsC;AACtC,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GAAG,MAAM,CAwBT;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CASvF;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAS9E;AASD;;;GAGG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAA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