create-principles-disciple 1.132.6 → 1.133.0
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/console/dist/server/routes/update.js +105 -1
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +7 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +17 -6
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js +14 -6
- package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/installer.d.ts +9 -3
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +37 -28
- package/dist/installer.js.map +1 -1
- package/dist/update/apply-payload.d.ts +88 -0
- package/dist/update/apply-payload.d.ts.map +1 -0
- package/dist/update/apply-payload.js +166 -0
- package/dist/update/apply-payload.js.map +1 -0
- package/dist/update/bootstrap-protocol.d.ts.map +1 -1
- package/dist/update/bootstrap-protocol.js +14 -2
- package/dist/update/bootstrap-protocol.js.map +1 -1
- package/dist/update/release-manager-authority.d.ts +15 -0
- package/dist/update/release-manager-authority.d.ts.map +1 -1
- package/dist/update/release-manager-authority.js +35 -7
- package/dist/update/release-manager-authority.js.map +1 -1
- package/dist/update/release-manager.d.ts +74 -6
- package/dist/update/release-manager.d.ts.map +1 -1
- package/dist/update/release-manager.js +272 -36
- package/dist/update/release-manager.js.map +1 -1
- package/dist/update/transaction-journal.d.ts +3 -1
- package/dist/update/transaction-journal.d.ts.map +1 -1
- package/dist/update/transaction-journal.js +3 -1
- package/dist/update/transaction-journal.js.map +1 -1
- package/package.json +1 -1
- package/plugin/dist/bundle.js +1 -1
- package/plugin/dist/governance-audit.js +1 -1
- package/plugin/dist/rulehost-evidence.js +1 -1
- package/release-manager/dist/installer.d.ts +9 -3
- package/release-manager/dist/installer.d.ts.map +1 -1
- package/release-manager/dist/installer.js +37 -28
- package/release-manager/dist/installer.js.map +1 -1
- package/release-manager/dist/update/apply-payload.d.ts +88 -0
- package/release-manager/dist/update/apply-payload.d.ts.map +1 -0
- package/release-manager/dist/update/apply-payload.js +166 -0
- package/release-manager/dist/update/apply-payload.js.map +1 -0
- package/release-manager/dist/update/bootstrap-protocol.d.ts.map +1 -1
- package/release-manager/dist/update/bootstrap-protocol.js +14 -2
- package/release-manager/dist/update/bootstrap-protocol.js.map +1 -1
- package/release-manager/dist/update/release-manager-authority.d.ts +15 -0
- package/release-manager/dist/update/release-manager-authority.d.ts.map +1 -1
- package/release-manager/dist/update/release-manager-authority.js +35 -7
- package/release-manager/dist/update/release-manager-authority.js.map +1 -1
- package/release-manager/dist/update/release-manager.d.ts +74 -6
- package/release-manager/dist/update/release-manager.d.ts.map +1 -1
- package/release-manager/dist/update/release-manager.js +272 -36
- package/release-manager/dist/update/release-manager.js.map +1 -1
- package/release-manager/dist/update/transaction-journal.d.ts +3 -1
- package/release-manager/dist/update/transaction-journal.d.ts.map +1 -1
- package/release-manager/dist/update/transaction-journal.js +3 -1
- package/release-manager/dist/update/transaction-journal.js.map +1 -1
- package/release-manager/package.json +1 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PRI-698 Phase 1 — apply payload acquisition for the ReleaseManager.
|
|
3
|
+
*
|
|
4
|
+
* Bridges the signed metadata world (TUF-verified release metadata + artifact
|
|
5
|
+
* target) and the installer's deployment contract (a local, extracted,
|
|
6
|
+
* self-contained release-asset directory). Owns ONLY acquisition-side writes,
|
|
7
|
+
* strictly bounded to the ReleaseManager staging area:
|
|
8
|
+
*
|
|
9
|
+
* ~/.pd/staging/<transactionId>/release-asset.tar.gz (verified download)
|
|
10
|
+
* ~/.pd/staging/<transactionId>/payload/ (extracted payload)
|
|
11
|
+
*
|
|
12
|
+
* Deployment writes (~/.pd/runtime, host extension dirs) belong exclusively
|
|
13
|
+
* to the installer; this module never touches them (ADR-0023 Decision 1,
|
|
14
|
+
* ADR-0024 §2.1). release-manager.ts itself stays free of filesystem
|
|
15
|
+
* mutation: it orchestrates, this helper acquires.
|
|
16
|
+
*
|
|
17
|
+
* Import-graph constraint: this module is reachable from the console's
|
|
18
|
+
* dynamically-imported authority module, so `installer.js` (the heavy CLI
|
|
19
|
+
* graph) is loaded via dynamic import at acquisition time only — the
|
|
20
|
+
* governed check path never pays for it.
|
|
21
|
+
*
|
|
22
|
+
* Artifact target convention (Phase 1, see
|
|
23
|
+
* docs/architecture/PRI-698-phase4-preflight-analysis.md §4): the release
|
|
24
|
+
* pipeline publishes each release asset as TUF target
|
|
25
|
+
*
|
|
26
|
+
* releases/<releaseId>/release-asset-<platform>-<arch>.tar.gz
|
|
27
|
+
*
|
|
28
|
+
* with TUF `custom` identity {releaseId, channel, platform} and tarball
|
|
29
|
+
* contents = the release-asset directory at its root (no wrapping component
|
|
30
|
+
* directory). The pipeline does not publish these targets yet; the flag
|
|
31
|
+
* stays off in production until it does.
|
|
32
|
+
*/
|
|
33
|
+
import { execFileSync } from 'node:child_process';
|
|
34
|
+
import * as fs from 'node:fs';
|
|
35
|
+
import * as path from 'node:path';
|
|
36
|
+
import { resolveTrustedReleaseTarget, downloadTrustedReleasePayload, } from './trust-metadata.js';
|
|
37
|
+
/** Acquisition failure with a stable reason; release-manager.ts maps it onto the ReleaseManagerError contract. */
|
|
38
|
+
export class ApplyPayloadError extends Error {
|
|
39
|
+
reason;
|
|
40
|
+
nextAction;
|
|
41
|
+
constructor(reason, message, nextAction) {
|
|
42
|
+
super(message);
|
|
43
|
+
this.name = 'ApplyPayloadError';
|
|
44
|
+
this.reason = reason;
|
|
45
|
+
this.nextAction = nextAction;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Select the release asset matching THIS runtime (platform + arch + node ABI)
|
|
50
|
+
* from the signed release metadata. A payload built for a different node ABI
|
|
51
|
+
* can break native modules after the swap, so a mismatch is a refusal, never
|
|
52
|
+
* a warning (rc-3: fail loud before any mutation).
|
|
53
|
+
*/
|
|
54
|
+
export function selectReleaseAsset(releaseMetadata) {
|
|
55
|
+
const { platform } = process;
|
|
56
|
+
const { arch } = process;
|
|
57
|
+
const nodeAbi = process.versions.modules;
|
|
58
|
+
const asset = releaseMetadata.assets.find((a) => a.platform === platform && a.arch === arch);
|
|
59
|
+
if (asset === undefined) {
|
|
60
|
+
throw new ApplyPayloadError('release_metadata_invalid', `Release ${releaseMetadata.productVersion} declares no asset for this platform (${platform}/${arch}); declared: ${releaseMetadata.assets.map((a) => `${a.platform}/${a.arch}`).join(', ') || 'none'}.`, 'Wait for a release asset covering this platform, or update from a supported host.');
|
|
61
|
+
}
|
|
62
|
+
if (asset.nodeAbi !== nodeAbi) {
|
|
63
|
+
throw new ApplyPayloadError('release_metadata_invalid', `Release ${releaseMetadata.productVersion} asset for ${platform}/${arch} targets node ABI ${asset.nodeAbi}, but this runtime is ABI ${nodeAbi}.`, 'Upgrade the bootstrap runtime first, or publish a release asset built for this node ABI.');
|
|
64
|
+
}
|
|
65
|
+
return asset;
|
|
66
|
+
}
|
|
67
|
+
/** TUF target path of the release asset for THIS platform (Phase 1 convention). */
|
|
68
|
+
export function releaseAssetTargetPath(releaseId) {
|
|
69
|
+
return `releases/${releaseId}/release-asset-${process.platform}-${process.arch}.tar.gz`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Resolve the signed artifact target, cross-check the TUF identity and digest
|
|
73
|
+
* against the signed release metadata (rc-6), and download it with in-flight
|
|
74
|
+
* sha256 verification into `~/.pd/staging/<transactionId>/`.
|
|
75
|
+
* Zero writes happen before every identity check has passed.
|
|
76
|
+
*/
|
|
77
|
+
export async function downloadReleaseAsset(options) {
|
|
78
|
+
const { paths, metadataBaseUrl, fetcher, releaseMetadata, channel, transactionId } = options;
|
|
79
|
+
const asset = selectReleaseAsset(releaseMetadata);
|
|
80
|
+
const targetPath = releaseAssetTargetPath(releaseMetadata.releaseId);
|
|
81
|
+
let trustedTarget;
|
|
82
|
+
try {
|
|
83
|
+
trustedTarget = await resolveTrustedReleaseTarget({
|
|
84
|
+
metadataDir: paths.trustDir,
|
|
85
|
+
metadataBaseUrl,
|
|
86
|
+
targetPath,
|
|
87
|
+
expectedChannel: channel,
|
|
88
|
+
expectedPlatform: process.platform,
|
|
89
|
+
fetcher,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
throw new ApplyPayloadError('metadata_refresh_failed', `The signed artifact target for release ${releaseMetadata.releaseId} could not be resolved: ${error instanceof Error ? error.message : String(error)}`, 'Verify that the release pipeline published this release asset to the signed repository, then retry.');
|
|
94
|
+
}
|
|
95
|
+
// rc-6: the TUF-signed identity and the release metadata must name the same
|
|
96
|
+
// release and the same bytes — a mismatch means the channel points at
|
|
97
|
+
// metadata the artifact repo does not answer for. Refuse before any write.
|
|
98
|
+
if (trustedTarget.releaseId !== releaseMetadata.releaseId) {
|
|
99
|
+
throw new ApplyPayloadError('release_metadata_invalid', `Signed artifact target names release ${trustedTarget.releaseId}, but the channel metadata names ${releaseMetadata.releaseId}.`, 'The release repository is inconsistent; wait for refreshed signed metadata. Nothing was modified.');
|
|
100
|
+
}
|
|
101
|
+
if (trustedTarget.artifactSha256 !== asset.archiveSha256) {
|
|
102
|
+
throw new ApplyPayloadError('release_metadata_invalid', 'The signed artifact digest disagrees with the digest in the signed release metadata.', 'The release repository is inconsistent; wait for refreshed signed metadata. Nothing was modified.');
|
|
103
|
+
}
|
|
104
|
+
const transactionDir = path.join(paths.stagingDir, transactionId);
|
|
105
|
+
const archivePath = path.join(transactionDir, 'release-asset.tar.gz');
|
|
106
|
+
fs.mkdirSync(transactionDir, { recursive: true });
|
|
107
|
+
try {
|
|
108
|
+
await downloadTrustedReleasePayload({
|
|
109
|
+
metadataDir: paths.trustDir,
|
|
110
|
+
metadataBaseUrl,
|
|
111
|
+
targetPath,
|
|
112
|
+
destinationPath: archivePath,
|
|
113
|
+
fetcher,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
throw new ApplyPayloadError('metadata_refresh_failed', `The signed release asset could not be downloaded: ${error instanceof Error ? error.message : String(error)}`, 'Check network access to the release repository and retry; nothing was deployed.');
|
|
118
|
+
}
|
|
119
|
+
return { transactionDir, archivePath, trustedTarget };
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Extract the release-asset tarball with the same discipline as the legacy
|
|
123
|
+
* console updater (EP-08): spawn tar via an argv array so paths stay data,
|
|
124
|
+
* and use cwd + RELATIVE archive/dir paths — Git Bash GNU tar on Windows
|
|
125
|
+
* misparses `D:\...` as a remote host (ERR: "Cannot connect to C:"), while
|
|
126
|
+
* Windows System32 bsdtar does not support GNU's --force-local. Relative is
|
|
127
|
+
* the universal form.
|
|
128
|
+
*/
|
|
129
|
+
function extractReleaseAssetArchive(transactionDir, payloadDir) {
|
|
130
|
+
execFileSync('tar', ['xzf', 'release-asset.tar.gz', '-C', 'payload'], {
|
|
131
|
+
cwd: transactionDir,
|
|
132
|
+
stdio: 'pipe',
|
|
133
|
+
});
|
|
134
|
+
if (!fs.existsSync(path.join(payloadDir, '_release', 'manifest.json'))) {
|
|
135
|
+
throw new Error('the artifact tarball does not contain a self-contained release asset at its root (missing _release/manifest.json)');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Extract the verified archive inside the staging transaction dir and run the
|
|
140
|
+
* installer's own self-contained asset preflight (the same verification gate
|
|
141
|
+
* a manual `npx create-principles-disciple` run of this payload would face).
|
|
142
|
+
* Every write stays inside the staging transaction dir.
|
|
143
|
+
*/
|
|
144
|
+
export async function extractAndVerifyReleaseAsset(options) {
|
|
145
|
+
const { transactionDir, archivePath } = options;
|
|
146
|
+
if (!fs.existsSync(archivePath)) {
|
|
147
|
+
throw new ApplyPayloadError('release_metadata_invalid', `The verified release archive is missing from staging: ${archivePath}`, 'Nothing was deployed; the runtime is unchanged. Retry the update.');
|
|
148
|
+
}
|
|
149
|
+
const payloadDir = path.join(transactionDir, 'payload');
|
|
150
|
+
try {
|
|
151
|
+
fs.mkdirSync(payloadDir, { recursive: true });
|
|
152
|
+
extractReleaseAssetArchive(transactionDir, payloadDir);
|
|
153
|
+
// Dynamic import: keeps installer.js (and its CLI dependency graph) out
|
|
154
|
+
// of the module graph until a real acquisition needs it — the governed
|
|
155
|
+
// check path never pays for it.
|
|
156
|
+
const { preflightSelfContainedReleaseAsset } = await import('../installer.js');
|
|
157
|
+
await preflightSelfContainedReleaseAsset(payloadDir);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
if (error instanceof ApplyPayloadError)
|
|
161
|
+
throw error;
|
|
162
|
+
throw new ApplyPayloadError('release_metadata_invalid', `The downloaded release payload failed verification: ${error instanceof Error ? error.message : String(error)}`, 'Nothing was deployed; the runtime is unchanged. Retry the update after the release repository issue is resolved.');
|
|
163
|
+
}
|
|
164
|
+
return { payloadDir };
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=apply-payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-payload.js","sourceRoot":"","sources":["../../src/update/apply-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,GAE9B,MAAM,qBAAqB,CAAC;AAO7B,kHAAkH;AAClH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACjC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/E,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAI1C;CACF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAsDnE;AAED,iFAAiF;AACjF,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAE9E;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,iBAAiB,CAAC,CAkD5B"}
|
|
@@ -97,8 +97,20 @@ export async function handleBootstrapRequest(request, manager) {
|
|
|
97
97
|
case 'check':
|
|
98
98
|
return { ok: true, result: await manager.check(request.channel) };
|
|
99
99
|
case 'apply':
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// PRI-698 Phase 1: apply() is the real write orchestrator now and
|
|
101
|
+
// requires a caller deployment context (workspaceDir) the bootstrap
|
|
102
|
+
// wire contract does not carry. This protocol surface has no
|
|
103
|
+
// production transport and never served apply (it previously refused
|
|
104
|
+
// with `shadow_mode_read_only`); returning a structured refusal keeps
|
|
105
|
+
// that parity without inventing protocol fields for a consumer that
|
|
106
|
+
// does not exist yet (P7). Extend the wire contract with the real
|
|
107
|
+
// first consumer.
|
|
108
|
+
return {
|
|
109
|
+
ok: false,
|
|
110
|
+
reason: 'apply_not_supported_over_bootstrap_protocol',
|
|
111
|
+
message: 'The bootstrap protocol does not carry the deployment context ReleaseManager.apply() requires.',
|
|
112
|
+
nextAction: 'Trigger updates through the Console update surface, which supplies the deployment context.',
|
|
113
|
+
};
|
|
102
114
|
case 'rollback':
|
|
103
115
|
await manager.rollback();
|
|
104
116
|
return { ok: true, result: { rolledBack: true } };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-protocol.js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go);
|
|
32
32
|
* until then these kinds explicitly fall back to the legacy console updater —
|
|
33
33
|
* TEMPORARY migration debt per ADR-0024 D-1, not a supported long-term state.
|
|
34
|
+
*
|
|
35
|
+
* PRI-698 Phase 1: `apply-full` (full-runtime update) is served by the real
|
|
36
|
+
* ReleaseManager.apply() orchestration (installer + journal) and reports the
|
|
37
|
+
* same base readiness as `check`. The CONSOLE additionally gates the routing
|
|
38
|
+
* behind the `release_manager_write_authority` flag (default off) — flag-off
|
|
39
|
+
* dispatches fall back explicitly with `release_manager_write_disabled`.
|
|
40
|
+
* `apply` (the plugin-diff mechanism, which the ReleaseManager does not
|
|
41
|
+
* implement) and `rollback` (Phase 2 — must prove same-version restore first)
|
|
42
|
+
* stay structurally not-ready with explicit reasons.
|
|
34
43
|
*/
|
|
35
44
|
import { ReleaseManager, type InstallStatus, type LegacyUpdaterDecision } from './release-manager.js';
|
|
36
45
|
/** Mutation kinds the console MutationController routes (PRI-659 contract). */
|
|
@@ -60,10 +69,16 @@ export declare function createReleaseManagerAuthority(options: ReleaseManagerAut
|
|
|
60
69
|
/**
|
|
61
70
|
* Map a ReleaseManager refusal onto the console's explicit-fallback reason
|
|
62
71
|
* vocabulary (rc-9: degradation must be observable with a stable reason).
|
|
72
|
+
* `transactionOpened` passes through the PRI-698 default-on safety net
|
|
73
|
+
* semantics: false ⇒ the refusal happened before any side effect, so the
|
|
74
|
+
* console may fall back to the legacy updater with an explicit reason; true
|
|
75
|
+
* ⇒ runtime-side effects may exist and the refusal must surface as a
|
|
76
|
+
* failure, never as a fallback.
|
|
63
77
|
*/
|
|
64
78
|
export declare function mapReleaseManagerErrorToFallback(error: unknown): {
|
|
65
79
|
reason: string;
|
|
66
80
|
message: string;
|
|
67
81
|
nextAction: string | null;
|
|
82
|
+
transactionOpened: boolean;
|
|
68
83
|
};
|
|
69
84
|
//# sourceMappingURL=release-manager-authority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-manager-authority.d.ts","sourceRoot":"","sources":["../../src/update/release-manager-authority.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"release-manager-authority.d.ts","sourceRoot":"","sources":["../../src/update/release-manager-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EACL,cAAc,EAEd,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAG9B,+EAA+E;AAC/E,eAAO,MAAM,+BAA+B,YAAI,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,CAAU,CAAC;AACrG,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3F,MAAM,MAAM,6BAA6B,GACrC,8BAA8B,GAC9B,yBAAyB,GACzB,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,CAAC;AAE7B,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,6BAA6B,EAAE,CAAC;CAC5D;AAUD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAC1F;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,mFAAmF;IACnF,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,2BAA2B,EAAE,gCAAgC,CAAC,CAAC,CAAC;CACjG;AAkBD,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,8BAA8B,GACtC,uBAAuB,CA0DzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,GAAG;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAeA"}
|
|
@@ -31,14 +31,28 @@
|
|
|
31
31
|
* activation rollout opens the `shadow_mode_read_only` gate (its own go/no-go);
|
|
32
32
|
* until then these kinds explicitly fall back to the legacy console updater —
|
|
33
33
|
* TEMPORARY migration debt per ADR-0024 D-1, not a supported long-term state.
|
|
34
|
+
*
|
|
35
|
+
* PRI-698 Phase 1: `apply-full` (full-runtime update) is served by the real
|
|
36
|
+
* ReleaseManager.apply() orchestration (installer + journal) and reports the
|
|
37
|
+
* same base readiness as `check`. The CONSOLE additionally gates the routing
|
|
38
|
+
* behind the `release_manager_write_authority` flag (default off) — flag-off
|
|
39
|
+
* dispatches fall back explicitly with `release_manager_write_disabled`.
|
|
40
|
+
* `apply` (the plugin-diff mechanism, which the ReleaseManager does not
|
|
41
|
+
* implement) and `rollback` (Phase 2 — must prove same-version restore first)
|
|
42
|
+
* stay structurally not-ready with explicit reasons.
|
|
34
43
|
*/
|
|
35
44
|
import * as fs from 'node:fs';
|
|
36
45
|
import { ReleaseManager, ReleaseManagerError, } from './release-manager.js';
|
|
37
46
|
import { InstallLayoutError, resolvePdHomePaths } from './install-layout.js';
|
|
38
47
|
/** Mutation kinds the console MutationController routes (PRI-659 contract). */
|
|
39
48
|
export const RELEASE_MANAGER_AUTHORITY_KINDS = ['check', 'apply', 'apply-full', 'rollback'];
|
|
40
|
-
/**
|
|
41
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Structural gate for the kinds whose write path does not exist yet:
|
|
51
|
+
* `rollback` arrives with the Phase 2 restore migration; `apply` (plugin
|
|
52
|
+
* diff) is not a ReleaseManager mechanism at all. `apply-full` left this
|
|
53
|
+
* gate in PRI-698 Phase 1.
|
|
54
|
+
*/
|
|
55
|
+
const ROLLBACK_AVAILABLE = false;
|
|
42
56
|
/**
|
|
43
57
|
* Probe the transactions directory WITHOUT writing: an existing directory must
|
|
44
58
|
* be writable (the journal is a mandatory mutation contract, ADR-0024 D-2), a
|
|
@@ -95,15 +109,18 @@ export function createReleaseManagerAuthority(options) {
|
|
|
95
109
|
},
|
|
96
110
|
apply: {
|
|
97
111
|
ready: false,
|
|
98
|
-
reasons:
|
|
112
|
+
reasons: ROLLBACK_AVAILABLE ? baseReasons : [...baseReasons, 'rollback_not_available'],
|
|
99
113
|
},
|
|
114
|
+
// PRI-698 Phase 1: the full-runtime write path exists (ReleaseManager.apply
|
|
115
|
+
// → installer → journal). Console routing is additionally flag-gated
|
|
116
|
+
// (`release_manager_write_authority`, default off).
|
|
100
117
|
'apply-full': {
|
|
101
|
-
ready:
|
|
102
|
-
reasons:
|
|
118
|
+
ready: baseReady,
|
|
119
|
+
reasons: baseReasons,
|
|
103
120
|
},
|
|
104
121
|
rollback: {
|
|
105
122
|
ready: false,
|
|
106
|
-
reasons:
|
|
123
|
+
reasons: ROLLBACK_AVAILABLE ? baseReasons : [...baseReasons, 'rollback_not_available'],
|
|
107
124
|
},
|
|
108
125
|
};
|
|
109
126
|
return { manager, installStatus, kinds };
|
|
@@ -111,15 +128,26 @@ export function createReleaseManagerAuthority(options) {
|
|
|
111
128
|
/**
|
|
112
129
|
* Map a ReleaseManager refusal onto the console's explicit-fallback reason
|
|
113
130
|
* vocabulary (rc-9: degradation must be observable with a stable reason).
|
|
131
|
+
* `transactionOpened` passes through the PRI-698 default-on safety net
|
|
132
|
+
* semantics: false ⇒ the refusal happened before any side effect, so the
|
|
133
|
+
* console may fall back to the legacy updater with an explicit reason; true
|
|
134
|
+
* ⇒ runtime-side effects may exist and the refusal must surface as a
|
|
135
|
+
* failure, never as a fallback.
|
|
114
136
|
*/
|
|
115
137
|
export function mapReleaseManagerErrorToFallback(error) {
|
|
116
138
|
if (error instanceof ReleaseManagerError) {
|
|
117
|
-
return {
|
|
139
|
+
return {
|
|
140
|
+
reason: error.reason,
|
|
141
|
+
message: error.message,
|
|
142
|
+
nextAction: error.nextAction,
|
|
143
|
+
transactionOpened: error.transactionOpened,
|
|
144
|
+
};
|
|
118
145
|
}
|
|
119
146
|
return {
|
|
120
147
|
reason: 'release_manager_check_failed',
|
|
121
148
|
message: error instanceof Error ? error.message : String(error),
|
|
122
149
|
nextAction: null,
|
|
150
|
+
transactionOpened: false,
|
|
123
151
|
};
|
|
124
152
|
}
|
|
125
153
|
//# sourceMappingURL=release-manager-authority.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-manager-authority.js","sourceRoot":"","sources":["../../src/update/release-manager-authority.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"release-manager-authority.js","sourceRoot":"","sources":["../../src/update/release-manager-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,CAAU,CAAC;AAerG;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAmBjC;;;;;GAKG;AACH,SAAS,0BAA0B,CAA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AC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gCAAgC,CAAC,KAAc;IAM7D,IAAI,KAAK,YAAY,mBAAmB,EAAE,CAAC;QACzC,OAAO;YACL,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;SAC3C,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,8BAA8B;QACtC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/D,UAAU,EAAE,IAAI;QAChB,iBAAiB,EAAE,KAAK;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -3,9 +3,18 @@
|
|
|
3
3
|
*
|
|
4
4
|
* External surface is intentionally small: inspect / check / apply /
|
|
5
5
|
* rollback. The module hides metadata validation, download, extraction,
|
|
6
|
-
* staging, probes, journaling, host control, rollback, and cleanup.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* staging, probes, journaling, host control, rollback, and cleanup.
|
|
7
|
+
*
|
|
8
|
+
* PRI-698 Phase 1: `apply()` is the update ORCHESTRATOR. It acquires the
|
|
9
|
+
* signed release payload into the staging area (apply-payload.ts) and hands
|
|
10
|
+
* deployment to the installer — the only direct artifact deployment authority
|
|
11
|
+
* (ADR-0024 §2.1) — as ONE journaled transaction (planned → downloaded →
|
|
12
|
+
* verified by this module; staged → probed → activated → confirmed by the
|
|
13
|
+
* installer's existing cycle, same journal file). This module performs ZERO
|
|
14
|
+
* deployment-side filesystem mutation: no writes under `~/.pd/runtime` or the
|
|
15
|
+
* host extension directories ever originate here. `rollback()` still refuses:
|
|
16
|
+
* rollback migration is Phase 2 and must prove same-version restore before it
|
|
17
|
+
* replaces the legacy rollback.
|
|
9
18
|
*
|
|
10
19
|
* Every refusal carries a stable reason and an Owner-visible next action
|
|
11
20
|
* (rc-9) and is computed BEFORE any installation state is mutated.
|
|
@@ -13,12 +22,23 @@
|
|
|
13
22
|
import { resolveTrustedReleaseTarget, type TrustedReleaseTarget } from './trust-metadata.js';
|
|
14
23
|
import { buildReleaseMetadata } from './release-metadata.js';
|
|
15
24
|
import { type ReleasePolicyDecision } from './release-policy.js';
|
|
25
|
+
import type { Language } from '../i18n.js';
|
|
26
|
+
import type { HostTarget } from '../installers/index.js';
|
|
16
27
|
import type { ReleaseChannelName } from './product-identity.js';
|
|
17
|
-
export type ReleaseManagerReason = 'shadow_mode_read_only' | 'bootstrap_not_installed' | 'metadata_refresh_failed' | 'release_metadata_unavailable' | 'release_metadata_invalid' | 'active_record_corrupt';
|
|
28
|
+
export type ReleaseManagerReason = 'shadow_mode_read_only' | 'bootstrap_not_installed' | 'metadata_refresh_failed' | 'release_metadata_unavailable' | 'release_metadata_invalid' | 'active_record_corrupt' | 'legacy_layout_not_supported' | 'journal_unavailable' | 'apply_failed';
|
|
18
29
|
export declare class ReleaseManagerError extends Error {
|
|
19
30
|
readonly reason: ReleaseManagerReason;
|
|
20
31
|
readonly nextAction: string;
|
|
21
|
-
|
|
32
|
+
/**
|
|
33
|
+
* PRI-698 Phase 1 default-on safety net: true when the refusal happened
|
|
34
|
+
* AFTER the apply transaction was opened (planned journaled) — runtime
|
|
35
|
+
* state may include staging writes and a terminal journal tail. False for
|
|
36
|
+
* pre-transaction refusals (layout, metadata, journal-unavailable): the
|
|
37
|
+
* caller can safely fall back to the legacy updater with an explicit
|
|
38
|
+
* reason, because zero side effects exist.
|
|
39
|
+
*/
|
|
40
|
+
readonly transactionOpened: boolean;
|
|
41
|
+
constructor(reason: ReleaseManagerReason, message: string, nextAction: string, transactionOpened?: boolean);
|
|
22
42
|
}
|
|
23
43
|
export type InstallationLayout = 'dual-slot' | 'legacy-overlay' | 'none';
|
|
24
44
|
export interface InstallStatus {
|
|
@@ -55,6 +75,25 @@ export interface UpdateCheck {
|
|
|
55
75
|
readonly note: string | null;
|
|
56
76
|
};
|
|
57
77
|
}
|
|
78
|
+
/** Caller-supplied deployment context for apply() (PRI-698 Phase 1). */
|
|
79
|
+
export interface ApplyOptions {
|
|
80
|
+
/** Workspace the installer re-run operates on (console passes its own). */
|
|
81
|
+
readonly workspaceDir: string;
|
|
82
|
+
/** Installer language; defaults to 'zh' (the installer's default locale). */
|
|
83
|
+
readonly language?: Language;
|
|
84
|
+
/** Host installers to run; defaults to 'openclaw' (matches the legacy full-update sync). */
|
|
85
|
+
readonly host?: HostTarget;
|
|
86
|
+
}
|
|
87
|
+
export type ApplyOutcome = {
|
|
88
|
+
readonly kind: 'applied';
|
|
89
|
+
readonly productVersion: string;
|
|
90
|
+
readonly transactionId: string;
|
|
91
|
+
readonly journalPath: string;
|
|
92
|
+
} | {
|
|
93
|
+
readonly kind: 'no_update';
|
|
94
|
+
/** Why nothing was applied (policy refusal reason or already-current note). */
|
|
95
|
+
readonly note: string;
|
|
96
|
+
};
|
|
58
97
|
export interface ReleaseManagerOptions {
|
|
59
98
|
readonly pdHome: string;
|
|
60
99
|
readonly metadataBaseUrl: string;
|
|
@@ -83,8 +122,37 @@ export declare class ReleaseManager {
|
|
|
83
122
|
constructor(options: ReleaseManagerOptions);
|
|
84
123
|
inspect(): InstallStatus;
|
|
85
124
|
check(channel: ReleaseChannelName): Promise<UpdateCheck>;
|
|
86
|
-
|
|
125
|
+
/**
|
|
126
|
+
* PRI-698 Phase 1: the update orchestrator. Readiness → signed candidate
|
|
127
|
+
* resolution → payload acquisition into staging (journaled) → deployment
|
|
128
|
+
* through the installer (the only direct artifact deployment authority,
|
|
129
|
+
* ADR-0024 §2.1) as ONE transaction. Every failure leaves the runtime on
|
|
130
|
+
* the previous release and the journal at a terminal state.
|
|
131
|
+
*/
|
|
132
|
+
apply(options: ApplyOptions): Promise<ApplyOutcome>;
|
|
87
133
|
rollback(): Promise<never>;
|
|
134
|
+
/**
|
|
135
|
+
* Resolve + digest-verify + cache the signed channel document (shared by
|
|
136
|
+
* check() and apply(); writes stay inside the RM-owned channels cache).
|
|
137
|
+
*/
|
|
138
|
+
private refreshSignedChannel;
|
|
139
|
+
/**
|
|
140
|
+
* evaluateReleaseAdvancement with the ACTIVE release's own metadata as the
|
|
141
|
+
* current state when a dual-slot installation records one (shared by
|
|
142
|
+
* check() and apply()).
|
|
143
|
+
*/
|
|
144
|
+
private evaluateCandidateDecision;
|
|
145
|
+
/**
|
|
146
|
+
* The release metadata document names the bytes to deploy. check() only
|
|
147
|
+
* evaluates already-cached documents; apply() is the "transactional updater"
|
|
148
|
+
* that finally downloads it: TUF target `releases/<releaseId>/metadata.json`
|
|
149
|
+
* (Phase 1 convention, custom identity {releaseId, channel, platform:
|
|
150
|
+
* 'metadata'}) fetched digest-verified into the releases cache, then read
|
|
151
|
+
* back through the SAME strict validation path (identity + expiry + channel
|
|
152
|
+
* digest binding). A pre-seeded local document is still accepted unchanged,
|
|
153
|
+
* so check()-time behavior is untouched.
|
|
154
|
+
*/
|
|
155
|
+
private ensureReleaseMetadataDocument;
|
|
88
156
|
private legacyOverlayMarker;
|
|
89
157
|
private readChannelMetadataPayload;
|
|
90
158
|
private readActiveReleaseMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-manager.d.ts","sourceRoot":"","sources":["../../src/update/release-manager.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"release-manager.d.ts","sourceRoot":"","sources":["../../src/update/release-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,OAAO,EAAE,2BAA2B,EAAoD,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE/I,OAAO,EACL,oBAAoB,EAKrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CA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