@c4a/context-cli 0.7.17 → 0.7.23

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 (41) hide show
  1. package/README.md +16 -2
  2. package/README.zh-CN.md +16 -2
  3. package/cli.js +58612 -58073
  4. package/indexers/contracts/profile-contract.json +245 -245
  5. package/indexers/release-manifest.json +1 -1
  6. package/package.json +12 -12
  7. package/plugins/README.md +5 -4
  8. package/plugins/README_CN.md +4 -2
  9. package/plugins/VERSION +1 -1
  10. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  11. package/plugins/claude/commands/context-inspect-search.md +141 -170
  12. package/plugins/claude/commands/context.md +77 -6
  13. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  14. package/plugins/codex/skills/context/SKILL.md +77 -6
  15. package/plugins/codex/skills/context-inspect-search/SKILL.md +141 -170
  16. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  17. package/plugins/cursor/commands/c4a-context-inspect-search.md +141 -170
  18. package/plugins/cursor/commands/c4a-context.md +77 -6
  19. package/plugins/skills/context/SKILL.md +77 -6
  20. package/plugins/skills/context-inspect-search/SKILL.md +141 -170
  21. package/providers/context/codes.yaml +1 -1
  22. package/providers/context/graphs/indexer.yaml +11 -7
  23. package/providers/context/graphs/workspace.yaml +5 -0
  24. package/providers/context/manifest.json +34 -34
  25. package/providers/context/provider.yaml +1 -1
  26. package/providers/context/resources/manuals/guides/knowledge-updates.md +5 -1
  27. package/providers/context/resources/manuals/guides/workspace-prepare.md +9 -0
  28. package/providers/context/resources/manuals/guides/workspace-restore.md +5 -1
  29. package/providers/context/resources/procedures/approved-revision.md +20 -0
  30. package/providers/context/resources/procedures/knowledge-review.md +11 -4
  31. package/providers/context/resources/procedures/knowledge-updates.md +5 -1
  32. package/providers/context/resources/procedures/package-output.md +4 -0
  33. package/providers/context/resources/procedures/production-requirements.md +5 -3
  34. package/providers/context/resources/procedures/source-boundary.md +15 -5
  35. package/providers/context/resources/procedures/source-capture-detailed.md +17 -0
  36. package/providers/context/resources/procedures/work-start-report.md +19 -6
  37. package/providers/context/resources/procedures/workspace-prepare.md +9 -0
  38. package/providers/context/resources/procedures/workspace-restore.md +5 -1
  39. package/providers/context/skills/resolve-current-indexer-gate/SKILL.md +7 -2
  40. package/providers/context/skills/run-indexer-lifecycle/SKILL.md +3 -2
  41. package/providers/context/skills/work-production-stage/SKILL.md +5 -3
@@ -1,175 +1,146 @@
1
1
  ---
2
- description: "Use only when the user explicitly invokes context-inspect-search to query a Context workspace's approved knowledge and trace answers to its registered documents or source code. Do not auto-start for ordinary coding, planning, debugging, or an active Context production workflow."
2
+ description: "Use only when the user explicitly invokes context-inspect-search to query available Context knowledge packages or approved workspace knowledge and trace answers to their identified sources. A local workspace is optional. Do not auto-start for ordinary coding, planning, debugging, or an active Context production workflow."
3
3
  ---
4
4
 
5
5
  # Context Inspect Search
6
6
 
7
- Answer questions from a selected knowledge workspace, then investigate its
8
- sources when the answer needs verification. This is an independent query entry,
9
- not an Indexer or a production Route. Use the conversation language.
10
-
11
- ## Invocation and scope
12
-
13
- Start only on the user's explicit command or named Skill invocation. Continue
14
- related follow-up questions without repeated invocation; stop applying this
15
- Skill when the user changes task. An existing workspace, error message, or
16
- knowledge-related phrase is not an activation signal.
17
-
18
- Locate the user-selected workspace. With the CLI available, use
19
- `context entry [project-dir] --format json` to identify it and its installed
20
- instructions. This is inspection: do not execute a returned production command
21
- just because it is actionable. If the CLI is unavailable or state inspection
22
- fails, readable files can still support a bounded answer; report what could not
23
- be checked. Do not initialize a replacement workspace or install tools silently.
24
- If several workspaces could match, resolve which one the user means.
25
-
26
- Keep all paths relative to that workspace. Read its `AGENTS.md` and relevant
27
- configuration before investigating. The presence of a `.tmp` directory alone
28
- does not establish a workspace. Querying must not clear caches, reset tasks,
29
- change checkouts, accept Review, or start Author or close. The one permitted
30
- query preparation build is described below.
31
-
32
- ## Choose the query material
33
-
34
- **Prefer an existing usable dist.** Locate the package output from the workspace
35
- configuration and inspect its index and `context-build-inventory.json`. Choose
36
- the package matching the question; do not silently combine unrelated packages.
37
- A usable package has readable delivered pages, not just an existing directory.
38
- Read its bundled query Skill (usually `skills/knowledge-query/SKILL.md`, but
39
- business templates may use another name) and use its navigation and search
40
- instructions within that package. If it has no query Skill, use its readable
41
- indexes and pages; a missing Skill alone is not a reason to rebuild. Do not
42
- execute unrelated scripts merely because they are bundled.
43
-
44
- Do not build first when usable output exists. It represents its last successful
45
- build and selected scope, not necessarily the latest approved workspace content.
46
- A search miss does not make the package unusable or justify a rebuild. For a
47
- latest-content question or an apparent gap, inspect the corresponding approved
48
- knowledge and distinguish it from the delivered version.
49
-
50
- **If no usable output exists, try one build when allowed.** Inspect the current
51
- Route/status and configured package. Only use the normal CLI build action when
52
- its prerequisites are already satisfied and it will not advance an unrelated
53
- active delivery or revision. Do not create package configuration, approve a
54
- template, run close, recover production state or finish pending work just to
55
- make this query possible. When a safe build is available, run its current
56
- command once in the identified workspace, wait for the same invocation's exit
57
- and receipt, then inspect its actual output and query Skill. Do not launch a
58
- second writer or treat partial output as a completed package. There is no
59
- unverified promise that this takes less than 20 seconds.
60
-
61
- **Otherwise query approved knowledge directly.** If the CLI is unavailable,
62
- state cannot be checked, build is not allowed, or the attempt fails, briefly
63
- explain the limitation and continue from readable approved knowledge. Do not
64
- loop through build repairs. Use `knowledge/structure.yaml` to locate pages,
65
- collections and source associations; search selected `knowledge/` paths with
66
- Host file tools, trying domain terms, symbol names and synonyms. Read relevant
67
- sections in context. A search miss proves neither absence of knowledge nor
68
- absence of the underlying capability. Candidates and `.tmp` reports may explain
69
- pending work but are not approved knowledge. If approval cannot be established,
70
- state that limitation rather than treating arbitrary Markdown as approved.
71
-
72
- ## Trace delivered answers to workspace sources
73
-
74
- For a dist hit, find its `dist_path` in the matching package inventory's
75
- `approved_knowledge.files` and follow that record's `approved_path` into the
76
- workspace. `approved_path` is relative to the workspace's `knowledge/` root,
77
- not the dist directory or workspace root; do not guess the mapping from similar filenames. Read that page and its source
78
- associations in `knowledge/structure.yaml`, then follow the registered sources.
79
- If the inventory or mapping is missing, still answer from readable package
80
- content where possible, but do not claim verified original-source attribution.
81
-
82
- The chain is: delivered page build inventory mapping → approved knowledge and
83
- structure registered raw material at its recorded version. The current
84
- approved page can have changed since build; describe differences rather than
85
- silently replacing one version with another. Dist and knowledge are two forms
86
- of the same content, not independent corroborating evidence. The bundled query
87
- Skill owns package-local retrieval; this explicitly invoked inspection Skill
88
- owns the subsequent, separately scoped workspace/source investigation. Cite
89
- which layer supports each claim.
90
-
91
- ## Prepare only the sources needed for attribution
92
-
93
- Follow the relevant page's source references and `sources/*/index.yaml` records.
94
- Check the selected raw body, attachments or repository module and its recorded
95
- version before claiming deep attribution. This readiness check concerns the
96
- selected materials, not completion of the active production workflow.
97
-
98
- For repositories, `context source recovery-plan --format json` provides a
99
- read-only recovery plan. Reuse an accessible checkout only after checking its
100
- remote, pinned commit and module path. Inspect local changes as well: a matching
101
- HEAD does not prove a dirty file is the recorded source. Do not silently use the
102
- latest branch or reset a user's checkout.
103
-
104
- If material is missing, report what cannot be verified and offer the smallest
105
- necessary recovery. With the user's recovery authorization, follow the installed
106
- `repository-source-recovery.md` procedure and schema in the workflow bundle
107
- identified by entry, using the CLI's `source restore` contract. Recover only the
108
- selected source groups; never run `task prepare` or the whole workspace-reset
109
- procedure to enable a query. If a writer is active or recovery cannot safely
110
- coexist, keep the answer bounded and defer the write. Do not invent recovery
111
- payload fields when the installed schema is unavailable.
112
-
113
- For documents, notes and sessions, read their saved source bodies or summaries
114
- and necessary attachments. A summary is not a full conversation transcript.
115
- An external link is not evidence of its unread target. Fetch missing external
116
- material only within the user's authorized scope; current remote content is not
117
- proof of an older snapshot. If historical raw material is unavailable, identify
118
- the gap rather than reconstructing it from generated knowledge.
119
-
120
- ## Explain and verify
121
-
122
- Trace from the approved claim to the relevant source location. Expand to
123
- adjacent definitions or tests only as necessary and within the selected source
124
- scope. Distinguish declared API, implementation behavior, test assertions and
125
- observed runtime behavior; reading code does not prove a runtime experiment.
126
- Apart from the bounded package build above, do not run repository builds, tests
127
- or arbitrary scripts merely to answer a query. If runtime validation is needed, explain the proposed check
128
- and obtain the user's authorization for that scope.
129
-
130
- Lead with the answer, then cite concrete page paths and source locations,
131
- including the version when it affects the conclusion. Separate confirmed facts,
132
- inferences and unavailable evidence. If source versions differ, describe the
133
- difference before deciding that a knowledge page is wrong. Do not dump runtime
134
- ids, long raw excerpts or a mandatory audit report into every answer.
135
-
136
-
137
- ## Website links in the final summary
138
-
139
- After answering from the pages actually read, optionally append one or more
140
- related document links in the final summary. Read `context-site-map.json` from
141
- the selected package (or its sibling website output in a workspace). Match the
142
- read page to `pages[].package_path` or `approved_path`; use its `title` and resolve
143
- `site_path` relative to `site_url`. The URL already includes the deployment base
144
- path: do not prepend `base` again. Only cite matched articles, deduplicate links,
145
- and do not invent section anchors.
146
-
147
- This is a local formatting step, not retrieval or validation. Do not probe URLs,
148
- make HTTP/HEAD requests, open a browser, inspect a deployment platform, or check
149
- remote versions to add links. Never build, publish or update metadata for this
150
- purpose. If the map, URL or matching page is absent or malformed, keep the local
151
- citation and continue silently. A configured URL does not prove that the site
152
- contains the current local revision; do not claim online verification.
153
-
154
- ## Suggest improvements and hand off
155
-
156
- When evidence supports a correction or worthwhile addition, briefly describe:
157
-
158
- - the affected page or missing topic and the reader's actual problem;
159
- - the supporting source location/version and what it establishes;
160
- - whether to revise an existing page, adjust discoverability, add a topic, or
161
- obtain missing material first;
162
- - the bounded pages/sources involved and any uncertainty.
163
-
164
- Check the existing scope and neighboring pages before recommending new content.
165
- Do not create a page solely because a search missed it, and do not propose
166
- unsupported claims as a knowledge update. With insufficient raw evidence, give
167
- an actionable material request instead of forcing an update.
168
-
169
- A suggestion is not authorization to write. Only when the user accepts the
170
- update, hand the question, evidence, proposed change and scope to the installed
171
- `context` production Skill in the same workspace. Read its fresh Route; it owns
172
- candidate repair, approved-page revision and scheduling around active work.
173
- Do not clear state, reuse an earlier revision, directly edit knowledge, or build
174
- a second update workflow. If the production Skill/CLI is unavailable, provide
175
- the handoff information and state that no update has started.
7
+ ## Entry and boundaries
8
+
9
+ Use on explicit invocation and related follow-up questions; use the conversation
10
+ language. The invocation authorizes read-only investigation of the selected
11
+ knowledge packages, available workspace and identified sources within that scope,
12
+ including isolated source retrieval and bounded non-destructive checks. The Skill
13
+ can run from a global installation with host-provided packages and no workspace.
14
+ Resolve scope from the request, conversation and configuration before asking.
15
+ Continue through non-blocking issues; ask only for missing access, genuinely
16
+ unresolved scope or effects outside existing authorization.
17
+
18
+ Start from the supplied package locations or workspace configuration. If a
19
+ workspace exists, read its `AGENTS.md` and relevant configuration;
20
+ `context entry [project-dir] --format json` may help locate instructions.
21
+ Neither a workspace nor a working Context CLI is required for package retrieval;
22
+ do not call entry in an arbitrary directory just to satisfy a prerequisite.
23
+ Do not execute returned production actions, initialize a replacement workspace,
24
+ or install tools without existing authorization. Querying must not alter source
25
+ registrations, snapshots, tasks, approvals or user checkouts.
26
+
27
+ ## Search available material concurrently
28
+
29
+ Check relevant knowledge packages, the workspace and reusable source checkouts
30
+ in parallel. Search each as soon as it is readable; tool checks and authorized
31
+ upgrades must not block independent reading. If a missing configured workspace
32
+ is needed for further attribution, recover it into an isolated directory while
33
+ package retrieval continues. Without a configured workspace, investigate the
34
+ available packages directly; do not request or create one merely to start.
35
+
36
+ A knowledge package may be workspace build output (usually `dist/`), a global
37
+ installation, or an equivalent host-provided directory. Locate it from available
38
+ configuration or installation metadata rather than assuming a fixed path.
39
+ Select packages relevant to the question. Follow their bundled query Skill when
40
+ present; otherwise search readable indexes and pages. Missing Skills or build
41
+ inventories do not block retrieval or justify rebuilding. If a needed package is
42
+ missing, use the host's configured, authorized package retrieval mechanism while
43
+ other reading continues. Only check or prepare tools needed for the next actual
44
+ operation; installation failure does not block independent local retrieval.
45
+
46
+ For gaps or latest-content questions, also search approved knowledge when a workspace is available:
47
+ use `knowledge/structure.yaml` and relevant `knowledge/` paths, trying business
48
+ terms, symbols and synonyms, then read matching sections in context. Delivered
49
+ content may lag approved knowledge; they are not independent corroboration.
50
+ Candidates and temporary reports are not approved pages. A search miss does not
51
+ prove a capability is absent. Do not build merely to answer a query; a separately
52
+ authorized build must follow its own workflow without advancing unrelated work.
53
+
54
+ When package or approved knowledge leaves a gap, directly trace relevant sources
55
+ without asking whether to deepen the query. Use available document, code-search
56
+ or extraction tools within the authorized scope, recording source identity and
57
+ version. Prepare sources while continuing other reading.
58
+ One failed source blocks only dependent claims. Answer when evidence is
59
+ sufficient, without completing unnecessary preparation.
60
+
61
+ ## Trace and retrieve only relevant sources
62
+
63
+ Without a workspace, use explicit source references in the package, its metadata
64
+ or user configuration to identify relevant documents or repository paths and
65
+ commits. Read or retrieve those sources directly within scope; the workspace
66
+ registry is not a mandatory intermediate step. If the source identity or version
67
+ cannot be established, retain package-grounded findings and qualify attribution;
68
+ do not invent a repository or equate current source with the package's baseline.
69
+
70
+ When a workspace and `context-build-inventory.json` are available, map a delivered page's
71
+ `dist_path` through `approved_knowledge.files` to its `approved_path`, relative
72
+ to the workspace's `knowledge/` root. Follow the approved page's associations in
73
+ `knowledge/structure.yaml` and `sources/*/index.yaml`. Without a reliable mapping,
74
+ continue package retrieval and follow explicit source references where available.
75
+ Do not guess originals from similar filenames or claim attribution without
76
+ checking the referenced material.
77
+
78
+ Use the repository and recorded commit identified by the package or workspace
79
+ as the source baseline.
80
+ Reuse existing checkouts only after checking remote, commit, module coverage
81
+ and local changes; do not reset them or change their sparse configuration.
82
+ Missing code goes into a reusable query-owned path such as
83
+ `.tmp/context-inspect/<host>/<repository-path>/<commit>/`, separate from user
84
+ checkouts and production-managed sources. Use safe, credential-free path
85
+ components and the full commit. Verify identity before reuse; never overwrite
86
+ a mismatched directory. Deduplicate recovery and use one writer per checkout;
87
+ that writer may append sparse paths without resetting existing files.
88
+
89
+ Default to lightweight retrieval and sparse checkout:
90
+
91
+ - Use shallow history (`--depth=1`) and deferred contents (`--filter=blob:none`)
92
+ where supported, with a complete partial-clone setup and named promisor remote.
93
+ Configure the sparse scope before checkout and verify the resulting commit.
94
+ - Start from known module paths. If unclear, inspect
95
+ `git ls-tree -r --name-only <commit>` for candidates, then read code to confirm
96
+ their relevance. Expand along imports, calls and service routes as needed;
97
+ deepen history only when needed. A sparse search miss is not a whole-repository miss.
98
+ - Read ready modules while other recovery proceeds. Allow sufficient command
99
+ time (for example 300 seconds or more), but investigate confirmed stalls
100
+ without waiting for timeout; silence alone is not a stall. If unsupported or
101
+ unsuccessful, try caches, commit-specific file retrieval or bounded shallow
102
+ retrieval; use a full clone only when necessary. Do not retry blindly or
103
+ silently substitute the default branch for an unavailable recorded commit.
104
+
105
+ Query retrieval never runs `context source restore`, `task prepare` or production
106
+ capture/recovery actions. Production recovery gates do not block this independent
107
+ inspection. Preserve unavailable-evidence gaps rather than changing production
108
+ state to get past them.
109
+
110
+ Compare relevant baseline files with current code when accessible, including
111
+ relevant local changes. Use actual diffs to assess impact; current code is not a
112
+ substitute for the baseline. Mention a missing comparison only when it limits
113
+ the answer. For documents, notes and sessions, read saved bodies and necessary
114
+ attachments; fetch missing accessible material within scope. A summary is not a
115
+ full transcript, an unread link is not evidence, and current remote content does
116
+ not prove a historical snapshot.
117
+
118
+ ## Answer with evidence and hand off updates
119
+
120
+ Lead with the conclusion and a concise evidence chain. Distinguish implementation,
121
+ declared contracts, test assertions, runtime observations and inferences. Perform
122
+ bounded non-destructive validation only when useful; inspect its effects first
123
+ and do not run unrelated scripts, builds or tests.
124
+
125
+ Link material actually read: source files at the inspected commit, knowledge
126
+ website articles and original documents. If no reliable clickable link exists,
127
+ give checkable local paths, symbols and short supporting excerpts with the
128
+ limitation. Do not dump internal reasoning, runtime identifiers or routine
129
+ version comparisons. Explain only differences affecting the answer; hashes may
130
+ appear in source URLs without requiring a separate version audit in the prose.
131
+
132
+ For website links, use `context-site-map.json` from the selected package or
133
+ sibling website output. Match `pages[].package_path` or `approved_path`, and
134
+ resolve `site_path` against `site_url` without prepending `base` again. Cite only
135
+ matched pages, deduplicate links and do not invent anchors. If mapping is absent
136
+ or invalid, retain local citations. Do not build, publish or probe remote sites
137
+ just to format citations; a local map is not proof of the current online content.
138
+
139
+ Suggest a knowledge update only with supporting evidence: identify the affected
140
+ page or gap, proposed change and bounded source scope. Check neighboring content
141
+ before proposing a new page. Only after user acceptance, hand the evidence and
142
+ scope to the installed `context` production Skill in the selected workspace and
143
+ its fresh Route. If no target workspace is known, resolve it at that handoff,
144
+ not as a prerequisite to answering. Do not edit approved knowledge, clear state
145
+ or reuse an earlier revision. If that entry
146
+ is unavailable, provide the handoff and state that no update has started.
@@ -94,13 +94,16 @@ settings. Reuse explicit answers and defaults; ask only for unresolved items.
94
94
 
95
95
  Use focused dialogue, not additional source reading, until every required start
96
96
  condition is resolved. Then write and present the complete work-start report
97
- supplied by the source-boundary Route and wait for the user's feedback. Do not
97
+ supplied by the source-boundary Route. Apply the confirmation policy below: a
98
+ specific earlier user request can approve an unchanged, bounded scope; otherwise
99
+ wait for feedback when confirmation is required. Do not
98
100
  present an unresolved draft as the report that authorizes production. The report
99
101
  or checklist is task guidance, not a source unless the user explicitly asks to
100
102
  ingest it. Before the complete report has been presented, do not write a
101
103
  source-registration payload, start capture or extraction, configure Indexers,
102
104
  or begin knowledge writing. A
103
- managed-mode choice does not waive this first reading opportunity. After feedback,
105
+ managed-mode choice does not waive this first reading opportunity. After the
106
+ applicable scope decision,
104
107
  use the exact current Route and include its work-start report reference in the
105
108
  source batch payload. Existing workspace updates follow their current update Route
106
109
  and do not recreate this first-task intake unless they start a new production task.
@@ -140,7 +143,9 @@ Follow the returned `next_action.command`:
140
143
 
141
144
  - `enter-workspace` and `evaluate-workflow` are read-only.
142
145
  - `initialize-workspace` may run immediately if the user requested initialization;
143
- otherwise confirm the target. Preserve any `init-target-nonempty` confirmation.
146
+ otherwise confirm the target. For `context.gate.workspace_initialize_nonempty`,
147
+ reuse the user's explicit target choice; ask if the nonempty target was not
148
+ clearly selected.
144
149
  - After initialization, execute its exact setup command, enter the project root,
145
150
  read the generated `AGENTS.md`, then run the entry again.
146
151
 
@@ -157,6 +162,50 @@ Reuse an explicit review/managed choice across capture and continuation. Neither
157
162
  mode settles unclear purpose, missing permissions or non-delegatable decisions.
158
163
  Status, discussion and save-only requests need no production-mode question.
159
164
 
165
+ ## Confirmation policy
166
+
167
+ The `context.gate.*` IDs below are stable Agent policy switches, not CLI flags or
168
+ workflow authority IDs. Keep the existing Route gate ID, command and payload
169
+ unchanged. An instance-specific Bot may override a switch; precedence is Bot >
170
+ fully managed > ordinary. Reuse a decision already made for the same scope.
171
+
172
+ | Policy ID | Ordinary default | Fully managed default | Existing Route gate, if any |
173
+ | --- | --- | --- | --- |
174
+ | `context.gate.production_entry` | Ask only if intent is unclear. | Same. | Context entry |
175
+ | `context.gate.workspace_initialize_nonempty` | Proceed if the user already selected this target; otherwise ask before initializing a nonempty directory. | Same. | Context entry `init-target-nonempty` |
176
+ | `context.gate.work_start_scope` | Present the report; ask only if the scope is complex **and** affects more than five new or revised articles. A matching request for 1–3 documents or one MR-triggered note needs no repeat question. | Same. | `production-work-start-report`, `indexer-semantic-structure-review` |
177
+ | `context.gate.source_boundary` | Use the user's selected source scope; ask only for missing boundaries. | Same. | `source-boundary` |
178
+ | `context.gate.source_read` | A user-supplied source authorizes reading it for the requested task; do not ask again. | Same. | `source-read-permission` |
179
+ | `context.gate.repository_clone` | Ask before cloning a missing repository. Other authorized recovery needs no repeat question. | Restore within the selected scope without asking. | Repository restore authority |
180
+ | `context.gate.indexer_extra_action` | Ask only if the operation blocks the requested result and no authorized alternative works. | Resolve eligible operations without asking. | Indexer authorization Routes |
181
+ | `context.gate.image_handling` | Ask once when the task has more than 30 distinct images and no prior handling choice. | Same. | Work-start report |
182
+ | `context.gate.top_level_directory` | Confirm the concrete structure. | Same. | Knowledge map guidance |
183
+ | `context.gate.knowledge_review` | Ask for a decision on the current HTML report. | Delegate when the Route permits. | `knowledge-review` |
184
+ | `context.gate.deletion_scope` | A user-approved deletion of exact sources or approved pages needs no second question after the CLI preview; ask only before deleting additional objects outside that scope. | Same. | Source remove / article retirement preview |
185
+ | `context.gate.force_review_approval` | If the user explicitly says `强制批准` after the report is inaccessible, execute the current force-approval Route without another question. | Same. | `knowledge-review` recovery |
186
+ | `context.gate.package_output` | Ask. | Choose within the requested delivery scope. | `package-output` |
187
+ | `context.gate.package_template` | Ask. | Choose within the requested delivery scope. | `package-template-review` |
188
+ | `context.gate.git_delivery` | Ask before commit, push or MR. | Same. | Host Git delivery |
189
+ | `context.gate.publication` | Ask before publishing. | Same. | Distribution tool |
190
+ | `context.gate.remote_target_create` | Ask before creating a remote target. | Same. | Distribution tool |
191
+ | `context.gate.workspace_reset_restore` | An explicit clear or historical restore request needs no second confirmation when target and losses are clear; clarify either if ambiguous. | Same. | Workspace prepare/restore |
192
+ | `context.gate.exceptional_recovery` | Ask only for a P0 blocker that prevents action and affects the requested result. | Same. | Current recovery Route |
193
+
194
+ `context.gate.work_start_scope` and `context.gate.knowledge_review` are separate
195
+ decisions; the latter uses the HTML report. Follow the current Route's payload and
196
+ revision. If a Route requires a human decision despite this policy, stop at that
197
+ Gate and report the mismatch instead of fabricating approval. For extra Indexer
198
+ operations that are not blocking, skip the optional operation rather than
199
+ granting its authority implicitly. Fully managed mode does not authorize
200
+ modifying source code or bypassing a non-delegatable Gate.
201
+
202
+ If an instance sets `context.gate.knowledge_review: ask` while using fully
203
+ managed mode, do not start a `--managed --until blocked-or-complete` loop that
204
+ could cross Review. At Review, evaluate without managed review authority and
205
+ follow the ordinary HTML report and user-decision Route. Force approval remains
206
+ available only after the user's exact Route-required reply; the override itself
207
+ never authorizes it.
208
+
160
209
  Enable debug only when requested: use `entry --debug` for initialization or
161
210
  `context debug enable` in an existing workspace. It records diagnostics under
162
211
  `.tmp/context-runtime/debug/`; it grants no authority and is not source evidence.
@@ -169,6 +218,20 @@ npm install -g @c4a/context-cli@latest
169
218
  context plugin install
170
219
  ```
171
220
 
221
+ For authorized local installation, `--local <path>` requires explicit `--agent`:
222
+ - `claude`, `cursor`, `codex`: path is the repository root; install into its
223
+ `.claude`, `.cursor`, `.agents` directory respectively, without host detection.
224
+ - `all`: install all three host layouts.
225
+ - `auto-detect`: select existing host directories in that repository only,
226
+ never PATH or desktop applications; if none exist, use `.agents/skills`.
227
+ - `standalone`: write all skills directly to `<path>/skills`, without commands.
228
+ All combinations support `--dry-run`. Bare `--local` is rejected. Older explicit
229
+ host installs took a host directory; now pass the repository root to avoid
230
+ nesting. Check CLI help for support before using these options on older versions.
231
+ Local entries have no plugin namespace and do not change global configuration.
232
+ Preserve customized files on conflict; refresh the host after installation.
233
+ Existing usable entries need no reinstall. Global installation is unchanged.
234
+
172
235
  Stop with that recovery. Do not run an installation preflight or auto-install;
173
236
  a normal Context `not found` diagnostic does not mean the executable is missing.
174
237
 
@@ -222,8 +285,9 @@ clear runtime state to force a transition. Explicit historical restoration may
222
285
  restore exact Git-saved workspace files after the preparation guide has ended
223
286
  old task state; it is not an alternative content-writing path. Do not infer sources, extraction
224
287
  scope, review decisions or package choices from surrounding files. Operations on
225
- source repositories—clone, checkout, reset, fetch, install, build or test—require
226
- explicit authorization for that scope.
288
+ source repositories stay within the selected source scope. Ask before cloning in
289
+ ordinary mode. Do not modify source code or run destructive recovery outside the
290
+ user's authorization.
227
291
 
228
292
  ## Follow the current Route
229
293
 
@@ -235,7 +299,8 @@ explicit grant.
235
299
 
236
300
  After continuation is authorized or the new target is registered, both modes
237
301
  may use `context run --until blocked-or-complete` for consecutive mechanical
238
- steps. With explicit managed authorization:
302
+ steps. With explicit managed authorization and no instance-specific Review
303
+ override:
239
304
 
240
305
  ```bash
241
306
  context run --managed --until blocked-or-complete --format json
@@ -285,6 +350,12 @@ Mechanical blockers follow the returned repair/recovery action; advisory
285
350
  warnings do not independently require rewriting content. Migration also uses
286
351
  its returned command, not manual path renames.
287
352
 
353
+ For Lark capture, use the available `lark-cli` without a session-wide version
354
+ precheck. Only when the Context command reports a missing or incompatible CLI,
355
+ follow its private-install recovery. Keep `CONTEXT_LARK_CLI_BIN` pointing to that
356
+ private executable on subsequent Context commands that access Lark; do not
357
+ upgrade or replace the host's global `lark-cli`.
358
+
288
359
  **Continue.** Read `next_route.file` for the full Route after a compact receipt;
289
360
  `result_file` is for full diagnostics. Otherwise use the returned workspace
290
361
  Route (`next`, `continuation.next` or `workflow.current`). Do not call status