@c4a/context-cli 0.7.20 → 0.7.25

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 (33) hide show
  1. package/README.md +6 -6
  2. package/README.zh-CN.md +6 -6
  3. package/cli.js +667 -651
  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/VERSION +1 -1
  8. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  9. package/plugins/claude/commands/context.md +77 -6
  10. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  11. package/plugins/codex/skills/context/SKILL.md +77 -6
  12. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  13. package/plugins/cursor/commands/c4a-context.md +77 -6
  14. package/plugins/skills/context/SKILL.md +77 -6
  15. package/providers/context/codes.yaml +1 -1
  16. package/providers/context/graphs/indexer.yaml +11 -7
  17. package/providers/context/graphs/workspace.yaml +5 -0
  18. package/providers/context/manifest.json +30 -30
  19. package/providers/context/provider.yaml +1 -1
  20. package/providers/context/resources/manuals/guides/knowledge-updates.md +5 -1
  21. package/providers/context/resources/manuals/guides/workspace-prepare.md +4 -0
  22. package/providers/context/resources/manuals/guides/workspace-restore.md +5 -1
  23. package/providers/context/resources/procedures/knowledge-review.md +11 -4
  24. package/providers/context/resources/procedures/knowledge-updates.md +5 -1
  25. package/providers/context/resources/procedures/package-output.md +4 -0
  26. package/providers/context/resources/procedures/production-requirements.md +5 -3
  27. package/providers/context/resources/procedures/source-boundary.md +15 -5
  28. package/providers/context/resources/procedures/work-start-report.md +19 -6
  29. package/providers/context/resources/procedures/workspace-prepare.md +4 -0
  30. package/providers/context/resources/procedures/workspace-restore.md +5 -1
  31. package/providers/context/skills/resolve-current-indexer-gate/SKILL.md +7 -2
  32. package/providers/context/skills/run-indexer-lifecycle/SKILL.md +3 -2
  33. package/providers/context/skills/work-production-stage/SKILL.md +5 -3
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "protocol": "context.indexer.cli-release-manifest/v1",
3
3
  "package": "@c4a/context-cli",
4
- "version": "0.7.20",
4
+ "version": "0.7.25",
5
5
  "issuer": "context4ai/context",
6
6
  "bundles": [
7
7
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/context-cli",
3
- "version": "0.7.20",
3
+ "version": "0.7.25",
4
4
  "type": "module",
5
5
  "description": "Local runtime and Agent integration for traceable knowledge production",
6
6
  "license": "MIT",
@@ -24,17 +24,17 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@c4a/agent-graph": "0.3.0",
27
- "@c4a/context": "0.7.20",
28
- "@c4a/extract": "0.7.20",
29
- "@c4a/extract-contract": "0.7.20",
30
- "@c4a/extract-go": "0.7.20",
31
- "@c4a/extract-mdx": "0.7.20",
32
- "@c4a/extract-proto": "0.7.20",
33
- "@c4a/extract-rush": "0.7.20",
34
- "@c4a/extract-sql": "0.7.20",
35
- "@c4a/extract-style": "0.7.20",
36
- "@c4a/extract-thrift": "0.7.20",
37
- "@c4a/extract-ts": "0.7.20",
27
+ "@c4a/context": "0.7.25",
28
+ "@c4a/extract": "0.7.25",
29
+ "@c4a/extract-contract": "0.7.25",
30
+ "@c4a/extract-go": "0.7.25",
31
+ "@c4a/extract-mdx": "0.7.25",
32
+ "@c4a/extract-proto": "0.7.25",
33
+ "@c4a/extract-rush": "0.7.25",
34
+ "@c4a/extract-sql": "0.7.25",
35
+ "@c4a/extract-style": "0.7.25",
36
+ "@c4a/extract-thrift": "0.7.25",
37
+ "@c4a/extract-ts": "0.7.25",
38
38
  "@mermaid-js/layout-elk": "0.2.0",
39
39
  "commander": "^11.0.0",
40
40
  "fast-xml-parser": "^5.10.1",
package/plugins/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.20
1
+ 0.7.25
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "c4a",
3
3
  "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
4
- "version": "0.7.20",
4
+ "version": "0.7.25",
5
5
  "author": {
6
6
  "name": "c4a"
7
7
  },
@@ -99,13 +99,16 @@ settings. Reuse explicit answers and defaults; ask only for unresolved items.
99
99
 
100
100
  Use focused dialogue, not additional source reading, until every required start
101
101
  condition is resolved. Then write and present the complete work-start report
102
- supplied by the source-boundary Route and wait for the user's feedback. Do not
102
+ supplied by the source-boundary Route. Apply the confirmation policy below: a
103
+ specific earlier user request can approve an unchanged, bounded scope; otherwise
104
+ wait for feedback when confirmation is required. Do not
103
105
  present an unresolved draft as the report that authorizes production. The report
104
106
  or checklist is task guidance, not a source unless the user explicitly asks to
105
107
  ingest it. Before the complete report has been presented, do not write a
106
108
  source-registration payload, start capture or extraction, configure Indexers,
107
109
  or begin knowledge writing. A
108
- managed-mode choice does not waive this first reading opportunity. After feedback,
110
+ managed-mode choice does not waive this first reading opportunity. After the
111
+ applicable scope decision,
109
112
  use the exact current Route and include its work-start report reference in the
110
113
  source batch payload. Existing workspace updates follow their current update Route
111
114
  and do not recreate this first-task intake unless they start a new production task.
@@ -145,7 +148,9 @@ Follow the returned `next_action.command`:
145
148
 
146
149
  - `enter-workspace` and `evaluate-workflow` are read-only.
147
150
  - `initialize-workspace` may run immediately if the user requested initialization;
148
- otherwise confirm the target. Preserve any `init-target-nonempty` confirmation.
151
+ otherwise confirm the target. For `context.gate.workspace_initialize_nonempty`,
152
+ reuse the user's explicit target choice; ask if the nonempty target was not
153
+ clearly selected.
149
154
  - After initialization, execute its exact setup command, enter the project root,
150
155
  read the generated `AGENTS.md`, then run the entry again.
151
156
 
@@ -162,6 +167,50 @@ Reuse an explicit review/managed choice across capture and continuation. Neither
162
167
  mode settles unclear purpose, missing permissions or non-delegatable decisions.
163
168
  Status, discussion and save-only requests need no production-mode question.
164
169
 
170
+ ## Confirmation policy
171
+
172
+ The `context.gate.*` IDs below are stable Agent policy switches, not CLI flags or
173
+ workflow authority IDs. Keep the existing Route gate ID, command and payload
174
+ unchanged. An instance-specific Bot may override a switch; precedence is Bot >
175
+ fully managed > ordinary. Reuse a decision already made for the same scope.
176
+
177
+ | Policy ID | Ordinary default | Fully managed default | Existing Route gate, if any |
178
+ | --- | --- | --- | --- |
179
+ | `context.gate.production_entry` | Ask only if intent is unclear. | Same. | Context entry |
180
+ | `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` |
181
+ | `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` |
182
+ | `context.gate.source_boundary` | Use the user's selected source scope; ask only for missing boundaries. | Same. | `source-boundary` |
183
+ | `context.gate.source_read` | A user-supplied source authorizes reading it for the requested task; do not ask again. | Same. | `source-read-permission` |
184
+ | `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 |
185
+ | `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 |
186
+ | `context.gate.image_handling` | Ask once when the task has more than 30 distinct images and no prior handling choice. | Same. | Work-start report |
187
+ | `context.gate.top_level_directory` | Confirm the concrete structure. | Same. | Knowledge map guidance |
188
+ | `context.gate.knowledge_review` | Ask for a decision on the current HTML report. | Delegate when the Route permits. | `knowledge-review` |
189
+ | `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 |
190
+ | `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 |
191
+ | `context.gate.package_output` | Ask. | Choose within the requested delivery scope. | `package-output` |
192
+ | `context.gate.package_template` | Ask. | Choose within the requested delivery scope. | `package-template-review` |
193
+ | `context.gate.git_delivery` | Ask before commit, push or MR. | Same. | Host Git delivery |
194
+ | `context.gate.publication` | Ask before publishing. | Same. | Distribution tool |
195
+ | `context.gate.remote_target_create` | Ask before creating a remote target. | Same. | Distribution tool |
196
+ | `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 |
197
+ | `context.gate.exceptional_recovery` | Ask only for a P0 blocker that prevents action and affects the requested result. | Same. | Current recovery Route |
198
+
199
+ `context.gate.work_start_scope` and `context.gate.knowledge_review` are separate
200
+ decisions; the latter uses the HTML report. Follow the current Route's payload and
201
+ revision. If a Route requires a human decision despite this policy, stop at that
202
+ Gate and report the mismatch instead of fabricating approval. For extra Indexer
203
+ operations that are not blocking, skip the optional operation rather than
204
+ granting its authority implicitly. Fully managed mode does not authorize
205
+ modifying source code or bypassing a non-delegatable Gate.
206
+
207
+ If an instance sets `context.gate.knowledge_review: ask` while using fully
208
+ managed mode, do not start a `--managed --until blocked-or-complete` loop that
209
+ could cross Review. At Review, evaluate without managed review authority and
210
+ follow the ordinary HTML report and user-decision Route. Force approval remains
211
+ available only after the user's exact Route-required reply; the override itself
212
+ never authorizes it.
213
+
165
214
  Enable debug only when requested: use `entry --debug` for initialization or
166
215
  `context debug enable` in an existing workspace. It records diagnostics under
167
216
  `.tmp/context-runtime/debug/`; it grants no authority and is not source evidence.
@@ -174,6 +223,20 @@ npm install -g @c4a/context-cli@latest
174
223
  context plugin install
175
224
  ```
176
225
 
226
+ For authorized local installation, `--local <path>` requires explicit `--agent`:
227
+ - `claude`, `cursor`, `codex`: path is the repository root; install into its
228
+ `.claude`, `.cursor`, `.agents` directory respectively, without host detection.
229
+ - `all`: install all three host layouts.
230
+ - `auto-detect`: select existing host directories in that repository only,
231
+ never PATH or desktop applications; if none exist, use `.agents/skills`.
232
+ - `standalone`: write all skills directly to `<path>/skills`, without commands.
233
+ All combinations support `--dry-run`. Bare `--local` is rejected. Older explicit
234
+ host installs took a host directory; now pass the repository root to avoid
235
+ nesting. Check CLI help for support before using these options on older versions.
236
+ Local entries have no plugin namespace and do not change global configuration.
237
+ Preserve customized files on conflict; refresh the host after installation.
238
+ Existing usable entries need no reinstall. Global installation is unchanged.
239
+
177
240
  Stop with that recovery. Do not run an installation preflight or auto-install;
178
241
  a normal Context `not found` diagnostic does not mean the executable is missing.
179
242
 
@@ -227,8 +290,9 @@ clear runtime state to force a transition. Explicit historical restoration may
227
290
  restore exact Git-saved workspace files after the preparation guide has ended
228
291
  old task state; it is not an alternative content-writing path. Do not infer sources, extraction
229
292
  scope, review decisions or package choices from surrounding files. Operations on
230
- source repositories—clone, checkout, reset, fetch, install, build or test—require
231
- explicit authorization for that scope.
293
+ source repositories stay within the selected source scope. Ask before cloning in
294
+ ordinary mode. Do not modify source code or run destructive recovery outside the
295
+ user's authorization.
232
296
 
233
297
  ## Follow the current Route
234
298
 
@@ -240,7 +304,8 @@ explicit grant.
240
304
 
241
305
  After continuation is authorized or the new target is registered, both modes
242
306
  may use `context run --until blocked-or-complete` for consecutive mechanical
243
- steps. With explicit managed authorization:
307
+ steps. With explicit managed authorization and no instance-specific Review
308
+ override:
244
309
 
245
310
  ```bash
246
311
  context run --managed --until blocked-or-complete --format json
@@ -290,6 +355,12 @@ Mechanical blockers follow the returned repair/recovery action; advisory
290
355
  warnings do not independently require rewriting content. Migration also uses
291
356
  its returned command, not manual path renames.
292
357
 
358
+ For Lark capture, use the available `lark-cli` without a session-wide version
359
+ precheck. Only when the Context command reports a missing or incompatible CLI,
360
+ follow its private-install recovery. Keep `CONTEXT_LARK_CLI_BIN` pointing to that
361
+ private executable on subsequent Context commands that access Lark; do not
362
+ upgrade or replace the host's global `lark-cli`.
363
+
293
364
  **Continue.** Read `next_route.file` for the full Route after a compact receipt;
294
365
  `result_file` is for full diagnostics. Otherwise use the returned workspace
295
366
  Route (`next`, `continuation.next` or `workflow.current`). Do not call status
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c4a",
3
- "version": "0.7.20",
3
+ "version": "0.7.25",
4
4
  "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
5
5
  "author": { "name": "c4a" },
6
6
  "homepage": "https://github.com/context4ai/c4a",
@@ -10,7 +10,7 @@
10
10
  "skills": "./skills/",
11
11
  "interface": {
12
12
  "displayName": "C4A Context",
13
- "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.7.20",
13
+ "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.7.25",
14
14
  "longDescription": "Create a Context workspace and use agent-guided next steps to register sources, run extraction, review candidates, build package outputs, and verify health without silently mutating source repositories.",
15
15
  "developerName": "c4a",
16
16
  "category": "Productivity",
@@ -97,13 +97,16 @@ settings. Reuse explicit answers and defaults; ask only for unresolved items.
97
97
 
98
98
  Use focused dialogue, not additional source reading, until every required start
99
99
  condition is resolved. Then write and present the complete work-start report
100
- supplied by the source-boundary Route and wait for the user's feedback. Do not
100
+ supplied by the source-boundary Route. Apply the confirmation policy below: a
101
+ specific earlier user request can approve an unchanged, bounded scope; otherwise
102
+ wait for feedback when confirmation is required. Do not
101
103
  present an unresolved draft as the report that authorizes production. The report
102
104
  or checklist is task guidance, not a source unless the user explicitly asks to
103
105
  ingest it. Before the complete report has been presented, do not write a
104
106
  source-registration payload, start capture or extraction, configure Indexers,
105
107
  or begin knowledge writing. A
106
- managed-mode choice does not waive this first reading opportunity. After feedback,
108
+ managed-mode choice does not waive this first reading opportunity. After the
109
+ applicable scope decision,
107
110
  use the exact current Route and include its work-start report reference in the
108
111
  source batch payload. Existing workspace updates follow their current update Route
109
112
  and do not recreate this first-task intake unless they start a new production task.
@@ -143,7 +146,9 @@ Follow the returned `next_action.command`:
143
146
 
144
147
  - `enter-workspace` and `evaluate-workflow` are read-only.
145
148
  - `initialize-workspace` may run immediately if the user requested initialization;
146
- otherwise confirm the target. Preserve any `init-target-nonempty` confirmation.
149
+ otherwise confirm the target. For `context.gate.workspace_initialize_nonempty`,
150
+ reuse the user's explicit target choice; ask if the nonempty target was not
151
+ clearly selected.
147
152
  - After initialization, execute its exact setup command, enter the project root,
148
153
  read the generated `AGENTS.md`, then run the entry again.
149
154
 
@@ -160,6 +165,50 @@ Reuse an explicit review/managed choice across capture and continuation. Neither
160
165
  mode settles unclear purpose, missing permissions or non-delegatable decisions.
161
166
  Status, discussion and save-only requests need no production-mode question.
162
167
 
168
+ ## Confirmation policy
169
+
170
+ The `context.gate.*` IDs below are stable Agent policy switches, not CLI flags or
171
+ workflow authority IDs. Keep the existing Route gate ID, command and payload
172
+ unchanged. An instance-specific Bot may override a switch; precedence is Bot >
173
+ fully managed > ordinary. Reuse a decision already made for the same scope.
174
+
175
+ | Policy ID | Ordinary default | Fully managed default | Existing Route gate, if any |
176
+ | --- | --- | --- | --- |
177
+ | `context.gate.production_entry` | Ask only if intent is unclear. | Same. | Context entry |
178
+ | `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` |
179
+ | `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` |
180
+ | `context.gate.source_boundary` | Use the user's selected source scope; ask only for missing boundaries. | Same. | `source-boundary` |
181
+ | `context.gate.source_read` | A user-supplied source authorizes reading it for the requested task; do not ask again. | Same. | `source-read-permission` |
182
+ | `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 |
183
+ | `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 |
184
+ | `context.gate.image_handling` | Ask once when the task has more than 30 distinct images and no prior handling choice. | Same. | Work-start report |
185
+ | `context.gate.top_level_directory` | Confirm the concrete structure. | Same. | Knowledge map guidance |
186
+ | `context.gate.knowledge_review` | Ask for a decision on the current HTML report. | Delegate when the Route permits. | `knowledge-review` |
187
+ | `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 |
188
+ | `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 |
189
+ | `context.gate.package_output` | Ask. | Choose within the requested delivery scope. | `package-output` |
190
+ | `context.gate.package_template` | Ask. | Choose within the requested delivery scope. | `package-template-review` |
191
+ | `context.gate.git_delivery` | Ask before commit, push or MR. | Same. | Host Git delivery |
192
+ | `context.gate.publication` | Ask before publishing. | Same. | Distribution tool |
193
+ | `context.gate.remote_target_create` | Ask before creating a remote target. | Same. | Distribution tool |
194
+ | `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 |
195
+ | `context.gate.exceptional_recovery` | Ask only for a P0 blocker that prevents action and affects the requested result. | Same. | Current recovery Route |
196
+
197
+ `context.gate.work_start_scope` and `context.gate.knowledge_review` are separate
198
+ decisions; the latter uses the HTML report. Follow the current Route's payload and
199
+ revision. If a Route requires a human decision despite this policy, stop at that
200
+ Gate and report the mismatch instead of fabricating approval. For extra Indexer
201
+ operations that are not blocking, skip the optional operation rather than
202
+ granting its authority implicitly. Fully managed mode does not authorize
203
+ modifying source code or bypassing a non-delegatable Gate.
204
+
205
+ If an instance sets `context.gate.knowledge_review: ask` while using fully
206
+ managed mode, do not start a `--managed --until blocked-or-complete` loop that
207
+ could cross Review. At Review, evaluate without managed review authority and
208
+ follow the ordinary HTML report and user-decision Route. Force approval remains
209
+ available only after the user's exact Route-required reply; the override itself
210
+ never authorizes it.
211
+
163
212
  Enable debug only when requested: use `entry --debug` for initialization or
164
213
  `context debug enable` in an existing workspace. It records diagnostics under
165
214
  `.tmp/context-runtime/debug/`; it grants no authority and is not source evidence.
@@ -172,6 +221,20 @@ npm install -g @c4a/context-cli@latest
172
221
  context plugin install
173
222
  ```
174
223
 
224
+ For authorized local installation, `--local <path>` requires explicit `--agent`:
225
+ - `claude`, `cursor`, `codex`: path is the repository root; install into its
226
+ `.claude`, `.cursor`, `.agents` directory respectively, without host detection.
227
+ - `all`: install all three host layouts.
228
+ - `auto-detect`: select existing host directories in that repository only,
229
+ never PATH or desktop applications; if none exist, use `.agents/skills`.
230
+ - `standalone`: write all skills directly to `<path>/skills`, without commands.
231
+ All combinations support `--dry-run`. Bare `--local` is rejected. Older explicit
232
+ host installs took a host directory; now pass the repository root to avoid
233
+ nesting. Check CLI help for support before using these options on older versions.
234
+ Local entries have no plugin namespace and do not change global configuration.
235
+ Preserve customized files on conflict; refresh the host after installation.
236
+ Existing usable entries need no reinstall. Global installation is unchanged.
237
+
175
238
  Stop with that recovery. Do not run an installation preflight or auto-install;
176
239
  a normal Context `not found` diagnostic does not mean the executable is missing.
177
240
 
@@ -225,8 +288,9 @@ clear runtime state to force a transition. Explicit historical restoration may
225
288
  restore exact Git-saved workspace files after the preparation guide has ended
226
289
  old task state; it is not an alternative content-writing path. Do not infer sources, extraction
227
290
  scope, review decisions or package choices from surrounding files. Operations on
228
- source repositories—clone, checkout, reset, fetch, install, build or test—require
229
- explicit authorization for that scope.
291
+ source repositories stay within the selected source scope. Ask before cloning in
292
+ ordinary mode. Do not modify source code or run destructive recovery outside the
293
+ user's authorization.
230
294
 
231
295
  ## Follow the current Route
232
296
 
@@ -238,7 +302,8 @@ explicit grant.
238
302
 
239
303
  After continuation is authorized or the new target is registered, both modes
240
304
  may use `context run --until blocked-or-complete` for consecutive mechanical
241
- steps. With explicit managed authorization:
305
+ steps. With explicit managed authorization and no instance-specific Review
306
+ override:
242
307
 
243
308
  ```bash
244
309
  context run --managed --until blocked-or-complete --format json
@@ -288,6 +353,12 @@ Mechanical blockers follow the returned repair/recovery action; advisory
288
353
  warnings do not independently require rewriting content. Migration also uses
289
354
  its returned command, not manual path renames.
290
355
 
356
+ For Lark capture, use the available `lark-cli` without a session-wide version
357
+ precheck. Only when the Context command reports a missing or incompatible CLI,
358
+ follow its private-install recovery. Keep `CONTEXT_LARK_CLI_BIN` pointing to that
359
+ private executable on subsequent Context commands that access Lark; do not
360
+ upgrade or replace the host's global `lark-cli`.
361
+
291
362
  **Continue.** Read `next_route.file` for the full Route after a compact receipt;
292
363
  `result_file` is for full diagnostics. Otherwise use the returned workspace
293
364
  Route (`next`, `continuation.next` or `workflow.current`). Do not call status
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "c4a",
3
3
  "displayName": "C4A Context",
4
- "version": "0.7.20",
4
+ "version": "0.7.25",
5
5
  "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
6
6
  "author": {
7
7
  "name": "Context4AI",
@@ -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
@@ -97,13 +97,16 @@ settings. Reuse explicit answers and defaults; ask only for unresolved items.
97
97
 
98
98
  Use focused dialogue, not additional source reading, until every required start
99
99
  condition is resolved. Then write and present the complete work-start report
100
- supplied by the source-boundary Route and wait for the user's feedback. Do not
100
+ supplied by the source-boundary Route. Apply the confirmation policy below: a
101
+ specific earlier user request can approve an unchanged, bounded scope; otherwise
102
+ wait for feedback when confirmation is required. Do not
101
103
  present an unresolved draft as the report that authorizes production. The report
102
104
  or checklist is task guidance, not a source unless the user explicitly asks to
103
105
  ingest it. Before the complete report has been presented, do not write a
104
106
  source-registration payload, start capture or extraction, configure Indexers,
105
107
  or begin knowledge writing. A
106
- managed-mode choice does not waive this first reading opportunity. After feedback,
108
+ managed-mode choice does not waive this first reading opportunity. After the
109
+ applicable scope decision,
107
110
  use the exact current Route and include its work-start report reference in the
108
111
  source batch payload. Existing workspace updates follow their current update Route
109
112
  and do not recreate this first-task intake unless they start a new production task.
@@ -143,7 +146,9 @@ Follow the returned `next_action.command`:
143
146
 
144
147
  - `enter-workspace` and `evaluate-workflow` are read-only.
145
148
  - `initialize-workspace` may run immediately if the user requested initialization;
146
- otherwise confirm the target. Preserve any `init-target-nonempty` confirmation.
149
+ otherwise confirm the target. For `context.gate.workspace_initialize_nonempty`,
150
+ reuse the user's explicit target choice; ask if the nonempty target was not
151
+ clearly selected.
147
152
  - After initialization, execute its exact setup command, enter the project root,
148
153
  read the generated `AGENTS.md`, then run the entry again.
149
154
 
@@ -160,6 +165,50 @@ Reuse an explicit review/managed choice across capture and continuation. Neither
160
165
  mode settles unclear purpose, missing permissions or non-delegatable decisions.
161
166
  Status, discussion and save-only requests need no production-mode question.
162
167
 
168
+ ## Confirmation policy
169
+
170
+ The `context.gate.*` IDs below are stable Agent policy switches, not CLI flags or
171
+ workflow authority IDs. Keep the existing Route gate ID, command and payload
172
+ unchanged. An instance-specific Bot may override a switch; precedence is Bot >
173
+ fully managed > ordinary. Reuse a decision already made for the same scope.
174
+
175
+ | Policy ID | Ordinary default | Fully managed default | Existing Route gate, if any |
176
+ | --- | --- | --- | --- |
177
+ | `context.gate.production_entry` | Ask only if intent is unclear. | Same. | Context entry |
178
+ | `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` |
179
+ | `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` |
180
+ | `context.gate.source_boundary` | Use the user's selected source scope; ask only for missing boundaries. | Same. | `source-boundary` |
181
+ | `context.gate.source_read` | A user-supplied source authorizes reading it for the requested task; do not ask again. | Same. | `source-read-permission` |
182
+ | `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 |
183
+ | `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 |
184
+ | `context.gate.image_handling` | Ask once when the task has more than 30 distinct images and no prior handling choice. | Same. | Work-start report |
185
+ | `context.gate.top_level_directory` | Confirm the concrete structure. | Same. | Knowledge map guidance |
186
+ | `context.gate.knowledge_review` | Ask for a decision on the current HTML report. | Delegate when the Route permits. | `knowledge-review` |
187
+ | `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 |
188
+ | `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 |
189
+ | `context.gate.package_output` | Ask. | Choose within the requested delivery scope. | `package-output` |
190
+ | `context.gate.package_template` | Ask. | Choose within the requested delivery scope. | `package-template-review` |
191
+ | `context.gate.git_delivery` | Ask before commit, push or MR. | Same. | Host Git delivery |
192
+ | `context.gate.publication` | Ask before publishing. | Same. | Distribution tool |
193
+ | `context.gate.remote_target_create` | Ask before creating a remote target. | Same. | Distribution tool |
194
+ | `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 |
195
+ | `context.gate.exceptional_recovery` | Ask only for a P0 blocker that prevents action and affects the requested result. | Same. | Current recovery Route |
196
+
197
+ `context.gate.work_start_scope` and `context.gate.knowledge_review` are separate
198
+ decisions; the latter uses the HTML report. Follow the current Route's payload and
199
+ revision. If a Route requires a human decision despite this policy, stop at that
200
+ Gate and report the mismatch instead of fabricating approval. For extra Indexer
201
+ operations that are not blocking, skip the optional operation rather than
202
+ granting its authority implicitly. Fully managed mode does not authorize
203
+ modifying source code or bypassing a non-delegatable Gate.
204
+
205
+ If an instance sets `context.gate.knowledge_review: ask` while using fully
206
+ managed mode, do not start a `--managed --until blocked-or-complete` loop that
207
+ could cross Review. At Review, evaluate without managed review authority and
208
+ follow the ordinary HTML report and user-decision Route. Force approval remains
209
+ available only after the user's exact Route-required reply; the override itself
210
+ never authorizes it.
211
+
163
212
  Enable debug only when requested: use `entry --debug` for initialization or
164
213
  `context debug enable` in an existing workspace. It records diagnostics under
165
214
  `.tmp/context-runtime/debug/`; it grants no authority and is not source evidence.
@@ -172,6 +221,20 @@ npm install -g @c4a/context-cli@latest
172
221
  context plugin install
173
222
  ```
174
223
 
224
+ For authorized local installation, `--local <path>` requires explicit `--agent`:
225
+ - `claude`, `cursor`, `codex`: path is the repository root; install into its
226
+ `.claude`, `.cursor`, `.agents` directory respectively, without host detection.
227
+ - `all`: install all three host layouts.
228
+ - `auto-detect`: select existing host directories in that repository only,
229
+ never PATH or desktop applications; if none exist, use `.agents/skills`.
230
+ - `standalone`: write all skills directly to `<path>/skills`, without commands.
231
+ All combinations support `--dry-run`. Bare `--local` is rejected. Older explicit
232
+ host installs took a host directory; now pass the repository root to avoid
233
+ nesting. Check CLI help for support before using these options on older versions.
234
+ Local entries have no plugin namespace and do not change global configuration.
235
+ Preserve customized files on conflict; refresh the host after installation.
236
+ Existing usable entries need no reinstall. Global installation is unchanged.
237
+
175
238
  Stop with that recovery. Do not run an installation preflight or auto-install;
176
239
  a normal Context `not found` diagnostic does not mean the executable is missing.
177
240
 
@@ -225,8 +288,9 @@ clear runtime state to force a transition. Explicit historical restoration may
225
288
  restore exact Git-saved workspace files after the preparation guide has ended
226
289
  old task state; it is not an alternative content-writing path. Do not infer sources, extraction
227
290
  scope, review decisions or package choices from surrounding files. Operations on
228
- source repositories—clone, checkout, reset, fetch, install, build or test—require
229
- explicit authorization for that scope.
291
+ source repositories stay within the selected source scope. Ask before cloning in
292
+ ordinary mode. Do not modify source code or run destructive recovery outside the
293
+ user's authorization.
230
294
 
231
295
  ## Follow the current Route
232
296
 
@@ -238,7 +302,8 @@ explicit grant.
238
302
 
239
303
  After continuation is authorized or the new target is registered, both modes
240
304
  may use `context run --until blocked-or-complete` for consecutive mechanical
241
- steps. With explicit managed authorization:
305
+ steps. With explicit managed authorization and no instance-specific Review
306
+ override:
242
307
 
243
308
  ```bash
244
309
  context run --managed --until blocked-or-complete --format json
@@ -288,6 +353,12 @@ Mechanical blockers follow the returned repair/recovery action; advisory
288
353
  warnings do not independently require rewriting content. Migration also uses
289
354
  its returned command, not manual path renames.
290
355
 
356
+ For Lark capture, use the available `lark-cli` without a session-wide version
357
+ precheck. Only when the Context command reports a missing or incompatible CLI,
358
+ follow its private-install recovery. Keep `CONTEXT_LARK_CLI_BIN` pointing to that
359
+ private executable on subsequent Context commands that access Lark; do not
360
+ upgrade or replace the host's global `lark-cli`.
361
+
291
362
  **Continue.** Read `next_route.file` for the full Route after a compact receipt;
292
363
  `result_file` is for full diagnostics. Otherwise use the returned workspace
293
364
  Route (`next`, `continuation.next` or `workflow.current`). Do not call status