@c4a/context-cli 0.5.29-beta.17 → 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.
@@ -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>
@@ -65,7 +65,7 @@ decisions:
65
65
  proposed:
66
66
  content: "Runtime isolation uses sandboxing to avoid state pollution."
67
67
  confidence: confirmed
68
- source_ref: "src-2#runtime L12-14@ab12cd34ef56"
68
+ source_ref: "src-2#runtime L12-14@7a6f4c9d2e10"
69
69
  rationale: "The new evidence clarifies the same claim."
70
70
  ```
71
71
 
@@ -166,7 +166,7 @@ decisions:
166
166
  proposed:
167
167
  kind: example
168
168
  content: "The host app maps remote modules through the runtime config."
169
- source_ref: "src-1#example L32-40@ab12cd34ef56"
169
+ source_ref: "src-1#example L32-40@7a6f4c9d2e10"
170
170
  ```
171
171
 
172
172
  Final executable decisions must not carry `user_confirmation.required: true`.