@c4a/context-cli 0.7.91 → 0.7.92

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 (25) hide show
  1. package/cli.js +5513 -3884
  2. package/indexers/bundles/context-code-indexer/references/indexer.md +3 -1
  3. package/indexers/bundles/context-markdown-indexer/references/indexer.md +4 -1
  4. package/indexers/contracts/profile-contract.json +245 -245
  5. package/indexers/release-manifest.json +5 -5
  6. package/package.json +12 -12
  7. package/parserEntryWorker.js +157 -162
  8. package/plugins/VERSION +1 -1
  9. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  10. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  11. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  12. package/plugins/skills/context-code-indexer/references/indexer.md +3 -1
  13. package/plugins/skills/context-markdown-indexer/references/indexer.md +4 -1
  14. package/providers/context/manifest.json +20 -20
  15. package/providers/context/provider.yaml +1 -1
  16. package/providers/context/resources/dialogue/knowledge-review.md +1 -1
  17. package/providers/context/resources/manuals/guides/knowledge-updates.md +6 -0
  18. package/providers/context/resources/manuals/guides/workspace-restore.md +7 -0
  19. package/providers/context/resources/procedures/approved-revision.md +33 -0
  20. package/providers/context/resources/procedures/knowledge-review.md +4 -2
  21. package/providers/context/resources/procedures/knowledge-updates.md +6 -0
  22. package/providers/context/resources/procedures/source-update.md +19 -2
  23. package/providers/context/resources/procedures/workspace-restore.md +7 -0
  24. package/providers/context/schemas/indexer-agent-step-result.schema.json +21 -0
  25. package/providers/context/skills/run-indexer-agent-step/SKILL.md +31 -0
@@ -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.92"
6
6
  },
7
7
  "providerManifest": "provider.yaml",
8
8
  "graphs": [
@@ -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:7810af1c49a5ce156d6705b52e32e53f603b16b4a425fab7305d8231553d79a4"
297
297
  },
298
298
  {
299
299
  "id": "procedure.close-and-build",
@@ -323,12 +323,12 @@
323
323
  {
324
324
  "id": "procedure.knowledge-review",
325
325
  "path": "resources/procedures/knowledge-review.md",
326
- "digest": "sha256:c3707cfe0c53e3732366ee4b19873f7f609823b44746c9a694e6a3d44bfafd55"
326
+ "digest": "sha256:993139d962271bd8373f2852e4f051daa24313b8ce327e5b9c83967bddd67c74"
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:b84254660a6396ab5325e4f20a15e073da07b685eb9fbbe89d422de78dbb415c"
332
332
  },
333
333
  {
334
334
  "id": "procedure.note",
@@ -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:084563d826b425a90c3099f6f969e9e72b59c8ab28b74ab088518f1c4dd0feef"
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:4c505855a796edb5b9df1c58075277d3d353953bfd5fc867e6491249a4219d58"
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",
@@ -658,7 +658,7 @@
658
658
  },
659
659
  {
660
660
  "path": "resources/manuals/guides/knowledge-updates.md",
661
- "digest": "sha256:fff96a7ba224684eb565b733370df2efb0306877e35a0b44d0c0e46c60abc2ce"
661
+ "digest": "sha256:f0e89453534cbbfcb7a5539ab827c13911f2e5769482ccbb2583c6d3b2013045"
662
662
  },
663
663
  {
664
664
  "path": "resources/manuals/guides/lark-resources.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",
@@ -726,7 +726,7 @@
726
726
  },
727
727
  {
728
728
  "path": "resources/procedures/approved-revision.md",
729
- "digest": "sha256:fecf43f12b1759cc1ca3b716892a787b5445caa25ff7efadb2cebf042a309a0c"
729
+ "digest": "sha256:7810af1c49a5ce156d6705b52e32e53f603b16b4a425fab7305d8231553d79a4"
730
730
  },
731
731
  {
732
732
  "path": "resources/procedures/close-and-build.md",
@@ -750,11 +750,11 @@
750
750
  },
751
751
  {
752
752
  "path": "resources/procedures/knowledge-review.md",
753
- "digest": "sha256:c3707cfe0c53e3732366ee4b19873f7f609823b44746c9a694e6a3d44bfafd55"
753
+ "digest": "sha256:993139d962271bd8373f2852e4f051daa24313b8ce327e5b9c83967bddd67c74"
754
754
  },
755
755
  {
756
756
  "path": "resources/procedures/knowledge-updates.md",
757
- "digest": "sha256:889e7bb709907eda63f94a19e5b9ad0942fa3e9bd700670ead0d3470b52faf63"
757
+ "digest": "sha256:b84254660a6396ab5325e4f20a15e073da07b685eb9fbbe89d422de78dbb415c"
758
758
  },
759
759
  {
760
760
  "path": "resources/procedures/note.md",
@@ -802,7 +802,7 @@
802
802
  },
803
803
  {
804
804
  "path": "resources/procedures/source-update.md",
805
- "digest": "sha256:ecad2a39447918b28b9e3c518935e6d29758782b440a74a811e519f98c45c0e0"
805
+ "digest": "sha256:084563d826b425a90c3099f6f969e9e72b59c8ab28b74ab088518f1c4dd0feef"
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:42991d26650c0b9f7e0bb9a09c9a01c2bf7b625de2128b8b4b639dc220c4b056"
906
906
  },
907
907
  {
908
908
  "path": "skills/run-indexer-lifecycle/SKILL.md",
@@ -921,5 +921,5 @@
921
921
  "indexer": [],
922
922
  "workspace": []
923
923
  },
924
- "digest": "sha256:64b6d714b4d09e2c3559294e0fad68dcef81465a729b0a05dc0530a88b1b5cfa"
924
+ "digest": "sha256:154a7f1549b0e8282774a85422078b2df345b6d36deb0f5a9fe4b6ab164d9555"
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.92
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.
@@ -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
@@ -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.
@@ -158,6 +158,16 @@ same command: it returns the assembled Markdown and prior text without accepting
158
158
  or advancing the revision. Submit without `--preview` after checking it. Preview
159
159
  is optional; it does not replace Review or authorize a stale revision.
160
160
 
161
+ Preview is useful only when its assembled text will be read before deciding to
162
+ submit. An unattended loop submits directly. Continue from the receipt's
163
+ `next_route.inline`, or read `next_route.file` once; do not routinely run status
164
+ or preview between submissions. Stop a loop when the Route node changes, a new
165
+ required reading appears, or a human gate is reached. Bind prepared content to
166
+ the issued task inputs rather than attaching an old draft to a fresh revision.
167
+ If submission fails, use its returned submission state and recovery action;
168
+ never replay work already committed. Refresh status when the next Route is
169
+ missing or the workspace changes externally.
170
+
161
171
  ## Interpreting generated API output
162
172
 
163
173
  Check fields, types, requiredness and supported defaults against the selected
@@ -185,3 +195,26 @@ line ranges. Both forms resolve against authorized captured text before hashing;
185
195
  stored references still contain only `path`, `start_line` and `end_line`.
186
196
  The per-fragment limits (three source files, eight regions) apply after
187
197
  resolving and deduplicating positions.
198
+
199
+ ## Submitting several prewritten pages
200
+
201
+ Single-page submission remains the default. When several queued pages are already
202
+ written, use the optional `action prepare-current` command from this Route. It
203
+ returns the existing `tasks[]` submission shape, task input files and one temporary
204
+ Agent directory. Compare each draft with its issued instruction, source inputs and
205
+ current sections before submitting it. An `edits` file contains the same
206
+ `stage: approved-revision` payload as a single submission; alternatively, `content`
207
+ is full Markdown and `references` is `{ "sections": [...] }`. All result paths are
208
+ relative to the returned Agent directory.
209
+
210
+ Submit an ordered completed prefix. The CLI saves one page at a time and stops at
211
+ Review, changed inputs, new reading requirements or a failed page. Follow the
212
+ returned Route. If a page fails, correct it and submit only the unfinished suffix
213
+ with the current Route revision and original input tokens. If inputs changed,
214
+ prepare again and reconcile the drafts. Never resubmit a committed page; uncertain
215
+ transactions must use the returned recovery action first.
216
+
217
+ For long submission loops, report completed/total progress using temporary files.
218
+ Use the host's recoverable background execution when available, otherwise allow
219
+ sufficient foreground timeout. Wait for the running command rather than repeatedly
220
+ polling through model turns. Do not modify knowledge inputs during a write.
@@ -48,8 +48,10 @@ bounded batch; keep the decisions in the current Agent context and do not write
48
48
  a Review ledger. Use the current scope template in that index with the Route's
49
49
  atomic apply command. Add explicit decisions only for reviewed pages; leave
50
50
  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
51
+ reviewed acceptable set, default approval remains available. The apply command preserves the standard HTML report before applying decisions
52
+ and returns its path. Use that report when the user requests a report or diff;
53
+ the managed reading surface remains the Markdown Resource, so do not parse the
54
+ HTML to make automated decisions. Reopen repair pages through their
53
55
  current repair command; unrelated approvals remain valid. The
54
56
  authority exists only in the current conversation. It does not bypass source
55
57
  permission, validation, close, or verify, and it is not proof that the files
@@ -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
@@ -18,13 +18,30 @@ omit `instruction` if no correction is needed, or describe the concrete change
18
18
  to make. Preserve unrelated content and the reader's existing improvements.
19
19
  Include a short `scope_summary` explaining the scope-level conclusion.
20
20
  When the action lists `changed_references`, start from those sections: the
21
- cited text changed (`changed`) or could not be read (`unavailable`, such as a
22
- renamed or deleted file). For `context update --pending`, pages whose citations
21
+ cited block was not found (`not-found`), has multiple matches (`ambiguous`), or
22
+ cannot be checked from the available snapshot (`unavailable`). A transient read
23
+ failure is a failed observation, not a reason to revise an article. For explicit
24
+ updates and `context update --pending`, pages whose citations
23
25
  are unchanged or only moved are not candidates, so an empty list is possible;
24
26
  still check the change for additions before submitting the scope decision.
25
27
  Those pages are listed in `scope_pages`: they need no decision, but include one
26
28
  with an `instruction` when an addition or shared change affects it.
27
29
 
30
+ Follow each changed reference's `evidence_ref` into `reference_evidence` for
31
+ digest-verified historical text and the current excerpt. Missing history is
32
+ explicitly marked unavailable. The current excerpt is from the old position
33
+ or nearby lines, not a claimed replacement; only a `format_only_proposals`
34
+ entry supplies a mapped replacement for your decision.
35
+
36
+ When `format_only_proposals` is present, compare every proposed old/new region.
37
+ Only if the document's changes preserve meaning, keep the affected page bodies
38
+ and submit `format_only: [{source_ref: "<proposed source>", reason: "<why the changes are only formatting>"}]`.
39
+ Keep those pages in `decisions` without an instruction. The CLI supplies and
40
+ validates new locations; do not guess line numbers. Removed strikethrough, changed
41
+ link targets or a restored table may change meaning even if the text looks similar.
42
+ If any mapping is missing or uncertain, use normal revision. A format-only
43
+ decision does not authorize publication or suppress unrelated version changes.
44
+
28
45
  Also inspect additions and shared dependencies in the source change. Existing
29
46
  page references cannot discover every new topic. List necessary new pages in `new_topics`, each with a readable `path` in an existing
30
47
  collection, `title`, registered `source_refs` and an `instruction` describing the
@@ -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.
@@ -21,6 +21,27 @@
21
21
  "type": "string",
22
22
  "const": "source-update"
23
23
  },
24
+ "format_only": {
25
+ "type": "array",
26
+ "items": {
27
+ "type": "object",
28
+ "properties": {
29
+ "source_ref": {
30
+ "type": "string",
31
+ "minLength": 1
32
+ },
33
+ "reason": {
34
+ "type": "string",
35
+ "minLength": 1
36
+ }
37
+ },
38
+ "required": [
39
+ "source_ref",
40
+ "reason"
41
+ ],
42
+ "additionalProperties": false
43
+ }
44
+ },
24
45
  "decisions": {
25
46
  "type": "array",
26
47
  "items": {
@@ -28,3 +28,34 @@ Review and conflict-recovery routes; acceptance does not approve publication.
28
28
  If the next preparation fails after acceptance, use its recovery command without
29
29
  repeating saved content. An unfinished production stage can remain suspended
30
30
  while this maintenance action runs; do not replace or clear its tasks.
31
+
32
+ After a successful submission, follow `next_route.inline`, or read
33
+ `next_route.file` once when no inline Route is present. Do not insert another
34
+ status call. Refresh status only after a failure, a missing next Route, or an
35
+ external workspace change. A driver loop must bind each prepared result to its
36
+ issued task inputs, use the returned Route revision, and stop when the node
37
+ changes or a new reading or human gate is required.
38
+
39
+ Minimal driver flow (pseudocode):
40
+
41
+ ```text
42
+ route = initial_route
43
+ while route.node == initial_node and no_new_read_or_confirmation_gate(route):
44
+ result = submit(input_bound_to(route), revision=route.revision)
45
+ if result_failed(result): follow_returned_recovery(result); break
46
+ if result.next_route is missing: refresh_status_once(); break
47
+ route = result.next_route.inline or read_once(result.next_route.file)
48
+ ```
49
+
50
+ Use preview only when someone will read the assembled Markdown before deciding
51
+ to submit; unattended loops submit directly. On failure, follow the returned
52
+ submission state and recovery action: correct uncommitted input, continue after
53
+ committed work, or recover an uncertain transaction before deciding to retry.
54
+
55
+ For writes expected to exceed a minute, use a recoverable background task when
56
+ the host supports one; otherwise allow sufficient foreground timeout. Prefer a
57
+ bounded wait based on remaining work over repeated model polling. Long loops
58
+ write completed/total progress under `.tmp` and report that progress to the user.
59
+ Do not change knowledge inputs during build, version recording or review apply.
60
+ Use the standard `context review html` report for review and requested diffs;
61
+ generate it before requesting confirmation. Managed approval also produces it.