create-principles-disciple 1.153.0 → 1.153.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/console/dist/server/models/ActivationsConsoleModel.d.ts +8 -0
- package/console/dist/server/models/ActivationsConsoleModel.js +3 -2
- package/console/dist/server/models/ExaminerEvidenceModel.d.ts +6 -2
- package/console/dist/server/models/ExaminerEvidenceModel.js +13 -2
- package/console/dist/server/routes/examiner-executor.d.ts +33 -0
- package/console/dist/server/routes/examiner-executor.js +95 -0
- package/console/dist/server/routes/examiner.js +12 -9
- package/console/dist/web/assets/app.css +8 -10
- package/console/dist/web/assets/app.js +27 -27
- package/core/dist/ledger-file-lock.d.ts +38 -0
- package/core/dist/ledger-file-lock.d.ts.map +1 -0
- package/core/dist/ledger-file-lock.js +240 -0
- package/core/dist/ledger-file-lock.js.map +1 -0
- package/core/dist/principle-text-normalization.d.ts +32 -0
- package/core/dist/principle-text-normalization.d.ts.map +1 -0
- package/core/dist/principle-text-normalization.js +34 -0
- package/core/dist/principle-text-normalization.js.map +1 -0
- package/core/dist/principle-tree-ledger.d.ts +22 -21
- package/core/dist/principle-tree-ledger.d.ts.map +1 -1
- package/core/dist/principle-tree-ledger.js +77 -204
- package/core/dist/principle-tree-ledger.js.map +1 -1
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts +13 -0
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.js +90 -1
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.js.map +1 -1
- package/core/dist/runtime/adapter/schema-prompt-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/schema-prompt-adapter.js +21 -30
- package/core/dist/runtime/adapter/schema-prompt-adapter.js.map +1 -1
- package/core/dist/runtime/candidate-intake-service.d.ts +40 -1
- package/core/dist/runtime/candidate-intake-service.d.ts.map +1 -1
- package/core/dist/runtime/candidate-intake-service.js +548 -110
- package/core/dist/runtime/candidate-intake-service.js.map +1 -1
- package/core/dist/runtime/candidate-intake.d.ts +59 -2
- package/core/dist/runtime/candidate-intake.d.ts.map +1 -1
- package/core/dist/runtime/candidate-intake.js +23 -0
- package/core/dist/runtime/candidate-intake.js.map +1 -1
- package/core/dist/runtime/candidate-seed-suppression.d.ts +63 -0
- package/core/dist/runtime/candidate-seed-suppression.d.ts.map +1 -0
- package/core/dist/runtime/candidate-seed-suppression.js +29 -0
- package/core/dist/runtime/candidate-seed-suppression.js.map +1 -0
- package/core/dist/runtime/config/pd-config-agent-binding.d.ts +5 -5
- package/core/dist/runtime/config/pd-config-agent-binding.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-agent-binding.js +22 -16
- package/core/dist/runtime/config/pd-config-agent-binding.js.map +1 -1
- package/core/dist/runtime/config/pd-credentials.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-credentials.js +7 -1
- package/core/dist/runtime/config/pd-credentials.js.map +1 -1
- package/core/dist/runtime/diagnostician/distiller-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/distiller-prompt-builder.js +30 -3
- package/core/dist/runtime/diagnostician/distiller-prompt-builder.js.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js +16 -5
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/core/dist/runtime/diagnostician/router-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/router-prompt-builder.js +16 -4
- package/core/dist/runtime/diagnostician/router-prompt-builder.js.map +1 -1
- package/core/dist/runtime/index.d.ts +4 -2
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +3 -1
- package/core/dist/runtime/index.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 +177 -29
- package/core/dist/runtime/internalization/dreamer-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.d.ts +16 -2
- package/core/dist/runtime/internalization/internalization-orchestrator.d.ts.map +1 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.js +48 -14
- package/core/dist/runtime/internalization/internalization-orchestrator.js.map +1 -1
- package/core/dist/runtime/internalization/philosopher-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/philosopher-prompt-builder.js +7 -6
- package/core/dist/runtime/internalization/philosopher-prompt-builder.js.map +1 -1
- package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts +13 -6
- package/core/dist/runtime/internalization/scribe-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/internalization/scribe-prompt-builder.js +15 -10
- package/core/dist/runtime/internalization/scribe-prompt-builder.js.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.d.ts +3 -0
- package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.js +224 -93
- package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime/pain-submit-capability.d.ts.map +1 -1
- package/core/dist/runtime/pain-submit-capability.js +3 -5
- package/core/dist/runtime/pain-submit-capability.js.map +1 -1
- package/core/dist/runtime/pain-to-principle-service.d.ts.map +1 -1
- package/core/dist/runtime/pain-to-principle-service.js +18 -21
- package/core/dist/runtime/pain-to-principle-service.js.map +1 -1
- package/core/dist/runtime/store/candidate/admission-document.d.ts +129 -0
- package/core/dist/runtime/store/candidate/admission-document.d.ts.map +1 -1
- package/core/dist/runtime/store/candidate/admission-document.js +196 -0
- package/core/dist/runtime/store/candidate/admission-document.js.map +1 -1
- package/core/dist/runtime/store/candidate/candidate-store.d.ts +54 -1
- package/core/dist/runtime/store/candidate/candidate-store.d.ts.map +1 -1
- package/core/dist/runtime/store/candidate/memory-candidate-store.d.ts +32 -1
- package/core/dist/runtime/store/candidate/memory-candidate-store.d.ts.map +1 -1
- package/core/dist/runtime/store/candidate/memory-candidate-store.js +24 -1
- package/core/dist/runtime/store/candidate/memory-candidate-store.js.map +1 -1
- package/core/dist/runtime/store/candidate/sqlite-candidate-store.d.ts +32 -1
- package/core/dist/runtime/store/candidate/sqlite-candidate-store.d.ts.map +1 -1
- package/core/dist/runtime/store/candidate/sqlite-candidate-store.js +76 -1
- package/core/dist/runtime/store/candidate/sqlite-candidate-store.js.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.d.ts +34 -1
- package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.js +10 -0
- package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
- package/core/package.json +1 -1
- package/host-runtime/dist/governance-signal-admission.js +1 -5
- package/host-runtime/package.json +1 -1
- package/package.json +2 -2
- package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
- package/pd-cli/dist/commands/candidate.js +243 -28
- package/pd-cli/dist/commands/candidate.js.map +1 -1
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +110 -7
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +3 -0
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.js +68 -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 +11 -1
- package/pd-cli/dist/program.js.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.d.ts.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.js +18 -7
- package/pd-cli/dist/services/admission-write-gate.js.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.js +8 -3
- package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
- package/pd-cli/dist/services/reuse-park-release.d.ts +142 -0
- package/pd-cli/dist/services/reuse-park-release.d.ts.map +1 -0
- package/pd-cli/dist/services/reuse-park-release.js +201 -0
- package/pd-cli/dist/services/reuse-park-release.js.map +1 -0
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +819 -629
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/package.json +1 -1
|
@@ -68,6 +68,14 @@ export interface ActivationsResponse {
|
|
|
68
68
|
reason?: string;
|
|
69
69
|
/** Present when status is 'degraded' — next operator action. */
|
|
70
70
|
nextAction?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Stable machine code for the degraded reason (rc-9 companion to `reason`):
|
|
73
|
+
* the Owner-facing UI translates THIS, while `reason` stays the raw
|
|
74
|
+
* operator/forensics detail. Undefined when status is 'ok'.
|
|
75
|
+
*/
|
|
76
|
+
reasonCode?: 'state_db_missing' | 'activation_table_missing' | 'dangling_artifact_references'
|
|
77
|
+
/** Produced by ExaminerEvidenceModel's own catch when the read throws. */
|
|
78
|
+
| 'activation_read_failed';
|
|
71
79
|
/** R-A3/AC-01: route context for the per-activation injection statuses. */
|
|
72
80
|
promptInjectionRoute?: PromptInjectionRouteSummaryWire;
|
|
73
81
|
/**
|
|
@@ -234,7 +234,7 @@ export class ActivationsConsoleModel {
|
|
|
234
234
|
const enforcement = readDegradedEnforcement(this.workspaceDir);
|
|
235
235
|
const stateDbPath = resolveStateDbPath(this.workspaceDir);
|
|
236
236
|
if (!fs.existsSync(stateDbPath)) {
|
|
237
|
-
return { activations: [], status: 'degraded', reason: 'state.db not found — workspace may not be initialized', nextAction: 'Run pd runtime diagnostics to check workspace state', enforcement };
|
|
237
|
+
return { activations: [], status: 'degraded', reason: 'state.db not found — workspace may not be initialized', nextAction: 'Run pd runtime diagnostics to check workspace state', reasonCode: 'state_db_missing', enforcement };
|
|
238
238
|
}
|
|
239
239
|
const conn = new SqliteConnection({ workspaceDir: this.workspaceDir, readonly: true });
|
|
240
240
|
try {
|
|
@@ -246,7 +246,7 @@ export class ActivationsConsoleModel {
|
|
|
246
246
|
}
|
|
247
247
|
catch (err) {
|
|
248
248
|
if (isMissingTableError(err)) {
|
|
249
|
-
return { activations: [], status: 'degraded', reason: 'activation table not found — workspace may not be initialized', nextAction: 'Run pd runtime internalization integrity to check schema', enforcement };
|
|
249
|
+
return { activations: [], status: 'degraded', reason: 'activation table not found — workspace may not be initialized', nextAction: 'Run pd runtime internalization integrity to check schema', reasonCode: 'activation_table_missing', enforcement };
|
|
250
250
|
}
|
|
251
251
|
throw err;
|
|
252
252
|
}
|
|
@@ -497,6 +497,7 @@ export class ActivationsConsoleModel {
|
|
|
497
497
|
status: 'degraded',
|
|
498
498
|
reason: `${danglingArtifactIds.size} activation(s) reference non-existent artifact_id(s): ${Array.from(danglingArtifactIds).join(', ')}`,
|
|
499
499
|
nextAction: 'Run pd runtime internalization integrity to check for orphaned activations',
|
|
500
|
+
reasonCode: 'dangling_artifact_references',
|
|
500
501
|
promptInjectionRoute,
|
|
501
502
|
enforcement,
|
|
502
503
|
};
|
|
@@ -34,6 +34,8 @@ export interface ExaminerEvidenceAuditProjection {
|
|
|
34
34
|
status: 'ok' | 'degraded';
|
|
35
35
|
reason?: string;
|
|
36
36
|
nextAction?: string;
|
|
37
|
+
/** Stable machine code for the degraded reason (mirrors coverage.reasonCode). */
|
|
38
|
+
reasonCode?: string;
|
|
37
39
|
/** P1-3: LOADED counts (the audit page window) — never presented as totals. */
|
|
38
40
|
counts: {
|
|
39
41
|
deliveries: number;
|
|
@@ -99,6 +101,8 @@ export interface ExaminerActivationProjection {
|
|
|
99
101
|
status: 'ok' | 'degraded';
|
|
100
102
|
reason?: string;
|
|
101
103
|
nextAction?: string;
|
|
104
|
+
/** Stable machine code for the degraded reason — the UI translates this. */
|
|
105
|
+
reasonCode?: 'state_db_missing' | 'activation_table_missing' | 'dangling_artifact_references' | 'activation_read_failed';
|
|
102
106
|
prompt: ExaminerPromptActivationRow[];
|
|
103
107
|
ruleCode: ExaminerRuleCodeRow[];
|
|
104
108
|
promptInjectionRoute?: PromptInjectionRouteSummaryWire;
|
|
@@ -107,6 +111,8 @@ export interface ExaminerInjectionProjection {
|
|
|
107
111
|
status: 'available' | 'degraded';
|
|
108
112
|
/** Present when no status could be computed at all (fail-loud, rc-9). */
|
|
109
113
|
globalReason?: string;
|
|
114
|
+
/** Machine code for the degraded lane; globalReason stays the forensics detail. */
|
|
115
|
+
reasonCode?: 'injection_status_unavailable';
|
|
110
116
|
statuses: {
|
|
111
117
|
activationId: string;
|
|
112
118
|
status: string;
|
|
@@ -139,8 +145,6 @@ export interface ExaminerPrincipleEvidence {
|
|
|
139
145
|
adherenceRate: number;
|
|
140
146
|
valueScore: number;
|
|
141
147
|
runtimeDeactivated?: boolean;
|
|
142
|
-
/** Asset status ≠ runtime activation — pinned for the UI (SPEC §4.1). */
|
|
143
|
-
ledgerStatusNote: string;
|
|
144
148
|
};
|
|
145
149
|
activation: ExaminerActivationProjection;
|
|
146
150
|
injection: ExaminerInjectionProjection;
|
|
@@ -94,6 +94,7 @@ export class ExaminerEvidenceModel {
|
|
|
94
94
|
status: 'degraded',
|
|
95
95
|
reason: `activation read failed: ${errorMessage(error)}`,
|
|
96
96
|
nextAction: 'check workspace .pd/state.db readability and the activation schema',
|
|
97
|
+
reasonCode: 'activation_read_failed',
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
100
|
const rows = activations.activations.filter((row) => row.principleId === principleId);
|
|
@@ -101,6 +102,7 @@ export class ExaminerEvidenceModel {
|
|
|
101
102
|
status: activations.status,
|
|
102
103
|
reason: activations.reason,
|
|
103
104
|
nextAction: activations.nextAction,
|
|
105
|
+
reasonCode: activations.reasonCode,
|
|
104
106
|
promptInjectionRoute: activations.promptInjectionRoute,
|
|
105
107
|
prompt: rows
|
|
106
108
|
.filter((row) => row.channel === 'prompt')
|
|
@@ -132,6 +134,7 @@ export class ExaminerEvidenceModel {
|
|
|
132
134
|
const injection = {
|
|
133
135
|
status: injectionReport.globalReason ? 'degraded' : 'available',
|
|
134
136
|
globalReason: injectionReport.globalReason,
|
|
137
|
+
reasonCode: injectionReport.globalReason ? 'injection_status_unavailable' : undefined,
|
|
135
138
|
statuses: targetStatuses.map((row) => ({
|
|
136
139
|
activationId: row.activationId,
|
|
137
140
|
status: row.status,
|
|
@@ -193,6 +196,10 @@ export class ExaminerEvidenceModel {
|
|
|
193
196
|
status: audit.status,
|
|
194
197
|
reason: audit.reason,
|
|
195
198
|
nextAction: audit.nextAction,
|
|
199
|
+
// The audit's own coverage already carries the stable degraded code
|
|
200
|
+
// (state_db_missing / ledger_flag_disabled / evidence_read_failed …);
|
|
201
|
+
// pass it through instead of re-deriving a second truth.
|
|
202
|
+
reasonCode: audit.status === 'degraded' ? audit.coverage?.reasonCode : undefined,
|
|
196
203
|
counts: {
|
|
197
204
|
deliveries: audit.deliveries.length,
|
|
198
205
|
applications: audit.applications.length,
|
|
@@ -263,8 +270,12 @@ export class ExaminerEvidenceModel {
|
|
|
263
270
|
painPreventedCount: detail.painPreventedCount,
|
|
264
271
|
adherenceRate: detail.adherenceRate,
|
|
265
272
|
valueScore: detail.valueScore,
|
|
266
|
-
|
|
267
|
-
|
|
273
|
+
// PRI-956 semantics: runtime revocation is an ACTIVATIONS-table fact.
|
|
274
|
+
// getPrincipleDetail does not populate this field (only the list
|
|
275
|
+
// projection does), so derive it here from the rows already read:
|
|
276
|
+
// rows exist and every one is explicitly deactivated (2026-11-16
|
|
277
|
+
// Owner review P1-2 — the field was previously always undefined).
|
|
278
|
+
runtimeDeactivated: rows.length > 0 && rows.every((row) => row.status === 'deactivated'),
|
|
268
279
|
},
|
|
269
280
|
activation,
|
|
270
281
|
injection,
|
|
@@ -106,6 +106,39 @@ export declare function readStudyJson(studyDir: string, rel: string): Record<str
|
|
|
106
106
|
* studies root (sorted). The route layer treats this list as the allowlist.
|
|
107
107
|
*/
|
|
108
108
|
export declare function listStudyNames(studiesRoot: string): string[];
|
|
109
|
+
/**
|
|
110
|
+
* Owner-facing study-list entry: identity + the few facts the list needs
|
|
111
|
+
* (target principle, mode, creation time, report status, point estimate).
|
|
112
|
+
* Raw facts only — the human "direction" wording is derived in the UI from
|
|
113
|
+
* ONE shared helper, never here (P4: no second conclusion truth).
|
|
114
|
+
*
|
|
115
|
+
* Per-study degradation is honest, never silent: an unreadable manifest or
|
|
116
|
+
* report keeps the row with a problemCode (rc-9) instead of dropping it.
|
|
117
|
+
*/
|
|
118
|
+
export interface StudySummary {
|
|
119
|
+
studyId: string;
|
|
120
|
+
readOnly: boolean;
|
|
121
|
+
targetPrincipleId: string | null;
|
|
122
|
+
experimentMode: string | null;
|
|
123
|
+
createdAt: string | null;
|
|
124
|
+
reportStatus: string | null;
|
|
125
|
+
hasExaminerResult: boolean;
|
|
126
|
+
pointEstimate: {
|
|
127
|
+
status: string;
|
|
128
|
+
value: number | null;
|
|
129
|
+
} | null;
|
|
130
|
+
problemCode?: 'manifest_unreadable' | 'report_unreadable';
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Study list with the metadata the Owner-facing list renders. Writable
|
|
134
|
+
* (console-owned) studies first, then historical names not shadowed by a
|
|
135
|
+
* writable one — same ordering rule the old name-only list had.
|
|
136
|
+
*
|
|
137
|
+
* readOnly mirrors the REAL access boundary (P2-2): a directory under the
|
|
138
|
+
* writable root that fails console-ownership verification is read-only for
|
|
139
|
+
* every write route, so the list must not label it writable.
|
|
140
|
+
*/
|
|
141
|
+
export declare function listStudySummaries(roots: StudyRoots): StudySummary[];
|
|
109
142
|
export type StudyAccess = {
|
|
110
143
|
dir: string;
|
|
111
144
|
studyId: string;
|
|
@@ -130,6 +130,101 @@ export function listStudyNames(studiesRoot) {
|
|
|
130
130
|
.map((entry) => entry.name)
|
|
131
131
|
.sort();
|
|
132
132
|
}
|
|
133
|
+
function readOptionalStudyJson(studyDir, rel) {
|
|
134
|
+
try {
|
|
135
|
+
return readStudyJson(studyDir, rel);
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function asString(value) {
|
|
142
|
+
return typeof value === 'string' && value !== '' ? value : null;
|
|
143
|
+
}
|
|
144
|
+
function summarizeOneStudy(root, name, readOnly) {
|
|
145
|
+
const studyDir = path.join(root, name);
|
|
146
|
+
const manifest = readOptionalStudyJson(studyDir, 'examiner-manifest.json');
|
|
147
|
+
let targetPrincipleId = null;
|
|
148
|
+
let experimentMode = null;
|
|
149
|
+
let problemCode;
|
|
150
|
+
if (manifest === null) {
|
|
151
|
+
problemCode = 'manifest_unreadable';
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
const target = manifest.targetPrinciple;
|
|
155
|
+
targetPrincipleId = isJsonObject(target) ? asString(target.id) : null;
|
|
156
|
+
experimentMode = asString(manifest.experimentMode);
|
|
157
|
+
if (targetPrincipleId === null && experimentMode === null)
|
|
158
|
+
problemCode = 'manifest_unreadable';
|
|
159
|
+
}
|
|
160
|
+
// Creation time: the console ownership marker (writable studies only);
|
|
161
|
+
// historical research assets carry no marker, so their date — when present
|
|
162
|
+
// at all — falls back to the report generation time below (P2-1: without
|
|
163
|
+
// the fallback every historical study sorts as "date unknown" and the
|
|
164
|
+
// latest-study pick degenerates to directory order).
|
|
165
|
+
let createdAt = null;
|
|
166
|
+
if (!readOnly) {
|
|
167
|
+
const marker = readOptionalStudyJson(studyDir, CONSOLE_OWNERSHIP_MARKER);
|
|
168
|
+
createdAt = marker === null ? null : asString(marker.createdAt);
|
|
169
|
+
}
|
|
170
|
+
const report = readOptionalStudyJson(studyDir, 'behavior-report-v2.json');
|
|
171
|
+
if (createdAt === null && report !== null)
|
|
172
|
+
createdAt = asString(report.generatedAt);
|
|
173
|
+
let reportStatus = null;
|
|
174
|
+
let hasExaminerResult = false;
|
|
175
|
+
let pointEstimate = null;
|
|
176
|
+
if (report === null) {
|
|
177
|
+
if (fs.existsSync(path.join(studyDir, 'behavior-report-v2.json')))
|
|
178
|
+
problemCode = problemCode ?? 'report_unreadable';
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
reportStatus = asString(report.status);
|
|
182
|
+
const { examiner } = report;
|
|
183
|
+
if (isJsonObject(examiner)) {
|
|
184
|
+
hasExaminerResult = true;
|
|
185
|
+
const { itt } = examiner;
|
|
186
|
+
if (isJsonObject(itt)) {
|
|
187
|
+
const { pointEstimate: estimate } = itt;
|
|
188
|
+
if (isJsonObject(estimate)) {
|
|
189
|
+
pointEstimate = {
|
|
190
|
+
status: asString(estimate.status) ?? 'unknown',
|
|
191
|
+
value: typeof estimate.value === 'number' && Number.isFinite(estimate.value) ? estimate.value : null,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
studyId: name,
|
|
199
|
+
readOnly,
|
|
200
|
+
targetPrincipleId,
|
|
201
|
+
experimentMode,
|
|
202
|
+
createdAt,
|
|
203
|
+
reportStatus,
|
|
204
|
+
hasExaminerResult,
|
|
205
|
+
pointEstimate,
|
|
206
|
+
...(problemCode === undefined ? {} : { problemCode }),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Study list with the metadata the Owner-facing list renders. Writable
|
|
211
|
+
* (console-owned) studies first, then historical names not shadowed by a
|
|
212
|
+
* writable one — same ordering rule the old name-only list had.
|
|
213
|
+
*
|
|
214
|
+
* readOnly mirrors the REAL access boundary (P2-2): a directory under the
|
|
215
|
+
* writable root that fails console-ownership verification is read-only for
|
|
216
|
+
* every write route, so the list must not label it writable.
|
|
217
|
+
*/
|
|
218
|
+
export function listStudySummaries(roots) {
|
|
219
|
+
const writable = listStudyNames(roots.writable);
|
|
220
|
+
const historical = listStudyNames(roots.historical).filter((name) => !writable.includes(name));
|
|
221
|
+
return [
|
|
222
|
+
...writable.map((name) => summarizeOneStudy(roots.writable, name,
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- hoisted function declaration
|
|
224
|
+
!verifyConsoleOwnership(roots.writable, path.join(roots.writable, name)).ok)),
|
|
225
|
+
...historical.map((name) => summarizeOneStudy(roots.historical, name, true)),
|
|
226
|
+
];
|
|
227
|
+
}
|
|
133
228
|
/**
|
|
134
229
|
* P1-1: verify that a directory under the WRITABLE root was really created by
|
|
135
230
|
* this server. Name membership is not enough and file existence is not enough:
|
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
4
4
|
import { sendSuccess, sendError, sendNotFound, sendJson } from '../utils/response.js';
|
|
5
5
|
import { PrinciplesConsoleModel } from '../models/PrinciplesConsoleModel.js';
|
|
6
6
|
import { ExaminerEvidenceModel } from '../models/ExaminerEvidenceModel.js';
|
|
7
|
-
import { loadLabModules, loadHostCapability, preflightCheck, offlineStudyPass, reportMaterialize, listStudyNames, resolveStudyAccess, resolveStudyRoots, studyReportPayload, materializeConsoleStudy, verifyConsoleOwnership, writableRootProblem, isJsonObject, ExaminerPreflightBlockedError, } from './examiner-executor.js';
|
|
7
|
+
import { loadLabModules, loadHostCapability, preflightCheck, offlineStudyPass, reportMaterialize, listStudyNames, listStudySummaries, resolveStudyAccess, resolveStudyRoots, studyReportPayload, materializeConsoleStudy, verifyConsoleOwnership, writableRootProblem, isJsonObject, ExaminerPreflightBlockedError, } from './examiner-executor.js';
|
|
8
8
|
import { listSuiteCatalog, isSuiteKey, readProductionSnapshot, } from './examiner-study-inputs.js';
|
|
9
9
|
import { evaluateStudyEligibility, toOperatorVerdict } from './examiner-eligibility.js';
|
|
10
10
|
import { appendConsoleRunEventLocked, readConsoleRuns, currentConsoleRun, recoverUnfinishedConsoleRuns, acceptConsoleRun, hostDryRunPass, f2AuthorizationGate, CONSOLE_RUN_SCHEMA, CONSOLE_RUN_MODES, ConsoleRunInProgressError, ConsoleLedgerUnreadableError, studyStatusPayload, assertOfflineAdmissionAllowed, } from './examiner-runs.js';
|
|
@@ -168,20 +168,23 @@ export async function handleExaminerRoute(req, res, workspaceDir, subPath) {
|
|
|
168
168
|
const historical = listStudyNames(roots.historical);
|
|
169
169
|
sendSuccess(res, {
|
|
170
170
|
spec: 'SPEC-PD-EXAMINER-001 v0.10.1',
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
// Stable code — the Owner-facing sentence lives in the UI locales.
|
|
172
|
+
executionScopeCode: 'offline_stub_only',
|
|
173
|
+
// Gate states as machine codes; the human explanation per gate id is
|
|
174
|
+
// UI copy, not server prose.
|
|
175
|
+
gates: [
|
|
176
|
+
{ id: 'gate1_challenge_trust', state: 'BLOCKED' },
|
|
177
|
+
{ id: 'gate2_behavior_evaluation', state: 'NOT_READY' },
|
|
178
|
+
{ id: 'gate3_llm_authoring', state: 'NOT_STARTED' },
|
|
179
|
+
{ id: 'gate4_product_integration', state: 'ACTIVE' },
|
|
180
|
+
],
|
|
178
181
|
hostInjectionCapability: lab,
|
|
179
182
|
fullConclusionMinimumLevel: 'CONTEXT_PRESENT',
|
|
180
183
|
writableStudiesRoot: roots.writable,
|
|
181
184
|
historicalStudiesRoot: roots.historical,
|
|
182
185
|
studiesAreWorkspaceData: true,
|
|
183
186
|
rootProblem,
|
|
184
|
-
studies:
|
|
187
|
+
studies: listStudySummaries(roots),
|
|
185
188
|
readOnlyStudies: [
|
|
186
189
|
...historical,
|
|
187
190
|
...writable.filter((name) => !verifyConsoleOwnership(roots.writable, path.join(roots.writable, name)).ok),
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
--color-teal-600: oklch(60% 0.118 184.704);
|
|
32
32
|
--color-sky-400: oklch(74.6% 0.16 232.661);
|
|
33
33
|
--color-sky-500: oklch(68.5% 0.169 237.323);
|
|
34
|
+
--color-sky-600: oklch(58.8% 0.158 241.966);
|
|
34
35
|
--color-sky-700: oklch(50% 0.134 242.749);
|
|
35
36
|
--color-black: #000;
|
|
36
37
|
--color-white: #fff;
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
--container-sm: 24rem;
|
|
39
40
|
--container-lg: 32rem;
|
|
40
41
|
--container-xl: 36rem;
|
|
42
|
+
--container-2xl: 42rem;
|
|
41
43
|
--text-xs: 0.75rem;
|
|
42
44
|
--text-xs--line-height: calc(1 / 0.75);
|
|
43
45
|
--text-sm: 0.875rem;
|
|
@@ -603,10 +605,6 @@
|
|
|
603
605
|
.table {
|
|
604
606
|
display: table;
|
|
605
607
|
}
|
|
606
|
-
.size-3 {
|
|
607
|
-
width: calc(var(--spacing) * 3);
|
|
608
|
-
height: calc(var(--spacing) * 3);
|
|
609
|
-
}
|
|
610
608
|
.size-3\.5 {
|
|
611
609
|
width: calc(var(--spacing) * 3.5);
|
|
612
610
|
height: calc(var(--spacing) * 3.5);
|
|
@@ -853,6 +851,9 @@
|
|
|
853
851
|
.w-px {
|
|
854
852
|
width: 1px;
|
|
855
853
|
}
|
|
854
|
+
.max-w-2xl {
|
|
855
|
+
max-width: var(--container-2xl);
|
|
856
|
+
}
|
|
856
857
|
.max-w-\[32ch\] {
|
|
857
858
|
max-width: 32ch;
|
|
858
859
|
}
|
|
@@ -1763,12 +1764,6 @@
|
|
|
1763
1764
|
background-color: color-mix(in oklab, var(--color-muted) 30%, transparent);
|
|
1764
1765
|
}
|
|
1765
1766
|
}
|
|
1766
|
-
.bg-muted\/40 {
|
|
1767
|
-
background-color: color-mix(in srgb, #f2ede3 40%, transparent);
|
|
1768
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1769
|
-
background-color: color-mix(in oklab, var(--color-muted) 40%, transparent);
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
1767
|
.bg-muted\/50 {
|
|
1773
1768
|
background-color: color-mix(in srgb, #f2ede3 50%, transparent);
|
|
1774
1769
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -2438,6 +2433,9 @@
|
|
|
2438
2433
|
.text-red-700 {
|
|
2439
2434
|
color: var(--color-red-700);
|
|
2440
2435
|
}
|
|
2436
|
+
.text-sky-600 {
|
|
2437
|
+
color: var(--color-sky-600);
|
|
2438
|
+
}
|
|
2441
2439
|
.text-sky-700 {
|
|
2442
2440
|
color: var(--color-sky-700);
|
|
2443
2441
|
}
|