@c4a/context-cli 0.7.10 → 0.7.12

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 (39) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +3 -3
  3. package/cli.js +1216 -450
  4. package/indexers/bundles/context-code-indexer/references/indexer.md +11 -1
  5. package/indexers/bundles/context-markdown-indexer/references/indexer.md +7 -2
  6. package/indexers/bundles/context-markdown-indexer/references/semantic-planning.md +9 -6
  7. package/indexers/contracts/profile-contract.json +245 -245
  8. package/indexers/release-manifest.json +6 -6
  9. package/package.json +12 -12
  10. package/parserEntryWorker.js +26 -2
  11. package/plugins/README.md +1 -1
  12. package/plugins/README_CN.md +1 -1
  13. package/plugins/VERSION +1 -1
  14. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  15. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  16. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  17. package/plugins/skills/context-code-indexer/references/indexer.md +11 -1
  18. package/plugins/skills/context-markdown-indexer/references/indexer.md +7 -2
  19. package/plugins/skills/context-markdown-indexer/references/semantic-planning.md +9 -6
  20. package/providers/context/graphs/workspace.yaml +1 -22
  21. package/providers/context/manifest.json +29 -65
  22. package/providers/context/provider.yaml +1 -1
  23. package/providers/context/resources/manuals/guides/knowledge-updates.md +87 -3
  24. package/providers/context/resources/manuals/guides/package-outputs.md +39 -1
  25. package/providers/context/resources/manuals/guides/workspace-prepare.md +3 -0
  26. package/providers/context/resources/manuals/reference/project-api.md +21 -2
  27. package/providers/context/resources/procedures/knowledge-review.md +18 -2
  28. package/providers/context/resources/procedures/knowledge-updates.md +87 -3
  29. package/providers/context/resources/procedures/package-output.md +18 -0
  30. package/providers/context/resources/procedures/production-stage-files.md +21 -0
  31. package/providers/context/resources/procedures/repository-source-recovery.md +5 -3
  32. package/providers/context/resources/procedures/task-recovery.md +6 -0
  33. package/providers/context/resources/procedures/work-start-report.md +14 -7
  34. package/providers/context/resources/procedures/workspace-prepare.md +3 -0
  35. package/providers/context/resources/templates/work-start-report.md +11 -6
  36. package/providers/context/actions/inspect-repository-recovery.yaml +0 -6
  37. package/providers/context/actions/restore-repository-sources.yaml +0 -7
  38. package/providers/context/resources/dialogue/repository-source-recovery.md +0 -23
  39. package/providers/context/schemas/repository-source-recovery.schema.json +0 -40
@@ -24,6 +24,25 @@ actual behavior, a confirmed decision, and a proposal that is not implemented.
24
24
 
25
25
  ## Keep planning local to the change
26
26
 
27
+ Before starting production, compare the proposed content with the workspace's
28
+ reader purpose. For clearly unrelated anecdotes or personal rankings, briefly
29
+ recommend leaving them out of the formal manual or saving them separately because
30
+ they can dilute useful retrieval. Attribution alone does not make content relevant.
31
+ This is advice, not a CLI gate: honor the user's informed choice without repeated
32
+ objections, while preserving subjective attribution and normal Review.
33
+
34
+ Registered repositories are not prerequisites for every new request. Restore only
35
+ sources needed to investigate or write the current task, including unchanged code
36
+ when its implementation needs checking. Notes, document-only work, wording edits
37
+ and navigation changes do not require unrelated checkouts. Retained article
38
+ references alone do not require restoring every referenced repository. Missing
39
+ material remains a gap; it must not be treated as investigated or permanently
40
+ excluded. Independent available material can proceed through planning and delivery.
41
+ For required code, use `context source recovery-plan <registered-name> --format json`.
42
+ Reuse a valid local checkout or obtain clone authorization for the returned pinned
43
+ version, then submit the decision using the returned recovery command and schema.
44
+ Do not restore all registered sources merely because a checkout is missing.
45
+
27
46
  For one or two documents or a clearly bounded module, retain the useful planning
28
47
  decision: add or revise which articles, and place them where readers expect them.
29
48
  Do not expand this into a whole-workspace taxonomy, full navigation redesign or
@@ -38,6 +57,14 @@ known-task input to combine preparation and task creation. It still prepares
38
57
  navigation and retains report confirmation; it is not a bypass for new source
39
58
  authorization. Planning depth is an Agent judgment, not an additional CLI gate.
40
59
 
60
+ For broad work, distinguish the whole requested outcome, the current batch and
61
+ remaining capability families or document tasks. Entry-first knowledge should
62
+ locate a checked file/symbol or source section and a concrete next step; a module
63
+ name alone is not problem coverage. When merging or revising, preserve useful
64
+ existing detail rather than replacing it with lookup advice. Review checks the
65
+ promised reader task; task completion and navigation binding only describe the
66
+ declared articles, not semantic coverage of all source material.
67
+
41
68
  ## First-task intake budget
42
69
 
43
70
  Before registration and capture, the Agent uses the user's task instructions and
@@ -385,6 +412,13 @@ and the same Review/build route.
385
412
 
386
413
  ## Adjust or roll back current work
387
414
 
415
+ Read `context task adjust --schema --format yaml` for the source-adjustment
416
+ and knowledge-map input variants; no workspace or input file is required.
417
+ After restoring an unavailable source, follow the recovery result's
418
+ `next_action` to refresh the captured planning materials. Preparation can return
419
+ a new stage: use its paths and identity when resubmitting your plan. Restoring
420
+ the checkout alone does not replace an existing stage's captured material.
421
+
388
422
  For an explicit same-task change to native Indexer source inputs, use
389
423
  `context task adjust --input <file|-> --format json` with `scopes` containing the
390
424
  selected `source_ref` and optional `module_refs`, plus an `instruction` explaining
@@ -428,11 +462,61 @@ knowledge structure and packages.
428
462
 
429
463
  To move an approved page, use `context revise "<old path>" --move-to "<new path>"
430
464
  --instruction "<requested move and content changes>" --format json`. The new
431
- path stays in the same collection. The revision retains the page identity,
465
+ path may use another supported knowledge collection. The revision retains the page identity,
432
466
  rebases outgoing links and updates incoming Markdown links at approval. A new
433
467
  subject name alone only needs a title/content revision; do not create duplicate
434
- pages. Retirement is a content decision: explain the inapplicable material and
435
- supported replacement before changing its page and referring navigation.
468
+ pages. Changing a website group alone does not require moving or reclassifying an article.
469
+
470
+ ### Restructure existing knowledge
471
+
472
+ Read the affected approved articles and current sources before deciding what to
473
+ keep, deepen, split, merge, retain as history or retire. Reuse the current plan
474
+ and remaining scope; a new article plan does not prove old content was preserved.
475
+ Work by reader task, not source or menu count.
476
+
477
+ For a split or merge, first approve destination content, then revise the original
478
+ and incoming links. Preserve useful details until their destination is available.
479
+ Same-page fragments use ordinary revision edits; cross-page work uses new/revision
480
+ tasks and explicit retirement. Finish each coherent batch's content and navigation
481
+ before delivery; inspect both new content and the old articles' disposition.
482
+
483
+ Preview approved-page retirement with `context task retire --input <file> --format json`:
484
+
485
+ ```yaml
486
+ reason: These reader tasks are now covered by the approved guide.
487
+ targets:
488
+ - path: architecture/old-guide.md
489
+ replacement: sop/current-guide.md
490
+ ```
491
+
492
+ `replacement` is optional and must already be approved, outside the retirement set.
493
+ Use several targets for a batch. Read affected files and blockers, then execute
494
+ the returned digest-bound apply command within the user's authorization; do not
495
+ ask for another confirmation when that retirement is already authorized.
496
+ `context task retire --schema --format yaml` describes the input.
497
+
498
+ Retirement removes selected Markdown and structure entries together, updates
499
+ page-level incoming Markdown links to explicit replacements, and rebinds page
500
+ navigation or removes retired navigation targets while retaining groups.
501
+ Repair fragment links explicitly first: the CLI cannot infer where a split moved
502
+ a paragraph. Without a replacement, repair incoming links before applying.
503
+ Finish active drafts/revisions first; unfinished production targeting a selected
504
+ page must be finished or amended rather than discarded.
505
+
506
+ Follow status and the normal close/version/build flow before delivery. Sources
507
+ and shared assets are not deleted. The response provides a temporary restore
508
+ input for the existing rollback preview, including exact previous article,
509
+ structure and modified navigation/link bytes. Retain that input or a Git baseline
510
+ if restoration is needed after temporary cleanup. Retry an interrupted apply
511
+ with the same input and digest; never delete runtime files to recover. Later
512
+ conflicting edits require inspection instead of blind rollback.
513
+
514
+ Historical pages with continuing reader value should normally retain their
515
+ applicable version. Source read failure, shorter new text or a changed menu is
516
+ not sufficient reason to retire an article.
517
+ Retirement does not narrow the registered production scope. If the user also
518
+ excludes the underlying topic from future work, record that through the existing
519
+ requirements/exclusion flow rather than assuming file removal changes the goal.
436
520
 
437
521
  ### Adjust inputs while a local update is unfinished
438
522
 
@@ -46,13 +46,51 @@ prefixes only, not filesystem output paths.
46
46
  kbPackage({
47
47
  name: "project-kb",
48
48
  template: "src/package-templates/kb",
49
- site: { title: "Project knowledge", lang: "en-US", base: "/" },
49
+ site: {
50
+ title: "Project knowledge",
51
+ lang: "en-US",
52
+ base: "/",
53
+ home: {
54
+ title: "Project knowledge",
55
+ slogan: "Find the context behind the work",
56
+ description: "Browse the approved knowledge map and supporting resources.",
57
+ resources: [{
58
+ title: "Project workspace",
59
+ description: "Open the repository that maintains this knowledge.",
60
+ href: "https://example.com/project",
61
+ featured: true,
62
+ }],
63
+ },
64
+ },
50
65
  });
51
66
  ```
52
67
 
53
68
  `site` is opt-in; omission keeps the existing KB-only output. Optional fields
54
69
  are `title` (defaults to the package name), `description`, `lang` (defaults to
55
70
  `en-US`), and `base` (defaults to `/`; use `/docs/` when hosted under that path).
71
+ `home` optionally customizes the landing-page `title`, `slogan`, `description`
72
+ and action buttons. Its `resources` list adds only configured repository,
73
+ service or support cards; each item requires a safe `href`, a copyable
74
+ `command`, or both. Set `featured: true` on a linked resource to also place it
75
+ between the Browse knowledge and LLM Docs hero actions. Do not add placeholders
76
+ for unknown destinations.
77
+
78
+ Configure resources from confirmed project settings, repository remotes or
79
+ successful publication receipts. If a service has not been created or its URL is
80
+ unknown, omit the resource object; empty strings are not placeholders. Missing
81
+ optional resources do not block building the site or authorize creating services.
82
+ After an authorized deployment succeeds, add its returned destination to the
83
+ existing resource list, avoiding duplicates. Rebuild when this changes the
84
+ configuration; updating the hosted site still requires publication authorization.
85
+
86
+ The homepage uses the first-level knowledge map as a complete site map. Each
87
+ section card previews a bounded number of page links and retains a link to the
88
+ full section, so large knowledge bases remain scannable without hiding top-level
89
+ coverage. LLM Docs and Changelog remain dedicated generated resources. On wide
90
+ screens the homepage content aligns with article content while preserving the
91
+ sidebar rail; on narrow screens it uses the available width. Motion is limited
92
+ to short card entrance and hover feedback and is disabled when the reader asks
93
+ the operating system to reduce motion.
56
94
  The website uses a full-width VitePress theme with system fonts, compact navigation,
57
95
  a wide reading area and a smaller article outline. It starts in
58
96
  light mode regardless of the operating system; an explicit reader choice is
@@ -67,6 +67,9 @@ workflow bundle: `repository-source-recovery.md` beside this guide and
67
67
  `../../schemas/repository-source-recovery.schema.json`. Reuse a matching local
68
68
  checkout or, when authorized, clone into a bounded location using
69
69
  `context source restore --input <workspace-input-file> --format json`.
70
+ Follow its `next_action` before resuming a plan: an active production stage may
71
+ need preparation to refresh previously unavailable material. Use the stage and
72
+ paths returned by preparation, not a payload's previous stage identity.
70
73
  Group modules sharing a remote and fixed commit; do not clone per module.
71
74
  Check registered commit and module paths. Never reset a supplied dirty checkout.
72
75
  Authentication or checkout problems can be diagnosed with Host Git tools;
@@ -154,7 +154,22 @@ kbPackage({
154
154
  name: "component-kb",
155
155
  template: "src/package-templates/kb",
156
156
  select: { collections: ["codeindex", "architecture"] },
157
- site: { title: "Component knowledge", lang: "en-US", base: "/" },
157
+ site: {
158
+ title: "Component knowledge",
159
+ lang: "en-US",
160
+ base: "/",
161
+ home: {
162
+ title: "Component knowledge",
163
+ slogan: "Build with the public contract in view",
164
+ description: "Browse components, usage guidance and implementation boundaries.",
165
+ resources: [{
166
+ title: "Project workspace",
167
+ description: "Open the repository that maintains this knowledge.",
168
+ href: "https://example.com/project",
169
+ featured: true,
170
+ }],
171
+ },
172
+ },
158
173
  });
159
174
 
160
175
  llmsPackage({
@@ -170,7 +185,11 @@ may be rebuilt; it is not an authoring source.
170
185
  `kbPackage.site` optionally adds a VitePress website at `dist/<base>-site/` in
171
186
  the same build, beside the KB directory. `<base>` removes one trailing `-kb`
172
187
  from the package name, if present. Omit it for KB-only output. It accepts `title`, `description`,
173
- `lang` and a deployment `base` path. Knowledge map is projected from
188
+ `lang`, a deployment `base` path, and an optional `home` presentation. `home`
189
+ accepts `title`, `slogan`, `description`, hero `actions`, and `resources` shown
190
+ below the generated site map. Each resource needs an `href`, a copyable
191
+ `command`, or both. Omit unknown resources; the builder never invents service
192
+ or repository links. Knowledge map is projected from
174
193
  `src/knowledge-map.yaml` independently of KB directories; see
175
194
  [Package Outputs](../guides/package-outputs.md#optional-static-documentation-website).
176
195
 
@@ -51,6 +51,13 @@ were read.
51
51
  After apply, re-evaluate. Do not infer that close or package output is current.
52
52
  Do not persist a duplicate review-report ledger in the workspace.
53
53
 
54
+ For restructuring, compare replacement content with the affected approved pages:
55
+ useful conditions, steps and explanations must have a destination before removal.
56
+ Review omission rejects a candidate; it does not retire an approved article.
57
+ Use the explicit retirement preview after replacement delivery, and repair its
58
+ reported incoming references. Navigation removal alone does not remove content
59
+ from search or packages. A renamed menu does not require a new article identity.
60
+
54
61
  The Review UI names the internal `rejected` decision **Omit** because it is a
55
62
  durable content decision, not a request to rewrite the page. When a page needs
56
63
  changes, leave that page pending and use `context revise` so the owning
@@ -103,8 +110,11 @@ and the Route returns to their Review/repair after the selected output builds.
103
110
  ## Check usefulness as well as factual accuracy
104
111
 
105
112
  Use the current requirements and agreed scope to check whether a reader can
106
- complete the promised task with these pages. Source citations and a valid API
107
- table alone do not establish that. Compare representative pages with their
113
+ complete the promised task with these pages. For navigation, check a specific
114
+ file/symbol or source section and an actionable next hop; for explanations or
115
+ procedures, check the necessary conditions, steps and examples. Source citations,
116
+ task acceptance and navigation bindings alone do not establish either outcome.
117
+ Compare representative pages with their
108
118
  actual definitions: keep defaults and members attached to the correct callable
109
119
  or type; inspect inherited members and static entry points when needed for the
110
120
  reader's task. Do not infer that an unexpanded type has no options or callbacks.
@@ -116,3 +126,9 @@ not an automatic rejection rule. If the source is insufficient, identify what
116
126
  is unavailable and its effect on the reader instead of inventing content or
117
127
  forcing another identical regeneration. Keep correct pages eligible for the
118
128
  partial approval and delivery path above.
129
+
130
+ Compare the batch with the agreed whole scope and remaining investigation, not
131
+ only its own titles. When revising or merging, preserve useful existing detail
132
+ instead of replacing it with generic lookup advice. Repair affected pages or
133
+ use the current planning route for missing topics. These are Agent judgments,
134
+ not minimum article counts, a new coverage ledger or an extra CLI approval gate.
@@ -24,6 +24,25 @@ actual behavior, a confirmed decision, and a proposal that is not implemented.
24
24
 
25
25
  ## Keep planning local to the change
26
26
 
27
+ Before starting production, compare the proposed content with the workspace's
28
+ reader purpose. For clearly unrelated anecdotes or personal rankings, briefly
29
+ recommend leaving them out of the formal manual or saving them separately because
30
+ they can dilute useful retrieval. Attribution alone does not make content relevant.
31
+ This is advice, not a CLI gate: honor the user's informed choice without repeated
32
+ objections, while preserving subjective attribution and normal Review.
33
+
34
+ Registered repositories are not prerequisites for every new request. Restore only
35
+ sources needed to investigate or write the current task, including unchanged code
36
+ when its implementation needs checking. Notes, document-only work, wording edits
37
+ and navigation changes do not require unrelated checkouts. Retained article
38
+ references alone do not require restoring every referenced repository. Missing
39
+ material remains a gap; it must not be treated as investigated or permanently
40
+ excluded. Independent available material can proceed through planning and delivery.
41
+ For required code, use `context source recovery-plan <registered-name> --format json`.
42
+ Reuse a valid local checkout or obtain clone authorization for the returned pinned
43
+ version, then submit the decision using the returned recovery command and schema.
44
+ Do not restore all registered sources merely because a checkout is missing.
45
+
27
46
  For one or two documents or a clearly bounded module, retain the useful planning
28
47
  decision: add or revise which articles, and place them where readers expect them.
29
48
  Do not expand this into a whole-workspace taxonomy, full navigation redesign or
@@ -38,6 +57,14 @@ known-task input to combine preparation and task creation. It still prepares
38
57
  navigation and retains report confirmation; it is not a bypass for new source
39
58
  authorization. Planning depth is an Agent judgment, not an additional CLI gate.
40
59
 
60
+ For broad work, distinguish the whole requested outcome, the current batch and
61
+ remaining capability families or document tasks. Entry-first knowledge should
62
+ locate a checked file/symbol or source section and a concrete next step; a module
63
+ name alone is not problem coverage. When merging or revising, preserve useful
64
+ existing detail rather than replacing it with lookup advice. Review checks the
65
+ promised reader task; task completion and navigation binding only describe the
66
+ declared articles, not semantic coverage of all source material.
67
+
41
68
  ## First-task intake budget
42
69
 
43
70
  Before registration and capture, the Agent uses the user's task instructions and
@@ -385,6 +412,13 @@ and the same Review/build route.
385
412
 
386
413
  ## Adjust or roll back current work
387
414
 
415
+ Read `context task adjust --schema --format yaml` for the source-adjustment
416
+ and knowledge-map input variants; no workspace or input file is required.
417
+ After restoring an unavailable source, follow the recovery result's
418
+ `next_action` to refresh the captured planning materials. Preparation can return
419
+ a new stage: use its paths and identity when resubmitting your plan. Restoring
420
+ the checkout alone does not replace an existing stage's captured material.
421
+
388
422
  For an explicit same-task change to native Indexer source inputs, use
389
423
  `context task adjust --input <file|-> --format json` with `scopes` containing the
390
424
  selected `source_ref` and optional `module_refs`, plus an `instruction` explaining
@@ -428,11 +462,61 @@ knowledge structure and packages.
428
462
 
429
463
  To move an approved page, use `context revise "<old path>" --move-to "<new path>"
430
464
  --instruction "<requested move and content changes>" --format json`. The new
431
- path stays in the same collection. The revision retains the page identity,
465
+ path may use another supported knowledge collection. The revision retains the page identity,
432
466
  rebases outgoing links and updates incoming Markdown links at approval. A new
433
467
  subject name alone only needs a title/content revision; do not create duplicate
434
- pages. Retirement is a content decision: explain the inapplicable material and
435
- supported replacement before changing its page and referring navigation.
468
+ pages. Changing a website group alone does not require moving or reclassifying an article.
469
+
470
+ ### Restructure existing knowledge
471
+
472
+ Read the affected approved articles and current sources before deciding what to
473
+ keep, deepen, split, merge, retain as history or retire. Reuse the current plan
474
+ and remaining scope; a new article plan does not prove old content was preserved.
475
+ Work by reader task, not source or menu count.
476
+
477
+ For a split or merge, first approve destination content, then revise the original
478
+ and incoming links. Preserve useful details until their destination is available.
479
+ Same-page fragments use ordinary revision edits; cross-page work uses new/revision
480
+ tasks and explicit retirement. Finish each coherent batch's content and navigation
481
+ before delivery; inspect both new content and the old articles' disposition.
482
+
483
+ Preview approved-page retirement with `context task retire --input <file> --format json`:
484
+
485
+ ```yaml
486
+ reason: These reader tasks are now covered by the approved guide.
487
+ targets:
488
+ - path: architecture/old-guide.md
489
+ replacement: sop/current-guide.md
490
+ ```
491
+
492
+ `replacement` is optional and must already be approved, outside the retirement set.
493
+ Use several targets for a batch. Read affected files and blockers, then execute
494
+ the returned digest-bound apply command within the user's authorization; do not
495
+ ask for another confirmation when that retirement is already authorized.
496
+ `context task retire --schema --format yaml` describes the input.
497
+
498
+ Retirement removes selected Markdown and structure entries together, updates
499
+ page-level incoming Markdown links to explicit replacements, and rebinds page
500
+ navigation or removes retired navigation targets while retaining groups.
501
+ Repair fragment links explicitly first: the CLI cannot infer where a split moved
502
+ a paragraph. Without a replacement, repair incoming links before applying.
503
+ Finish active drafts/revisions first; unfinished production targeting a selected
504
+ page must be finished or amended rather than discarded.
505
+
506
+ Follow status and the normal close/version/build flow before delivery. Sources
507
+ and shared assets are not deleted. The response provides a temporary restore
508
+ input for the existing rollback preview, including exact previous article,
509
+ structure and modified navigation/link bytes. Retain that input or a Git baseline
510
+ if restoration is needed after temporary cleanup. Retry an interrupted apply
511
+ with the same input and digest; never delete runtime files to recover. Later
512
+ conflicting edits require inspection instead of blind rollback.
513
+
514
+ Historical pages with continuing reader value should normally retain their
515
+ applicable version. Source read failure, shorter new text or a changed menu is
516
+ not sufficient reason to retire an article.
517
+ Retirement does not narrow the registered production scope. If the user also
518
+ excludes the underlying topic from future work, record that through the existing
519
+ requirements/exclusion flow rather than assuming file removal changes the goal.
436
520
 
437
521
  ### Adjust inputs while a local update is unfinished
438
522
 
@@ -58,6 +58,24 @@ changed. A request to generate a documentation website follows this same route,
58
58
  including after initial delivery. Inspect existing declarations before editing;
59
59
  do not register the request itself as source material or re-index unchanged knowledge.
60
60
 
61
+ For a new website or a requested homepage redesign, configure `site.home` from
62
+ the confirmed audience and scope: a concise title, slogan and description, plus
63
+ only useful hero actions. The generated homepage already supplies the complete
64
+ top-level site map, LLM Docs and Changelog. Add `home.resources` for verified
65
+ repositories, services, support channels or copyable install commands. Omit
66
+ unknown destinations instead of inventing links or showing empty cards; they
67
+ can be added later without re-indexing knowledge.
68
+
69
+ When configuring the homepage, reuse confirmed project declarations, repository
70
+ remotes, deployment configuration and successful publication receipts. Known
71
+ resource types do not prove that a destination exists. Omit unavailable resources
72
+ entirely rather than passing empty strings; note missing optional destinations in
73
+ the existing work summary without blocking knowledge production or requesting
74
+ new services. After an authorized publication or service setup succeeds, use its
75
+ returned URL and package identity to update the corresponding resource. Preserve
76
+ existing entries, avoid duplicates, and rebuild only when configuration changes.
77
+ Republish the changed site only within the existing publication authorization.
78
+
61
79
  Validate reading targets before build. Website navigation uses the approved reading
62
80
  structure; repair missing bindings through the current structure adjustment action.
63
81
  Build cost is rendering and local search generation, not another Indexer run.
@@ -10,6 +10,16 @@ The stage entry links CLI-owned requirements, planned skill guidance and task
10
10
  directories. Read relevant source text before writing; a skeleton is navigation,
11
11
  not semantic evidence. Skill names guide work, not article ownership or versions.
12
12
 
13
+ Restore repository checkouts only when needed for the current investigation or
14
+ article. Independent notes/documents can proceed while unavailable code remains
15
+ an explicit gap. For a required repository, read the
16
+ [recovery procedure](repository-source-recovery.md) and inspect only its registered
17
+ name, not every repository. Never claim missing material was checked.
18
+
19
+ Plan article paths are relative to `knowledge/`, for example `business/example.md`.
20
+ `indexer_usage.scopes` contains stage source refs, not collection names. Declare
21
+ selected skills through the plan; no separate Indexer registration is required.
22
+
13
23
  Choose relevant code directories while planning or writing. A task brief may
14
24
  name useful reading scope; module labels do not imply directory permissions.
15
25
  No module mapping file, version receipt or article-level scope fields are needed.
@@ -22,6 +32,17 @@ existing topics, not every navigation page. Expand investigation when the materi
22
32
  requires it, not to fill a planning template. One batch is sufficient unless real
23
33
  dependencies or useful parallel work call for more. Source count is not a page
24
34
  count or a CLI threshold.
35
+ For a broad request, identify its major capability families and document tasks;
36
+ lightweight planning limits initial depth, not the authorized range. Use existing
37
+ questions and briefs to distinguish checked entry points from explanations and
38
+ keep unplanned work visible. A first batch is not the whole requested outcome.
39
+
40
+ For restructuring, assess existing articles as well as proposed additions.
41
+ Preserve useful text until approved destinations carry it; then repair links and
42
+ navigation. Splitting/merging uses ordinary article tasks and fragment edits.
43
+ After their delivery, explicitly obsolete approved pages can use the retirement
44
+ preview described in the knowledge-updates guide. Removing a plan task or menu
45
+ entry does not retire its approved article.
25
46
 
26
47
  During an approved stage, use the existing plan-amendment path for in-scope
27
48
  additions and preserve completed work. Do not restart planning solely because
@@ -10,7 +10,9 @@ Repository checkout contents and materialized module links are local runtime
10
10
  inputs. Git stores their recovery recipe in `sources/repo/index.yaml`; it does
11
11
  not store the checkout, local aliases, or `sources/repo/<date>/<module>` links.
12
12
 
13
- Run the route's inspection action first. It groups logical modules by registered
13
+ Recover only repositories required by the current task, not all registered
14
+ checkouts before an unrelated document or Note update. Run
15
+ `context source recovery-plan <registered-name> --format json` first. It groups logical modules by registered
14
16
  remote and pinned commit, so one physical checkout can restore every module in
15
17
  that group. Do not create one clone per module. Groups already marked `ready`
16
18
  need no decision; when every group is ready, the plan has no recovery action.
@@ -39,5 +41,5 @@ materializes module links.
39
41
 
40
42
  Repository sources are ready only when every selected module resolves to the
41
43
  registered remote and pinned commit, every registered subpath exists, no local
42
- path was overwritten, Context materialization succeeds, and the current route
43
- no longer reports `route.source.repository-not-ready`.
44
+ path was overwritten, Context materialization succeeds, and the selected recovery
45
+ plan reports them ready.
@@ -15,6 +15,12 @@ its progress is changing. Never start a competing writer or delete a writer lock
15
15
 
16
16
  ## Choose the smallest applicable action
17
17
 
18
+ - Orphan writer lock: preview `task recover --operation writer-lock`. Before
19
+ applying its current digest, pause new workspace commands and confirm no child
20
+ writer or other host/container still uses the workspace. Apply archives only
21
+ the unchanged lock whose owner is no longer running; it does not complete any
22
+ capture. Run recovery inspection again for interrupted transactions, then
23
+ refresh the Route. Unknown or active ownership must not be bypassed.
18
24
  - Wrong current payload: use the reported schema/evidence to correct it and refresh
19
25
  the Route when available. A current candidate can use its ordinary revise action.
20
26
  - Interrupted transaction: preview `task recover --operation transactions`, inspect
@@ -27,8 +27,10 @@ first, then use documents and selectively read business definitions to correct
27
27
  reader topics. Directory names are orientation, not verified business semantics.
28
28
  Documents need not fit a code-shaped menu.
29
29
 
30
- Code investigation returns bounded feature names, counts where complete, entry
31
- paths and checked/remaining ranges, not full symbols or call graphs. Document
30
+ Code investigation identifies the authorized capability families, checked entry
31
+ paths and remaining ranges, not full symbols or call graphs. Broad scope calls for
32
+ horizontal discovery, not deep reading of every implementation before writing.
33
+ Document
32
34
  overviews include titles, bounded introductory text, the full H2/H3 hierarchy and
33
35
  full-text access. Read more when the overview cannot settle a semantic choice.
34
36
  Do not run additional parsers merely to populate counts or tables.
@@ -48,11 +50,14 @@ the current Route's approval boundary.
48
50
 
49
51
  ## Explain the proposed work
50
52
 
51
- Write in the user's language. Open with the reader's task and first useful
52
- delivery, not protocol IDs. Explain purpose, source/version boundaries, proposed
53
- topics, reuse or revision of existing articles, cross-source articles, suggested
54
- batches, dependencies and first delivery. Separate material counts from planned
55
- article counts; unknown totals are not zero or confirmed final counts.
53
+ Write in the user's language. Open with the reader's task and whole requested
54
+ outcome, then distinguish the current delivery and remaining work. Explain source
55
+ versions, topics, reuse or revision of existing articles and useful dependencies,
56
+ not protocol IDs. State which topics provide checked problem-level entry points
57
+ and which explain behavior or operations. Package names alone are not that depth.
58
+ Keep material, planned article and investigated-scope counts separate; unknown
59
+ totals are not zero. Describe remaining capability families or document tasks in
60
+ the existing plan/report, without a per-file ledger or another confirmation step.
56
61
 
57
62
  Explain relevant conflicts, gaps, exclusions and decisions requiring feedback.
58
63
  Access permission alone does not approve a semantic exclusion. Distinguish user
@@ -96,6 +101,8 @@ pause. Actual scale belongs in the report whose pre-writing feedback is mandator
96
101
  Use current CLI task and stage progress; distinguish accepted candidates, approved
97
102
  articles and delivered outputs. The current batch is not the whole goal. Do not
98
103
  treat input rechecks as loss of formal articles or candidates as delivered pages.
104
+ Task completion concerns the declared plan; navigation coverage concerns existing
105
+ articles. Neither proves that all authorized source topics have been explained.
99
106
 
100
107
  Reports, plans, skills, candidates, confirmation and transaction process stay in
101
108
  `.tmp`. Only formal results and necessary long-term source/requirement decisions
@@ -67,6 +67,9 @@ workflow bundle: `repository-source-recovery.md` beside this guide and
67
67
  `../../schemas/repository-source-recovery.schema.json`. Reuse a matching local
68
68
  checkout or, when authorized, clone into a bounded location using
69
69
  `context source restore --input <workspace-input-file> --format json`.
70
+ Follow its `next_action` before resuming a plan: an active production stage may
71
+ need preparation to refresh previously unavailable material. Use the stage and
72
+ paths returned by preparation, not a payload's previous stage identity.
70
73
  Group modules sharing a remote and fixed commit; do not clone per module.
71
74
  Check registered commit and module paths. Never reset a supplied dirty checkout.
72
75
  Authentication or checkout problems can be diagnosed with Host Git tools;
@@ -10,11 +10,11 @@ Write `.tmp/work-start-report.md` in the user's language after lightweight
10
10
  investigation and planning. Adapt this outline; omit empty sections and template
11
11
  instructions. Headings are not a questionnaire or mandatory schema.
12
12
 
13
- ## Readers and first useful delivery
13
+ ## Readers, whole goal and current delivery
14
14
 
15
- Explain who will use the knowledge, what they need to do and what the first
16
- reviewed delivery enables. Reuse confirmed purpose, scope, priorities, language
17
- and delivery choices. Describe execution/settings implications only when useful.
15
+ Explain who will use the knowledge, the whole requested outcome and what this
16
+ reviewed delivery enables. Distinguish a first useful batch from the final scope.
17
+ Reuse confirmed purpose, priorities, language and delivery choices.
18
18
 
19
19
  ## What the materials support
20
20
 
@@ -33,6 +33,9 @@ Use this table only when several groups need comparison:
33
33
  Keep material counts separate from article counts. Do not produce a per-file
34
34
  accounting table. One article may use several sources and Indexers. Batches are
35
35
  execution groupings, not fixed article templates or mandatory route transitions.
36
+ State the useful depth for each topic: a specific investigation entry, an
37
+ explanation or an executable procedure. Name still-unplanned capability families
38
+ and document tasks rather than hiding them behind completion of this table.
36
39
 
37
40
  ## Reading organization and delivery
38
41
 
@@ -43,8 +46,10 @@ duplicating bodies. Retain existing KB, website and LLMS delivery choices.
43
46
 
44
47
  For website delivery, add a compact sketch showing the site title, top-level
45
48
  groups, a representative left menu, article chapters and on-page outline.
46
- Briefly explain mobile menus when relevant. A sketch is not a built website or
47
- permission to create empty pages. Do not infer business semantics from code paths.
49
+ For a new homepage or requested redesign, also propose a short title, slogan,
50
+ description and the verified optional resource cards. Briefly explain mobile
51
+ menus when relevant. A sketch is not a built website or permission to create
52
+ empty pages. Do not infer business semantics from code paths or invent links.
48
53
 
49
54
  ## Relevant indexing guidance
50
55
 
@@ -1,6 +0,0 @@
1
- schema: agent-graph.action.v1
2
- id: inspect-repository-recovery
3
- description: Group missing repository modules by physical checkout and show recovery choices.
4
- runner: command
5
- effect: read
6
- command: context source recovery-plan --format json
@@ -1,7 +0,0 @@
1
- schema: agent-graph.action.v1
2
- id: restore-repository-sources
3
- description: Restore registered repository sources from user-confirmed local paths or explicit clones.
4
- runner: command
5
- effect: external
6
- command: context source restore --input .tmp/agent-payloads/repository-source-recovery.json --format json
7
- inputSchema: schemas/repository-source-recovery.schema.json
@@ -1,23 +0,0 @@
1
- ---
2
- id: dialogue.repository-source-recovery
3
- kind: procedure
4
- mediaType: text/markdown
5
- ---
6
-
7
- # Repository source recovery dialogue
8
-
9
- Explain that the Context project is intact: only Git-ignored source checkouts
10
- or local links are missing. Show one choice per physical repository, not per
11
- logical module.
12
-
13
- For an existing checkout, ask for its path or ask the user to authorize a
14
- specific parent directory for a bounded scan. Show matching candidates with
15
- their origin, HEAD, dirty state, and required subpath coverage before the user
16
- selects one. Do not modify, switch, clean, or pull the selected checkout.
17
-
18
- For a clone, show the registered remote, pinned commit, target directory, and
19
- the logical modules that will share it. The clone restores the recorded source
20
- version; it does not silently advance to the latest branch.
21
-
22
- After recovery, summarize reused and cloned checkouts, actual commits, restored
23
- module links, and any remaining permission or missing-subpath blockers.