@principles/codex-adapter 0.6.1 → 0.6.2

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.
@@ -32,7 +32,7 @@ export type CodexCatchUpResult = {
32
32
  /** Checkpoints not examined this invocation because of the bound (rotation converges them over repeated passes). */
33
33
  readonly unexaminedRollouts: readonly string[];
34
34
  };
35
- export declare const CODEX_CATCH_UP_NEXT_ACTION = "Set features.codex_conversation_ingestion.enabled=true in the selected Workspace .pd/config.yaml to enable bounded conversation ingestion.";
35
+ export declare const CODEX_CATCH_UP_NEXT_ACTION = "Enable bounded conversation ingestion in the selected Workspace .pd/config.yaml \u2014 in the existing \"features:\" block set codex_conversation_ingestion: {enabled: true} (one flat key, not nested).";
36
36
  /**
37
37
  * Perform one bounded catch-up pass. `remainingLagRollouts` is derived from
38
38
  * each processed rollout's reported lag plus the checkpoints left unprocessed
@@ -22,7 +22,15 @@ import { locateCodexTranscriptByRolloutIdentity } from './transcript-locate.js';
22
22
  import { ingestCodexTranscriptFromPath } from './ingestion.js';
23
23
  import { runGovernanceAdmission } from './admission.js';
24
24
  const DEFAULT_MAX_ROLLOUTS = 8;
25
- export const CODEX_CATCH_UP_NEXT_ACTION = 'Set features.codex_conversation_ingestion.enabled=true in the selected Workspace .pd/config.yaml to enable bounded conversation ingestion.';
25
+ // PRI-1063 (review fix): the hint must survive two hard constraints.
26
+ // 1. It may travel through `diagnostic()` elsewhere, which collapses ALL
27
+ // whitespace (`replace(/\s+/g, ' ')`) — a multi-line YAML block would be
28
+ // flattened into unusable text, so the snippet itself is single-line.
29
+ // 2. A real .pd/config.yaml ALWAYS already has a top-level `features:` key, so
30
+ // pasting a second `features:` block throws "duplicated mapping key". The
31
+ // instruction therefore says "in the existing features: block", and the
32
+ // flow mapping keeps the edited line copy-pasteable.
33
+ export const CODEX_CATCH_UP_NEXT_ACTION = 'Enable bounded conversation ingestion in the selected Workspace .pd/config.yaml — in the existing "features:" block set codex_conversation_ingestion: {enabled: true} (one flat key, not nested).';
26
34
  /**
27
35
  * Perform one bounded catch-up pass. `remainingLagRollouts` is derived from
28
36
  * each processed rollout's reported lag plus the checkpoints left unprocessed
@@ -38,7 +46,7 @@ export async function catchUpCodexIngestion(options) {
38
46
  }
39
47
  const { flags } = computeFeatureFlagsFromConfig(config.effective);
40
48
  if (flags['host.codex']?.enabled !== true) {
41
- return { status: 'skipped', reason: 'host.codex_disabled', nextAction: 'Set features.host.codex.enabled=true in the selected Workspace to enable PD.' };
49
+ return { status: 'skipped', reason: 'host.codex_disabled', nextAction: 'Enable PD in the selected Workspace .pd/config.yaml — in the existing "features:" block set host.codex: {enabled: true} (one flat key, not nested).' };
42
50
  }
43
51
  if (flags.codex_conversation_ingestion?.enabled !== true) {
44
52
  return { status: 'skipped', reason: 'feature_disabled', nextAction: CODEX_CATCH_UP_NEXT_ACTION };
package/dist/pd-hook.js CHANGED
@@ -244,7 +244,11 @@ export async function processHookInvocation(rawStdin, _env = process.env, cwd =
244
244
  }
245
245
  const { flags } = computeFeatureFlagsFromConfig(config.effective);
246
246
  if (flags['host.codex']?.enabled !== true) {
247
- return { stdout: {}, exitCode: 0, stderr: [diagnostic('host.codex_disabled', 'Set features.host.codex.enabled=true in the selected Workspace to enable PD.')] };
247
+ // PRI-1063 (review fix): single-line flow mapping. `diagnostic()` below
248
+ // collapses every whitespace run, so a multi-line YAML block would reach
249
+ // the user flattened into garbage; and a second `features:` block would
250
+ // duplicate the key already present in every real config.
251
+ return { stdout: {}, exitCode: 0, stderr: [diagnostic('host.codex_disabled', 'Enable PD in the selected Workspace .pd/config.yaml — in the existing "features:" block set host.codex: {enabled: true} (one flat key, not nested).')] };
248
252
  }
249
253
  const ingestionEnabled = flags.codex_conversation_ingestion?.enabled === true;
250
254
  if (event.kind === 'turn_complete') {
@@ -269,7 +273,7 @@ export async function processHookInvocation(rawStdin, _env = process.env, cwd =
269
273
  // would be per-event noise).
270
274
  const stderr = ingestionEnabled
271
275
  ? [...clearDiagnostics, ...await runConversationIngestion({ rawPayload: parsed, kind: event.kind, workspaceDir: resolution.workspaceDir, env: _env })]
272
- : [...clearDiagnostics, diagnostic('feature_disabled', 'Set features.codex_conversation_ingestion.enabled=true in the selected Workspace .pd/config.yaml to enable bounded conversation ingestion.')];
276
+ : [...clearDiagnostics, diagnostic('feature_disabled', 'Enable bounded conversation ingestion in the selected Workspace .pd/config.yaml — in the existing "features:" block set codex_conversation_ingestion: {enabled: true} (one flat key, not nested).')];
273
277
  return { stdout: {}, exitCode: 0, stderr };
274
278
  }
275
279
  try {
@@ -176,7 +176,8 @@ export async function runCodexWorkspaceWorkerCycle(options) {
176
176
  }
177
177
  const { flags } = computeFeatureFlagsFromConfig(config.effective);
178
178
  if (flags['host.codex']?.enabled !== true) {
179
- return { ...base, mode: 'paused', reason: 'host.codex_disabled', nextAction: 'Set features.host.codex.enabled=true in the Workspace .pd/config.yaml to enable Codex PD behavior.' };
179
+ // PRI-1063 (review fix): single-line flow mapping — see catch-up.ts.
180
+ return { ...base, mode: 'paused', reason: 'host.codex_disabled', nextAction: 'Enable Codex PD behavior in the Workspace .pd/config.yaml — in the existing "features:" block set host.codex: {enabled: true} (one flat key, not nested).' };
180
181
  }
181
182
  // CR-08: liveness bookkeeping starts only after the workspace proved
182
183
  // eligible — writing into a missing workspace directory would fabricate it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/codex-adapter",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Codex CLI host adapter for Principles Disciple — implements HostAdapter interface for OpenAI Codex CLI's stdin/stdout JSON hook model (ADR-0020).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@principles/core": "^1.297.5",
37
- "@principles/host-runtime": "^0.14.2",
37
+ "@principles/host-runtime": "^0.14.3",
38
38
  "@principles/install-layout": "^0.4.0"
39
39
  },
40
40
  "devDependencies": {