@c4a/context-cli 0.5.39-beta.4 → 0.5.41-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/context-cli",
3
- "version": "0.5.39-beta.4",
3
+ "version": "0.5.41-beta.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "context": "./cli.js"
package/plugin/README.md CHANGED
@@ -107,17 +107,17 @@ The compiled knowledge base can be packaged for distribution:
107
107
 
108
108
  The numbers below come from a parallel benchmark: each model runs the full c4a flow (capture → align → compile) end-to-end over the same 10-document business corpus, with no manual intervention. Quality is scored across 7 dimensions (totaling 100) based on the resulting knowledge base; duration covers the full flow from `context init` to `compile close`.
109
109
 
110
- | Dimension | GPT 5.5 (Codex) | Opus 4.7 (Claude) | DeepSeek V4 Pro (Claude) |
111
- |---|---:|---:|---:|
112
- | Fact coverage (25) | 22 | 22 | 18 |
113
- | Fact fidelity (25) | 23 | 19 | 18 |
114
- | Structure (15) | 13 | 8 | 7 |
115
- | URL (5) | 3 | 2 | 5 |
116
- | Source ref (10) | 9 | 7 | 6 |
117
- | Section boundary (10) | 9 | 7 | 5 |
118
- | Schema (10) | 8 | 9 | 7 |
119
- | **Total** | **87** | **74** | **66** |
120
- | Duration | 14m55s | 19m6s | 14m44s |
110
+ | Dimension | Opus 4.8 (Claude) | GPT 5.5 (Codex) | Opus 4.7 (Claude) | DeepSeek V4 Pro (Claude) |
111
+ |---|---:|---:|---:|---:|
112
+ | Fact coverage (25) | 23 | 23 | 22 | 18 |
113
+ | Fact fidelity (25) | 24 | 23 | 19 | 18 |
114
+ | Structure (15) | 14 | 13 | 8 | 7 |
115
+ | URL (5) | 5 | 4 | 2 | 5 |
116
+ | Source ref (10) | 9 | 9 | 7 | 6 |
117
+ | Section boundary (10) | 9 | 10 | 7 | 5 |
118
+ | Schema (10) | 9 | 10 | 9 | 7 |
119
+ | **Total** | **93** | **92** | **74** | **66** |
120
+ | Duration | 30m47s | 10m07s | 19m6s | 14m44s |
121
121
 
122
122
  ## About this repository
123
123
 
@@ -105,17 +105,17 @@ bun add -g @c4a/context-cli
105
105
 
106
106
  下方数据来自一次并发基准测试:每个模型在同一份 10 篇业务文档语料上端到端跑完 c4a 全流程(capture → align → compile),无人工介入。质量按 7 个维度评分(总分 100)反映产物知识库;耗时覆盖 `context init` 到 `compile close` 的全流程。
107
107
 
108
- | 维度 | GPT 5.5(Codex) | Opus 4.7(Claude) | DeepSeek V4 Pro(Claude) |
109
- |---|---:|---:|---:|
110
- | 事实覆盖(25) | 22 | 22 | 18 |
111
- | 事实忠实(25) | 23 | 19 | 18 |
112
- | 结构语义(15) | 13 | 8 | 7 |
113
- | URL(5) | 3 | 2 | 5 |
114
- | Source ref(10) | 9 | 7 | 6 |
115
- | Section 边界(10) | 9 | 7 | 5 |
116
- | Schema(10) | 8 | 9 | 7 |
117
- | **总分** | **87** | **74** | **66** |
118
- | 总耗时 | 14m55s | 19m6s | 14m44s |
108
+ | 维度 | Opus 4.8(Claude) | GPT 5.5(Codex) | Opus 4.7(Claude) | DeepSeek V4 Pro(Claude) |
109
+ |---|---:|---:|---:|---:|
110
+ | 事实覆盖(25) | 23 | 23 | 22 | 18 |
111
+ | 事实忠实(25) | 24 | 23 | 19 | 18 |
112
+ | 结构语义(15) | 14 | 13 | 8 | 7 |
113
+ | URL(5) | 5 | 4 | 2 | 5 |
114
+ | Source ref(10) | 9 | 9 | 7 | 6 |
115
+ | Section 边界(10) | 9 | 10 | 7 | 5 |
116
+ | Schema(10) | 9 | 10 | 9 | 7 |
117
+ | **总分** | **93** | **92** | **74** | **66** |
118
+ | 总耗时 | 30m47s | 10m07s | 19m6s | 14m44s |
119
119
 
120
120
  ## 关于本仓库
121
121
 
@@ -21,12 +21,13 @@ Use the returned `workflow.next-action-envelope.v2` as the source of truth:
21
21
  - Treat `allowed_actions[]` as permission for read-only insertions such as `show_view`; do not choose a different write path from it.
22
22
  - Treat `agent_hints[]`, when present, as a temporary mirror or diagnostic only. If it conflicts with `next_action`, follow `next_action`.
23
23
  - Read workflow payload views only through returned `context workflow show` commands.
24
+ - If the host truncates scan stdout but the preview includes top-level `next_action.command`, run that command. If `next_action` is not visible, rerun the scan command; do not recover host tool-result files.
24
25
 
25
26
  For protocol discovery, prefer narrow commands:
26
27
 
27
28
  - `context schema workflow.next-action-envelope.v2 --view minimal --format json`
28
29
  - `context protocol show align-compile --format json`
29
- - `context schema align-structure-intent --view minimal --format json`
30
+ - `context schema align-structure-intent --view minimal --format json` — includes required fields, enums, mount matrix, and a minimal authoring example; use full schema only for extended notes.
30
31
 
31
32
  ### Step 2 — Read Evidence Through The Single Evidence Path
32
33
 
@@ -34,7 +35,7 @@ If scan returns a `read-plan` command, run it and then follow the next command r
34
35
 
35
36
  - `read-plan` summarizes source size, active source set, navigation/placeholder sources, and the next evidence command.
36
37
  - `source-bundle` returns the selected source text with `@c4a` block annotations. Read it, then write the requested align JSON yourself, normally `align-structure-intent`; do not pipe the bundle text into `context align validate`.
37
- - If `source-bundle` omits text for budget, run its `next_action.command`.
38
+ - If `source-bundle` omits text for budget, `read_scope_complete: false`, `page.has_more: true`, or the final `source-bundle:end` annotation is missing, run its `next_action.command` before authoring.
38
39
  - If the next command contains `--read-cursor`, treat it as opaque continuation state. Do not decode it and do not replace it with hand-written `--source` / `--window` / `--range` / `--heading` selectors.
39
40
  - `blocks`, `windows`, `block-index`, `source-mapping`, and `pending-relation-refs` are detail views only. Use them when the read-plan/source-bundle next action or `how_to_explore[]` asks for a narrow follow-up.
40
41
 
@@ -46,12 +47,12 @@ If a detail view returns `align-blocks-read-incomplete`, `page.has_more`, or `tr
46
47
 
47
48
  Reuse existing knowledge before inventing new Nodes: use `context mdrive glossary match <name>` and `context mdrive node list --format json` for term/entity reuse.
48
49
 
49
- Apply packaged `context:skill-align-workflow` Node classification gates and align intent procedure. Keep generated payloads on stdin. Prefer heredocs for small payloads; if payload staging is needed for large or parallel writes, use the workspace AGENTS.md scratch path (`.context/.tmp/agent-payloads/<run-id>/...` in embedded workspaces, `.tmp/agent-payloads/<run-id>/...` in root-layout workspaces) and redirect stdin from it. Never reuse fixed `/tmp/c4a-*` names and never place scratch payloads under output/archive/knowledge/raw truth directories.
50
+ Apply packaged `context:skill-align-workflow` Node classification gates and align intent procedure. Keep generated payloads on stdin. Prefer heredocs for small payloads; if payload staging is needed for large or parallel writes, use the workspace AGENTS.md scratch path (`.context/.tmp/agent-payloads/<run-id>/...` in embedded workspaces, `.tmp/agent-payloads/<run-id>/...` in root-layout workspaces) and redirect stdin from it. Never reuse fixed `/tmp/c4a-*` names and never place scratch payloads under CLI-managed `.tmp/context-cli/`, `output/`, `archive/`, `knowledge/`, or `raw/` truth directories.
50
51
 
51
52
  Use CLI diagnostics instead of static prompt rules:
52
53
 
53
- - `diagnostics.automatic_ownership_adjustments[]` explains mechanical external-reference demotions and the explicit ownership override shape.
54
- - `pending-relation-refs` lists explicit Parent/Children/Related markdown links. Reuse existing target Nodes when present; keep unresolved target slug hints deferred instead of writing dangling `contains_parent` / `domain_gate.child_refs` or empty placeholder Domains.
54
+ - `diagnostics.automatic_ownership_adjustments[]` explains mechanical structural-block demotions and the explicit ownership override shape.
55
+ - `pending-relation-refs` lists explicit Parent/Children/Related markdown links. Reuse existing target Nodes when present; keep unresolved target slug hints deferred instead of writing dangling `contains_parent` / `domain_gate.child_refs`. A relation/placeholder source may still be preserved as a no-write Node with root-level `planned_sections: []`; preserve it before default skip when an explicit retrieval need, graph need, or atomic/concrete title gives the page standalone retrieval value, even if every child ref is unresolved. Never put `planned_sections` inside `domain_gate`. If it is kept without graph support, keep supporting blocks `context_only` with `visible_to`. If you skip the source and emit no Node for it, still cover its coverable blocks with an `ownership_groups[]` rule, usually source-wide `ignored` for pure placeholders. `ignored` disposes unused material and does not support the placeholder by itself. Unresolved children stay pending rather than becoming graph edges.
55
56
  - Validation diagnostics identify contiguity, citation eligibility, ownership, and mount-matrix problems.
56
57
  - `views[]` and `diagnostics` distinguish citable evidence from supporting context; do not infer citation eligibility from raw ownership prose.
57
58
 
@@ -24,8 +24,10 @@ Invocation note: code capture does not run through `npx`. The default code aspec
24
24
 
25
25
  ### Route by argument
26
26
 
27
- - `$ARGUMENTS` is one or more `http://` / `https://` targets and/or local `.md` paths `context capture $ARGUMENTS` (Feishu docx/wiki URLs need `lark-cli`; URL and mixed batches are supported). Do not write an Agent-side URL loop.
28
- - User provides a long newline-separated URL list or local `.md` path list → pass it to `context capture --stdin` with a direct heredoc. Mixed URL + local `.md` batches are supported when the user intentionally provides both.
27
+ 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.
28
+
29
+ - `$ARGUMENTS` is one or more `http://` / `https://` targets and/or local `.md` source documents to ingest → `context capture $ARGUMENTS` (Feishu docx/wiki URLs need `lark-cli`; URL and mixed batches are supported). Do not write an Agent-side URL loop.
30
+ - User provides a long newline-separated URL list or local `.md` source document list to ingest → pass it to `context capture --stdin` with a direct heredoc. Mixed URL + local `.md` batches are supported when the user intentionally provides both.
29
31
  - `$ARGUMENTS` contains `--inbox` → `context capture --inbox`.
30
32
  - `$ARGUMENTS` contains `--refresh` → `context capture --refresh`. This refreshes active Feishu URL sources and local Markdown sources whose stored origin file still exists; code sources use `context capture --code`.
31
33
  - User asks for code capture with explicit `--module` flags → run `context capture --code $ARGUMENTS`, preserving code flags such as `--module`, `--version`, `--version-from`, and `--no-runner-cache`.
@@ -21,7 +21,7 @@ Naming convention:
21
21
  - **`--aspect code [selector]`** — run `context compile --aspect code [selector]`, report the CLI result, and stop unless the CLI asks for a follow-up close. The selector may be omitted to process all actionable code sources; when present, the CLI resolves source slug, package name, or module path.
22
22
  - **`--aspect <name>`** — run deterministic custom aspect projection for one configured aspect. Use `context compile --aspect <name> --allow-large-deprecate` only when the CLI rejected a large deprecate and the user confirms the runner output is intentionally empty or reduced.
23
23
  - **`--all`** — run `context compile --all` to materialize code projection first and then custom aspect projections in deterministic order.
24
- - **Delegated** — add `--delegated` only when the user explicitly authorized delegated/automatic mode at the start of this conversation. Do not infer it from vague "continue" permission.
24
+ - **Delegated** — add `--delegated` only when the user explicitly authorized delegated mode at the start of this conversation. Delegated mode records scoped authority for low-risk reconcile/review/apply defaults; it does not auto-draft Node content or replace agent evidence reading. Do not infer it from vague "continue" permission.
25
25
 
26
26
  ### Core Rules
27
27
 
@@ -30,6 +30,7 @@ Naming convention:
30
30
  - Treat `allowed_actions[]` as permission for read-only insertions; it is not a menu of alternate write paths.
31
31
  - Treat `agent_hints[]`, when present, as a temporary mirror or diagnostic. If it conflicts with `next_action`, follow `next_action`.
32
32
  - Do not use direct file tools, shell scripts, `jq`, `sed`, `cat`, `head`, `tail`, Python, or Node.js to inspect workspace storage, workflow payload files, or `--format json` stdout.
33
+ - Workflow write digest flags are stale guards. Omit `--payload-digest` unless the returned command explicitly requires one; when an explicit digest is needed, use `context workflow show --payload <name> --digest-only --format text` instead of parsing JSON stdout.
33
34
 
34
35
  Protocol discovery:
35
36
 
@@ -40,8 +41,9 @@ Protocol discovery:
40
41
  ## Start
41
42
 
42
43
  1. Run `context compile scan --format json` (or `context compile scan --delegated --format json` only for explicit delegated mode).
43
- 2. If the scan returns `stop_noop` or no changed work, report that compile stopped before draft and no files were written.
44
- 3. Run `context status --view summary --format json` or `context mdrive workspace stats --format json` only when needed for the final before/after report or when the CLI asks for diagnostics. Do not run doctor/status/source-list as a required preflight before following a valid compile scan or align-finalize handoff.
44
+ 2. If the scan returns `close_compile`, run the returned close command even when there are no changed Nodes; finalized no-write/container Nodes may still need close materialization.
45
+ 3. If the scan returns `stop_noop` or no changed work, report that compile stopped before draft and no files were written.
46
+ 4. Run `context status --view summary --format json` or `context mdrive workspace stats --format json` only when needed for the final before/after report or when the CLI asks for diagnostics. Do not run doctor/status/source-list as a required preflight before following a valid compile scan or align-finalize handoff.
45
47
 
46
48
  Run `context compile scan` only for this initial preflight unless the CLI explicitly returns it as the next command after a terminal/no-work state. During an active compile workflow, discover the next node from the current envelope (`next_action`, `views[]`, `workset_progress`) and follow returned commands; do not rerun scan between node cycles to probe for the next node.
47
49
 
@@ -60,8 +62,7 @@ Run the evidence command returned by the envelope before writing. `views[].expec
60
62
  - `request_full_text_command` / `--view text` — narrow text view for one block when quote preview is not enough; this is still Node-scoped, not a workspace evidence bundle.
61
63
  - `citable_source_refs[]` — detailed-view refs eligible for draft citations; prefer `block_id` values in `source_block_ids[]`.
62
64
  - `supporting_context_refs[]` — background/framing only.
63
- - `required_preserved_literals[]` URL, code identifier, `source_ref`, or `block_id` literals that must stay visible in the generated content or repair report.
64
- - diagnostics such as citation eligibility, source support, coverage, engagement, and advisory foldbacks.
65
+ - diagnostics such as citation eligibility, coverage, engagement, stale raw/source_ref pointers, and advisory foldbacks.
65
66
 
66
67
  Follow `page.next_command` for pagination. Use `how_to_explore[]` for narrow reads. Do not expand workflow payloads through host tool-results. Node-cycle receipts are compact by default; `actions_meta[]` exposes current draft action handles for patching without an extra status read. When advisory foldbacks say `agent_recommended_action: ignore`, do not inspect each detail row unless the user asks for cleanup or the cited source appears to lose meaning.
67
68
 
@@ -75,9 +76,9 @@ For `continue_compile_cycle`, do not invoke the draft skill and do not attach `-
75
76
 
76
77
  For `patch_compile_draft`, submit only the patch schema requested by the CLI. Use `actions_meta[].action_id` for `replace_action` / `remove_action`, or `add_action` with `before` / `after`; do not use generic `op/path/value` aliases.
77
78
 
78
- For `review_reconcile_decisions`, load the prepare payload through CLI views such as `context workflow show --payload prepare --unwrap --format json`, invoke packaged `context:skill-compile-judge` when semantic judgment is needed, run `context reconcile validate --mode compile --node <slug> --decisions - --format json`, repair any blocking diagnostics, then pass validated decisions to the returned review command.
79
+ For `review_reconcile_decisions`, first inspect the returned command and prepare summary. If the command is `context reconcile review --accept-safe-defaults ...` with no `--decisions -`, run it directly; the CLI is accepting only mechanical defaults. If manual decisions remain, load the prepare payload through CLI views such as `context workflow show --payload prepare --view issues --unwrap --format json`, accept default_decision items with compact `{ item_id, accept_default: true }` when you can verify they are appropriate, and invoke packaged `context:skill-compile-judge` only for items that still need support/relation judgment. For hand-authored decision payloads, run `context reconcile validate --mode compile --node <slug> --decisions - --format json`, repair any blocking diagnostics, then pass validated decisions to the returned review command.
79
80
 
80
- Invoke `context:skill-compile-judge` only when the top-level `next_action.kind` is exactly `review_reconcile_decisions`. If `questions` are present but `next_action.kind` is `patch_compile_draft`, patch the draft first; do not infer judge mode from question counts.
81
+ Do not treat every `review_reconcile_decisions` envelope as a judge request. Invoke `context:skill-compile-judge` only when the prepare summary includes `judge_handoff` or the returned diagnostics explicitly ask for support/relation judgment. If `questions` are present but `next_action.kind` is `patch_compile_draft`, patch the draft first; do not infer judge mode from question counts.
81
82
 
82
83
  For `apply_reconcile_review`, execute the returned plain apply command exactly, typically `context reconcile apply --format json`; do not add `--decisions` or stdin. For `close_compile`, `finish_current_node`, `submit_coverage_disposition`, or `abandon_or_rescan`, execute the returned command exactly. If it rejects, follow the new `next_action` and `reason_code`.
83
84
 
@@ -89,8 +90,9 @@ Use typed diagnostics as the repair contract:
89
90
  - `diagnostics.auto_repaired[]` records mechanical repairs; warning severity must be surfaced in the final report.
90
91
  - `diagnostics.warnings[]` with info/advisory severity are not write blockers unless `blocking: true` or the next action says so.
91
92
  - `agent_recommended_action` classifies warning handling: `ignore` means continue unless the user asks for cleanup, `respond_optional` means repair only when semantically useful, and `respond_required` means resolve before the returned write action can succeed.
92
- - `source_support` is advisory lexical diagnostics, not a keyword gate. Do not patch drafts only to satisfy term overlap. Blocking evidence checks should come from invalid source refs, changed evidence boundaries, unsupported confirmed hard facts, or explicit top-level `next_action`. URL preservation, section kind precision, example formatting, and summary style are advisory/debt unless the CLI explicitly marks them blocking.
93
+ - Raw/source_ref pointer diagnostics are mechanical evidence checks, not content-quality judges. Do not patch drafts only to satisfy URL/style/term-overlap preferences. Blocking evidence checks should come from invalid source refs, stale raw mirrors, changed evidence boundaries, or explicit top-level `next_action`.
93
94
  - stale prepare refresh returns `review_reconcile_decisions` with `reason_code: "prepare_refreshed"`; reread the new prepare result before reviewing.
95
+ - If close reports a finalized Node that needs only block ownership/support repair, use `context compile repair ownership --input - --format json` with the `align.ownership-patch.v2` shape. This is the compile-family repair path and preserves completed node-cycle progress. Do not abandon the active compile workflow just to run `context align patch ownership`.
94
96
 
95
97
  Do not recover by replaying an old manual path, editing rendered files, or guessing schema aliases.
96
98
 
@@ -98,4 +100,4 @@ Do not recover by replaying an old manual path, editing rendered files, or guess
98
100
 
99
101
  When `next_action.kind` is `close_compile`, execute `context compile close` through packaged `context:skill-compile-close` or the returned command. Never claim success unless close exits 0 and verify is green, except the explicit no-work path.
100
102
 
101
- Report in the user's conversation language. Include semantic apply counts, close/verify status, warning-level `auto_repaired[]`, `ready_with_debt` coverage/review-debt summaries when present, and before/after workspace totals. Do not surface internal workflow payload digests, source-ref hashes, archive paths, or absolute file paths unless a user-facing report view explicitly returns them.
103
+ Report in the user's conversation language. Include semantic apply counts, close/verify status, warning-level `auto_repaired[]`, `ready_with_debt` coverage summaries when present, and before/after workspace totals. Do not surface internal workflow payload digests, source-ref hashes, archive paths, or absolute file paths unless a user-facing report view explicitly returns them.
@@ -15,17 +15,19 @@ Naming convention: `/context:*` names user slash commands and `context ...` name
15
15
  Routing rules (first match wins):
16
16
 
17
17
  1. **Empty arguments** → run `/context:status`.
18
- 2. **Starts with `http://` or `https://`, or ends in `.md`** → `/context:capture $ARGUMENTS`.
19
- 3. **Equals `--inbox` or `--refresh`** → `/context:capture $ARGUMENTS`.
20
- 4. **Matches `init`, `initialize`, `new workspace`, or looks like a plain workspace name** `/context:init $ARGUMENTS`.
21
- 5. **Mentions `code` or source-code capture** → `/context:capture --code $ARGUMENTS`.
22
- 6. **Mentions `aspect` without a concrete supported capture flag** ask one clarification; code aspect capture is exposed as `/context:capture --code`.
23
- 7. **Matches `align`, `structure`, `plan`, `node tree`** → `/context:align $ARGUMENTS`.
24
- 8. **Matches `compile`, `recompile`, `synthesize`, or `build knowledge`** → `/context:compile $ARGUMENTS`.
25
- 9. **Matches `drop`, `retract`, `delete source`, or passes a known source-id pattern (`feishu:*` / `local:*` / `aspect:*` / `oncall:*` / `meeting:*`)** → `/context:drop $ARGUMENTS`.
26
- 10. **Matches `purge`, `clear archive`, `delete archive`, or `清理归档`** → `/context:purge $ARGUMENTS`.
27
- 11. **Equals `status`, `health`, `overview`, `summary`, or asks for workspace/cache/plugin health** → `/context:status`.
28
- 12. **Anything else** (likely a knowledge question) → `/context:query $ARGUMENTS`.
18
+ 2. **Starts with `http://` or `https://`** → `/context:capture $ARGUMENTS`.
19
+ 3. **Ends in `.md` and is explicitly presented as source material to ingest/capture** → `/context:capture $ARGUMENTS`.
20
+ Driver documents such as run instructions, handbooks, READMEs, plans, feedback issues, corpus/index/manifests, and batch lists are not capture targets 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.
21
+ 4. **Equals `--inbox` or `--refresh`** → `/context:capture $ARGUMENTS`.
22
+ 5. **Matches `init`, `initialize`, `new workspace`, or looks like a plain workspace name** `/context:init $ARGUMENTS`.
23
+ 6. **Mentions `code` or source-code capture** → `/context:capture --code $ARGUMENTS`.
24
+ 7. **Mentions `aspect` without a concrete supported capture flag** ask one clarification; code aspect capture is exposed as `/context:capture --code`.
25
+ 8. **Matches `align`, `structure`, `plan`, `node tree`** → `/context:align $ARGUMENTS`.
26
+ 9. **Matches `compile`, `recompile`, `synthesize`, or `build knowledge`** → `/context:compile $ARGUMENTS`.
27
+ 10. **Matches `drop`, `retract`, `delete source`, or passes a known source-id pattern (`feishu:*` / `local:*` / `aspect:*` / `oncall:*` / `meeting:*`)** → `/context:drop $ARGUMENTS`.
28
+ 11. **Matches `purge`, `clear archive`, `delete archive`, or `清理归档`** → `/context:purge $ARGUMENTS`.
29
+ 12. **Equals `status`, `health`, `overview`, `summary`, or asks for workspace/cache/plugin health** → `/context:status`.
30
+ 13. **Anything else** (likely a knowledge question) → `/context:query $ARGUMENTS`.
29
31
 
30
32
  If multiple rules apply, pick the most specific (URL beats word match). When in doubt, ask one clarifying question before dispatching.
31
33
  Never use Read / Glob / Grep / Write against `WORKSPACE_DIR`; route to packaged `/context:*` commands and skills instead of opening plugin or workspace files manually.
@@ -47,7 +47,7 @@ Q. What default language should agents use for user-facing replies in this works
47
47
  C. Other — please describe.
48
48
  ```
49
49
 
50
- The option label must be localized, but the stored CLI value should remain stable. Pass the answer as `--language "Chinese"`, `--language "English"`, or the user's custom text.
50
+ The option label must be localized, but the stored CLI value should remain stable. Pass the answer as `--language Chinese`, `--language English`, or quote custom text as `--language '<custom text>'`.
51
51
 
52
52
  ### Step 3 — Ask about workspace focus (unless user already passed `--focus`)
53
53
 
@@ -68,15 +68,16 @@ Q. What will this workspace mainly hold?
68
68
  ```
69
69
 
70
70
  Interpret the answer:
71
+ - When appending generated or user-provided free text to the shell command, quote it with POSIX single quotes. If the text contains a single quote, escape it as `'\''`; do not use double quotes for free-form values.
71
72
  - Chose A–D → generate a 2–3 line focus description in the user's language. Phrase it as
72
73
  "primarily X; supporting materials such as Y may also be filed here" rather than exclusion
73
74
  language — workspaces absorb auxiliary material in practice. Show the exact generated focus
74
75
  text to the user and ask for one confirmation before running `context init`. If the user
75
- approves, pass it as `--focus "..."`; if the user edits it, pass the edited text as
76
- `--focus "..."`; if the user declines or says to skip, run without `--focus`.
77
- - Chose E or described freely → pass the user's text verbatim as `--focus "..."`.
76
+ approves, pass it as `--focus '...'`; if the user edits it, pass the edited text as
77
+ `--focus '...'`; if the user declines or says to skip, run without `--focus`.
78
+ - Chose E or described freely → pass the user's text verbatim as `--focus '...'`.
78
79
  - User says "skip" / "don't care" → run `context init` without `--focus`.
79
- - `$ARGUMENTS` already contains `--focus "..."` → skip this step entirely.
80
+ - `$ARGUMENTS` already contains `--focus <text>` → skip this step entirely.
80
81
 
81
82
  ### Step 4 — Choose aspects (unless `$ARGUMENTS` already has aspect flags)
82
83
 
@@ -127,6 +128,7 @@ Briefly state in the user's conversation language:
127
128
  - Default language
128
129
  - Installed aspects
129
130
  - Whether `AGENTS.md` was created and whether `CLAUDE.md` was linked
131
+ - If the user asks to read the generated workspace instructions, run `context workspace read AGENTS.md --format text`; do not open the data-root file with generic file tools.
130
132
  - Whether focus was recorded (show the first line if yes; mention the user can edit `config.yaml` later if not)
131
133
  - If the CLI prints a Claude local permission hint, tell the user that `Bash(context:*)` is the recommended scoped allow for heredoc-heavy context workflows. Do not edit `.claude/settings.local.json` unless the user explicitly asks.
132
134
  - Suggest `/context:capture` as the natural next step
@@ -16,13 +16,14 @@ Run `context align scan --format json`, follow the top-level `next_action.comman
16
16
  - `workflow.next-action-envelope.v2` is authoritative. Branch on `next_action.kind`, execute `next_action.command`, and treat `views[].command` as detail reads rather than a checklist.
17
17
  - `allowed_actions[]` may permit extra read-only work before the next write; it is not a menu of alternate write paths.
18
18
  - `agent_hints[]`, when still present, is a short-term cutover mirror or diagnostic. Do not prefer it over top-level `next_action`.
19
- - Schema names and enum values come from `context schema <name>`; use `--view minimal` for protocol discovery before full schema reads.
19
+ - Schema names and enum values come from `context schema <name>`. Use `--view minimal` first; for authoring schemas such as `align-structure-intent`, the minimal view includes required fields, enums, and a minimal payload example. Read the full schema only when you need extended notes or edge-case examples.
20
20
  - Existing knowledge is the lookup registry. Use `context mdrive glossary match <name>` and `context mdrive node list --format json`; do not read `knowledge/**` or create a separate registry file.
21
21
  - Code projection Nodes are reusable knowledge handles. When document evidence belongs on a code symbol, reuse the code slug instead of creating a parallel document Node.
22
- - `diagnostics.automatic_ownership_adjustments[]` and validation diagnostics are the mechanical external-reference ownership source of truth. Independent reference definitions, pure URLs, relation kind blocks, and multiline reference-only lists default to context_only; submit an explicit `block_ownership[]` owned/shared entry only when such a reference block is primary citation evidence.
23
- - When `pending-relation-refs` is present, inspect it before finalizing graph structure. Use existing/current matches for `contains_parent_ref` or `domain_gate.child_refs`; keep unresolved target slug hints deferred and do not write dangling parent, child, or edge refs. For navigation-only / placeholder-only sources whose child refs are all deferred, the default is no Node, not an empty Domain with `child_refs: []`; only use `entity[term]` when the source title is an atomic term.
22
+ - `diagnostics.automatic_ownership_adjustments[]` and validation diagnostics are the mechanical structural-block ownership source of truth. Source-wide owned/shared defaults automatically demote non-content blocks such as navigation references, placeholders, front matter, marker quotes, embed tags, and embedded assets to `context_only` or `ignored`; submit an explicit `block_ownership[]` owned/shared entry only when such a block is primary citation evidence.
23
+ - When `pending-relation-refs` is present, inspect it before finalizing graph structure. Use existing/current matches for `contains_parent_ref` or `domain_gate.child_refs`; keep unresolved target slug hints deferred and do not write dangling parent, child, or edge refs. For navigation-only / placeholder-only sources, first preserve useful source/page identities as no-write Nodes with root-level `planned_sections: []` when an explicit retrieval need, graph need, or atomic/concrete title gives the page standalone retrieval value; this no-write Entity priority can apply even when every child ref is unresolved. Never put `planned_sections` inside `domain_gate`. Those kept placeholders need support through `context_only` blocks with `visible_to`, owned/shared evidence, or finalized graph support. If a placeholder/relation source is skipped entirely, still classify its coverable blocks with a source-wide `ownership_groups[]` rule, usually `ignored` for pure placeholders. `ignored` only disposes unused material and does not support a placeholder by itself. Domain placeholders may have `domain_gate.child_refs: []` when every child is still deferred. Only use `entity[term]` when the source title is an atomic term.
24
24
  - `views[]` and diagnostics distinguish citable evidence from supporting context. Do not promote supporting/context-only material into cited Sections unless a later ownership correction makes it citation-eligible.
25
25
  - Keep cache-friendly prompt order: fixed protocol/schema first, existing knowledge lookup second, source evidence views third, current semantic payload last. Preserve CLI JSON order and do not add timestamps, random ids, scratch paths, or host paths to generated payloads.
26
+ - Workflow digest flags are stale guards. Follow returned `next_action.command` and omit optional digest flags unless the CLI asks for one; if an explicit digest is needed, recover it with `context workflow show --payload <name> --digest-only --format text`, not JSON parsing.
26
27
  - Node type, tag, fake-Entity, `domain`, and `action` gates are in `references/gates.md`.
27
28
  - Coarse reading density and neutral signal rules are in `references/density-profile.md`.
28
29
  - Candidate anomaly handling, `label_hint`, and `llm_slug_hint` reference rules are in `references/candidate-resolution.md`.
@@ -37,6 +38,8 @@ Use this only inside `/context:align`.
37
38
 
38
39
  Run `context align scan --format json`. Confirm `schema_version: "workflow.next-action-envelope.v2"`, then identify `next_action`, `views`, `workflow`, `route`, and `diagnostics`.
39
40
 
41
+ If the host truncates scan stdout but the preview includes top-level `next_action.command`, run that command. If `next_action` is not visible, rerun the scan command; do not recover host tool-result files.
42
+
40
43
  If no envelope is present, stop and surface the CLI output; do not reconstruct an align route from old prompt memory.
41
44
 
42
45
  ### Step 2 — Follow The Evidence Read Path
@@ -45,7 +48,7 @@ Run the returned `next_action.command`. For structural align work this is normal
45
48
 
46
49
  `read-plan` is the navigation surface. It chooses whether the next evidence read is a whole-batch `source-bundle`, a scoped source/window bundle, or an existing coarse-read route. `source-bundle` is annotated source text; read it and then author the requested align JSON yourself, normally `align-structure-intent`. Never pipe bundle text into `context align validate`.
47
50
 
48
- If `source-bundle` omits text for budget, run its `next_action.command`.
51
+ If `source-bundle` omits text for budget, `read_scope_complete: false`, `page.has_more: true`, or the final `source-bundle:end` annotation is missing, run its `next_action.command` before authoring.
49
52
 
50
53
  Read evidence through semantic CLI views, not shell parsing. Follow `page.next_command` for pagination. If the command contains `--read-cursor`, treat it as opaque continuation state and run it exactly; do not replace it with hand-written `--source`, `--heading`, `--window`, or `--range` selectors. Use `--source`, `--heading`, `--window`, `--range`, and `--token-budget` as view filters only. `--unwrap` removes workflow metadata; it does not expand a compact view into full detail.
51
54
 
@@ -63,19 +66,23 @@ Apply `references/gates.md` before authoring Nodes: classify Node type in order
63
66
 
64
67
  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.
65
68
 
69
+ For `node.title` and `node.summary`, follow `align-segments.generation_policy.language`. In Chinese workspaces, translate descriptive scaffold words such as architecture, strategy, lifecycle, overview, scheduling, high availability, and warning into Chinese while preserving product names, code identifiers, CLI flags, slugs, block_id tokens, and citation tokens exactly when needed. Do not copy an English source title into `node.title` merely because the source is English.
70
+
71
+ Do not classify a broad architecture/system/方案 source as `domain` just because the title sounds like a scope. If it has writable Sections but no resolvable current/existing child Nodes, use an `entity` tag such as `system` or `application`; reserve `domain` for grouping child Nodes through `domain_gate.child_refs`.
72
+
66
73
  For large or batched payloads, use `references/density-profile.md` and `references/candidate-resolution.md` only when the CLI `next_action` asks for coarse-read or candidate-op payloads. Do not choose those stages yourself.
67
74
 
68
75
  ### Step 5 — Build The Payload Requested By `next_action`
69
76
 
70
- Use `next_action.input_schema` or the matching `context schema <name> --view minimal --format json` output to shape the payload.
77
+ Use `next_action.input_schema` and the matching `context schema <name> --view minimal --format json` output to shape the payload. If the minimal view exposes `required`, `enums`, `minimal_example`, and `field_guidance`, treat it as the authoring contract; read the full schema only when those fields are insufficient for an edge case.
71
78
 
72
- For the default `align-structure-intent` path, produce one intent document with semantic Nodes, `section_groups[]`, `ownership_groups[]`, optional explicit `block_ownership[]` patches, and edges. Let CLI generate `section_id` values and expand ownership groups into canonical defaults/exceptions. For long sources, do not hand-enumerate the largest ownership range; use one `{ source_id }` ownership group for the majority owner, then use `{ block_ids }` groups or explicit patches only for exceptions.
79
+ For the default `align-structure-intent` path, produce one intent document with semantic Nodes, `section_groups[]`, `ownership_groups[]`, and edges. Let CLI generate `section_id` values and expand ownership groups into canonical defaults/exceptions. For long sources, do not hand-enumerate the largest ownership range; use one `{ source_id }` ownership group for the majority owner, then use `{ block_ids }` ownership groups for semantic exceptions. `block_ownership[]` is an advanced single-block patch path only when schema output or CLI diagnostics explicitly ask for it; it uses singular `block_id` and never `scope` or `block_ids`. Do not add `{ source_id, structural_role }` groups merely to mark front matter, navigation, placeholders, marker quotes, embed tags, or embedded assets as non-citation material; the source-wide default's automatic demotion handles those.
73
80
 
74
- Use only `block_ids[]` in `section_groups[]`. Do not invent heading/range/window selectors inside the intent. Treat source heading changes as section-planning signals: sibling sub-headings under a shared parent may stay in one Section when they form one coherent semantic topic; headings with no shared parent should usually split unless you intentionally want one Section to span them. The CLI reports cross-heading groups but does not rewrite your semantic grouping. If one semantic section spans non-contiguous citation-eligible blocks, align may accept the grouping, but finalized ownership will split it into compile draft-ready contiguous runs; compile source-refs templates should stay separate by default. Every block you leave as `owned` or `shared` citation evidence must appear in some section group; otherwise reclassify it as `context_only` or `ignored`. If a no-write/navigation-only/placeholder-only Node is intentionally kept, set `planned_sections: []` explicitly so the CLI knows this was intentional. Do not keep such a Node by default when all children are unresolved relation clues; skip it until a child or content source resolves. Do not express deferred children as `domain_gate.child_refs: []`, and do not turn a container placeholder into `entity[term]` unless the title itself is a useful atomic term.
81
+ Use only `block_ids[]` in `section_groups[]`. Do not invent heading/range/window selectors inside the intent. Treat source heading changes as section-planning signals: sibling sub-headings under a shared parent may stay in one Section when they form one coherent semantic topic; headings with no shared parent should usually split unless you intentionally want one Section to span them. The CLI reports cross-heading groups but does not rewrite your semantic grouping. If one semantic section spans non-contiguous citation-eligible blocks, align may accept the grouping, but finalized ownership will split it into compile draft-ready contiguous runs; hard citation-gap templates should stay separate. Every block you leave as `owned` or `shared` citation evidence must appear in some section group; otherwise reclassify it as `context_only` or `ignored`. If a no-write/navigation-only/placeholder-only Node is kept, set root-level `planned_sections: []` explicitly so the CLI knows this was intentional, and keep at least one supporting block as `context_only` with `visible_to` unless the Node already has owned/shared evidence or finalized graph support. `planned_sections` is a node field, not a `domain_gate` child. `ignored` is valid for skipped material or extra placeholder lines, but it does not create `context_sources` or unblock close by itself. If you skip a relation-only, navigation-only, or placeholder-only source after ruling out resolved Domain support and standalone retrieval or graph value, you still must classify every coverable block; use one source-wide `ownership_groups[]` rule with `ownership_role: "ignored"` or `context_only` instead of leaving the source absent from ownership. For Domain placeholders, put only resolved current/existing targets in `domain_gate.child_refs`; if all child refs are unresolved relation clues, use `child_refs: []` and leave the unresolved rows in pending-relation-refs. Do not turn a container placeholder into `entity[term]` unless the title itself is a useful atomic term.
75
82
 
76
83
  Emit `depends_on` edges only when cited source blocks explicitly say one Node consumes, requires, calls, is configured by, or is downstream of another Node as a prerequisite, capability provider, upstream input, runtime dependency, or data-flow source. Direction is consumer/downstream -> provider/upstream. Do not create `depends_on` for parent/child containment, `Related`/`See also` lists, sibling co-occurrence, shared table membership, name similarity, or a plain mention without a dependency predicate. `edges[].evidence_blocks[]` must include the block that states the dependency; if the relationship matters but evidence is missing, leave the edge out or add an unresolved question instead of guessing.
77
84
 
78
- Prefer the strongest source-backed `section_kind` that fits the current schema priority chain; avoid planning an entire dense source as `description` when the evidence clearly contains examples, comparison tables, Q&A, decisions, specs, warnings, or principles. Treat kind precision as a drafting quality preference, not a reason to block an otherwise source-backed write. Keep only source-supported semantic decisions in the payload; leave mechanical repair and patch routing to CLI diagnostics.
85
+ Prefer the strongest source-backed `section_kind` that fits the current schema priority chain; avoid planning an entire dense source as `description` when the evidence clearly contains examples, comparison tables, Q&A, decisions, specs, warnings, or principles. Treat kind precision as a drafting quality preference, not a reason to block an otherwise source-backed write. Keep only raw-backed semantic decisions in the payload; leave mechanical repair and patch routing to CLI diagnostics.
79
86
 
80
87
  Canonical `align-structure-decision` is not a parallel authoring path. Use it only when `next_action.input_schema` explicitly asks for it or when auditing/repairing canonical output returned by the CLI.
81
88
 
@@ -7,21 +7,10 @@ This reference applies only when the current envelope asks for `next_action.kind
7
7
  | Profile | Use When | Agent Behavior |
8
8
  |---|---|---|
9
9
  | `macro` | A long source has many headings, sections, or broad topic shifts. | Create section proposals around major headings and preserve document-level anchors so later passes do not flatten scope. |
10
- | `meso` | Default for normal product, design, or operational documents with several related sections. | Produce section proposals for meaningful local units and neutral content signals for each anchor. |
10
+ | `meso` | Default for normal product, design, or operational documents with several related sections. | Produce section proposals for meaningful local units and preserve evidence anchors. |
11
11
  | `micro` | The source is fragmented, note-like, or dense with short independent claims. | Keep section proposals narrow and avoid bundling unrelated blocks into one candidate. |
12
12
  | `single_pass` | The source is short enough that one read can safely discover all relevant structure. | Still emit the `align-coarse-read` artifact, but keep anchors minimal and avoid over-segmentation. |
13
13
 
14
14
  Treat Markdown heading changes as section-planning hints, not hard boundaries. Sibling sub-headings under a shared parent can remain in one `section_groups[]` entry when they form one coherent semantic topic for that parent. Headings with no shared parent should usually split unless you intentionally want one Section to span them. When a dense source has many headings, split by heading first, then merge adjacent or sibling groups only when the merged Section is still one coherent fact group.
15
15
 
16
- ## Content Signals
17
-
18
- `content_signals` are neutral shape signals used later by action/domain gates. They must not directly claim `node_type`, tags, or recommendations.
19
-
20
- | Signal | Meaning |
21
- |---|---|
22
- | `temporal_density` | The text has timelines, phases, schedules, version changes, or ordered time references. |
23
- | `actor_density` | The text names roles, users, teams, systems, services, or operators that perform work. |
24
- | `step_density` | The text contains ordered steps, procedures, phases, checklists, or how-to flow. |
25
- | `directive_density` | The text contains imperatives, policies, constraints, must/should language, or runbook-like instructions. |
26
-
27
- Use only `high`, `med`, or `low` based on the local section text. The canonical middle value is `med`; do not write `medium`. High `step_density` plus explicit actors and outcomes is useful evidence for an Action Gate, but it is not enough by itself to emit an `action` Node.
16
+ Do not emit kind/tag/content signals from coarse-read. Action/domain gates are decided later from the source-bundle evidence and schema gate fields, not from density metadata.
@@ -38,7 +38,15 @@ After choosing `node_type`, choose the title to fit that type:
38
38
 
39
39
  Scope/process words in a source title are warning signals when proposed as an Entity title, not hard classification rules. Re-check the type/title when a proposed Entity title contains words such as "方案", "架构", "体系", "演练", "流程", "策略", "能力", "机制", "framework", "architecture", "system", "strategy", "process", or "drill". Keep the wording only when evidence shows it is the formal name of a concrete object or an atomic term.
40
40
 
41
- Relation-only sources should not force title copying or empty graph shells. If a relation block has resolvable current/existing children and the graph node is useful, prefer an explicit Domain placeholder with `planned_sections: []`. If all children are unresolved/deferred relation clues, skip the Node by default and keep the source blocks `context_only` / `ignored`; the pending relation refs are enough until child content appears. Do not express this deferred state as `domain_gate.child_refs: []`. If the source names only an atomic concept such as SSR/CSR and that term is useful on its own, prefer a term Entity title such as "SSR" or "CSR" instead of "SSR 方案" / "CSR 方案".
41
+ Do not promote broad architecture/system/方案 content to `domain` just because it sounds like a scope. When the source has writable Sections but no resolvable current/existing child Nodes, use an Entity such as `[system]` or `[application]` and put the architecture facts in Sections. Use `domain` only when it groups child Nodes through `domain_gate.child_refs`.
42
+
43
+ Relation-only sources should not force title copying or dangling graph edges. Decide placeholder handling in this order:
44
+
45
+ 1. If resolved current/existing child Nodes make the page a real grouping scope, preserve it as a no-write Domain.
46
+ 2. If an explicit user-facing retrieval need or graph need makes the source/page identity valuable, and the title names an atomic concept or concrete object, preserve it as a no-write Entity with root-level `planned_sections: []`. This priority still applies when all child refs are unresolved/deferred; keep those target hints pending rather than writing dangling graph refs.
47
+ 3. Otherwise, skip navigation-only / placeholder-only material and classify its coverable blocks, usually as `ignored`.
48
+
49
+ Do not put `planned_sections` inside `domain_gate`. A kept placeholder needs support: `context_only` block(s) with `visible_to`, owned/shared evidence, or finalized graph support. `ignored` blocks only dispose unused material and do not support close materialization by themselves. For Domain placeholders, write only resolved current/existing children in `domain_gate.child_refs`; if all children are unresolved/deferred relation clues, use `child_refs: []` and keep those target hints in pending relation refs. If the source names only an atomic concept and that term is useful on its own, prefer a concise term Entity title without scope/process suffixes.
42
50
 
43
51
  ## Entity Tag Rules
44
52
 
@@ -105,7 +113,7 @@ Use `node_type: domain` only for a scope that groups child Nodes. Fill:
105
113
  | `child_refs[]` | Candidate ids, local refs, or final slugs for children in the scope. |
106
114
  | `grouping_reason` | Why these children belong together under this domain. |
107
115
 
108
- If a domain has no resolvable child refs, no clear grouping reason, or only one same-file child without a broader scope, do not emit a Domain. For navigation-only / placeholder-only sources with only deferred children, skip the Node. Emit an Entity only when evidence names an atomic term or concrete object and choose its Entity tag yourself. The CLI rejects invalid Domain gates; it does not auto-downgrade a Domain or choose fallback tags.
116
+ If a domain has no resolvable child refs, no clear grouping reason, or only one same-file child without a broader scope, do not emit a Domain. For navigation-only / placeholder-only sources with only deferred children, skip the Node after ruling out standalone retrieval or graph value for an atomic-term or concrete Entity; still classify that source's coverable blocks with a source-wide `ownership_groups[]` rule, usually `ignored` for pure placeholders. Emit an Entity only when evidence names an atomic term or concrete object and choose its Entity tag yourself. The CLI rejects invalid Domain gates; it does not auto-downgrade a Domain or choose fallback tags.
109
117
 
110
118
  Scope-name titles such as "X 业务域", "Y 领域", "business domain", or "technical area" are a warning sign when proposed as Entity. Keep them as Entity only when the subject is an atomic term or concrete object; otherwise use Domain with `domain_gate.child_refs`.
111
119
 
@@ -34,8 +34,8 @@ command. It does not hand-edit rendered knowledge.
34
34
  - Exit 2 → report the full issue list verbatim + point at the right re-entry command above. Do not hand-open the affected rendered article.
35
35
  - Coverage warnings are CLI-owned diagnostics. `ready_with_debt` means close succeeded and unresolved coverage remains visible. For severely low coverage, recommend one `--cover-uncovered-only` repair pass unless the user explicitly accepts the debt; otherwise report the warning and follow returned coverage view commands / `available_actions[]` only if the user chooses a repair or skip round.
36
36
  - Coverage and engagement denominators count primary citable content evidence. URL/reference-only, marker, frontmatter, embed, navigation, and context-only evidence is excluded or bucketed as non-blocking bookkeeping by the CLI.
37
- - User-accepted hard-fact risk is carried as `review_debt`; report it from close/status when present, but do not treat review-debt count as a close failure.
38
37
  - Materialized knowledge means either a CLI-written knowledge article, or an explicit no-write placeholder from align: `planned_sections: []` plus source/context/graph support. A compile skip action records reviewed evidence, but it does not by itself materialize an arbitrary finalized Node.
38
+ - If close is blocked only because finalized block ownership/support is wrong, use `context compile repair ownership --input - --format json` with `align.ownership-patch.v2`. This keeps the active compile workflow and completed node progress. Do not abandon compile just to run `context align patch ownership`.
39
39
  - Never re-run `context compile draft` from close to paper over verify failures. Draft failures belong in the draft loop.
40
40
  - Do not use Python, Node.js, shell scripts, `ls`, `find`, `rg`, `cat`, or similar ad-hoc commands to inspect `WORKSPACE_DIR`, `.context`, knowledge files, or `/tmp` workflow artifacts.
41
41
  - Derivable files self-heal: missing `_index.md` or `changelog.md` is rebuilt inside `context compile close` before the append, locator-only source moves are refreshed, non-canonical but hash-valid `source_ref` locators are canonicalized, and high-signal coverage candidates already backed by active Sections are marked covered. No pre-check needed.
@@ -67,7 +67,7 @@ Close is one in-process command with one exit code:
67
67
  | Exit 0, 0 issues | Summarise those counts in the user's language: Nodes touched; Sections added / updated / superseded / deprecated / skipped; `recompiled`; `locator_updates`; `rebuilt`; verify green. Stop. |
68
68
  | Exit 0, warnings only | Summarise + list warnings verbatim. For severely low coverage, recommend the CLI-returned `--cover-uncovered-only` repair command before final acceptance; for other coverage warnings, surface returned coverage view commands / `available_actions[]` instead of inventing a local decision matrix. |
69
69
  | Exit 2, Section / content issue | Surface the full issue list; point the user at re-running `/context:compile` (the draft loop owns Section writes). Do NOT Edit the affected rendered article. |
70
- | Exit 2, `compile-close-finalized-node-missing-knowledge` | If the missing Node has real citation evidence, point the user at `/context:compile` for that Node. If it is intentionally navigation-only or placeholder-only, point the user at `/context:align` to make it explicit no-write with `planned_sections: []` and context-only/ignored relation or placeholder blocks. |
70
+ | Exit 2, `compile-close-finalized-node-missing-knowledge` | If the missing Node has real citation evidence, point the user at `/context:compile` for that Node. If it is intentionally navigation-only or placeholder-only and only block ownership/support is wrong, use `context compile repair ownership --input - --format json` to make support explicit with `context_only` + `visible_to` or owned/shared evidence. `ignored` blocks do not support the placeholder by themselves. If the Node itself is structurally wrong, route back to `/context:align` after the active compile workflow is resolved. |
71
71
  | Exit 2, structural issue (cycle, duplicate slug, `invalid-node-type`, `domain-same-file-child`) | Surface the full issue list; point the user at `/context:align` to revise structure. Do not re-run compile. |
72
72
  | Exit 2, `dropped-source-reference` | Surface the source-id; point the user at `/context:drop <id>` to complete the drop cleanup. |
73
73
 
@@ -103,7 +103,7 @@ Use stdout + stderr. The exit code selects the path via [Outcome routing](#outco
103
103
  For each error in the CLI's report, classify via [Outcome routing](#outcome-routing) and name the re-entry command in your report. Do NOT hand-edit rendered knowledge — that violates the CLI-sole-writer principle and masks the real upstream fix. Specifically:
104
104
 
105
105
  - Section / content issue → user re-runs `/context:compile` (draft loop produces new Section actions; the CLI re-writes).
106
- - `compile-close-finalized-node-missing-knowledge` → content Nodes go back through `/context:compile`; navigation-only or placeholder-only Nodes go back through `/context:align` so they become explicit no-write placeholders.
106
+ - `compile-close-finalized-node-missing-knowledge` → content Nodes go back through `/context:compile`; ownership-only placeholder support fixes use `context compile repair ownership --input - --format json`; structural Node changes still go through `/context:align` after the active compile workflow is resolved.
107
107
  - Structural issue → user runs `/context:align` (revise the plan; re-compile afterwards).
108
108
  - `dropped-source-reference` → user runs `/context:drop <id>` to finish drop cleanup.
109
109