create-principles-disciple 1.148.11 → 1.150.1
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/_release/product-identity.json +1 -1
- package/codex-adapter/dist/pd-hook.d.ts +22 -1
- package/codex-adapter/dist/pd-hook.js +81 -7
- package/codex-adapter/dist/worker/workspace-worker.d.ts +15 -0
- package/codex-adapter/dist/worker/workspace-worker.js +7 -36
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/index.js +21 -0
- package/console/dist/server/models/ActivationsConsoleModel.d.ts +3 -17
- package/console/dist/server/models/ActivationsConsoleModel.js +5 -44
- package/console/dist/server/routes/compatibility-scan.d.ts +18 -0
- package/console/dist/server/routes/compatibility-scan.js +33 -0
- package/console/dist/server/routes/diagnostician.d.ts +50 -0
- package/console/dist/server/routes/diagnostician.js +388 -0
- package/console/dist/shared/compatibility-scan-contract.d.ts +26 -0
- package/console/dist/shared/compatibility-scan-contract.js +1 -0
- package/console/dist/web/assets/app.js +31 -31
- package/core/dist/host/host-installer.d.ts +7 -0
- package/core/dist/host/host-installer.d.ts.map +1 -1
- package/core/dist/host/host-installer.js.map +1 -1
- package/core/dist/runtime/activation/index.d.ts +3 -3
- package/core/dist/runtime/activation/index.d.ts.map +1 -1
- package/core/dist/runtime/activation/index.js +1 -1
- package/core/dist/runtime/activation/index.js.map +1 -1
- package/core/dist/runtime/activation/promotion-readiness-evaluator.d.ts +25 -1
- package/core/dist/runtime/activation/promotion-readiness-evaluator.d.ts.map +1 -1
- package/core/dist/runtime/activation/promotion-readiness-evaluator.js +58 -1
- package/core/dist/runtime/activation/promotion-readiness-evaluator.js.map +1 -1
- package/core/dist/runtime/activation/promotion-readiness-reader.d.ts.map +1 -1
- package/core/dist/runtime/activation/promotion-readiness-reader.js +4 -2
- package/core/dist/runtime/activation/promotion-readiness-reader.js.map +1 -1
- package/core/dist/runtime/activation/rulecode-owner-decision-service.d.ts +28 -0
- package/core/dist/runtime/activation/rulecode-owner-decision-service.d.ts.map +1 -1
- package/core/dist/runtime/activation/rulecode-owner-decision-service.js +2 -0
- package/core/dist/runtime/activation/rulecode-owner-decision-service.js.map +1 -1
- package/core/dist/runtime/activation-compatibility-read-model.d.ts +20 -5
- package/core/dist/runtime/activation-compatibility-read-model.d.ts.map +1 -1
- package/core/dist/runtime/activation-compatibility-read-model.js +15 -3
- package/core/dist/runtime/activation-compatibility-read-model.js.map +1 -1
- package/core/dist/runtime/admission-gate.d.ts +8 -1
- package/core/dist/runtime/admission-gate.d.ts.map +1 -1
- package/core/dist/runtime/admission-gate.js +2 -1
- package/core/dist/runtime/admission-gate.js.map +1 -1
- package/core/dist/runtime/config/pd-config-defaults.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-defaults.js +20 -2
- package/core/dist/runtime/config/pd-config-defaults.js.map +1 -1
- package/core/dist/runtime/config/pd-config-validate.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-validate.js +18 -0
- package/core/dist/runtime/config/pd-config-validate.js.map +1 -1
- package/core/dist/runtime/context-payload.d.ts +48 -3
- package/core/dist/runtime/context-payload.d.ts.map +1 -1
- package/core/dist/runtime/context-payload.js +38 -0
- package/core/dist/runtime/context-payload.js.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts +8 -2
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js +28 -2
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/core/dist/runtime/diagnostician-candidate.d.ts +24 -0
- package/core/dist/runtime/diagnostician-candidate.d.ts.map +1 -0
- package/core/dist/runtime/diagnostician-candidate.js +55 -0
- package/core/dist/runtime/diagnostician-candidate.js.map +1 -0
- package/core/dist/runtime/evidence-guards.d.ts +10 -4
- package/core/dist/runtime/evidence-guards.d.ts.map +1 -1
- package/core/dist/runtime/evidence-guards.js +12 -5
- package/core/dist/runtime/evidence-guards.js.map +1 -1
- package/core/dist/runtime/evolution/evolution-types.d.ts +4 -4
- package/core/dist/runtime/evolution/evolution-types.d.ts.map +1 -1
- package/core/dist/runtime/evolution/evolution-types.js +1 -0
- package/core/dist/runtime/evolution/evolution-types.js.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-contract.js +14 -0
- package/core/dist/runtime/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js +16 -0
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/dist/runtime/index.d.ts +5 -2
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +6 -1
- package/core/dist/runtime/index.js.map +1 -1
- package/core/dist/runtime/internalization/index.d.ts +1 -0
- package/core/dist/runtime/internalization/index.d.ts.map +1 -1
- package/core/dist/runtime/internalization/index.js +2 -0
- package/core/dist/runtime/internalization/index.js.map +1 -1
- package/core/dist/runtime/internalization/rule-host-contracts.d.ts +10 -0
- package/core/dist/runtime/internalization/rule-host-contracts.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rule-host-evaluator.js +10 -10
- package/core/dist/runtime/internalization/rule-host-evaluator.js.map +1 -1
- package/core/dist/runtime/internalization/rule-host-input-builder.d.ts +7 -6
- package/core/dist/runtime/internalization/rule-host-input-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rule-host-input-builder.js +6 -2
- package/core/dist/runtime/internalization/rule-host-input-builder.js.map +1 -1
- package/core/dist/runtime/internalization/rule-host-result-normalizer.d.ts +33 -0
- package/core/dist/runtime/internalization/rule-host-result-normalizer.d.ts.map +1 -0
- package/core/dist/runtime/internalization/rule-host-result-normalizer.js +61 -0
- package/core/dist/runtime/internalization/rule-host-result-normalizer.js.map +1 -0
- package/core/dist/runtime/internalization/rule-host-validator.d.ts.map +1 -1
- package/core/dist/runtime/internalization/rule-host-validator.js +17 -0
- package/core/dist/runtime/internalization/rule-host-validator.js.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.d.ts +27 -2
- package/core/dist/runtime/pain-ingress-payload.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.js +45 -3
- package/core/dist/runtime/pain-ingress-payload.js.map +1 -1
- package/core/dist/runtime/pain-ingress.d.ts +4 -2
- package/core/dist/runtime/pain-ingress.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress.js +23 -3
- package/core/dist/runtime/pain-ingress.js.map +1 -1
- package/core/dist/runtime/pain-severity.d.ts +14 -0
- package/core/dist/runtime/pain-severity.d.ts.map +1 -0
- package/core/dist/runtime/pain-severity.js +14 -0
- package/core/dist/runtime/pain-severity.js.map +1 -0
- package/core/dist/runtime/pain-signal-bridge.d.ts +17 -3
- package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.js +6 -0
- package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime/pain-signal-observability.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-observability.js +3 -2
- package/core/dist/runtime/pain-signal-observability.js.map +1 -1
- package/core/dist/runtime/pain-submit-capability.d.ts +164 -0
- package/core/dist/runtime/pain-submit-capability.d.ts.map +1 -0
- package/core/dist/runtime/pain-submit-capability.js +442 -0
- package/core/dist/runtime/pain-submit-capability.js.map +1 -0
- package/core/dist/runtime/pain-to-principle-service.d.ts +4 -0
- package/core/dist/runtime/pain-to-principle-service.d.ts.map +1 -1
- package/core/dist/runtime/pain-to-principle-service.js +2 -0
- package/core/dist/runtime/pain-to-principle-service.js.map +1 -1
- package/core/dist/runtime/stalled-diagnostician-task-read-model.d.ts +56 -10
- package/core/dist/runtime/stalled-diagnostician-task-read-model.d.ts.map +1 -1
- package/core/dist/runtime/stalled-diagnostician-task-read-model.js +80 -4
- package/core/dist/runtime/stalled-diagnostician-task-read-model.js.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.js +11 -0
- package/core/dist/runtime/store/context/sqlite-context-assembler.js.map +1 -1
- package/core/dist/runtime/store/run/memory-run-store.d.ts +10 -0
- package/core/dist/runtime/store/run/memory-run-store.d.ts.map +1 -1
- package/core/dist/runtime/store/run/memory-run-store.js +21 -0
- package/core/dist/runtime/store/run/memory-run-store.js.map +1 -1
- package/core/dist/runtime/store/run/run-store.d.ts +12 -0
- package/core/dist/runtime/store/run/run-store.d.ts.map +1 -1
- package/core/dist/runtime/store/run/sqlite-run-store.d.ts +1 -0
- package/core/dist/runtime/store/run/sqlite-run-store.d.ts.map +1 -1
- package/core/dist/runtime/store/run/sqlite-run-store.js +14 -0
- package/core/dist/runtime/store/run/sqlite-run-store.js.map +1 -1
- package/core/dist/runtime/task-status.d.ts +9 -0
- package/core/dist/runtime/task-status.d.ts.map +1 -1
- package/core/dist/runtime/task-status.js +7 -1
- package/core/dist/runtime/task-status.js.map +1 -1
- package/core/dist/runtime/types/evidence-chain-contract.d.ts +18 -0
- package/core/dist/runtime/types/evidence-chain-contract.d.ts.map +1 -1
- package/core/dist/runtime/types/evidence-chain-contract.js +37 -7
- package/core/dist/runtime/types/evidence-chain-contract.js.map +1 -1
- package/core/package.json +5 -1
- package/dist/install-summary.d.ts +7 -0
- package/dist/install-summary.d.ts.map +1 -1
- package/dist/install-summary.js +4 -0
- package/dist/install-summary.js.map +1 -1
- package/dist/installer.d.ts +92 -8
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +215 -10
- package/dist/installer.js.map +1 -1
- package/dist/installers/codex-host-installer.d.ts +88 -1
- package/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/dist/installers/codex-host-installer.js +350 -11
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/dist/installers/index.d.ts +23 -0
- package/dist/installers/index.d.ts.map +1 -1
- package/dist/installers/index.js +38 -1
- package/dist/installers/index.js.map +1 -1
- package/dist/installers/legacy-workbuddy-skill.d.ts +59 -0
- package/dist/installers/legacy-workbuddy-skill.d.ts.map +1 -0
- package/dist/installers/legacy-workbuddy-skill.js +168 -0
- package/dist/installers/legacy-workbuddy-skill.js.map +1 -0
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +7 -0
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/host-runtime/dist/adaptive-priority-provider.d.ts +94 -0
- package/host-runtime/dist/adaptive-priority-provider.js +162 -0
- package/host-runtime/dist/adaptive-selection.d.ts +164 -0
- package/host-runtime/dist/adaptive-selection.js +506 -0
- package/host-runtime/dist/diagnostician-auto-run.d.ts +28 -0
- package/host-runtime/dist/diagnostician-auto-run.js +100 -0
- package/host-runtime/dist/host-tool-semantic-resolver.d.ts +42 -1
- package/host-runtime/dist/host-tool-semantic-resolver.js +80 -14
- package/host-runtime/dist/index.d.ts +4 -0
- package/host-runtime/dist/index.js +6 -0
- package/host-runtime/dist/production-rulehost-gate.js +17 -17
- package/host-runtime/dist/rulecode-event-collection.d.ts +31 -0
- package/host-runtime/dist/rulecode-event-collection.js +62 -0
- package/host-runtime/package.json +1 -1
- package/install-layout/dist/index.d.ts +1 -1
- package/install-layout/dist/index.js +1 -1
- package/install-layout/dist/pd-home.d.ts +9 -2
- package/install-layout/dist/pd-home.js +77 -14
- package/install-layout/package.json +1 -1
- package/package.json +4 -4
- package/pd-cli/dist/commands/diagnose.d.ts +30 -0
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +75 -0
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-record.js +5 -4
- package/pd-cli/dist/commands/pain-record.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +2 -1
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/runtime-activation.d.ts +6 -17
- package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-activation.js +42 -48
- package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
- package/pd-cli/dist/commands/runtime-compatibility-scan.d.ts +5 -2
- package/pd-cli/dist/commands/runtime-compatibility-scan.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-compatibility-scan.js +22 -2
- package/pd-cli/dist/commands/runtime-compatibility-scan.js.map +1 -1
- package/pd-cli/dist/index.js +1 -0
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/services/config-doctor.d.ts +9 -0
- package/pd-cli/dist/services/config-doctor.d.ts.map +1 -1
- package/pd-cli/dist/services/config-doctor.js +15 -0
- package/pd-cli/dist/services/config-doctor.js.map +1 -1
- package/pd-cli/dist/services/delivery-surfaces.js +1 -1
- package/pd-cli/dist/services/delivery-surfaces.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/pd-mcp-server/dist/budget.d.ts +1 -1
- package/pd-mcp-server/dist/budget.js +2 -2
- package/pd-mcp-server/dist/envelope.d.ts +15 -0
- package/pd-mcp-server/dist/envelope.js +49 -1
- package/pd-mcp-server/dist/index.d.ts +2 -0
- package/pd-mcp-server/dist/index.js +6 -0
- package/pd-mcp-server/dist/server.d.ts +83 -14
- package/pd-mcp-server/dist/server.js +251 -4
- package/pd-mcp-server/dist/version.d.ts +1 -1
- package/pd-mcp-server/dist/version.js +1 -1
- package/pd-mcp-server/dist/workspace.d.ts +4 -2
- package/pd-mcp-server/dist/workspace.js +5 -2
- package/pd-mcp-server/package.json +1 -1
- package/plugin/dist/bundle.js +443 -431
- package/plugin/dist/core/evolution-reducer.d.ts +2 -2
- package/plugin/dist/hooks/hook-tool-semantics.d.ts +25 -0
- package/plugin/dist/hooks/pain-ingress-adapter.d.ts +1 -1
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/rulehost-evidence.js +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/dist/installer.js +215 -10
- package/release-manager/dist/installers/codex-host-installer.js +350 -11
- package/release-manager/dist/installers/index.js +38 -1
- package/release-manager/dist/installers/legacy-workbuddy-skill.js +168 -0
- package/release-manager/dist/installers/workbuddy-host-installer.js +7 -0
- package/release-manager/package.json +1 -1
- package/workbuddy-adapter/dist/pd-hook.js +20 -4
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/skills/pd-pain-signal/SKILL.md +123 -20
package/dist/installer.js
CHANGED
|
@@ -12,7 +12,8 @@ import { logger } from './utils/logger.js';
|
|
|
12
12
|
import { checkOpenClawGateway, stopOpenClawGateway, restartOpenClawGateway } from './utils/env.js';
|
|
13
13
|
import { t } from './i18n.js';
|
|
14
14
|
import { generateConfigYamlContent, ExistingConfigVerifyInfraError, validateExistingConfigYamlForPreserve, getConfigYamlPath, readEnabledChannelsFromConfigYaml, getOpenClawDir, getPdDir, getPdRuntimeDir, getInstallManifestPath, getPdRuntimeBackupsDir, getPluginExtDir, getInstalledPluginDir, getInstalledLayoutPackageDir, getPdBackupsDir, getInstalledPdCliDir, getInstalledBinDir, getInstalledConsoleDir, getHomeDir, isWindows, } from './mvp-config.js';
|
|
15
|
-
import { getHostInstallers } from './installers/index.js';
|
|
15
|
+
import { detectInstalledHosts, getHostInstallers } from './installers/index.js';
|
|
16
|
+
import { readCanonicalRuntimeCohort, readInstalledRuntimeCohort, resolvePluginDataRoot } from './installers/codex-host-installer.js';
|
|
16
17
|
import { runWorkbuddyEarlyPreflight } from './installers/workbuddy-host-installer.js';
|
|
17
18
|
import { INSTALL_LAYOUT_VERSION, getInstallLayoutPaths, getWorkbuddyWorkspaceDir, installManifestHostsForPersist, mergeInstallManifestWorkspaces, parseInstallManifest } from '@principles/install-layout';
|
|
18
19
|
import { resolveMcpServerDir } from './mcp-server-layout-compat.js';
|
|
@@ -209,6 +210,25 @@ export function resolveHostRefreshTargets(persistedHosts, host) {
|
|
|
209
210
|
}
|
|
210
211
|
return targets;
|
|
211
212
|
}
|
|
213
|
+
/** Union the detected (already-installed) hosts into the manifest host list. */
|
|
214
|
+
function withDetectedHosts(hosts, detected) {
|
|
215
|
+
const merged = [...hosts];
|
|
216
|
+
for (const host of detected) {
|
|
217
|
+
if (!merged.includes(host.hostId))
|
|
218
|
+
merged.push(host.hostId);
|
|
219
|
+
}
|
|
220
|
+
return merged;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* One upgrade must cover every host that already carries PD (2026-11-11).
|
|
224
|
+
* Pure so the coverage rule is testable without running a whole install.
|
|
225
|
+
*/
|
|
226
|
+
export function planUpgradeHosts(requested, persistedHosts, detected) {
|
|
227
|
+
return {
|
|
228
|
+
refreshTargets: resolveHostRefreshTargets([...persistedHosts, ...detected.map((host) => host.hostId)], requested),
|
|
229
|
+
newlyCovered: detected.filter((host) => !persistedHosts.includes(host.hostId)),
|
|
230
|
+
};
|
|
231
|
+
}
|
|
212
232
|
/**
|
|
213
233
|
* PRI-624 Slice C: the install manifest records every Workspace this install
|
|
214
234
|
* serves so the Companion can discover its per-Workspace workers (SPEC §13
|
|
@@ -1331,16 +1351,52 @@ function protocolInvalid(detail) {
|
|
|
1331
1351
|
remediation: 'The compatibility scanner returned an unexpected result. Re-download/rebuild the installer before upgrading. The current installation has not been replaced.',
|
|
1332
1352
|
};
|
|
1333
1353
|
}
|
|
1354
|
+
const MAX_SKIP_BUCKETS = 50;
|
|
1355
|
+
/** Sentinel so "absent scannedActivations" stays distinguishable from 0. */
|
|
1356
|
+
const INVALID_COUNT = Symbol('invalid-count');
|
|
1357
|
+
/** rc-4: validate every bucket field, not just "is an array". */
|
|
1358
|
+
function parseSkippedBuckets(value) {
|
|
1359
|
+
if (value === undefined)
|
|
1360
|
+
return [];
|
|
1361
|
+
if (!Array.isArray(value) || value.length > MAX_SKIP_BUCKETS)
|
|
1362
|
+
return null;
|
|
1363
|
+
const buckets = [];
|
|
1364
|
+
for (const entry of value) {
|
|
1365
|
+
if (!isRecord(entry))
|
|
1366
|
+
return null;
|
|
1367
|
+
const { reason } = entry;
|
|
1368
|
+
const { count } = entry;
|
|
1369
|
+
const samples = entry.sampleActivationIds;
|
|
1370
|
+
if (typeof reason !== 'string' || reason.length === 0)
|
|
1371
|
+
return null;
|
|
1372
|
+
if (typeof count !== 'number' || !Number.isInteger(count) || count <= 0)
|
|
1373
|
+
return null;
|
|
1374
|
+
if (!Array.isArray(samples) || !samples.every((id) => typeof id === 'string'))
|
|
1375
|
+
return null;
|
|
1376
|
+
buckets.push({ reason, count, sampleActivationIds: [...samples] });
|
|
1377
|
+
}
|
|
1378
|
+
return buckets;
|
|
1379
|
+
}
|
|
1380
|
+
function parseScannedActivations(value) {
|
|
1381
|
+
if (value === undefined)
|
|
1382
|
+
return undefined;
|
|
1383
|
+
if (typeof value !== 'number' || !Number.isInteger(value) || value < 0)
|
|
1384
|
+
return INVALID_COUNT;
|
|
1385
|
+
return value;
|
|
1386
|
+
}
|
|
1334
1387
|
/**
|
|
1335
1388
|
* Strict (ok, status) protocol parse (P2, 2026-08-20).
|
|
1336
1389
|
*
|
|
1337
1390
|
* Boolean `ok` alone is NOT authoritative — the (ok, status) pair is the
|
|
1338
|
-
* contract. Only ok=true + (clean|no_state_db) is a successful
|
|
1339
|
-
* other combination fails closed:
|
|
1340
|
-
* - ok=true + refusal
|
|
1341
|
-
* - ok=
|
|
1391
|
+
* contract. Only ok=true + (clean|no_state_db|incomplete) is a successful
|
|
1392
|
+
* scan. Every other combination fails closed:
|
|
1393
|
+
* - ok=true + refusal status → protocol invalid
|
|
1394
|
+
* - ok=true + clean/no_state_db + skipped rows → protocol invalid (a
|
|
1395
|
+
* consumer may never quietly downgrade `incomplete` to `clean`)
|
|
1396
|
+
* - ok=true + incomplete + empty skipped → protocol invalid
|
|
1397
|
+
* - ok=false + clean|no_state_db|incomplete/unknown → protocol invalid
|
|
1342
1398
|
* - ok=false + legacy_dependency|scan_failed|scan_unavailable → refusal
|
|
1343
|
-
* - non-boolean / missing ok
|
|
1399
|
+
* - non-boolean / missing ok → protocol invalid
|
|
1344
1400
|
* The payload is never trusted to self-describe a pass.
|
|
1345
1401
|
*/
|
|
1346
1402
|
export function parseCompatibilityScanStdout(stdout) {
|
|
@@ -1360,9 +1416,34 @@ export function parseCompatibilityScanStdout(stdout) {
|
|
|
1360
1416
|
const status = typeof parsed.status === 'string' ? parsed.status : 'unknown';
|
|
1361
1417
|
const reason = typeof parsed.reason === 'string' ? parsed.reason : undefined;
|
|
1362
1418
|
const remediation = typeof parsed.remediation === 'string' ? parsed.remediation : undefined;
|
|
1419
|
+
const skipped = parseSkippedBuckets(parsed.skipped);
|
|
1420
|
+
if (skipped === null) {
|
|
1421
|
+
return protocolInvalid('skipped is not a valid [{reason,count,sampleActivationIds}] array');
|
|
1422
|
+
}
|
|
1423
|
+
const scannedActivations = parseScannedActivations(parsed.scannedActivations);
|
|
1424
|
+
if (scannedActivations === INVALID_COUNT) {
|
|
1425
|
+
return protocolInvalid('scannedActivations is not a non-negative integer');
|
|
1426
|
+
}
|
|
1427
|
+
const skippedTotal = skipped.reduce((sum, bucket) => sum + bucket.count, 0);
|
|
1428
|
+
const visibility = {
|
|
1429
|
+
skipped,
|
|
1430
|
+
...(scannedActivations !== undefined ? { scannedActivations } : {}),
|
|
1431
|
+
};
|
|
1363
1432
|
if (parsed.ok === true) {
|
|
1364
1433
|
if (status === 'clean' || status === 'no_state_db') {
|
|
1365
|
-
|
|
1434
|
+
// Hard constraint (5B): `incomplete` must never be degraded to `clean`
|
|
1435
|
+
// by a consumer. A payload that admits it skipped rows while claiming
|
|
1436
|
+
// clean is self-contradictory, not a pass.
|
|
1437
|
+
if (skipped.length > 0) {
|
|
1438
|
+
return protocolInvalid(`ok=true with status=${status} but skipped=${skippedTotal}`);
|
|
1439
|
+
}
|
|
1440
|
+
return { ok: true, status, ...visibility };
|
|
1441
|
+
}
|
|
1442
|
+
if (status === 'incomplete') {
|
|
1443
|
+
if (skipped.length === 0) {
|
|
1444
|
+
return protocolInvalid('ok=true with status=incomplete but skipped is empty');
|
|
1445
|
+
}
|
|
1446
|
+
return { ok: true, status, ...visibility };
|
|
1366
1447
|
}
|
|
1367
1448
|
return protocolInvalid(`ok=true with status=${status}`);
|
|
1368
1449
|
}
|
|
@@ -1374,6 +1455,52 @@ export function parseCompatibilityScanStdout(stdout) {
|
|
|
1374
1455
|
}
|
|
1375
1456
|
return protocolInvalid(`ok is not a boolean`);
|
|
1376
1457
|
}
|
|
1458
|
+
/**
|
|
1459
|
+
* 5B: turn the scan's `skipped` buckets into operator-facing lines.
|
|
1460
|
+
*
|
|
1461
|
+
* INTENTIONAL CHOICE — these are warnings, never a refusal. A non-interactive
|
|
1462
|
+
* install that hard-failed here would strand the user: the old installation is
|
|
1463
|
+
* untouched, but the upgrade is blocked with no in-product repair path (they
|
|
1464
|
+
* would have to hand-edit the workspace DB before the installer would run).
|
|
1465
|
+
* Escalate to a hard failure only if a real incident is attributed to an
|
|
1466
|
+
* upgrade that ran with unverified ACTIVE rules; the escalation condition is
|
|
1467
|
+
* then `level === 'critical'` (zero rules verified) and belongs here.
|
|
1468
|
+
*/
|
|
1469
|
+
export function summarizeCompatibilityVisibility(outcome, workspaceDir) {
|
|
1470
|
+
const skipped = outcome.skipped ?? [];
|
|
1471
|
+
if (skipped.length === 0)
|
|
1472
|
+
return { level: 'none', lines: [] };
|
|
1473
|
+
const total = skipped.reduce((sum, bucket) => sum + bucket.count, 0);
|
|
1474
|
+
const rows = skipped.map((bucket) => {
|
|
1475
|
+
const sample = bucket.sampleActivationIds.length > 0 ? ` (sample: ${bucket.sampleActivationIds.join(', ')})` : '';
|
|
1476
|
+
return `${bucket.reason}=${bucket.count}${sample}`;
|
|
1477
|
+
});
|
|
1478
|
+
const nextCommand = `pd runtime compatibility-scan --workspace "${workspaceDir}" --json`;
|
|
1479
|
+
if (outcome.scannedActivations === 0) {
|
|
1480
|
+
const border = '!'.repeat(74);
|
|
1481
|
+
return {
|
|
1482
|
+
level: 'critical',
|
|
1483
|
+
lines: [
|
|
1484
|
+
border,
|
|
1485
|
+
'!! WARNING: THIS UPGRADE DID NOT VERIFY ANY RULE COMPATIBILITY',
|
|
1486
|
+
`!! ${total} ACTIVE rule(s) could not be read and 0 ACTIVE rule(s) were scanned,`,
|
|
1487
|
+
'!! so no ACTIVE rule was checked for retired-contract dependencies.',
|
|
1488
|
+
`!! ${rows.join(' | ')}`,
|
|
1489
|
+
'!! The upgrade proceeds; verify now:',
|
|
1490
|
+
`!! ${nextCommand}`,
|
|
1491
|
+
border,
|
|
1492
|
+
],
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
return {
|
|
1496
|
+
level: 'warning',
|
|
1497
|
+
lines: [
|
|
1498
|
+
`warning: ${total} ACTIVE rule(s) could not be read during the compatibility check — their compatibility is NOT verified.`,
|
|
1499
|
+
...rows.map((row) => ` ${row}`),
|
|
1500
|
+
`next: ${nextCommand}`,
|
|
1501
|
+
],
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1377
1504
|
/**
|
|
1378
1505
|
* PRI-693 / PRI-1060: materialize node_modules links for the BUNDLED (not yet
|
|
1379
1506
|
* deployed) components so the pre-deployment compatibility scan can execute
|
|
@@ -3624,6 +3751,44 @@ export function partitionHostInstallResults(results) {
|
|
|
3624
3751
|
}
|
|
3625
3752
|
return { failures, manualActions };
|
|
3626
3753
|
}
|
|
3754
|
+
/**
|
|
3755
|
+
* UPDATE CHAIN (2026-11-11): the Owner-visible install summary. Every host
|
|
3756
|
+
* this run actually touched gets one line naming the runtime it now resolves,
|
|
3757
|
+
* so covering an already-installed host can never happen silently.
|
|
3758
|
+
*
|
|
3759
|
+
* The two runtime layouts are different authorities, not interchangeable
|
|
3760
|
+
* views: the shared canonical runtime is `<dir>/<component>/package.json`,
|
|
3761
|
+
* while Codex's PLUGIN_DATA copy is `<dir>/node_modules/<pkg>/package.json`.
|
|
3762
|
+
* Reading the canonical dir with the PLUGIN_DATA reader made every
|
|
3763
|
+
* OpenClaw/WorkBuddy line print "runtime not verified".
|
|
3764
|
+
*
|
|
3765
|
+
* Derived from the existing host results plus the installed runtime dirs —
|
|
3766
|
+
* never persisted, never a second install-state authority.
|
|
3767
|
+
*/
|
|
3768
|
+
export function summarizeTouchedHosts(results, deps = {}) {
|
|
3769
|
+
const canonical = readCanonicalRuntimeCohort(deps.canonicalRuntimeDir ?? getPdRuntimeDir());
|
|
3770
|
+
const codexHome = process.env.CODEX_HOME ?? path.join(getHomeDir(), '.codex');
|
|
3771
|
+
// `resolvePluginDataRoot` returns the PLUGIN DATA ROOT; the installed cohort
|
|
3772
|
+
// lives one level below it in `runtime/`. Appending `node_modules` to the
|
|
3773
|
+
// root read a directory that never exists, so an install that had just
|
|
3774
|
+
// refreshed Codex to the payload pin still printed "runtime not verified".
|
|
3775
|
+
const pluginDataRoot = resolvePluginDataRoot(codexHome, 'principles');
|
|
3776
|
+
const codexRuntimeDir = deps.codexRuntimeDir
|
|
3777
|
+
?? (pluginDataRoot === undefined ? undefined : path.join(pluginDataRoot, 'runtime'));
|
|
3778
|
+
const codex = deps.codexRuntimeReadable === false || codexRuntimeDir === undefined
|
|
3779
|
+
? undefined
|
|
3780
|
+
: readInstalledRuntimeCohort(codexRuntimeDir);
|
|
3781
|
+
return results.map((host) => {
|
|
3782
|
+
if (!host.success) {
|
|
3783
|
+
return `Host "${host.hostId}" — not updated: ${host.reason ?? 'unknown failure'}`;
|
|
3784
|
+
}
|
|
3785
|
+
const cohort = host.hostId === 'codex' ? codex : canonical;
|
|
3786
|
+
const version = cohort
|
|
3787
|
+
? `core@${cohort.core}, codex-adapter@${cohort.codexAdapter}, host-runtime@${cohort.hostRuntime}, mcp@${cohort.mcpServer}`
|
|
3788
|
+
: 'runtime not verified';
|
|
3789
|
+
return `Host "${host.hostId}" — ${version} (${host.configAction ?? 'updated'})`;
|
|
3790
|
+
});
|
|
3791
|
+
}
|
|
3627
3792
|
/**
|
|
3628
3793
|
* ADR-0020 §2.3: Run host installers for the selected HostTarget.
|
|
3629
3794
|
*
|
|
@@ -4034,6 +4199,11 @@ transaction) {
|
|
|
4034
4199
|
// a refusal leaves the existing installation completely untouched. Only
|
|
4035
4200
|
// meaningful when the target workspace already has PD state; fresh
|
|
4036
4201
|
// workspaces scan clean (no state.db → nothing persisted to conflict).
|
|
4202
|
+
//
|
|
4203
|
+
// 5B: rows the scan could not read are surfaced as warnings, never as a
|
|
4204
|
+
// refusal — see summarizeCompatibilityVisibility for why, and for the
|
|
4205
|
+
// condition under which that choice should be revisited.
|
|
4206
|
+
let compatibilityVisibility = { level: 'none', lines: [] };
|
|
4037
4207
|
if (existsSync(path.join(path.resolve(options.workspaceDir), '.pd', 'state.db'))) {
|
|
4038
4208
|
if (spinner)
|
|
4039
4209
|
updateProgress(spinner, stepIndex, 'Checking workspace rule compatibility...');
|
|
@@ -4043,6 +4213,11 @@ transaction) {
|
|
|
4043
4213
|
logger.error(compat.reason ?? 'legacy_rule_contract_dependency');
|
|
4044
4214
|
return buildCompatibilityRefusalResult(options, compat);
|
|
4045
4215
|
}
|
|
4216
|
+
compatibilityVisibility = summarizeCompatibilityVisibility(compat, options.workspaceDir);
|
|
4217
|
+
if (!quiet) {
|
|
4218
|
+
for (const line of compatibilityVisibility.lines)
|
|
4219
|
+
logger.warn(line);
|
|
4220
|
+
}
|
|
4046
4221
|
}
|
|
4047
4222
|
stepIndex++;
|
|
4048
4223
|
if (spinner)
|
|
@@ -4081,7 +4256,17 @@ transaction) {
|
|
|
4081
4256
|
// host config. A malformed manifest must not be discovered only after the
|
|
4082
4257
|
// old installation has already been replaced (rc-3/rc-9).
|
|
4083
4258
|
const persistedHostsBeforeRun = readPersistedInstallHosts();
|
|
4084
|
-
|
|
4259
|
+
// UPDATE CHAIN (2026-11-11): a host installed outside the manifest (e.g. a
|
|
4260
|
+
// Codex Marketplace plugin added by hand) used to stay on the old release
|
|
4261
|
+
// while the upgrade reported success. Detect every host that already
|
|
4262
|
+
// carries PD and include it in BOTH the manifest record and the refresh
|
|
4263
|
+
// set, so one upgrade brings all hosts forward without uninstall/reinstall.
|
|
4264
|
+
const detectedHostsBeforeRun = detectInstalledHosts();
|
|
4265
|
+
const hostPlan = planUpgradeHosts(options.host, persistedHostsBeforeRun, detectedHostsBeforeRun);
|
|
4266
|
+
installManifestHosts = withDetectedHosts(resolveInstallManifestHosts(options.host), detectedHostsBeforeRun);
|
|
4267
|
+
for (const detectedHost of hostPlan.newlyCovered) {
|
|
4268
|
+
logger.info(`Detected installed host "${detectedHost.hostId}" (${detectedHost.evidence}) — included in this upgrade.`);
|
|
4269
|
+
}
|
|
4085
4270
|
if (installsOpenClaw(options.host))
|
|
4086
4271
|
migrateLegacyPdBackups();
|
|
4087
4272
|
const { backupDir: backupDirFromResult, runtimeBackupDir: runtimeBackupDirFromResult } = backupExistingInstall(options.host);
|
|
@@ -4389,14 +4574,16 @@ transaction) {
|
|
|
4389
4574
|
// next launch (binding_version_mismatch). Refresh them through their real
|
|
4390
4575
|
// host installers here — best effort only: the requested host succeeded,
|
|
4391
4576
|
// and a sibling refresh failure must not roll back the working runtime.
|
|
4392
|
-
const refreshTargets =
|
|
4577
|
+
const { refreshTargets } = hostPlan;
|
|
4578
|
+
const refreshedResults = [];
|
|
4393
4579
|
for (const refreshTarget of refreshTargets) {
|
|
4394
4580
|
if (spinner)
|
|
4395
4581
|
updateProgress(spinner, stepIndex, `Refreshing ${refreshTarget} host binding...`);
|
|
4396
4582
|
const refreshResults = await runHostInstallers(refreshTarget, hostInstallCtx);
|
|
4583
|
+
refreshedResults.push(...refreshResults);
|
|
4397
4584
|
for (const hr of refreshResults) {
|
|
4398
4585
|
if (hr.success) {
|
|
4399
|
-
logger.info(`Host "${hr.hostId}"
|
|
4586
|
+
logger.info(`Host "${hr.hostId}" refresh: ${hr.configAction === 'updated' ? 'updated' : 'no change needed'}${hr.reason ? ` — ${hr.reason}` : ''}.`);
|
|
4400
4587
|
}
|
|
4401
4588
|
else {
|
|
4402
4589
|
// rc-9: never silent — state the reason and the exact recovery step.
|
|
@@ -4404,6 +4591,15 @@ transaction) {
|
|
|
4404
4591
|
}
|
|
4405
4592
|
}
|
|
4406
4593
|
}
|
|
4594
|
+
// UPDATE CHAIN (2026-11-11): one visible line per host this run touched.
|
|
4595
|
+
// First installs and upgrades share it, so an already-installed host being
|
|
4596
|
+
// brought forward can never be silent (Owner report).
|
|
4597
|
+
const hostSummary = summarizeTouchedHosts([...hostResults, ...refreshedResults]);
|
|
4598
|
+
if (hostSummary.length > 0) {
|
|
4599
|
+
logger.info('Install summary:');
|
|
4600
|
+
for (const line of hostSummary)
|
|
4601
|
+
logger.info(` ${line}`);
|
|
4602
|
+
}
|
|
4407
4603
|
// Manual-action hosts (e.g. Codex awaiting the Marketplace step) STAY in
|
|
4408
4604
|
// the install manifest: the manifest records the hosts PD serves on this
|
|
4409
4605
|
// machine (uninstall reads it to decide shared-runtime removal), not a
|
|
@@ -4522,6 +4718,13 @@ transaction) {
|
|
|
4522
4718
|
spinner.warn(`Install partially complete — ${hostManualActions.length} manual step(s) pending (details below)`);
|
|
4523
4719
|
}
|
|
4524
4720
|
}
|
|
4721
|
+
// 5B: the preflight warning scrolls away during a multi-minute install, so
|
|
4722
|
+
// the end summary repeats the zero-visibility block verbatim. This is
|
|
4723
|
+
// still a warning: the install completed and success is unchanged.
|
|
4724
|
+
if (!quiet && compatibilityVisibility.level === 'critical') {
|
|
4725
|
+
for (const line of compatibilityVisibility.lines)
|
|
4726
|
+
logger.warn(line);
|
|
4727
|
+
}
|
|
4525
4728
|
// P0-2: terminate + join the verified child before any later step that
|
|
4526
4729
|
// may touch the runtime tree (here: none destructive, but a wedged child
|
|
4527
4730
|
// must not leak past the install either).
|
|
@@ -4588,6 +4791,8 @@ transaction) {
|
|
|
4588
4791
|
nextAction: nextActions.join(' | '),
|
|
4589
4792
|
consoleUrl: launchResult.consoleUrl,
|
|
4590
4793
|
hostResults,
|
|
4794
|
+
hostSummary,
|
|
4795
|
+
...(compatibilityVisibility.lines.length > 0 ? { compatibilityWarnings: compatibilityVisibility.lines } : {}),
|
|
4591
4796
|
...(manualActionReason !== undefined ? { reason: manualActionReason, manualActions: hostManualActions } : {}),
|
|
4592
4797
|
journal: installerJournalRecord(journal),
|
|
4593
4798
|
};
|