@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
@@ -6,7 +6,7 @@ codes:
6
6
  - { code: route.production.requirements-migration, kind: route-reason, summary: Preserve long-term requirements while removing legacy Provider configuration. }
7
7
  - { code: route.production.planning-prepare, kind: route-reason, summary: Prepare lightweight navigation for confirmed requirements. }
8
8
  - { code: route.production.planning-required, kind: route-reason, summary: Investigate source skeletons and submit article goals and batches. }
9
- - { code: route.production.report-required, kind: route-reason, summary: Present the planned work-start report and wait for user feedback. }
9
+ - { code: route.production.report-required, kind: route-reason, summary: Present the planned work-start report and apply context.gate.work_start_scope. }
10
10
  - { code: route.production.prepare-required, kind: route-reason, summary: Prepare the next eligible production directories. }
11
11
  - { code: route.production.writing-required, kind: route-reason, summary: Complete the issued production tasks using stage-local files. }
12
12
  - { code: route.production.scope-incomplete, kind: route-reason, summary: Resolve remaining investigation and material gaps without discarding accepted articles. }
@@ -42,15 +42,17 @@ nodes:
42
42
  - id: production-planning-ready
43
43
  kind: terminal
44
44
  terminalOutcome: completed
45
+ # Agent policy: context.gate.work_start_scope
45
46
  - id: confirm-production-report
46
47
  kind: gate
47
48
  reasonCode: route.production.report-required
48
49
  resolutionAction: actions/approve-production-report.yaml
49
50
  gate:
50
51
  id: production-work-start-report
51
- prompt: Present the lightweight plan and work-start report, then wait for
52
- explicit user feedback before writing. Managed authority does not waive
53
- confirmation.
52
+ prompt: Present the lightweight plan and work-start report. Apply
53
+ context.gate.work_start_scope; reuse a matching explicit user scope
54
+ decision, otherwise ask when the scope is complex and changes more than
55
+ five articles. Managed authority does not waive a required decision.
54
56
  delegatable: false
55
57
  satisfiedBy:
56
58
  - path: production.report_approved
@@ -146,6 +148,7 @@ nodes:
146
148
  recommended:
147
149
  - resources/procedures/note.md
148
150
  - resources/procedures/sessions.md
151
+ # Agent policy: context.gate.work_start_scope; context.gate.top_level_directory when applicable
149
152
  - id: review-current-indexer-structure
150
153
  kind: gate
151
154
  reasonCode: route.indexer.semantic-structure-review
@@ -153,10 +156,11 @@ nodes:
153
156
  gate:
154
157
  id: indexer-semantic-structure-review
155
158
  prompt: Present the work-start report from the lightweight plan, explain reader
156
- topics, scope, first delivery and gaps, then wait for explicit user
157
- feedback before bulk writing. Managed execution does not waive this
158
- gate. Reuse approval of unchanged scope across batches; task counts add
159
- no separate confirmation.
159
+ topics, scope, first delivery and gaps. Apply context.gate.work_start_scope;
160
+ reuse matching prior approval, otherwise ask when the scope is complex
161
+ and changes more than five articles. Managed execution does not waive a
162
+ required decision. Top-level changes need their own approval; task counts
163
+ add no separate confirmation.
160
164
  authority: context.knowledge-review
161
165
  delegatable: false
162
166
  satisfiedBy:
@@ -71,6 +71,7 @@ nodes:
71
71
  - resources/views/verification-current.yaml
72
72
  - resources/diagnostics/projection-stale.md
73
73
 
74
+ # Agent policy: context.gate.source_boundary
74
75
  - id: choose-source-boundary
75
76
  kind: gate
76
77
  reasonCode: route.source.boundary-required
@@ -109,6 +110,7 @@ nodes:
109
110
  - resources/views/source-current.yaml
110
111
  - resources/manuals/guides/lark-resources.md
111
112
 
113
+ # Agent policy: context.gate.source_read
112
114
  - id: authorize-document-capture
113
115
  kind: gate
114
116
  reasonCode: route.capture.permission-required
@@ -177,6 +179,7 @@ nodes:
177
179
  - path: indexer.lifecycle_current
178
180
  equals: true
179
181
 
182
+ # Agent policy: context.gate.knowledge_review
180
183
  - id: review-current-batch
181
184
  kind: gate
182
185
  reasonCode: route.review.decision-required
@@ -205,6 +208,7 @@ nodes:
205
208
  recommended:
206
209
  - resources/views/review-current.yaml
207
210
 
211
+ # Agent policy: context.gate.package_output
208
212
  - id: choose-package-output
209
213
  kind: gate
210
214
  reasonCode: route.package.output-required
@@ -247,6 +251,7 @@ nodes:
247
251
  - resources/manuals/reference/package-templates.md
248
252
  - resources/manuals/reference/template-variables.md
249
253
 
254
+ # Agent policy: context.gate.package_template
250
255
  - id: review-package-template
251
256
  kind: gate
252
257
  reasonCode: route.package.template-review-required
@@ -2,19 +2,19 @@
2
2
  "schema": "agent-graph.bundle.v1",
3
3
  "provider": {
4
4
  "id": "c4a/context",
5
- "version": "0.7.20"
5
+ "version": "0.7.25"
6
6
  },
7
7
  "providerManifest": "provider.yaml",
8
8
  "graphs": [
9
9
  {
10
10
  "id": "indexer",
11
11
  "path": "graphs/indexer.yaml",
12
- "digest": "sha256:bfa5061e08fb7c8ee94f5d4d1afc91dd68efff1d39788db324708e954266a7b7"
12
+ "digest": "sha256:4992b548a9d19c6d7fd25a5dc0ae6b78a4a494ce39d37633144d389362f21122"
13
13
  },
14
14
  {
15
15
  "id": "workspace",
16
16
  "path": "graphs/workspace.yaml",
17
- "digest": "sha256:2904eb61889037ffdcdf878c807187f9acf807a9409111ee4de4c5b703b15d5d"
17
+ "digest": "sha256:a0db554b3506e9a68464afe11a5d486a0ce0a0340747f810d8ebdf2fec285c43"
18
18
  }
19
19
  ],
20
20
  "actions": [
@@ -303,12 +303,12 @@
303
303
  {
304
304
  "id": "procedure.knowledge-review",
305
305
  "path": "resources/procedures/knowledge-review.md",
306
- "digest": "sha256:69dc39212547ea8a304c20d6fadc2bd3eb1de83eaf0c62dade8fcf5e8695c5d6"
306
+ "digest": "sha256:f0532acbc93458c90209dfed3395b69873eeea6b7d431ae52a84d44c4553751e"
307
307
  },
308
308
  {
309
309
  "id": "procedure.knowledge-updates",
310
310
  "path": "resources/procedures/knowledge-updates.md",
311
- "digest": "sha256:e3bf78d43ebc4263bc5d4c08984e51af6d4df16bd2d5d708622816442b777949"
311
+ "digest": "sha256:bd457b533803f214899f58e03846354f50fafa479a97e01665beb5065a5e90fb"
312
312
  },
313
313
  {
314
314
  "id": "procedure.note",
@@ -318,7 +318,7 @@
318
318
  {
319
319
  "id": "procedure.package-output",
320
320
  "path": "resources/procedures/package-output.md",
321
- "digest": "sha256:fc214d1c6f7d8ce4a67fa56a90727f6676a7801f572e73e907005a37a8a543f7"
321
+ "digest": "sha256:74441590a5b78768bad327f8947c2c9d78fbfa3b470e08b6c6e0e61c2aba1081"
322
322
  },
323
323
  {
324
324
  "id": "procedure.parallel-agent-batch",
@@ -328,7 +328,7 @@
328
328
  {
329
329
  "id": "procedure.production-requirements",
330
330
  "path": "resources/procedures/production-requirements.md",
331
- "digest": "sha256:a01bcdf788d9c8fd1cc6ba4ba47f19da6df99cd2397ed35eaaa3d3fdc8b6ec25"
331
+ "digest": "sha256:d881da8d538efdcef18b7a876f595f0b0098bbac5ea1fd3148e476f63a435dfb"
332
332
  },
333
333
  {
334
334
  "id": "procedure.production-stage-files",
@@ -358,7 +358,7 @@
358
358
  {
359
359
  "id": "procedure.source-boundary",
360
360
  "path": "resources/procedures/source-boundary.md",
361
- "digest": "sha256:4c8e7b237503d95bdd1d8b5b53e0e5816f56a4627f24d9b17711233a26c5dc4a"
361
+ "digest": "sha256:61d0183954abce3356fca94d0bef966b3351af272b10473cae1119737a5c9e66"
362
362
  },
363
363
  {
364
364
  "id": "procedure.source-capture-detailed",
@@ -383,7 +383,7 @@
383
383
  {
384
384
  "id": "procedure.work-start-report",
385
385
  "path": "resources/procedures/work-start-report.md",
386
- "digest": "sha256:39bb407bbc799c380dc03100473a757e3fa3bcf823be6e6993534444040f4fc9"
386
+ "digest": "sha256:1d1bbd3ecc0cb6baf5bd07e51ce3837094741b815ae935129f70363c37257ad8"
387
387
  },
388
388
  {
389
389
  "id": "procedure.workspace-commit",
@@ -393,12 +393,12 @@
393
393
  {
394
394
  "id": "procedure.workspace-prepare",
395
395
  "path": "resources/procedures/workspace-prepare.md",
396
- "digest": "sha256:b6192c1058b26630f122de5728ee1d508754a8a46584672fe9f76e3d77d273cb"
396
+ "digest": "sha256:5fc94a9197a52ec894d5a58872faf1812c18c1e4ff06fd92244dc551147c1bb4"
397
397
  },
398
398
  {
399
399
  "id": "procedure.workspace-restore",
400
400
  "path": "resources/procedures/workspace-restore.md",
401
- "digest": "sha256:81f510f339d2970c00444bf0452ef97430840ffb90afdfefbe17611012c86c95"
401
+ "digest": "sha256:c9ba5b5ee703ca79b5db6499c1361a1b7e7ee7efe43fb5c204ad08876f6e89c7"
402
402
  },
403
403
  {
404
404
  "id": "template.indexer-agent-worker",
@@ -558,19 +558,19 @@
558
558
  },
559
559
  {
560
560
  "path": "codes.yaml",
561
- "digest": "sha256:195754031443edc76a314c5165d2089d98bcfba5e00e45facf720b2d6f825804"
561
+ "digest": "sha256:3e400dafffcd4f9e9d46f1503b005180b594f64a3cc5b2503564fb21327e9e08"
562
562
  },
563
563
  {
564
564
  "path": "graphs/indexer.yaml",
565
- "digest": "sha256:bfa5061e08fb7c8ee94f5d4d1afc91dd68efff1d39788db324708e954266a7b7"
565
+ "digest": "sha256:4992b548a9d19c6d7fd25a5dc0ae6b78a4a494ce39d37633144d389362f21122"
566
566
  },
567
567
  {
568
568
  "path": "graphs/workspace.yaml",
569
- "digest": "sha256:2904eb61889037ffdcdf878c807187f9acf807a9409111ee4de4c5b703b15d5d"
569
+ "digest": "sha256:a0db554b3506e9a68464afe11a5d486a0ce0a0340747f810d8ebdf2fec285c43"
570
570
  },
571
571
  {
572
572
  "path": "provider.yaml",
573
- "digest": "sha256:07557b0b88123c833f25f144cb9c2feab3a1233b7d7a2ecde9e3a9995ae51675"
573
+ "digest": "sha256:205a4786448c8825b10469fc7eda3b5e9e67caa7a0df528d14709c9c88f985bd"
574
574
  },
575
575
  {
576
576
  "path": "resources/contracts/indexer-provider-guide.yaml",
@@ -626,7 +626,7 @@
626
626
  },
627
627
  {
628
628
  "path": "resources/manuals/guides/knowledge-updates.md",
629
- "digest": "sha256:3fa4b18e1919578e8939fffba40d250e8898ed6e85376fd2758abe3d12b908d8"
629
+ "digest": "sha256:8d408d8d15c4f322a2ffcaac7798ece234f3a0bf58d2a122ee3ab97472ef75c3"
630
630
  },
631
631
  {
632
632
  "path": "resources/manuals/guides/lark-resources.md",
@@ -658,11 +658,11 @@
658
658
  },
659
659
  {
660
660
  "path": "resources/manuals/guides/workspace-prepare.md",
661
- "digest": "sha256:fa8451aa20ee48437c8b6ce1163752d0baec8486c1919982996c3d202e82a714"
661
+ "digest": "sha256:057ab5a00ed51629bf856551a20b18fb9e81a9a597dcd87dd44e9b1c9dffd3f2"
662
662
  },
663
663
  {
664
664
  "path": "resources/manuals/guides/workspace-restore.md",
665
- "digest": "sha256:290c321c120bf7c4ef86cc578b77a4b51086e47d6a225786768f65cc122c6626"
665
+ "digest": "sha256:01530e0ddf701ceba53988bab4531e0e854cccd8ab827dcc1c5fc3cb4dc6c3cb"
666
666
  },
667
667
  {
668
668
  "path": "resources/manuals/reference/code-extractors.md",
@@ -702,11 +702,11 @@
702
702
  },
703
703
  {
704
704
  "path": "resources/procedures/knowledge-review.md",
705
- "digest": "sha256:69dc39212547ea8a304c20d6fadc2bd3eb1de83eaf0c62dade8fcf5e8695c5d6"
705
+ "digest": "sha256:f0532acbc93458c90209dfed3395b69873eeea6b7d431ae52a84d44c4553751e"
706
706
  },
707
707
  {
708
708
  "path": "resources/procedures/knowledge-updates.md",
709
- "digest": "sha256:e3bf78d43ebc4263bc5d4c08984e51af6d4df16bd2d5d708622816442b777949"
709
+ "digest": "sha256:bd457b533803f214899f58e03846354f50fafa479a97e01665beb5065a5e90fb"
710
710
  },
711
711
  {
712
712
  "path": "resources/procedures/note.md",
@@ -714,7 +714,7 @@
714
714
  },
715
715
  {
716
716
  "path": "resources/procedures/package-output.md",
717
- "digest": "sha256:fc214d1c6f7d8ce4a67fa56a90727f6676a7801f572e73e907005a37a8a543f7"
717
+ "digest": "sha256:74441590a5b78768bad327f8947c2c9d78fbfa3b470e08b6c6e0e61c2aba1081"
718
718
  },
719
719
  {
720
720
  "path": "resources/procedures/parallel-agent-batch.md",
@@ -722,7 +722,7 @@
722
722
  },
723
723
  {
724
724
  "path": "resources/procedures/production-requirements.md",
725
- "digest": "sha256:a01bcdf788d9c8fd1cc6ba4ba47f19da6df99cd2397ed35eaaa3d3fdc8b6ec25"
725
+ "digest": "sha256:d881da8d538efdcef18b7a876f595f0b0098bbac5ea1fd3148e476f63a435dfb"
726
726
  },
727
727
  {
728
728
  "path": "resources/procedures/production-stage-files.md",
@@ -746,7 +746,7 @@
746
746
  },
747
747
  {
748
748
  "path": "resources/procedures/source-boundary.md",
749
- "digest": "sha256:4c8e7b237503d95bdd1d8b5b53e0e5816f56a4627f24d9b17711233a26c5dc4a"
749
+ "digest": "sha256:61d0183954abce3356fca94d0bef966b3351af272b10473cae1119737a5c9e66"
750
750
  },
751
751
  {
752
752
  "path": "resources/procedures/source-capture-detailed.md",
@@ -766,7 +766,7 @@
766
766
  },
767
767
  {
768
768
  "path": "resources/procedures/work-start-report.md",
769
- "digest": "sha256:39bb407bbc799c380dc03100473a757e3fa3bcf823be6e6993534444040f4fc9"
769
+ "digest": "sha256:1d1bbd3ecc0cb6baf5bd07e51ce3837094741b815ae935129f70363c37257ad8"
770
770
  },
771
771
  {
772
772
  "path": "resources/procedures/workspace-commit.md",
@@ -774,11 +774,11 @@
774
774
  },
775
775
  {
776
776
  "path": "resources/procedures/workspace-prepare.md",
777
- "digest": "sha256:b6192c1058b26630f122de5728ee1d508754a8a46584672fe9f76e3d77d273cb"
777
+ "digest": "sha256:5fc94a9197a52ec894d5a58872faf1812c18c1e4ff06fd92244dc551147c1bb4"
778
778
  },
779
779
  {
780
780
  "path": "resources/procedures/workspace-restore.md",
781
- "digest": "sha256:81f510f339d2970c00444bf0452ef97430840ffb90afdfefbe17611012c86c95"
781
+ "digest": "sha256:c9ba5b5ee703ca79b5db6499c1361a1b7e7ee7efe43fb5c204ad08876f6e89c7"
782
782
  },
783
783
  {
784
784
  "path": "resources/templates/indexer-agent-worker.md",
@@ -850,7 +850,7 @@
850
850
  },
851
851
  {
852
852
  "path": "skills/resolve-current-indexer-gate/SKILL.md",
853
- "digest": "sha256:a4be3b069717f2e16af59ec64415bc1f8a269e9798c591087239629d41c7e94d"
853
+ "digest": "sha256:e5cd37225e555879b90df46206eb61c398250de1dad0378e0fb85cd61e93fca3"
854
854
  },
855
855
  {
856
856
  "path": "skills/run-indexer-agent-step/SKILL.md",
@@ -858,16 +858,16 @@
858
858
  },
859
859
  {
860
860
  "path": "skills/run-indexer-lifecycle/SKILL.md",
861
- "digest": "sha256:2e80cd1d81a215859bcea6f483de17705a54d214f91fd33013777e1f84b6b075"
861
+ "digest": "sha256:e56bf044855a3a66aa75a12d16ecba730b11a1e695f1ce75f2ea0af81384a011"
862
862
  },
863
863
  {
864
864
  "path": "skills/work-production-stage/SKILL.md",
865
- "digest": "sha256:cacf6ce1b106cfe7af7b07009e6a3658c04007c6eb49127069fa16e3b2892f31"
865
+ "digest": "sha256:b7aa28c032e00f93f67d3c9dc3589cf1513451456f589262e22ad7f73d265de7"
866
866
  }
867
867
  ],
868
868
  "graphDependencies": {
869
869
  "indexer": [],
870
870
  "workspace": []
871
871
  },
872
- "digest": "sha256:194f155ebef71ee850a23521a36a9df1906be6d9285549cfe5f1e7d881417f78"
872
+ "digest": "sha256:1632415b812eb5fe95240d1e959d1f598ed060a9b923ba9dfa5dc5d88d02cfce"
873
873
  }
@@ -1,6 +1,6 @@
1
1
  schema: agent-graph.provider.v1
2
2
  id: c4a/context
3
- version: 0.7.20
3
+ version: 0.7.25
4
4
  name: Context workflow
5
5
  description: Internal work contract for Context knowledge workspaces.
6
6
  graphs:
@@ -223,7 +223,7 @@ In the work-start report or current plan, briefly state the affected articles'
223
223
  intended placements and reused category intent. For proposed top-level additions,
224
224
  renames, removals or changes of purpose, show the before/after tree, why reuse is
225
225
  insufficient, affected existing pages and reading order. Present that change for
226
- human review before applying it. This uses the existing report feedback where
226
+ human review under `context.gate.top_level_directory` before applying it. This uses the existing report feedback where
227
227
  available; do not add a new CLI state, schema field or routine per-article gate.
228
228
  Explicit user approval of that concrete structure is sufficient; do not ask again.
229
229
  General permission to write knowledge or organize batches is not approval to
@@ -593,6 +593,10 @@ before delivery; inspect both new content and the old articles' disposition.
593
593
 
594
594
  Preview approved-page retirement with `context task retire --input <file> --format json`:
595
595
 
596
+ This standalone retirement does not enter the article HTML Review. Apply
597
+ `context.gate.deletion_scope` to its target list; an already approved deletion
598
+ needs no second confirmation after the preview.
599
+
596
600
  ```yaml
597
601
  reason: These reader tasks are now covered by the approved guide.
598
602
  targets:
@@ -6,6 +6,10 @@ mediaType: text/markdown
6
6
 
7
7
  # Prepare a workspace for the next task
8
8
 
9
+ Agent policy: `context.gate.workspace_reset_restore`. A clear request to
10
+ prepare this workspace authorizes the described task-state cleanup; clarify
11
+ only an unresolved target or loss.
12
+
9
13
  Use only for an explicit workspace preparation request. The goal is usable
10
14
  registered sources and no unfinished task, while retaining approved knowledge
11
15
  and configuration. Lead with Host tools and actual observations; do not start
@@ -6,6 +6,9 @@ mediaType: text/markdown
6
6
 
7
7
  # Restore a historical workspace version
8
8
 
9
+ Agent policy: `context.gate.workspace_reset_restore`. An explicit restore
10
+ request needs no second approval when the target and affected files are clear.
11
+
9
12
  Use the Agent's Git and environment tools. This restores selected workspace
10
13
  files and usable sources; it does not reset the entire repository, rewind source
11
14
  repositories, or restore ignored runtime progress.
@@ -25,7 +28,8 @@ Compare target files with current tracked, untracked and staged files. Include
25
28
  current additions absent at the target in the proposed removal scope. Keep
26
29
  unrelated files, existing staged work and ignored source checkouts. Account for
27
30
  workspace moves or renames instead of treating a missing old path as an empty
28
- version. Reuse explicit authorization; ask when the target or loss is unresolved.
31
+ version. Reuse explicit authorization; clarify an unresolved target or loss
32
+ before acting rather than asking for a second approval of the same request.
29
33
 
30
34
  ## Restore files and environment
31
35
 
@@ -6,6 +6,10 @@ mediaType: text/markdown
6
6
 
7
7
  # Knowledge Review
8
8
 
9
+ Agent policy: `context.gate.knowledge_review`. An instance-specific Bot may
10
+ override the managed default and require the ordinary HTML review decision.
11
+ The report-inaccessible exception is `context.gate.force_review_approval`.
12
+
9
13
  Review is the authority boundary between candidates and approved knowledge.
10
14
  Open one report for the complete current candidate set and apply only a payload
11
15
  that matches its collection scope and candidate-set digest.
@@ -17,8 +21,9 @@ blocks Review. Follow the returned identity-coordination route: the default
17
21
  mechanical repair preserves the approved identity and approved path, then
18
22
  recompiles only the affected source. It keeps the candidate batch intact while
19
23
  replacing affected candidates in place. Changing an approved identity or moving
20
- an approved path is a migration and must never run without a separate, explicit
21
- authorization.
24
+ an approved path is a migration within the user's requested scope; do not ask
25
+ again when that scope is already clear. The resulting Candidate still enters
26
+ Review.
22
27
 
23
28
  Without explicit session-managed authority:
24
29
 
@@ -31,7 +36,8 @@ Without explicit session-managed authority:
31
36
  The ordinary Route also carries a revision-bound force-approval resolution
32
37
  Action as an escape path. Do not advertise it when first presenting Review.
33
38
  Use it only after the user cannot use the report and explicitly replies with
34
- the exact phrase `强制批准` in the current conversation. It approves the complete
39
+ the exact phrase `强制批准` in the current conversation. That reply is the
40
+ decision; do not ask a second confirmation. It approves the complete
35
41
  current scope atomically; no candidate-specific decisions are inferred.
36
42
 
37
43
  With explicit session-managed authority, materialize the required
@@ -54,7 +60,8 @@ Do not persist a duplicate review-report ledger in the workspace.
54
60
  For restructuring, compare replacement content with the affected approved pages:
55
61
  useful conditions, steps and explanations must have a destination before removal.
56
62
  Review omission rejects a candidate; it does not retire an approved article.
57
- Use the explicit retirement preview after replacement delivery, and repair its
63
+ Pure retirement does not enter this HTML report. Use the explicit retirement
64
+ preview after replacement delivery, and repair its
58
65
  reported incoming references. Navigation removal alone does not remove content
59
66
  from search or packages. A renamed menu does not require a new article identity.
60
67
 
@@ -223,7 +223,7 @@ In the work-start report or current plan, briefly state the affected articles'
223
223
  intended placements and reused category intent. For proposed top-level additions,
224
224
  renames, removals or changes of purpose, show the before/after tree, why reuse is
225
225
  insufficient, affected existing pages and reading order. Present that change for
226
- human review before applying it. This uses the existing report feedback where
226
+ human review under `context.gate.top_level_directory` before applying it. This uses the existing report feedback where
227
227
  available; do not add a new CLI state, schema field or routine per-article gate.
228
228
  Explicit user approval of that concrete structure is sufficient; do not ask again.
229
229
  General permission to write knowledge or organize batches is not approval to
@@ -593,6 +593,10 @@ before delivery; inspect both new content and the old articles' disposition.
593
593
 
594
594
  Preview approved-page retirement with `context task retire --input <file> --format json`:
595
595
 
596
+ This standalone retirement does not enter the article HTML Review. Apply
597
+ `context.gate.deletion_scope` to its target list; an already approved deletion
598
+ needs no second confirmation after the preview.
599
+
596
600
  ```yaml
597
601
  reason: These reader tasks are now covered by the approved guide.
598
602
  targets:
@@ -6,6 +6,10 @@ mediaType: text/markdown
6
6
 
7
7
  # Package output
8
8
 
9
+ Agent policies: `context.gate.package_output` and
10
+ `context.gate.package_template`. Publication uses the separate
11
+ `context.gate.publication` decision.
12
+
9
13
  Before editing, read `context.sdk.package-outputs`, especially its Agent configuration
10
14
  and delivery recipe. It contains the concrete SDK declarations and preview steps.
11
15
 
@@ -8,8 +8,9 @@ mediaType: text/markdown
8
8
 
9
9
  Use the reader purpose and source boundaries already confirmed by the user.
10
10
  Ask for missing decisions before writing; registering a source does not authorize
11
- unrelated modules. This is not the work-start report: the report follows the
12
- lightweight investigation and must still wait for user feedback.
11
+ unrelated modules. This is not the work-start report: that report follows the
12
+ lightweight investigation and uses `context.gate.work_start_scope` for its
13
+ confirmation decision.
13
14
 
14
15
  Write `src/indexers.yaml` with this minimal shape, replacing the example values
15
16
  with the user's actual purpose and registered source reference:
@@ -57,7 +58,8 @@ plan fields (`capabilities`, `articles`, optional `indexer_usage`) in a file und
57
58
  contains `path`, `question`, `sources` and `batch`, with optional `brief` and
58
59
  `after`. Add `--input <that-file>` to the returned `action prepare-current`
59
60
  command to prepare those tasks without a separate investigation-plan submission.
60
- This does not approve the report or permit writing before user feedback.
61
+ This does not approve the report or permit writing before its applicable scope
62
+ decision.
61
63
  When targets are unclear, use normal preparation and investigate the skeletons.
62
64
 
63
65
  ## Configured coverage and the current request
@@ -6,6 +6,12 @@ mediaType: text/markdown
6
6
 
7
7
  # Source boundary
8
8
 
9
+ Agent policy: `context.gate.source_boundary` for source selection,
10
+ `context.gate.source_read` for reading registered external documents, and
11
+ `context.gate.repository_clone` for a missing repository. These labels do not
12
+ replace the current Route's gate ID or authorization command.
13
+ Source removal uses `context.gate.deletion_scope`.
14
+
9
15
  A source boundary is a user decision about which repositories, modules, or
10
16
  documents may become approved knowledge. It affects extraction scope,
11
17
  provenance, output paths, and freshness checks.
@@ -66,7 +72,9 @@ mutation instead of running registry writes in parallel.
66
72
  To retire a registered source, first run `context source remove <source-id>
67
73
  --format json`. This is a read-only preview that lists every project, candidate,
68
74
  or approved-knowledge reference. Only after those references are intentionally
69
- resolved may the route use `--yes`; the CLI never silently deletes referenced
75
+ resolved may the route use `--yes`. A user-approved deletion of this exact source
76
+ needs no second confirmation; clarify only a newly affected source outside that
77
+ scope. Source removal does not enter the article HTML Review. The CLI never silently deletes referenced
70
78
  knowledge or another source's materialized files. Execute the exact
71
79
  digest-bound command returned by the preview. For a shared document batch, the
72
80
  manifest entry is the ownership boundary: removal deletes only that entry and
@@ -75,7 +83,9 @@ so removal is registry-only; the shared date directory is never inferred as
75
83
  module-owned.
76
84
 
77
85
  Repository readiness checks are mechanical and may run after the boundary is
78
- registered. Clone, fetch, checkout, install, build, test, and other external
79
- repository operations need separate authority. File and remote-document
80
- registration records metadata only; reading their bodies requires source-read
81
- permission for the exact pending modules.
86
+ registered. In ordinary mode ask before cloning a missing repository; in fully
87
+ managed mode use the selected source scope without a repeat question. Other
88
+ repository operations stay within existing authorization and must not modify
89
+ source code or perform destructive recovery without a separate grant. File and
90
+ remote-document registration records metadata only; reading their bodies uses
91
+ source-read permission for the exact pending modules.
@@ -6,6 +6,10 @@ mediaType: text/markdown
6
6
 
7
7
  # Present the production plan before bulk writing
8
8
 
9
+ Agent policy: `context.gate.work_start_scope`; top-level navigation changes
10
+ add the independent `context.gate.top_level_directory` decision. More than 30
11
+ distinct images without a prior choice uses `context.gate.image_handling`.
12
+
9
13
  Prepare `.tmp/work-start-report.md` after lightweight investigation has formed an
10
14
  actionable article plan and before bulk writing. Use the companion template as
11
15
  guidance, not a mandatory form. This scratch report is for the user; its existence
@@ -80,6 +84,9 @@ position; reuse its layout and delivery choices instead of proposing them again.
80
84
 
81
85
  ## Confirm image handling for large tasks
82
86
 
87
+ `context.gate.image_handling` asks once in both ordinary and managed mode; a
88
+ previous explicit choice for this task avoids another question.
89
+
83
90
  Before bulk image interpretation or article writing, count distinct image resources
84
91
  across the current authorized task (all its sources, not each document or batch).
85
92
  Use source descriptors and capture reports; do not download images just to count
@@ -125,13 +132,18 @@ Obtain explicit feedback before applying that structural change, reusing a
125
132
  concrete structure already approved by the user. If it emerges later, update this
126
133
  same plan and review only the changed decision; do not restart approved batches.
127
134
 
128
- ## Mandatory feedback
135
+ ## Scope decision
129
136
 
130
137
  Write the scratch report using the host file tool, show its clickable path,
131
- summarize scope, first delivery and decisions, then wait. Managed mode, permission
132
- to plan autonomously and multi-Agent capability do not waive this gate. Silence,
133
- elapsed time, questions and objections are not approval. Make requested
134
- adjustments before continuing with the Graph-selected confirmation action.
138
+ summarize scope, first delivery and decisions. Ask for feedback only when the
139
+ scope is complex and changes more than five articles, or when a separate decision
140
+ such as a top-level directory change remains unresolved. A specific earlier user
141
+ request can already approve a matching bounded report, including 1–3 documents
142
+ or a single MR-triggered note; do not ask again solely because the report was
143
+ presented. Apply the same rule in ordinary and managed mode. Silence, elapsed
144
+ time, questions and objections are never approval. Make requested adjustments
145
+ before the Graph-selected confirmation action. If the current Route still
146
+ requires a fresh human decision, stop rather than fabricating it.
135
147
 
136
148
  The current action records confirmation of planned scope, not report file
137
149
  integrity. If saving the report fails, explain the issue and present the proposal
@@ -141,7 +153,8 @@ Reuse approval for an unchanged applicable plan across batches, retries and
141
153
  compatible skill changes. Update and explain material changes; wait again for
142
154
  scope expansion or unresolved material decisions, not merely another ready batch.
143
155
  There is no extra task-count confirmation: crossing 50 planning tasks adds no
144
- pause. Actual scale belongs in the report whose pre-writing feedback is mandatory.
156
+ separate pause. Actual scale belongs in the report and its applicable scope
157
+ decision.
145
158
 
146
159
  ## Progress and storage
147
160
 
@@ -6,6 +6,10 @@ mediaType: text/markdown
6
6
 
7
7
  # Prepare a workspace for the next task
8
8
 
9
+ Agent policy: `context.gate.workspace_reset_restore`. A clear request to
10
+ prepare this workspace authorizes the described task-state cleanup; clarify
11
+ only an unresolved target or loss.
12
+
9
13
  Use only for an explicit workspace preparation request. The goal is usable
10
14
  registered sources and no unfinished task, while retaining approved knowledge
11
15
  and configuration. Lead with Host tools and actual observations; do not start
@@ -6,6 +6,9 @@ mediaType: text/markdown
6
6
 
7
7
  # Restore a historical workspace version
8
8
 
9
+ Agent policy: `context.gate.workspace_reset_restore`. An explicit restore
10
+ request needs no second approval when the target and affected files are clear.
11
+
9
12
  Use the Agent's Git and environment tools. This restores selected workspace
10
13
  files and usable sources; it does not reset the entire repository, rewind source
11
14
  repositories, or restore ignored runtime progress.
@@ -25,7 +28,8 @@ Compare target files with current tracked, untracked and staged files. Include
25
28
  current additions absent at the target in the proposed removal scope. Keep
26
29
  unrelated files, existing staged work and ignored source checkouts. Account for
27
30
  workspace moves or renames instead of treating a missing old path as an empty
28
- version. Reuse explicit authorization; ask when the target or loss is unresolved.
31
+ version. Reuse explicit authorization; clarify an unresolved target or loss
32
+ before acting rather than asking for a second approval of the same request.
29
33
 
30
34
  ## Restore files and environment
31
35
 
@@ -9,10 +9,15 @@ metadata:
9
9
 
10
10
  # Resolve the current structure proposal
11
11
 
12
+ This structure proposal uses `context.gate.work_start_scope`; a top-level
13
+ directory change additionally uses `context.gate.top_level_directory`.
14
+
12
15
  Read the exact Gate input and its output schema. Explain the proposed new topics,
13
16
  affected existing articles, source scope and unresolved gaps in the user's
14
- language. Reuse prior scope decisions, but wait for the confirmation required by
15
- this Gate; managed execution does not waive a non-delegatable decision.
17
+ language. Reuse a matching prior scope decision. Ask when the proposal is complex
18
+ and changes more than five articles, or when a separate structural decision is
19
+ unresolved. Managed execution does not waive a required non-delegatable decision;
20
+ if the current Route still requires fresh feedback, wait for it.
16
21
 
17
22
  Submit approval or specific adjustment feedback through the returned command.
18
23
  Use a temporary JSON/YAML file for long feedback. Do not invent another approval
@@ -19,8 +19,9 @@ selectively to decide article topics and writing batches, then more deeply for
19
19
  the actual claims being written. Skill guidance is optional assistance with
20
20
  discovery and writing, not a version-bound production credential.
21
21
 
22
- Submit the lightweight plan, present the work-start report and wait for explicit
23
- user feedback before writing. Use the report resources selected by the Route;
22
+ Submit the lightweight plan, present the work-start report and apply
23
+ `context.gate.work_start_scope` before writing. Reuse a matching explicit user
24
+ decision or ask when required. Use the report resources selected by the Route;
24
25
  unchanged scope does not need another report merely because a batch ends.
25
26
 
26
27
  Write in the issued Agent directories and submit completed subsets using the