@c4a/context-cli 0.7.92 → 0.7.94

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 (60) hide show
  1. package/README.md +11 -3
  2. package/README.zh-CN.md +4 -2
  3. package/cli.js +19490 -18500
  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 +1 -1
  13. package/indexers/bundles/context-code-indexer/templates/data-sync-reconciliation.md +1 -1
  14. package/indexers/bundles/context-markdown-indexer/references/indexer.md +1 -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 +1 -1
  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 +131 -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 +131 -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 +131 -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 +131 -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 +1 -1
  44. package/plugins/skills/context-code-indexer/templates/data-sync-reconciliation.md +1 -1
  45. package/plugins/skills/context-markdown-indexer/references/indexer.md +1 -1
  46. package/providers/context/manifest.json +24 -24
  47. package/providers/context/provider.yaml +1 -1
  48. package/providers/context/resources/manuals/guides/code-indexer-skill-authoring.md +1 -1
  49. package/providers/context/resources/manuals/guides/knowledge-updates.md +22 -7
  50. package/providers/context/resources/manuals/guides/markdown-indexer-skill-authoring.md +1 -1
  51. package/providers/context/resources/manuals/guides/site-translation.md +13 -3
  52. package/providers/context/resources/manuals/reference/package-templates.md +1 -1
  53. package/providers/context/resources/procedures/approved-revision.md +19 -4
  54. package/providers/context/resources/procedures/knowledge-maintenance.md +16 -0
  55. package/providers/context/resources/procedures/knowledge-review.md +17 -6
  56. package/providers/context/resources/procedures/knowledge-updates.md +22 -7
  57. package/providers/context/resources/procedures/production-stage-files.md +2 -2
  58. package/providers/context/resources/procedures/source-update.md +4 -2
  59. package/providers/context/skills/run-indexer-agent-step/SKILL.md +3 -1
  60. package/providers/context/skills/translate-site-locales/SKILL.md +8 -2
@@ -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,15 @@ 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
+
161
176
  Preview is useful only when its assembled text will be read before deciding to
162
177
  submit. An unattended loop submits directly. Continue from the receipt's
163
178
  `next_route.inline`, or read `next_route.file` once; do not routinely run status
@@ -193,7 +208,7 @@ same-level or higher-level heading. A quote is an exact, unique, nonempty
193
208
  substring (line endings are normalized). Ambiguous matches return candidate
194
209
  line ranges. Both forms resolve against authorized captured text before hashing;
195
210
  stored references still contain only `path`, `start_line` and `end_line`.
196
- The per-fragment limits (three source files, eight regions) apply after
211
+ The per-fragment limits (five source files, eight regions) apply after
197
212
  resolving and deduplicating positions.
198
213
 
199
214
  ## Submitting several prewritten pages
@@ -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
@@ -63,9 +67,11 @@ Do not persist a duplicate review-report ledger in the workspace.
63
67
  For restructuring, compare replacement content with the affected approved pages:
64
68
  useful conditions, steps and explanations must have a destination before removal.
65
69
  Review omission rejects a candidate; it does not retire an approved article.
66
- Pure retirement does not enter this HTML report. Use the explicit retirement
67
- preview after replacement delivery, and repair its
68
- 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
69
75
  from search or packages. A renamed menu does not require a new article identity.
70
76
 
71
77
  Before requesting human review, follow the report's navigation diagnostics.
@@ -103,7 +109,12 @@ the correction instruction. Current candidates are repaired within this batch;
103
109
  `--regenerate` schedules program regeneration for approved pages. If supplied
104
110
  for a current candidate, follow the CLI's returned repair command instead.
105
111
  After the repair, read the new Route and review the changed material before
106
- 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.
107
118
 
108
119
  For a repaired generated table, inspect the new Candidate's affected rows, not
109
120
  only its Repair ID or accepted Author/Composer outcome. Check the reported error
@@ -176,7 +176,9 @@ The CLI updates `package.json`, `changelog.yaml` and generated `CHANGELOG.md` to
176
176
  `context version inspect --base <commit-or-tag> --format json` compares the actual
177
177
  workspace files with Git, including untracked files. Without an explicit base it
178
178
  uses the current version's `v<version>` tag when available, otherwise HEAD; HEAD
179
- is not proof of publication. Review article bodies, assets, structure, navigation
179
+ is not proof of publication. A workspace kept in a subdirectory of a larger
180
+ repository compares only that directory and defaults to HEAD, because the
181
+ repository's tags are not workspace versions. Review article bodies, assets, structure, navigation
180
182
  and templates, not structure alone. Without Git, inspection reports local files.
181
183
  A disposable `.tmp` checkpoint suppresses repeated recording in an uncommitted
182
184
  iteration. Losing it does not lose knowledge or prove a new publication.
@@ -344,7 +346,7 @@ changing structure, adding a page or when a section has no unambiguous ID.
344
346
  To change a fragment's citations, include `references` alongside its `section_id`:
345
347
  each entry supplies `source_ref` and `locator` (`path`, `start_line`, `end_line`).
346
348
  Context computes the region fingerprint. This uses the same revision submission,
347
- with at most three source files and eight regions per fragment. Full Markdown may include a
349
+ with at most five source files and eight regions per fragment. Full Markdown may include a
348
350
  `sections` list of reference edits; local section edits may change content,
349
351
  references, or both. Omission preserves citations; an empty list removes them.
350
352
 
@@ -663,8 +665,17 @@ page-level incoming Markdown links to explicit replacements, and rebinds page
663
665
  navigation or removes retired navigation targets while retaining groups.
664
666
  Repair fragment links explicitly first: the CLI cannot infer where a split moved
665
667
  a paragraph. Without a replacement, repair incoming links before applying.
666
- Finish active drafts/revisions first; unfinished production targeting a selected
667
- page must be finished or amended rather than discarded.
668
+ While a revision batch is active and not yet approved, the same command schedules
669
+ the retirement in that batch instead. Its preview lists the follow-up by the entry
670
+ that handles it: pages whose links to the retired page need updating (they join
671
+ the batch), navigation entries that will point to the replacement and keep their
672
+ label or be removed (adjust labels with `context task adjust` if needed), and
673
+ translations that become orphaned (the translation step removes them). The
674
+ retired page's own unfinished draft is dropped; the replacement may be a page new
675
+ in this batch. Nothing is deleted until the batch's final Review apply, which
676
+ computes the retirement on the final drafts in the same write as the approved
677
+ pages. Once a batch is approved, finish its delivery first; unfinished production
678
+ targeting a selected page must be finished or amended rather than discarded.
668
679
 
669
680
  Follow status and the normal close/version/build flow before delivery. Sources
670
681
  and shared assets are not deleted. The response provides a temporary restore
@@ -688,7 +699,11 @@ approved-page revision or source-update queue. Keep `scopes` and `instruction`
688
699
  explicit. First call without `refresh`; it authorizes replacing only those
689
700
  inputs and blocks page completion while acquisition is pending. Import the
690
701
  selected new material, then repeat with `refresh: true` to bind the actual local
691
- versions and obtain the new Route. Do not submit the old revision. Current
702
+ versions and obtain the new Route. When every selected source is newly added to
703
+ the task and its material is already local (an imported document, or a repository
704
+ at the commit the delivered knowledge already uses), the first call completes the
705
+ adjustment and returns `adjusted` with `acquisition: already-available`; do not
706
+ repeat it. Do not submit the old revision. Current
692
707
  prose and queued pages remain; an affected draft returns to writing/review.
693
708
  An unrelated queued page does not revoke an unchanged current page's review.
694
709
  If a page has already been applied, finish its close/build before changing its
@@ -717,7 +732,7 @@ Revision section edits may supply `references` as `source_ref` plus a
717
732
  `locator` containing `path`, `start_line`, and `end_line`. Context computes the
718
733
  regional digest. Omitted references preserve the current fragment's citations;
719
734
  an explicit empty list removes them, and deleting a fragment removes its
720
- citations. Each fragment may cite at most three source files and eight regions. Register and
735
+ citations. Each fragment may cite at most five source files and eight regions. Register and
721
736
  authorize new material before citing it, then follow normal Review, close and
722
737
  build. Article links alone do not authorize reading new sources or prove a claim.
723
738
 
@@ -731,5 +746,5 @@ same-level or higher-level heading. A quote is an exact, unique, nonempty
731
746
  substring (line endings are normalized). Ambiguous matches return candidate
732
747
  line ranges. Both forms resolve against authorized captured text before hashing;
733
748
  stored references still contain only `path`, `start_line` and `end_line`.
734
- The per-fragment limits (three source files, eight regions) apply after
749
+ The per-fragment limits (five source files, eight regions) apply after
735
750
  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.
@@ -27,8 +27,10 @@ still check the change for additions before submitting the scope decision.
27
27
  Those pages are listed in `scope_pages`: they need no decision, but include one
28
28
  with an `instruction` when an addition or shared change affects it.
29
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
30
+ Follow each changed reference's `evidence_ref` into the JSON array in
31
+ `reference_evidence_file` (`reference_evidence_count` entries) for
32
+ digest-verified historical text and the current excerpt. Read only the entries
33
+ for references you are deciding; the Route does not repeat them inline. Missing history is
32
34
  explicitly marked unavailable. The current excerpt is from the old position
33
35
  or nearby lines, not a claimed replacement; only a `format_only_proposals`
34
36
  entry supplies a mapped replacement for your decision.
@@ -48,7 +48,9 @@ while route.node == initial_node and no_new_read_or_confirmation_gate(route):
48
48
  ```
49
49
 
50
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
51
+ to submit; unattended loops submit directly. A prepared multi-page batch is the
52
+ exception: preview the whole batch once before submitting it, since that one
53
+ call checks every page without saving drafts or task state. On failure, follow the returned
52
54
  submission state and recovery action: correct uncommitted input, continue after
53
55
  committed work, or recover an uncertain transaction before deciding to retry.
54
56
 
@@ -3,7 +3,9 @@ name: translate-site-locales
3
3
  description: Translate approved knowledge for the website locales declared in site.locales when the workspace Route selects this action.
4
4
  ---
5
5
 
6
- Run `context translate prepare --format json`. The task lists every article and
6
+ Run `context translate prepare --format json`. When nothing needs translating
7
+ and only translations of removed pages remain, it deletes them and returns
8
+ `outcome: orphans-removed`; continue with the returned Route. Otherwise the task lists every article and
7
9
  knowledge map title that is missing or stale for each declared locale, with the
8
10
  `expected_digest` to submit. Approved knowledge in the primary language remains
9
11
  the only source of truth; translations never change it.
@@ -21,7 +23,11 @@ approved article before submitting. Keep the translation's structure exactly:
21
23
  `txt`, and `plaintext` blocks, preserving commands, paths and placeholders such
22
24
  as `<repository>`. Mermaid labels may be translated. Keep content unchanged
23
25
  in every other block, including blocks without a language marker;
24
- - keep every link target unchanged; translate link labels only;
26
+ - keep every link target unchanged; translate link labels only. A link to a
27
+ heading anchor (for example `guide.md#install-the-cli`) does not exist in
28
+ other languages; keep it unchanged here, and after this step correct the
29
+ original link to the target's section ID with
30
+ `context revise <path> --instruction <correction>`;
25
31
  - keep product names, commands, file paths, identifiers and API names as written.
26
32
 
27
33
  Translate knowledge map titles as short navigation labels. Submit with