@c4a/context-cli 0.6.0-alpha.1 → 0.6.0-beta.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.
Files changed (55) hide show
  1. package/cli.js +49755 -34355
  2. package/package.json +1 -1
  3. package/plugin/skills/skill-prose-align/SKILL.md +23 -9
  4. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +44 -10
  5. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +32 -1
  6. package/plugin/skills/skill-prose-compile/SKILL.md +17 -8
  7. package/plugin/skills/skill-review-gate/SKILL.md +5 -5
  8. package/plugin/skills/skill-source-scope/SKILL.md +98 -71
  9. package/plugin/skills/skill-source-scope/references/capture-source.md +25 -15
  10. package/plugins/VERSION +1 -1
  11. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  12. package/plugins/claude/skills/skill-prose-align/SKILL.md +23 -9
  13. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +44 -10
  14. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +32 -1
  15. package/plugins/claude/skills/skill-prose-compile/SKILL.md +17 -8
  16. package/plugins/claude/skills/skill-review-gate/SKILL.md +5 -5
  17. package/plugins/claude/skills/skill-source-scope/SKILL.md +98 -71
  18. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +25 -15
  19. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  20. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +44 -10
  21. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +32 -1
  22. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +23 -9
  23. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +17 -8
  24. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +5 -5
  25. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +25 -15
  26. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +98 -71
  27. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +44 -10
  28. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +32 -1
  29. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +23 -9
  30. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +17 -8
  31. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +5 -5
  32. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +25 -15
  33. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +98 -71
  34. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  35. package/plugins/cursor/skills/skill-prose-align/SKILL.md +23 -9
  36. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +44 -10
  37. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +32 -1
  38. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +17 -8
  39. package/plugins/cursor/skills/skill-review-gate/SKILL.md +5 -5
  40. package/plugins/cursor/skills/skill-source-scope/SKILL.md +98 -71
  41. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +25 -15
  42. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +44 -10
  43. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +32 -1
  44. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +23 -9
  45. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +17 -8
  46. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +5 -5
  47. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +25 -15
  48. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +98 -71
  49. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +44 -10
  50. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +32 -1
  51. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +23 -9
  52. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +17 -8
  53. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +5 -5
  54. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +25 -15
  55. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +98 -71
@@ -13,10 +13,10 @@ tools:
13
13
  Current capture discipline for document sources. The executable path is source
14
14
  registration plus the declared capture phase flow:
15
15
 
16
- - local Markdown/MDX file source: `context source add file <name> --local <path>`
17
- followed by `context run capture:file:<name> --format json`;
18
- - Lark/Feishu source: `context source add lark <name> ...` followed by
19
- `context run capture:lark:<name> --format json`;
16
+ - local Markdown/MDX file source: `context source add file --local <path>`
17
+ followed by `context run capture:file:<source-name> --format json`;
18
+ - Lark/Feishu source: `context source add lark ...` followed by
19
+ `context run capture:lark:<source-name> --format json`;
20
20
  - refresh: rerun the same declared capture phase after status or the user asks
21
21
  for recapture.
22
22
 
@@ -52,19 +52,29 @@ manager or version.
52
52
  Before choosing a local Markdown capture route, honor the surrounding task context. Driver documents such as run instructions, handbooks, READMEs, plans, feedback issues, corpus/index/manifests, and batch lists are not Context sources unless the user explicitly asks to ingest them. Capture only ingest targets that are already explicit in the user request; if they are missing, ask one clarification instead of capturing the driver document.
53
53
 
54
54
  - One or more local `.md` / `.mdx` files or a local documentation folder to ingest →
55
- register one file source with the user-confirmed source name and boundary:
56
- `context source add file <name> --local <file-or-folder>`. For an explicit
55
+ register one file source with the user-confirmed boundary:
56
+ `context source add file --local <file-or-folder>`. The CLI returns the date
57
+ source name (`YYYYMMDD`) to use in project phases. For an explicit
57
58
  batch inside a broader folder, preserve the user's include list on source
58
- registration. Default file capture handles `.md`. For MDX documentation sites
59
- that use `_meta.json`, declare `mdxJsonDocs()` on `captureFile` in
60
- `src/index.ts`; keep `_meta.json` only when it is route metadata for the
61
- selected document folder. It is captured as metadata, not body evidence.
62
- Declare `captureFile({ source: source("<name>") })`, then run
63
- `context run capture:file:<name> --format json`.
59
+ registration. Default file capture handles `.md`. If the CLI reports
60
+ document-site files such as `.mdx`, `_meta.json`, sidebars, or docs config,
61
+ stop and confirm whether the selected boundary is a documentation site before
62
+ changing capture configuration. For MDX documentation sites that use
63
+ `_meta.json`, declare `mdxJsonDocs()` on `captureFile` in `src/index.ts`;
64
+ keep `_meta.json` only when it is route metadata for the selected document
65
+ folder. The CLI captures it as metadata and generates
66
+ `__context_route_metadata.md` as mechanical route evidence; it also extracts
67
+ static MDX component props/children into `__context_mdx_component_text.md`
68
+ when components carry user-facing text. Declare
69
+ `captureFile({ source: source("<source-name>"), processor: mdxJsonDocs() })`, then
70
+ run `context run capture:file:<source-name> --format json`. If the selected MDX page
71
+ is empty or only mounts runtime-rendered content, tell the user that capture
72
+ found a document-site shell and ask for the rendered-site or data-source
73
+ boundary instead of inventing body text.
64
74
  - A Lark/Feishu URL, doc token, or wiki token → register one Lark source:
65
- `context source add lark <name> --url <url>` or the matching token flag.
66
- Declare `captureLark({ source: source("<name>") })`, then run
67
- `context run capture:lark:<name> --format json`.
75
+ `context source add lark --url <url>` or the matching token flag.
76
+ Declare `captureLark({ source: source("<source-name>") })`, then run
77
+ `context run capture:lark:<source-name> --format json`.
68
78
  - Mixed local document and Lark document batches are separate sources unless
69
79
  the current CLI explicitly offers a combined source contract. Do not write an
70
80
  Agent-side URL/file loop.
package/plugins/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0-alpha.1
1
+ 0.6.0-beta.1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "context",
3
3
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
4
- "version": "0.6.0-alpha.1",
4
+ "version": "0.6.0-beta.1",
5
5
  "author": {
6
6
  "name": "c4a"
7
7
  },
@@ -23,10 +23,14 @@ Turn captured document evidence into confirmed structure.
23
23
  and view set returned by the CLI.
24
24
  - Write and validate `context.structure.v1` into `unapproved/structure.yaml`.
25
25
  Stop for user confirmation before compile.
26
- - Before classifying nodes, section plans, edges, weak evidence, duplicates,
26
+ - Before classifying nodes, section plans, edges, support strength, duplicates,
27
27
  conflicts, ownership, or unresolved items, read the current procedure
28
28
  references listed by the CLI as `semantic_reference_files`. These references
29
29
  are the current structure judgment rules, not summaries.
30
+ - Plan source evidence as Sections before promoting any heading to a Node/View.
31
+ Local FAQ, decision, incident, warning, or reference fragments normally stay
32
+ under the owning View unless source evidence proves independent retrieval
33
+ identity.
30
34
  - Do not produce or validate a structure payload from this entry file alone. If
31
35
  the relevant `semantic_reference_files` have not been read in the current
32
36
  turn, stop and read them first.
@@ -195,15 +199,23 @@ Validate:
195
199
  context run align:<type>:<source>:<collection> --validate --input <structure.yaml> --format json
196
200
  ```
197
201
 
198
- Validation returns `structure_summary` and writes a temporary
199
- `structure_report.path` under `.tmp/context-runtime/reports/`. Use those
200
- artifacts as the primary confirmation material; do not ask the user to confirm a
201
- structure they cannot inspect. If the user needs a focused view, run:
202
+ Validation returns `structure_summary` and writes a temporary HTML report under
203
+ `.tmp/context-runtime/reports/`. Use `structure_report.file_url` as the primary
204
+ user-facing link, and include `structure_report.absolute_path` as a copyable
205
+ fallback. Do not ask the user to confirm a structure they cannot click or open.
206
+ If the user needs a focused view, run:
202
207
 
203
208
  ```bash
204
209
  context run align:<type>:<source>:<collection> --view structure-summary --input <structure.yaml> --format json
205
210
  ```
206
211
 
212
+ The CLI response may include a large full `structure_summary` for debugging and
213
+ report rendering. For user confirmation, prioritize the first-screen fields:
214
+ `review_notice`, `structure_report`, and `structure_summary_compact`. A valid
215
+ user-facing confirmation prompt must include the report `file_url`, the absolute
216
+ path fallback, and a compact summary of collections/views/unresolved/diagnostics.
217
+ Do not ask the user to confirm from counts alone.
218
+
207
219
  Repair diagnostics by routing them to the right decision:
208
220
 
209
221
  - source ref or snapshot mismatch -> reread evidence views or refresh capture;
@@ -228,13 +240,15 @@ After validation, and again after a draft structure is staged, show the user:
228
240
  - expected compile order;
229
241
  - downstream impact: these choices freeze paths, section ownership, and
230
242
  relationships for this compile round.
231
- - the `structure_report.path` generated by validate or `--view
232
- structure-summary`.
243
+ - the `structure_report.file_url` generated by validate or `--view
244
+ structure-summary`;
245
+ - the `structure_report.absolute_path` fallback in case the host cannot click
246
+ file URLs.
233
247
 
234
248
  If the CLI stage result includes `next_action.human_gate: true`, treat it as a
235
249
  hard stop for structure review. Do not ask for a blind "confirm structure"
236
- reply. Surface the report path and enough structured summary for the user to
237
- inspect what will be confirmed.
250
+ reply. Surface the report `file_url`, absolute path, and enough structured
251
+ summary for the user to inspect what will be confirmed.
238
252
 
239
253
  Use the host's multi-choice question tool when available. If unavailable, use a
240
254
  short Markdown fallback. Good options are:
@@ -22,12 +22,10 @@ Answer in this order and stop at the first match:
22
22
  1. **Action?** A large executable event / process with both:
23
23
  - scale: can support `planned_sections` with at least two distinct Section kinds, or contains at least one child Action;
24
24
  - process evidence: explicit steps, phases, trigger -> handling -> result, role collaboration, or repeatable plan. Parallel lists such as "three API modes" are not process evidence.
25
- Single-section exceptions are allowed only when the collection route and
26
- source evidence give the record its own lifecycle or tracking identity:
27
- product `user-story`, test `scenario`, or incident `action-item` /
28
- incident record. These still need source-backed acceptance, lifecycle,
29
- scenario, or tracking evidence; otherwise keep the material as a Section
30
- under the owning Node.
25
+ Single-section user-story / scenario / incident records may be meaningful to
26
+ a human reader, but the CLI does not infer that exception from source prose.
27
+ If the structure cannot express at least two distinct Section kinds or a
28
+ child Action, keep the material as a Section under the owning Node.
31
29
  2. **Entity?** A concrete independent subject with retrieval value: deployable code, product/application/system, library/module/CLI/symbol, or an atomic term/pattern.
32
30
  3. **Domain?** A container/scope that groups at least one child Node.
33
31
  4. Otherwise do not create a Node; leave the material for compile as a Section under the owning Node.
@@ -75,6 +73,36 @@ scope/process suffixes.
75
73
 
76
74
  For no-write placeholder summaries, describe only the preserved page identity and unresolved navigation clues. Do not say the Node "provides navigation/links/relations to X" unless those targets are resolved graph children or rendered links; say the source contains deferred navigation clues instead.
77
75
 
76
+ ## Section Promotion Gate
77
+
78
+ Classify local evidence as a Section before creating a child Node/View. A
79
+ heading, table row, FAQ label, or short sub-topic does not by itself establish a
80
+ standalone page.
81
+
82
+ Promote a Section to a child View only when at least one condition is supported
83
+ by source evidence:
84
+
85
+ 1. The title is a concrete product/code object/system/module/library, not just a
86
+ local heading.
87
+ 2. The item is an atomic term or pattern that answers standalone lookup
88
+ questions outside the parent page.
89
+ 3. The item clears the Action Gate or Domain Gate.
90
+ 4. The source gives it independent article identity: owner/date, lifecycle,
91
+ timeline, tracking record, or cross-cutting support scope.
92
+
93
+ Hard repairs:
94
+
95
+ | Pattern | Repair |
96
+ |---|---|
97
+ | One local Q&A under a product/system page | `faq` Section under the owning View |
98
+ | One-off conclusion or trade-off note | `decision` Section under the owning View |
99
+ | Warning/failure note without incident identity | `warning` or `incident` Section under the owning View |
100
+ | Reference/link bucket with no body | `unresolved[]` or omit, not an Entity page |
101
+ | Many same-source, single-section child Entities under one parent | Merge them into parent Sections unless each child has standalone lookup identity |
102
+
103
+ The CLI treats section-like child Views as invalid unless the payload provides
104
+ source-backed independent identity through the surrounding structure.
105
+
78
106
  ## Entity Tag Rules
79
107
 
80
108
  Use `tags` to state what the Entity is. Legal combinations:
@@ -88,6 +116,11 @@ Use `tags` to state what the Entity is. Legal combinations:
88
116
 
89
117
  `term` is mutually exclusive with A/B tags. React is `[lib]`, not `[lib, term]`; if a separate term entry is useful, create another Entity tagged `[term]` and let the structure plan express the relation as a typed edge or unresolved relation with `source_refs[]`.
90
118
 
119
+ Do not inherit scope tags mechanically. If a parent Entity is tagged `system` or
120
+ `application`, a child Entity should repeat that tag only when it is itself an
121
+ independent system/application. Local aspects under that parent should either
122
+ use their own shape tag or remain Sections.
123
+
91
124
  ## Action Gate
92
125
 
93
126
  Use `node_type: action` only after the Node Type Order says action. Fill the
@@ -105,7 +138,7 @@ bar is:
105
138
  | `is_repeatable_or_planned` | The work is repeatable, scheduled, policy-like, or intentionally planned. | May be inferred; record the source. |
106
139
  | `queries_answerable_with_refs` | The Node can answer how/when/who/what-to-do questions from cited spans. | May be inferred; record the source. |
107
140
 
108
- Do not emit an Action for a single sentence, a one-off conclusion, a short operation, or a parallel enumeration. Those become Sections under the owning Entity or Domain. The only single-Section Action exceptions are source-backed `user-story`, `scenario`, and incident/action-item records with lifecycle, acceptance, or tracking identity.
141
+ Do not emit an Action for a single sentence, a one-off conclusion, a short operation, or a parallel enumeration. Those become Sections under the owning Entity or Domain. The CLI does not infer single-Section Action exceptions from source prose; represent the material with enough structure or keep it as a Section.
109
142
 
110
143
  Action anti-examples:
111
144
 
@@ -209,7 +242,7 @@ Each source must include `rationale` when inferred and at least one of `source_r
209
242
  ## Final Reflection
210
243
 
211
244
  - Entity cannot pick a legal tag, or depends on its upstream title to make sense -> write it as a Section under the upstream Node or change type before submit.
212
- - Action only supports one Section -> write it as a Section instead of an Action, unless it is a source-backed `user-story`, `scenario`, or incident/action-item record with lifecycle, acceptance, or tracking identity. The discriminator is scale or record identity, not the presence of "step" words.
245
+ - Action only supports one Section -> write it as a Section instead of an Action, or add source-backed structure that reaches at least two distinct Section kinds / one child Action. The CLI does not use source prose keywords to grant an exception.
213
246
  - Action "steps" are parallel options/configs -> route to Entity `comparison` / `spec` / `description`.
214
247
  - Domain has no children -> delete it or merge it into a larger Domain.
215
248
 
@@ -225,11 +258,12 @@ checks as deterministic diagnostics:
225
258
  | `tags.term_conflict` | An Entity uses `term` together with concrete runtime/product tags such as `lib`, `service`, `application`, or `system`. | Split the term from the concrete object, or remove the conflicting tag before staging. |
226
259
  | `node.description_dominates` | A non-Action Node has at least half of its planned Sections as `description`. | Re-run kind precision. Keep it only when source evidence is genuinely narrative; otherwise split into `example`, `spec`, `comparison`, `faq`, `incident`, `decision`, `warning`, or `principle`. |
227
260
  | `node.thin_concrete_entity` | A concrete Entity has one Section and no child Nodes. | Keep it only when it has stable standalone retrieval value; otherwise merge it into the owning Node. |
261
+ | `node.children_should_be_sections` | One parent contains many same-source, single-section child Entities with no stable shape tag. | Merge those children into parent Sections unless the user confirms each child has standalone lookup value. |
228
262
  | `node.term_expanded_beyond_definition` | A `term` Entity has grown past a compact definition or owns children. | Move rules, procedures, designs, and examples to the owning Node; keep the term entry narrow. |
229
- | `node.action_too_thin` | An Action has fewer than two distinct planned Section kinds and no child Action. | Downgrade it to a Section under the owning Node unless evidence supports a repeatable process or a source-backed `user-story`, `scenario`, or incident/action-item record with lifecycle, acceptance, or tracking identity. |
263
+ | `node.action_too_thin` | An Action has fewer than two distinct planned Section kinds and no child Action. | Downgrade it to a Section under the owning Node, add a distinct Section kind, or add a child Action; the CLI does not infer a single-section exception from source text. |
230
264
  | `node.domain_without_children` | A Domain has no source-backed `contains` child edge. | Add supported children, keep an explicitly confirmed no-write placeholder, or reclassify the Node. |
265
+ | `tags.child_inherits_system` | A child Entity repeats its parent `system` / `application` scope tag. | Retag by the child’s own shape/scope, or keep the child as a Section if it is only a local aspect. |
231
266
  | `edge.confidence_invalid` | An edge declares a confidence value outside the current schema. | Use only `possible` or `hypothesis`, or omit the field for source-certain relations. |
232
- | `edge.confidence_required` | The cited relation sentence contains source-level uncertainty such as "可能", "疑似", "may", or "might". | Preserve source-authored uncertainty with `confidence: possible` / `confidence: hypothesis`, or move the relation to `unresolved[]`. |
233
267
 
234
268
  Warnings are not automatic blockers, but they are not suggestions to ignore.
235
269
  Resolve them or include the user-confirmed rationale when confirming structure.
@@ -151,6 +151,24 @@ the shared evidence.
151
151
 
152
152
  Source titles and headings are ordinary evidence, not structural authority. Choose titles and summaries that fit the final Node type and the CLI-provided generation policy.
153
153
 
154
+ Plan source material as Sections first. A source heading only becomes a child
155
+ Node/View when the cited evidence names a concrete independent subject, an
156
+ atomic term, a gated Action, or a child-bearing Domain. A `contains` edge only
157
+ states hierarchy; it does not prove that a thin child page has standalone
158
+ retrieval value.
159
+
160
+ Avoid same-source fragmentation. If one parent would contain many single-section
161
+ child Entities from the same source document, keep them as Sections unless each
162
+ child has an independent product/code object, atomic term, Action, or Domain
163
+ identity. Also avoid copying the parent `system` / `application` scope tag onto
164
+ local child aspects; tag a child by what it independently is.
165
+
166
+ Do not promote local support fragments into child pages. FAQ, decision, and
167
+ incident snippets under an owning topic stay as `faq`, `decision`, or
168
+ `incident` Sections unless the source proves an independent article, lifecycle,
169
+ timeline, owner/date, or cross-cutting retrieval scope. The CLI will reject
170
+ section-like child views before confirmation.
171
+
154
172
  For `node.title` and `node.summary`, follow the workspace/source language
155
173
  surfaced by the current view or the user's instruction. In Chinese workspaces,
156
174
  translate descriptive scaffold words such as architecture, strategy, lifecycle,
@@ -188,6 +206,19 @@ structure gate. Current compile writes approved knowledge by mirroring source
188
206
  spans; it does not use rewritten multi-ref sections to compress unrelated
189
207
  evidence.
190
208
 
209
+ Validate will surface source mirror blockers before confirmation. Treat
210
+ `section.source_mirror_split_required`,
211
+ `section.source_mirror_repair_required`, and
212
+ `section.source_mirror_source_refs_missing` as structure problems, not compile
213
+ drafting problems. Use the returned `repair.suggested_splits[]` when present;
214
+ otherwise repair source refs from CLI evidence views or move unsupported
215
+ material to `unresolved[]`.
216
+
217
+ For pure suggested-split repairs, prefer the CLI repair view before hand-editing:
218
+ `context run align:<type>:<source>:<collection> --repair suggested-splits --input <structure.yaml> --format json`.
219
+ It only rewrites section ids/source_refs inside the same view. It does not
220
+ create child nodes/views or decide semantic regrouping for you.
221
+
191
222
  When the cited source sentence itself is uncertain, preserve that uncertainty on
192
223
  the edge with `confidence: possible` or `confidence: hypothesis`. This is only
193
224
  for source-authored uncertainty such as "可能", "疑似", "may", or "might". If
@@ -220,7 +251,7 @@ There is no parallel candidate-body authoring path. Emit only the
220
251
 
221
252
  ### Step 6 — Validate And Submit
222
253
 
223
- Before staging, run `context run align:<type>:<source>:<collection> --validate --input - --format json` with the `context.structure.v1` payload. If validate returns blocking diagnostics, repair the exact paths it reports and rerun validate. After validation, show the structure to the user with the structure summary and `structure_report.path`. If validation returns `confirmation_blockers[]` or `will_block_confirmation`, repair those blockers before asking the user to confirm. If you stage a draft structure first, the stage result is still a human review gate: show the returned report/summary and ask the user to inspect it before confirming. Only write `lifecycle.state: confirmed` only after explicit confirmation; then run `context run align:<type>:<source>:<collection> --confirm --format json` or pass an explicit file with `--confirm --input <structure.yaml> --format json`.
254
+ Before staging, run `context run align:<type>:<source>:<collection> --validate --input - --format json` with the `context.structure.v1` payload. If validate returns blocking diagnostics, repair the exact paths it reports and rerun validate. After validation, show the structure to the user with the structure summary, `structure_report.file_url`, and `structure_report.absolute_path`. If validation returns `confirmation_blockers[]` or `will_block_confirmation`, repair those blockers before asking the user to confirm. If you stage a draft structure first, the stage result is still a human review gate: show the returned report link/summary and ask the user to inspect it before confirming. Only write `lifecycle.state: confirmed` only after explicit confirmation; then run `context run align:<type>:<source>:<collection> --confirm --format json` or pass an explicit file with `--confirm --input <structure.yaml> --format json`.
224
255
 
225
256
  After stage succeeds, do not rerun the same write command to confirm success.
226
257
  Use `context status --format json` or the returned result for read-only
@@ -21,9 +21,12 @@ Compile confirmed document structure into reviewable draft knowledge.
21
21
  - The input is already confirmed `context.structure.v1`; do not redesign node
22
22
  ownership, page paths, or relationships here. Return to prose align if those
23
23
  are wrong.
24
- - Read compile context through CLI views only: `read-plan`, `node-context`, and
25
- `schema`. Use align evidence views only when the compile view or validation
26
- output gives a specific source ref that needs exact text.
24
+ - Read compile context through CLI views only: `blockers`, `read-plan`,
25
+ `node-context`, and `schema`. Start with `blockers` for large or recently
26
+ repaired structures; if it returns section blockers, return to prose align
27
+ instead of drafting compile actions. Use align evidence views only when the
28
+ compile view or validation output gives a specific source ref that needs exact
29
+ text.
27
30
  - Emit `context.compile-actions.v1`; the CLI mirrors source spans, derives
28
31
  `content_mode`, writes review candidates, and enforces source-bound evidence.
29
32
  - The `summary` field in each action is the Agent-authored behavior half only:
@@ -88,14 +91,17 @@ Use semantic labels, not SDK function names:
88
91
  Recommended read order:
89
92
 
90
93
  ```bash
94
+ context run compile:<type>:<source>:<collection> --view blockers --format json
91
95
  context run compile:<type>:<source>:<collection> --view read-plan --format json
92
96
  context run compile:<type>:<source>:<collection> --view node-context --source <view-ref> --format json
93
97
  context run compile:<type>:<source>:<collection> --view schema --format json
94
98
  ```
95
99
 
96
100
  Use CLI-returned `available_view_refs`, `planned_sections`, `local_sources`, and
97
- `next_action.command`. Do not reconstruct the structure by opening
98
- `unapproved/structure.yaml` or `knowledge/structure.yaml` directly.
101
+ `next_action.command`. If `blockers.section_blockers[]` is non-empty, repair the
102
+ structure through align first; do not inspect every node or hand-split compile
103
+ actions. Do not reconstruct the structure by opening `unapproved/structure.yaml`
104
+ or `knowledge/structure.yaml` directly.
99
105
 
100
106
  ## Procedure References
101
107
 
@@ -134,12 +140,15 @@ relationship reference blocks.
134
140
  Run:
135
141
 
136
142
  ```bash
143
+ context run compile:<type>:<source>:<collection> --view blockers --format json
137
144
  context run compile:<type>:<source>:<collection> --view read-plan --format json
138
145
  ```
139
146
 
140
- Use the returned node list, source overview, and next action. If the CLI says
141
- the structure is missing, unconfirmed, stale, frozen against the wrong
142
- snapshot, or invalid, return to prose align or source capture as indicated.
147
+ Use the returned blockers, node list, source overview, and next action. If the
148
+ blockers view reports section blockers, return to prose align and repair the
149
+ confirmed structure before compile. If the CLI says the structure is missing,
150
+ unconfirmed, stale, frozen against the wrong snapshot, or invalid, return to
151
+ prose align or source capture as indicated.
143
152
 
144
153
  ### Step 2 — Inspect One Node
145
154
 
@@ -20,8 +20,8 @@ Run the human review gate. The user decides approval or rejection.
20
20
  - `<collection>` is an internal production collection such as `architecture`,
21
21
  `sop`, `decision`, or `standards`; it is not an OKF package root such as
22
22
  `wikis`, `guides`, or `rules`.
23
- - If browser opening fails or the host cannot make a path clickable, provide the
24
- `file://` URL.
23
+ - Always surface the CLI-printed `file_url`. If browser opening fails or the
24
+ host cannot make a path clickable, also provide `absolute_path`.
25
25
  - Apply only the JSONL payload copied by the user from the review UI.
26
26
  - Do not parse `unapproved/entities.jsonl`, `.tmp`, or HTML internals with
27
27
  scripts to synthesize decisions.
@@ -40,9 +40,9 @@ For the internal collection reported by status, run:
40
40
  context review html <collection> --open
41
41
  ```
42
42
 
43
- Tell the user where the page opened. If needed, provide a clickable
44
- `file://.../<collection>.html` URL or the exact path printed by the CLI. Do
45
- not assume a fixed review filename; review scope is collection or `--all`.
43
+ Tell the user where the page opened and include the CLI-printed `file_url` as a
44
+ clickable link plus `absolute_path` as a copyable fallback. Do not assume a
45
+ fixed review filename; review scope is collection or `--all`.
46
46
  Do not substitute OKF package roots (`wikis`, `guides`, `rules`) for this
47
47
  argument; review scope is the internal collection namespace.
48
48