@telora/daemon 0.22.13 → 0.22.52
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 +5 -3
- package/dist/backends/index.d.ts.map +1 -1
- package/dist/backends/index.js +1 -0
- package/dist/backends/index.js.map +1 -1
- package/dist/ci/ci-status.d.ts.map +1 -1
- package/dist/ci/ci-status.js +1 -0
- package/dist/ci/ci-status.js.map +1 -1
- package/dist/completion/detector.d.ts +9 -0
- package/dist/completion/detector.d.ts.map +1 -1
- package/dist/completion/detector.js +18 -0
- package/dist/completion/detector.js.map +1 -1
- package/dist/completion/event-phases.d.ts +20 -0
- package/dist/completion/event-phases.d.ts.map +1 -1
- package/dist/completion/event-phases.js +46 -13
- package/dist/completion/event-phases.js.map +1 -1
- package/dist/completion/event.d.ts +69 -9
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +109 -22
- package/dist/completion/event.js.map +1 -1
- package/dist/completion/liveness-firing.d.ts +27 -0
- package/dist/completion/liveness-firing.d.ts.map +1 -0
- package/dist/completion/liveness-firing.js +79 -0
- package/dist/completion/liveness-firing.js.map +1 -0
- package/dist/completion/review-exit-phase.js +4 -4
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/completion/state-cascade.d.ts.map +1 -1
- package/dist/completion/state-cascade.js +8 -0
- package/dist/completion/state-cascade.js.map +1 -1
- package/dist/completion/stdin-turn-tracker.d.ts +19 -0
- package/dist/completion/stdin-turn-tracker.d.ts.map +1 -0
- package/dist/completion/stdin-turn-tracker.js +57 -0
- package/dist/completion/stdin-turn-tracker.js.map +1 -0
- package/dist/completion/supervision-firing-record.d.ts +242 -0
- package/dist/completion/supervision-firing-record.d.ts.map +1 -0
- package/dist/completion/supervision-firing-record.js +292 -0
- package/dist/completion/supervision-firing-record.js.map +1 -0
- package/dist/completion/team-lifecycle.d.ts.map +1 -1
- package/dist/completion/team-lifecycle.js +9 -0
- package/dist/completion/team-lifecycle.js.map +1 -1
- package/dist/directive/directive-dispatch.d.ts +7 -1
- package/dist/directive/directive-dispatch.d.ts.map +1 -1
- package/dist/directive/directive-dispatch.js +105 -39
- package/dist/directive/directive-dispatch.js.map +1 -1
- package/dist/directive/directive-executor.d.ts +1 -10
- package/dist/directive/directive-executor.d.ts.map +1 -1
- package/dist/directive/directive-executor.js +51 -33
- package/dist/directive/directive-executor.js.map +1 -1
- package/dist/directive/directive-queue.d.ts +35 -9
- package/dist/directive/directive-queue.d.ts.map +1 -1
- package/dist/directive/directive-queue.js +15 -8
- package/dist/directive/directive-queue.js.map +1 -1
- package/dist/directive/directive-verify-hold-gate.d.ts +33 -0
- package/dist/directive/directive-verify-hold-gate.d.ts.map +1 -0
- package/dist/directive/directive-verify-hold-gate.js +57 -0
- package/dist/directive/directive-verify-hold-gate.js.map +1 -0
- package/dist/directive/phase-sync.d.ts +11 -0
- package/dist/directive/phase-sync.d.ts.map +1 -1
- package/dist/directive/phase-sync.js +12 -0
- package/dist/directive/phase-sync.js.map +1 -1
- package/dist/drift/staleness-sensor.d.ts +62 -67
- package/dist/drift/staleness-sensor.d.ts.map +1 -1
- package/dist/drift/staleness-sensor.js +233 -68
- package/dist/drift/staleness-sensor.js.map +1 -1
- package/dist/drift/staleness.d.ts +8 -0
- package/dist/drift/staleness.d.ts.map +1 -1
- package/dist/drift/staleness.js +7 -1
- package/dist/drift/staleness.js.map +1 -1
- package/dist/focus/focus-engine.js +1 -1
- package/dist/focus/focus-engine.js.map +1 -1
- package/dist/focus/focus-team-state.d.ts.map +1 -1
- package/dist/focus/focus-team-state.js +2 -0
- package/dist/focus/focus-team-state.js.map +1 -1
- package/dist/focus/focus-worktree-state.d.ts.map +1 -1
- package/dist/focus/focus-worktree-state.js +5 -2
- package/dist/focus/focus-worktree-state.js.map +1 -1
- package/dist/focus/listener-spawn.d.ts +39 -0
- package/dist/focus/listener-spawn.d.ts.map +1 -1
- package/dist/focus/listener-spawn.js +140 -24
- package/dist/focus/listener-spawn.js.map +1 -1
- package/dist/focus/listener.d.ts.map +1 -1
- package/dist/focus/listener.js +53 -25
- package/dist/focus/listener.js.map +1 -1
- package/dist/focus/session-health.d.ts +25 -3
- package/dist/focus/session-health.d.ts.map +1 -1
- package/dist/focus/session-health.js +32 -1
- package/dist/focus/session-health.js.map +1 -1
- package/dist/focus/team-actionable-work.d.ts +41 -2
- package/dist/focus/team-actionable-work.d.ts.map +1 -1
- package/dist/focus/team-actionable-work.js +52 -7
- package/dist/focus/team-actionable-work.js.map +1 -1
- package/dist/merge/focus-merge.d.ts +12 -1
- package/dist/merge/focus-merge.d.ts.map +1 -1
- package/dist/merge/focus-merge.js +33 -2
- package/dist/merge/focus-merge.js.map +1 -1
- package/dist/nexus/return.d.ts +105 -1
- package/dist/nexus/return.d.ts.map +1 -1
- package/dist/nexus/return.js +237 -47
- package/dist/nexus/return.js.map +1 -1
- package/dist/queries/schemas.d.ts +12 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +7 -0
- package/dist/queries/schemas.js.map +1 -1
- package/dist/queries/sessions.d.ts.map +1 -1
- package/dist/queries/sessions.js +1 -0
- package/dist/queries/sessions.js.map +1 -1
- package/dist/shell/heartbeat-metadata.d.ts +102 -0
- package/dist/shell/heartbeat-metadata.d.ts.map +1 -0
- package/dist/shell/heartbeat-metadata.js +172 -0
- package/dist/shell/heartbeat-metadata.js.map +1 -0
- package/dist/shell/heartbeat.d.ts +7 -22
- package/dist/shell/heartbeat.d.ts.map +1 -1
- package/dist/shell/heartbeat.js +120 -89
- package/dist/shell/heartbeat.js.map +1 -1
- package/dist/shell/unified-shell.d.ts.map +1 -1
- package/dist/shell/unified-shell.js +21 -12
- package/dist/shell/unified-shell.js.map +1 -1
- package/dist/spawn/helpers.d.ts.map +1 -1
- package/dist/spawn/helpers.js +7 -1
- package/dist/spawn/helpers.js.map +1 -1
- package/dist/spawn/process-spawn.d.ts +32 -1
- package/dist/spawn/process-spawn.d.ts.map +1 -1
- package/dist/spawn/process-spawn.js +43 -5
- package/dist/spawn/process-spawn.js.map +1 -1
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/session.d.ts +11 -0
- package/dist/types/session.d.ts.map +1 -1
- package/dist/update/auto-update-idle.d.ts +22 -0
- package/dist/update/auto-update-idle.d.ts.map +1 -1
- package/dist/update/auto-update-idle.js +8 -1
- package/dist/update/auto-update-idle.js.map +1 -1
- package/dist/update/auto-update.d.ts +0 -6
- package/dist/update/auto-update.d.ts.map +1 -1
- package/dist/update/auto-update.js +20 -6
- package/dist/update/auto-update.js.map +1 -1
- package/dist/update/version-check.d.ts +73 -0
- package/dist/update/version-check.d.ts.map +1 -1
- package/dist/update/version-check.js +107 -11
- package/dist/update/version-check.js.map +1 -1
- package/dist/verify/stall-detector-config.d.ts +26 -0
- package/dist/verify/stall-detector-config.d.ts.map +1 -1
- package/dist/verify/stall-detector-config.js +32 -0
- package/dist/verify/stall-detector-config.js.map +1 -1
- package/dist/verify/stall-detectors.d.ts +40 -0
- package/dist/verify/stall-detectors.d.ts.map +1 -1
- package/dist/verify/stall-detectors.js +60 -6
- package/dist/verify/stall-detectors.js.map +1 -1
- package/dist/verify/stalled-team-backstop.d.ts +43 -0
- package/dist/verify/stalled-team-backstop.d.ts.map +1 -0
- package/dist/verify/stalled-team-backstop.js +131 -0
- package/dist/verify/stalled-team-backstop.js.map +1 -0
- package/dist/worktree/verify-interlock.d.ts.map +1 -1
- package/dist/worktree/verify-interlock.js +3 -1
- package/dist/worktree/verify-interlock.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../src/queries/sessions.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0FAA0F;AAC1F,gBAAgB;AAOhB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAEL,4BAA4B,EAC5B,+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AC,OAAO,CAAC,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAc;IAC5C,+EAA+E;IAC/E,8EAA8E;IAC9E,0EAA0E;IAC1E,MAAM,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { DaemonConfig } from '../types/index.js';
|
|
2
|
+
import { computeBranchStatus, type BranchStatusPayload } from './branch-status.js';
|
|
3
|
+
import { type ProductBranchConfig } from '../queries/products.js';
|
|
4
|
+
import { type VersionDistance } from '../update/version-check.js';
|
|
5
|
+
/** Injectable seam for buildBranchStatusByProduct (unit tests inject fakes). */
|
|
6
|
+
export interface BranchStatusProducerDeps {
|
|
7
|
+
computeBranchStatus: typeof computeBranchStatus;
|
|
8
|
+
getBranchConfig: (productId: string) => Promise<ProductBranchConfig>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Publish branch status per product ({ [productId]: BranchStatusPayload }),
|
|
12
|
+
* mirroring the verificationPostures shape. Each product's payload is
|
|
13
|
+
* computed against ITS OWN repository (configForProduct) with ITS OWN
|
|
14
|
+
* mainBranch/branchMonitors resolved from its own product record — the root
|
|
15
|
+
* config always mirrors products[0] and must never be used to describe the
|
|
16
|
+
* others. One product failing is non-fatal to the rest (its entry is omitted).
|
|
17
|
+
*
|
|
18
|
+
* Exported (with injectable deps) so tests can pin the per-product claims
|
|
19
|
+
* without module mocks; doHeartbeat calls it with the real dependencies.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildBranchStatusByProduct(config: DaemonConfig, deps?: BranchStatusProducerDeps): Promise<Record<string, BranchStatusPayload>>;
|
|
22
|
+
/** The versionLag heartbeat field shape (running-vs-latest lag). */
|
|
23
|
+
export interface VersionLagField {
|
|
24
|
+
running: string;
|
|
25
|
+
latest: string;
|
|
26
|
+
/** The registry the `latest` reading was consulted from, or null when unknown
|
|
27
|
+
* (no reading yet / legacy). Names WHICH registry the reading came from. */
|
|
28
|
+
registry: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* True only when the reading is ATTRIBUTABLE to the registry npm resolves for
|
|
31
|
+
* an install -- only then are behind/distance a trustworthy measurement. When
|
|
32
|
+
* false the field is UNMEASURED: the platform must NOT read behind:false as
|
|
33
|
+
* "in sync" (it may be agreement against the wrong registry -- the mars
|
|
34
|
+
* false-negative). Silence (no field) means no reading yet; measured:false
|
|
35
|
+
* means a reading exists but cannot be attributed to the install registry.
|
|
36
|
+
*/
|
|
37
|
+
measured: boolean;
|
|
38
|
+
/** True when `latest` is strictly newer than `running`. */
|
|
39
|
+
behind: boolean;
|
|
40
|
+
distance: VersionDistance;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Build the versionLag metadata field: the running daemon vs the install
|
|
44
|
+
* registry's latest. Returns null when it cannot be computed (latest unknown, or
|
|
45
|
+
* the running version unstamped) so the key is simply absent; `behind:false` when
|
|
46
|
+
* the daemon is current. Carries the registry the reading came from and whether
|
|
47
|
+
* it is attributable to `installRegistry` (the registry npm resolves for an
|
|
48
|
+
* install) -- an unattributable reading is measured:false (UNMEASURED), never a
|
|
49
|
+
* silent false "in sync". The fields make a fix that has SHIPPED but is not
|
|
50
|
+
* RUNNING distinguishable from one that is running -- the mars 0.22.4-vs-0.22.13
|
|
51
|
+
* incident, visible from the platform without host access. Pure + testable.
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildVersionLagField(running: string, latest: string | null, readingRegistry: string | null, installRegistry: string): VersionLagField | null;
|
|
54
|
+
/** Version-observability state performHeartbeat samples from the daemon module. */
|
|
55
|
+
export interface HeartbeatVersionState {
|
|
56
|
+
daemonVersion: string;
|
|
57
|
+
daemonCommitSha: string;
|
|
58
|
+
latestAvailableVersion: string | null;
|
|
59
|
+
latestAvailableRegistry: string | null;
|
|
60
|
+
installRegistry: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Assemble the heartbeat metadata object (version observability, verification
|
|
64
|
+
* postures, available backends, branch status, focus-scoped fields, health
|
|
65
|
+
* events, read-only mode). Split out of heartbeat.ts (at its file-size floor);
|
|
66
|
+
* the daemon's volatile version state and the two heartbeat-internal helpers
|
|
67
|
+
* (focus-scoped fields, read-only field) are passed in so this stays a pure
|
|
68
|
+
* composer with no back-import into the hot-path module. No behavior change.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildHeartbeatMetadata(args: {
|
|
71
|
+
cfg: DaemonConfig;
|
|
72
|
+
version: HeartbeatVersionState;
|
|
73
|
+
probeBackends: (cfg: DaemonConfig) => Promise<unknown>;
|
|
74
|
+
buildBranchStatus: (cfg: DaemonConfig) => Promise<Record<string, BranchStatusPayload>>;
|
|
75
|
+
applyFocusScopedMetadata: (metadata: Record<string, unknown>) => void;
|
|
76
|
+
readOnlyMetadataField: () => Record<string, unknown> | null;
|
|
77
|
+
}): Promise<Record<string, unknown>>;
|
|
78
|
+
/** One mechanism's heartbeat falsifiability reading. */
|
|
79
|
+
export interface SupervisionFiringRate {
|
|
80
|
+
total: number;
|
|
81
|
+
falsePositives: number;
|
|
82
|
+
falsePositiveRate: number | null;
|
|
83
|
+
/** True when the mechanism is DEMOTED to observe-only (zero true positives over
|
|
84
|
+
* a meaningful sample): it still records firings but its action sites no longer
|
|
85
|
+
* kill/hold/respawn (enforced via isMechanismDemoted). The visible half of the
|
|
86
|
+
* block-to-observe policy -- the demotion IS the reading (AC/FRT #10). */
|
|
87
|
+
demotionRecommended: boolean;
|
|
88
|
+
/** Firings recorded while demoted (acted===false): observe-only counterfactuals
|
|
89
|
+
* that the settle sweep never true-positives. Surfaced so a rate cannot be
|
|
90
|
+
* mistaken for one earned in action. */
|
|
91
|
+
unacted: number;
|
|
92
|
+
/** True positives reached by an OBSERVED falsifying/confirming event -- accuracy
|
|
93
|
+
* the mechanism EARNED in action. */
|
|
94
|
+
activeTruePositives: number;
|
|
95
|
+
/** True positives inferred from the settle window elapsing on an ACTED firing --
|
|
96
|
+
* the benefit of the doubt silence gives, distinct from an earned verdict so a
|
|
97
|
+
* mechanism that has merely been quiet cannot read as one that has been right. */
|
|
98
|
+
sweptTruePositives: number;
|
|
99
|
+
}
|
|
100
|
+
/** Per-mechanism falsifiability reading (rate + demotion recommendation) from the store. */
|
|
101
|
+
export declare function buildSupervisionFiringRates(): Record<string, SupervisionFiringRate>;
|
|
102
|
+
//# sourceMappingURL=heartbeat-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat-metadata.d.ts","sourceRoot":"","sources":["../../src/shell/heartbeat-metadata.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAA4B,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAA0D,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAoB1H,gFAAgF;AAChF,MAAM,WAAW,wBAAwB;IACvC,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,wBAGL,GACA,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAc9C;AAED,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf;iFAC6E;IAC7E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACx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MAAM,GAAG,IAAI,CAAC;IACjC;;;+EAG2E;IAC3E,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;6CAEyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB;0CACsC;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;uFAEmF;IACnF,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,4FAA4F;AAC5F,wBAAgB,2BAA2B,IAAI,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAenF"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
+
// Pinned by: packages/daemon/src/shell/heartbeat-per-product-branch-status.test.ts,
|
|
3
|
+
// packages/daemon/src/shell/heartbeat-version-lag.test.ts,
|
|
4
|
+
// packages/daemon/src/shell/supervision-firing-rates.test.ts
|
|
5
|
+
// PINNED-BY-END
|
|
6
|
+
/**
|
|
7
|
+
* Heartbeat metadata builders.
|
|
8
|
+
*
|
|
9
|
+
* Pure/near-pure producers of individual heartbeat metadata fields, split out of
|
|
10
|
+
* heartbeat.ts (which sits at its file-size floor) so a new field can be added
|
|
11
|
+
* without growing the hot-path module. Each builder is independently testable;
|
|
12
|
+
* doHeartbeat composes them into the metadata object.
|
|
13
|
+
*/
|
|
14
|
+
import { healthEvents } from '@telora/daemon-core';
|
|
15
|
+
import { configForProduct } from './config.js';
|
|
16
|
+
import { computeBranchStatus } from './branch-status.js';
|
|
17
|
+
import { getProductBranchConfig } from '../queries/products.js';
|
|
18
|
+
import { isNewerVersion, versionDistance, isReadingAttributable } from '../update/version-check.js';
|
|
19
|
+
import { buildProductPostureMap } from '../verify/verification-config.js';
|
|
20
|
+
import { firingMechanisms, firingStats, isDemotionRecommended } from '../completion/supervision-firing-record.js';
|
|
21
|
+
// ── Product branch config cache (per product) ────────────────────────
|
|
22
|
+
const branchConfigCache = new Map();
|
|
23
|
+
const BRANCH_CONFIG_REFRESH_MS = 300_000; // 5 minutes
|
|
24
|
+
/** Fetch (with 5-minute cache) the branch config for one product. */
|
|
25
|
+
async function getCachedBranchConfig(productId) {
|
|
26
|
+
const now = Date.now();
|
|
27
|
+
const cached = branchConfigCache.get(productId);
|
|
28
|
+
if (cached && now - cached.fetchedAt <= BRANCH_CONFIG_REFRESH_MS) {
|
|
29
|
+
return cached.config;
|
|
30
|
+
}
|
|
31
|
+
const fresh = await getProductBranchConfig(productId);
|
|
32
|
+
branchConfigCache.set(productId, { config: fresh, fetchedAt: now });
|
|
33
|
+
return fresh;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Publish branch status per product ({ [productId]: BranchStatusPayload }),
|
|
37
|
+
* mirroring the verificationPostures shape. Each product's payload is
|
|
38
|
+
* computed against ITS OWN repository (configForProduct) with ITS OWN
|
|
39
|
+
* mainBranch/branchMonitors resolved from its own product record — the root
|
|
40
|
+
* config always mirrors products[0] and must never be used to describe the
|
|
41
|
+
* others. One product failing is non-fatal to the rest (its entry is omitted).
|
|
42
|
+
*
|
|
43
|
+
* Exported (with injectable deps) so tests can pin the per-product claims
|
|
44
|
+
* without module mocks; doHeartbeat calls it with the real dependencies.
|
|
45
|
+
*/
|
|
46
|
+
export async function buildBranchStatusByProduct(config, deps = {
|
|
47
|
+
computeBranchStatus,
|
|
48
|
+
getBranchConfig: getCachedBranchConfig,
|
|
49
|
+
}) {
|
|
50
|
+
const branchStatusByProduct = {};
|
|
51
|
+
for (const product of config.products) {
|
|
52
|
+
try {
|
|
53
|
+
const productConfig = configForProduct(config, product);
|
|
54
|
+
const branchConfig = await deps.getBranchConfig(product.id);
|
|
55
|
+
const branchOpts = {
|
|
56
|
+
mainBranch: branchConfig.mainBranch,
|
|
57
|
+
branchMonitors: branchConfig.branchMonitors,
|
|
58
|
+
};
|
|
59
|
+
branchStatusByProduct[product.id] = deps.computeBranchStatus(productConfig, branchOpts);
|
|
60
|
+
}
|
|
61
|
+
catch { /* non-fatal — omit this product's entry */ }
|
|
62
|
+
}
|
|
63
|
+
return branchStatusByProduct;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Build the versionLag metadata field: the running daemon vs the install
|
|
67
|
+
* registry's latest. Returns null when it cannot be computed (latest unknown, or
|
|
68
|
+
* the running version unstamped) so the key is simply absent; `behind:false` when
|
|
69
|
+
* the daemon is current. Carries the registry the reading came from and whether
|
|
70
|
+
* it is attributable to `installRegistry` (the registry npm resolves for an
|
|
71
|
+
* install) -- an unattributable reading is measured:false (UNMEASURED), never a
|
|
72
|
+
* silent false "in sync". The fields make a fix that has SHIPPED but is not
|
|
73
|
+
* RUNNING distinguishable from one that is running -- the mars 0.22.4-vs-0.22.13
|
|
74
|
+
* incident, visible from the platform without host access. Pure + testable.
|
|
75
|
+
*/
|
|
76
|
+
export function buildVersionLagField(running, latest, readingRegistry, installRegistry) {
|
|
77
|
+
if (!latest || running === 'unknown')
|
|
78
|
+
return null;
|
|
79
|
+
return {
|
|
80
|
+
running,
|
|
81
|
+
latest,
|
|
82
|
+
registry: readingRegistry,
|
|
83
|
+
measured: isReadingAttributable(readingRegistry, installRegistry),
|
|
84
|
+
behind: isNewerVersion(latest, running),
|
|
85
|
+
distance: versionDistance(running, latest),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Assemble the heartbeat metadata object (version observability, verification
|
|
90
|
+
* postures, available backends, branch status, focus-scoped fields, health
|
|
91
|
+
* events, read-only mode). Split out of heartbeat.ts (at its file-size floor);
|
|
92
|
+
* the daemon's volatile version state and the two heartbeat-internal helpers
|
|
93
|
+
* (focus-scoped fields, read-only field) are passed in so this stays a pure
|
|
94
|
+
* composer with no back-import into the hot-path module. No behavior change.
|
|
95
|
+
*/
|
|
96
|
+
export async function buildHeartbeatMetadata(args) {
|
|
97
|
+
const { cfg, version, probeBackends, buildBranchStatus, applyFocusScopedMetadata, readOnlyMetadataField } = args;
|
|
98
|
+
const metadata = {};
|
|
99
|
+
if (version.daemonCommitSha !== 'unknown') {
|
|
100
|
+
metadata.commitSha = version.daemonCommitSha;
|
|
101
|
+
}
|
|
102
|
+
if (version.latestAvailableVersion) {
|
|
103
|
+
metadata.latestAvailableVersion = version.latestAvailableVersion;
|
|
104
|
+
}
|
|
105
|
+
// Version lag: the running daemon vs the install registry's latest, carried so
|
|
106
|
+
// a lagging host (a fix shipped but NOT running -- the mars 0.22.4-vs-0.22.13
|
|
107
|
+
// incident) is visible from the platform without host access. It names the
|
|
108
|
+
// registry the reading came from and marks measured:false (UNMEASURED) when the
|
|
109
|
+
// reading cannot be attributed to the install registry, so the platform never
|
|
110
|
+
// reads a false "in sync" against the wrong registry.
|
|
111
|
+
const versionLag = buildVersionLagField(version.daemonVersion, version.latestAvailableVersion, version.latestAvailableRegistry, version.installRegistry);
|
|
112
|
+
if (versionLag) {
|
|
113
|
+
metadata.versionLag = versionLag;
|
|
114
|
+
}
|
|
115
|
+
metadata.maxTotalSessions = cfg.maxTotalSessions;
|
|
116
|
+
// Publish per-product verification posture ({ [productId]: { posture, command } })
|
|
117
|
+
// so the web app's product settings can surface how each product's deliveries
|
|
118
|
+
// are gated -- posture is local daemon.json config the app cannot otherwise see.
|
|
119
|
+
// Declarative state, derived at read time; never an escalation.
|
|
120
|
+
metadata.verificationPostures = buildProductPostureMap(cfg.products, cfg.defaultVerification);
|
|
121
|
+
// Publish which engines are installed + authenticated on this host so the
|
|
122
|
+
// app's engine picker can grey out unavailable ones (probe is cached).
|
|
123
|
+
try {
|
|
124
|
+
metadata.availableBackends = await probeBackends(cfg);
|
|
125
|
+
}
|
|
126
|
+
catch { /* non-fatal -- omit availability rather than fail the heartbeat */ }
|
|
127
|
+
const branchStatusByProduct = await buildBranchStatus(cfg);
|
|
128
|
+
if (Object.keys(branchStatusByProduct).length > 0) {
|
|
129
|
+
metadata.branchStatus = branchStatusByProduct;
|
|
130
|
+
}
|
|
131
|
+
applyFocusScopedMetadata(metadata);
|
|
132
|
+
// Include health events in metadata for dashboard visibility
|
|
133
|
+
const events = healthEvents.getEvents();
|
|
134
|
+
if (events.length > 0) {
|
|
135
|
+
metadata.healthEvents = events;
|
|
136
|
+
}
|
|
137
|
+
// Surface read-only mode (schema-version gate, warn path) so the dashboard can
|
|
138
|
+
// mark stuck foci/deliveries and show the recovery path. The heartbeat is
|
|
139
|
+
// allowlisted in read-only mode, so this write always lands. Only emit when
|
|
140
|
+
// active -- in normal operation the key is absent.
|
|
141
|
+
const readOnlyField = readOnlyMetadataField();
|
|
142
|
+
if (readOnlyField) {
|
|
143
|
+
Object.assign(metadata, readOnlyField);
|
|
144
|
+
}
|
|
145
|
+
// Supervision falsifiability: the per-mechanism false-positive rate from the
|
|
146
|
+
// firing-record store, so a chronically-wrong kill/hold/respawn mechanism is a
|
|
147
|
+
// READING on the heartbeat -- not something a human hand-greps from the log
|
|
148
|
+
// after the cost is paid. Omitted (key absent) until a mechanism has fired.
|
|
149
|
+
const firingRates = buildSupervisionFiringRates();
|
|
150
|
+
if (Object.keys(firingRates).length > 0) {
|
|
151
|
+
metadata.supervisionFiringRates = firingRates;
|
|
152
|
+
}
|
|
153
|
+
return metadata;
|
|
154
|
+
}
|
|
155
|
+
/** Per-mechanism falsifiability reading (rate + demotion recommendation) from the store. */
|
|
156
|
+
export function buildSupervisionFiringRates() {
|
|
157
|
+
const rates = {};
|
|
158
|
+
for (const mechanism of firingMechanisms()) {
|
|
159
|
+
const s = firingStats(mechanism);
|
|
160
|
+
rates[mechanism] = {
|
|
161
|
+
total: s.total,
|
|
162
|
+
falsePositives: s.falsePositives,
|
|
163
|
+
falsePositiveRate: s.falsePositiveRate,
|
|
164
|
+
demotionRecommended: isDemotionRecommended(mechanism),
|
|
165
|
+
unacted: s.unacted,
|
|
166
|
+
activeTruePositives: s.activeTruePositives,
|
|
167
|
+
sweptTruePositives: s.sweptTruePositives,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return rates;
|
|
171
|
+
}
|
|
172
|
+
//# sourceMapping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AAC,SAAS,CAAC;YACrD,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,mBAAmB,EAAE,CAAC,CAAC,mBAAmB;YAC1C,kBAAkB,EAAE,CAAC,CAAC,kBAAkB;SACzC,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -3,8 +3,7 @@ import { sendHeartbeat, sendDisconnect } from '../queries/daemon-connection.js';
|
|
|
3
3
|
import { type RetentionBeatObservation, type RetirementPreconditionVerdict } from '../drift/retention-observation.js';
|
|
4
4
|
import { recordSessionCompleted, recordActivity, getLastActivityAt } from './agent-state.js';
|
|
5
5
|
import type { ReadOnlyModeState } from '@telora/daemon-core';
|
|
6
|
-
import {
|
|
7
|
-
import { type ProductBranchConfig } from '../queries/products.js';
|
|
6
|
+
import { type BranchStatusPayload } from './branch-status.js';
|
|
8
7
|
/**
|
|
9
8
|
* Compute a stable, display-meaningful repo identity from a product set: the
|
|
10
9
|
* sorted, deduplicated basenames of each product's repo path, joined by ', '.
|
|
@@ -55,10 +54,13 @@ export declare function getVersions(): {
|
|
|
55
54
|
daemon: string;
|
|
56
55
|
};
|
|
57
56
|
/**
|
|
58
|
-
* Store the latest available version from the npm registry
|
|
59
|
-
*
|
|
57
|
+
* Store the latest available version from the npm registry, plus the registry it
|
|
58
|
+
* was read from. The registry lets the heartbeat ATTRIBUTE the reading to the
|
|
59
|
+
* install registry so a lagging host cannot publish a false "in sync" against the
|
|
60
|
+
* wrong registry (the mars false-negative). Called by the version check module
|
|
61
|
+
* after a successful registry query.
|
|
60
62
|
*/
|
|
61
|
-
export declare function setLatestAvailableVersion(version: string): void;
|
|
63
|
+
export declare function setLatestAvailableVersion(version: string, registry?: string): void;
|
|
62
64
|
export { recordSessionCompleted };
|
|
63
65
|
/**
|
|
64
66
|
* Record a completed issue (called when an issue transitions to Done).
|
|
@@ -77,23 +79,6 @@ export declare function recordIssueCompleted(): void;
|
|
|
77
79
|
export declare function readOnlyMetadataField(): {
|
|
78
80
|
readOnlyMode: ReadOnlyModeState;
|
|
79
81
|
} | null;
|
|
80
|
-
/** Injectable seam for buildBranchStatusByProduct (unit tests inject fakes). */
|
|
81
|
-
export interface BranchStatusProducerDeps {
|
|
82
|
-
computeBranchStatus: typeof computeBranchStatus;
|
|
83
|
-
getBranchConfig: (productId: string) => Promise<ProductBranchConfig>;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Publish branch status per product ({ [productId]: BranchStatusPayload }),
|
|
87
|
-
* mirroring the verificationPostures shape. Each product's payload is
|
|
88
|
-
* computed against ITS OWN repository (configForProduct) with ITS OWN
|
|
89
|
-
* mainBranch/branchMonitors resolved from its own product record — the root
|
|
90
|
-
* config always mirrors products[0] and must never be used to describe the
|
|
91
|
-
* others. One product failing is non-fatal to the rest (its entry is omitted).
|
|
92
|
-
*
|
|
93
|
-
* Exported (with injectable deps) so tests can pin the per-product claims
|
|
94
|
-
* without module mocks; doHeartbeat calls it with the real dependencies.
|
|
95
|
-
*/
|
|
96
|
-
export declare function buildBranchStatusByProduct(config: DaemonConfig, deps?: BranchStatusProducerDeps): Promise<Record<string, BranchStatusPayload>>;
|
|
97
82
|
/**
|
|
98
83
|
* Pure presence-gap detector for the heartbeat.
|
|
99
84
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../../src/shell/heartbeat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../../src/shell/heartbeat.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAIL,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EACnC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAA0C,sBAAsB,EAAE,cAAc,EAAE,iBAAi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