@codedology/code-forge 0.3.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ waits on a second real consumer (plan §10.4, Q17).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.1] — 2026-10-01
10
+
11
+ ### Fixed
12
+
13
+ - Claude sessions: the `--json-schema` passed to the Claude CLI no longer carries the top-level `$schema` pointer, which
14
+ the CLI rejected ("no schema with key or ref"), so every Claude reviewer session failed at once and each review came
15
+ back unavailable. Validation still uses the full schema.
16
+ - Grok sessions: the answer is read from Grok's `structuredOutput`/`text` envelope, so Grok reviewer, author and System
17
+ 2 calls no longer fail schema validation (`invalid-output`).
18
+
9
19
  ## [0.3.0] — 2026-10-01
10
20
 
11
21
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codedology/code-forge",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Plan/harden/code/review orchestration CLI and Agent Skill for cross-model, parallel, evidence-gated feature delivery.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,7 +10,7 @@
10
10
  # copied install with no package next to it); `test/skill/shim.test.mjs` asserts the pin
11
11
  # equals package.json's version.
12
12
  # The shim holds no logic of its own: every verb, flag and message is the CLI's.
13
- PINNED_VERSION="0.3.0"
13
+ PINNED_VERSION="0.3.1"
14
14
  set -eu
15
15
 
16
16
  self="$0"
@@ -202,7 +202,7 @@ function buildClosedBookArgv(params) {
202
202
  argv.push('--no-session-persistence');
203
203
  if (systemPromptText !== undefined) argv.push('--system-prompt', systemPromptText);
204
204
  argv.push('--output-format', 'json');
205
- if (schema !== undefined) argv.push('--json-schema', JSON.stringify(schema));
205
+ if (schema !== undefined) argv.push('--json-schema', JSON.stringify(stripSchemaMeta(schema)));
206
206
  if (maxBudgetUsd !== undefined) argv.push('--max-budget-usd', String(maxBudgetUsd));
207
207
  argv.push('--permission-mode', 'dontAsk');
208
208
  if (!isFacts) {
@@ -222,3 +222,16 @@ export function buildClaudeArgv(params) {
222
222
  assertBaseParams('buildClaudeArgv', params);
223
223
  return params.role === 'coder' ? buildCoderArgv(params) : buildClosedBookArgv(params);
224
224
  }
225
+
226
+ /**
227
+ * The Claude CLI's `--json-schema` validator does not know the draft 2020-12 meta-schema and exits
228
+ * 1 on a top-level `$schema` naming it ("no schema with key or ref …"). The local Ajv2020 check
229
+ * keeps the full schema; only the copy handed to the CLI drops the meta-schema pointer.
230
+ * @param {unknown} schema
231
+ * @returns {unknown}
232
+ */
233
+ function stripSchemaMeta(schema) {
234
+ if (schema === null || typeof schema !== 'object' || Array.isArray(schema) || !('$schema' in schema)) return schema;
235
+ const { $schema: _meta, ...rest } = /** @type {Record<string, unknown>} */ (schema);
236
+ return rest;
237
+ }
@@ -177,8 +177,9 @@ export function readAnswer(cli, stdout, outText) {
177
177
  return { parsed: errorEvent ?? null, text, answer: tryJSON(text), usage: parseUsage('codex', usageEvent ?? null) };
178
178
  }
179
179
  const parsed = tryJSON(stdout.trim());
180
- const text = typeof parsed?.result === 'string' ? parsed.result : stdout;
181
- const answer = parsed?.structured_output ?? tryJSON(text);
180
+ // Claude's envelope carries `result` + `structured_output`; Grok's carries `text` + `structuredOutput`.
181
+ const text = typeof parsed?.result === 'string' ? parsed.result : typeof parsed?.text === 'string' ? parsed.text : stdout;
182
+ const answer = parsed?.structured_output ?? parsed?.structuredOutput ?? tryJSON(text);
182
183
  return { parsed: parsed ?? null, text, answer, usage: parseUsage(/** @type {"claude"|"grok"} */ (cli), parsed ?? null) };
183
184
  }
184
185