@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
@@ -2,19 +2,19 @@
2
2
  "schema": "agent-graph.bundle.v1",
3
3
  "provider": {
4
4
  "id": "c4a/context",
5
- "version": "0.7.17"
5
+ "version": "0.7.23"
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": [
@@ -278,7 +278,7 @@
278
278
  {
279
279
  "id": "procedure.approved-revision",
280
280
  "path": "resources/procedures/approved-revision.md",
281
- "digest": "sha256:278ac0a0c7e3577dcabdf71c813b63ff943add712782969fb9496ff15a1f19b2"
281
+ "digest": "sha256:4ee897e6c13e0e908e4d28b239d93f74e66756ef7707277997225743ca250552"
282
282
  },
283
283
  {
284
284
  "id": "procedure.close-and-build",
@@ -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,12 +358,12 @@
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",
365
365
  "path": "resources/procedures/source-capture-detailed.md",
366
- "digest": "sha256:04588ea5955c3796e867d091a0fba6fcc5d854c94805bfca4ae1fd398f5542c4"
366
+ "digest": "sha256:75694361543f5c44a1077b5e6c4ed9bca844ec9b46c1773198f66e0f20ba3748"
367
367
  },
368
368
  {
369
369
  "id": "procedure.source-update",
@@ -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:9bffefd9d4ac0ab46b9274a07c1a0a0b809659fe22a0bb28e2c78a6dc403a999"
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:30f94e1127da95b0128d4e50ba4bf096954fef4ca09a9b93b7e6c4fa4579ac47"
573
+ "digest": "sha256:4fa32f047a37039e93af588f116d01423ee50fca99ad54d4e16f881b3f25e9b9"
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:a0f801e442331135274de04cfc4006c4641da50421d5e80a47f23b329dd13766"
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",
@@ -682,7 +682,7 @@
682
682
  },
683
683
  {
684
684
  "path": "resources/procedures/approved-revision.md",
685
- "digest": "sha256:278ac0a0c7e3577dcabdf71c813b63ff943add712782969fb9496ff15a1f19b2"
685
+ "digest": "sha256:4ee897e6c13e0e908e4d28b239d93f74e66756ef7707277997225743ca250552"
686
686
  },
687
687
  {
688
688
  "path": "resources/procedures/close-and-build.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,11 +746,11 @@
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",
753
- "digest": "sha256:04588ea5955c3796e867d091a0fba6fcc5d854c94805bfca4ae1fd398f5542c4"
753
+ "digest": "sha256:75694361543f5c44a1077b5e6c4ed9bca844ec9b46c1773198f66e0f20ba3748"
754
754
  },
755
755
  {
756
756
  "path": "resources/procedures/source-update.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:9bffefd9d4ac0ab46b9274a07c1a0a0b809659fe22a0bb28e2c78a6dc403a999"
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:b1e15a2c60465b30bd30b709b98dc7d5c8df1b21fa1f91852dffbcc2fc0c5a3a"
872
+ "digest": "sha256:e38e780dea12218d57a1d69c66c3f0d78f06f86cf46df6874838648b12fb1714"
873
873
  }
@@ -1,6 +1,6 @@
1
1
  schema: agent-graph.provider.v1
2
2
  id: c4a/context
3
- version: 0.7.17
3
+ version: 0.7.23
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
@@ -21,6 +25,11 @@ Wait for an active writer to finish and obtain its receipt before changing state
21
25
  If status is broken, inspect its diagnostic and files with Host tools rather
22
26
  than treating failure as proof that the workspace is empty.
23
27
 
28
+ Registered source inventory is not an active task. Preparation does not repair
29
+ invalid snapshots or change source scope; do not repeat preparation to bypass a
30
+ capture diagnostic. Excluding a source from one task is not authorization to
31
+ delete its registration or retained evidence.
32
+
24
33
  ## End the old task
25
34
 
26
35
  Run `context task prepare --format json`. It previews the exact Context-owned
@@ -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
 
@@ -17,6 +17,26 @@ to ask about the affected claim, not to reconstruct the whole knowledge base.
17
17
  Record new factual contributions as managed sources before expanding source
18
18
  ownership; an editing instruction alone is not a permanent factual source.
19
19
 
20
+ If a source diagnostic blocks the action, inspect that exact source before
21
+ calling it uncaptured. An invalid retained capture report is not evidence that
22
+ the source was never collected. Do not use rollback, task preparation, or source
23
+ removal to repair a revision-token or submission-schema error. Refresh the
24
+ current action and use its revision and required `stage: approved-revision`.
25
+ If the fresh action still conflicts, preserve the request and report the tool
26
+ blocker instead of repeatedly clearing or re-registering maintenance.
27
+
28
+ For new independent evidence added during a revision, keep its own managed source.
29
+ A `requirement_ref` alone does not authorize it: the selected requirement in
30
+ `src/indexers.yaml` must connect the new source to an existing task source through
31
+ its target or evidence scopes. When `revision-source-scope-unconfirmed` is returned,
32
+ use its `missing` and `configuration` fields to correct only the user-authorized
33
+ association. Then retry the same `task adjust` without refresh and, once material
34
+ is available, with `refresh: true`; reread the resulting revision. Do not invent
35
+ module references, replace an older note, delete sources or clear the task to
36
+ satisfy this boundary. Already imported material does not need to be imported again.
37
+ A managed-source `base_digest` protects file replacement from conflicts; it is not
38
+ source-scope authorization and is not interchangeable with a snapshot hash.
39
+
20
40
  Return the full revised Markdown in the supplied output schema, preserving the
21
41
  page's stable fragment markers and metadata. Do not silently
22
42
  turn paraphrased text into a verbatim quotation. Do not directly write knowledge
@@ -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.
@@ -190,6 +190,23 @@ Do not discover files with `find` / `ls` when the user already supplied paths.
190
190
  If the include set is large, summarize it and ask for confirmation before
191
191
  registration; do not read file bodies before capture permission is clear.
192
192
 
193
+ ### Unavailable document acquisition
194
+
195
+ A `document.capture.warning` is not a successful capture. Report whether the CLI
196
+ retained a validated registered snapshot or deferred a source with no evidence.
197
+ Use retained material with its recorded version; do not claim that upstream is
198
+ current. A deferred source remains registered and must not be cited as evidence.
199
+ Continue unrelated work using the returned workspace Route. Do not remove sources,
200
+ clear tasks, invent content, or repeatedly retry authentication to unblock it.
201
+
202
+ The warning includes a retry command. Run it when access is restored or the user
203
+ requests another attempt. Changing the source or capture configuration invalidates
204
+ the old deferral. Warning receipts are local runtime state; another checkout may
205
+ attempt acquisition again. Persisted snapshots remain the portable evidence.
206
+ Snapshot corruption, invalid input, write conflicts and repository restore errors
207
+ are not downgraded. Code work still requires its authorized registered repository
208
+ version. Note/session material already saved in the workspace is read locally.
209
+
193
210
  ### Output Handling
194
211
 
195
212
  Preserve commands, reason codes, ids, and diagnostics exactly; summarize
@@ -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
@@ -21,6 +25,11 @@ Wait for an active writer to finish and obtain its receipt before changing state
21
25
  If status is broken, inspect its diagnostic and files with Host tools rather
22
26
  than treating failure as proof that the workspace is empty.
23
27
 
28
+ Registered source inventory is not an active task. Preparation does not repair
29
+ invalid snapshots or change source scope; do not repeat preparation to bypass a
30
+ capture diagnostic. Excluding a source from one task is not authorization to
31
+ delete its registration or retained evidence.
32
+
24
33
  ## End the old task
25
34
 
26
35
  Run `context task prepare --format json`. It previews the exact Context-owned
@@ -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