@groundnuty/macf-core 0.2.47 → 0.2.49
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/dist/delivery/index.d.ts +3 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +2 -0
- package/dist/delivery/index.js.map +1 -0
- package/dist/delivery/store.d.ts +135 -0
- package/dist/delivery/store.d.ts.map +1 -0
- package/dist/delivery/store.js +81 -0
- package/dist/delivery/store.js.map +1 -0
- package/dist/discovery.d.ts +19 -8
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +42 -12
- package/dist/discovery.js.map +1 -1
- package/dist/fleet-driver.d.ts +141 -1
- package/dist/fleet-driver.d.ts.map +1 -1
- package/dist/fleet-driver.js.map +1 -1
- package/dist/fleet-upgrade.d.ts +287 -22
- package/dist/fleet-upgrade.d.ts.map +1 -1
- package/dist/fleet-upgrade.js +350 -31
- package/dist/fleet-upgrade.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/prompt-responses.d.ts +9 -0
- package/dist/prompt-responses.d.ts.map +1 -1
- package/dist/prompt-responses.js +10 -1
- package/dist/prompt-responses.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/fleet-upgrade.d.ts
CHANGED
|
@@ -16,7 +16,10 @@ export type UpgradeDisposition = 'behind' | 'at-target' | 'offline';
|
|
|
16
16
|
export interface AgentUpgradePlan {
|
|
17
17
|
/** The agent's routing label (registry key). */
|
|
18
18
|
readonly agent: string;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The fleet this member belongs to — the workspace's PROJECT (macf#710), NOT
|
|
21
|
+
* its (possibly-shared) registry scope. See `WorkspaceRecord.project`.
|
|
22
|
+
*/
|
|
20
23
|
readonly fleet: string;
|
|
21
24
|
/** The agent's live self-reported `/health.version`, or `null` when offline/version-less. */
|
|
22
25
|
readonly runningVersion: string | null;
|
|
@@ -27,18 +30,158 @@ export interface AgentUpgradePlan {
|
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* The EXECUTE-path outcome of a single agent in the roll:
|
|
30
|
-
* - `upgraded`
|
|
31
|
-
* - `busy-skipped`
|
|
32
|
-
*
|
|
33
|
-
* - `
|
|
33
|
+
* - `upgraded` — rolled + confirmed green on the target. CONTINUES.
|
|
34
|
+
* - `busy-skipped` — busy-gated (or `--wait` timed out still busy),
|
|
35
|
+
* BEFORE any mutation; NOT a failure, CONTINUES.
|
|
36
|
+
* - `config-dirty-skipped` — config-dirty-gated (uncommitted changes on the
|
|
37
|
+
* roll's touched-config surface), BEFORE any
|
|
38
|
+
* mutation; NOT a failure, CONTINUES. The roll
|
|
39
|
+
* OBJECTS with the specific file list + an
|
|
40
|
+
* agent-directed message (macf#725 — replaces
|
|
41
|
+
* macf#722 Fix B's silent skip).
|
|
42
|
+
* - `halted` — verify-green did NOT confirm the target version;
|
|
43
|
+
* the roll STOPS here. `reason` distinguishes WHY
|
|
44
|
+
* (see `HaltReason`).
|
|
45
|
+
*
|
|
46
|
+
* The two pre-flight skip outcomes (`busy-skipped` / `config-dirty-skipped`)
|
|
47
|
+
* are safe to continue past because the agent was NEVER mutated. `halted` is
|
|
48
|
+
* always terminal because the agent WAS rolled and its post-restart state is
|
|
49
|
+
* either confirmed-bad or unconfirmed — neither is safe to leave behind while
|
|
50
|
+
* moving on to the next agent (macf#722 Fix A).
|
|
51
|
+
*/
|
|
52
|
+
export type RollOutcome = 'upgraded' | 'busy-skipped' | 'config-dirty-skipped' | 'halted';
|
|
53
|
+
/**
|
|
54
|
+
* WHY a roll halted (only meaningful when `outcome === 'halted'`):
|
|
55
|
+
* - `bad-release` — verify-green confirmed the agent came back up
|
|
56
|
+
* REACHABLE at its OLD (pre-upgrade) version — a
|
|
57
|
+
* crash-loop / stuck-old-process release. Terminal;
|
|
58
|
+
* stops this fleet's roll + later fleets.
|
|
59
|
+
* - `relaunch-unconfirmed` — past the full verify-green grace budget, the
|
|
60
|
+
* agent was never confirmed at the target version:
|
|
61
|
+
* down the whole time, unreachable, or reachable at
|
|
62
|
+
* some OTHER (neither old-pin nor target) version.
|
|
63
|
+
* "Not yet green" cannot distinguish a slow-but-fine
|
|
64
|
+
* relaunch from a release that crashes on startup
|
|
65
|
+
* (which never shows the old version either), so
|
|
66
|
+
* this is deliberately NOT a continue.
|
|
34
67
|
*/
|
|
35
|
-
export type
|
|
36
|
-
/** The per-agent EXECUTE result. `detail` carries
|
|
68
|
+
export type HaltReason = 'bad-release' | 'relaunch-unconfirmed';
|
|
69
|
+
/** The per-agent EXECUTE result. `detail` carries a human-readable summary. */
|
|
37
70
|
export interface AgentRollResult {
|
|
38
71
|
readonly agent: string;
|
|
39
72
|
readonly outcome: RollOutcome;
|
|
73
|
+
/** Set only when `outcome === 'halted'` — see `HaltReason`. */
|
|
74
|
+
readonly reason?: HaltReason;
|
|
40
75
|
readonly detail?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Files auto-resolved (committed as already-canonical) during this
|
|
78
|
+
* agent's pre-flight, if any (DR-040 Decision 3 / macf#698 R1). Orthogonal
|
|
79
|
+
* to `outcome` — auto-resolve happens BEFORE the outcome is decided, so it
|
|
80
|
+
* can co-occur with ANY outcome: e.g. all dirty files were already-canonical
|
|
81
|
+
* → committed, roll proceeds → `outcome: 'upgraded'` WITH this field set; or
|
|
82
|
+
* some were already-canonical (committed) and some were genuine-delta →
|
|
83
|
+
* `outcome: 'config-dirty-skipped'` (message scoped to the genuine-delta
|
|
84
|
+
* subset only) WITH this field set. Absent when nothing was auto-resolved.
|
|
85
|
+
*/
|
|
86
|
+
readonly autoResolvedFiles?: readonly string[];
|
|
41
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* The roll's MEANINGFUL config surface (macf#722 Fix B / macf#725 UNION,
|
|
90
|
+
* narrowed by DR-040 Decision 6 / macf#698). The path globs that BOTH
|
|
91
|
+
* consumers of this constant key on:
|
|
92
|
+
*
|
|
93
|
+
* 1. **The dirty-CHECK gate** — `rollFleet`'s pre-flight config-dirty
|
|
94
|
+
* gate (`isConfigDirty` / `listDirtyConfig` in `vm-driver.ts`) +
|
|
95
|
+
* `restart-self`'s standalone stash-refusal guard
|
|
96
|
+
* (`hasUncommittedConfigChanges`). `git status --porcelain -- <pattern>`
|
|
97
|
+
* → non-empty ⇒ OBJECT / refuse. Narrowing here narrows what OBJECTS.
|
|
98
|
+
* 2. **The `excludeConfigSurface` stash** — `restart-self`'s roll-path
|
|
99
|
+
* relaunch (`git stash push -- . ':!<pattern>'` per entry) stashes
|
|
100
|
+
* everything EXCEPT this pattern, so the roll's own `macf update`
|
|
101
|
+
* regeneration stays uncommitted for the relaunched agent to see. A
|
|
102
|
+
* path DROPPED from the pattern is therefore no longer excluded → it
|
|
103
|
+
* gets STASHED on relaunch. For a TRACKED operator-evolution file
|
|
104
|
+
* (`CLAUDE.md`), that means the agent comes back with it reverted to
|
|
105
|
+
* HEAD and the edits buried in a stash = silent pre-reconcile loss.
|
|
106
|
+
*
|
|
107
|
+
* Because of use #2, this is a **UNION, not the overwrite-set alone**
|
|
108
|
+
* (macf#725): (a) the files `macf update` OVERWRITES ∪ (b) the
|
|
109
|
+
* operator-evolution files that must NOT be silently stashed on relaunch.
|
|
110
|
+
* The `.claude/**` wildcard was the ONLY bug — it swept in runtime logs
|
|
111
|
+
* (`.claude/audit.log`) + agent scratch that `macf update` never writes,
|
|
112
|
+
* producing false CONFIG-DIRTY objections. This revision replaces ONLY that
|
|
113
|
+
* wildcard with the specific managed paths; the union's meaningful members
|
|
114
|
+
* are preserved.
|
|
115
|
+
*
|
|
116
|
+
* **(a) The exact set `macf update` OVERWRITES** — verified directly against
|
|
117
|
+
* the CLI source (`update.ts` + `env-files-update.ts` + `rules.ts` +
|
|
118
|
+
* `claude-sh.ts` + `host-prelude.ts` + `settings-writer.ts`):
|
|
119
|
+
*
|
|
120
|
+
* - `claude.sh` — `writeClaudeSh` (unconditional for a macf-managed workspace;
|
|
121
|
+
* preserved only when hand-authored/header-less, in which case it's never
|
|
122
|
+
* legitimately dirty from `macf update`'s perspective anyway — harmless to
|
|
123
|
+
* include unconditionally, same reasoning as the prior revision).
|
|
124
|
+
* - `.claude/rules/**` — `copyCanonicalRules` (universal `.claude/rules/*.md`)
|
|
125
|
+
* + `fetchProjectRules` (project-tier `.claude/rules/project/*.md`); both
|
|
126
|
+
* land under this one glob.
|
|
127
|
+
* - `.claude/scripts/**` — `copyCanonicalScripts`. Still the exact overwrite
|
|
128
|
+
* set as of DR-039 phase 2 (macf#749, hook SCRIPT FILES moved to
|
|
129
|
+
* `plugin/scripts/`): `macf update` still writes a `.claude/scripts/`
|
|
130
|
+
* compat copy for hand-wired substrate hooks + non-plugin-init'd
|
|
131
|
+
* workspaces (see `rules.ts` `copyCanonicalScripts` doc comment). Drop this
|
|
132
|
+
* entry once that compat copy is retired.
|
|
133
|
+
* - `.claude/settings.json` — `installGhTokenHook` / `installPluginSkillPermissions`
|
|
134
|
+
* / `installSandboxFdAllowRead` / `installSandboxExcludedCommands` (all
|
|
135
|
+
* merge-preserving writers targeting this one file). Deliberately EXCLUDES
|
|
136
|
+
* `.claude/settings.local.json` — `macf update` only ever READS it (for the
|
|
137
|
+
* getters' merged-view), never writes it (+ it's gitignored → never dirty
|
|
138
|
+
* in the first place → no stash risk).
|
|
139
|
+
* - `.claude/.macf/env._helpers` / `env.identity` / `env.github` / `env.certs`
|
|
140
|
+
* / `env.registry` — the 5 `MANAGED_ENV_FILES` (`env-files-update.ts`),
|
|
141
|
+
* regenerated unconditionally + warn-on-hand-edit. Deliberately EXCLUDES the
|
|
142
|
+
* 2 `OPERATOR_ENV_FILES` (`env.telemetry`, `env.tmux` — bootstrap-write-if-
|
|
143
|
+
* absent, else preserved unconditionally).
|
|
144
|
+
* - `.claude/.macf/host-prelude.sh` — `writeHostPrelude`, "macf-managed +
|
|
145
|
+
* RE-DETECTED (never preserve-existing)" per its own doc comment
|
|
146
|
+
* (`host-prelude.ts`). Genuinely overwritten every `macf update` run; ADDED
|
|
147
|
+
* here (the prior `.claude/**` wildcard caught it incidentally — narrowing
|
|
148
|
+
* the wildcard away would have silently dropped coverage for this file
|
|
149
|
+
* without this explicit addition).
|
|
150
|
+
*
|
|
151
|
+
* **(b) The operator-evolution surface that must NOT be silently stashed**
|
|
152
|
+
* (macf#725 union half — kept, NOT dropped, per the use-#2 reasoning above):
|
|
153
|
+
*
|
|
154
|
+
* - `CLAUDE.md` — TRACKED operator/workbench doc. `macf update` never writes
|
|
155
|
+
* it (no write path in any CLI command), so it's NOT an overwrite-set
|
|
156
|
+
* member — but it IS a meaningful operator-evolution file: a dirty
|
|
157
|
+
* `CLAUDE.md` legitimately warrants a gate objection (unlike `audit.log`,
|
|
158
|
+
* it's real work, not runtime noise), and it MUST stay in the pattern so
|
|
159
|
+
* `excludeConfigSurface` leaves it uncommitted rather than stashing the
|
|
160
|
+
* operator's edits away on relaunch (verified TRACKED → live stash-loss
|
|
161
|
+
* hazard if dropped).
|
|
162
|
+
* - `env.local.*` — the operator-custom env-extension slot (bare pathspec,
|
|
163
|
+
* preserved verbatim from the prior union). Untracked in practice (so no
|
|
164
|
+
* live stash risk today), but kept for union fidelity + zero-cost safety as
|
|
165
|
+
* a genuine operator-surface member.
|
|
166
|
+
*
|
|
167
|
+
* **Motivating incident** (devops review, PR #748 / macf#698): the prior
|
|
168
|
+
* `.claude/**` wildcard matched `.claude/audit.log` — a runtime log a custom
|
|
169
|
+
* `ConfigChange` hook appends to (hence perpetually git-dirty on that
|
|
170
|
+
* workspace) that `macf update` never writes — and **blocked devops's
|
|
171
|
+
* v0.2.48 fleet upgrade** with a false CONFIG-DIRTY objection on 2026-07-02.
|
|
172
|
+
* Untracking `audit.log` itself (the `.gitignore` force-include +
|
|
173
|
+
* `git rm --cached`) is a separate, devops-owned LOCAL workspace cleanup —
|
|
174
|
+
* out of scope here; this pattern-narrowing is the FRAMEWORK-side fix so no
|
|
175
|
+
* future non-canonical `.claude/` file (runtime logs, agent scratch, custom-
|
|
176
|
+
* hook output) can trip the gate at all, regardless of gitignore state on any
|
|
177
|
+
* given workspace.
|
|
178
|
+
*
|
|
179
|
+
* Both gate consumers already pathspec-filter their `git status --porcelain`
|
|
180
|
+
* calls by this exact array (as does the stash), so this revision narrows
|
|
181
|
+
* ALL consumers' behavior identically; no separate no-pathspec fix was needed
|
|
182
|
+
* at any call site.
|
|
183
|
+
*/
|
|
184
|
+
export declare const ROLL_TOUCHED_CONFIG_PATTERNS: readonly ["claude.sh", ".claude/rules/**", ".claude/scripts/**", ".claude/settings.json", ".claude/.macf/env._helpers", ".claude/.macf/env.identity", ".claude/.macf/env.github", ".claude/.macf/env.certs", ".claude/.macf/env.registry", ".claude/.macf/host-prelude.sh", "CLAUDE.md", "env.local.*"];
|
|
42
185
|
/** The result of rolling ONE fleet (the EXECUTE path). */
|
|
43
186
|
export interface FleetRollResult {
|
|
44
187
|
readonly results: readonly AgentRollResult[];
|
|
@@ -48,6 +191,21 @@ export interface FleetRollResult {
|
|
|
48
191
|
readonly upgraded: number;
|
|
49
192
|
/** Count of agents skipped because they were busy. */
|
|
50
193
|
readonly busySkipped: number;
|
|
194
|
+
/**
|
|
195
|
+
* Count of agents skipped because their config surface still had a
|
|
196
|
+
* GENUINE-DELTA file after tiering (macf#722 Fix B; scope narrowed to
|
|
197
|
+
* genuine-delta-only by DR-040 Decision 3 / macf#698 R1 — an agent whose
|
|
198
|
+
* ENTIRE dirty set was already-canonical is auto-resolved instead and does
|
|
199
|
+
* NOT count here).
|
|
200
|
+
*/
|
|
201
|
+
readonly configDirtySkipped: number;
|
|
202
|
+
/**
|
|
203
|
+
* Count of agents that had ≥1 dirty file auto-resolved (committed as
|
|
204
|
+
* already-canonical) this roll (DR-040 Decision 3 / macf#698 R1). Same
|
|
205
|
+
* per-agent-count style as the other counters; see each result's
|
|
206
|
+
* `autoResolvedFiles` for the file-level detail.
|
|
207
|
+
*/
|
|
208
|
+
readonly configAutoResolved: number;
|
|
51
209
|
}
|
|
52
210
|
/** Progress events for CLI rendering (the RESULT objects are what tests assert on). */
|
|
53
211
|
export type UpgradeEvent = {
|
|
@@ -64,18 +222,59 @@ export type UpgradeEvent = {
|
|
|
64
222
|
readonly agent: string;
|
|
65
223
|
readonly from: string | null;
|
|
66
224
|
readonly to: string;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The pre-flight AUTO-RESOLVE (DR-040 Decision 3 / macf#698 R1) — `files`
|
|
228
|
+
* were dirty but their content already equalled canonical, so they were
|
|
229
|
+
* committed automatically; no agent/operator involvement. Fired BEFORE the
|
|
230
|
+
* genuine-delta OBJECT check (if any) + before the busy-gate / transaction,
|
|
231
|
+
* for the SAME agent this iteration — an agent can see BOTH this event AND
|
|
232
|
+
* a subsequent `config-dirty-skip` (for the remaining genuine-delta files)
|
|
233
|
+
* in the same roll.
|
|
234
|
+
*/
|
|
235
|
+
| {
|
|
236
|
+
readonly kind: 'config-auto-resolved';
|
|
237
|
+
readonly agent: string;
|
|
238
|
+
readonly files: readonly string[];
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* The pre-flight OBJECT (macf#725; scope narrowed to GENUINE-DELTA files
|
|
242
|
+
* only by DR-040 Decision 3 / macf#698 R1 — already-canonical files were
|
|
243
|
+
* auto-resolved above and are never part of this list). `files` is the
|
|
244
|
+
* exact genuine-delta uncommitted-path list; `message` is the
|
|
245
|
+
* ready-to-forward, agent-directed text (inspect + commit / delete /
|
|
246
|
+
* gitignore, then re-run). Fired INSTEAD of any mutation — nothing on this
|
|
247
|
+
* agent's genuine-delta files was touched (though the already-canonical
|
|
248
|
+
* subset, if any, WAS committed by the preceding `config-auto-resolved`).
|
|
249
|
+
*/
|
|
250
|
+
| {
|
|
251
|
+
readonly kind: 'config-dirty-skip';
|
|
252
|
+
readonly agent: string;
|
|
253
|
+
readonly files: readonly string[];
|
|
254
|
+
readonly message: string;
|
|
67
255
|
} | {
|
|
68
256
|
readonly kind: 'busy-skip';
|
|
69
257
|
readonly agent: string;
|
|
70
258
|
readonly waited: boolean;
|
|
71
|
-
}
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The post-upgrade modified-files report (macf#725) — fired once an agent is
|
|
262
|
+
* confirmed green, before advancing to the next agent. `files` lists what
|
|
263
|
+
* `macf update` regenerated (and `restart-self` deliberately left
|
|
264
|
+
* uncommitted) in the relaunched agent's workspace; `message` is the
|
|
265
|
+
* ready-to-forward, agent-directed text (review with `git diff` + commit /
|
|
266
|
+
* act as needed).
|
|
267
|
+
*/
|
|
268
|
+
| {
|
|
72
269
|
readonly kind: 'upgraded';
|
|
73
270
|
readonly agent: string;
|
|
74
271
|
readonly version: string;
|
|
272
|
+
readonly modifiedFiles: readonly string[];
|
|
273
|
+
readonly message: string;
|
|
75
274
|
} | {
|
|
76
275
|
readonly kind: 'halt';
|
|
77
276
|
readonly agent: string;
|
|
78
|
-
readonly reason:
|
|
277
|
+
readonly reason: HaltReason;
|
|
79
278
|
readonly lastVersion: string | null;
|
|
80
279
|
};
|
|
81
280
|
/**
|
|
@@ -96,6 +295,16 @@ export interface RollFleetOptions {
|
|
|
96
295
|
readonly waitTimeoutMs?: number;
|
|
97
296
|
/** Re-poll interval while waiting for idle (ms). */
|
|
98
297
|
readonly waitPollMs?: number;
|
|
298
|
+
/**
|
|
299
|
+
* `--force` (macf#722 Fix B / macf#725): roll an agent EVEN IF its config
|
|
300
|
+
* surface is dirty PRE-flight — bypasses the pre-flight config-dirty OBJECT
|
|
301
|
+
* gate. Once bypassed for an agent, that agent's `restart` is ALSO told
|
|
302
|
+
* `leaveConfigUncommitted: true` (same as the normal clean-path transaction)
|
|
303
|
+
* — `--force` means "roll anyway," not "stash the pre-existing dirt," so the
|
|
304
|
+
* pre-existing uncommitted files are left in place exactly like `macf
|
|
305
|
+
* update`'s own regeneration would be.
|
|
306
|
+
*/
|
|
307
|
+
readonly force?: boolean;
|
|
99
308
|
}
|
|
100
309
|
/** Injected side-effect seams for the roll (all fakeable in tests). */
|
|
101
310
|
export interface RollFleetDeps {
|
|
@@ -119,11 +328,62 @@ export declare const DEFAULT_WAIT_TIMEOUT_MS = 300000;
|
|
|
119
328
|
/** Default `--wait` re-poll interval (ms). */
|
|
120
329
|
export declare const DEFAULT_WAIT_POLL_MS = 5000;
|
|
121
330
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
331
|
+
* Build the agent-directed OBJECT message for a config-dirty pre-flight skip
|
|
332
|
+
* (macf#725). Pure — exported for CLI-rendering reuse / tests.
|
|
333
|
+
*/
|
|
334
|
+
export declare function buildConfigDirtyMessage(agent: string, files: readonly string[]): string;
|
|
335
|
+
/**
|
|
336
|
+
* Build the agent-directed post-upgrade modified-files message (macf#725).
|
|
337
|
+
* Pure — exported for CLI-rendering reuse / tests.
|
|
338
|
+
*
|
|
339
|
+
* The message names the intended STEADY-STATE explicitly: a clean roll LEAVES
|
|
340
|
+
* this regeneration uncommitted (so the agent can review it), which means the
|
|
341
|
+
* NEXT roll's pre-flight WILL re-flag these same files as uncommitted unless
|
|
342
|
+
* they're committed. That re-flag is intended hygiene ("commit last update's
|
|
343
|
+
* regen before upgrading again"), not a surprise — so the message tells the
|
|
344
|
+
* agent to commit them, not merely review them.
|
|
345
|
+
*/
|
|
346
|
+
export declare function buildModifiedFilesMessage(agent: string, files: readonly string[]): string;
|
|
347
|
+
/**
|
|
348
|
+
* Roll ONE fleet: for every `behind` plan (in order) run the PRE-FLIGHT gates
|
|
349
|
+
* (config-dirty tier-first, then busy) → upgrade → restart → verify-green
|
|
350
|
+
* cycle, HALTING the roll on the first agent whose post-restart state isn't
|
|
351
|
+
* confirmed-green. Non-`behind` plans are ignored (planned skips).
|
|
352
|
+
* Pre-flight-gated agents are skipped + reported and NEVER a halt (they were
|
|
353
|
+
* never mutated, so continuing is always safe) — config-dirty is checked
|
|
354
|
+
* first because a busy-but-clean agent may still become idle later
|
|
355
|
+
* (`--wait`), whereas a dirty (genuine-delta) agent is skip-only regardless.
|
|
356
|
+
* With `wait`, a busy agent is re-polled for idle first. The verb order +
|
|
357
|
+
* HALT semantics mirror `fleet/upgrade.sh`'s `roll_one`.
|
|
358
|
+
*
|
|
359
|
+
* **Transactional + OBJECT-with-message revision (macf#725).** The pre-flight
|
|
360
|
+
* config-dirty gate is the ONLY decision point that inspects PRE-upgrade
|
|
361
|
+
* state: clean (or explicitly `--force`-bypassed) ⇒ the roll enters the
|
|
362
|
+
* transaction and MUST complete it — `upgrade` → `restart(agent,
|
|
363
|
+
* { leaveConfigUncommitted: true })` always runs together, never mutating
|
|
364
|
+
* `upgrade` without following through to `restart`. Dirty (and not forced) ⇒
|
|
365
|
+
* the roll does NOTHING to this agent (no `upgrade`, no `restart`) and OBJECTS
|
|
366
|
+
* via `onEvent` with the exact file list + an agent-directed message —
|
|
367
|
+
* reconcile is MANUAL: the agent (or operator) resolves the flagged files and
|
|
368
|
+
* a clean re-run completes it. This replaces the earlier (macf#722 Fix B)
|
|
369
|
+
* silent-skip + separately-force-stashed-restart shape, which could dirty the
|
|
370
|
+
* workspace via `upgrade` and then have `restart-self`'s OWN guard refuse —
|
|
371
|
+
* aborting mid-transaction with the workspace already mutated.
|
|
372
|
+
*
|
|
373
|
+
* **Tier-first auto-resolve (DR-040 Decision 3 / macf#698 R1).** Before
|
|
374
|
+
* deciding OBJECT-or-proceed, `deps.driver.classifyDirtyConfig` splits the
|
|
375
|
+
* dirty set into `alreadyCanonical` (content already equals what `macf
|
|
376
|
+
* update` would write — the common case: a stale-branch workspace, both
|
|
377
|
+
* code-agent AND science hit ONLY this tier on the v0.2.48 roll) and
|
|
378
|
+
* `genuineDelta` (a real local difference). `alreadyCanonical` files are
|
|
379
|
+
* committed automatically via `autoResolveCanonical` — no agent/operator
|
|
380
|
+
* involvement, no OBJECT — clearing the false config-dirty signal. Only a
|
|
381
|
+
* non-empty `genuineDelta` still triggers the OBJECT-and-skip path, and its
|
|
382
|
+
* message + `onEvent` payload are scoped to the genuine-delta files ONLY
|
|
383
|
+
* (the auto-resolved noise is never re-surfaced as something to inspect).
|
|
384
|
+
* When `genuineDelta` is empty (either the whole dirty set was
|
|
385
|
+
* already-canonical, or there was nothing dirty at all), the roll falls
|
|
386
|
+
* through into the transaction exactly as the clean case always has.
|
|
127
387
|
*/
|
|
128
388
|
export declare function rollFleet(plans: readonly AgentUpgradePlan[], opts: RollFleetOptions, deps: RollFleetDeps): Promise<FleetRollResult>;
|
|
129
389
|
/** Options for the multi-fleet orchestrator. */
|
|
@@ -134,9 +394,11 @@ export interface UpgradeFleetsOptions extends RollFleetOptions {
|
|
|
134
394
|
/** Injected seams for the multi-fleet orchestrator. */
|
|
135
395
|
export interface UpgradeFleetsDeps {
|
|
136
396
|
/**
|
|
137
|
-
* Resolve the driver for a fleet (
|
|
138
|
-
* `createVmDriverFromConfig` at a representative workspace
|
|
139
|
-
*
|
|
397
|
+
* Resolve the driver for a fleet (a PROJECT identifier — macf#710). Production
|
|
398
|
+
* binds `createVmDriverFromConfig` at a representative workspace OF THAT
|
|
399
|
+
* PROJECT (so the driver's mTLS CA + registry namespace are the project's own,
|
|
400
|
+
* never a sibling project's sharing the same registry scope); tests return a
|
|
401
|
+
* fake. `null` ⇒ the fleet cannot be reached (skip + report, NOT a halt).
|
|
140
402
|
*/
|
|
141
403
|
readonly resolveDriver: (fleet: string) => Promise<FleetDriver | null>;
|
|
142
404
|
readonly verifyGreen: (opts: VerifyGreenOptions) => Promise<VerifyGreenResult>;
|
|
@@ -161,11 +423,14 @@ export interface FleetUpgradeReport {
|
|
|
161
423
|
readonly halted: boolean;
|
|
162
424
|
}
|
|
163
425
|
/**
|
|
164
|
-
* Orchestrate a rolling upgrade across the ORDERED `fleets` (
|
|
165
|
-
* identifiers
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
426
|
+
* Orchestrate a rolling upgrade across the ORDERED `fleets` (PROJECT
|
|
427
|
+
* identifiers — macf#710: a "fleet" == a project, which owns its own CA +
|
|
428
|
+
* registry namespace + version cadence; a profile/org registry scope hosting N
|
|
429
|
+
* projects yields N fleets here, never one), fleet-by-fleet. Each fleet is
|
|
430
|
+
* probed + planned; in EXECUTE mode it is then rolled, and a HALT in one fleet
|
|
431
|
+
* STOPS the whole run — later fleets are never started (a bad release cannot
|
|
432
|
+
* cascade across fleets). An unresolvable fleet is skipped + reported and does
|
|
433
|
+
* NOT halt the run.
|
|
169
434
|
*/
|
|
170
435
|
export declare function upgradeFleets(fleets: readonly string[], opts: UpgradeFleetsOptions, deps: UpgradeFleetsDeps): Promise<FleetUpgradeReport>;
|
|
171
436
|
//# sourceMappingURL=fleet-upgrade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fleet-upgrade.d.ts","sourceRoot":"","sources":["../src/fleet-upgrade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fleet-upgrade.d.ts","sourceRoot":"","sources":["../src/fleet-upgrade.ts"],"names":[],"mappings":"AAiFA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE/E;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AAEpE,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,6FAA6F;IAC7F,QAAQ,CAAC,cAAc,EAAE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