@telora/daemon 0.20.28 → 0.20.32
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 +2 -2
- package/dist/auto-update.d.ts +87 -0
- package/dist/auto-update.d.ts.map +1 -1
- package/dist/auto-update.js +142 -8
- package/dist/auto-update.js.map +1 -1
- package/dist/focus-loop-registry.d.ts.map +1 -1
- package/dist/focus-loop-registry.js +27 -0
- package/dist/focus-loop-registry.js.map +1 -1
- package/dist/focus-prompt-builder.d.ts.map +1 -1
- package/dist/focus-prompt-builder.js +5 -1
- package/dist/focus-prompt-builder.js.map +1 -1
- package/dist/prompt-listing.d.ts +25 -0
- package/dist/prompt-listing.d.ts.map +1 -1
- package/dist/prompt-listing.js +61 -0
- package/dist/prompt-listing.js.map +1 -1
- package/dist/security-scan-engine.d.ts +9 -1
- package/dist/security-scan-engine.d.ts.map +1 -1
- package/dist/security-scan-engine.js +25 -2
- package/dist/security-scan-engine.js.map +1 -1
- package/dist/staleness-sensor.d.ts +153 -0
- package/dist/staleness-sensor.d.ts.map +1 -0
- package/dist/staleness-sensor.js +308 -0
- package/dist/staleness-sensor.js.map +1 -0
- package/dist/unified-shell.d.ts.map +1 -1
- package/dist/unified-shell.js +11 -0
- package/dist/unified-shell.js.map +1 -1
- package/dist/verification-engine.d.ts +6 -4
- package/dist/verification-engine.d.ts.map +1 -1
- package/dist/verification-engine.js +9 -43
- package/dist/verification-engine.js.map +1 -1
- package/dist/verification-feedback.d.ts +42 -0
- package/dist/verification-feedback.d.ts.map +1 -1
- package/dist/verification-feedback.js +93 -0
- package/dist/verification-feedback.js.map +1 -1
- package/dist/version-check.d.ts +6 -0
- package/dist/version-check.d.ts.map +1 -1
- package/dist/version-check.js +1 -1
- package/dist/version-check.js.map +1 -1
- package/package.json +2 -2
|
@@ -87,7 +87,15 @@ export interface SecurityScanDeps {
|
|
|
87
87
|
/** Stamp last_run_at on the config after a scan completes. */
|
|
88
88
|
updateConfigLastRun: (configId: string) => Promise<void>;
|
|
89
89
|
clearManualRunRequest: (configId: string) => Promise<void>;
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Resolve the repo to scan for a product, or null when this daemon does not
|
|
92
|
+
* manage that product. NULL IS LOAD-BEARING: the caller must skip the scan
|
|
93
|
+
* entirely rather than substitute a fallback path. Returning some other
|
|
94
|
+
* repo's path makes `npm audit` (and every path-based scanner) report THAT
|
|
95
|
+
* repo's findings against this product -- see the fail-closed gate in
|
|
96
|
+
* runScanForConfig.
|
|
97
|
+
*/
|
|
98
|
+
resolveCwd: (productId: string) => string | null;
|
|
91
99
|
/**
|
|
92
100
|
* Flush the OSV + GHSA feed caches. Invoked at the start of every
|
|
93
101
|
* manual-triggered scan so a user-clicked "Refresh feeds" pulls fresh
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scan-engine.d.ts","sourceRoot":"","sources":["../src/security-scan-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAC;AAYzC,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9E,sEAAsE;AACtE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,MAAM,GAAG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E,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,qBAAqB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACjD;;;;OAIG;IACH,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,cAAc,CAAC;IACrB,sEAAsE;IACtE,WAAW,IAAI,MAAM,GAAG,IAAI,CAAC;CAC9B;AAwBD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,cAAc,GAAG,SAAS,GAChC,iBAAiB,GAAG,SAAS,CAyB/B;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,UAAU,GAAG,QAAQ,EAC9B,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,IAAI,CAAC,CAwIf;AAaD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,gBAAgB,EACtB,IAAI,GAAE,qBAA0B,GAC/B,OAAO,CAAC,IAAI,CAAC,CAiBf;AAMD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAiDnF"}
|
|
@@ -81,6 +81,18 @@ export async function runScanForConfig(config, trigger, deps) {
|
|
|
81
81
|
if (trigger === 'manual') {
|
|
82
82
|
deps.clearFeedCaches();
|
|
83
83
|
}
|
|
84
|
+
// Fail-closed product gate. Scan configs exist per product ORG-WIDE, but this
|
|
85
|
+
// daemon only manages the products it was started with. Scanning a product we
|
|
86
|
+
// have no checkout for can only produce findings about some OTHER repo, so we
|
|
87
|
+
// scan nothing rather than scan the wrong tree. Skipping without stamping
|
|
88
|
+
// last_run_at is deliberate: the config stays due, so the daemon that DOES
|
|
89
|
+
// manage this product still picks it up on its own tick.
|
|
90
|
+
const repoPath = deps.resolveCwd(config.productId);
|
|
91
|
+
if (repoPath === null) {
|
|
92
|
+
log.debug(`Skipping security scan for product ${config.productId}: not managed by this daemon ` +
|
|
93
|
+
`(no repo checkout here). Leaving the config due for a daemon that manages it.`);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
84
96
|
// Per-scan-run focus memoization. The server handler always creates a new
|
|
85
97
|
// focus, so without this wrapper each finding in a scan would land in its
|
|
86
98
|
// own focus. The first finding in this run triggers focus creation; every
|
|
@@ -97,7 +109,7 @@ export async function runScanForConfig(config, trigger, deps) {
|
|
|
97
109
|
try {
|
|
98
110
|
const result = await scanner.scan({
|
|
99
111
|
config,
|
|
100
|
-
repoPath
|
|
112
|
+
repoPath,
|
|
101
113
|
});
|
|
102
114
|
const observed = new Set();
|
|
103
115
|
for (const finding of result.findings) {
|
|
@@ -212,8 +224,19 @@ export async function runSecurityScanTick(deps, opts = {}) {
|
|
|
212
224
|
export function buildDefaultSecurityScanDeps(config) {
|
|
213
225
|
const resolveCwd = (productId) => {
|
|
214
226
|
const product = config.products.find((p) => p.id === productId);
|
|
227
|
+
// Fail CLOSED. This previously returned config.repoPath -- the daemon's own
|
|
228
|
+
// primary repo -- for any product this daemon does not manage. A scan config
|
|
229
|
+
// exists per product org-wide, but config.products holds only the products
|
|
230
|
+
// THIS daemon was started with, so every unmanaged product was scanned
|
|
231
|
+
// against the daemon's own tree: `npm audit` passed its Node-project gate
|
|
232
|
+
// legitimately (the daemon's repo IS a Node project) and reported the
|
|
233
|
+
// DAEMON's dependency advisories as findings on an unrelated product.
|
|
234
|
+
// Observed 2026-07-24: @modelcontextprotocol/sdk, @hono/node-server,
|
|
235
|
+
// fast-uri and dompurify -- all Telora's own deps -- filed against a Quarto
|
|
236
|
+
// book, a Rust/Godot workspace, and a Python+Vite app, each spawning a
|
|
237
|
+
// Security Remediation focus whose team found nothing and escalated.
|
|
215
238
|
if (!product)
|
|
216
|
-
return
|
|
239
|
+
return null;
|
|
217
240
|
return configForProduct(config, product).repoPath;
|
|
218
241
|
};
|
|
219
242
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scan-engine.js","sourceRoot":"","sources":["../src/security-scan-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,GAGlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAG3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;AAkD7D,8EAA8E;AAC9E,uEAAuE;AACvE,8EAA8E;AAE9E,MAAM,gBAAgB,GAAyB,IAAI,GAAG,EAAE,CAAC;AAEzD,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;AACxC,CAAC;
|
|
1
|
+
{"version":3,"file":"security-scan-engine.js","sourceRoot":"","sources":["../src/security-scan-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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,CAAC;QACpE,CAAC;QACD,qBAAqB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACxC,MAAM,OAAO,CAAC,kCAAkC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,UAAU;QACV,eAAe,EAAE,GAAG,EAAE;YACpB,aAAa,EAAE,CAAC;YAChB,cAAc,EAAE,CAAC;QACnB,CAAC;QACD,QAAQ,EAAE,qBAAqB,EAAE;QACjC,cAAc,EAAE,0BAA0B,EAAE;QAC5C,cAAc,EAAE,0BAA0B,EAAE;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Propagation-staleness sensor (focus: "Propagation Staleness Is Invisible").
|
|
3
|
+
*
|
|
4
|
+
* The differential instrument this focus is named for: it computes
|
|
5
|
+
* newest-available MINUS actually-running for a tracked target. Its first (and
|
|
6
|
+
* directly observable) target is the running daemon vs the Gitea npm registry:
|
|
7
|
+
*
|
|
8
|
+
* running = ~/.telora/daemon.meta.json .version (this daemon's own build)
|
|
9
|
+
* newest = the warm version cache .latestVersion (Gitea registry dist-tags.latest,
|
|
10
|
+
* kept fresh by startVersionCacheRefreshLoop)
|
|
11
|
+
*
|
|
12
|
+
* CLOSING the gap, not reporting it. The daemon-version gap is machine-closable:
|
|
13
|
+
* the safe-seam auto-update controller (auto-update.ts) already installs a newer
|
|
14
|
+
* registry version at the next batch-safe idle seam. So when the gap is beyond
|
|
15
|
+
* threshold this sensor DEFERS to that closer -- it does NOT tell a human "the
|
|
16
|
+
* daemon is stale, restart it". Telling a human about a gap the machine is
|
|
17
|
+
* already closing converts machine signal into human chore, and firing on a
|
|
18
|
+
* healthy daemon that is merely deferring to its next safe seam is exactly the
|
|
19
|
+
* failure mode this focus exists to remove.
|
|
20
|
+
*
|
|
21
|
+
* A human is involved ONLY where the machine genuinely cannot act: auto-update
|
|
22
|
+
* is disabled for this daemon (installMode=npx, or --no-auto-update /
|
|
23
|
+
* TELORA_AUTO_UPDATE=0, reflected as autoUpdateEnabled=false in daemon.meta.json).
|
|
24
|
+
* The operator opted out of automation, so the machine cannot close the gap --
|
|
25
|
+
* and even then the deliverable is a READY ACTION handed over (the exact
|
|
26
|
+
* `npm install -g` command + restart), never an inbox item that merely says a
|
|
27
|
+
* gap exists. That handover auto-resolves once the running version catches up,
|
|
28
|
+
* and is retired immediately if auto-update is re-enabled (the machine reclaims
|
|
29
|
+
* closure).
|
|
30
|
+
*
|
|
31
|
+
* Every tick leaves a trace (delegated-to-auto-update / handed-over /
|
|
32
|
+
* back-in-sync / "measured, within threshold" / "UNMEASURED"), so an ABSENT
|
|
33
|
+
* trace positively means "measured and in sync" -- never "not measured". Wedged
|
|
34
|
+
* auto-update (enabled but not running) is made visible by the SEPARATE
|
|
35
|
+
* auto-update decision heartbeat (auto-update.ts): an absent [auto-update] trace
|
|
36
|
+
* identifies a controller that is not running. That is not re-derived here.
|
|
37
|
+
*
|
|
38
|
+
* Pure decision (computeDaemonVersionDifferential / decideStalenessAction) +
|
|
39
|
+
* injected IO, mirroring ci-sensor-loop.ts, so the loop is unit-testable without
|
|
40
|
+
* a live registry or DB. Registered in LOOP_REGISTRY under the opt-out guard
|
|
41
|
+
* TELORA_STALENESS_SENSOR_LOOP.
|
|
42
|
+
*
|
|
43
|
+
* The two infra-owned targets observed 2026-07-24 (npmjs mirror serving a stale
|
|
44
|
+
* version; Opus 5 seed merged-but-maybe-not-applied) are NOT computable from
|
|
45
|
+
* this repo (no prod DB access; infra alone publishes to npmjs). They are
|
|
46
|
+
* recorded, with their operator-facing close action, in
|
|
47
|
+
* docs/runbook-propagation-staleness-targets.md -- the sensor deliberately does
|
|
48
|
+
* NOT attempt those infra actions.
|
|
49
|
+
*
|
|
50
|
+
* @module staleness-sensor
|
|
51
|
+
*/
|
|
52
|
+
import type { DaemonConfig } from './types.js';
|
|
53
|
+
/**
|
|
54
|
+
* escalation_kind for a stale daemon that the machine CANNOT auto-close (auto-update
|
|
55
|
+
* disabled). Carries a ready action, not a bare "gap exists" notice.
|
|
56
|
+
*/
|
|
57
|
+
export declare const PROPAGATION_STALE_ESCALATION_KIND = "propagation_stale";
|
|
58
|
+
/** Stable target id for the daemon-vs-registry differential. */
|
|
59
|
+
export declare const DAEMON_VERSION_TARGET = "daemon-version";
|
|
60
|
+
/**
|
|
61
|
+
* Default patch-version distance that trips the signal. Any minor/major gap
|
|
62
|
+
* always trips regardless. A 1-2 patch gap is left quiet: auto-update closes it
|
|
63
|
+
* at the next idle seam, so signaling immediately would be noise. The observed
|
|
64
|
+
* failure (0.20.21 vs 0.20.28 = 7 patches) is well past this floor.
|
|
65
|
+
*/
|
|
66
|
+
export declare const DEFAULT_STALENESS_PATCH_THRESHOLD = 3;
|
|
67
|
+
/** Component-wise magnitude of how far `running` is behind `newest` (clamped at 0). */
|
|
68
|
+
export interface VersionDistance {
|
|
69
|
+
major: number;
|
|
70
|
+
minor: number;
|
|
71
|
+
patch: number;
|
|
72
|
+
}
|
|
73
|
+
/** The computed newest-vs-running differential for a tracked target. */
|
|
74
|
+
export interface StalenessDifferential {
|
|
75
|
+
target: string;
|
|
76
|
+
running: string;
|
|
77
|
+
newest: string;
|
|
78
|
+
/** True when `newest` is strictly newer than `running`. */
|
|
79
|
+
behind: boolean;
|
|
80
|
+
distance: VersionDistance;
|
|
81
|
+
/** True when the gap exceeds the declared threshold (any minor/major, or >= patchThreshold patches). */
|
|
82
|
+
beyondThreshold: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Compute the daemon-vs-registry differential. Returns null when it cannot be
|
|
86
|
+
* MEASURED (either version missing) -- the caller must then emit an explicit
|
|
87
|
+
* "UNMEASURED" trace rather than staying silent, so silence always means "in
|
|
88
|
+
* sync", never "not measured".
|
|
89
|
+
*/
|
|
90
|
+
export declare function computeDaemonVersionDifferential(running: string | null, newest: string | null, patchThreshold?: number): StalenessDifferential | null;
|
|
91
|
+
/**
|
|
92
|
+
* What the sensor should do with the current differential.
|
|
93
|
+
* - `delegate` -- gap is beyond threshold and the machine closes it itself
|
|
94
|
+
* (auto-update enabled): defer to that closer, no human.
|
|
95
|
+
* - `hand-over` -- gap is beyond threshold but the machine cannot act
|
|
96
|
+
* (auto-update disabled): hand a human a ready action.
|
|
97
|
+
* - `resolve` -- an open handover exists but the machine is now closing the
|
|
98
|
+
* gap (back within threshold, OR auto-update re-enabled).
|
|
99
|
+
* - `none` -- nothing to do.
|
|
100
|
+
*/
|
|
101
|
+
export type StalenessAction = 'delegate' | 'hand-over' | 'resolve' | 'none';
|
|
102
|
+
/**
|
|
103
|
+
* Pure decision. The pivot is `canMachineClose`: when the auto-update controller
|
|
104
|
+
* owns closing the daemon-version gap, the sensor NEVER hands a human a report --
|
|
105
|
+
* it defers (and retires any stale handover). A human is handed a ready action
|
|
106
|
+
* ONLY when the machine genuinely cannot act. A null differential (unmeasurable)
|
|
107
|
+
* never acts -- it is handled as a trace by the tick.
|
|
108
|
+
*/
|
|
109
|
+
export declare function decideStalenessAction(diff: StalenessDifferential | null, hasOpen: boolean, canMachineClose: boolean): StalenessAction;
|
|
110
|
+
/** Injected IO for the sensor tick. Defaults reach for the real implementations. */
|
|
111
|
+
export interface StalenessSensorDeps {
|
|
112
|
+
readRunningVersion: () => string | null;
|
|
113
|
+
readNewestAvailable: () => string | null;
|
|
114
|
+
patchThreshold: number;
|
|
115
|
+
/**
|
|
116
|
+
* True when the auto-update controller can close the daemon-version gap itself.
|
|
117
|
+
* When true the sensor defers to that closer and never hands a human a report;
|
|
118
|
+
* when false the operator opted out and the machine genuinely cannot act.
|
|
119
|
+
*/
|
|
120
|
+
canMachineCloseGap: () => boolean;
|
|
121
|
+
hasOpenStalenessEscalation: () => Promise<boolean>;
|
|
122
|
+
/** Hand a human a READY ACTION when (and only when) the machine cannot act. */
|
|
123
|
+
handOverReadyAction: (params: {
|
|
124
|
+
organizationId: string;
|
|
125
|
+
productId: string;
|
|
126
|
+
diff: StalenessDifferential;
|
|
127
|
+
readyCommand: string;
|
|
128
|
+
}) => Promise<void>;
|
|
129
|
+
resolveStalenessEscalations: () => Promise<number>;
|
|
130
|
+
}
|
|
131
|
+
export interface StalenessSensorTickCounts {
|
|
132
|
+
/** True when the differential could be computed (both versions known). */
|
|
133
|
+
measured: boolean;
|
|
134
|
+
/** True when the daemon is behind the registry at all (any distance). */
|
|
135
|
+
behind: boolean;
|
|
136
|
+
/** True when the machine (auto-update) owns closing the measured gap this tick. */
|
|
137
|
+
delegatedToAutoUpdate: boolean;
|
|
138
|
+
/** Ready-action handovers filed -- only when the machine genuinely cannot act. */
|
|
139
|
+
handoversToOperator: number;
|
|
140
|
+
escalationsResolved: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* One propagation-staleness sensor tick. Computes the global daemon-vs-registry
|
|
144
|
+
* differential once (the running daemon has a single version). When the gap is
|
|
145
|
+
* beyond threshold the sensor DEFERS to the auto-update controller if that closer
|
|
146
|
+
* is active, and hands a human a ready action ONLY when it is not. Any handover
|
|
147
|
+
* is anchored to the first configured product for inbox visibility (the fact is
|
|
148
|
+
* process-global; all products share one org).
|
|
149
|
+
*
|
|
150
|
+
* Every path emits a trace so an absent signal means "measured and in sync".
|
|
151
|
+
*/
|
|
152
|
+
export declare function runStalenessSensorTick(config: DaemonConfig, deps?: StalenessSensorDeps): Promise<StalenessSensorTickCounts>;
|
|
153
|
+
//# sourceMappingURL=staleness-sensor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staleness-sensor.d.ts","sourceRoot":"","sources":["../src/staleness-sensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAa/C;;;GAGG;AACH,eAAO,MAAM,iCAAiC,sBAAsB,CAAC;AAErE,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,mB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M,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,qBAAqB,CAAC;QAC5B,YAAY,EAAE,MAAM,CAAC;KACtB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,2BAA2B,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CACpD;AAYD,MAAM,WAAW,yBAAyB;IACxC,0EAA0E;IAC1E,QAAQ,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,MAAM,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kFAAkF;IAClF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,mBAAiC,GACtC,OAAO,CAAC,yBAAyB,CAAC,CAyFpC"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Propagation-staleness sensor (focus: "Propagation Staleness Is Invisible").
|
|
3
|
+
*
|
|
4
|
+
* The differential instrument this focus is named for: it computes
|
|
5
|
+
* newest-available MINUS actually-running for a tracked target. Its first (and
|
|
6
|
+
* directly observable) target is the running daemon vs the Gitea npm registry:
|
|
7
|
+
*
|
|
8
|
+
* running = ~/.telora/daemon.meta.json .version (this daemon's own build)
|
|
9
|
+
* newest = the warm version cache .latestVersion (Gitea registry dist-tags.latest,
|
|
10
|
+
* kept fresh by startVersionCacheRefreshLoop)
|
|
11
|
+
*
|
|
12
|
+
* CLOSING the gap, not reporting it. The daemon-version gap is machine-closable:
|
|
13
|
+
* the safe-seam auto-update controller (auto-update.ts) already installs a newer
|
|
14
|
+
* registry version at the next batch-safe idle seam. So when the gap is beyond
|
|
15
|
+
* threshold this sensor DEFERS to that closer -- it does NOT tell a human "the
|
|
16
|
+
* daemon is stale, restart it". Telling a human about a gap the machine is
|
|
17
|
+
* already closing converts machine signal into human chore, and firing on a
|
|
18
|
+
* healthy daemon that is merely deferring to its next safe seam is exactly the
|
|
19
|
+
* failure mode this focus exists to remove.
|
|
20
|
+
*
|
|
21
|
+
* A human is involved ONLY where the machine genuinely cannot act: auto-update
|
|
22
|
+
* is disabled for this daemon (installMode=npx, or --no-auto-update /
|
|
23
|
+
* TELORA_AUTO_UPDATE=0, reflected as autoUpdateEnabled=false in daemon.meta.json).
|
|
24
|
+
* The operator opted out of automation, so the machine cannot close the gap --
|
|
25
|
+
* and even then the deliverable is a READY ACTION handed over (the exact
|
|
26
|
+
* `npm install -g` command + restart), never an inbox item that merely says a
|
|
27
|
+
* gap exists. That handover auto-resolves once the running version catches up,
|
|
28
|
+
* and is retired immediately if auto-update is re-enabled (the machine reclaims
|
|
29
|
+
* closure).
|
|
30
|
+
*
|
|
31
|
+
* Every tick leaves a trace (delegated-to-auto-update / handed-over /
|
|
32
|
+
* back-in-sync / "measured, within threshold" / "UNMEASURED"), so an ABSENT
|
|
33
|
+
* trace positively means "measured and in sync" -- never "not measured". Wedged
|
|
34
|
+
* auto-update (enabled but not running) is made visible by the SEPARATE
|
|
35
|
+
* auto-update decision heartbeat (auto-update.ts): an absent [auto-update] trace
|
|
36
|
+
* identifies a controller that is not running. That is not re-derived here.
|
|
37
|
+
*
|
|
38
|
+
* Pure decision (computeDaemonVersionDifferential / decideStalenessAction) +
|
|
39
|
+
* injected IO, mirroring ci-sensor-loop.ts, so the loop is unit-testable without
|
|
40
|
+
* a live registry or DB. Registered in LOOP_REGISTRY under the opt-out guard
|
|
41
|
+
* TELORA_STALENESS_SENSOR_LOOP.
|
|
42
|
+
*
|
|
43
|
+
* The two infra-owned targets observed 2026-07-24 (npmjs mirror serving a stale
|
|
44
|
+
* version; Opus 5 seed merged-but-maybe-not-applied) are NOT computable from
|
|
45
|
+
* this repo (no prod DB access; infra alone publishes to npmjs). They are
|
|
46
|
+
* recorded, with their operator-facing close action, in
|
|
47
|
+
* docs/runbook-propagation-staleness-targets.md -- the sensor deliberately does
|
|
48
|
+
* NOT attempt those infra actions.
|
|
49
|
+
*
|
|
50
|
+
* @module staleness-sensor
|
|
51
|
+
*/
|
|
52
|
+
import { configForProduct } from './config.js';
|
|
53
|
+
import { readFreshVersionCache } from './staleness.js';
|
|
54
|
+
import { readDaemonMeta } from './daemon-process.js';
|
|
55
|
+
import { isNewerVersion, parseVersionCore } from './version-check.js';
|
|
56
|
+
import { createEscalation, markEscalationResolved } from './queries/issues.js';
|
|
57
|
+
import { callApi } from './queries/shared.js';
|
|
58
|
+
import { ESCALATION_REASONS, ESCALATION_DISPOSITIONS } from '@telora/daemon-core';
|
|
59
|
+
import { createLogger } from './log.js';
|
|
60
|
+
const log = createLogger({ module: 'staleness-sensor' });
|
|
61
|
+
/**
|
|
62
|
+
* escalation_kind for a stale daemon that the machine CANNOT auto-close (auto-update
|
|
63
|
+
* disabled). Carries a ready action, not a bare "gap exists" notice.
|
|
64
|
+
*/
|
|
65
|
+
export const PROPAGATION_STALE_ESCALATION_KIND = 'propagation_stale';
|
|
66
|
+
/** Stable target id for the daemon-vs-registry differential. */
|
|
67
|
+
export const DAEMON_VERSION_TARGET = 'daemon-version';
|
|
68
|
+
/**
|
|
69
|
+
* Default patch-version distance that trips the signal. Any minor/major gap
|
|
70
|
+
* always trips regardless. A 1-2 patch gap is left quiet: auto-update closes it
|
|
71
|
+
* at the next idle seam, so signaling immediately would be noise. The observed
|
|
72
|
+
* failure (0.20.21 vs 0.20.28 = 7 patches) is well past this floor.
|
|
73
|
+
*/
|
|
74
|
+
export const DEFAULT_STALENESS_PATCH_THRESHOLD = 3;
|
|
75
|
+
/** Component-wise (newest - running), clamped at 0 per component. */
|
|
76
|
+
function versionDistance(running, newest) {
|
|
77
|
+
const r = parseVersionCore(running);
|
|
78
|
+
const n = parseVersionCore(newest);
|
|
79
|
+
if (!r || !n)
|
|
80
|
+
return { major: 0, minor: 0, patch: 0 };
|
|
81
|
+
return {
|
|
82
|
+
major: Math.max(0, n[0] - r[0]),
|
|
83
|
+
minor: Math.max(0, n[1] - r[1]),
|
|
84
|
+
patch: Math.max(0, n[2] - r[2]),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Compute the daemon-vs-registry differential. Returns null when it cannot be
|
|
89
|
+
* MEASURED (either version missing) -- the caller must then emit an explicit
|
|
90
|
+
* "UNMEASURED" trace rather than staying silent, so silence always means "in
|
|
91
|
+
* sync", never "not measured".
|
|
92
|
+
*/
|
|
93
|
+
export function computeDaemonVersionDifferential(running, newest, patchThreshold = DEFAULT_STALENESS_PATCH_THRESHOLD) {
|
|
94
|
+
if (!running || !newest)
|
|
95
|
+
return null;
|
|
96
|
+
const behind = isNewerVersion(newest, running);
|
|
97
|
+
const distance = versionDistance(running, newest);
|
|
98
|
+
const beyondThreshold = behind && (distance.major > 0 || distance.minor > 0 || distance.patch >= patchThreshold);
|
|
99
|
+
return { target: DAEMON_VERSION_TARGET, running, newest, behind, distance, beyondThreshold };
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Pure decision. The pivot is `canMachineClose`: when the auto-update controller
|
|
103
|
+
* owns closing the daemon-version gap, the sensor NEVER hands a human a report --
|
|
104
|
+
* it defers (and retires any stale handover). A human is handed a ready action
|
|
105
|
+
* ONLY when the machine genuinely cannot act. A null differential (unmeasurable)
|
|
106
|
+
* never acts -- it is handled as a trace by the tick.
|
|
107
|
+
*/
|
|
108
|
+
export function decideStalenessAction(diff, hasOpen, canMachineClose) {
|
|
109
|
+
if (!diff)
|
|
110
|
+
return 'none';
|
|
111
|
+
if (diff.beyondThreshold) {
|
|
112
|
+
if (canMachineClose) {
|
|
113
|
+
// Auto-update closes this at the next safe seam. Defer to it. If a stale
|
|
114
|
+
// handover from a prior disabled period is still open, retire it -- the
|
|
115
|
+
// machine has reclaimed closure.
|
|
116
|
+
return hasOpen ? 'resolve' : 'delegate';
|
|
117
|
+
}
|
|
118
|
+
// Machine cannot act (auto-update off / npx). Hand over a ready action once.
|
|
119
|
+
return hasOpen ? 'none' : 'hand-over';
|
|
120
|
+
}
|
|
121
|
+
// Within threshold / in sync: retire any open handover, else stay quiet.
|
|
122
|
+
return hasOpen ? 'resolve' : 'none';
|
|
123
|
+
}
|
|
124
|
+
function formatDistance(d) {
|
|
125
|
+
return `${d.major}.${d.minor}.${d.patch}`;
|
|
126
|
+
}
|
|
127
|
+
/** The exact operator command that closes the gap when the machine cannot. */
|
|
128
|
+
function readyUpdateCommand(newest) {
|
|
129
|
+
return `npm install -g @telora/daemon@${newest} # then restart the daemon`;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Whether the auto-update controller can close the daemon-version gap itself.
|
|
133
|
+
* Mirrors auto-update.ts's own disable conditions: npx-cache installs never
|
|
134
|
+
* update, and --no-auto-update / TELORA_AUTO_UPDATE=0 (surfaced as
|
|
135
|
+
* autoUpdateEnabled=false in daemon.meta.json) opt the operator out.
|
|
136
|
+
*
|
|
137
|
+
* Defaults to true (the closer is opt-out and runs by default) when meta is
|
|
138
|
+
* absent or the field is unstamped, so an unknown state never manufactures a
|
|
139
|
+
* spurious human handover.
|
|
140
|
+
*/
|
|
141
|
+
function defaultCanMachineCloseGap() {
|
|
142
|
+
const meta = readDaemonMeta();
|
|
143
|
+
if (!meta)
|
|
144
|
+
return true;
|
|
145
|
+
if (meta.installMode === 'npx')
|
|
146
|
+
return false;
|
|
147
|
+
return meta.autoUpdateEnabled !== false;
|
|
148
|
+
}
|
|
149
|
+
const OPEN_STATUSES = new Set(['pending', 'in_review']);
|
|
150
|
+
function isOpenPropagationStale(e) {
|
|
151
|
+
if (e.status && !OPEN_STATUSES.has(e.status))
|
|
152
|
+
return false;
|
|
153
|
+
return e.escalationKind === PROPAGATION_STALE_ESCALATION_KIND;
|
|
154
|
+
}
|
|
155
|
+
async function defaultHasOpenStalenessEscalation() {
|
|
156
|
+
const result = await callApi('escalation_list', {
|
|
157
|
+
fields: { statuses: ['pending', 'in_review'] },
|
|
158
|
+
limit: 500,
|
|
159
|
+
});
|
|
160
|
+
return (result.escalations ?? []).some(isOpenPropagationStale);
|
|
161
|
+
}
|
|
162
|
+
async function defaultResolveStalenessEscalations() {
|
|
163
|
+
const result = await callApi('escalation_list', {
|
|
164
|
+
fields: { statuses: ['pending', 'in_review'] },
|
|
165
|
+
limit: 500,
|
|
166
|
+
});
|
|
167
|
+
const open = (result.escalations ?? []).filter(isOpenPropagationStale);
|
|
168
|
+
let resolved = 0;
|
|
169
|
+
for (const e of open) {
|
|
170
|
+
try {
|
|
171
|
+
await markEscalationResolved(e.id, 'Auto-resolved by the daemon: the machine is closing the daemon-version gap ' +
|
|
172
|
+
'(back in sync, or auto-update re-enabled) -- no operator action needed.');
|
|
173
|
+
resolved++;
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
log.warn(`Failed to resolve propagation_stale escalation ${e.id}: ${err.message}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return resolved;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Hand a human a READY ACTION (not a gap report) for a stale daemon the machine
|
|
183
|
+
* cannot auto-close. The description leads with the exact command to run; the
|
|
184
|
+
* escalation exists to carry the action, not to announce that a gap exists.
|
|
185
|
+
*/
|
|
186
|
+
async function defaultHandOverReadyAction(params) {
|
|
187
|
+
const { diff, readyCommand } = params;
|
|
188
|
+
await createEscalation({
|
|
189
|
+
organizationId: params.organizationId,
|
|
190
|
+
issueId: null,
|
|
191
|
+
reasonType: ESCALATION_REASONS.ERROR_ENCOUNTERED,
|
|
192
|
+
disposition: ESCALATION_DISPOSITIONS.NEEDS_OPERATOR,
|
|
193
|
+
productId: params.productId,
|
|
194
|
+
escalationKind: PROPAGATION_STALE_ESCALATION_KIND,
|
|
195
|
+
description: `Ready action -- update this daemon:\n\n ${readyCommand}\n\n` +
|
|
196
|
+
`Auto-update is disabled on this daemon (running from an npx cache, or ` +
|
|
197
|
+
`--no-auto-update / TELORA_AUTO_UPDATE=0), so the machine cannot close the ` +
|
|
198
|
+
`daemon-version gap itself: running v${diff.running} while the Gitea registry ` +
|
|
199
|
+
`serves v${diff.newest} (behind by ${formatDistance(diff.distance)}). Running the ` +
|
|
200
|
+
`command above closes it. This resolves automatically once the running version ` +
|
|
201
|
+
`catches up, or if auto-update is re-enabled.`,
|
|
202
|
+
metadata: {
|
|
203
|
+
target: diff.target,
|
|
204
|
+
running_version: diff.running,
|
|
205
|
+
newest_version: diff.newest,
|
|
206
|
+
distance: diff.distance,
|
|
207
|
+
ready_command: readyCommand,
|
|
208
|
+
reason: 'auto_update_disabled',
|
|
209
|
+
product_id: params.productId,
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
const defaultDeps = {
|
|
214
|
+
readRunningVersion: () => readDaemonMeta()?.version ?? null,
|
|
215
|
+
readNewestAvailable: () => readFreshVersionCache()?.latestVersion ?? null,
|
|
216
|
+
patchThreshold: DEFAULT_STALENESS_PATCH_THRESHOLD,
|
|
217
|
+
canMachineCloseGap: defaultCanMachineCloseGap,
|
|
218
|
+
hasOpenStalenessEscalation: defaultHasOpenStalenessEscalation,
|
|
219
|
+
handOverReadyAction: defaultHandOverReadyAction,
|
|
220
|
+
resolveStalenessEscalations: defaultResolveStalenessEscalations,
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* One propagation-staleness sensor tick. Computes the global daemon-vs-registry
|
|
224
|
+
* differential once (the running daemon has a single version). When the gap is
|
|
225
|
+
* beyond threshold the sensor DEFERS to the auto-update controller if that closer
|
|
226
|
+
* is active, and hands a human a ready action ONLY when it is not. Any handover
|
|
227
|
+
* is anchored to the first configured product for inbox visibility (the fact is
|
|
228
|
+
* process-global; all products share one org).
|
|
229
|
+
*
|
|
230
|
+
* Every path emits a trace so an absent signal means "measured and in sync".
|
|
231
|
+
*/
|
|
232
|
+
export async function runStalenessSensorTick(config, deps = defaultDeps) {
|
|
233
|
+
const counts = {
|
|
234
|
+
measured: false,
|
|
235
|
+
behind: false,
|
|
236
|
+
delegatedToAutoUpdate: false,
|
|
237
|
+
handoversToOperator: 0,
|
|
238
|
+
escalationsResolved: 0,
|
|
239
|
+
};
|
|
240
|
+
try {
|
|
241
|
+
const running = deps.readRunningVersion();
|
|
242
|
+
const newest = deps.readNewestAvailable();
|
|
243
|
+
const diff = computeDaemonVersionDifferential(running, newest, deps.patchThreshold);
|
|
244
|
+
if (!diff) {
|
|
245
|
+
// Not measurable this tick -- must NOT be silent (silence means in-sync).
|
|
246
|
+
log.warn(`[staleness] daemon-version differential UNMEASURED ` +
|
|
247
|
+
`(running=${running ?? 'unknown'}, newest=${newest ?? 'unknown'}); ` +
|
|
248
|
+
`cannot compute the propagation gap -- the version cache may not be warm yet.`);
|
|
249
|
+
return counts;
|
|
250
|
+
}
|
|
251
|
+
counts.measured = true;
|
|
252
|
+
counts.behind = diff.behind;
|
|
253
|
+
const anchor = config.products[0];
|
|
254
|
+
if (!anchor) {
|
|
255
|
+
log.info(`[staleness] measured: running v${diff.running} vs newest v${diff.newest} ` +
|
|
256
|
+
`(${diff.behind ? `behind ${formatDistance(diff.distance)}` : 'in sync'}); ` +
|
|
257
|
+
`no product configured to anchor a handover.`);
|
|
258
|
+
return counts;
|
|
259
|
+
}
|
|
260
|
+
const pc = configForProduct(config, anchor);
|
|
261
|
+
const canMachineClose = deps.canMachineCloseGap();
|
|
262
|
+
const hasOpen = await deps.hasOpenStalenessEscalation();
|
|
263
|
+
const action = decideStalenessAction(diff, hasOpen, canMachineClose);
|
|
264
|
+
if (diff.beyondThreshold && canMachineClose) {
|
|
265
|
+
counts.delegatedToAutoUpdate = true;
|
|
266
|
+
}
|
|
267
|
+
if (action === 'hand-over') {
|
|
268
|
+
const readyCommand = readyUpdateCommand(diff.newest);
|
|
269
|
+
await deps.handOverReadyAction({
|
|
270
|
+
organizationId: pc.organizationId,
|
|
271
|
+
productId: pc.productId,
|
|
272
|
+
diff,
|
|
273
|
+
readyCommand,
|
|
274
|
+
});
|
|
275
|
+
counts.handoversToOperator++;
|
|
276
|
+
log.warn(`[staleness] daemon behind registry (running v${diff.running} < newest v${diff.newest}, ` +
|
|
277
|
+
`behind ${formatDistance(diff.distance)}) and auto-update is DISABLED -- the machine ` +
|
|
278
|
+
`cannot close it. Handed over ready action: ${readyCommand}`);
|
|
279
|
+
}
|
|
280
|
+
else if (action === 'delegate') {
|
|
281
|
+
log.info(`[staleness] daemon behind registry (running v${diff.running} < newest v${diff.newest}, ` +
|
|
282
|
+
`behind ${formatDistance(diff.distance)}); auto-update owns closure at the next safe ` +
|
|
283
|
+
`seam -- deferring, no operator action.`);
|
|
284
|
+
}
|
|
285
|
+
else if (action === 'resolve') {
|
|
286
|
+
counts.escalationsResolved += await deps.resolveStalenessEscalations();
|
|
287
|
+
log.info(diff.beyondThreshold
|
|
288
|
+
? `[staleness] auto-update re-enabled while behind (v${diff.running}); the machine now ` +
|
|
289
|
+
`owns closure -- retired the operator handover.`
|
|
290
|
+
: `[staleness] daemon back in sync with registry (v${diff.running}); ` +
|
|
291
|
+
`retired the operator handover.`);
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
// Positive in-sync (or within-threshold) trace: silence must never mean
|
|
295
|
+
// "not measured". This is the heartbeat that makes an absent signal
|
|
296
|
+
// diagnostic.
|
|
297
|
+
log.info(`[staleness] measured: running v${diff.running} vs newest v${diff.newest} -- ` +
|
|
298
|
+
(diff.behind
|
|
299
|
+
? `behind by ${formatDistance(diff.distance)} (within threshold).`
|
|
300
|
+
: 'in sync.'));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
log.warn(`[staleness] tick failed: ${err.message}`);
|
|
305
|
+
}
|
|
306
|
+
return counts;
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=staleness-sensor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staleness-sensor.js","sourceRoot":"","sources":["../src/staleness-sens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C,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-shell.d.ts","sourceRoot":"","sources":["../src/unified-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,qBAAqB,CAAC;AAyC7B,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAmFtE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAkBlE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CA8BtE;AAMD;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CA2BlB;AAMD;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"unified-shell.d.ts","sourceRoot":"","sources":["../src/unified-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,qBAAqB,CAAC;AAyC7B,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAmFtE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAkBlE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CA8BtE;AAMD;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CA2BlB;AAMD;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAidhF"}
|
package/dist/unified-shell.js
CHANGED
|
@@ -658,6 +658,17 @@ export async function runUnifiedDaemon(opts) {
|
|
|
658
658
|
},
|
|
659
659
|
});
|
|
660
660
|
}
|
|
661
|
+
else {
|
|
662
|
+
// Auto-update is off. Emit a distinguishable trace naming which short-circuit
|
|
663
|
+
// fired, so "disabled by config/flag" is never confused with a controller
|
|
664
|
+
// that silently never ran (the invisibility this focus closes). The npx-cache
|
|
665
|
+
// short-circuit logs its own line from inside startAutoUpdateLoop.
|
|
666
|
+
const reason = opts.noAutoUpdate
|
|
667
|
+
? 'the --no-auto-update flag'
|
|
668
|
+
: 'TELORA_AUTO_UPDATE=0 / config autoUpdate.enabled=false';
|
|
669
|
+
log.info(`[auto-update] Disabled by ${reason}; not sampling for updates ` +
|
|
670
|
+
'(version staleness is still tracked via the session-state staleness warning).');
|
|
671
|
+
}
|
|
661
672
|
// -- 13. Keep process alive -----------------------------------------------
|
|
662
673
|
await new Promise(() => { });
|
|
663
674
|
}
|