@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
@@ -18,13 +18,32 @@ 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 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
34
+ explicitly marked unavailable. The current excerpt is from the old position
35
+ or nearby lines, not a claimed replacement; only a `format_only_proposals`
36
+ entry supplies a mapped replacement for your decision.
37
+
38
+ When `format_only_proposals` is present, compare every proposed old/new region.
39
+ Only if the document's changes preserve meaning, keep the affected page bodies
40
+ and submit `format_only: [{source_ref: "<proposed source>", reason: "<why the changes are only formatting>"}]`.
41
+ Keep those pages in `decisions` without an instruction. The CLI supplies and
42
+ validates new locations; do not guess line numbers. Removed strikethrough, changed
43
+ link targets or a restored table may change meaning even if the text looks similar.
44
+ If any mapping is missing or uncertain, use normal revision. A format-only
45
+ decision does not authorize publication or suppress unrelated version changes.
46
+
28
47
  Also inspect additions and shared dependencies in the source change. Existing
29
48
  page references cannot discover every new topic. List necessary new pages in `new_topics`, each with a readable `path` in an existing
30
49
  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,36 @@ 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. 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
54
+ submission state and recovery action: correct uncommitted input, continue after
55
+ committed work, or recover an uncertain transaction before deciding to retry.
56
+
57
+ For writes expected to exceed a minute, use a recoverable background task when
58
+ the host supports one; otherwise allow sufficient foreground timeout. Prefer a
59
+ bounded wait based on remaining work over repeated model polling. Long loops
60
+ write completed/total progress under `.tmp` and report that progress to the user.
61
+ Do not change knowledge inputs during build, version recording or review apply.
62
+ Use the standard `context review html` report for review and requested diffs;
63
+ generate it before requesting confirmation. Managed approval also produces it.
@@ -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.