create-principles-disciple 1.152.4 → 1.153.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/_release/product-identity.json +2 -2
- package/agent-skill/pd-setup/SKILL.md +70 -0
- package/codex-adapter/dist/background-selection.d.ts +9 -0
- package/codex-adapter/dist/background-selection.js +142 -0
- package/codex-adapter/dist/ingestion/adaptive-append-state.d.ts +209 -0
- package/codex-adapter/dist/ingestion/adaptive-append-state.js +544 -0
- package/codex-adapter/dist/pd-hook.js +329 -5
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/config/pd-config-store.d.ts +11 -15
- package/console/dist/server/config/pd-config-store.js +92 -17
- package/console/dist/server/models/AdaptiveActivationConsoleModel.d.ts +43 -4
- package/console/dist/server/models/AdaptiveActivationConsoleModel.js +36 -7
- package/console/dist/server/routes/config.js +34 -8
- package/console/dist/web/assets/app.css +6 -0
- package/console/dist/web/assets/app.js +22 -22
- package/core/dist/runtime/activation/sqlite-approval-store.d.ts.map +1 -1
- package/core/dist/runtime/activation/sqlite-approval-store.js +7 -1
- package/core/dist/runtime/activation/sqlite-approval-store.js.map +1 -1
- package/core/dist/runtime/config/pd-config-feature-flags.d.ts +10 -0
- package/core/dist/runtime/config/pd-config-feature-flags.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-feature-flags.js +14 -0
- package/core/dist/runtime/config/pd-config-feature-flags.js.map +1 -1
- package/core/dist/runtime/config/pd-config-types.d.ts +9 -0
- package/core/dist/runtime/config/pd-config-types.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-types.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 +10 -2
- package/core/dist/runtime/config/pd-config-validate.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 +13 -2
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/dist/runtime/intent/intent-doc.d.ts +22 -0
- package/core/dist/runtime/intent/intent-doc.d.ts.map +1 -1
- package/core/dist/runtime/intent/intent-doc.js +79 -0
- package/core/dist/runtime/intent/intent-doc.js.map +1 -1
- package/core/dist/runtime/intent/intent-friction-block.d.ts +7 -0
- package/core/dist/runtime/intent/intent-friction-block.d.ts.map +1 -1
- package/core/dist/runtime/intent/intent-friction-block.js +34 -1
- package/core/dist/runtime/intent/intent-friction-block.js.map +1 -1
- package/core/dist/runtime/intent/intent-snapshot.d.ts +44 -5
- package/core/dist/runtime/intent/intent-snapshot.d.ts.map +1 -1
- package/core/dist/runtime/intent/intent-snapshot.js +83 -15
- package/core/dist/runtime/intent/intent-snapshot.js.map +1 -1
- package/core/dist/runtime/intent/strategic-conflict-gate.d.ts +19 -0
- package/core/dist/runtime/intent/strategic-conflict-gate.d.ts.map +1 -1
- package/core/dist/runtime/intent/strategic-conflict-gate.js +94 -26
- package/core/dist/runtime/intent/strategic-conflict-gate.js.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +22 -11
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.js +101 -28
- package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
- package/core/dist/runtime/internalization/dreamer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/dreamer-prompt-builder.js +1 -0
- package/core/dist/runtime/internalization/dreamer-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/dreamer-runner.d.ts +9 -2
- package/core/dist/runtime/internalization/dreamer-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/dreamer-runner.js +11 -1
- package/core/dist/runtime/internalization/dreamer-runner.js.map +1 -1
- package/core/dist/runtime/internalization/evaluator-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/evaluator-runner.js +7 -0
- package/core/dist/runtime/internalization/evaluator-runner.js.map +1 -1
- package/core/dist/runtime/internalization/formation-context.d.ts +16 -0
- package/core/dist/runtime/internalization/formation-context.d.ts.map +1 -1
- package/core/dist/runtime/internalization/formation-context.js +109 -8
- package/core/dist/runtime/internalization/formation-context.js.map +1 -1
- package/core/dist/runtime/internalization/index.d.ts +2 -2
- package/core/dist/runtime/internalization/index.d.ts.map +1 -1
- package/core/dist/runtime/internalization/index.js +1 -1
- package/core/dist/runtime/internalization/index.js.map +1 -1
- package/core/dist/runtime/internalization/intent-contract.d.ts +55 -4
- package/core/dist/runtime/internalization/intent-contract.d.ts.map +1 -1
- package/core/dist/runtime/internalization/intent-contract.js +111 -30
- package/core/dist/runtime/internalization/intent-contract.js.map +1 -1
- package/core/dist/runtime/internalization/philosopher-runner.d.ts +9 -2
- package/core/dist/runtime/internalization/philosopher-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/philosopher-runner.js +11 -1
- package/core/dist/runtime/internalization/philosopher-runner.js.map +1 -1
- package/core/dist/runtime/internalization/scribe-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/scribe-runner.js +17 -7
- package/core/dist/runtime/internalization/scribe-runner.js.map +1 -1
- package/core/dist/runtime/store/intent/sqlite-intent-decision-store.d.ts +10 -0
- package/core/dist/runtime/store/intent/sqlite-intent-decision-store.d.ts.map +1 -1
- package/core/dist/runtime/store/intent/sqlite-intent-decision-store.js +15 -4
- package/core/dist/runtime/store/intent/sqlite-intent-decision-store.js.map +1 -1
- package/core/dist/telemetry-event.d.ts +2 -2
- package/core/dist/telemetry-event.d.ts.map +1 -1
- package/core/dist/telemetry-event.js +6 -0
- package/core/dist/telemetry-event.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/agent-skill.d.ts +59 -0
- package/dist/agent-skill.d.ts.map +1 -0
- package/dist/agent-skill.js +198 -0
- package/dist/agent-skill.js.map +1 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +12 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +171 -3
- package/dist/index.js.map +1 -1
- package/dist/install-summary.d.ts +52 -0
- package/dist/install-summary.d.ts.map +1 -1
- package/dist/install-summary.js +104 -0
- package/dist/install-summary.js.map +1 -1
- package/dist/update/release-metadata-publisher.d.ts +3 -1
- package/dist/update/release-metadata-publisher.d.ts.map +1 -1
- package/dist/update/release-metadata-publisher.js +33 -2
- package/dist/update/release-metadata-publisher.js.map +1 -1
- package/dist/update/trust-metadata.d.ts +21 -0
- package/dist/update/trust-metadata.d.ts.map +1 -1
- package/dist/update/trust-metadata.js +192 -4
- package/dist/update/trust-metadata.js.map +1 -1
- package/host-runtime/dist/adaptive-background-append.d.ts +70 -0
- package/host-runtime/dist/adaptive-background-append.js +165 -0
- package/host-runtime/dist/index.d.ts +1 -0
- package/host-runtime/dist/index.js +5 -0
- package/host-runtime/package.json +1 -1
- package/package.json +3 -2
- package/pd-cli/dist/commands/health-console.d.ts +21 -0
- package/pd-cli/dist/commands/health-console.d.ts.map +1 -0
- package/pd-cli/dist/commands/health-console.js +106 -0
- package/pd-cli/dist/commands/health-console.js.map +1 -0
- package/pd-cli/dist/commands/health.d.ts +159 -0
- package/pd-cli/dist/commands/health.d.ts.map +1 -1
- package/pd-cli/dist/commands/health.js +162 -2
- package/pd-cli/dist/commands/health.js.map +1 -1
- package/pd-cli/dist/commands/mcp-probe.d.ts +48 -0
- package/pd-cli/dist/commands/mcp-probe.d.ts.map +1 -0
- package/pd-cli/dist/commands/mcp-probe.js +479 -0
- package/pd-cli/dist/commands/mcp-probe.js.map +1 -0
- package/pd-cli/dist/commands/runtime-internalization-run-once.js +2 -2
- package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/pd-cli/dist/program.d.ts.map +1 -1
- package/pd-cli/dist/program.js +57 -0
- package/pd-cli/dist/program.js.map +1 -1
- package/pd-cli/dist/services/console-launcher.d.ts +3 -0
- package/pd-cli/dist/services/console-launcher.d.ts.map +1 -1
- package/pd-cli/dist/services/console-launcher.js +3 -2
- package/pd-cli/dist/services/console-launcher.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +533 -449
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/dist/i18n.js +12 -0
- package/release-manager/dist/update/trust-metadata.js +192 -4
- package/release-manager/package.json +2 -1
- package/workbuddy-adapter/dist/pd-hook.js +37 -3
- package/workbuddy-adapter/package.json +1 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PRI-1196 — Adaptive Activation, background selection (Codex desktop).
|
|
3
|
+
*
|
|
4
|
+
* The synchronous path decides BEFORE the first model request. This module is
|
|
5
|
+
* the asynchronous counterpart: the first request already left as Native, and
|
|
6
|
+
* the decision runs in a detached process. It reuses the SAME candidate read,
|
|
7
|
+
* skip gate, decision protocol, authorization revalidation and capacity
|
|
8
|
+
* measurement as the synchronous path; only the orchestration differs.
|
|
9
|
+
*
|
|
10
|
+
* Append-only by construction: the feasible gap is the budget the sent Native
|
|
11
|
+
* did NOT use, and the target is never offered a replacement slot. The chosen
|
|
12
|
+
* directive is rendered for a LATER request of the same turn.
|
|
13
|
+
*/
|
|
14
|
+
import { createHash } from 'node:crypto';
|
|
15
|
+
import { escapeXml } from '@principles/core/prompt-builder';
|
|
16
|
+
import { measureSharedDirectiveBlockChars, renderPrinciplesToDirectives, } from '@principles/core/runtime';
|
|
17
|
+
import { readPromptActivationCandidates } from './active-principle-prompt.js';
|
|
18
|
+
import { revalidateAdaptivePrinciple } from './adaptive-principle-revalidation.js';
|
|
19
|
+
import { createAdaptivePriorityProviderForConfig, } from './adaptive-priority-provider.js';
|
|
20
|
+
import { loadPdConfigForPlugin } from './pd-config.js';
|
|
21
|
+
export function fingerprintAdaptiveAppendRevision(principle) {
|
|
22
|
+
if (!principle.artifactContentSha256)
|
|
23
|
+
return null;
|
|
24
|
+
return createHash('sha256').update(JSON.stringify([
|
|
25
|
+
principle.artifactContentSha256, principle.text, principle.authority, principle.approvedBy,
|
|
26
|
+
])).digest('hex');
|
|
27
|
+
}
|
|
28
|
+
/** The one directive body, identical to what the shared packer would render. */
|
|
29
|
+
export function renderAppendDirective(principle) {
|
|
30
|
+
const rendered = renderPrinciplesToDirectives([principle], new Set([principle.principleId]), { escapeFn: escapeXml });
|
|
31
|
+
const start = rendered.indexOf('<directive ');
|
|
32
|
+
const end = rendered.indexOf('</directive>');
|
|
33
|
+
if (start < 0 || end < 0)
|
|
34
|
+
return null;
|
|
35
|
+
return rendered.slice(start, end + '</directive>'.length);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Runs ONE background selection for a turn whose Native request already left.
|
|
39
|
+
*
|
|
40
|
+
* Returns `selected` only when the shared measurement proves the target fits
|
|
41
|
+
* the budget Native did not use, and the shared revalidator proves the exact
|
|
42
|
+
* authorized revision still holds at decision time.
|
|
43
|
+
*/
|
|
44
|
+
export async function runAdaptiveBackgroundSelection(input) {
|
|
45
|
+
let diagnostic = { status: 'skipped', reason: 'no_appendable_gap', sends: 0 };
|
|
46
|
+
const config = loadPdConfigForPlugin(input.workspaceDir);
|
|
47
|
+
if (!config.ok) {
|
|
48
|
+
return { status: 'unavailable', reason: 'config_invalid', diagnostic: { status: 'unavailable', reason: 'config_invalid', sends: 0 } };
|
|
49
|
+
}
|
|
50
|
+
const candidates = await readPromptActivationCandidates({ workspaceDir: input.workspaceDir, includeAuthority: true });
|
|
51
|
+
if (candidates.aborted || candidates.warnings.length > 0) {
|
|
52
|
+
const reason = candidates.aborted ? 'reader_aborted' : 'reader_warnings';
|
|
53
|
+
return { status: 'unavailable', reason, diagnostic: { status: 'unavailable', reason, sends: 0 } };
|
|
54
|
+
}
|
|
55
|
+
const nativeIds = new Set(input.nativeActivationIds);
|
|
56
|
+
const omitted = candidates.principles.filter((principle) => !nativeIds.has(principle.activationId));
|
|
57
|
+
const renderOptions = { escapeFn: escapeXml, selfReportInstruction: candidates.selfReportEnabled };
|
|
58
|
+
const remaining = input.budgetChars - input.nativeChars;
|
|
59
|
+
const feasible = remaining > 0
|
|
60
|
+
? omitted.filter((principle) => measureSharedDirectiveBlockChars(principle, renderOptions) <= remaining)
|
|
61
|
+
: [];
|
|
62
|
+
if (feasible.length === 0) {
|
|
63
|
+
return { status: 'skipped', reason: 'no_appendable_gap', diagnostic };
|
|
64
|
+
}
|
|
65
|
+
const resolution = createAdaptivePriorityProviderForConfig(config.effective.config, input.workspaceDir, {
|
|
66
|
+
...(input.env ? { env: input.env } : {}),
|
|
67
|
+
...(input.fetchImpl ? { fetchImpl: input.fetchImpl } : {}),
|
|
68
|
+
...(input.now ? { now: input.now } : {}),
|
|
69
|
+
outerDeadlineAt: input.deadlineAt,
|
|
70
|
+
// Nothing needs to be reserved for a second assembly: the directive is
|
|
71
|
+
// already rendered by the time the process exits.
|
|
72
|
+
outputReserveMs: 0,
|
|
73
|
+
onDiagnostic: (line) => {
|
|
74
|
+
diagnostic = { status: line.status, reason: line.reason, sends: line.sends };
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
if (!resolution.ok) {
|
|
78
|
+
return {
|
|
79
|
+
status: 'skipped',
|
|
80
|
+
reason: `needs_setup:${resolution.reason}`,
|
|
81
|
+
diagnostic: { status: 'needs_setup', reason: resolution.reason, sends: 0 },
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// The provider only needs the host-supplied turn identity and prompt body.
|
|
85
|
+
const event = {
|
|
86
|
+
kind: 'before_prompt_build',
|
|
87
|
+
source: 'codex:adaptive_background_selection',
|
|
88
|
+
rawPayload: null,
|
|
89
|
+
context: {
|
|
90
|
+
workspaceDir: input.workspaceDir,
|
|
91
|
+
sessionId: input.sessionId,
|
|
92
|
+
turnId: input.turnId,
|
|
93
|
+
promptContent: input.promptContent,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
const selection = await resolution.provider(event, feasible, {
|
|
97
|
+
excludedByBudget: feasible.length < omitted.length,
|
|
98
|
+
// Background mode is append-only: never offer a replacement slot.
|
|
99
|
+
replacementByActivationId: new Map(),
|
|
100
|
+
});
|
|
101
|
+
if (!selection) {
|
|
102
|
+
return { status: 'skipped', reason: diagnostic.reason, diagnostic };
|
|
103
|
+
}
|
|
104
|
+
const selected = feasible.find((principle) => principle.activationId === selection.activationId
|
|
105
|
+
&& principle.artifactId === selection.artifactId);
|
|
106
|
+
if (!selected) {
|
|
107
|
+
return { status: 'unavailable', reason: 'selection_target_missing', diagnostic };
|
|
108
|
+
}
|
|
109
|
+
const revalidationBudgetMs = Math.max(1, Math.min(1500, input.deadlineAt - (input.now?.() ?? Date.now())));
|
|
110
|
+
if (!await revalidateAdaptivePrinciple(input.workspaceDir, selected, AbortSignal.timeout(revalidationBudgetMs))) {
|
|
111
|
+
return { status: 'unavailable', reason: 'target_changed', diagnostic };
|
|
112
|
+
}
|
|
113
|
+
const revisionFingerprint = fingerprintAdaptiveAppendRevision(selected);
|
|
114
|
+
if (!revisionFingerprint)
|
|
115
|
+
return { status: 'unavailable', reason: 'target_changed', diagnostic };
|
|
116
|
+
const directive = renderAppendDirective(selected);
|
|
117
|
+
if (directive === null) {
|
|
118
|
+
return { status: 'unavailable', reason: 'target_render_failed', diagnostic };
|
|
119
|
+
}
|
|
120
|
+
if (input.nativeChars + directive.length > input.budgetChars) {
|
|
121
|
+
return { status: 'unavailable', reason: 'budget_exhausted', diagnostic };
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
status: 'selected',
|
|
125
|
+
target: {
|
|
126
|
+
principleId: selected.principleId,
|
|
127
|
+
activationId: selected.activationId,
|
|
128
|
+
artifactId: selected.artifactId,
|
|
129
|
+
revisionFingerprint,
|
|
130
|
+
},
|
|
131
|
+
directive,
|
|
132
|
+
diagnostic,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Consume-time revalidation. Runs in the LATER hook process and therefore
|
|
137
|
+
* proves the authorization/body facts again — a background decision is not a
|
|
138
|
+
* license to append a revision that changed while the turn was running.
|
|
139
|
+
*/
|
|
140
|
+
export async function renderAcceptedAdaptiveAppend(input) {
|
|
141
|
+
const read = await readPromptActivationCandidates({
|
|
142
|
+
workspaceDir: input.workspaceDir,
|
|
143
|
+
includeAuthority: true,
|
|
144
|
+
noBusyWait: true,
|
|
145
|
+
});
|
|
146
|
+
if (read.aborted || read.warnings.length > 0)
|
|
147
|
+
return { ok: false, reason: 'authority_unavailable' };
|
|
148
|
+
const matches = read.principles.filter((principle) => principle.activationId === input.target.activationId && principle.artifactId === input.target.artifactId);
|
|
149
|
+
if (matches.length !== 1)
|
|
150
|
+
return { ok: false, reason: 'target_unavailable' };
|
|
151
|
+
const [principle] = matches;
|
|
152
|
+
if (!principle
|
|
153
|
+
|| principle.principleId !== input.target.principleId
|
|
154
|
+
|| fingerprintAdaptiveAppendRevision(principle) !== input.target.revisionFingerprint
|
|
155
|
+
|| read.principles.filter((candidate) => candidate.principleId === principle.principleId).length !== 1) {
|
|
156
|
+
return { ok: false, reason: 'target_changed' };
|
|
157
|
+
}
|
|
158
|
+
if (!await revalidateAdaptivePrinciple(input.workspaceDir, principle, input.signal)) {
|
|
159
|
+
return { ok: false, reason: 'target_changed' };
|
|
160
|
+
}
|
|
161
|
+
const directive = renderAppendDirective(principle);
|
|
162
|
+
if (directive === null)
|
|
163
|
+
return { ok: false, reason: 'target_render_failed' };
|
|
164
|
+
return { ok: true, directive, principle };
|
|
165
|
+
}
|
|
@@ -24,6 +24,7 @@ export * from './governance-signal-admission.js';
|
|
|
24
24
|
export * from './signal-classifier.js';
|
|
25
25
|
export * from './adaptive-selection.js';
|
|
26
26
|
export * from './adaptive-priority-provider.js';
|
|
27
|
+
export * from './adaptive-background-append.js';
|
|
27
28
|
export * from './signal-stage2-cycle.js';
|
|
28
29
|
export * from './host-liveness-contract.js';
|
|
29
30
|
export * from './internalization-consumer-governance.js';
|
|
@@ -43,6 +43,11 @@ export * from './governance-signal-admission.js';
|
|
|
43
43
|
export * from './signal-classifier.js';
|
|
44
44
|
export * from './adaptive-selection.js';
|
|
45
45
|
export * from './adaptive-priority-provider.js';
|
|
46
|
+
// PRI-1196: background (async) Adaptive selection for the Codex host. Reuses
|
|
47
|
+
// the same candidates/gate/protocol/revalidation/capacity primitives; the
|
|
48
|
+
// first request goes out as Native and one directive may be appended later in
|
|
49
|
+
// the same turn.
|
|
50
|
+
export * from './adaptive-background-append.js';
|
|
46
51
|
export * from './signal-stage2-cycle.js';
|
|
47
52
|
export * from './host-liveness-contract.js';
|
|
48
53
|
// PRI-624 Slice C: shared internalization consumer execution (OpenClaw
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-principles-disciple",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.153.0",
|
|
4
4
|
"description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"dist",
|
|
22
|
+
"agent-skill",
|
|
22
23
|
"plugin",
|
|
23
24
|
"pd-cli",
|
|
24
25
|
"console",
|
|
@@ -101,5 +102,5 @@
|
|
|
101
102
|
"pd": {
|
|
102
103
|
"bundledPluginVersion": "2.2.13"
|
|
103
104
|
},
|
|
104
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "97cac4b30eb64ad4b369d2f86f5c57a8053897eb"
|
|
105
106
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ConsoleHealthSection {
|
|
2
|
+
status: 'installed_running' | 'installed_not_running' | 'not_installed' | 'broken';
|
|
3
|
+
dir: string | null;
|
|
4
|
+
entry: string | null;
|
|
5
|
+
webIndex: string | null;
|
|
6
|
+
/** First broken runtime-dependency slot description (checkConsoleRuntimeDependencies). */
|
|
7
|
+
integrity: string | null;
|
|
8
|
+
running: {
|
|
9
|
+
url: string | null;
|
|
10
|
+
port: number | null;
|
|
11
|
+
};
|
|
12
|
+
reason?: string;
|
|
13
|
+
nextAction?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Assess the installed console for a PD home dir. Port scanning only READS:
|
|
17
|
+
* isPortInUse + probeConsoleHealth (both carry global mock hooks used by the
|
|
18
|
+
* tests — no bespoke injection seam needed).
|
|
19
|
+
*/
|
|
20
|
+
export declare function assessConsole(homeDirInput: string): Promise<ConsoleHealthSection>;
|
|
21
|
+
//# sourceMappingURL=health-console.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-console.d.ts","sourceRoot":"","sources":["../../src/commands/health-console.ts"],"names":[],"mappings":"AAsCA,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,mBAAmB,GAAG,uBAAuB,GAAG,eAAe,GAAG,QAAQ,CAAC;IACnF,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0FAA0F;IAC1F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA2BD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoDvF"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Console install/liveness section for `pd health` — the console sibling of
|
|
3
|
+
* health-mcp.ts. Read-only: health never STARTS the console (the same boundary
|
|
4
|
+
* that keeps the MCP section from spawning the server); the active complement
|
|
5
|
+
* for full startup is `pd console open` / the installer's verify step.
|
|
6
|
+
*
|
|
7
|
+
* Resolution uses the SAME install-layout authorities as `pd console`
|
|
8
|
+
* (resolveInstallLayout + getConsoleServerEntry/getConsoleWebIndex), so there
|
|
9
|
+
* is one resolution truth; integrity reuses checkConsoleRuntimeDependencies
|
|
10
|
+
* (the exact slots the console server imports at startup).
|
|
11
|
+
*
|
|
12
|
+
* Status ladder:
|
|
13
|
+
* - not_installed — no install manifest/runtime for this home (neutral)
|
|
14
|
+
* - installed_running — a healthy console answered /api/health in the
|
|
15
|
+
* default port window (neutral-healthy)
|
|
16
|
+
* - installed_not_running — installed and intact, nobody started it (the
|
|
17
|
+
* NORMAL on-demand state; neutral)
|
|
18
|
+
* - broken — entry/web bundle missing or a runtime-dependency
|
|
19
|
+
* slot is broken: a real install-integrity defect
|
|
20
|
+
* (health exit-code failure, PRI-1130 grade).
|
|
21
|
+
*/
|
|
22
|
+
import * as fs from 'fs';
|
|
23
|
+
import * as path from 'path';
|
|
24
|
+
import { getConsoleServerEntry, getConsoleWebIndex, getInstallLayoutPaths, resolveInstallLayout, } from '@principles/install-layout';
|
|
25
|
+
import { buildConsoleUrl, DEFAULT_PORT, isPortInUse, PORT_FALLBACK_LIMIT, probeConsoleHealth, } from '../services/console-launcher.js';
|
|
26
|
+
import { checkConsoleRuntimeDependencies } from './console.js';
|
|
27
|
+
const CONSOLE_SCAN_HOST = '127.0.0.1';
|
|
28
|
+
/**
|
|
29
|
+
* The default port window `pd console open` binds/falls back through —
|
|
30
|
+
* derived from the launcher's own constants so the window has ONE authority
|
|
31
|
+
* (P4): if the launcher window ever changes, this scan follows it.
|
|
32
|
+
*/
|
|
33
|
+
const CONSOLE_SCAN_PORTS = Array.from({ length: PORT_FALLBACK_LIMIT }, (_, i) => DEFAULT_PORT + i);
|
|
34
|
+
const CONSOLE_PROBE_TIMEOUT_MS = 800;
|
|
35
|
+
function notInstalled(reason) {
|
|
36
|
+
return {
|
|
37
|
+
status: 'not_installed',
|
|
38
|
+
dir: null,
|
|
39
|
+
entry: null,
|
|
40
|
+
webIndex: null,
|
|
41
|
+
integrity: null,
|
|
42
|
+
running: { url: null, port: null },
|
|
43
|
+
reason,
|
|
44
|
+
nextAction: 'Run: npx create-principles-disciple',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Assess the installed console for a PD home dir. Port scanning only READS:
|
|
49
|
+
* isPortInUse + probeConsoleHealth (both carry global mock hooks used by the
|
|
50
|
+
* tests — no bespoke injection seam needed).
|
|
51
|
+
*/
|
|
52
|
+
export async function assessConsole(homeDirInput) {
|
|
53
|
+
// CWE-22 guard: normalize the home dir and require an absolute path.
|
|
54
|
+
const homeDir = path.resolve(homeDirInput);
|
|
55
|
+
if (!path.isAbsolute(homeDir)) {
|
|
56
|
+
return notInstalled('home dir is not absolute');
|
|
57
|
+
}
|
|
58
|
+
const paths = getInstallLayoutPaths(homeDir);
|
|
59
|
+
let manifest;
|
|
60
|
+
try {
|
|
61
|
+
manifest = JSON.parse(fs.readFileSync(paths.manifest, 'utf8'));
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
manifest = undefined;
|
|
65
|
+
}
|
|
66
|
+
const resolved = resolveInstallLayout({
|
|
67
|
+
homeDir,
|
|
68
|
+
manifest,
|
|
69
|
+
canonicalRuntimeExists: fs.existsSync(paths.runtimeDir),
|
|
70
|
+
legacyExtensionExists: fs.existsSync(paths.openClawExtensionDir),
|
|
71
|
+
});
|
|
72
|
+
if (resolved.mode === 'missing')
|
|
73
|
+
return notInstalled('no install manifest / runtime found');
|
|
74
|
+
const entry = getConsoleServerEntry(paths, resolved.mode);
|
|
75
|
+
const webIndex = getConsoleWebIndex(paths, resolved.mode);
|
|
76
|
+
const base = {
|
|
77
|
+
status: 'installed_not_running',
|
|
78
|
+
dir: resolved.mode === 'canonical' ? paths.consoleDir : path.join(paths.openClawExtensionDir, 'console'),
|
|
79
|
+
entry,
|
|
80
|
+
webIndex,
|
|
81
|
+
integrity: null,
|
|
82
|
+
running: { url: null, port: null },
|
|
83
|
+
};
|
|
84
|
+
if (!fs.existsSync(entry)) {
|
|
85
|
+
return { ...base, status: 'broken', reason: 'console_server_entry_missing', nextAction: `Re-run installer: npx create-principles-disciple (expected ${entry})` };
|
|
86
|
+
}
|
|
87
|
+
if (!fs.existsSync(webIndex)) {
|
|
88
|
+
return { ...base, status: 'broken', reason: 'console_web_ui_missing', nextAction: `Re-run installer: npx create-principles-disciple (expected ${webIndex})` };
|
|
89
|
+
}
|
|
90
|
+
const dir = base.dir;
|
|
91
|
+
const integrityError = checkConsoleRuntimeDependencies(dir);
|
|
92
|
+
if (integrityError) {
|
|
93
|
+
return { ...base, status: 'broken', reason: 'console_runtime_dependency_broken', integrity: integrityError, nextAction: `Re-run installer: npx create-principles-disciple (${integrityError})` };
|
|
94
|
+
}
|
|
95
|
+
for (const port of CONSOLE_SCAN_PORTS) {
|
|
96
|
+
if (!(await isPortInUse(CONSOLE_SCAN_HOST, port)))
|
|
97
|
+
continue;
|
|
98
|
+
const health = await probeConsoleHealth({ host: CONSOLE_SCAN_HOST, port, timeoutMs: CONSOLE_PROBE_TIMEOUT_MS });
|
|
99
|
+
if (health.healthy) {
|
|
100
|
+
return { ...base, status: 'installed_running', running: { url: buildConsoleUrl(CONSOLE_SCAN_HOST, port), port } };
|
|
101
|
+
}
|
|
102
|
+
// Occupied by something that is not a healthy console — keep scanning.
|
|
103
|
+
}
|
|
104
|
+
return base;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=health-console.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-console.js","sourceRoot":"","sources":["../../src/commands/health-console.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,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EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,wBAAwB,EAAE,UAAU,EAAE,8DAA8D,QAAQ,GAAG,EAAE,CAAC;IAChK,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAa,CAAC;IAC/B,MAAM,cAAc,GAAG,+BAA+B,CAAC,GAAG,CAAC,CAAC;IAC5D,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,mCAAmC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,qDAAqD,cAAc,GAAG,EAAE,CAAC;IACnM,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;QACtC,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;YAAE,SAAS;QAC5D,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC,CAAC;QAChH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,iBAAiB,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;QACpH,CAAC;QACD,uEAAuE;IACzE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -8,7 +8,166 @@
|
|
|
8
8
|
* Uses read models from @principles/core/runtime (no direct ledger access).
|
|
9
9
|
*/
|
|
10
10
|
import type { Command } from 'commander';
|
|
11
|
+
import { type ConsoleHealthSection } from './health-console.js';
|
|
12
|
+
import type { DegradedEnforcementReading } from '@principles/host-runtime';
|
|
11
13
|
import { handleHealthCodex } from './health-codex.js';
|
|
14
|
+
import type { McpHealthSection, McpHostSelection } from './health-mcp.js';
|
|
15
|
+
import type { WorkbuddyHostFacts } from './health-workbuddy.js';
|
|
16
|
+
import type { IngestionHealthSection } from './health-ingestion.js';
|
|
17
|
+
interface LastSuccessfulChain {
|
|
18
|
+
painId?: string;
|
|
19
|
+
taskId: string;
|
|
20
|
+
runId: string;
|
|
21
|
+
artifactId: string;
|
|
22
|
+
candidateIds: string[];
|
|
23
|
+
ledgerEntryIds: string[];
|
|
24
|
+
latencyMs?: {
|
|
25
|
+
totalMs?: number;
|
|
26
|
+
};
|
|
27
|
+
failureCategory: string | null;
|
|
28
|
+
checkedAt: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* PRI-662: reliability readiness — the post-upgrade validation surface.
|
|
32
|
+
* Reads the SAME durable host declarations and uses the SAME resolver /
|
|
33
|
+
* evaluator runtime-context builder as the production activation and
|
|
34
|
+
* evaluator replay paths, so "replay: ready" here means exactly "the
|
|
35
|
+
* replay the gate will run is constructible" — no parallel truth.
|
|
36
|
+
*/
|
|
37
|
+
interface ReliabilityHealth {
|
|
38
|
+
registry: {
|
|
39
|
+
status: 'ok' | 'degraded';
|
|
40
|
+
hosts: string[];
|
|
41
|
+
declaredTools: number;
|
|
42
|
+
};
|
|
43
|
+
resolver: 'ready' | 'not_ready';
|
|
44
|
+
replay: 'ready' | 'not_ready';
|
|
45
|
+
reason?: string;
|
|
46
|
+
nextAction?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface HealthSummaryItem {
|
|
49
|
+
status: 'ok' | 'attention' | 'error' | 'not_applicable';
|
|
50
|
+
detail?: string;
|
|
51
|
+
nextAction?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface HealthSummary {
|
|
54
|
+
overall: 'healthy' | 'attention' | 'error';
|
|
55
|
+
/** The CLI answering this command IS the witness (self-evident, no probe). */
|
|
56
|
+
cli: {
|
|
57
|
+
status: 'ok';
|
|
58
|
+
note: string;
|
|
59
|
+
};
|
|
60
|
+
mcp: HealthSummaryItem;
|
|
61
|
+
console: HealthSummaryItem;
|
|
62
|
+
skills: HealthSummaryItem;
|
|
63
|
+
/** Whether any host has started and declared tools since install (host-tool-semantics). */
|
|
64
|
+
hostLoaded: HealthSummaryItem;
|
|
65
|
+
restart: HealthSummaryItem;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Pure derivation — every item reads its OWN witness field on the health
|
|
69
|
+
* report; nothing is inferred from a sibling section. Exit-1 grades that are
|
|
70
|
+
* not summary items (ledger consistency, enforcement) still gate `overall` so
|
|
71
|
+
* the summary can never read 'healthy' on a report that exits 1.
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildHealthSummary(health: Pick<WorkspaceHealth, 'mcp' | 'console' | 'reliability' | 'candidateLedgerConsistency' | 'enforcement'>): HealthSummary;
|
|
74
|
+
interface WorkspaceHealth {
|
|
75
|
+
generatedAt: string;
|
|
76
|
+
workspace: string;
|
|
77
|
+
partialHealth?: boolean;
|
|
78
|
+
pdStateDb: {
|
|
79
|
+
path: string;
|
|
80
|
+
exists: boolean;
|
|
81
|
+
};
|
|
82
|
+
ledger: {
|
|
83
|
+
path: string;
|
|
84
|
+
exists: boolean;
|
|
85
|
+
totalPrinciples: number;
|
|
86
|
+
byStatus: Record<string, number>;
|
|
87
|
+
};
|
|
88
|
+
candidates: {
|
|
89
|
+
total: number;
|
|
90
|
+
consumed: number;
|
|
91
|
+
pending: number;
|
|
92
|
+
};
|
|
93
|
+
tasks: {
|
|
94
|
+
total: number;
|
|
95
|
+
byStatus: Record<string, number>;
|
|
96
|
+
};
|
|
97
|
+
candidateLedgerConsistency: {
|
|
98
|
+
status: 'ok' | 'degraded';
|
|
99
|
+
missing: number;
|
|
100
|
+
};
|
|
101
|
+
reliability: ReliabilityHealth;
|
|
102
|
+
/**
|
|
103
|
+
* PRI-1210: durable degraded-enforcement marker read (`~/.pd/enforcement-health/`).
|
|
104
|
+
* Three states — `healthy` (no marker), `degraded` (enforcement fail-opened at
|
|
105
|
+
* least once; reason + first/last seen), `unknown` (marker unreadable or
|
|
106
|
+
* malformed). `unknown` is never reported as healthy and never as 0.
|
|
107
|
+
*/
|
|
108
|
+
enforcement: DegradedEnforcementReading;
|
|
109
|
+
/**
|
|
110
|
+
* PRI-1071 Gate 4 / PRI-1130: shared MCP lifecycle diagnostics (binding,
|
|
111
|
+
* install, version, host config, declared-entry integrity, restart) for the
|
|
112
|
+
* selected host. Read-only and independent of the ledger, but a broken host
|
|
113
|
+
* install IS a health failure: a non-HEALTHY MCP section sets exit code 1 so
|
|
114
|
+
* exit-code-only automation cannot mistake a missing payload file for success.
|
|
115
|
+
* HOST_NOT_FOUND / NOT_INSTALLED stay exit-code neutral (not a defect).
|
|
116
|
+
*/
|
|
117
|
+
mcp: McpHealthSection;
|
|
118
|
+
/**
|
|
119
|
+
* PRI-1186: how the MCP host was chosen. Without --host the serving
|
|
120
|
+
* binding (mcp-binding.json workspaceDir) selects the host; an unresolvable
|
|
121
|
+
* or ambiguous workspace keeps the openclaw default and says so here, so
|
|
122
|
+
* the MCP section is never silently about the wrong host.
|
|
123
|
+
*/
|
|
124
|
+
mcpHostSelection: McpHostSelection;
|
|
125
|
+
/**
|
|
126
|
+
* PRI-939 Option A: last semantic reuse evaluation degradation read from the
|
|
127
|
+
* workspace's own critical-events.jsonl (same durable sink the gate writes).
|
|
128
|
+
* Read-only summary — the authority stays the event file itself.
|
|
129
|
+
*/
|
|
130
|
+
reuseEvaluation: ReuseEvaluationHealth;
|
|
131
|
+
lastSuccessfulChain?: LastSuccessfulChain;
|
|
132
|
+
/**
|
|
133
|
+
* 2026-11-07 (WorkBuddy host-fact truthfulness): the FOUR independent host
|
|
134
|
+
* facts — plugin registration, plugin enablement, governance flag, runtime
|
|
135
|
+
* truthfulness — present ONLY for `pd health --host workbuddy`. Read-only;
|
|
136
|
+
* none of the facts is inferred from the MCP section, and the runtime
|
|
137
|
+
* boundary (probe never performed, model tool call not verified) is stated
|
|
138
|
+
* explicitly instead of implied.
|
|
139
|
+
*/
|
|
140
|
+
workbuddyHostFacts?: WorkbuddyHostFacts;
|
|
141
|
+
/**
|
|
142
|
+
* PRI-1171 ticket ⑦: unified three-host conversation-ingestion health
|
|
143
|
+
* (SPEC v0.2 §6, TD §9). Host-neutral section embedded in the main report;
|
|
144
|
+
* the `--host codex` path keeps its own detailed governance report. Every
|
|
145
|
+
* degraded field carries reason + nextAction (rc-9); openclaw is an
|
|
146
|
+
* explicit `not_wired` row until P3 ticket ⑨ wires its live bypass.
|
|
147
|
+
*/
|
|
148
|
+
ingestion: IngestionHealthSection;
|
|
149
|
+
/**
|
|
150
|
+
* Console install/liveness facts for the resolved PD home. Read-only (health
|
|
151
|
+
* never starts the console); `installed_not_running` is the normal on-demand
|
|
152
|
+
* state, `broken` fails the health exit code (broken install = health
|
|
153
|
+
* failure, same grade as the MCP section's non-neutral defects).
|
|
154
|
+
*/
|
|
155
|
+
console: ConsoleHealthSection;
|
|
156
|
+
/**
|
|
157
|
+
* Derived agent acceptance view (post-install QA): one verdict per
|
|
158
|
+
* component (cli/mcp/console/skills/hostLoaded/restart) + overall. Pure
|
|
159
|
+
* derivation from the sections above — never a second truth (P4).
|
|
160
|
+
*/
|
|
161
|
+
summary: HealthSummary;
|
|
162
|
+
}
|
|
163
|
+
interface ReuseEvaluationHealth {
|
|
164
|
+
criticalEventsFile: string;
|
|
165
|
+
lastUnavailable?: {
|
|
166
|
+
at: string;
|
|
167
|
+
candidateId?: string;
|
|
168
|
+
reason: string;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
12
171
|
interface HealthOptions {
|
|
13
172
|
workspace?: string;
|
|
14
173
|
json?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/commands/health.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