@c4a/context-cli 0.5.29-beta.16 → 0.5.29-beta.18

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.
@@ -4,7 +4,7 @@ description: >
4
4
  Packaged skill invoked by `/context:compile`; not a user slash command. For one Node at a time, reads
5
5
  the CLI-provided `NodeContext` (planned metadata, raw snippets, and
6
6
  existing Sections if any), classifies every raw fragment into a Section
7
- kind via the priority chain, writes content + detail + `source_refs[]`,
7
+ kind via the priority chain, writes `body` + `source_refs[]`,
8
8
  and emits a compile draft JSON document. The CLI
9
9
  validates the actions via `context compile --draft <slug> --input - --plan`.
10
10
  Activates when `/context:compile` iterates across the confirmed align plan.
@@ -35,17 +35,17 @@ deprecate / skip` actions; emit JSON; the CLI performs every write.
35
35
  - Pick `kind` from the form of the cited raw block: code / config / command sample → `example`; verifiable rule with a check method → `spec`; stable invariant, design rule, or core mechanism → `principle`; ≥2 subjects × ≥2 dimensions → `comparison`; explicit risk or caveat → `warning`; Q+A pair → `faq`; real incident with timeline → `incident`; versioned change record → `changelog`. Reach `description` only when none of those forms fit — narrative that defines an entity, explains a mechanism, or summarises a stance. First matching form wins.
36
36
  - `kind × node.type` must satisfy the CLI Section mount matrix; mismatches get rejected at write time. When the strongest kind is blocked by mount matrix, fall to the next legal kind whose form actually fits — do not collapse to `description` just because it mounts everywhere, and do not invent thin precision (e.g. one-line `spec`) just to avoid `description` either. See [Description anti-abuse gates](#description-anti-abuse-gates) for the classification checks at the description boundary.
37
37
  - Every write action cites raw via `source_refs[]`, choosing values from `raw_snippets[].source_ref`. Use a single-element array for one citation. Treat each source ref as an opaque citation token; never fabricate, parse, dereference, or cite navigation-only blocks as evidence for a content Section.
38
- - `content` ≤256 chars; long prose goes in `detail`. If a cited raw sentence is already short, single-line, and readable, use it with `content_mode: "extract"` instead of asking AI to summarize it. Do not compress 200 readable characters into a 180-character paraphrase just to make it look rewritten.
39
- - `detail` is not an evidence echo field. Do not copy raw evidence into `detail`, do not prefix detail with labels such as `原文:`, and do not use detail only to show the raw quote. Raw evidence is traceable through `source_refs[]`.
40
- - For `example` Sections, if the cited raw snippet contains command / config / code fences, keep `content` as a short summary and preserve the relevant fenced block in `detail`; do not collapse copyable examples into prose-only summaries unless semantic review asks the user and the user accepts that compression.
41
- - Preserve documentation/reference URL blocks. If a cited raw block is primarily links (官网 / docs / reference / related links), create a small `description` Section such as "相关链接" and put every URL in `detail`; do not drop link-only evidence just because it is not prose.
42
- - For `add` and `supersede.new`, omit optional fields when empty; do not emit `detail: null`. `detail: null` only has "clear existing detail" meaning on `update`.
38
+ - Use one `body` field for Section prose. It may be long and may contain fenced code. Do not emit internal Section fields or retired extractive-contract fields; the CLI derives its internal short claim/detail split before validation.
39
+ - Set `rewrite: false` only when the raw wording is already clear and should be preserved; omit it for normal concise rewriting.
40
+ - For `example` Sections, if the cited raw snippet contains command / config / code fences, include the short summary and the relevant fenced block together in `body`; do not collapse copyable examples into prose-only summaries unless semantic review asks the user and the user accepts that compression.
41
+ - Preserve documentation/reference URL blocks. If a cited raw block is primarily links (官网 / docs / reference / related links), create a small `description` Section such as "相关链接" and keep every URL in `body`; do not drop link-only evidence just because it is not prose.
42
+ - For `add`, `update`, and `supersede.new`, omit optional fields when empty; never emit `detail: null`.
43
43
  - `refers_to_nodes[]` only carries slugs present in the context's glossary, existing Sections, or the current align plan; never invent one.
44
44
  - `supersede` is for semantic replacement; `update` is for typo / wording fixes; `deprecate` needs a `reason`; `skip` is the honest default when raw adds nothing.
45
45
  - If a note or raw snippet was reviewed and should intentionally not write active knowledge, emit `skip` with `source_refs[]` from that exact snippet. This lets semantic review record `reviewed_no_write`; a bare skip is only for deterministic no-op cases such as unchanged input or navigation-only context.
46
46
  - Any Node may legitimately compile to no Sections when the provided snippets contain only navigation (`Parent` / `Children` / `Related` / `Relations`) or placeholder text that explicitly says no detailed content is available. Emit `skip`; do not turn align summaries, parent/child lists, sibling links, or placeholders into `description` Sections. The align graph and Node metadata preserve structure; active Sections need citation-eligible content.
47
47
  - FAQ collections attach to the most specific finalized Node (Entity → Action → Domain fallback); never create a standalone FAQ container.
48
- - Output language: `content`, `detail`, Node-facing summaries, and user-facing draft explanations follow `NodeContext.generation_policy.language` when present; otherwise match the raw material. Preserve product names, code identifiers, CLI flags, slugs, `source_ref` tokens, and exact quoted evidence as printed. Kind / confidence / identifier fields stay English.
48
+ - Output language: draft `body`, Node-facing summaries, and user-facing draft explanations follow `NodeContext.generation_policy.language` when present; otherwise match the raw material. Preserve product names, code identifiers, CLI flags, slugs, `block_id` / `source_ref` tokens, and exact quoted evidence as printed. Kind / confidence / identifier fields stay English.
49
49
  - Stable output: keep action order aligned with evidence order, keep object fields in the documented schema order, omit empty optional fields, and do not add current timestamps, random ids, scratch paths, or host paths. Fixed rules and schema come from this skill; only the current NodeContext should vary between repeated Node draft calls.
50
50
 
51
51
  <reference>
@@ -60,21 +60,21 @@ deprecate / skip` actions; emit JSON; the CLI performs every write.
60
60
  "sources": ["..."], "aliases": ["..."], "summary": "...",
61
61
  "planned_sections": ["spec", "..."],
62
62
  "action_gate": {
63
- "actor_blocks": ["b0002"],
63
+ "actor_blocks": ["2f4b8c1e9a03"],
64
64
  "trigger_blocks": [],
65
- "goal_blocks": ["b0003"],
66
- "step_blocks": ["b0004"],
67
- "outcome_blocks": ["b0005"],
68
- "repeatability_or_plan_blocks": ["b0006"],
65
+ "goal_blocks": ["c0d4e5f61728"],
66
+ "step_blocks": ["8b9a0c1d2e3f"],
67
+ "outcome_blocks": ["4e2d1c0b9a88"],
68
+ "repeatability_or_plan_blocks": ["9d1e2f3a4b5c"],
69
69
  "inference_sources": {
70
- "actor": { "source_type": "explicit-block", "evidence_blocks": ["b0002"], "rationale": "..." },
71
- "outcome_or_goal": { "source_type": "explicit-block", "evidence_blocks": ["b0003"], "rationale": "..." },
72
- "repeatability_or_plan": { "source_type": "explicit-block", "evidence_blocks": ["b0006"], "rationale": "..." },
70
+ "actor": { "source_type": "explicit-block", "evidence_blocks": ["2f4b8c1e9a03"], "rationale": "..." },
71
+ "outcome_or_goal": { "source_type": "explicit-block", "evidence_blocks": ["c0d4e5f61728"], "rationale": "..." },
72
+ "repeatability_or_plan": { "source_type": "explicit-block", "evidence_blocks": ["9d1e2f3a4b5c"], "rationale": "..." },
73
73
  "answerability": { "source_type": "ref-node", "ref_nodes": ["..."], "rationale": "..." }
74
74
  }
75
75
  },
76
76
  "domain_gate": {
77
- "scope_blocks": ["b0001"],
77
+ "scope_blocks": ["7a6f4c9d2e10"],
78
78
  "child_refs": ["..."],
79
79
  "grouping_reason": "..."
80
80
  }
@@ -83,22 +83,22 @@ deprecate / skip` actions; emit JSON; the CLI performs every write.
83
83
  "language": "Chinese",
84
84
  "source": "workspace.language",
85
85
  "applies_to": ["node.title", "node.summary", "section.content", "section.detail", "user_facing_report"],
86
- "instruction": "Generate knowledge titles, summaries, Section content/detail, and user-facing reports in Chinese; preserve product names, code identifiers, CLI flags, source_ref tokens, slugs, and quoted evidence exactly when needed."
86
+ "instruction": "Generate knowledge titles, summaries, Section content/detail, and user-facing reports in Chinese; preserve product names, code identifiers, CLI flags, block_id/source_ref tokens, slugs, and quoted evidence exactly when needed."
87
87
  },
88
88
  "existing": { // present if the Node already exists
89
89
  "sections": [
90
90
  { "id": "section-1", "kind": "description", "content": "...",
91
91
  "detail": "...", "status": "active|deprecated",
92
- "confidence": "...", "source_ref": "src-1#anchor L10-14@ab12cd34ef56",
92
+ "confidence": "...", "source_ref": "src-1#anchor L10-14@7a6f4c9d2e10",
93
93
  "refers_to_nodes": [...] }
94
94
  ]
95
95
  },
96
96
  // Default NodeContext does not expose raw file paths. Copy raw_snippets[].source_ref
97
- // into draft source_refs[]; identify blocks via source_id + block_locator_id (or block_hash).
97
+ // into draft source_refs[]; copy CLI-provided block_id only for ownership challenges.
98
98
  "mentions": [ { "line": 12, "quote": "...", "source_id": "local:billing", "block_locator_id": "h2-api" } ],
99
99
  "raw_snippets": [ { "line": 10,
100
100
  "line_range": [10, 18],
101
- "source_ref": "src-1#api L10-18@ab12cd34ef56",
101
+ "source_ref": "src-1#api L10-18@7a6f4c9d2e10",
102
102
  "quote": "...context block...",
103
103
  "mention_quote": "...",
104
104
  "source_type": "local|feishu|note",
@@ -152,43 +152,31 @@ unless citation-eligible raw snippets state the same claim.
152
152
  "target_node": "<matches node.slug>",
153
153
  "actions": [
154
154
  { "op": "add", "kind": "spec",
155
- "content": "...", "detail": "...",
155
+ "body": "...",
156
+ "rewrite": false,
156
157
  "refers_to_nodes": ["..."],
157
- "source_refs": ["src-1#api L10-14@ab12cd34ef56"],
158
- "content_mode": "extract",
159
- "basis_spans": [
160
- { "source_ref": "src-1#api L10-14@ab12cd34ef56" }
161
- ]
158
+ "source_refs": ["src-1#api L10-14@7a6f4c9d2e10"]
162
159
  },
163
160
  { "op": "update", "target_section_id": "section-3",
164
- "content": "...", "detail": null, // null clears detail
161
+ "body": "...",
165
162
  "refers_to_nodes": null,
166
- "source_refs": ["src-1#api L18-21@cd34ef56ab78"],
167
- "content_mode": "minimal_paraphrase",
168
- "paraphrase_reason": "fragment_fix",
169
- "basis_spans": [
170
- { "source_ref": "src-1#api L18-21@cd34ef56ab78" }
171
- ] },
163
+ "source_refs": ["src-1#api L18-21@c0d4e5f61728"] },
172
164
  { "op": "supersede", "target_section_id": "section-5",
173
165
  "reason": "raw published a new retention value",
174
- "new": { "kind": "spec", "content": "...", "detail": "...",
166
+ "new": { "kind": "spec", "body": "...",
175
167
  "refers_to_nodes": ["..."],
176
- "source_refs": ["src-1#limits L30-34@ef56ab78cd90"],
177
- "content_mode": "extract",
178
- "basis_spans": [
179
- { "source_ref": "src-1#limits L30-34@ef56ab78cd90" }
180
- ] } },
168
+ "source_refs": ["src-1#limits L30-34@9d1e2f3a4b5c"] } },
181
169
  { "op": "deprecate", "target_section_id": "section-2", "reason": "..." },
182
170
  { "op": "skip", "reason": "no new evidence in raw snippets" },
183
171
  { "op": "skip", "reason": "reviewed; intentionally not written",
184
- "source_refs": ["src-1#note L4-8@ab12cd34ef56"] },
172
+ "source_refs": ["src-1#note L4-8@7a6f4c9d2e10"] },
185
173
  { "op": "structure_challenge",
186
174
  "challenge_id": "ch_0001",
187
175
  "kind": "missing_action_node",
188
176
  "node_slug": "<matches node.slug>",
189
177
  "action_tag": "rollout-runbook",
190
178
  "summary": "The cited evidence is a repeatable procedure.",
191
- "source_ref": "src-1#ops L40-55@cd34ef56ab78",
179
+ "source_ref": "src-1#ops L40-55@c0d4e5f61728",
192
180
  "reason": "Align must review structure before compile writes process prose." },
193
181
  { "op": "structure_challenge",
194
182
  "challenge_id": "ch_0002",
@@ -199,7 +187,7 @@ unless citation-eligible raw snippets state the same claim.
199
187
  { "op": "pending_ownership_challenge",
200
188
  "challenge_id": "och_0001",
201
189
  "node_slug": "<matches node.slug>",
202
- "block_id": "b0032",
190
+ "block_id": "2f4b8c1e9a03",
203
191
  "requested_role": "shared",
204
192
  "reason": "A visible context_only or secondary shared block contains facts that need citation." }
205
193
  ]
@@ -209,17 +197,10 @@ unless citation-eligible raw snippets state the same claim.
209
197
  `source_refs[]` values are copied from `raw_snippets[].source_ref`; a single
210
198
  citation is still written as a single-element array. Submitting singular
211
199
  `source_ref` or quoted-evidence fields is rejected with canonical repair hints.
212
- Every Section write (`add`, `update` with content/detail/source refs, and
213
- `supersede.new`) must include `content_mode` plus `basis_spans[]`. Use
214
- `content_mode: "extract"` when the cited raw sentence already fits the
215
- single-line content contract and you keep the original sentence order. If you reorder
216
- sentences, merge sentences with new punctuation, or consolidate bullets, use
217
- `content_mode: "minimal_paraphrase"` with the matching `paraphrase_reason`. Use `content_mode: "minimal_paraphrase"` only
218
- when direct extract would be malformed, too broad, duplicated, or needs
219
- multi-span consolidation; include `paraphrase_reason`.
220
- Do not mark sentence 1 + sentence 3 from the same evidence block as
221
- `extract`; non-contiguous copies are `minimal_paraphrase` even when every word
222
- came from raw evidence.
200
+ Every Section write (`add`, `update` with body/source refs, and
201
+ `supersede.new`) uses `body`. Keep one coherent fact group per action; when
202
+ one Section summarizes contiguous multi-block evidence, list every relevant
203
+ source ref in order under `source_refs[]`.
223
204
  `structure_challenge` and `pending_ownership_challenge` do not write Sections;
224
205
  the CLI stores them as workflow payloads and close exposes them as debt until
225
206
  align resolution handles them. Supported structure challenge kinds include
@@ -357,27 +338,21 @@ For each existing Section:
357
338
 
358
339
  For each change from Steps 2-3:
359
340
 
360
- 1. Split the cited block into `content` and `detail` so the Section is independently addressable in retrieval. `content` (≤256 chars) carries the Section's identity — for `example` / `spec` / `incident` that is the load-bearing identifiers the cited block hinges on (command name, key flags, field names, distinguishing values, mode names, error codes); for `principle` / `description` / `decision` / `comparison` / `warning` / `faq` / `changelog` it is the claim itself in raw's own terms. If the raw sentence already fits this shape, keep it as an extract instead of summarizing it. `detail` carries active knowledge that cannot fit in `content`, especially copyable code/config/URL/table material. Prefer splitting prose into separate supported Sections over storing a raw prose quote in `detail`. Do not put the raw evidence itself into `detail` as a "source copy"; the rendered Section already carries source_ref, and the CLI can resolve the raw evidence from that token.
361
- 2. Keep `content` and `detail` faithful to the cited raw terms: do not introduce acronyms, abbreviations, translations, or aliases that do not appear in the cited raw snippet unless raw itself defines the equivalence or the user confirms it later during semantic review.
362
- 3. If the cited block contains documentation/reference URLs, preserve them in `content` or `detail`. Link-only blocks are still useful knowledge; use `kind: description` with a concise "相关链接" identity when no more specific kind applies.
341
+ 1. Write `body` as the Section text the reader should see. It can include long prose, URLs, tables, command/config/code fences, or short raw wording. Keep one coherent, cited fact group per action; the CLI derives the internal `content`/`detail` split.
342
+ 2. Keep `body` faithful to the cited raw terms: do not introduce acronyms, abbreviations, translations, or aliases that do not appear in the cited raw snippet unless raw itself defines the equivalence or the user confirms it later during semantic review. Use `rewrite: false` when preserving raw expression is the least surprising representation.
343
+ 3. If the cited block contains documentation/reference URLs, preserve them in `body`. Link-only blocks are still useful knowledge; use `kind: description` with a concise "相关链接" identity when no more specific kind applies.
363
344
  4. Omit `confidence` for ordinary confirmed claims. Assign `confidence` per the [Confidence rubric](#confidence-rubric) only when the evidence is not confirmed.
364
345
  5. Fill `refers_to_nodes[]` per [Glossary and refers_to_nodes](#glossary-and-refers_to_nodes).
365
346
  6. Cite evidence with `source_refs[]`, picking values from `raw_snippets[].source_ref`. When one Section summarizes contiguous multi-block evidence, list every relevant source ref in order under `source_refs[]`; the CLI verifies that the refs can collapse to one canonical citation token. If the evidence is non-contiguous or contains separable claims, split the draft into separately cited actions instead of stretching one action across unrelated blocks. For `skip`, include `source_refs[]` only when the skip represents reviewed no-write material; omit evidence for purely deterministic no-ops such as unchanged input. Never submit singular `source_ref` or quoted-evidence fields; the CLI rejects them.
366
- 7. Add the extractive contract to every Section write: `content_mode`,
367
- `basis_spans[]`, and `paraphrase_reason` when `content_mode` is
368
- `minimal_paraphrase`. Each `basis_spans[]` entry contains only
369
- `source_ref`; the CLI resolves cited text and computes the audit basis
370
- internally. When one short basis span is already a valid `content`, choose
371
- `content_mode: "extract"`.
372
- 8. If evidence implies a missing Action, missing `depends_on`, wrong parent, or
347
+ 7. If evidence implies a missing Action, missing `depends_on`, wrong parent, or
373
348
  needed ownership upgrade from `context_only`, emit the corresponding
374
349
  challenge action instead of forcing the content into a Section.
375
350
  `pending_ownership_challenge.requested_role` is `owned` or `shared`.
376
351
 
377
- Rendered knowledge uses the short claim as the visible blockquote and renders
378
- `detail` as a collapsed Details block under that claim. A reader should be able
379
- to understand the Section from `content` first; `detail` is supporting active
380
- knowledge, not a hidden evidence copy.
352
+ Rendered knowledge uses a CLI-derived short claim as the visible blockquote and
353
+ renders longer supporting material from `body` as collapsed Details when needed.
354
+ A reader should be able to understand the Section from the short claim first;
355
+ long supporting material is active knowledge, not a hidden evidence copy.
381
356
 
382
357
  ### Step 5 — Emit the JSON
383
358
 
@@ -388,11 +363,10 @@ Emit one compile draft JSON document for the caller to pass to `context compile
388
363
  - [ ] `target_node` equals `node.slug` — if not, **Step 5**.
389
364
  - [ ] Every `add` / `supersede.new` has a legal kind × type combination — if not, **Step 2**.
390
365
  - [ ] Every action's `source_refs[]` entries appear in `raw_snippets[].source_ref` for this NodeContext, and no action carries singular `source_ref` or quoted-evidence fields — if not, **Step 4**; pick the right source ref, split non-contiguous claims, or use `skip` only when raw has no write-worthy fact.
391
- - [ ] Every Section write has `content_mode` and `basis_spans[]`; every
392
- `minimal_paraphrase` has `paraphrase_reason` — if not, **Step 4**.
393
- - [ ] Short, readable, single-line evidence was not rewritten just for style. If it already fits `content`, switch to `content_mode: "extract"` if not, **Step 4**.
394
- - [ ] `content` does not add new hard terms, acronyms, abbreviations, translations, URLs, code literals, versions, or aliases absent from the cited raw snippet if it does, either use the raw wording, move the extra explanation into a user-confirmed decision later, or **Step 4**.
395
- - [ ] No `add` / `supersede.new` action contains `detail: null` — omit `detail` instead.
366
+ - [ ] Every Section write uses `body` and cites `source_refs[]`; no action uses `content`, `detail`, singular `source_ref`, extractive-contract fields, or quoted-evidence fields — if not, **Step 4**.
367
+ - [ ] Short, readable, single-line evidence was not rewritten just for style. If it is already clear, keep the raw wording in `body` and set `rewrite: false` — if not, **Step 4**.
368
+ - [ ] `body` does not add new hard terms, acronyms, abbreviations, translations, URLs, code literals, versions, or aliases absent from the cited raw snippet — if it does, either use the raw wording, move the extra explanation into a user-confirmed decision later, or **Step 4**.
369
+ - [ ] No action contains `detail` or `content` — use `body` instead.
396
370
  - [ ] No `description` action that would fail the anti-abuse gates — if any, **Step 2**.
397
371
  - [ ] Every citation-eligible raw URL block is either preserved in a Section or intentionally skipped with evidence and reason; if not, **Step 4**.
398
372
  - [ ] Dense raw material was not collapsed into one broad Section. If `raw_snippets[]` spans many locator areas and only one write action exists, return to **Step 2** unless the remaining snippets are duplicates, navigation-only, or already covered by existing Sections.
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: skill-compile-judge
3
+ description: >
4
+ Packaged skill invoked by `/context:compile`; not a user slash command. Consumes the full compile prepare payload,
5
+ judges each draft action's source support and relation to listed candidates,
6
+ and emits a compile.judge-decisions.v1 document for `context reconcile review`.
7
+ tools:
8
+ - Bash
9
+ ---
10
+
11
+ # skill-compile-judge — judge compile support and relation
12
+
13
+ Decide whether each prepared compile item is supported by cited raw evidence
14
+ and how it relates to the candidate Sections listed by the CLI. Emit judge
15
+ decisions only; the CLI reviews, applies, and writes every workspace change.
16
+
17
+ ## TL;DR — Non-negotiables
18
+
19
+ - Input is the full compile prepare payload. Compact summaries are only a pointer; if needed, load the full payload with the `workflow_payload.show_command` from `context compile --draft ... --prepare`.
20
+ - Do not inspect workspace storage directly or run ad-hoc scripts to reconstruct candidates. Use only `items[]`, `evidence[]`, `source_support` diagnostics, `candidates[]`, `previous_decisions[]`, and `judge_handoff`.
21
+ - Output exactly one JSON or YAML document with `schema_version: "compile.judge-decisions.v1"` and `decisions[]`.
22
+ - Keep one decision per prepared `item_id`, preserving prepare order.
23
+ - For support, output `support_verdict: supported | weak | unsupported` plus `support_reason`.
24
+ - For relation, output `relation_verdict: new | duplicate | supersede | conflict | merge_into` plus `relation_reason`.
25
+ - Compare only the candidates listed on that item. Do not perform workspace-wide BM25, grep, or source-file searches.
26
+ - Fill `compared_section_ids` with every visible candidate Section id you inspected and set `compared_count` to the total candidate count inspected across pages. If candidates are paged, continue until `compared_count >= candidate_total` before final output.
27
+ - Escape hatch: when an item has no candidates, `relation_verdict: new` with `compared_section_ids: []` and `compared_count: 0` is valid and expected.
28
+ - For `duplicate`, `supersede`, `conflict`, or `merge_into`, set `target_section_id` to the matched candidate Section id.
29
+ - Same `source_ref` can support different Section kinds only when the semantic role differs. Detect and explain same-source-ref multi-kind cases instead of treating them as automatic duplicates.
30
+ - Weak support is a warning-level verdict, not permission to invent missing facts. Unsupported support should normally pair with `conflict` or a later user question rather than a write decision.
31
+
32
+ <reference>
33
+
34
+ ## Output Shape
35
+
36
+ ```yaml
37
+ schema_version: "compile.judge-decisions.v1"
38
+ mode: compile
39
+ decisions:
40
+ - item_id: claim-001
41
+ support_verdict: supported
42
+ support_reason: "The cited raw block explicitly states the same invoice handling behavior."
43
+ relation_verdict: new
44
+ relation_reason: "No listed candidate covers this claim."
45
+ compared_section_ids: []
46
+ compared_count: 0
47
+ ```
48
+
49
+ For a relation against an existing candidate:
50
+
51
+ ```yaml
52
+ schema_version: "compile.judge-decisions.v1"
53
+ mode: compile
54
+ decisions:
55
+ - item_id: claim-002
56
+ support_verdict: supported
57
+ support_reason: "The cited evidence covers the correction."
58
+ relation_verdict: supersede
59
+ relation_reason: "section-3 states the older behavior and should be replaced."
60
+ target_section_id: section-3
61
+ compared_section_ids: [section-3, section-7]
62
+ compared_count: 2
63
+ ```
64
+
65
+ ## Verdict Meanings
66
+
67
+ | field | value | Meaning |
68
+ |---|---|---|
69
+ | `support_verdict` | `supported` | Cited raw evidence covers the claim's hard facts. |
70
+ | `support_verdict` | `weak` | The evidence plausibly supports an ordinary summary, but review may ask for confirmation. |
71
+ | `support_verdict` | `unsupported` | The claim adds facts or boundaries not present in cited raw evidence. |
72
+ | `relation_verdict` | `new` | No listed candidate already covers the proposed knowledge. |
73
+ | `relation_verdict` | `duplicate` | A listed candidate already covers the same claim. |
74
+ | `relation_verdict` | `supersede` | A listed candidate is stale or wrong and should be replaced by the new claim. |
75
+ | `relation_verdict` | `conflict` | The prepared claim and candidate disagree and need user resolution. |
76
+ | `relation_verdict` | `merge_into` | The prepared claim should update or refine one listed candidate. |
77
+
78
+ </reference>
79
+
80
+ <procedures>
81
+
82
+ ### Step 1 — Load Full Prepare Payload
83
+
84
+ If the caller gave compact prepare output, use its workflow payload command to
85
+ load the full `prepare` payload. Do not infer missing candidates from memory.
86
+
87
+ ### Step 2 — Judge Support
88
+
89
+ For each item, read the proposed content and cited evidence. Use
90
+ `source_support` only as a diagnostic hint; final support is your semantic
91
+ verdict from the cited raw evidence.
92
+
93
+ ### Step 3 — Judge Relation
94
+
95
+ Compare the proposed claim against each listed candidate. Track every
96
+ visible candidate Section id in `compared_section_ids`, and set
97
+ `compared_count` to the total candidate count inspected across pages. If the
98
+ candidate list is empty, emit `new` with an empty compared list and
99
+ `compared_count: 0`.
100
+
101
+ ### Step 4 — Emit Judge Decisions
102
+
103
+ Return only the `compile.judge-decisions.v1` document. The caller passes it
104
+ directly to `context reconcile review --prepare-digest <digest> --decisions -`.
105
+
106
+ </procedures>
@@ -31,6 +31,7 @@ CLI-prepared context. Emit decisions only; the CLI performs every write.
31
31
  - `merge_update` is legal only when the final Section content is supported by one valid `source_ref`; otherwise use `keep_separate`, `split_then_reanchor`, or `ask_user`.
32
32
  - Unresolved conflicts and low-confidence support questions must be `action: ask_user`.
33
33
  - `context reconcile review` may return `support_confirmation` for a weakly supported `keep_separate`. Ask the user. If review provides the same `group_key` on several ordinary summary/compression questions, group them into one compact confirmation; do not group missing hard facts, new facts, or different evidence boundaries. If the user confirms, emit the same final write actions with `decided_by: user`; do not apply an `ask_user` decision.
34
+ - Auto mode, long-running authorization, or permission to proceed is not user confirmation. Never use it as a reason to write `decided_by: user`.
34
35
  - If review returns `context-only-leakage-high`, stop before apply and follow its `agent_hints[]`: use `rewrite_with_owned_basis` only when owned or shared-primary citation evidence can support the same claim, `skip_for_node` when no citation-eligible basis exists and the claim is not core to that Node, or `pending_ownership_challenge` when a context-only or secondary shared block should be upgraded into owned/shared-primary evidence.
35
36
  - The caller applies a ready review by running plain `context reconcile apply` against the current workflow scope. Apply has no input-file path; do not extract `apply_document` with scripts.
36
37
  - Stable output: preserve prepared item order, keep decision object fields in the documented order, omit empty optional fields, and do not add current timestamps, random ids, storage paths, or host absolute paths. The fixed protocol and action table come first; only the prepared context should vary between repeated review calls.
@@ -64,7 +65,7 @@ decisions:
64
65
  proposed:
65
66
  content: "Runtime isolation uses sandboxing to avoid state pollution."
66
67
  confidence: confirmed
67
- source_ref: "src-2#runtime L12-14@ab12cd34ef56"
68
+ source_ref: "src-2#runtime L12-14@7a6f4c9d2e10"
68
69
  rationale: "The new evidence clarifies the same claim."
69
70
  ```
70
71
 
@@ -107,7 +108,8 @@ If review returns `example_detail_preservation`, the cited example evidence
107
108
  contains a command / config / code fence that was not preserved in
108
109
  `proposed.detail`. Prefer regenerating the decision with the relevant fenced
109
110
  block in `proposed.detail`; only keep a prose-only example summary after asking
110
- the user and marking the final decision `decided_by: user`.
111
+ the user and marking the final decision `decided_by: user`. Auto mode or
112
+ permission to continue is not that confirmation.
111
113
 
112
114
  The support gate exists to prevent orphan claims and false evidence links, not
113
115
  to optimize retrieval. Prefer preserving a precise raw-backed claim over
@@ -148,7 +150,7 @@ separately. If confirmed, regenerate the same executable decision with
148
150
  `decided_by: user`; if not confirmed, choose stricter evidence or leave an
149
151
  `ask_user` item unresolved and stop before apply. User confirmation only
150
152
  permits weak support; it does not permit unsupported evidence or missing hard
151
- facts.
153
+ facts. Auto mode or permission to continue is not user confirmation.
152
154
 
153
155
  `decided_by` is a top-level decision field, not a `proposed` field:
154
156
 
@@ -164,7 +166,7 @@ decisions:
164
166
  proposed:
165
167
  kind: example
166
168
  content: "The host app maps remote modules through the runtime config."
167
- source_ref: "src-1#example L32-40@ab12cd34ef56"
169
+ source_ref: "src-1#example L32-40@7a6f4c9d2e10"
168
170
  ```
169
171
 
170
172
  Final executable decisions must not carry `user_confirmation.required: true`.