@c4a/context-cli 0.6.0-beta.8 → 0.6.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/LICENSE +21 -0
- package/README.md +129 -137
- package/cli.js +1573 -3320
- package/package.json +18 -3
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/skills/skill-review-gate/SKILL.md +0 -3
- package/plugins/claude/skills/skill-source-scope/SKILL.md +0 -6
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +0 -3
- package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +0 -6
- package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +0 -3
- package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +0 -6
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor/skills/skill-review-gate/SKILL.md +0 -3
- package/plugins/cursor/skills/skill-source-scope/SKILL.md +0 -6
- package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +0 -3
- package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +0 -6
- package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +0 -3
- package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +0 -6
- package/plugin/.claude-plugin/plugin.json.template +0 -16
- package/plugin/.codex-plugin/plugin.json.template +0 -38
- package/plugin/.cursor-plugin/plugin.json.template +0 -29
- package/plugin/README.md +0 -158
- package/plugin/README_CN.md +0 -142
- package/plugin/assets/icon.svg +0 -3
- package/plugin/assets/logo.svg +0 -3
- package/plugin/assets/workflow-en.png +0 -0
- package/plugin/assets/workflow.png +0 -0
- package/plugin/commands/continue.md +0 -34
- package/plugin/commands/init.md +0 -21
- package/plugin/skills/skill-continue-workflow/SKILL.md +0 -235
- package/plugin/skills/skill-init-workspace/SKILL.md +0 -74
- package/plugin/skills/skill-package-output/SKILL.md +0 -180
- package/plugin/skills/skill-prose-align/SKILL.md +0 -322
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugin/skills/skill-prose-compile/SKILL.md +0 -287
- package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugin/skills/skill-review-gate/SKILL.md +0 -141
- package/plugin/skills/skill-source-scope/SKILL.md +0 -531
- package/plugin/skills/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/assets/icon.svg +0 -3
- package/plugins/assets/workflow-en.png +0 -0
- package/plugins/assets/workflow.png +0 -0
- package/plugins/codex/assets/workflow-en.png +0 -0
- package/plugins/codex/assets/workflow.png +0 -0
- package/plugins/cursor/assets/icon.svg +0 -3
- package/plugins/cursor/assets/workflow-en.png +0 -0
- package/plugins/cursor/assets/workflow.png +0 -0
- package/scripts/build-plugin.ts +0 -658
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Structural and ownership challenges
|
|
2
|
-
|
|
3
|
-
Consult this reference when the cited evidence **cannot be written as a Section under the current confirmed structure**:
|
|
4
|
-
|
|
5
|
-
- The evidence describes a coherent process that should be its own `action` Node (not a Section here).
|
|
6
|
-
- The evidence implies a missing `depends_on` edge between Nodes.
|
|
7
|
-
- The evidence belongs under a different parent Node.
|
|
8
|
-
- A finalized shared-block split leaves this Node with only secondary, non-citable evidence.
|
|
9
|
-
- A visible `context_only` or secondary-shared block contains facts that need citation, requiring an ownership upgrade.
|
|
10
|
-
|
|
11
|
-
In these cases, do **not** force the content into a Section. The current
|
|
12
|
-
`context.compile-actions.v1` schema does not accept challenge actions. Stop the
|
|
13
|
-
compile draft for this Node, report the structure defect, and return to the
|
|
14
|
-
prose align gate so the structure can be revised as `unresolved[]`, a corrected
|
|
15
|
-
node, a corrected section plan, or a typed edge.
|
|
16
|
-
|
|
17
|
-
## When to challenge vs. when to skip
|
|
18
|
-
|
|
19
|
-
| Situation | Route |
|
|
20
|
-
|---|---|
|
|
21
|
-
| Evidence is a repeatable procedure with steps that clearly warrant a sub-Action | Return to align and propose a new or corrected `action` node. |
|
|
22
|
-
| Evidence depends on a Node that the current structure does not link to this Node | Return to align and add a source-backed typed edge such as `depends_on`, `prerequisite`, or `applies_to`, or keep it in `unresolved[]` when evidence/target is incomplete. |
|
|
23
|
-
| Evidence belongs under a different parent | Return to align and move the planned section source refs to the correct node. |
|
|
24
|
-
| The planned section has no primary source-backed evidence for this Node | Return to align and revise section ownership/source refs, or remove the node if it should not exist. |
|
|
25
|
-
| The Node should not exist because its evidence belongs elsewhere | Return to align and remove or replace the node before compile. |
|
|
26
|
-
| Background/context evidence holds facts this Node needs to cite | Return to align and make those source refs owned by the correct planned section, or keep the issue unresolved. |
|
|
27
|
-
|
|
28
|
-
Use challenge labels only as private reasoning labels in your user explanation.
|
|
29
|
-
Do not put them in `context.compile-actions.v1`.
|
|
30
|
-
|
|
31
|
-
## Report shape
|
|
32
|
-
|
|
33
|
-
When this reference triggers, do not submit a compile payload for the affected
|
|
34
|
-
Node. Report a compact structure repair request to the user and the align gate:
|
|
35
|
-
|
|
36
|
-
```jsonc
|
|
37
|
-
{
|
|
38
|
-
"reason_code": "structure_reconfirmation_required",
|
|
39
|
-
"issue": "missing_action_node",
|
|
40
|
-
"view_ref": "<matches selected view_ref>",
|
|
41
|
-
"summary": "The cited evidence is a repeatable procedure.",
|
|
42
|
-
"source_refs": ["file:docs/runbook.md#span:ops L40-55@<span-hash>"],
|
|
43
|
-
"align_repair": "Add a supported action node or keep the issue in unresolved[]."
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
The actual committed repair is a revised `context.structure.v1` payload. Use
|
|
48
|
-
the align schema and validation diagnostics for that repair; do not invent a
|
|
49
|
-
compile action shape.
|
|
50
|
-
|
|
51
|
-
## What these are NOT
|
|
52
|
-
|
|
53
|
-
- **Not a substitute for `skip`** when raw simply has no write-worthy fact for this Node.
|
|
54
|
-
- **Not a Section.** Structure defects never appear in active knowledge.
|
|
55
|
-
- **Not a compile action.** Do not encode them as `op` values in
|
|
56
|
-
`context.compile-actions.v1`.
|
|
57
|
-
- **Not a free retargeting path.** Do not switch `view_ref`, `section_id`, or
|
|
58
|
-
`source_refs[]` inside compile merely to make validation pass. The confirmed
|
|
59
|
-
structure must be repaired first.
|
|
60
|
-
- **Not a free upgrade path.** Exact text views expose visible evidence text for
|
|
61
|
-
inspection, but they do not change section ownership. If you need to cite
|
|
62
|
-
background content, return to align and revise ownership/source refs.
|
|
63
|
-
|
|
64
|
-
## How this slots into the main procedure
|
|
65
|
-
|
|
66
|
-
- **Step 3 — Build actions**: when evidence implies a missing Action, missing
|
|
67
|
-
edge, wrong parent, or needed ownership/source-ref repair, stop the compile
|
|
68
|
-
draft for this Node and return to align instead of writing a Section.
|
|
69
|
-
- **Step 5 — Self-verify**: no Section write cites source refs outside the
|
|
70
|
-
planned section ownership; if any did, remove the action and return to align.
|
|
71
|
-
- **Review handoff**: if a user asks why compile stopped, explain the structure
|
|
72
|
-
effect plainly: paths, ownership, and relations are frozen at compile time, so
|
|
73
|
-
these repairs need a new confirmed structure rather than a draft-page patch.
|
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: compile-actions
|
|
3
|
-
description: >
|
|
4
|
-
Internal procedure invoked by the current compile gate; not a user slash
|
|
5
|
-
command. For one View at a time, reads the CLI-provided node-context
|
|
6
|
-
(planned metadata, planned sections, local source aliases, and source refs),
|
|
7
|
-
classifies each planned source span into a Section kind via the priority
|
|
8
|
-
chain, writes source-bound actions with section_id, kind, required summary,
|
|
9
|
-
source_refs[], and emits a context.compile-actions.v1 document
|
|
10
|
-
for the caller to submit to the current phase command.
|
|
11
|
-
Activates when compile iterates across the confirmed align structure.
|
|
12
|
-
tools:
|
|
13
|
-
- Bash
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
# compile-actions — write Section actions for one View
|
|
17
|
-
|
|
18
|
-
Classify source-backed planned evidence for one materialized View into `add`, `update`, or
|
|
19
|
-
`skip` actions; emit JSON; the CLI performs every write. Replacement or
|
|
20
|
-
withdrawal judgments stay in user/structure review unless the schema view
|
|
21
|
-
explicitly exposes a current write shape.
|
|
22
|
-
|
|
23
|
-
## TL;DR — Non-negotiables
|
|
24
|
-
|
|
25
|
-
- One View per invocation — `view_ref` MUST equal the selected `view_ref`; no cross-View writes. Finish the current View's draft quality checks before the caller moves to another View's review/apply loop.
|
|
26
|
-
- Agent emits JSON only; no markdown, no direct workspace file writes. The caller submits the JSON to the current phase command; the CLI validates and stores candidate state.
|
|
27
|
-
- Evidence boundary: treat the CLI-provided node-context and evidence views as
|
|
28
|
-
complete. Cite only source refs already planned on the selected section.
|
|
29
|
-
If exact text is needed before choosing kind/summary/content, read it through
|
|
30
|
-
current evidence views such as
|
|
31
|
-
`context run align:<type>:<source>:<collection> --view span-detail --span <source-ref> --format json`
|
|
32
|
-
or `--view span-text`. Never `grep` / `sed` / `jq` / `cat` / `head`
|
|
33
|
-
snapshots, `--format json` stdout, or agent scratch files.
|
|
34
|
-
- Actions are candidate write actions, not final semantic decisions. Op naming
|
|
35
|
-
is scoped by schema: `actions[]` already targets Sections, so Section
|
|
36
|
-
lifecycle ops are verb-only: `add`, `update`, and `skip`. Do not use
|
|
37
|
-
align-style names such as `add_section`, `write_section`, or
|
|
38
|
-
`propose_section`.
|
|
39
|
-
- Citation validation passing is not completion. Before emitting, estimate
|
|
40
|
-
coverage from the planned section refs: if there are 3+ citation-eligible
|
|
41
|
-
spans, a one-action draft is valid only when the later spans are duplicates,
|
|
42
|
-
navigation, placeholders, or continuations of the same fact. Small dense docs
|
|
43
|
-
still need multiple actions when later spans state distinct capabilities,
|
|
44
|
-
constraints, examples, risks, FAQ, or usage notes. Large manuals/design docs
|
|
45
|
-
should compile to several orthogonal actions in the same draft.
|
|
46
|
-
- Pick `kind` from the current compile schema view, especially legal values and
|
|
47
|
-
mount rules. Treat kind precision as a drafting quality preference, not a
|
|
48
|
-
reason to loop forever when the CLI accepts the write. A `decision` fits only
|
|
49
|
-
when the source explicitly presents two or more alternatives or options and
|
|
50
|
-
records the chosen path plus rationale. One-option policy conclusions are
|
|
51
|
-
usually `spec`, `principle`, or `description`. Bare rules or checks are usually
|
|
52
|
-
`spec`. Reach `description` only after every more specific kind fails.
|
|
53
|
-
- `node.sections[]` / `planned_sections[]` is the confirmed structure scaffold,
|
|
54
|
-
not a loose suggestion. Prefer a planned kind when the evidence fits; if a
|
|
55
|
-
source-backed stronger kind differs, validate it and let CLI diagnostics guide
|
|
56
|
-
review.
|
|
57
|
-
- `kind × node.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.
|
|
58
|
-
- The schema view exposes `legal_section_kinds`, `section_kind_priority`,
|
|
59
|
-
`section_kind_triggers`, and `section_kind_mount_matrix`. CLI validation
|
|
60
|
-
rejects unknown kinds and kind/node_type mount violations; treat those as
|
|
61
|
-
structure or drafting errors, not review-time style preferences.
|
|
62
|
-
- Every write action cites raw via `source_refs[]` copied from the chosen
|
|
63
|
-
planned section. Omitted-content verbatim actions must use one contiguous
|
|
64
|
-
same-document evidence run; split non-contiguous evidence into multiple
|
|
65
|
-
sections or return to prose align when the confirmed section is too coarse.
|
|
66
|
-
Do not use explicit `content` / `content_intent` as a shortcut to merge
|
|
67
|
-
unrelated or non-contiguous source spans into a shorter summary. Never
|
|
68
|
-
fabricate refs or cite navigation-only spans as evidence for a content
|
|
69
|
-
Section.
|
|
70
|
-
- For large evidence, use `source-index` to choose refs and `span-detail` /
|
|
71
|
-
`span-text` only for the spans an action needs.
|
|
72
|
-
- `content` is not accepted on source-backed writes. Cite with `source_refs[]`
|
|
73
|
-
and let the CLI mirror source into content. If the problem is non-contiguous
|
|
74
|
-
source refs, dense examples, a needed translation, or a too-broad planned
|
|
75
|
-
section, split the section through align instead of writing a compressed or
|
|
76
|
-
summarized `content` paragraph. Prefer `summary` on `add` / `update` when
|
|
77
|
-
it adds useful recall value; omit it when the View or Section title is already
|
|
78
|
-
self-explanatory. Summary is recall text, not evidence. This summary is only
|
|
79
|
-
the behavior half: the CLI derives any reachability half from confirmed
|
|
80
|
-
structure edges after validation, so do not add relation summaries or edge
|
|
81
|
-
fields to the action payload.
|
|
82
|
-
The CLI
|
|
83
|
-
rejects unsupported fields (`body`, `detail`, `raw`, singular `source_ref`,
|
|
84
|
-
quoted-evidence) with canonical repair hints.
|
|
85
|
-
- The CLI also rejects template-like explicit `content`: bare TODO/TBD,
|
|
86
|
-
`<placeholder>`, deferred-content placeholders, source-omission text such as
|
|
87
|
-
"see source text", and directory lead-ins such as "this section describes" or
|
|
88
|
-
"本节介绍". Only preserve such markers when they are literally present in the
|
|
89
|
-
cited source text and are themselves the fact being documented.
|
|
90
|
-
- Preserve user-facing Markdown structure from cited raw when it carries meaning: inline code/code fences, Markdown links and URLs, blockquotes, list nesting, tables, and emphasis around key terms. Summary remains plain text; the materialized mirrored Section body may preserve raw Markdown when that is the clearest faithful Section text. Do not patch solely for style cleanup unless the cited source meaning is materially lost.
|
|
91
|
-
- Do not synthesize a user-facing prefix by concatenating `heading_path` values (for example, `Parent - Child:`) when that prefix is not in the cited raw. Use headings only to choose grouping and framing; if a heading's wording is itself useful, keep it as sourced content only when it appears in the cited span text.
|
|
92
|
-
- Preserve source-backed URLs, code identifiers, or `source_ref` literals when
|
|
93
|
-
they are part of reader-facing knowledge or a repair challenge. Do not rely on
|
|
94
|
-
memorized URL rules, and do not add literals only for scoring or traceability.
|
|
95
|
-
- Relationships and cross-node references belong in confirmed structure edges,
|
|
96
|
-
not in compile action fields or verbatim body. Do not add structure edges or unresolved relations
|
|
97
|
-
to `context.compile-actions.v1`.
|
|
98
|
-
- `skip` is the honest default when source evidence adds nothing. Bare `skip`
|
|
99
|
-
is only for deterministic no-ops such as unchanged input, pure navigation, or
|
|
100
|
-
context/background snippets. When citation-eligible evidence was reviewed and
|
|
101
|
-
intentionally not written, emit `skip` with the relevant `source_refs[]`.
|
|
102
|
-
- 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; narrow context-only navigation/reference blocks may be rendered later as a `References` auto-block, while active Sections still need citation-eligible content.
|
|
103
|
-
- FAQ collections attach to the most specific finalized Node (Entity → Action → Domain fallback); never create a standalone FAQ container.
|
|
104
|
-
- Output language: Node-facing summaries and user-facing draft explanations
|
|
105
|
-
follow the workspace/source language when the phase view exposes one;
|
|
106
|
-
otherwise match the source material. Section `summary` is reader/query aid:
|
|
107
|
-
write Chinese summary prose for clearly Chinese cited evidence or mirrored
|
|
108
|
-
content; English summary prose is acceptable for clearly English evidence;
|
|
109
|
-
mixed technical evidence may keep concise mixed-language terms. Mirrored
|
|
110
|
-
content is source-bound: preserve the cited source language, product names,
|
|
111
|
-
code identifiers, CLI flags, slugs, `source_ref` tokens, and exact quoted
|
|
112
|
-
evidence as printed.
|
|
113
|
-
- Stable output: keep action order aligned with evidence order — that ordering
|
|
114
|
-
is the only stability concern the CLI cannot enforce. The CLI rejects unknown
|
|
115
|
-
fields (timestamps, random ids, host/scratch paths) and canonicalises stored
|
|
116
|
-
payloads; fixed rules and schema come from this skill, so only the current
|
|
117
|
-
node-context should vary between repeated View draft calls.
|
|
118
|
-
|
|
119
|
-
## Edge cases — consult references when:
|
|
120
|
-
|
|
121
|
-
| Condition | Reference |
|
|
122
|
-
|---|---|
|
|
123
|
-
| `node.node_type` is `action` or `domain` | [compile-actions/references/action-domain-gates.md](compile-actions/references/action-domain-gates.md); use current `node-context` fields, planned sections, edges, and source refs |
|
|
124
|
-
| current schema/view exposes note evidence | [compile-actions/references/notes.md](compile-actions/references/notes.md) |
|
|
125
|
-
| `existing.sections[]` non-empty, **or** `incremental.status` is `unchanged` / `full-context`, **or** `incremental.locator_only_changes[]` non-empty | [compile-actions/references/refresh-and-update.md](compile-actions/references/refresh-and-update.md) |
|
|
126
|
-
| evidence implies missing Action / wrong parent / `depends_on` gap / planned-section ownership repair | [compile-actions/references/structural-challenges.md](compile-actions/references/structural-challenges.md) |
|
|
127
|
-
|
|
128
|
-
If none of the above hold, you are on the main path (first compile of an entity Node with default `changed-only` incremental status). The procedure below covers that path end-to-end.
|
|
129
|
-
|
|
130
|
-
<reference>
|
|
131
|
-
|
|
132
|
-
## Input — node-context
|
|
133
|
-
|
|
134
|
-
Canonical shape: `context run compile:<type>:<source>:<collection> --view node-context --source <view-ref> --format json` (or `--format json`). The CLI is the source of truth for fields, enums, and produced-by paths.
|
|
135
|
-
|
|
136
|
-
Boundary recap:
|
|
137
|
-
|
|
138
|
-
- `view_ref` is the active write boundary. The payload `view_ref` must match
|
|
139
|
-
the selected view; do not draft for another view because the evidence looks
|
|
140
|
-
related.
|
|
141
|
-
- `planned_sections[]` and their `source_refs[]` are the evidence floor. Never
|
|
142
|
-
cite outside the selected planned section unless you first return to align and
|
|
143
|
-
reconfirm structure.
|
|
144
|
-
- `local_sources[]` are aliases for source refs inside the node-context view.
|
|
145
|
-
Preserve CLI-returned refs exactly in the payload.
|
|
146
|
-
- `existing.sections[]`, when present, means this is a refresh path. Read
|
|
147
|
-
[compile-actions/references/refresh-and-update.md](compile-actions/references/refresh-and-update.md)
|
|
148
|
-
before writing an `update` or deciding that no action is needed.
|
|
149
|
-
- `incremental.status`, locator-only changes, low-coverage diagnostics, and
|
|
150
|
-
repair hints are part of the compile contract. Preserve their reason in the
|
|
151
|
-
user-facing handoff when they force a skip, full-context read, or return to
|
|
152
|
-
structure confirmation.
|
|
153
|
-
- Candidate or conflict lists surfaced by the CLI are the only relation
|
|
154
|
-
comparison set. Do not search `knowledge/`, `dist/`, or source snapshots to
|
|
155
|
-
invent more candidates.
|
|
156
|
-
- When you need exact source text for kind/summary/content judgment, read only
|
|
157
|
-
the matching `span-detail` or `span-text` view for that source ref.
|
|
158
|
-
|
|
159
|
-
## Evidence Index Translation
|
|
160
|
-
|
|
161
|
-
Evidence views may expose compact indexes, grouped spans, and detail commands.
|
|
162
|
-
The committed evidence handle in the current workflow is `source_refs[]`, copied
|
|
163
|
-
from the confirmed planned section or from a CLI evidence view that the current
|
|
164
|
-
node-context explicitly points to.
|
|
165
|
-
|
|
166
|
-
Use the same discipline behind the evidence index:
|
|
167
|
-
|
|
168
|
-
- A write action cites only the refs it actually consumes. Do not attach every
|
|
169
|
-
planned ref to a broad section just to make validation pass.
|
|
170
|
-
- Omitted-content verbatim actions need one continuous same-document evidence
|
|
171
|
-
span after CLI canonicalization. If the relevant evidence is non-contiguous,
|
|
172
|
-
split it into separate sections or return to align for a confirmed section
|
|
173
|
-
split.
|
|
174
|
-
- If a planned section contains several unrelated facts, write several actions
|
|
175
|
-
when the schema allows it; otherwise return to structure confirmation and
|
|
176
|
-
split the planned section. Do not hide unrelated claims behind one summary.
|
|
177
|
-
- If the only available evidence is context/background, navigation, parent /
|
|
178
|
-
child / related lists, placeholder text, or a title-only cue, do not promote
|
|
179
|
-
it to active section body. Use `skip`, `unresolved[]`, or return to align as
|
|
180
|
-
appropriate.
|
|
181
|
-
- Source refs are not traceability padding. They are the support boundary for
|
|
182
|
-
reader-visible mirrored content and summaries. Every fact in `summary` must
|
|
183
|
-
be covered by the cited refs.
|
|
184
|
-
- Never convert CLI-visible evidence handles into new ad hoc ids, aliases, or
|
|
185
|
-
quoted evidence fields. Copy current refs exactly and let validation reject
|
|
186
|
-
stale or miscoped refs.
|
|
187
|
-
|
|
188
|
-
## Output — Compile Draft JSON (main path)
|
|
189
|
-
|
|
190
|
-
Canonical shape: `context run compile:<type>:<source>:<collection> --view schema --format json` (or `--format json`). The CLI is the source of truth for fields, enums, and validation — do not memorise the shape from this file.
|
|
191
|
-
|
|
192
|
-
Main-path ops are **`add`**, **`update`**, and **`skip`** when supported by the
|
|
193
|
-
current schema. A typical new Section action is
|
|
194
|
-
`{ op: "add", section_id: "<planned-section-id>", kind: "<chain-picked>", summary: "...", source_refs: ["<source_ref>"] }`;
|
|
195
|
-
omit `content`. Never spell that as `add_section` because the `actions[]` array
|
|
196
|
-
already names the target object. A bare skip is `{ op: "skip", reason: "..." }`;
|
|
197
|
-
a reviewed-no-write skip may carry `source_refs[]` from the planned section.
|
|
198
|
-
|
|
199
|
-
Payload shape example. This envelope is **not valid** until `actions[]`
|
|
200
|
-
contains at least one action; the CLI rejects empty `actions[]` with
|
|
201
|
-
`schema.actions_missing`.
|
|
202
|
-
|
|
203
|
-
```json
|
|
204
|
-
{
|
|
205
|
-
"schema_version": "context.compile-actions.v1",
|
|
206
|
-
"view_ref": "<matches selected view_ref>",
|
|
207
|
-
"actions": []
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
Minimal valid `add` payload:
|
|
212
|
-
|
|
213
|
-
```json
|
|
214
|
-
{
|
|
215
|
-
"schema_version": "context.compile-actions.v1",
|
|
216
|
-
"view_ref": "<matches selected view_ref>",
|
|
217
|
-
"actions": [
|
|
218
|
-
{
|
|
219
|
-
"op": "add",
|
|
220
|
-
"section_id": "<planned-section-id>",
|
|
221
|
-
"kind": "<confirmed-section-kind>",
|
|
222
|
-
"summary": "<source-backed summary>",
|
|
223
|
-
"source_refs": ["<source_ref>"]
|
|
224
|
-
}
|
|
225
|
-
]
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Minimal valid no-write payload:
|
|
230
|
-
|
|
231
|
-
```json
|
|
232
|
-
{
|
|
233
|
-
"schema_version": "context.compile-actions.v1",
|
|
234
|
-
"view_ref": "<matches selected view_ref>",
|
|
235
|
-
"actions": [
|
|
236
|
-
{
|
|
237
|
-
"op": "skip",
|
|
238
|
-
"reason": "<source-bound reason>"
|
|
239
|
-
}
|
|
240
|
-
]
|
|
241
|
-
}
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
Refresh/update judgment lives in
|
|
245
|
-
[compile-actions/references/refresh-and-update.md](compile-actions/references/refresh-and-update.md),
|
|
246
|
-
but emit only fields accepted by the current schema. Structure challenges live
|
|
247
|
-
in [compile-actions/references/structural-challenges.md](compile-actions/references/structural-challenges.md);
|
|
248
|
-
if the current schema has no challenge op, return to align rather than
|
|
249
|
-
inventing one.
|
|
250
|
-
|
|
251
|
-
`source_refs[]` is the committed evidence contract. A single citation is still
|
|
252
|
-
a single-element array. Keep hard citation gaps separate because omitted-content
|
|
253
|
-
verbatim cannot form one source ref across unrelated spans. When one Section
|
|
254
|
-
summarizes multi-span evidence, list only refs the action actually consumes.
|
|
255
|
-
Preserve raw wording by omitting `content`.
|
|
256
|
-
Preserving a cited prose/bullet list as the Section's user-facing content is
|
|
257
|
-
allowed when that list is the actual knowledge; the anti-pattern is copying raw
|
|
258
|
-
text only as traceability padding. For `example` Sections that cite command /
|
|
259
|
-
config / code fences, cite the relevant fenced block and let the CLI mirror it.
|
|
260
|
-
Inline command/code spans are not fences; if the cited raw is a numbered list
|
|
261
|
-
or prose with inline code, keep that shape and do not synthesize a ```bash```
|
|
262
|
-
block or shell commands.
|
|
263
|
-
|
|
264
|
-
## Section Kind Choice
|
|
265
|
-
|
|
266
|
-
Use `context run compile:<type>:<source>:<collection> --view schema --format json` (or yaml) for the current legal kind list, priority order, and mount matrix. This skill adds only semantic guardrails:
|
|
267
|
-
|
|
268
|
-
- Stop at the first kind whose source-backed form fits.
|
|
269
|
-
- Do not choose `description` to hide lists, rules, tables, samples, risks, choices, or Q+A evidence that has a more precise kind.
|
|
270
|
-
- When the strongest kind is not mountable on this Node type, choose the next legal kind that the evidence truly supports, or `skip` with a structural challenge reason.
|
|
271
|
-
|
|
272
|
-
Confidence is optional. Omit it for ordinary confirmed claims; set it only when the evidence is clearly verified, inferred, or speculative according to the schema enum.
|
|
273
|
-
|
|
274
|
-
## Description anti-abuse gates
|
|
275
|
-
|
|
276
|
-
`description` is the kind for narrative claims that do not match any other form. Before locking in `kind: description` for a snippet, run three classification checks against the cited span:
|
|
277
|
-
|
|
278
|
-
1. **Atomicity**: single narrative, or multi-step / multi-row / multi-config? Multi → split into the right kinds — each step into its own `spec` / `warning`, each row into a `comparison` Section, each config block into `example` (sample) or `spec` (constraint with a check method).
|
|
279
|
-
2. **Kind-precision**: does a higher-priority kind fit better? A fenced code / config / command block belongs in `example`; a comparison table belongs in `comparison`; a Q+A pair belongs in `faq`; `incident` requires dated or timestamped failure evidence with impact scope plus root cause, mitigation, or handling record; ordinary scenario, case-study, or impact-result prose is not `incident`; a versioned change record belongs in `changelog`; `decision` requires two or more surfaced alternatives or options plus a chosen path and rationale; a verifiable rule with a check method belongs in `spec`; explicit risks belong in `warning`; a stable design rule or core mechanism without a recorded choice or check method belongs in `principle`.
|
|
280
|
-
3. **Action threshold**: multi-step fragments that clear the Action bar → emit `op: skip` with a note "evidence warrants sub-Action; re-align needed"; do not create Nodes from this skill.
|
|
281
|
-
|
|
282
|
-
A Node whose raw is genuinely narrative — definitions, summaries, plain prose without enumerations or normative wording — legitimately ends with description-dominant output. The smell fires the other way: when raw contained enumerations, normative rules, or code blocks, and the draft collapsed them to `description`. Redraft from Step 2 in that case, not from a percentage threshold. Navigation-only evidence is handled separately by the TL;DR navigation rule and Step 2 — the gates above are not the right place to second-guess that path.
|
|
283
|
-
|
|
284
|
-
## Cross-Node Relations
|
|
285
|
-
|
|
286
|
-
When a Section meaningfully discusses another known Node, preserve that
|
|
287
|
-
relationship in confirmed `structure.yaml` edges or unresolved items. Do not
|
|
288
|
-
add structure edges or unresolved relations to compile actions and do not inject `[[id]]` style
|
|
289
|
-
links into verbatim body, because that breaks source mirror verification.
|
|
290
|
-
|
|
291
|
-
Use this decision chain:
|
|
292
|
-
|
|
293
|
-
1. If the relation is already a confirmed edge, compile may mention only what
|
|
294
|
-
the selected section refs state; the edge itself remains in structure.
|
|
295
|
-
2. If the source-backed section clearly depends on, compares, triggers, or
|
|
296
|
-
applies to another existing/current node but the edge is missing, stop and
|
|
297
|
-
return to prose align with a structure repair note.
|
|
298
|
-
3. If the target is only a title hint, navigation clue, unresolved external
|
|
299
|
-
system, or not present as a current/approved node, keep it in `unresolved[]`;
|
|
300
|
-
do not invent a NodeRef to make the relation fit.
|
|
301
|
-
4. If another node name appears incidentally inside an example, command, URL, or
|
|
302
|
-
product list and does not change the section's retrieval meaning, keep the
|
|
303
|
-
source text as-is and do not add a relationship.
|
|
304
|
-
|
|
305
|
-
Relationship wording in body text still follows the source. Do not add
|
|
306
|
-
"depends on", "triggers", "contains", or similar language unless the cited span
|
|
307
|
-
states that relationship. The typed edge can preserve relation intent without
|
|
308
|
-
rewriting verbatim content.
|
|
309
|
-
|
|
310
|
-
If the CLI returns summary quality or low-coverage advisories with non-error severity, do not patch solely to satisfy the advisory and do not inspect every folded detail row by default. Patch only when the cited source meaning is lost, the user asks for cleanup, or the returned `next_action` asks for a draft patch.
|
|
311
|
-
|
|
312
|
-
## FAQ attachment priority
|
|
313
|
-
|
|
314
|
-
| FAQ topic | Attach to |
|
|
315
|
-
|---|---|
|
|
316
|
-
| About a concrete thing | That thing's Entity (Section `faq`) |
|
|
317
|
-
| About a mechanism or term | The matching Entity |
|
|
318
|
-
| About an action / flow | That Action |
|
|
319
|
-
| Cross-topic / generic workspace FAQ | Domain (fallback only) |
|
|
320
|
-
|
|
321
|
-
Never manufacture a FAQ container Node. If a FAQ cluster grows too large, a
|
|
322
|
-
sub-Entity is the correct escape hatch; return to structure confirmation with a
|
|
323
|
-
source-backed repair note instead of encoding that decision in compile actions.
|
|
324
|
-
|
|
325
|
-
</reference>
|
|
326
|
-
|
|
327
|
-
<procedures>
|
|
328
|
-
|
|
329
|
-
### Step 1 — Sanity-check the context
|
|
330
|
-
|
|
331
|
-
Confirm `view_ref` is set; abort if not. Note `node.node_type` — it caps legal
|
|
332
|
-
kinds per the CLI Section mount matrix.
|
|
333
|
-
|
|
334
|
-
Check edge case conditions from the routing table at the top of this skill. If any apply, read the relevant reference **before** continuing. The references explain how their conditions modify Step 1 / Step 2 / Step 3.
|
|
335
|
-
|
|
336
|
-
Estimate coverage from the planned section source refs before writing actions.
|
|
337
|
-
Treat "the first quote is supported" as only a validation result, not a
|
|
338
|
-
completion signal.
|
|
339
|
-
|
|
340
|
-
Use the CLI-provided citation-eligible snippets and diagnostics as the coverage contract. Distinct source-backed facts should become distinct actions or evidence-carrying skips; duplicates, navigation-only blocks, placeholders, and unsupported fragments can be skipped. If later CLI diagnostics report low coverage, repair the same draft through the returned `next_action`.
|
|
341
|
-
|
|
342
|
-
### Step 2 — Classify each raw snippet
|
|
343
|
-
|
|
344
|
-
For each planned section and its source refs:
|
|
345
|
-
|
|
346
|
-
1. If the snippet only contains navigation or placeholder evidence (`Parent` / `Children` / `Related` / `Relations`, sibling links, "no detailed content", etc.), emit `skip`. Do not create a Section whose content is just "Children: ..." or "Related: ..." and do not summarize facts that are not present in the snippet.
|
|
347
|
-
2. Pick kind using [Section Kind Choice](#section-kind-choice); stop at the first kind whose trigger fires.
|
|
348
|
-
3. Verify the kind against the mount matrix for `node.node_type`. Mismatch → pick the next legal kind down the chain, or emit `skip` with a reason pointing at a better Node. Never "fall through to description" just to place evidence.
|
|
349
|
-
4. If you land on `description`, walk the [Description anti-abuse gates](#description-anti-abuse-gates). Any gate fires → split or `skip`.
|
|
350
|
-
|
|
351
|
-
For dense documents, group nearby spans by heading context and write one action
|
|
352
|
-
per coherent fact group. Repeated `#` headings inside one source are often
|
|
353
|
-
internal chapters of the current Node; keep them as Sections unless the evidence
|
|
354
|
-
establishes a separate durable Node identity.
|
|
355
|
-
|
|
356
|
-
### Step 3 — Build actions
|
|
357
|
-
|
|
358
|
-
For each classified snippet:
|
|
359
|
-
|
|
360
|
-
1. Do not write `content`. Cite `source_refs[]` and let the CLI mirror source
|
|
361
|
-
into the Section content. If the cited raw is too broad, non-contiguous, or
|
|
362
|
-
needs translation/rewording, split actions/sections or return to structure
|
|
363
|
-
confirmation. Do not compress several raw blocks into one paragraph.
|
|
364
|
-
2. `summary` on `add` / `update` is optional behavior-half recall text.
|
|
365
|
-
When present, it is LLM-authored reader/query aid: one plain paragraph, no
|
|
366
|
-
Markdown, and compact. In YAML payloads, write `summary` as a plain
|
|
367
|
-
single-line scalar. Omit it when the title is self-explanatory rather than
|
|
368
|
-
writing filler.
|
|
369
|
-
It covers only the cited section behavior. The CLI appends deterministic
|
|
370
|
-
edge reachability metadata from confirmed structure edges during candidate
|
|
371
|
-
materialization; do not duplicate that relation text in `summary`.
|
|
372
|
-
Generic placeholders like "description section covering N evidence spans"
|
|
373
|
-
are invalid drafting quality even when the payload remains schema-valid.
|
|
374
|
-
If you cannot write a meaningful summary for source-backed reader content,
|
|
375
|
-
do not submit a placeholder; narrow the action, use `skip` for no-write
|
|
376
|
-
evidence, or return to the evidence/structure gate. The CLI reports
|
|
377
|
-
non-blocking advisory hints for weak summary quality; it does not treat
|
|
378
|
-
summary style as an evidence failure. Keep summaries faithful to the
|
|
379
|
-
source-backed action, but do not copy source-only keywords into `summary` for
|
|
380
|
-
scoring.
|
|
381
|
-
3. Preserve meaningful source-backed literals in `summary`, skip reason, or
|
|
382
|
-
repair challenge when they are part of the knowledge. Do not patch only to
|
|
383
|
-
satisfy non-blocking URL or style advisories.
|
|
384
|
-
4. Keep edge confidence out of compile actions. Source-authored uncertainty is
|
|
385
|
-
preserved on confirmed structure edges during align; compile only consumes
|
|
386
|
-
those edges for deterministic reachability metadata.
|
|
387
|
-
5. Keep cross-node relationships in structure edges; do not add extra relation
|
|
388
|
-
fields to compile actions.
|
|
389
|
-
6. Cite evidence with `source_refs[]`, copied from the planned section. Hard
|
|
390
|
-
citation gaps stay separate, while heading-annotated evidence may stay
|
|
391
|
-
together or be split by semantic knowledge unit. If the evidence is
|
|
392
|
-
non-contiguous or contains separable claims, split the draft into separately
|
|
393
|
-
cited actions instead of stretching one action across unrelated spans. For
|
|
394
|
-
`skip`, include `source_refs[]` only when the skip represents reviewed
|
|
395
|
-
no-write material from citation-eligible evidence; omit evidence for purely
|
|
396
|
-
deterministic no-ops, navigation, and context-only/background snippets.
|
|
397
|
-
Never submit singular `source_ref` or quoted-evidence fields.
|
|
398
|
-
|
|
399
|
-
Approved knowledge may contain non-rendered `context:summary` metadata comments,
|
|
400
|
-
but reader-visible section body starts with the active mirrored content. Agents
|
|
401
|
-
must not emit rendered comments, debug raw blocks, or audit payloads themselves.
|
|
402
|
-
|
|
403
|
-
### Step 4 — Emit the JSON
|
|
404
|
-
|
|
405
|
-
Emit one compile draft JSON document for the caller to submit to the current envelope's `next_action.command`. No markdown wrapper, no leading prose, no trailing commentary.
|
|
406
|
-
|
|
407
|
-
Before returning, ensure `schema_version` is `context.compile-actions.v1`,
|
|
408
|
-
`view_ref` matches the selected view, every add/update action has `section_id`, fields
|
|
409
|
-
conform to the current compile schema view, citations point only at
|
|
410
|
-
CLI-provided planned section evidence, and node-context was the only evidence
|
|
411
|
-
source except for exact span reads through current CLI views.
|
|
412
|
-
|
|
413
|
-
</procedures>
|
package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: compile-judgment
|
|
3
|
-
description: >
|
|
4
|
-
Internal support/relation judgment procedure for the current compile and
|
|
5
|
-
review gates; not a user slash command. Consumes current compile/review
|
|
6
|
-
diagnostics and evidence views, judges each draft action's source evidence
|
|
7
|
-
support and relation to listed candidates, and returns a judgment the caller
|
|
8
|
-
expresses through current compile actions, unresolved structure, or an
|
|
9
|
-
explicit user question.
|
|
10
|
-
tools:
|
|
11
|
-
- Bash
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
# compile-judgment — judge compile support and relation
|
|
15
|
-
|
|
16
|
-
Decide whether each proposed compile action is supported by cited source
|
|
17
|
-
evidence and how it relates to candidate Sections listed by the CLI. Return the
|
|
18
|
-
judgment in the current route; the CLI reviews, applies, and writes every
|
|
19
|
-
workspace change.
|
|
20
|
-
|
|
21
|
-
## TL;DR — Non-negotiables
|
|
22
|
-
|
|
23
|
-
- Invoke this procedure only when current align/compile/review diagnostics ask
|
|
24
|
-
for support, duplicate, conflict, replacement, or weak-evidence judgment.
|
|
25
|
-
- Input is the budget-safe diagnostic or view returned by the current phase.
|
|
26
|
-
If the view is paginated, follow `next_command` until every relevant item is
|
|
27
|
-
listed.
|
|
28
|
-
- The summary is an index: use only CLI-returned detail commands when full
|
|
29
|
-
proposed content, source evidence, or source_ref details are needed.
|
|
30
|
-
- Do not inspect `sources/`, `unapproved/`, `knowledge/`, or `dist/` directly
|
|
31
|
-
or run ad-hoc scripts to reconstruct candidates. Use only the current
|
|
32
|
-
diagnostics, evidence views, candidate lists, and detail commands returned by
|
|
33
|
-
the CLI.
|
|
34
|
-
- Output the judgment in the caller's current shape: repair compile actions,
|
|
35
|
-
update unresolved structure items, or ask the user. Do not emit a standalone
|
|
36
|
-
judge-decision payload unless the current CLI schema view explicitly asks for
|
|
37
|
-
one.
|
|
38
|
-
- Keep one decision per diagnostic item, preserving CLI order.
|
|
39
|
-
- Compare only the candidates listed on that item. Do not perform workspace-wide BM25, grep, or source-file searches.
|
|
40
|
-
- Inspect every candidate page the CLI provides before judging. If candidates
|
|
41
|
-
are paged, follow `next_command` until no candidate page remains.
|
|
42
|
-
- When there are no candidates, classify the action as new unless the evidence
|
|
43
|
-
itself is unsupported or structurally misplaced.
|
|
44
|
-
- For duplicate, replacement, conflict, or update judgments, name the matched
|
|
45
|
-
candidate Section in prose or repair rationale only when the current CLI view
|
|
46
|
-
exposes that Section id.
|
|
47
|
-
- 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.
|
|
48
|
-
- Raw/source_ref diagnostics are deterministic evidence checks, not a keyword gate. A supported judge verdict comes from the cited raw evidence semantically covering the claim.
|
|
49
|
-
- Evidence-boundary errors remain blocking evidence issues. Section kind precision, example formatting, and summary style are advisory unless the active CLI `next_action` explicitly blocks on them.
|
|
50
|
-
- 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.
|
|
51
|
-
- Weak support, replacement, or conflict that depends on business meaning must
|
|
52
|
-
route to explicit user confirmation. A blanket "continue" is not enough; ask
|
|
53
|
-
the concrete choice and express the answer through the current compile,
|
|
54
|
-
structure, or review route.
|
|
55
|
-
|
|
56
|
-
<reference>
|
|
57
|
-
|
|
58
|
-
## Judgment Shape
|
|
59
|
-
|
|
60
|
-
Use these values as the decision vocabulary in your repair note or user
|
|
61
|
-
question. The current write payload is still `context.structure.v1` or
|
|
62
|
-
`context.compile-actions.v1`, not this table.
|
|
63
|
-
|
|
64
|
-
## Verdict Meanings
|
|
65
|
-
|
|
66
|
-
| Judgment | Meaning |
|
|
67
|
-
|---|---|
|
|
68
|
-
| `supported` | Cited source evidence covers the claim. |
|
|
69
|
-
| `weak` | The evidence plausibly supports an ordinary summary, but review may ask for confirmation. |
|
|
70
|
-
| `unsupported` | The claim adds facts or boundaries not present in cited source evidence. |
|
|
71
|
-
| `new` | No listed candidate already covers the proposed knowledge. |
|
|
72
|
-
| `duplicate` | A listed candidate already covers the same claim. |
|
|
73
|
-
| `replacement` | A listed candidate is stale or wrong and should be replaced by the new claim. |
|
|
74
|
-
| `conflict` | The prepared claim and candidate disagree and need user resolution. |
|
|
75
|
-
| `update` | The prepared claim should refine one listed candidate. |
|
|
76
|
-
| `merge` | The proposed claim should be folded into one listed candidate without changing meaning, when the current schema exposes a safe update path. |
|
|
77
|
-
|
|
78
|
-
</reference>
|
|
79
|
-
|
|
80
|
-
<procedures>
|
|
81
|
-
|
|
82
|
-
### Step 1 — Load Current Diagnostics And Candidate Details
|
|
83
|
-
|
|
84
|
-
Use the caller-provided compact diagnostic output. For every item with
|
|
85
|
-
candidates, load only the CLI-provided candidate detail view before judging
|
|
86
|
-
relation. Do not infer missing candidates from memory or bypass the detail view.
|
|
87
|
-
|
|
88
|
-
### Step 2 — Judge Support
|
|
89
|
-
|
|
90
|
-
For each item, read the proposed content and cited evidence. Use source_ref
|
|
91
|
-
diagnostics only as evidence pointers; final support is your
|
|
92
|
-
semantic verdict from the cited raw evidence.
|
|
93
|
-
|
|
94
|
-
### Step 3 — Judge Relation
|
|
95
|
-
|
|
96
|
-
Compare the proposed claim against each listed candidate. Track every visible
|
|
97
|
-
candidate in your reasoning, and continue candidate pages until the CLI says the
|
|
98
|
-
candidate list is complete. If the candidate list is empty, classify the action
|
|
99
|
-
as `new` unless support or structure checks fail.
|
|
100
|
-
|
|
101
|
-
Use this relation/action chain before returning a repair:
|
|
102
|
-
|
|
103
|
-
| Relation judgment | Current route |
|
|
104
|
-
|---|---|
|
|
105
|
-
| Exact same claim already active | Do not write a duplicate section; emit or repair a `skip` with duplicate reason when the schema supports it. |
|
|
106
|
-
| Same claim with source-backed wording/detail refinement | Use `update` only when node-context and schema expose the target section; otherwise ask the user or return to review/structure. |
|
|
107
|
-
| Related but orthogonal claim | Keep a separate action/section when the planned section owns the cited source refs. |
|
|
108
|
-
| New evidence replaces a previous rule, value, or decision | Treat as replacement; ask the user or return to review/structure. Do not hide the replacement inside a same-section edit. |
|
|
109
|
-
| Direct contradiction | Ask the user. Do not auto-resolve from source order, title order, or "latest-looking" wording. |
|
|
110
|
-
| Candidate relation depends on another node or edge | Return to prose align so the typed edge or unresolved item can be confirmed. |
|
|
111
|
-
|
|
112
|
-
For duplicate, replacement, conflict, merge, or update judgments, name the
|
|
113
|
-
candidate section(s) inspected in the repair rationale when the CLI exposes
|
|
114
|
-
their ids. Do not claim workspace-wide uniqueness unless the current CLI view
|
|
115
|
-
performed that search.
|
|
116
|
-
|
|
117
|
-
### Step 4 — Emit Judge Decisions
|
|
118
|
-
|
|
119
|
-
Return only the judgment needed by the caller: repaired current payload,
|
|
120
|
-
unresolved item, or user question. Do not invent a separate semantic repair command
|
|
121
|
-
unless the current CLI explicitly returns one.
|
|
122
|
-
|
|
123
|
-
</procedures>
|