@c4a/context-cli 0.7.10-alpha.1 → 0.7.10

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 (49) hide show
  1. package/cli.js +1154 -754
  2. package/indexers/bundles/context-code-indexer/references/indexer.md +14 -0
  3. package/indexers/bundles/context-code-indexer/templates/adapter-integration.md +1 -1
  4. package/indexers/bundles/context-code-indexer/templates/api-service.md +1 -1
  5. package/indexers/bundles/context-code-indexer/templates/background-runtime.md +1 -1
  6. package/indexers/bundles/context-code-indexer/templates/cli-tool.md +1 -1
  7. package/indexers/bundles/context-code-indexer/templates/component-library.md +4 -4
  8. package/indexers/bundles/context-code-indexer/templates/contract-source.md +1 -1
  9. package/indexers/bundles/context-code-indexer/templates/data-sync-reconciliation.md +6 -8
  10. package/indexers/bundles/context-code-indexer/templates/domain-service.md +1 -1
  11. package/indexers/bundles/context-code-indexer/templates/monorepo-container.md +1 -1
  12. package/indexers/bundles/context-code-indexer/templates/sdk-library.md +1 -2
  13. package/indexers/bundles/context-code-indexer/templates/web-application.md +1 -1
  14. package/indexers/contracts/profile-contract.json +245 -245
  15. package/indexers/release-manifest.json +14 -14
  16. package/package.json +12 -12
  17. package/parserEntryWorker.js +17 -8
  18. package/plugins/VERSION +1 -1
  19. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  20. package/plugins/claude/commands/context.md +37 -73
  21. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  22. package/plugins/codex/skills/context/SKILL.md +37 -73
  23. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  24. package/plugins/cursor/commands/c4a-context.md +37 -73
  25. package/plugins/skills/context/SKILL.md +37 -73
  26. package/plugins/skills/context-code-indexer/references/indexer.md +14 -0
  27. package/plugins/skills/context-code-indexer/templates/adapter-integration.md +1 -1
  28. package/plugins/skills/context-code-indexer/templates/api-service.md +1 -1
  29. package/plugins/skills/context-code-indexer/templates/background-runtime.md +1 -1
  30. package/plugins/skills/context-code-indexer/templates/cli-tool.md +1 -1
  31. package/plugins/skills/context-code-indexer/templates/component-library.md +4 -4
  32. package/plugins/skills/context-code-indexer/templates/contract-source.md +1 -1
  33. package/plugins/skills/context-code-indexer/templates/data-sync-reconciliation.md +6 -8
  34. package/plugins/skills/context-code-indexer/templates/domain-service.md +1 -1
  35. package/plugins/skills/context-code-indexer/templates/monorepo-container.md +1 -1
  36. package/plugins/skills/context-code-indexer/templates/sdk-library.md +1 -2
  37. package/plugins/skills/context-code-indexer/templates/web-application.md +1 -1
  38. package/providers/context/manifest.json +20 -20
  39. package/providers/context/provider.yaml +1 -1
  40. package/providers/context/resources/manuals/guides/indexer-provider-and-customization.md +0 -2
  41. package/providers/context/resources/manuals/guides/knowledge-updates.md +28 -2
  42. package/providers/context/resources/manuals/guides/workspace-prepare.md +17 -0
  43. package/providers/context/resources/manuals/reference/project-api.md +37 -17
  44. package/providers/context/resources/procedures/close-and-build.md +21 -0
  45. package/providers/context/resources/procedures/knowledge-updates.md +28 -2
  46. package/providers/context/resources/procedures/production-stage-files.md +14 -0
  47. package/providers/context/resources/procedures/source-capture-detailed.md +16 -2
  48. package/providers/context/resources/procedures/work-start-report.md +10 -4
  49. package/providers/context/resources/procedures/workspace-prepare.md +17 -0
@@ -2,7 +2,7 @@
2
2
  "schema": "agent-graph.bundle.v1",
3
3
  "provider": {
4
4
  "id": "c4a/context",
5
- "version": "0.7.10-alpha.1"
5
+ "version": "0.7.10"
6
6
  },
7
7
  "providerManifest": "provider.yaml",
8
8
  "graphs": [
@@ -208,7 +208,7 @@
208
208
  {
209
209
  "id": "context.sdk.project-api",
210
210
  "path": "resources/manuals/reference/project-api.md",
211
- "digest": "sha256:c885675aa4c31b6c4b765498dd31517d4851b663636c50cfe538217af20c3148"
211
+ "digest": "sha256:2a6f4d9856827c5699226216579153b163e184f8c5dec6c9660c859966a3de8d"
212
212
  },
213
213
  {
214
214
  "id": "context.sdk.template-variables",
@@ -293,7 +293,7 @@
293
293
  {
294
294
  "id": "procedure.close-and-build",
295
295
  "path": "resources/procedures/close-and-build.md",
296
- "digest": "sha256:397e4e426cc86777e6f34cd22391e8f32785be765714762a908669eeadbb06e9"
296
+ "digest": "sha256:c2f39abc2867e73a529ded2e475276738f62a4b61811b7792a49d6e358865a74"
297
297
  },
298
298
  {
299
299
  "id": "procedure.document-capture",
@@ -318,7 +318,7 @@
318
318
  {
319
319
  "id": "procedure.knowledge-updates",
320
320
  "path": "resources/procedures/knowledge-updates.md",
321
- "digest": "sha256:cccbd04d452b4c4b5e6661d8d26f449ab4a1476201763a94bc1b1085fe9fc8cb"
321
+ "digest": "sha256:509c083ee40e96465396ea7ee8281cf18837a669f0882def19d55abc05ce86a7"
322
322
  },
323
323
  {
324
324
  "id": "procedure.note",
@@ -343,7 +343,7 @@
343
343
  {
344
344
  "id": "procedure.production-stage-files",
345
345
  "path": "resources/procedures/production-stage-files.md",
346
- "digest": "sha256:cfc137270976b78591b189d274f1dd7fc9576b9325914836e5254ebd7cde7ba6"
346
+ "digest": "sha256:7ac5ee8e370dd887fb1e24419adfcbe66aec174aa8ce651a1f7f763864972e73"
347
347
  },
348
348
  {
349
349
  "id": "procedure.project-configuration",
@@ -373,7 +373,7 @@
373
373
  {
374
374
  "id": "procedure.source-capture-detailed",
375
375
  "path": "resources/procedures/source-capture-detailed.md",
376
- "digest": "sha256:6d9a86e30e2c17df41850463f01e8bb02bcf2744cb10acf1bcaacb48ade9808a"
376
+ "digest": "sha256:04588ea5955c3796e867d091a0fba6fcc5d854c94805bfca4ae1fd398f5542c4"
377
377
  },
378
378
  {
379
379
  "id": "procedure.source-update",
@@ -393,7 +393,7 @@
393
393
  {
394
394
  "id": "procedure.work-start-report",
395
395
  "path": "resources/procedures/work-start-report.md",
396
- "digest": "sha256:6cf90b883205b82579a1c737350c8507513cdde48e78d8e67c35ceb0c743dac1"
396
+ "digest": "sha256:14574e9874c393f16601604eb1d460012dc7ee5da85c8228562d772407c48761"
397
397
  },
398
398
  {
399
399
  "id": "procedure.workspace-commit",
@@ -403,7 +403,7 @@
403
403
  {
404
404
  "id": "procedure.workspace-prepare",
405
405
  "path": "resources/procedures/workspace-prepare.md",
406
- "digest": "sha256:2070ad93fecb856b22e6b7183dce2262ba7ed14d117c9a3fb11ddd7433959dee"
406
+ "digest": "sha256:fdbfdeb1486c998785b41569cf6ed57c744e6265d11610d320a60ede0ebbc2c8"
407
407
  },
408
408
  {
409
409
  "id": "procedure.workspace-restore",
@@ -593,7 +593,7 @@
593
593
  },
594
594
  {
595
595
  "path": "provider.yaml",
596
- "digest": "sha256:2f1fafedc777f5040ac75f91bb4a74129987d881063229d9cc72be0ec5b698fa"
596
+ "digest": "sha256:7aa52ec56fd418284a036924f462e2ff85b4dd0d09c9ebf9598700a6fcf5ee78"
597
597
  },
598
598
  {
599
599
  "path": "resources/contracts/indexer-provider-guide.yaml",
@@ -649,11 +649,11 @@
649
649
  },
650
650
  {
651
651
  "path": "resources/manuals/guides/indexer-provider-and-customization.md",
652
- "digest": "sha256:ca719f378668df609f3e8e98847a1c14d5e49cff2acd27d11d99e69726d0d825"
652
+ "digest": "sha256:57775f65ef70e622162f526522412cd2d54fbfbdf13a303300549705d34d3ccd"
653
653
  },
654
654
  {
655
655
  "path": "resources/manuals/guides/knowledge-updates.md",
656
- "digest": "sha256:2ebadaa4a43742f8138ae50a0a06d76cabd73ccc1109c186c622a34abff0dc5b"
656
+ "digest": "sha256:117f1385d381be6420107ccd0ba399b45ad5c027d9dcdd825740bbebacd28365"
657
657
  },
658
658
  {
659
659
  "path": "resources/manuals/guides/lark-resources.md",
@@ -681,7 +681,7 @@
681
681
  },
682
682
  {
683
683
  "path": "resources/manuals/guides/workspace-prepare.md",
684
- "digest": "sha256:914b8889c4430ce5358977354088b10ab806e17ca1ad72587c3778fad7cbc09e"
684
+ "digest": "sha256:0ee9b75fc2fa3237eef2119a90f217e913297cb036a4653a12369f2b00147ad9"
685
685
  },
686
686
  {
687
687
  "path": "resources/manuals/guides/workspace-restore.md",
@@ -697,7 +697,7 @@
697
697
  },
698
698
  {
699
699
  "path": "resources/manuals/reference/project-api.md",
700
- "digest": "sha256:c885675aa4c31b6c4b765498dd31517d4851b663636c50cfe538217af20c3148"
700
+ "digest": "sha256:2a6f4d9856827c5699226216579153b163e184f8c5dec6c9660c859966a3de8d"
701
701
  },
702
702
  {
703
703
  "path": "resources/manuals/reference/template-variables.md",
@@ -709,7 +709,7 @@
709
709
  },
710
710
  {
711
711
  "path": "resources/procedures/close-and-build.md",
712
- "digest": "sha256:397e4e426cc86777e6f34cd22391e8f32785be765714762a908669eeadbb06e9"
712
+ "digest": "sha256:c2f39abc2867e73a529ded2e475276738f62a4b61811b7792a49d6e358865a74"
713
713
  },
714
714
  {
715
715
  "path": "resources/procedures/document-capture.md",
@@ -729,7 +729,7 @@
729
729
  },
730
730
  {
731
731
  "path": "resources/procedures/knowledge-updates.md",
732
- "digest": "sha256:cccbd04d452b4c4b5e6661d8d26f449ab4a1476201763a94bc1b1085fe9fc8cb"
732
+ "digest": "sha256:509c083ee40e96465396ea7ee8281cf18837a669f0882def19d55abc05ce86a7"
733
733
  },
734
734
  {
735
735
  "path": "resources/procedures/note.md",
@@ -749,7 +749,7 @@
749
749
  },
750
750
  {
751
751
  "path": "resources/procedures/production-stage-files.md",
752
- "digest": "sha256:cfc137270976b78591b189d274f1dd7fc9576b9325914836e5254ebd7cde7ba6"
752
+ "digest": "sha256:7ac5ee8e370dd887fb1e24419adfcbe66aec174aa8ce651a1f7f763864972e73"
753
753
  },
754
754
  {
755
755
  "path": "resources/procedures/project-configuration.md",
@@ -773,7 +773,7 @@
773
773
  },
774
774
  {
775
775
  "path": "resources/procedures/source-capture-detailed.md",
776
- "digest": "sha256:6d9a86e30e2c17df41850463f01e8bb02bcf2744cb10acf1bcaacb48ade9808a"
776
+ "digest": "sha256:04588ea5955c3796e867d091a0fba6fcc5d854c94805bfca4ae1fd398f5542c4"
777
777
  },
778
778
  {
779
779
  "path": "resources/procedures/source-update.md",
@@ -789,7 +789,7 @@
789
789
  },
790
790
  {
791
791
  "path": "resources/procedures/work-start-report.md",
792
- "digest": "sha256:6cf90b883205b82579a1c737350c8507513cdde48e78d8e67c35ceb0c743dac1"
792
+ "digest": "sha256:14574e9874c393f16601604eb1d460012dc7ee5da85c8228562d772407c48761"
793
793
  },
794
794
  {
795
795
  "path": "resources/procedures/workspace-commit.md",
@@ -797,7 +797,7 @@
797
797
  },
798
798
  {
799
799
  "path": "resources/procedures/workspace-prepare.md",
800
- "digest": "sha256:2070ad93fecb856b22e6b7183dce2262ba7ed14d117c9a3fb11ddd7433959dee"
800
+ "digest": "sha256:fdbfdeb1486c998785b41569cf6ed57c744e6265d11610d320a60ede0ebbc2c8"
801
801
  },
802
802
  {
803
803
  "path": "resources/procedures/workspace-restore.md",
@@ -896,5 +896,5 @@
896
896
  "indexer": [],
897
897
  "workspace": []
898
898
  },
899
- "digest": "sha256:ac0730b3cd1060b6def03b9702d36fba6b6d55d72d45d43a3667aaf9999877b6"
899
+ "digest": "sha256:a0ca654f19065b2ce03eaabdd76631c477eaa951eb7957f6bff027110600f74f"
900
900
  }
@@ -1,6 +1,6 @@
1
1
  schema: agent-graph.provider.v1
2
2
  id: c4a/context
3
- version: 0.7.10-alpha.1
3
+ version: 0.7.10
4
4
  name: Context workflow
5
5
  description: Internal work contract for Context knowledge workspaces.
6
6
  graphs:
@@ -34,7 +34,6 @@ production assignments. For example, replace the source and goals with the
34
34
  user's actual scope:
35
35
 
36
36
  ```yaml
37
- protocol: context.indexer.registry/v1
38
37
  requirements:
39
38
  - id: integration-guide
40
39
  purpose: Help application developers understand and integrate the system.
@@ -47,7 +46,6 @@ requirements:
47
46
  evidence_source_scope:
48
47
  targets:
49
48
  - source_ref: repo:sample
50
- indexers: []
51
49
  ```
52
50
 
53
51
  Use registered source identities, not guessed paths or URLs. Keep any confirmed
@@ -22,6 +22,22 @@ and continues through Review and delivery. Expression-only changes need no
22
22
  source capture or Parser. Preserve prior confirmed contributions; distinguish
23
23
  actual behavior, a confirmed decision, and a proposal that is not implemented.
24
24
 
25
+ ## Keep planning local to the change
26
+
27
+ For one or two documents or a clearly bounded module, retain the useful planning
28
+ decision: add or revise which articles, and place them where readers expect them.
29
+ Do not expand this into a whole-workspace taxonomy, full navigation redesign or
30
+ multi-wave plan. Read related existing topics first and expand only as needed.
31
+ One module can contain several topics; scope and ambiguity, not source count,
32
+ determine how much investigation is useful.
33
+
34
+ Reuse an approved stage's plan for in-scope additions through its existing amendment
35
+ route. Keep completed work and unrelated pending investigation intact. If article
36
+ targets are already decided before approval, the preparation route supports a
37
+ known-task input to combine preparation and task creation. It still prepares
38
+ navigation and retains report confirmation; it is not a bypass for new source
39
+ authorization. Planning depth is an Agent judgment, not an additional CLI gate.
40
+
25
41
  ## First-task intake budget
26
42
 
27
43
  Before registration and capture, the Agent uses the user's task instructions and
@@ -62,7 +78,14 @@ progress under `.tmp/` never causes a version increase.
62
78
  Version recording runs at completed-scope delivery after Review, Close and package
63
79
  configuration/template approval, before the final build. The record response
64
80
  returns the next workspace Route, so no extra status call is needed. Build retries
65
- reuse the recorded version when formal content is unchanged. Intermediate batches
81
+ reuse the recorded version when formal content is unchanged. If build preparation
82
+ or rendering fails and formal corrections are needed, `version inspect` returns
83
+ `reusable_version` for the current entry only while it has no successful build or
84
+ publication receipt. Submit that same version with the complete iteration's title,
85
+ changes and triggers, including the repair; this replaces the pending changelog
86
+ entry rather than appending another version. Do not submit only the repair and
87
+ lose the original delivery description. Once built or published, the version is
88
+ sealed and further formal changes require an increase. Intermediate batches
66
89
  do not each receive a version.
67
90
 
68
91
  The workspace AGENTS.md and version-writing instructions require each entry's
@@ -91,7 +114,10 @@ actor:
91
114
  ```
92
115
 
93
116
  `actor` is optional; omit it to use local Git `user.name` when configured. Use a
94
- Lark display name only when explicitly known from the conversation. Trigger kinds
117
+ Lark display name only when explicitly known from the conversation. Amending an
118
+ unbuilt entry preserves its actor unless a replacement is explicitly supplied.
119
+ If neither the conversation nor Git identifies the user, omit the actor and
120
+ mention the missing identity in the delivery summary; never guess it. Trigger kinds
95
121
  are `initial`, `note`, `sessions`, `mr`, `module`, `document`, `navigation`,
96
122
  `repair`, `dist`, and `other`. Agent-written fields describe the actual diff and
97
123
  conversation; they must not expose credentials, raw transcripts or private IDs.
@@ -42,6 +42,23 @@ reports, unique material, unknown files and modified checkouts unless their
42
42
  specific loss is authorized. Do not delete locks, transaction records or active
43
43
  tool directories. Empty task directories can remain.
44
44
 
45
+ Prefer cleanup after successful delivery, not immediately after close: version
46
+ recording, build and retries may still need the current task. Completed production
47
+ drafts and Review state are removed by delivery cleanup. Do not invoke
48
+ `task resume` merely to make a completed workspace advance; it starts a new task
49
+ and requires an actual new user request.
50
+
51
+ Keep repository checkouts referenced by registered sources, including fixed
52
+ commits: removing them can force a costly clone before the next update. Keep
53
+ pending telemetry and source-region baselines; losing the latter reduces the
54
+ ability to distinguish relocated text from changed text. Debug and historical
55
+ views may be archived or removed after diagnosis when no operation is active,
56
+ but unknown Agent files are not automatically disposable.
57
+
58
+ After all scratch state is lost, an existing build receipt defaults the workspace
59
+ to waiting for an explicit new task. This does not restore lost drafts or prove
60
+ sources and outputs are current. Use the recovery checks below before resuming.
61
+
45
62
  ## Restore usable sources
46
63
 
47
64
  For repositories, run `context source recovery-plan --format json` and read
@@ -10,8 +10,8 @@ The project has two durable declarations with separate responsibilities:
10
10
 
11
11
  - `src/index.ts`: source references, document capture, custom non-knowledge
12
12
  orchestration, and package outputs.
13
- - `src/indexers.yaml`: knowledge requirements, Provider selection, target/read
14
- scopes, profiles, and Provider customization.
13
+ - `src/indexers.yaml`: long-term reader requirements, authorized target/supporting
14
+ sources and confirmed exclusions. Skill choices belong to the temporary plan.
15
15
 
16
16
  Do not describe the same knowledge transformation in both files.
17
17
 
@@ -59,6 +59,19 @@ and [knowledge updates](../guides/knowledge-updates.md).
59
59
 
60
60
  ## Capture phases
61
61
 
62
+ For ordinary acquisition, add `--configure` to `context source add repo`, `file`,
63
+ `lark` or `batch`. The command registers the selected inputs and generates explicit
64
+ source references and default document capture phases in `src/index.ts`. It does
65
+ not fetch content, select other registrations or change package outputs.
66
+
67
+ Generation supports a literal `defineProject` with literal source/phase arrays
68
+ and recognizable SDK calls. Existing capture settings are preserved, repeated
69
+ registration is idempotent, and custom/dynamic entries remain untouched with a
70
+ `configuration.status: manual` hint. Registration is still saved; edit only the
71
+ needed declarations through the normal configuration path. For special processors
72
+ or resource options, configure them before following the capture Route. Omitting
73
+ `--configure` keeps registration-only behavior.
74
+
62
75
  ```ts
63
76
  captureFile({ source: docs });
64
77
  captureFile({ source: docs, processor: mdxJsonDocs() });
@@ -73,24 +86,27 @@ creating a second capture or knowledge pipeline.
73
86
 
74
87
  ### Batch capture from the source registry
75
88
 
76
- When all registered Lark documents are intended for this project and share capture
77
- settings, read the registry once instead of copying its module names into
78
- `src/index.ts`. For the standard `src/index.ts` entry:
89
+ For documents with shared capture settings, prefer registry-driven configuration
90
+ over repeating source declarations and capture calls, even for two documents.
91
+ Select the task's intended registrations first. The example below assumes all
92
+ registered Lark documents are in scope, with the standard `src/index.ts` entry:
79
93
 
80
94
  ```ts
81
95
  import { fileURLToPath } from "node:url";
82
96
  import {
83
- allSources, captureLark, defineProject, loadSourcesRegistry, source,
97
+ captureLark, defineProject, loadSourcesRegistry, source,
84
98
  } from "@c4a/context";
85
99
 
86
100
  const workspaceRoot = fileURLToPath(new URL("../", import.meta.url));
87
101
  const registry = await loadSourcesRegistry({ rootDir: workspaceRoot });
102
+ // For a subset, filter registry.larks by the authorized namespace/names here.
88
103
  const documents = registry.larks.map(entry =>
89
104
  source(entry.name, { type: "lark" }),
90
105
  );
91
106
 
92
107
  export default defineProject({
93
- sources: [...allSources("repo"), ...documents],
108
+ sources: documents,
109
+ // Shared settings, independent source identities and capture phases.
94
110
  phases: documents.map(document => captureLark({ source: document })),
95
111
  packages: [],
96
112
  });
@@ -115,6 +131,10 @@ Registry loading only reads local registrations; it does not fetch documents.
115
131
  - The map declares one phase per document. It does not fetch URLs, change capture
116
132
  permissions, or request parallel execution. Run the declared phases through the
117
133
  existing CLI flow so each document retains independent refresh and retry behavior.
134
+ This reduces configuration repetition, not the number of capture operations.
135
+ - Capture boundaries do not dictate article boundaries. During planning and
136
+ writing, combine related captured documents around reader tasks when useful;
137
+ do not create one article or a complete production cycle per source by default.
118
138
 
119
139
  ## `customPhase`
120
140
 
@@ -154,18 +174,18 @@ from the package name, if present. Omit it for KB-only output. It accepts `title
154
174
  `src/knowledge-map.yaml` independently of KB directories; see
155
175
  [Package Outputs](../guides/package-outputs.md#optional-static-documentation-website).
156
176
 
157
- ## Indexer registry
177
+ ## Knowledge requirements and Indexer Skills
158
178
 
159
- When this file is absent, the configuration Route supplies the initial schema:
160
- write confirmed `requirements` with `indexers: []`, then re-evaluate. The Provider
161
- selection Action supplies its own completion schema; that payload is not the
162
- configuration file. Subsequent changes use typed proposals and applicable gates. Each selected Indexer binds requirements and scopes to one
163
- primary Provider, with optional declared layers or composers. Provider code
164
- must return the current Indexer result protocol; it must not write Candidate,
165
- knowledge, or Review files directly.
179
+ When `src/indexers.yaml` is absent, the configuration Route supplies its schema.
180
+ Write `requirements` only; do not add `protocol`, `indexers`, Provider selections
181
+ or profiles. Re-evaluate after changing confirmed requirements.
166
182
 
167
- Detailed Provider protocol and customization guidance is selected by the
168
- current workflow Route when it is needed.
183
+ Installed Indexer Skills guide investigation and writing. Relevant Skill choices
184
+ and optional configuration use `indexer_usage` in the temporary production plan,
185
+ not this durable file. There is no separate Provider selection or resolution gate.
186
+ The Agent writes task drafts and reference files under the returned temporary
187
+ directory; the CLI accepts them and owns Candidate, Review and formal output.
188
+ See [Indexer guidance](../guides/indexer-provider-and-customization.md).
169
189
 
170
190
  ## Persistent versus runtime state
171
191
 
@@ -9,10 +9,31 @@ mediaType: text/markdown
9
9
  At completed-scope delivery, follow the version-recording Route. The coordinator
10
10
  writes the semantic changelog from formal diffs and the conversation, including
11
11
  the triggering source and an explicitly known user (Git name is the default).
12
+ Pass `actor` explicitly when the conversation identifies the triggering user,
13
+ including a known Lark display name. If Git has no name and the conversation
14
+ does not identify the user, leave it absent and mention that in the delivery
15
+ summary; do not infer identity from paths, logins or source authors. Amending
16
+ an unbuilt entry preserves its actor unless an explicit replacement is supplied.
12
17
  Record after Close and package/template approval, before the final build, so the
13
18
  selected outputs are built with the new version once. Build records hashes without
14
19
  increasing versions. Never count temporary progress or a build retry as a change.
15
20
 
21
+ For formal repairs before a successful build, use `version inspect`'s
22
+ `reusable_version` when present. Submit the same version and a complete updated
23
+ changelog covering the original work plus repairs, not a repair-only replacement.
24
+ The CLI updates the pending entry in place. A successful build or publication
25
+ seals that version; subsequent changes require an increase. Do not delete build
26
+ or publication receipts to reopen history.
27
+
28
+ Successful delivery clears completed task drafts. Do not empty `.tmp` or call
29
+ `task resume` as a finalization step. Retain registered repository checkouts,
30
+ source-region baselines and queued logs for reuse; optional historical-cache
31
+ cleanup follows the workspace preparation guide after delivery, not after close.
32
+
33
+ Website rendering must preserve literal code and template examples. Do not revise
34
+ valid source-grounded JSX or template syntax merely to avoid Vue interpolation;
35
+ report a rendering defect if the website compiler cannot display it literally.
36
+
16
37
  Before an authorized external publication, run `context version publish-check
17
38
  --format json`. If `needs_version` is true, inspect with `context version inspect
18
39
  --publish --format json`, record a patch changelog using a `dist` trigger, and
@@ -22,6 +22,22 @@ and continues through Review and delivery. Expression-only changes need no
22
22
  source capture or Parser. Preserve prior confirmed contributions; distinguish
23
23
  actual behavior, a confirmed decision, and a proposal that is not implemented.
24
24
 
25
+ ## Keep planning local to the change
26
+
27
+ For one or two documents or a clearly bounded module, retain the useful planning
28
+ decision: add or revise which articles, and place them where readers expect them.
29
+ Do not expand this into a whole-workspace taxonomy, full navigation redesign or
30
+ multi-wave plan. Read related existing topics first and expand only as needed.
31
+ One module can contain several topics; scope and ambiguity, not source count,
32
+ determine how much investigation is useful.
33
+
34
+ Reuse an approved stage's plan for in-scope additions through its existing amendment
35
+ route. Keep completed work and unrelated pending investigation intact. If article
36
+ targets are already decided before approval, the preparation route supports a
37
+ known-task input to combine preparation and task creation. It still prepares
38
+ navigation and retains report confirmation; it is not a bypass for new source
39
+ authorization. Planning depth is an Agent judgment, not an additional CLI gate.
40
+
25
41
  ## First-task intake budget
26
42
 
27
43
  Before registration and capture, the Agent uses the user's task instructions and
@@ -62,7 +78,14 @@ progress under `.tmp/` never causes a version increase.
62
78
  Version recording runs at completed-scope delivery after Review, Close and package
63
79
  configuration/template approval, before the final build. The record response
64
80
  returns the next workspace Route, so no extra status call is needed. Build retries
65
- reuse the recorded version when formal content is unchanged. Intermediate batches
81
+ reuse the recorded version when formal content is unchanged. If build preparation
82
+ or rendering fails and formal corrections are needed, `version inspect` returns
83
+ `reusable_version` for the current entry only while it has no successful build or
84
+ publication receipt. Submit that same version with the complete iteration's title,
85
+ changes and triggers, including the repair; this replaces the pending changelog
86
+ entry rather than appending another version. Do not submit only the repair and
87
+ lose the original delivery description. Once built or published, the version is
88
+ sealed and further formal changes require an increase. Intermediate batches
66
89
  do not each receive a version.
67
90
 
68
91
  The workspace AGENTS.md and version-writing instructions require each entry's
@@ -91,7 +114,10 @@ actor:
91
114
  ```
92
115
 
93
116
  `actor` is optional; omit it to use local Git `user.name` when configured. Use a
94
- Lark display name only when explicitly known from the conversation. Trigger kinds
117
+ Lark display name only when explicitly known from the conversation. Amending an
118
+ unbuilt entry preserves its actor unless a replacement is explicitly supplied.
119
+ If neither the conversation nor Git identifies the user, omit the actor and
120
+ mention the missing identity in the delivery summary; never guess it. Trigger kinds
95
121
  are `initial`, `note`, `sessions`, `mr`, `module`, `document`, `navigation`,
96
122
  `repair`, `dist`, and `other`. Agent-written fields describe the actual diff and
97
123
  conversation; they must not expose credentials, raw transcripts or private IDs.
@@ -15,6 +15,20 @@ name useful reading scope; module labels do not imply directory permissions.
15
15
  No module mapping file, version receipt or article-level scope fields are needed.
16
16
  Read related code as needed within the user's authorized sources.
17
17
 
18
+ Keep planning proportional to this request. For a short document task or one
19
+ bounded module, decide whether to add or revise related articles and their reading
20
+ position; do not redesign unrelated modules or the whole site. Start with relevant
21
+ existing topics, not every navigation page. Expand investigation when the material
22
+ requires it, not to fill a planning template. One batch is sufficient unless real
23
+ dependencies or useful parallel work call for more. Source count is not a page
24
+ count or a CLI threshold.
25
+
26
+ During an approved stage, use the existing plan-amendment path for in-scope
27
+ additions and preserve completed work. Do not restart planning solely because
28
+ another article is ready to write. Keep remaining investigation explicit; a small
29
+ current task does not mean other authorized work is finished. New source or purpose
30
+ authorization still follows the current Route.
31
+
18
32
  Write results under the returned Agent directory. All submission paths are
19
33
  relative to that stage directory, even when the manifest is in `submissions/`.
20
34
  Copy the CLI's submission template, keep completed tasks only, and keep each
@@ -121,6 +121,14 @@ manager or version.
121
121
 
122
122
  ### Route by source boundary
123
123
 
124
+ For explicitly selected sources needing ordinary capture settings, use
125
+ `source add ... --configure` (also supported by `source add batch`) to register
126
+ and generate explicit `src/index.ts` declarations in one call. This does not
127
+ capture, select unrelated registrations, or change output settings. Inspect the
128
+ returned configuration result: custom/dynamic entries return `manual` and remain
129
+ unchanged; preserve them and make a focused edit. If special processors/resources
130
+ are needed, configure those before capture. Do not retry generation in a loop.
131
+
124
132
  Before choosing a local Markdown capture route, honor the surrounding task context. Driver documents such as run instructions, handbooks, READMEs, plans, feedback issues, corpus/index/manifests, and batch lists are not Context sources unless the user explicitly asks to ingest them. Capture only ingest targets that are already explicit in the user request; if they are missing, ask one clarification instead of capturing the driver document.
125
133
 
126
134
  - One or more local `.md` / `.mdx` files or a local documentation folder to ingest →
@@ -147,15 +155,21 @@ Before choosing a local Markdown capture route, honor the surrounding task conte
147
155
  - A Lark/Feishu URL, doc token, or wiki token → register one Lark source:
148
156
  `context source add lark [YYYYMMDD] --module <module> --url <url>` or the
149
157
  matching token flag. Register every requested document under the same date;
150
- do not ask for `YYYYMMDD-2`. Declare
158
+ do not ask for `YYYYMMDD-2`. For multiple documents, use the shared configuration
159
+ pattern below rather than repeating declarations. For a single document, declare
151
160
  `captureLark({ source: source("<date>", "<module>", { type: "lark" }) })`,
152
- then run `context run capture:lark:<date>/<module> --format json`.
161
+ then follow the current Route to execute capture.
153
162
  - For a registered document batch with shared capture settings, use
154
163
  [Batch capture from the source registry](../manuals/reference/project-api.md#batch-capture-from-the-source-registry)
155
164
  to load the registry and generate typed references and phases. Do not transcribe
156
165
  the full YAML module list into `src/index.ts`. Select only the intended entries;
157
166
  use the entire registry only when all its documents are in scope. Preserve
158
167
  existing phases/packages and keep processor or resource exceptions per document.
168
+ Prefer this pattern even for two documents with the same settings. It reduces
169
+ configuration repetition, not capture operations or permission boundaries.
170
+ Independent source identities do not require independent articles: plan and
171
+ write across related captured documents by reader task, not one production
172
+ cycle per input document.
159
173
  - Mixed local document and Lark document batches are separate sources unless
160
174
  the current CLI explicitly offers a combined source contract. Mapping registered
161
175
  entries into declarative SDK phases is supported; writing an Agent-side loop
@@ -38,9 +38,13 @@ confirmed/provisional topics, unchecked ranges and delivery implications. If
38
38
  document acquisition is blocked, ask whether a limited first scope is acceptable;
39
39
  do not silently omit supplied documents or claim full coverage from partial scans.
40
40
 
41
- Small, clearly scoped revisions, notes and conversation summaries can use a short
42
- handling proposal. Do not invent an independent planning phase to fill a report;
43
- do not use this exception to bypass feedback on a bulk build.
41
+ Small, clearly scoped document tasks, single-module work, revisions, notes and
42
+ conversation summaries can use a short handling proposal: which related articles
43
+ to add or revise, their reading position and the intended result. A module with
44
+ several reader topics may need more planning within that module, not a redesign
45
+ of the whole knowledge base. Do not invent an independent investigation, batch
46
+ hierarchy or dependency analysis to fill a report. This changes report depth, not
47
+ the current Route's approval boundary.
44
48
 
45
49
  ## Explain the proposed work
46
50
 
@@ -60,12 +64,14 @@ per-module ownership tables. One module may use several Indexers and one article
60
64
  may combine their materials. Optional specialist absence does not exclude sources.
61
65
 
62
66
  Reuse selected KB, website and LLMS delivery channels. For website delivery,
63
- include a compact proposed menu and layout: top-level groups, a representative
67
+ for a new site or requested navigation redesign, include a compact proposed menu and layout: top-level groups, a representative
64
68
  left menu, article chapters and on-page outline. Explain mobile behavior briefly
65
69
  when relevant. This is a sketch, not a built site; do not create empty articles,
66
70
  temporary websites or promise deployment. Link the existing requirement or
67
71
  workspace configuration rather than creating a permanent report identity.
68
72
  Estimate timing or savings only when supported by measurements and conditions.
73
+ For a small addition to an existing site, describe only the affected reading
74
+ position; reuse its layout and delivery choices instead of proposing them again.
69
75
 
70
76
  ## Mandatory feedback
71
77
 
@@ -42,6 +42,23 @@ reports, unique material, unknown files and modified checkouts unless their
42
42
  specific loss is authorized. Do not delete locks, transaction records or active
43
43
  tool directories. Empty task directories can remain.
44
44
 
45
+ Prefer cleanup after successful delivery, not immediately after close: version
46
+ recording, build and retries may still need the current task. Completed production
47
+ drafts and Review state are removed by delivery cleanup. Do not invoke
48
+ `task resume` merely to make a completed workspace advance; it starts a new task
49
+ and requires an actual new user request.
50
+
51
+ Keep repository checkouts referenced by registered sources, including fixed
52
+ commits: removing them can force a costly clone before the next update. Keep
53
+ pending telemetry and source-region baselines; losing the latter reduces the
54
+ ability to distinguish relocated text from changed text. Debug and historical
55
+ views may be archived or removed after diagnosis when no operation is active,
56
+ but unknown Agent files are not automatically disposable.
57
+
58
+ After all scratch state is lost, an existing build receipt defaults the workspace
59
+ to waiting for an explicit new task. This does not restore lost drafts or prove
60
+ sources and outputs are current. Use the recovery checks below before resuming.
61
+
45
62
  ## Restore usable sources
46
63
 
47
64
  For repositories, run `context source recovery-plan --format json` and read