@c4a/context-cli 0.7.70 → 0.7.71

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 (45) hide show
  1. package/README.md +9 -0
  2. package/README.zh-CN.md +2 -0
  3. package/cli.js +2564 -2589
  4. package/indexers/bundles/context-code-indexer/references/composers/contracts-and-chains.md +2 -2
  5. package/indexers/bundles/context-code-indexer/references/composers/cross-module-chain.md +2 -2
  6. package/indexers/bundles/context-code-indexer/references/composers/development-and-delivery.md +2 -2
  7. package/indexers/bundles/context-code-indexer/references/composers/event-flow.md +2 -2
  8. package/indexers/bundles/context-code-indexer/references/composers/examples-and-documentation.md +2 -2
  9. package/indexers/bundles/context-code-indexer/references/composers/persistence-boundary.md +2 -2
  10. package/indexers/bundles/context-code-indexer/references/composers/protocol-boundary.md +2 -2
  11. package/indexers/bundles/context-code-indexer/references/composers/public-contract.md +2 -2
  12. package/indexers/bundles/context-code-indexer/references/indexer.md +2 -2
  13. package/indexers/bundles/context-code-indexer/templates/data-sync-reconciliation.md +2 -1
  14. package/indexers/bundles/context-markdown-indexer/references/indexer.md +2 -2
  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 +23 -11
  19. package/plugins/VERSION +1 -1
  20. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  21. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  22. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  23. package/plugins/skills/context-code-indexer/references/composers/contracts-and-chains.md +2 -2
  24. package/plugins/skills/context-code-indexer/references/composers/cross-module-chain.md +2 -2
  25. package/plugins/skills/context-code-indexer/references/composers/development-and-delivery.md +2 -2
  26. package/plugins/skills/context-code-indexer/references/composers/event-flow.md +2 -2
  27. package/plugins/skills/context-code-indexer/references/composers/examples-and-documentation.md +2 -2
  28. package/plugins/skills/context-code-indexer/references/composers/persistence-boundary.md +2 -2
  29. package/plugins/skills/context-code-indexer/references/composers/protocol-boundary.md +2 -2
  30. package/plugins/skills/context-code-indexer/references/composers/public-contract.md +2 -2
  31. package/plugins/skills/context-code-indexer/references/indexer.md +2 -2
  32. package/plugins/skills/context-code-indexer/templates/data-sync-reconciliation.md +2 -1
  33. package/plugins/skills/context-markdown-indexer/references/indexer.md +2 -2
  34. package/providers/context/manifest.json +19 -19
  35. package/providers/context/provider.yaml +1 -1
  36. package/providers/context/resources/manuals/guides/code-indexer-skill-authoring.md +2 -1
  37. package/providers/context/resources/manuals/guides/knowledge-updates.md +7 -5
  38. package/providers/context/resources/manuals/guides/markdown-indexer-skill-authoring.md +1 -1
  39. package/providers/context/resources/manuals/guides/site-translation.md +19 -18
  40. package/providers/context/resources/manuals/reference/package-templates.md +2 -2
  41. package/providers/context/resources/procedures/approved-revision.md +8 -4
  42. package/providers/context/resources/procedures/knowledge-updates.md +7 -5
  43. package/providers/context/resources/procedures/production-stage-files.md +6 -4
  44. package/providers/context/resources/procedures/source-update.md +7 -0
  45. package/providers/context/skills/translate-site-locales/SKILL.md +6 -7
@@ -80,23 +80,24 @@ shows the original with a notice. Navigation titles without a translation use
80
80
  the translated article title, then the primary title. Site search covers every
81
81
  language; opening a result in another language switches to it.
82
82
 
83
-
84
83
  ## Incremental drafts
85
84
 
86
- `prepare` returns section changes, title/description changes, exterior-text changes
87
- (including the article tail), and section order changes. It writes draft files
88
- and a `submission_path` template. Unchanged parts retain their translation;
89
- changed parts contain the current primary-language text for the Agent to translate.
90
- Review every pending part before submitting; generated source text is not a translation.
91
-
92
- Older current translations acquire source-part baselines without changing their
93
- reader text. Older stale translations report `diff: unknown` and get a full source
94
- draft plus a `.previous.md` translation for comparison.
95
-
96
- Repeated preparation preserves edited drafts. `draft: rebase-required` means the
97
- source changed while a draft was being edited; that draft is excluded from the
98
- submission template. Reconcile it with the current source, then explicitly add
99
- the returned `source_digest` to that article's submission entry. Never copy a new
100
- digest onto an unreconciled draft. Ordinary submissions still use `expected_digest`.
101
- A draft without a generation record, such as one left by an older workflow, is
102
- kept as `unrecorded_draft` beside a freshly generated draft.
85
+ `prepare` writes a draft for each pending article and a `submission_path`
86
+ template. A stale article's draft is its current translation; a missing
87
+ article's draft is the approved source. When Git history contains the approved
88
+ version the translation was made from, `source_diff` names a diff from that
89
+ version to the current article. Without such history `source_diff` is `null`;
90
+ compare the draft with the whole approved article. Update only what changed and
91
+ submit the draft. History is missing, for example, when several approve and
92
+ translate rounds ran without a commit in between: the version each translation
93
+ was made from was never recorded. Committing approved knowledge and translations
94
+ after a round lets the next generated draft carry a diff; it does not guarantee
95
+ one, because a kept draft never has a diff.
96
+
97
+ An existing edited draft is kept (`draft: kept`) as unfinished work, with
98
+ `source_diff: null`; a draft whose body is still the unedited starting text is
99
+ regenerated with its diff. A kept draft has no diff because the source may have
100
+ changed again, even back, since it was written, so align the whole draft with
101
+ the current approved article. Delete it
102
+ to start again from the current translation. Successful submission removes the
103
+ drafts and diffs it saved.
@@ -316,8 +316,8 @@ Approved Markdown under `knowledge/` and the article index in
316
316
  and fragment `sections` with their region `references`.
317
317
  - Markdown fragment markers contain only their stable ID:
318
318
  `<!-- context:section id="usage" -->` and `<!-- /context:section -->`.
319
- Structure records each corresponding ID and at most three source positions
320
- per fragment, not three per article.
319
+ Structure records each corresponding ID and its source positions: at most
320
+ three distinct source files and eight regions per fragment, not per article.
321
321
  - A reference contains `source_ref`, `locator: { path, start_line, end_line }`
322
322
  and the Host-computed regional `content_digest`. Do not duplicate this in
323
323
  Markdown frontmatter or comments.
@@ -34,6 +34,8 @@ association. Then retry the same `task adjust` without refresh and, once materia
34
34
  is available, with `refresh: true`; reread the resulting revision. Do not invent
35
35
  module references, replace an older note, delete sources or clear the task to
36
36
  satisfy this boundary. Already imported material does not need to be imported again.
37
+ The adjusted source stays citable by the remaining pages queued in the same revision;
38
+ repeating the adjustment for an unchanged source keeps already prepared pages.
37
39
  A managed-source `base_digest` protects file replacement from conflicts; it is not
38
40
  source-scope authorization and is not interchangeable with a snapshot hash.
39
41
 
@@ -137,7 +139,7 @@ Action schema and the same source and baseline validation.
137
139
 
138
140
  When a fragment's support changes, include `references` with its actual
139
141
  `source_ref` and `locator` (`path`, `start_line`, `end_line`). Each fragment allows
140
- up to three positions; Context reads the captured region and computes its digest.
142
+ regions from up to three source files, eight regions in total; Context reads the captured region and computes its digest.
141
143
  For full Markdown, optional `sections` contains only `{ section_id, references }`
142
144
  entries; for local edits it can accompany `content` or update references alone.
143
145
  An explicit empty list removes that fragment's citations. Deleted fragments lose
@@ -174,10 +176,12 @@ accepted tasks or an empty Composer result alone do not demonstrate a correction
174
176
  ### Locating submitted references
175
177
 
176
178
  Submission locators also accept `{path, heading}` or `{path, quote}` instead of
177
- line numbers. Use exactly one form. A heading matches an exact ATX heading
178
- outside code fences in a Markdown source; its region ends before the next
179
+ line numbers. Use exactly one form. A heading is the title text of an exact ATX heading
180
+ outside code fences in a Markdown source; a leading `##` marker is optional and,
181
+ when present, also selects the heading level; its region ends before the next
179
182
  same-level or higher-level heading. A quote is an exact, unique, nonempty
180
183
  substring (line endings are normalized). Ambiguous matches return candidate
181
184
  line ranges. Both forms resolve against authorized captured text before hashing;
182
185
  stored references still contain only `path`, `start_line` and `end_line`.
183
- The three-region limit applies after resolving and deduplicating positions.
186
+ The per-fragment limits (three source files, eight regions) apply after
187
+ resolving and deduplicating positions.
@@ -338,7 +338,7 @@ changing structure, adding a page or when a section has no unambiguous ID.
338
338
  To change a fragment's citations, include `references` alongside its `section_id`:
339
339
  each entry supplies `source_ref` and `locator` (`path`, `start_line`, `end_line`).
340
340
  Context computes the region fingerprint. This uses the same revision submission,
341
- with at most three source positions per fragment. Full Markdown may include a
341
+ with at most three source files and eight regions per fragment. Full Markdown may include a
342
342
  `sections` list of reference edits; local section edits may change content,
343
343
  references, or both. Omission preserves citations; an empty list removes them.
344
344
 
@@ -703,17 +703,19 @@ Revision section edits may supply `references` as `source_ref` plus a
703
703
  `locator` containing `path`, `start_line`, and `end_line`. Context computes the
704
704
  regional digest. Omitted references preserve the current fragment's citations;
705
705
  an explicit empty list removes them, and deleting a fragment removes its
706
- citations. Each fragment may cite at most three source positions. Register and
706
+ citations. Each fragment may cite at most three source files and eight regions. Register and
707
707
  authorize new material before citing it, then follow normal Review, close and
708
708
  build. Article links alone do not authorize reading new sources or prove a claim.
709
709
 
710
710
  ### Locating submitted references
711
711
 
712
712
  Submission locators also accept `{path, heading}` or `{path, quote}` instead of
713
- line numbers. Use exactly one form. A heading matches an exact ATX heading
714
- outside code fences in a Markdown source; its region ends before the next
713
+ line numbers. Use exactly one form. A heading is the title text of an exact ATX heading
714
+ outside code fences in a Markdown source; a leading `##` marker is optional and,
715
+ when present, also selects the heading level; its region ends before the next
715
716
  same-level or higher-level heading. A quote is an exact, unique, nonempty
716
717
  substring (line endings are normalized). Ambiguous matches return candidate
717
718
  line ranges. Both forms resolve against authorized captured text before hashing;
718
719
  stored references still contain only `path`, `start_line` and `end_line`.
719
- The three-region limit applies after resolving and deduplicating positions.
720
+ The per-fragment limits (three source files, eight regions) apply after
721
+ resolving and deduplicating positions.
@@ -70,7 +70,7 @@ 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
72
  text. CLI computes source digests. A fragment may cite at most three distinct
73
- source positions; an article may have multiple fragments.
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
76
76
  exact repository-relative path, or the unique name of its directory such as a
@@ -108,10 +108,12 @@ Partial delivery must include the approved articles needed by its local links.
108
108
  ### Locating submitted references
109
109
 
110
110
  Submission locators also accept `{path, heading}` or `{path, quote}` instead of
111
- line numbers. Use exactly one form. A heading matches an exact ATX heading
112
- outside code fences in a Markdown source; its region ends before the next
111
+ line numbers. Use exactly one form. A heading is the title text of an exact ATX heading
112
+ outside code fences in a Markdown source; a leading `##` marker is optional and,
113
+ when present, also selects the heading level; its region ends before the next
113
114
  same-level or higher-level heading. A quote is an exact, unique, nonempty
114
115
  substring (line endings are normalized). Ambiguous matches return candidate
115
116
  line ranges. Both forms resolve against authorized captured text before hashing;
116
117
  stored references still contain only `path`, `start_line` and `end_line`.
117
- The three-region limit applies after resolving and deduplicating positions.
118
+ The per-fragment limits (three source files, eight regions) apply after
119
+ resolving and deduplicating positions.
@@ -26,6 +26,13 @@ Use an empty list only when existing pages cover the change or the additions
26
26
  are outside the confirmed purpose. New pages go through the same writing and
27
27
  review process as revisions; a new topic is not a no-change decision.
28
28
 
29
+ A kept page's citations whose text only moved in the updated source are
30
+ relocated when the update settles. When cited text changed or cannot be
31
+ confirmed, the completion result lists it in `reference_warnings`; those
32
+ citations keep their previous locations. The warning is a receipt for the
33
+ accepted decision, not a request to resubmit it: after the current update queue
34
+ finishes, run `context revise` on each listed page that needs a correction.
35
+
29
36
  The CLI keeps the previous processed version until every requested page has
30
37
  been approved, closed and built. If temporary progress is lost, inspect again
31
38
  from that version and preserve the pages already approved. A saved report or
@@ -8,13 +8,12 @@ knowledge map title that is missing or stale for each declared locale, with the
8
8
  `expected_digest` to submit. Approved knowledge in the primary language remains
9
9
  the only source of truth; translations never change it.
10
10
 
11
- Use the returned draft and submission paths. Preserve unchanged translated parts
12
- and translate the listed changes in a natural tone. For `diff: unknown`, compare
13
- with the previous translation. A `rebase-required` draft must be reconciled with
14
- the current source before explicitly confirming its `source_digest`.
15
-
16
- For each article, read the approved file and write a complete translation to a
17
- temporary file under `.tmp/agent-payloads/`. Keep its structure exactly:
11
+ Edit each returned draft `file` and submit the returned `submission_path`. With
12
+ `draft: generated`, a stale article's draft is its current translation; when
13
+ `source_diff` is a path, apply those source changes. A missing article's draft
14
+ is the approved source to translate in a natural tone. With `draft: kept`, or
15
+ whenever `source_diff` is `null`, align the whole draft with the current
16
+ approved article before submitting. Keep the translation's structure exactly:
18
17
 
19
18
  - frontmatter contains only a translated `title` and optional `description`;
20
19
  - keep every `context:section` marker, id and order unchanged;