@principles/pd-cli 1.147.6 → 1.147.7

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.
@@ -1,22 +1,38 @@
1
1
  /**
2
- * pd health --host codex command implementation.
2
+ * pd health --host codex command implementation — Codex Governance Closure
3
+ * Slice D (PRI-625; SPEC rev 2 §15 health surface).
3
4
  *
4
- * Reports Codex adapter/runtime versions, host.codex feature flag state,
5
- * hook trust status, and dual global/plugin hook registration detection.
5
+ * Reports the §15 Owner-experience surface for one workspace:
6
+ * - adapter/runtime versions + the G1 ingestion minimum Codex version;
7
+ * - workspace init (config resolution), hook trust, dual registration;
8
+ * - BOTH flag states (host.codex, codex_conversation_ingestion);
9
+ * - consent state (decision metadata only — no captured text, ever);
10
+ * - worker mode (no Companion ⇒ `manual_action_required`, never auto-closure);
11
+ * - per-rollout checkpoints with completeness (incomplete tail / degradation)
12
+ * and bounded byte lag against the live transcript file (stat only);
13
+ * - operational/promoted/quarantined counts + next expiry + last observation;
14
+ * - admission counts incl. admitted-pain-without-task + promotion tails;
15
+ * - Diagnostician task counts (pending/leased/retry_wait/needs_human_review);
16
+ * - §15 `ready` semantics — "unknown is not reported as healthy".
17
+ *
18
+ * Read-only throughout: this command never mutates workspace state and never
19
+ * opens a transcript (file SIZE stat only, never content).
6
20
  *
7
21
  * CLI gate compliance:
8
22
  * - cli-1: --json outputs exactly one parseable JSON object on stdout.
9
- * - cli-2: exit paths stop execution (return after process.exit).
23
+ * - cli-2: exit paths stop execution.
10
24
  * - cli-5: failure paths do not mutate state (read-only throughout).
11
- * - cli-6: every degraded/refused result includes reason + nextAction.
25
+ * - cli-6: every degraded/unknown section carries reason + nextAction.
12
26
  */
13
27
  import * as fs from 'fs';
14
28
  import * as path from 'path';
15
29
  import * as os from 'os';
16
30
  import { createRequire } from 'module';
17
31
  import { resolveWorkspaceDir } from '../resolve-workspace.js';
18
- import { loadPdConfigForPlugin, resolveNearestPdWorkspace } from '@principles/host-runtime';
19
- import { computeFeatureFlagsFromConfig, isFeatureEnabled } from '@principles/core/runtime-v2';
32
+ import { loadPdConfigForPlugin, resolveNearestPdWorkspace, readCodexIngestionConsent, deriveCodexIngestionConsentState, listGovernanceCheckpoints, readGovernanceObservationStats, readGovernanceAdmissionCounts, detectLegacyCodexHookRegistration, CODEX_INGESTION_DISCLOSURE_VERSION, } from '@principles/host-runtime';
33
+ import { computeCodexWorkerStatusMode, locateCodexTranscriptByRolloutIdentity, CODEX_INGESTION_MIN_VERSION, CODEX_INGESTION_VERIFIED_VERSION, } from '@principles/codex-adapter';
34
+ import { getInstallLayoutPaths, parseInstallManifest } from '@principles/install-layout';
35
+ import { SqliteConnection, SqliteTaskStore, computeFeatureFlagsFromConfig, isFeatureEnabled } from '@principles/core/runtime-v2';
20
36
  const require = createRequire(import.meta.url);
21
37
  function readPackageVersion(packageName) {
22
38
  try {
@@ -46,9 +62,9 @@ function detectHooksTrust(codexConfigDir) {
46
62
  };
47
63
  }
48
64
  // Codex stores hook trust in config.toml under [features] hooks = true|false.
49
- // We do a best-effort text scan rather than a full TOML parse to avoid a new
50
- // dependency. If the file is missing or the hook line is absent, we report
51
- // undetectable with a clear next action.
65
+ // Best-effort text scan (no TOML parser dependency): find the 'hooks' key,
66
+ // then the next '=' and inspect the value token. Deliberately plain string
67
+ // operations no regex over assignment syntax.
52
68
  const configTomlPath = path.join(codexConfigDir, 'config.toml');
53
69
  if (!fs.existsSync(configTomlPath)) {
54
70
  return {
@@ -59,15 +75,39 @@ function detectHooksTrust(codexConfigDir) {
59
75
  }
60
76
  try {
61
77
  const raw = fs.readFileSync(configTomlPath, 'utf8');
62
- const match = /hooks\s*=\s*(true|false)/i.exec(raw);
63
- if (!match || !match[1]) {
78
+ // Line-by-line scan: a `hooks = <bool>` assignment inside the file, with
79
+ // comment lines skipped — a commented-out `# hooks = false` legacy note
80
+ // must not flip the trust verdict (review round 3).
81
+ let trusted;
82
+ for (const rawLine of raw.split('\n')) {
83
+ const line = rawLine.trim();
84
+ if (line.startsWith('#'))
85
+ continue;
86
+ const lowered = line.toLowerCase();
87
+ const hooksIndex = lowered.indexOf('hooks');
88
+ if (hooksIndex === -1)
89
+ continue;
90
+ const eqIndex = lowered.indexOf('=', hooksIndex);
91
+ if (eqIndex === -1)
92
+ continue;
93
+ const tail = lowered.slice(eqIndex + 1, eqIndex + 12).trim();
94
+ if (tail.startsWith('true')) {
95
+ trusted = true;
96
+ break;
97
+ }
98
+ if (tail.startsWith('false')) {
99
+ trusted = false;
100
+ break;
101
+ }
102
+ }
103
+ if (trusted === undefined) {
64
104
  return {
65
105
  detectable: false,
66
106
  reason: 'hooks_setting_not_found_in_config',
67
107
  nextAction: 'Open Codex and run /hooks to trust PD hooks. Codex config.toml exists but has no `hooks` setting under [features].',
68
108
  };
69
109
  }
70
- return { detectable: true, trusted: match[1].toLowerCase() === 'true' };
110
+ return { detectable: true, trusted };
71
111
  }
72
112
  catch (error) {
73
113
  const message = error instanceof Error ? error.message : String(error);
@@ -78,53 +118,166 @@ function detectHooksTrust(codexConfigDir) {
78
118
  };
79
119
  }
80
120
  }
121
+ /**
122
+ * Dual-registration detection for the §15/§17 health surface. The legacy
123
+ * predicate itself is the ONE authority in host-runtime
124
+ * (detectLegacyCodexHookRegistration) — shared with the retired installer.
125
+ */
81
126
  function detectDualRegistration(codexConfigDir) {
82
127
  const globalHooksPath = codexConfigDir ? path.join(codexConfigDir, 'hooks.json') : undefined;
83
- // Plugin hooks are declared in a plugin manifest; we cannot reliably detect
84
- // them from outside Codex. We only flag the global-hooks path and let the
85
- // operator confirm plugin registration via /hooks in Codex.
86
128
  const globalHooksExists = globalHooksPath ? fs.existsSync(globalHooksPath) : false;
87
- if (globalHooksExists) {
129
+ if (globalHooksExists && globalHooksPath) {
130
+ const legacy = detectLegacyCodexHookRegistration(globalHooksPath);
88
131
  return {
89
132
  detected: true,
133
+ legacyAsyncPostToolUse: legacy.legacyAsyncPostToolUse,
90
134
  globalHooksPath,
91
135
  reason: 'global_hooks_json_present',
92
- nextAction: 'Global ~/.codex/hooks.json is installed. If the PD Codex plugin is also installed via marketplace, this may cause double-registration. Choose ONE: keep global hooks.json (fallback path) OR uninstall it and use the plugin (recommended). To remove global PD entries, run `create-principles-disciple uninstall --host codex`.',
136
+ nextAction: legacy.detected
137
+ ? 'A legacy PD global hook registration was detected. The Marketplace plugin is the only supported new install path (SPEC §17): remove the legacy registration with `create-principles-disciple uninstall --host codex`, then install the principles-disciple Codex plugin.'
138
+ : 'Global ~/.codex/hooks.json is installed. If the PD Codex plugin is also installed via marketplace, this may cause double-registration. Choose ONE: keep global hooks.json (fallback path) OR uninstall it and use the plugin (recommended).',
93
139
  };
94
140
  }
95
141
  return { detected: false };
96
142
  }
143
+ function readInstallManifestRegistration(workspace) {
144
+ try {
145
+ const paths = getInstallLayoutPaths(os.homedir());
146
+ const raw = JSON.parse(fs.readFileSync(paths.manifest, 'utf8'));
147
+ const parsed = parseInstallManifest(raw);
148
+ if (parsed.manifest !== undefined) {
149
+ const registered = parsed.manifest.workspaces?.some((entry) => path.resolve(entry) === path.resolve(workspace)) ?? false;
150
+ return { registered };
151
+ }
152
+ return { registered: false, error: parsed.error ?? 'install_manifest_invalid' };
153
+ }
154
+ catch {
155
+ return { registered: false, error: 'install_manifest_unreadable' };
156
+ }
157
+ }
158
+ /**
159
+ * §15 Diagnostician counts, read from the Runtime V2 task store
160
+ * (taskKind 'diagnostician'). Read-only; degradation is structured.
161
+ */
162
+ async function readDiagnosticianCounts(workspace) {
163
+ try {
164
+ const connection = new SqliteConnection(workspace);
165
+ const taskStore = new SqliteTaskStore(connection);
166
+ const count = async (status) => {
167
+ // Bounded reporting: 1000 far exceeds any realistic per-workspace
168
+ // Diagnostician backlog; a saturated bucket still blocks readiness via
169
+ // needs_human_review/pending semantics rather than hiding.
170
+ const tasks = await taskStore.listTasks({ status, taskKind: 'diagnostician', limit: 1000 });
171
+ return tasks.length;
172
+ };
173
+ const [pending, leased, retryWait, needsHumanReview] = await Promise.all([
174
+ count('pending'), count('leased'), count('retry_wait'), count('needs_human_review'),
175
+ ]);
176
+ return { pending, leased, retryWait, needsHumanReview };
177
+ }
178
+ catch (error) {
179
+ const message = error instanceof Error ? error.message.slice(0, 160) : String(error);
180
+ return {
181
+ reason: `diagnostician_counts_unavailable: ${message}`,
182
+ nextAction: 'Run `pd runtime init --confirm` if state.db is missing, or inspect the Runtime V2 task store.',
183
+ };
184
+ }
185
+ }
97
186
  export async function handleHealthCodex(opts = {}) {
98
187
  const generatedAt = new Date().toISOString();
99
- const workspaceDir = opts.workspace
100
- ? path.resolve(opts.workspace)
101
- : resolveWorkspaceDir();
188
+ const workspaceDir = opts.workspace ? path.resolve(opts.workspace) : resolveWorkspaceDir();
102
189
  const warnings = [];
103
- // Resolve workspace via the shared host-runtime resolver so pd-cli reports
104
- // the same workspace the Codex hook would resolve.
190
+ const readyBlockers = [];
191
+ const noteReadyBlocker = (label, reason) => {
192
+ readyBlockers.push(reason !== undefined ? `${label}: ${reason}` : label);
193
+ };
194
+ // ── Workspace config → flags + workspace init ──────────────────────────────
105
195
  const resolution = resolveNearestPdWorkspace(workspaceDir);
106
- let resolvedWorkspace;
196
+ let resolvedWorkspace = workspaceDir;
107
197
  let featureFlagSource;
108
198
  let hostCodexEnabled = false;
199
+ let workspaceInit = { initialized: false, reason: 'workspace_not_resolved', nextAction: 'Run `pd runtime init --confirm` in the workspace.' };
200
+ // ONE config load feeds both flag states + workspace init.
201
+ const configLoad = loadPdConfigForPlugin(resolution.ok ? resolution.workspaceDir : workspaceDir);
109
202
  if (!resolution.ok) {
110
- resolvedWorkspace = workspaceDir;
111
203
  featureFlagSource = 'defaults';
112
204
  warnings.push(`workspace_not_resolved: ${resolution.reason} — ${resolution.nextAction}`);
205
+ noteReadyBlocker('workspace', resolution.reason);
113
206
  }
114
207
  else {
115
208
  resolvedWorkspace = resolution.workspaceDir;
116
- const configLoad = loadPdConfigForPlugin(resolvedWorkspace);
117
209
  featureFlagSource = configLoad.source;
118
210
  const flags = computeFeatureFlagsFromConfig(configLoad.effective);
119
211
  hostCodexEnabled = isFeatureEnabled(flags, 'host.codex');
120
212
  if (!configLoad.ok) {
121
- for (const error of configLoad.errors) {
213
+ workspaceInit = {
214
+ initialized: false,
215
+ reason: `config_malformed: ${configLoad.errors[0]?.reason ?? 'unknown'}`,
216
+ nextAction: configLoad.errors[0]?.nextAction ?? 'Repair .pd/config.yaml.',
217
+ };
218
+ for (const error of configLoad.errors)
122
219
  warnings.push(`config_error: ${error.reason} — ${error.nextAction}`);
123
- }
220
+ noteReadyBlocker('workspace', 'config_malformed');
221
+ }
222
+ else {
223
+ workspaceInit = { initialized: true };
124
224
  }
125
225
  }
126
- const adapterVersion = readPackageVersion('@principles/codex-adapter');
127
- const runtimeVersion = readPackageVersion('@principles/host-runtime');
226
+ const ingestionFlag = configLoad.ok
227
+ ? {
228
+ name: 'codex_conversation_ingestion',
229
+ enabled: isFeatureEnabled(computeFeatureFlagsFromConfig(configLoad.effective), 'codex_conversation_ingestion'),
230
+ source: configLoad.source,
231
+ }
232
+ : { reason: `config_unreadable: ${configLoad.errors[0]?.reason ?? 'unknown'}`, nextAction: 'Repair .pd/config.yaml so the flag state can be evaluated.' };
233
+ const ingestionEnabled = 'enabled' in ingestionFlag ? ingestionFlag.enabled : false;
234
+ // ── Consent state (decision metadata only — never captured text) ──────────
235
+ let consent;
236
+ {
237
+ const read = readCodexIngestionConsent(resolvedWorkspace);
238
+ if (!read.ok) {
239
+ consent = { reason: read.reason, nextAction: read.nextAction };
240
+ noteReadyBlocker('consent', read.reason);
241
+ }
242
+ else {
243
+ const state = deriveCodexIngestionConsentState(read.record, ingestionEnabled);
244
+ const disclosureStale = read.record !== null && read.record.disclosureVersion !== CODEX_INGESTION_DISCLOSURE_VERSION;
245
+ consent = {
246
+ state,
247
+ disclosureStale,
248
+ ...(read.record !== null
249
+ ? { decidedAt: read.record.decidedAt, decidedVia: read.record.decidedVia, disclosureVersion: read.record.disclosureVersion }
250
+ : {}),
251
+ ...(state === 'flag_on_without_grant'
252
+ ? {
253
+ reason: 'flag_enabled_without_consent_record',
254
+ nextAction: 'The ingestion flag was enabled outside the disclosed consent flow. Run `pd codex setup` to present the disclosure and record (or reverse) the decision.',
255
+ }
256
+ : {}),
257
+ ...(disclosureStale
258
+ ? { reason: 'consent_recorded_for_older_disclosure', nextAction: 'Run `pd codex setup` to review the current disclosure and re-record the decision.' }
259
+ : {}),
260
+ };
261
+ if (ingestionEnabled && state !== 'granted')
262
+ noteReadyBlocker('consent', state);
263
+ }
264
+ }
265
+ // ── Worker mode ────────────────────────────────────────────────────────────
266
+ const manifest = readInstallManifestRegistration(resolvedWorkspace);
267
+ const workerEvaluation = computeCodexWorkerStatusMode({ workspaceDir: resolvedWorkspace, registeredInInstallManifest: manifest.registered });
268
+ const worker = {
269
+ mode: workerEvaluation.mode,
270
+ registeredInInstallManifest: manifest.registered,
271
+ ...(workerEvaluation.reason !== undefined ? { reason: workerEvaluation.reason } : {}),
272
+ ...(workerEvaluation.nextAction !== undefined ? { nextAction: workerEvaluation.nextAction } : {}),
273
+ };
274
+ if (workerEvaluation.mode === 'degraded')
275
+ noteReadyBlocker('worker', workerEvaluation.reason);
276
+ if (workerEvaluation.mode === 'manual_action_required')
277
+ noteReadyBlocker('worker', 'manual_action_required');
278
+ if (manifest.error !== undefined)
279
+ warnings.push(`install_manifest: ${manifest.error}`);
280
+ // ── Hook trust + dual registration ─────────────────────────────────────────
128
281
  const codexConfigDir = detectCodexConfigDir();
129
282
  const hooksTrust = detectHooksTrust(codexConfigDir);
130
283
  const dualRegistration = detectDualRegistration(codexConfigDir);
@@ -132,12 +285,99 @@ export async function handleHealthCodex(opts = {}) {
132
285
  warnings.push(`hooks_trust: ${hooksTrust.reason}`);
133
286
  if (dualRegistration.reason)
134
287
  warnings.push(`dual_registration: ${dualRegistration.reason}`);
288
+ if (hooksTrust.trusted !== true)
289
+ noteReadyBlocker('hooks_trust', hooksTrust.reason ?? 'untrusted');
290
+ // ── Per-rollout checkpoints + bounded lag (stat only, never content) ───────
291
+ let rollouts;
292
+ {
293
+ const listed = listGovernanceCheckpoints({ workspaceDir: resolvedWorkspace, hostKind: 'codex' });
294
+ if (listed.ok) {
295
+ const codexHome = process.env.CODEX_HOME ?? path.join(os.homedir(), '.codex');
296
+ let lagUndetectable = false;
297
+ const checkpoints = listed.checkpoints.map((checkpoint) => {
298
+ let lagBytes = null;
299
+ const lookup = locateCodexTranscriptByRolloutIdentity(codexHome, checkpoint.rolloutIdentity);
300
+ if (lookup.ok) {
301
+ try {
302
+ lagBytes = Math.max(0, fs.statSync(lookup.transcriptPath).size - checkpoint.byteOffset);
303
+ }
304
+ catch {
305
+ lagUndetectable = true;
306
+ }
307
+ }
308
+ else {
309
+ lagUndetectable = true;
310
+ }
311
+ return {
312
+ rolloutIdentity: checkpoint.rolloutIdentity,
313
+ byteOffset: checkpoint.byteOffset,
314
+ lastOrdinal: checkpoint.lastOrdinal,
315
+ incompleteTail: checkpoint.incompleteTail,
316
+ lastDegradationReason: checkpoint.lastDegradationReason,
317
+ updatedAt: checkpoint.updatedAt,
318
+ lagBytes,
319
+ };
320
+ });
321
+ rollouts = { checkpoints, lagUndetectable };
322
+ for (const checkpoint of checkpoints) {
323
+ if (checkpoint.incompleteTail)
324
+ noteReadyBlocker('rollout', `${checkpoint.rolloutIdentity} incomplete_tail`);
325
+ else if (checkpoint.lagBytes !== null && checkpoint.lagBytes > 0)
326
+ noteReadyBlocker('rollout', `${checkpoint.rolloutIdentity} lag=${checkpoint.lagBytes}B`);
327
+ }
328
+ if (checkpoints.length > 0 && lagUndetectable) {
329
+ warnings.push('rollout_lag_undetectable: the transcript file for at least one checkpoint could not be located (deleted rollout or non-default CODEX_HOME).');
330
+ }
331
+ }
332
+ else {
333
+ rollouts = { reason: listed.reason, nextAction: listed.nextAction };
334
+ noteReadyBlocker('rollouts', listed.reason);
335
+ }
336
+ }
337
+ // ── Observation / admission / diagnostician counts ─────────────────────────
338
+ let observations;
339
+ {
340
+ const stats = readGovernanceObservationStats({ workspaceDir: resolvedWorkspace });
341
+ observations = stats.ok ? stats.stats : { reason: stats.reason, nextAction: stats.nextAction };
342
+ if (!stats.ok)
343
+ noteReadyBlocker('observations', stats.reason);
344
+ }
345
+ let admissions;
346
+ {
347
+ const counts = readGovernanceAdmissionCounts({ workspaceDir: resolvedWorkspace });
348
+ admissions = counts.ok ? counts.counts : { reason: counts.reason, nextAction: counts.nextAction };
349
+ if (!counts.ok)
350
+ noteReadyBlocker('admissions', counts.reason);
351
+ else if (counts.counts.admittedWithoutTask > 0) {
352
+ noteReadyBlocker('admissions', `${counts.counts.admittedWithoutTask} admitted pain(s) without a Diagnostician task; run pd codex reconcile`);
353
+ }
354
+ }
355
+ const diagnosticianTasks = await readDiagnosticianCounts(resolvedWorkspace);
356
+ if ('pending' in diagnosticianTasks) {
357
+ if (diagnosticianTasks.needsHumanReview > 0)
358
+ noteReadyBlocker('diagnostician', `${diagnosticianTasks.needsHumanReview} task(s) need human review`);
359
+ }
360
+ else {
361
+ noteReadyBlocker('diagnostician', diagnosticianTasks.reason);
362
+ }
363
+ // ── §15 ready conjunction ──────────────────────────────────────────────────
364
+ if (!hostCodexEnabled)
365
+ noteReadyBlocker('host.codex', 'disabled');
366
+ if (workerEvaluation.mode === 'paused')
367
+ noteReadyBlocker('worker', workerEvaluation.reason);
368
+ const adapterVersion = readPackageVersion('@principles/codex-adapter');
369
+ const runtimeVersion = readPackageVersion('@principles/host-runtime');
370
+ if (adapterVersion === 'unknown')
371
+ noteReadyBlocker('adapter', 'version_unknown');
372
+ const ready = readyBlockers.length === 0;
135
373
  const report = {
136
374
  generatedAt,
137
375
  host: 'codex',
138
376
  workspace: resolvedWorkspace,
139
377
  adapterVersion,
140
378
  runtimeVersion,
379
+ codexIngestionMinVersion: CODEX_INGESTION_MIN_VERSION,
380
+ codexIngestionVerifiedVersion: CODEX_INGESTION_VERIFIED_VERSION,
141
381
  featureFlag: {
142
382
  name: 'host.codex',
143
383
  enabled: hostCodexEnabled,
@@ -149,61 +389,104 @@ export async function handleHealthCodex(opts = {}) {
149
389
  nextAction: `Enable the Codex host adapter by setting features.host.codex.enabled=true in ${resolvedWorkspace}/.pd/config.yaml, then re-run \`pd health --host codex\`.`,
150
390
  }),
151
391
  },
392
+ ingestionFlag,
393
+ consent,
394
+ workspaceInit,
152
395
  hooksTrust,
153
396
  dualRegistration,
397
+ worker,
398
+ rollouts,
399
+ observations,
400
+ admissions,
401
+ diagnosticianTasks,
402
+ ready,
403
+ readyBlockers: readyBlockers.slice(0, 12),
154
404
  warnings,
155
405
  };
156
406
  if (opts.json) {
157
407
  // cli-1: exactly one parseable JSON object on stdout.
158
408
  console.log(JSON.stringify(report, null, 2));
159
- // cli-2: exit-stops. Non-zero only when host.codex is disabled AND hooks
160
- // are not trusted — the operator must act before Codex activation works.
161
- if (!hostCodexEnabled && !hooksTrust.trusted) {
409
+ // cli-2: exit paths stop execution. Not-ready is the actionable signal.
410
+ if (!ready)
162
411
  process.exitCode = 1;
163
- }
164
412
  return;
165
413
  }
166
414
  // Text output — still includes explicit nextAction per cli-6.
167
- console.log(`generatedAt: ${report.generatedAt}`);
168
- console.log(`host: ${report.host}`);
169
- console.log(`workspace: ${report.workspace}`);
170
- console.log(`adapterVersion: ${report.adapterVersion}`);
171
- console.log(`runtimeVersion: ${report.runtimeVersion}`);
172
- console.log(`featureFlag.name: ${report.featureFlag.name}`);
173
- console.log(`featureFlag.enabled: ${report.featureFlag.enabled}`);
174
- console.log(`featureFlag.source: ${report.featureFlag.source}`);
175
- if (report.featureFlag.reason) {
176
- console.log(`featureFlag.reason: ${report.featureFlag.reason}`);
177
- console.log(`featureFlag.nextAction: ${report.featureFlag.nextAction ?? ''}`);
178
- }
179
- console.log(`hooksTrust.detectable: ${report.hooksTrust.detectable}`);
180
- if (report.hooksTrust.trusted !== undefined) {
181
- console.log(`hooksTrust.trusted: ${report.hooksTrust.trusted}`);
182
- }
183
- if (report.hooksTrust.reason) {
184
- console.log(`hooksTrust.reason: ${report.hooksTrust.reason}`);
185
- console.log(`hooksTrust.nextAction: ${report.hooksTrust.nextAction ?? ''}`);
186
- }
187
- console.log(`dualRegistration.detected: ${report.dualRegistration.detected}`);
188
- if (report.dualRegistration.globalHooksPath) {
189
- console.log(`dualRegistration.globalHooksPath: ${report.dualRegistration.globalHooksPath}`);
190
- }
191
- if (report.dualRegistration.reason) {
192
- console.log(`dualRegistration.reason: ${report.dualRegistration.reason}`);
193
- console.log(`dualRegistration.nextAction: ${report.dualRegistration.nextAction ?? ''}`);
415
+ const line = (label, value) => console.log(`${label}: ${value}`);
416
+ line('generatedAt', report.generatedAt);
417
+ line('host', report.host);
418
+ line('workspace', report.workspace);
419
+ line('adapterVersion', report.adapterVersion);
420
+ line('runtimeVersion', report.runtimeVersion);
421
+ line('codexIngestionMinVersion', report.codexIngestionMinVersion);
422
+ line('codexIngestionVerifiedVersion', report.codexIngestionVerifiedVersion);
423
+ line('featureFlag.host.codex', `${String(report.featureFlag.enabled)} (${report.featureFlag.source})`);
424
+ if ('enabled' in report.ingestionFlag) {
425
+ line('ingestionFlag.codex_conversation_ingestion', `${String(report.ingestionFlag.enabled)} (${report.ingestionFlag.source})`);
426
+ }
427
+ else {
428
+ line('ingestionFlag', `unknown (${report.ingestionFlag.reason})`);
429
+ line('ingestionFlag.nextAction', report.ingestionFlag.nextAction);
194
430
  }
431
+ if ('state' in report.consent)
432
+ line('consent.state', report.consent.state);
433
+ else {
434
+ line('consent', `unknown (${report.consent.reason})`);
435
+ line('consent.nextAction', report.consent.nextAction);
436
+ }
437
+ const init = report.workspaceInit;
438
+ line('workspaceInit', init.initialized === true ? 'ok' : `not-initialized (${init.reason ?? 'unknown'})`);
439
+ line('hooksTrust', report.hooksTrust.trusted === undefined ? `undetectable (${report.hooksTrust.reason ?? 'unknown'})` : String(report.hooksTrust.trusted));
440
+ line('dualRegistration', String(report.dualRegistration.detected));
441
+ if (report.dualRegistration.detected)
442
+ line('dualRegistration.nextAction', report.dualRegistration.nextAction ?? '');
443
+ line('worker.mode', `${report.worker.mode}${report.worker.reason !== undefined ? ` (${report.worker.reason})` : ''}`);
444
+ if ('checkpoints' in report.rollouts) {
445
+ line('rollouts', String(report.rollouts.checkpoints.length));
446
+ for (const checkpoint of report.rollouts.checkpoints.slice(0, 10)) {
447
+ console.log(` - ${checkpoint.rolloutIdentity} lag=${checkpoint.lagBytes === null ? 'unknown' : `${checkpoint.lagBytes}B`} incompleteTail=${String(checkpoint.incompleteTail)} updatedAt=${checkpoint.updatedAt}`);
448
+ }
449
+ }
450
+ else {
451
+ line('rollouts', `unknown (${report.rollouts.reason})`);
452
+ }
453
+ if ('operational' in report.observations) {
454
+ line('observations', `operational=${String(report.observations.operational)} promoted=${String(report.observations.promoted)} quarantined=${String(report.observations.quarantined)} terminal=${String(report.observations.terminalOther)}`);
455
+ line('observations.nextExpiryAt', report.observations.nextExpiryAt ?? 'n/a');
456
+ line('observations.lastObservationAt', report.observations.lastObservationAt ?? 'n/a');
457
+ }
458
+ else {
459
+ line('observations', `unknown (${report.observations.reason})`);
460
+ }
461
+ if ('admitted' in report.admissions) {
462
+ line('admissions', `admitted=${String(report.admissions.admitted)} withoutTask=${String(report.admissions.admittedWithoutTask)} tails pending=${String(report.admissions.pendingTails)}/stale=${String(report.admissions.staleTails)}/completed=${String(report.admissions.completedTails)}`);
463
+ line('admissions.lastAdmissionAt', report.admissions.lastAdmissionAt ?? 'n/a');
464
+ }
465
+ else {
466
+ line('admissions', `unknown (${report.admissions.reason})`);
467
+ }
468
+ if ('pending' in report.diagnosticianTasks) {
469
+ line('diagnosticianTasks', `pending=${String(report.diagnosticianTasks.pending)} leased=${String(report.diagnosticianTasks.leased)} retryWait=${String(report.diagnosticianTasks.retryWait)} needsHumanReview=${String(report.diagnosticianTasks.needsHumanReview)}`);
470
+ }
471
+ else {
472
+ line('diagnosticianTasks', `unknown (${report.diagnosticianTasks.reason})`);
473
+ }
474
+ line('ready', `${String(report.ready)}${report.readyBlockers.length > 0 ? ` (blockers: ${report.readyBlockers.join('; ')})` : ''}`);
195
475
  if (report.warnings.length > 0) {
196
- console.log(`warnings:`);
197
- for (const w of report.warnings)
198
- console.log(` - ${w}`);
476
+ console.log('warnings:');
477
+ for (const warning of report.warnings)
478
+ console.log(` - ${warning}`);
199
479
  }
200
480
  console.log('');
481
+ // Product-claim boundary (PRI-625): automatic closure readiness is NOT
482
+ // cross-host signal parity (PRI-632 tracks that separately).
483
+ if (report.ready) {
484
+ console.log('rev2 automatic closure is ready for this workspace. This does NOT claim OpenClaw↔Codex signal-modality parity (see PRI-632).');
485
+ }
201
486
  if (!hostCodexEnabled) {
202
487
  console.warn(`⚠️ host.codex feature flag is disabled. Enable it in ${resolvedWorkspace}/.pd/config.yaml under features.host.codex.enabled to activate Codex hooks.`);
203
488
  }
204
- if (!hooksTrust.trusted && !hooksTrust.detectable) {
205
- console.warn(`⚠️ Hook trust state could not be detected. ${hooksTrust.nextAction ?? ''}`);
489
+ if (!report.ready)
206
490
  process.exitCode = 1;
207
- }
208
491
  }
209
492
  //# sourceMappingURL=health-codex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"health-codex.js","sourceRoot":"","sources":["../../src/commands/health-codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE9F,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CA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