@c4a/context-cli 0.7.91 → 0.7.93

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 (63) hide show
  1. package/README.md +11 -3
  2. package/README.zh-CN.md +4 -2
  3. package/cli.js +23913 -21322
  4. package/indexers/bundles/context-code-indexer/references/composers/contracts-and-chains.md +1 -1
  5. package/indexers/bundles/context-code-indexer/references/composers/cross-module-chain.md +1 -1
  6. package/indexers/bundles/context-code-indexer/references/composers/development-and-delivery.md +1 -1
  7. package/indexers/bundles/context-code-indexer/references/composers/event-flow.md +1 -1
  8. package/indexers/bundles/context-code-indexer/references/composers/examples-and-documentation.md +1 -1
  9. package/indexers/bundles/context-code-indexer/references/composers/persistence-boundary.md +1 -1
  10. package/indexers/bundles/context-code-indexer/references/composers/protocol-boundary.md +1 -1
  11. package/indexers/bundles/context-code-indexer/references/composers/public-contract.md +1 -1
  12. package/indexers/bundles/context-code-indexer/references/indexer.md +4 -2
  13. package/indexers/bundles/context-code-indexer/templates/data-sync-reconciliation.md +1 -1
  14. package/indexers/bundles/context-markdown-indexer/references/indexer.md +4 -1
  15. package/indexers/contracts/profile-contract.json +245 -245
  16. package/indexers/release-manifest.json +14 -14
  17. package/package.json +12 -12
  18. package/parserEntryWorker.js +158 -163
  19. package/plugins/VERSION +1 -1
  20. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  21. package/plugins/claude/commands/context.md +31 -10
  22. package/plugins/claude/resources/context/routine-update.md +125 -0
  23. package/plugins/claude/resources/context/version-alignment.md +54 -0
  24. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  25. package/plugins/codex/skills/context/SKILL.md +31 -10
  26. package/plugins/codex/skills/context/references/routine-update.md +125 -0
  27. package/plugins/codex/skills/context/references/version-alignment.md +54 -0
  28. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  29. package/plugins/cursor/commands/c4a-context.md +31 -10
  30. package/plugins/cursor/resources/context/routine-update.md +125 -0
  31. package/plugins/cursor/resources/context/version-alignment.md +54 -0
  32. package/plugins/skills/context/SKILL.md +31 -10
  33. package/plugins/skills/context/references/routine-update.md +125 -0
  34. package/plugins/skills/context/references/version-alignment.md +54 -0
  35. package/plugins/skills/context-code-indexer/references/composers/contracts-and-chains.md +1 -1
  36. package/plugins/skills/context-code-indexer/references/composers/cross-module-chain.md +1 -1
  37. package/plugins/skills/context-code-indexer/references/composers/development-and-delivery.md +1 -1
  38. package/plugins/skills/context-code-indexer/references/composers/event-flow.md +1 -1
  39. package/plugins/skills/context-code-indexer/references/composers/examples-and-documentation.md +1 -1
  40. package/plugins/skills/context-code-indexer/references/composers/persistence-boundary.md +1 -1
  41. package/plugins/skills/context-code-indexer/references/composers/protocol-boundary.md +1 -1
  42. package/plugins/skills/context-code-indexer/references/composers/public-contract.md +1 -1
  43. package/plugins/skills/context-code-indexer/references/indexer.md +4 -2
  44. package/plugins/skills/context-code-indexer/templates/data-sync-reconciliation.md +1 -1
  45. package/plugins/skills/context-markdown-indexer/references/indexer.md +4 -1
  46. package/providers/context/manifest.json +29 -29
  47. package/providers/context/provider.yaml +1 -1
  48. package/providers/context/resources/dialogue/knowledge-review.md +1 -1
  49. package/providers/context/resources/manuals/guides/code-indexer-skill-authoring.md +1 -1
  50. package/providers/context/resources/manuals/guides/knowledge-updates.md +25 -6
  51. package/providers/context/resources/manuals/guides/markdown-indexer-skill-authoring.md +1 -1
  52. package/providers/context/resources/manuals/guides/workspace-restore.md +7 -0
  53. package/providers/context/resources/manuals/reference/package-templates.md +1 -1
  54. package/providers/context/resources/procedures/approved-revision.md +52 -4
  55. package/providers/context/resources/procedures/knowledge-maintenance.md +16 -0
  56. package/providers/context/resources/procedures/knowledge-review.md +21 -8
  57. package/providers/context/resources/procedures/knowledge-updates.md +25 -6
  58. package/providers/context/resources/procedures/production-stage-files.md +2 -2
  59. package/providers/context/resources/procedures/source-update.md +21 -2
  60. package/providers/context/resources/procedures/workspace-restore.md +7 -0
  61. package/providers/context/schemas/indexer-agent-step-result.schema.json +21 -0
  62. package/providers/context/skills/run-indexer-agent-step/SKILL.md +33 -0
  63. package/providers/context/skills/translate-site-locales/SKILL.md +3 -1
@@ -2,7 +2,7 @@
2
2
  "schema": "agent-graph.bundle.v1",
3
3
  "provider": {
4
4
  "id": "c4a/context",
5
- "version": "0.7.91"
5
+ "version": "0.7.93"
6
6
  },
7
7
  "providerManifest": "provider.yaml",
8
8
  "graphs": [
@@ -203,7 +203,7 @@
203
203
  {
204
204
  "id": "context.sdk.package-templates",
205
205
  "path": "resources/manuals/reference/package-templates.md",
206
- "digest": "sha256:c0aa85da17a28e4821786bb04d0297e2fdda1439cf3f7a3c3a7ef6701d24daa1"
206
+ "digest": "sha256:801a6bea36673decab62367f38a1d31b9c7555b7df67e30e9312b51412510c78"
207
207
  },
208
208
  {
209
209
  "id": "context.sdk.page-customization",
@@ -273,7 +273,7 @@
273
273
  {
274
274
  "id": "dialogue.knowledge-review",
275
275
  "path": "resources/dialogue/knowledge-review.md",
276
- "digest": "sha256:685d6d408419d21a6cfb2affa008b260813193836a828486868a8700123cf11e"
276
+ "digest": "sha256:d581b31d21436a93fbdb57ccfc9f27ee9ab5417a782c727ed699f2f80ecb83b1"
277
277
  },
278
278
  {
279
279
  "id": "dialogue.package-output",
@@ -293,7 +293,7 @@
293
293
  {
294
294
  "id": "procedure.approved-revision",
295
295
  "path": "resources/procedures/approved-revision.md",
296
- "digest": "sha256:fecf43f12b1759cc1ca3b716892a787b5445caa25ff7efadb2cebf042a309a0c"
296
+ "digest": "sha256:53e905cc5e189094b90bda7cccaa7d3e2bf7151e59bd3f06a44d7fb966aef33d"
297
297
  },
298
298
  {
299
299
  "id": "procedure.close-and-build",
@@ -318,17 +318,17 @@
318
318
  {
319
319
  "id": "procedure.knowledge-maintenance",
320
320
  "path": "resources/procedures/knowledge-maintenance.md",
321
- "digest": "sha256:f2cc36cb2425cf0ac96a2ea4f114ed5ce872c3711b82bdc25fdc71e42a2849b7"
321
+ "digest": "sha256:e149feae8c33bf5f9859b14e119991fa76b7a91e3916bcb2ffe04fcf064d9a60"
322
322
  },
323
323
  {
324
324
  "id": "procedure.knowledge-review",
325
325
  "path": "resources/procedures/knowledge-review.md",
326
- "digest": "sha256:c3707cfe0c53e3732366ee4b19873f7f609823b44746c9a694e6a3d44bfafd55"
326
+ "digest": "sha256:bc8e0de7d9a94480b21373074bb18deb50ab532327e18bb734cc762afa5e09dd"
327
327
  },
328
328
  {
329
329
  "id": "procedure.knowledge-updates",
330
330
  "path": "resources/procedures/knowledge-updates.md",
331
- "digest": "sha256:889e7bb709907eda63f94a19e5b9ad0942fa3e9bd700670ead0d3470b52faf63"
331
+ "digest": "sha256:a85f755b29c88c8392da42b0b4b4223f523ca01417c4142284c1a5f43c8d5db1"
332
332
  },
333
333
  {
334
334
  "id": "procedure.note",
@@ -353,7 +353,7 @@
353
353
  {
354
354
  "id": "procedure.production-stage-files",
355
355
  "path": "resources/procedures/production-stage-files.md",
356
- "digest": "sha256:3baccaa799d01749dae4cdb7bf839c7d182009540d3bf91a95e775d44be2ef6c"
356
+ "digest": "sha256:a057e59b37546f1ab5f2c70c9ac8b5922382931949643c20450aac00ac744da8"
357
357
  },
358
358
  {
359
359
  "id": "procedure.project-configuration",
@@ -388,7 +388,7 @@
388
388
  {
389
389
  "id": "procedure.source-update",
390
390
  "path": "resources/procedures/source-update.md",
391
- "digest": "sha256:ecad2a39447918b28b9e3c518935e6d29758782b440a74a811e519f98c45c0e0"
391
+ "digest": "sha256:992cfc2279fa770e7242d78b9a3d54989dd61262d495f2fda4cb260856da5151"
392
392
  },
393
393
  {
394
394
  "id": "procedure.task-recovery",
@@ -418,7 +418,7 @@
418
418
  {
419
419
  "id": "procedure.workspace-restore",
420
420
  "path": "resources/procedures/workspace-restore.md",
421
- "digest": "sha256:c9ba5b5ee703ca79b5db6499c1361a1b7e7ee7efe43fb5c204ad08876f6e89c7"
421
+ "digest": "sha256:a5f6cc1fefc006970c4d21b7a0a616adfdd4fb0b2cae7753b00ce83b58865610"
422
422
  },
423
423
  {
424
424
  "id": "template.indexer-agent-worker",
@@ -445,7 +445,7 @@
445
445
  {
446
446
  "id": "schemas/indexer-agent-step-result.schema.json",
447
447
  "path": "schemas/indexer-agent-step-result.schema.json",
448
- "digest": "sha256:b80501f5c131ffd731cd2f96513c37aa012c3470098a287bd58b06c4698af6d2"
448
+ "digest": "sha256:56d6ead3dc53b5a56079e04385c7b2293a017c19d33762ca9ba8307ae0684ecc"
449
449
  },
450
450
  {
451
451
  "id": "context.indexer.registry-bootstrap",
@@ -598,7 +598,7 @@
598
598
  },
599
599
  {
600
600
  "path": "provider.yaml",
601
- "digest": "sha256:ab753c7977642bebaf0b50f10288456d99c751225ac3b1ae07f4b7811dfc775a"
601
+ "digest": "sha256:9a7308ff7ab4a2432a8bf5c969774c103162da96c9340511abfd3e1e2ee00f57"
602
602
  },
603
603
  {
604
604
  "path": "resources/contracts/indexer-provider-guide.yaml",
@@ -630,7 +630,7 @@
630
630
  },
631
631
  {
632
632
  "path": "resources/dialogue/knowledge-review.md",
633
- "digest": "sha256:685d6d408419d21a6cfb2affa008b260813193836a828486868a8700123cf11e"
633
+ "digest": "sha256:d581b31d21436a93fbdb57ccfc9f27ee9ab5417a782c727ed699f2f80ecb83b1"
634
634
  },
635
635
  {
636
636
  "path": "resources/dialogue/package-output.md",
@@ -646,7 +646,7 @@
646
646
  },
647
647
  {
648
648
  "path": "resources/manuals/guides/code-indexer-skill-authoring.md",
649
- "digest": "sha256:35a403edb2efaa0814df6f7b743c9c6a997f65603667678b53f6b36a068d124b"
649
+ "digest": "sha256:8d8bac9c302d969d518c99eeb7a98532d7499c7bac6dc5bb85d5031d2948f50b"
650
650
  },
651
651
  {
652
652
  "path": "resources/manuals/guides/imports.md",
@@ -658,7 +658,7 @@
658
658
  },
659
659
  {
660
660
  "path": "resources/manuals/guides/knowledge-updates.md",
661
- "digest": "sha256:fff96a7ba224684eb565b733370df2efb0306877e35a0b44d0c0e46c60abc2ce"
661
+ "digest": "sha256:0ccba0d285484040bd5fb513081e5c734b63debd86a34ee5c38f692f4537be07"
662
662
  },
663
663
  {
664
664
  "path": "resources/manuals/guides/lark-resources.md",
@@ -666,7 +666,7 @@
666
666
  },
667
667
  {
668
668
  "path": "resources/manuals/guides/markdown-indexer-skill-authoring.md",
669
- "digest": "sha256:a2d9cce0fce4a220befbfa8c0a8062ec4656b1ab812b149e0a14d341967d976a"
669
+ "digest": "sha256:9dcfd99cd0c999e04c15d92fafeb9c740c931dd547825622ae76032cfdd3e2fc"
670
670
  },
671
671
  {
672
672
  "path": "resources/manuals/guides/note.md",
@@ -706,7 +706,7 @@
706
706
  },
707
707
  {
708
708
  "path": "resources/manuals/guides/workspace-restore.md",
709
- "digest": "sha256:01530e0ddf701ceba53988bab4531e0e854cccd8ab827dcc1c5fc3cb4dc6c3cb"
709
+ "digest": "sha256:8019b43338dee3645296878c82dc737feed49e05c3594e91e72c47055787249e"
710
710
  },
711
711
  {
712
712
  "path": "resources/manuals/reference/code-extractors.md",
@@ -714,7 +714,7 @@
714
714
  },
715
715
  {
716
716
  "path": "resources/manuals/reference/package-templates.md",
717
- "digest": "sha256:c0aa85da17a28e4821786bb04d0297e2fdda1439cf3f7a3c3a7ef6701d24daa1"
717
+ "digest": "sha256:801a6bea36673decab62367f38a1d31b9c7555b7df67e30e9312b51412510c78"
718
718
  },
719
719
  {
720
720
  "path": "resources/manuals/reference/project-api.md",
@@ -726,7 +726,7 @@
726
726
  },
727
727
  {
728
728
  "path": "resources/procedures/approved-revision.md",
729
- "digest": "sha256:fecf43f12b1759cc1ca3b716892a787b5445caa25ff7efadb2cebf042a309a0c"
729
+ "digest": "sha256:53e905cc5e189094b90bda7cccaa7d3e2bf7151e59bd3f06a44d7fb966aef33d"
730
730
  },
731
731
  {
732
732
  "path": "resources/procedures/close-and-build.md",
@@ -746,15 +746,15 @@
746
746
  },
747
747
  {
748
748
  "path": "resources/procedures/knowledge-maintenance.md",
749
- "digest": "sha256:f2cc36cb2425cf0ac96a2ea4f114ed5ce872c3711b82bdc25fdc71e42a2849b7"
749
+ "digest": "sha256:e149feae8c33bf5f9859b14e119991fa76b7a91e3916bcb2ffe04fcf064d9a60"
750
750
  },
751
751
  {
752
752
  "path": "resources/procedures/knowledge-review.md",
753
- "digest": "sha256:c3707cfe0c53e3732366ee4b19873f7f609823b44746c9a694e6a3d44bfafd55"
753
+ "digest": "sha256:bc8e0de7d9a94480b21373074bb18deb50ab532327e18bb734cc762afa5e09dd"
754
754
  },
755
755
  {
756
756
  "path": "resources/procedures/knowledge-updates.md",
757
- "digest": "sha256:889e7bb709907eda63f94a19e5b9ad0942fa3e9bd700670ead0d3470b52faf63"
757
+ "digest": "sha256:a85f755b29c88c8392da42b0b4b4223f523ca01417c4142284c1a5f43c8d5db1"
758
758
  },
759
759
  {
760
760
  "path": "resources/procedures/note.md",
@@ -774,7 +774,7 @@
774
774
  },
775
775
  {
776
776
  "path": "resources/procedures/production-stage-files.md",
777
- "digest": "sha256:3baccaa799d01749dae4cdb7bf839c7d182009540d3bf91a95e775d44be2ef6c"
777
+ "digest": "sha256:a057e59b37546f1ab5f2c70c9ac8b5922382931949643c20450aac00ac744da8"
778
778
  },
779
779
  {
780
780
  "path": "resources/procedures/project-configuration.md",
@@ -802,7 +802,7 @@
802
802
  },
803
803
  {
804
804
  "path": "resources/procedures/source-update.md",
805
- "digest": "sha256:ecad2a39447918b28b9e3c518935e6d29758782b440a74a811e519f98c45c0e0"
805
+ "digest": "sha256:992cfc2279fa770e7242d78b9a3d54989dd61262d495f2fda4cb260856da5151"
806
806
  },
807
807
  {
808
808
  "path": "resources/procedures/task-recovery.md",
@@ -826,7 +826,7 @@
826
826
  },
827
827
  {
828
828
  "path": "resources/procedures/workspace-restore.md",
829
- "digest": "sha256:c9ba5b5ee703ca79b5db6499c1361a1b7e7ee7efe43fb5c204ad08876f6e89c7"
829
+ "digest": "sha256:a5f6cc1fefc006970c4d21b7a0a616adfdd4fb0b2cae7753b00ce83b58865610"
830
830
  },
831
831
  {
832
832
  "path": "resources/templates/indexer-agent-worker.md",
@@ -870,7 +870,7 @@
870
870
  },
871
871
  {
872
872
  "path": "schemas/indexer-agent-step-result.schema.json",
873
- "digest": "sha256:b80501f5c131ffd731cd2f96513c37aa012c3470098a287bd58b06c4698af6d2"
873
+ "digest": "sha256:56d6ead3dc53b5a56079e04385c7b2293a017c19d33762ca9ba8307ae0684ecc"
874
874
  },
875
875
  {
876
876
  "path": "schemas/indexer-registry-bootstrap.schema.json",
@@ -902,7 +902,7 @@
902
902
  },
903
903
  {
904
904
  "path": "skills/run-indexer-agent-step/SKILL.md",
905
- "digest": "sha256:a174ccb27ccd72c24475c2965c0c33ad52198ad48cd2fb67967237d8a48162c6"
905
+ "digest": "sha256:d86e5592df9a96ce7a0c54ce6f4b310df21df16cb521fb5aaadcc21eb90020a8"
906
906
  },
907
907
  {
908
908
  "path": "skills/run-indexer-lifecycle/SKILL.md",
@@ -910,7 +910,7 @@
910
910
  },
911
911
  {
912
912
  "path": "skills/translate-site-locales/SKILL.md",
913
- "digest": "sha256:b13be9668338273cb6f2a7baa4bf1249d77e63895369220af84193c1de3da3ad"
913
+ "digest": "sha256:e7bcb9e068ba91531c8948901fb1d505848e8ab941440a8a4e08bc61df280af7"
914
914
  },
915
915
  {
916
916
  "path": "skills/work-production-stage/SKILL.md",
@@ -921,5 +921,5 @@
921
921
  "indexer": [],
922
922
  "workspace": []
923
923
  },
924
- "digest": "sha256:64b6d714b4d09e2c3559294e0fad68dcef81465a729b0a05dc0530a88b1b5cfa"
924
+ "digest": "sha256:4aa7f4327d55e41e448a169562ce3275bc058cd2a678b5c191313a48d9f071df"
925
925
  }
@@ -1,6 +1,6 @@
1
1
  schema: agent-graph.provider.v1
2
2
  id: c4a/context
3
- version: 0.7.91
3
+ version: 0.7.93
4
4
  name: Context workflow
5
5
  description: Internal work contract for Context knowledge workspaces.
6
6
  graphs:
@@ -59,5 +59,5 @@ Do not report fully managed or inaccessible material as read by the user.
59
59
  With explicit session-managed authority, consume the required current Markdown
60
60
  review resource and use its scope template and Route's atomic apply command.
61
61
  Read pages before deciding, leave repair and undecided pages pending, and reuse
62
- still-available review of unchanged pages. Do not open HTML or create a parallel
62
+ still-available review of unchanged pages. Give the user the report path returned by review apply. Do not open HTML on the user’s behalf or create a parallel
63
63
  review ledger. After any apply or repair, follow the freshly evaluated Route.
@@ -50,7 +50,7 @@ proof of runtime behavior. Preserve expressions without executing project code,
50
50
  distinguish declaration defaults from implementation defaults, and state unknowns.
51
51
 
52
52
  Use the current stage's Markdown and reference-file schemas. Each fragment cites
53
- actual source regions from at most three files (up to eight regions); the CLI
53
+ actual source regions from at most five files (up to eight regions); the CLI
54
54
  computes regional digests. Split
55
55
  an explanation when it needs separate evidence, not to fill a fixed template.
56
56
  Reuse stable article and fragment identities when revising. Supporting documents,
@@ -185,6 +185,12 @@ There are no root-level Context version/build/publication receipts to maintain.
185
185
  Build freshness uses the existing local package cache. The CLI does not seal a
186
186
  version merely because a preview was built. Before reusing a version, check the
187
187
  actual publication target and Git tags; a published version requires an increase.
188
+ Replaying the same latest version and description returns `already-recorded`,
189
+ including after tagging. Resubmitting a different description for the latest
190
+ untagged version updates that description without changing its version or content
191
+ checkpoint. No additional flag is needed. If this session already published the
192
+ version, record a new version instead: the CLI protects tagged records but cannot
193
+ infer whether an untagged version was published by another tool.
188
194
  Publication belongs to the installed distribution tool. Record remote receipts
189
195
  in its configuration or the existing work summary, separately for each target.
190
196
  A successful authorized commit/tag identifies the delivered source; never create
@@ -338,7 +344,7 @@ changing structure, adding a page or when a section has no unambiguous ID.
338
344
  To change a fragment's citations, include `references` alongside its `section_id`:
339
345
  each entry supplies `source_ref` and `locator` (`path`, `start_line`, `end_line`).
340
346
  Context computes the region fingerprint. This uses the same revision submission,
341
- with at most three source files and eight regions per fragment. Full Markdown may include a
347
+ with at most five source files and eight regions per fragment. Full Markdown may include a
342
348
  `sections` list of reference edits; local section edits may change content,
343
349
  references, or both. Omission preserves citations; an empty list removes them.
344
350
 
@@ -657,8 +663,17 @@ page-level incoming Markdown links to explicit replacements, and rebinds page
657
663
  navigation or removes retired navigation targets while retaining groups.
658
664
  Repair fragment links explicitly first: the CLI cannot infer where a split moved
659
665
  a paragraph. Without a replacement, repair incoming links before applying.
660
- Finish active drafts/revisions first; unfinished production targeting a selected
661
- page must be finished or amended rather than discarded.
666
+ While a revision batch is active and not yet approved, the same command schedules
667
+ the retirement in that batch instead. Its preview lists the follow-up by the entry
668
+ that handles it: pages whose links to the retired page need updating (they join
669
+ the batch), navigation entries that will point to the replacement and keep their
670
+ label or be removed (adjust labels with `context task adjust` if needed), and
671
+ translations that become orphaned (the translation step removes them). The
672
+ retired page's own unfinished draft is dropped; the replacement may be a page new
673
+ in this batch. Nothing is deleted until the batch's final Review apply, which
674
+ computes the retirement on the final drafts in the same write as the approved
675
+ pages. Once a batch is approved, finish its delivery first; unfinished production
676
+ targeting a selected page must be finished or amended rather than discarded.
662
677
 
663
678
  Follow status and the normal close/version/build flow before delivery. Sources
664
679
  and shared assets are not deleted. The response provides a temporary restore
@@ -682,7 +697,11 @@ approved-page revision or source-update queue. Keep `scopes` and `instruction`
682
697
  explicit. First call without `refresh`; it authorizes replacing only those
683
698
  inputs and blocks page completion while acquisition is pending. Import the
684
699
  selected new material, then repeat with `refresh: true` to bind the actual local
685
- versions and obtain the new Route. Do not submit the old revision. Current
700
+ versions and obtain the new Route. When every selected source is newly added to
701
+ the task and its material is already local (an imported document, or a repository
702
+ at the commit the delivered knowledge already uses), the first call completes the
703
+ adjustment and returns `adjusted` with `acquisition: already-available`; do not
704
+ repeat it. Do not submit the old revision. Current
686
705
  prose and queued pages remain; an affected draft returns to writing/review.
687
706
  An unrelated queued page does not revoke an unchanged current page's review.
688
707
  If a page has already been applied, finish its close/build before changing its
@@ -711,7 +730,7 @@ Revision section edits may supply `references` as `source_ref` plus a
711
730
  `locator` containing `path`, `start_line`, and `end_line`. Context computes the
712
731
  regional digest. Omitted references preserve the current fragment's citations;
713
732
  an explicit empty list removes them, and deleting a fragment removes its
714
- citations. Each fragment may cite at most three source files and eight regions. Register and
733
+ citations. Each fragment may cite at most five source files and eight regions. Register and
715
734
  authorize new material before citing it, then follow normal Review, close and
716
735
  build. Article links alone do not authorize reading new sources or prove a claim.
717
736
 
@@ -725,5 +744,5 @@ same-level or higher-level heading. A quote is an exact, unique, nonempty
725
744
  substring (line endings are normalized). Ambiguous matches return candidate
726
745
  line ranges. Both forms resolve against authorized captured text before hashing;
727
746
  stored references still contain only `path`, `start_line` and `end_line`.
728
- The per-fragment limits (three source files, eight regions) apply after
747
+ The per-fragment limits (five source files, eight regions) apply after
729
748
  resolving and deduplicating positions.
@@ -45,7 +45,7 @@ submit the short stage-relative manifest. Title and description belong to the
45
45
  article, not an internal layout-mapping tuple.
46
46
 
47
47
  Keep stable article and fragment identities when revising. Each fragment cites
48
- actual source regions from at most three files (up to eight regions). The CLI handles source digests and safety;
48
+ actual source regions from at most five files (up to eight regions). The CLI handles source digests and safety;
49
49
  the Agent judges whether the evidence supports the explanation. For a local
50
50
  failure, use the returned fragment identifier or position to repair the affected
51
51
  part. Completed independent tasks can be submitted without the rest of the batch.
@@ -47,6 +47,13 @@ whole-repository `reset --hard` or `clean -fdx` as a workspace shortcut.
47
47
  Use the restored source records with the preparation guide to restore pinned
48
48
  repository versions, module paths, document snapshots and attachments. New remote
49
49
  content cannot stand in for lost old snapshots. Do not reclone usable sources.
50
+ For one registered document, `context source restore --input - --format json`
51
+ accepts `{ "type": "lark", "name": "handbook", "commit": "<sha>" }` (or
52
+ `type: "file"`). It restores that source's body, assets and manifest entry as
53
+ one verified snapshot, preserving other documents in a shared manifest. Omit
54
+ `commit` to select the latest complete, hash-valid capture in Git history.
55
+ Do not assemble a document from different captures or rebuild its capture report
56
+ by hand. Run the returned status action after restoring it.
50
57
  On interruption, inspect the actual file diff and remaining source gaps and
51
58
  continue those operations; do not assume the previous Git command completed or
52
59
  replay old task submissions.
@@ -330,7 +330,7 @@ Approved Markdown under `knowledge/` and the article index in
330
330
  - Markdown fragment markers contain only their stable ID:
331
331
  `<!-- context:section id="usage" -->` and `<!-- /context:section -->`.
332
332
  Structure records each corresponding ID and its source positions: at most
333
- three distinct source files and eight regions per fragment, not per article.
333
+ five distinct source files and eight regions per fragment, not per article.
334
334
  - A reference contains `source_ref`, `locator: { path, start_line, end_line }`
335
335
  and the Host-computed regional `content_digest`. Do not duplicate this in
336
336
  Markdown frontmatter or comments.
@@ -30,8 +30,9 @@ A `requirement_ref` alone does not authorize it: the selected requirement in
30
30
  `src/indexers.yaml` must connect the new source to an existing task source through
31
31
  its target or evidence scopes. When `revision-source-scope-unconfirmed` is returned,
32
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
33
+ association. Then retry the same `task adjust` without refresh. If it returns
34
+ `adjusted` (the material was already local), continue; otherwise, once material
35
+ is available, repeat with `refresh: true`. Reread the resulting revision. Do not invent
35
36
  module references, replace an older note, delete sources or clear the task to
36
37
  satisfy this boundary. Already imported material does not need to be imported again.
37
38
  The adjusted source stays citable by the remaining pages queued in the same revision;
@@ -139,13 +140,18 @@ Action schema and the same source and baseline validation.
139
140
 
140
141
  When a fragment's support changes, include `references` with its actual
141
142
  `source_ref` and `locator` (`path`, `start_line`, `end_line`). Each fragment allows
142
- regions from up to three source files, eight regions in total; Context reads the captured region and computes its digest.
143
+ regions from up to five source files, eight regions in total; Context reads the captured region and computes its digest.
143
144
  For full Markdown, optional `sections` contains only `{ section_id, references }`
144
145
  entries; for local edits it can accompany `content` or update references alone.
145
146
  An explicit empty list removes that fragment's citations. Deleted fragments lose
146
147
  their references; new fragments need their own selected sources, not copied IDs.
147
148
  Uniquely moved unchanged text can retain its fingerprint at its new position;
148
149
  changed or ambiguous regions remain visible for review, not silently refreshed.
150
+ Inside a submitted `references` list, an earlier citation repeated with the same
151
+ `start_line`/`end_line` means "keep that evidence": Context moves it to where that
152
+ text is now, or rejects the fragment when it no longer exists uniquely. To cite
153
+ the text now at those lines instead, use a `quote` or `heading` locator; those
154
+ always select current text.
149
155
 
150
156
  For example, after substituting IDs/tokens from this Route:
151
157
 
@@ -158,6 +164,25 @@ same command: it returns the assembled Markdown and prior text without accepting
158
164
  or advancing the revision. Submit without `--preview` after checking it. Preview
159
165
  is optional; it does not replace Review or authorize a stale revision.
160
166
 
167
+ For a prepared multi-page batch (`prepare-current`), append `--preview` to the
168
+ batch submission. It applies the submission checks to every page against its
169
+ issued input (task binding, fragment file and region limits, line ranges in the
170
+ fixed source, signing) against the current Route and returns one result per page
171
+ with its issues, without saving drafts, task state or source caches. It reports problems and never repairs them: for example, a line range
172
+ past the end of a file is reported, not clamped. Write the whole batch, preview
173
+ it once, correct the flagged pages, then submit; do not write ad-hoc validation
174
+ or re-signing scripts.
175
+
176
+ Preview is useful only when its assembled text will be read before deciding to
177
+ submit. An unattended loop submits directly. Continue from the receipt's
178
+ `next_route.inline`, or read `next_route.file` once; do not routinely run status
179
+ or preview between submissions. Stop a loop when the Route node changes, a new
180
+ required reading appears, or a human gate is reached. Bind prepared content to
181
+ the issued task inputs rather than attaching an old draft to a fresh revision.
182
+ If submission fails, use its returned submission state and recovery action;
183
+ never replay work already committed. Refresh status when the next Route is
184
+ missing or the workspace changes externally.
185
+
161
186
  ## Interpreting generated API output
162
187
 
163
188
  Check fields, types, requiredness and supported defaults against the selected
@@ -183,5 +208,28 @@ same-level or higher-level heading. A quote is an exact, unique, nonempty
183
208
  substring (line endings are normalized). Ambiguous matches return candidate
184
209
  line ranges. Both forms resolve against authorized captured text before hashing;
185
210
  stored references still contain only `path`, `start_line` and `end_line`.
186
- The per-fragment limits (three source files, eight regions) apply after
211
+ The per-fragment limits (five source files, eight regions) apply after
187
212
  resolving and deduplicating positions.
213
+
214
+ ## Submitting several prewritten pages
215
+
216
+ Single-page submission remains the default. When several queued pages are already
217
+ written, use the optional `action prepare-current` command from this Route. It
218
+ returns the existing `tasks[]` submission shape, task input files and one temporary
219
+ Agent directory. Compare each draft with its issued instruction, source inputs and
220
+ current sections before submitting it. An `edits` file contains the same
221
+ `stage: approved-revision` payload as a single submission; alternatively, `content`
222
+ is full Markdown and `references` is `{ "sections": [...] }`. All result paths are
223
+ relative to the returned Agent directory.
224
+
225
+ Submit an ordered completed prefix. The CLI saves one page at a time and stops at
226
+ Review, changed inputs, new reading requirements or a failed page. Follow the
227
+ returned Route. If a page fails, correct it and submit only the unfinished suffix
228
+ with the current Route revision and original input tokens. If inputs changed,
229
+ prepare again and reconcile the drafts. Never resubmit a committed page; uncertain
230
+ transactions must use the returned recovery action first.
231
+
232
+ For long submission loops, report completed/total progress using temporary files.
233
+ Use the host's recoverable background execution when available, otherwise allow
234
+ sufficient foreground timeout. Wait for the running command rather than repeatedly
235
+ polling through model turns. Do not modify knowledge inputs during a write.
@@ -44,6 +44,22 @@ adjustment procedures. A regenerated table does not advance a whole-source
44
44
  processed baseline. A changed upstream version still requires source impact
45
45
  assessment, including other affected approved pages and new topics.
46
46
 
47
+ While the current revision batch (a maintenance batch or the pages of a source
48
+ update) is not yet approved, a page request joins it instead of queueing: the
49
+ result says `joined-current-batch`, the page enters this batch's Review, and a
50
+ request for a page already drafted here restarts from that draft. Once Review
51
+ approves the batch, new requests queue for the next batch. A new source update
52
+ never joins; it starts its own batch. Translation and version recording wait
53
+ until no request is queued, so they run once after the last batch.
54
+
55
+ After approval and before delivery finishes, a mechanical correction caused by
56
+ the revision (a broken link, link text pointing to a retired page, a menu label,
57
+ an anchor or formatting) may be applied to the approved page without another
58
+ Review. You judge whether it is mechanical; if it changes meaning or citations,
59
+ register it for the next batch. Record each one with
60
+ `context task record-fix --input <{path, reason}> --format json` and report the
61
+ recorded fixes to the user with the batch result.
62
+
47
63
  `after-batch` waits for the current delivery boundary. Use `priority` when the
48
64
  user asks to handle the correction first: the Graph requests early delivery
49
65
  of complete pages, retaining ordinary Review gates. Never interrupt a running
@@ -26,12 +26,16 @@ Review.
26
26
 
27
27
  Without explicit session-managed authority, open the report returned by the
28
28
  Route and request confirmation or revision notes through the host user-question
29
- tool. Follow the selected knowledge-review dialogue to distinguish feedback,
29
+ tool. When the CLI cannot open it (for example without a graphical
30
+ session), follow `open_next`: open the same report path the same way after each
31
+ regeneration, so the reader's READ marks carry over to unchanged pages. Follow the selected knowledge-review dialogue to distinguish feedback,
30
32
  approval and approval-after-repair. Keep the exact report reference, presented
31
33
  scope and user intent in this conversation. The HTML contains reading progress
32
34
  and plain revision notes, not approval authority. Normal explicit confirmation
33
35
  uses the Route's revision-bound resolution Action and the report's scope snapshot.
34
- No review code or special approval phrase is required.
36
+ No review code or special approval phrase is required. When the report's
37
+ `navigation.changes` is not empty, name those menu changes (added, removed,
38
+ renamed, pointing elsewhere) in the confirmation request.
35
39
 
36
40
  For old automation, `review approve-all --force` remains a deprecated explicit
37
41
  approval alias and applies the current candidate scope without requiring a new
@@ -48,8 +52,10 @@ bounded batch; keep the decisions in the current Agent context and do not write
48
52
  a Review ledger. Use the current scope template in that index with the Route's
49
53
  atomic apply command. Add explicit decisions only for reviewed pages; leave
50
54
  repair or undecided pages out of decisions and do not set a default. For a fully
51
- reviewed acceptable set, default approval remains available. Do not generate,
52
- open, or parse the ordinary HTML report. Reopen repair pages through their
55
+ reviewed acceptable set, default approval remains available. The apply command preserves the standard HTML report before applying decisions
56
+ and returns its path. Use that report when the user requests a report or diff;
57
+ the managed reading surface remains the Markdown Resource, so do not parse the
58
+ HTML to make automated decisions. Reopen repair pages through their
53
59
  current repair command; unrelated approvals remain valid. The
54
60
  authority exists only in the current conversation. It does not bypass source
55
61
  permission, validation, close, or verify, and it is not proof that the files
@@ -61,9 +67,11 @@ Do not persist a duplicate review-report ledger in the workspace.
61
67
  For restructuring, compare replacement content with the affected approved pages:
62
68
  useful conditions, steps and explanations must have a destination before removal.
63
69
  Review omission rejects a candidate; it does not retire an approved article.
64
- Pure retirement does not enter this HTML report. Use the explicit retirement
65
- preview after replacement delivery, and repair its
66
- reported incoming references. Navigation removal alone does not remove content
70
+ A retirement scheduled in the current batch appears in this report as planned:
71
+ the retired pages, navigation changes, and drafts that still link to them. Revise
72
+ those drafts before requesting approval; approval cannot apply while they remain.
73
+ Outside a batch, retirement stays a standalone action that does not enter this
74
+ report; use its explicit preview and repair its reported incoming references. Navigation removal alone does not remove content
67
75
  from search or packages. A renamed menu does not require a new article identity.
68
76
 
69
77
  Before requesting human review, follow the report's navigation diagnostics.
@@ -101,7 +109,12 @@ the correction instruction. Current candidates are repaired within this batch;
101
109
  `--regenerate` schedules program regeneration for approved pages. If supplied
102
110
  for a current candidate, follow the CLI's returned repair command instead.
103
111
  After the repair, read the new Route and review the changed material before
104
- approving the batch. Pending maintenance requests for other pages remain queued.
112
+ approving the batch. Requests for other pages made before approval join this
113
+ batch; after approval they queue for the next one. Between approval and the end
114
+ of delivery, a mechanical correction caused by this batch (a link, anchor, menu
115
+ label or formatting) may be applied without another Review; record it with
116
+ `context task record-fix --input <{path, reason}> --format json` and report it
117
+ with the batch result. A content change waits for the next batch.
105
118
 
106
119
  For a repaired generated table, inspect the new Candidate's affected rows, not
107
120
  only its Repair ID or accepted Author/Composer outcome. Check the reported error
@@ -185,6 +185,12 @@ There are no root-level Context version/build/publication receipts to maintain.
185
185
  Build freshness uses the existing local package cache. The CLI does not seal a
186
186
  version merely because a preview was built. Before reusing a version, check the
187
187
  actual publication target and Git tags; a published version requires an increase.
188
+ Replaying the same latest version and description returns `already-recorded`,
189
+ including after tagging. Resubmitting a different description for the latest
190
+ untagged version updates that description without changing its version or content
191
+ checkpoint. No additional flag is needed. If this session already published the
192
+ version, record a new version instead: the CLI protects tagged records but cannot
193
+ infer whether an untagged version was published by another tool.
188
194
  Publication belongs to the installed distribution tool. Record remote receipts
189
195
  in its configuration or the existing work summary, separately for each target.
190
196
  A successful authorized commit/tag identifies the delivered source; never create
@@ -338,7 +344,7 @@ changing structure, adding a page or when a section has no unambiguous ID.
338
344
  To change a fragment's citations, include `references` alongside its `section_id`:
339
345
  each entry supplies `source_ref` and `locator` (`path`, `start_line`, `end_line`).
340
346
  Context computes the region fingerprint. This uses the same revision submission,
341
- with at most three source files and eight regions per fragment. Full Markdown may include a
347
+ with at most five source files and eight regions per fragment. Full Markdown may include a
342
348
  `sections` list of reference edits; local section edits may change content,
343
349
  references, or both. Omission preserves citations; an empty list removes them.
344
350
 
@@ -657,8 +663,17 @@ page-level incoming Markdown links to explicit replacements, and rebinds page
657
663
  navigation or removes retired navigation targets while retaining groups.
658
664
  Repair fragment links explicitly first: the CLI cannot infer where a split moved
659
665
  a paragraph. Without a replacement, repair incoming links before applying.
660
- Finish active drafts/revisions first; unfinished production targeting a selected
661
- page must be finished or amended rather than discarded.
666
+ While a revision batch is active and not yet approved, the same command schedules
667
+ the retirement in that batch instead. Its preview lists the follow-up by the entry
668
+ that handles it: pages whose links to the retired page need updating (they join
669
+ the batch), navigation entries that will point to the replacement and keep their
670
+ label or be removed (adjust labels with `context task adjust` if needed), and
671
+ translations that become orphaned (the translation step removes them). The
672
+ retired page's own unfinished draft is dropped; the replacement may be a page new
673
+ in this batch. Nothing is deleted until the batch's final Review apply, which
674
+ computes the retirement on the final drafts in the same write as the approved
675
+ pages. Once a batch is approved, finish its delivery first; unfinished production
676
+ targeting a selected page must be finished or amended rather than discarded.
662
677
 
663
678
  Follow status and the normal close/version/build flow before delivery. Sources
664
679
  and shared assets are not deleted. The response provides a temporary restore
@@ -682,7 +697,11 @@ approved-page revision or source-update queue. Keep `scopes` and `instruction`
682
697
  explicit. First call without `refresh`; it authorizes replacing only those
683
698
  inputs and blocks page completion while acquisition is pending. Import the
684
699
  selected new material, then repeat with `refresh: true` to bind the actual local
685
- versions and obtain the new Route. Do not submit the old revision. Current
700
+ versions and obtain the new Route. When every selected source is newly added to
701
+ the task and its material is already local (an imported document, or a repository
702
+ at the commit the delivered knowledge already uses), the first call completes the
703
+ adjustment and returns `adjusted` with `acquisition: already-available`; do not
704
+ repeat it. Do not submit the old revision. Current
686
705
  prose and queued pages remain; an affected draft returns to writing/review.
687
706
  An unrelated queued page does not revoke an unchanged current page's review.
688
707
  If a page has already been applied, finish its close/build before changing its
@@ -711,7 +730,7 @@ Revision section edits may supply `references` as `source_ref` plus a
711
730
  `locator` containing `path`, `start_line`, and `end_line`. Context computes the
712
731
  regional digest. Omitted references preserve the current fragment's citations;
713
732
  an explicit empty list removes them, and deleting a fragment removes its
714
- citations. Each fragment may cite at most three source files and eight regions. Register and
733
+ citations. Each fragment may cite at most five source files and eight regions. Register and
715
734
  authorize new material before citing it, then follow normal Review, close and
716
735
  build. Article links alone do not authorize reading new sources or prove a claim.
717
736
 
@@ -725,5 +744,5 @@ same-level or higher-level heading. A quote is an exact, unique, nonempty
725
744
  substring (line endings are normalized). Ambiguous matches return candidate
726
745
  line ranges. Both forms resolve against authorized captured text before hashing;
727
746
  stored references still contain only `path`, `start_line` and `end_line`.
728
- The per-fragment limits (three source files, eight regions) apply after
747
+ The per-fragment limits (five source files, eight regions) apply after
729
748
  resolving and deduplicating positions.
@@ -69,7 +69,7 @@ Markdown has reader-facing title and description frontmatter, followed by the
69
69
  complete article with stable `context:section` markers. References contain
70
70
  `sections`, each with its matching `id` and `references` list. A reference is
71
71
  `source_ref` plus `locator: {path, start_line, end_line}` from actual authorized
72
- text. CLI computes source digests. A fragment may cite at most three distinct
72
+ text. CLI computes source digests. A fragment may cite at most five distinct
73
73
  source files and eight regions; an article may have multiple fragments.
74
74
 
75
75
  When prose names a file, directory or Skill from a cited repository, write its
@@ -115,5 +115,5 @@ same-level or higher-level heading. A quote is an exact, unique, nonempty
115
115
  substring (line endings are normalized). Ambiguous matches return candidate
116
116
  line ranges. Both forms resolve against authorized captured text before hashing;
117
117
  stored references still contain only `path`, `start_line` and `end_line`.
118
- The per-fragment limits (three source files, eight regions) apply after
118
+ The per-fragment limits (five source files, eight regions) apply after
119
119
  resolving and deduplicating positions.