@c4a/context-cli 0.7.4 → 0.7.5

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 (47) hide show
  1. package/cli.js +6420 -1986
  2. package/indexers/bundles/context-code-indexer/SKILL.md +1 -1
  3. package/indexers/bundles/context-code-indexer/context-indexer.yaml +1 -1
  4. package/indexers/bundles/context-markdown-indexer/SKILL.md +1 -1
  5. package/indexers/bundles/context-markdown-indexer/context-indexer.yaml +1 -1
  6. package/indexers/contracts/profile-contract.json +245 -245
  7. package/indexers/release-manifest.json +11 -11
  8. package/package.json +12 -12
  9. package/plugins/VERSION +1 -1
  10. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  11. package/plugins/claude/commands/context.md +15 -25
  12. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  13. package/plugins/codex/skills/context/SKILL.md +15 -25
  14. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  15. package/plugins/cursor/commands/c4a-context.md +15 -25
  16. package/plugins/skills/context/SKILL.md +15 -25
  17. package/plugins/skills/context-code-indexer/SKILL.md +1 -1
  18. package/plugins/skills/context-code-indexer/context-indexer.yaml +1 -1
  19. package/plugins/skills/context-markdown-indexer/SKILL.md +1 -1
  20. package/plugins/skills/context-markdown-indexer/context-indexer.yaml +1 -1
  21. package/providers/context/actions/authorize-current-indexer-provider-program.yaml +6 -0
  22. package/providers/context/actions/finalize-current-indexer-provider-selection.yaml +5 -0
  23. package/providers/context/actions/resolve-current-indexer-gate.yaml +6 -0
  24. package/providers/context/actions/resolve-current-indexer-provider.yaml +6 -0
  25. package/providers/context/actions/run-indexer-lifecycle.yaml +0 -1
  26. package/providers/context/actions/run-indexer-post-author-composer.yaml +1 -1
  27. package/providers/context/codes.yaml +2 -0
  28. package/providers/context/graphs/indexer.yaml +22 -0
  29. package/providers/context/graphs/workspace.yaml +1 -0
  30. package/providers/context/manifest.json +78 -48
  31. package/providers/context/provider.yaml +1 -1
  32. package/providers/context/resources/dialogue/knowledge-review.md +6 -3
  33. package/providers/context/resources/procedures/knowledge-review.md +11 -8
  34. package/providers/context/resources/views/resolved-indexer-instructions.yaml +2 -4
  35. package/providers/context/schemas/indexer-agent-step-input.schema.json +71 -21
  36. package/providers/context/schemas/indexer-agent-step-result.schema.json +107 -20
  37. package/providers/context/schemas/indexer-materialize-request.schema.json +4 -8
  38. package/providers/context/schemas/indexer-workset-view-materialization-request.schema.json +4 -1
  39. package/providers/context/skills/authorize-current-indexer-provider-program/SKILL.md +20 -0
  40. package/providers/context/skills/configure-indexer-providers/SKILL.md +15 -14
  41. package/providers/context/skills/resolve-current-indexer-gate/SKILL.md +27 -0
  42. package/providers/context/skills/resolve-current-indexer-provider/SKILL.md +20 -0
  43. package/providers/context/skills/run-indexer-agent-step/SKILL.md +27 -14
  44. package/providers/context/skills/run-indexer-lifecycle/SKILL.md +14 -9
  45. package/providers/context/skills/run-indexer-post-author-composer/SKILL.md +35 -23
  46. package/providers/context/schemas/indexer-lifecycle-continuation.schema.json +0 -15
  47. package/providers/context/schemas/indexer-post-author-fragment-request.schema.json +0 -26
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "context.indexer.current-action-input/v1",
3
+ "$id": "context.indexer.current-action-input/v2",
4
4
  "oneOf": [
5
5
  { "$ref": "#/$defs/providerSelection" },
6
6
  { "$ref": "#/$defs/providerResolution" },
7
7
  { "$ref": "#/$defs/providerProgramAuthorization" },
8
- { "$ref": "#/$defs/providerFinalization" },
9
- { "$ref": "#/$defs/partition" },
10
- { "$ref": "#/$defs/author" },
8
+ { "$ref": "#/$defs/partitionBatch" },
9
+ { "$ref": "#/$defs/authorBatch" },
11
10
  { "$ref": "#/$defs/postAuthor" },
12
11
  { "$ref": "#/$defs/structureReview" },
13
12
  { "$ref": "#/$defs/layoutConfirmation" }
@@ -61,32 +60,46 @@
61
60
  }
62
61
  }
63
62
  },
64
- "providerFinalization": {
63
+ "providerProgramAuthorization": {
65
64
  "type": "object",
66
65
  "additionalProperties": false,
67
- "required": ["stage"],
66
+ "required": ["stage", "decision"],
68
67
  "properties": {
69
- "stage": { "const": "provider-finalization" }
68
+ "stage": { "const": "provider-program-authorization" },
69
+ "decision": { "enum": ["approved", "rejected"] }
70
70
  }
71
71
  },
72
- "providerProgramAuthorization": {
72
+ "partitionBatch": {
73
73
  "type": "object",
74
74
  "additionalProperties": false,
75
- "required": ["stage", "decision"],
75
+ "required": ["stage", "results"],
76
76
  "properties": {
77
- "stage": { "const": "provider-program-authorization" },
78
- "decision": { "enum": ["approved", "rejected"] }
77
+ "stage": { "const": "partition" },
78
+ "results": {
79
+ "type": "array",
80
+ "minItems": 1,
81
+ "items": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["task_key", "result"],
85
+ "properties": {
86
+ "task_key": { "type": "string", "pattern": "^task-[0-9]{3}$" },
87
+ "result": { "$ref": "#/$defs/partition" }
88
+ }
89
+ }
90
+ }
79
91
  }
80
92
  },
81
93
  "partition": {
82
94
  "type": "object",
83
95
  "additionalProperties": false,
84
- "required": ["stage", "outcome", "unit_type", "partition_axis", "groups", "excluded", "unsupported"],
96
+ "required": ["stage", "outcome", "groups", "excluded", "unsupported"],
85
97
  "properties": {
86
98
  "stage": { "const": "partition" },
87
- "outcome": { "enum": ["complete", "failed"] },
88
- "unit_type": { "$ref": "#/$defs/string" },
89
- "partition_axis": { "$ref": "#/$defs/string" },
99
+ "outcome": {
100
+ "enum": ["complete", "failed"],
101
+ "description": "Use complete when the semantic partition is ready; use failed only with failure details. accepted is not an Agent outcome."
102
+ },
90
103
  "groups": { "type": "array", "items": { "$ref": "#/$defs/partitionGroup" } },
91
104
  "excluded": { "type": "array", "items": { "$ref": "#/$defs/excluded" } },
92
105
  "unsupported": { "type": "array", "items": { "$ref": "#/$defs/unsupported" } },
@@ -99,6 +112,27 @@
99
112
  }
100
113
  ]
101
114
  },
115
+ "authorBatch": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": ["stage", "results"],
119
+ "properties": {
120
+ "stage": { "const": "author" },
121
+ "results": {
122
+ "type": "array",
123
+ "minItems": 1,
124
+ "items": {
125
+ "type": "object",
126
+ "additionalProperties": false,
127
+ "required": ["task_key", "result"],
128
+ "properties": {
129
+ "task_key": { "type": "string", "pattern": "^task-[0-9]{3}$" },
130
+ "result": { "$ref": "#/$defs/author" }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ },
102
136
  "partitionGroup": {
103
137
  "type": "object",
104
138
  "additionalProperties": false,
@@ -122,7 +156,10 @@
122
156
  }
123
157
  ]
124
158
  },
125
- "subject_intent": { "enum": ["primary", "enrich-or-independent"] },
159
+ "subject_intent": {
160
+ "enum": ["primary", "enrich-or-independent"],
161
+ "description": "Use primary when this group owns a reader subject. Use enrich-or-independent for a publishable supplemental view, including test or example behavior: Context enriches an existing matching subject when one exists and otherwise creates an independent subject. supporting is not a valid intent; material that must never become a reader subject must not be emitted as a group."
162
+ },
126
163
  "members": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/string" } },
127
164
  "questions": { "type": "array", "items": { "$ref": "#/$defs/string" } },
128
165
  "question_targets": { "type": "array", "items": { "$ref": "#/$defs/questionTarget" } },
@@ -241,6 +278,27 @@
241
278
  }
242
279
  },
243
280
  "postAuthor": {
281
+ "type": "object",
282
+ "additionalProperties": false,
283
+ "required": ["stage", "results"],
284
+ "properties": {
285
+ "stage": { "const": "post-author" },
286
+ "results": {
287
+ "type": "array",
288
+ "minItems": 1,
289
+ "items": {
290
+ "type": "object",
291
+ "additionalProperties": false,
292
+ "required": ["task_key", "result"],
293
+ "properties": {
294
+ "task_key": { "type": "string", "pattern": "^task-[0-9]{3}$" },
295
+ "result": { "$ref": "#/$defs/postAuthorResult" }
296
+ }
297
+ }
298
+ }
299
+ }
300
+ },
301
+ "postAuthorResult": {
244
302
  "type": "object",
245
303
  "additionalProperties": false,
246
304
  "required": ["stage", "outcome", "proposals", "diagnostics"],
@@ -285,7 +343,11 @@
285
343
  "allOf": [
286
344
  {
287
345
  "if": { "properties": { "outcome": { "const": "failed" } } },
288
- "then": { "properties": { "diagnostics": { "minItems": 1 } } }
346
+ "then": {
347
+ "properties": {
348
+ "diagnostics": { "type": "array", "minItems": 1 }
349
+ }
350
+ }
289
351
  }
290
352
  ]
291
353
  },
@@ -297,7 +359,13 @@
297
359
  "stage": { "const": "structure-review" },
298
360
  "decision": { "enum": ["approved", "request-adjustment"] },
299
361
  "feedback": { "$ref": "#/$defs/string" }
300
- }
362
+ },
363
+ "allOf": [
364
+ {
365
+ "if": { "properties": { "decision": { "const": "request-adjustment" } } },
366
+ "then": { "required": ["feedback"] }
367
+ }
368
+ ]
301
369
  },
302
370
  "layoutConfirmation": {
303
371
  "type": "object",
@@ -306,8 +374,27 @@
306
374
  "properties": {
307
375
  "stage": { "const": "layout-confirmation" },
308
376
  "decision": { "enum": ["approved", "rejected"] },
309
- "feedback": { "$ref": "#/$defs/string" }
310
- }
377
+ "feedback": { "$ref": "#/$defs/string" },
378
+ "paths": {
379
+ "type": "array",
380
+ "minItems": 1,
381
+ "items": {
382
+ "type": "object",
383
+ "additionalProperties": false,
384
+ "required": ["artifact_ref", "output_path"],
385
+ "properties": {
386
+ "artifact_ref": { "$ref": "#/$defs/string" },
387
+ "output_path": { "$ref": "#/$defs/string" }
388
+ }
389
+ }
390
+ }
391
+ },
392
+ "allOf": [
393
+ {
394
+ "if": { "properties": { "decision": { "const": "rejected" } } },
395
+ "then": { "required": ["feedback"], "not": { "required": ["paths"] } }
396
+ }
397
+ ]
311
398
  }
312
399
  }
313
400
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "context.indexer.materialize-request/v1",
3
+ "$id": "context.indexer.materialize-request/v2",
4
4
  "type": "object",
5
5
  "additionalProperties": false,
6
6
  "required": [
@@ -12,9 +12,7 @@
12
12
  "provider_fingerprint",
13
13
  "provider_integrity",
14
14
  "manifest_digest",
15
- "requirement_set_digest",
16
- "workset_ref",
17
- "workset_digest",
15
+ "stage",
18
16
  "profile",
19
17
  "composer_id",
20
18
  "instruction_set_digest",
@@ -22,7 +20,7 @@
22
20
  "request_digest"
23
21
  ],
24
22
  "properties": {
25
- "protocol": { "const": "context.indexer.materialize-request/v1" },
23
+ "protocol": { "const": "context.indexer.materialize-request/v2" },
26
24
  "handler": { "const": "context.materialize-indexer-instructions/v1" },
27
25
  "resource_id": { "const": "resolved-indexer-instructions" },
28
26
  "indexer_id": { "type": "string", "minLength": 1 },
@@ -30,9 +28,7 @@
30
28
  "provider_fingerprint": { "$ref": "#/$defs/digest" },
31
29
  "provider_integrity": { "$ref": "#/$defs/digest" },
32
30
  "manifest_digest": { "$ref": "#/$defs/digest" },
33
- "requirement_set_digest": { "$ref": "#/$defs/digest" },
34
- "workset_ref": { "type": "string", "minLength": 1 },
35
- "workset_digest": { "$ref": "#/$defs/digest" },
31
+ "stage": { "enum": ["partition", "author", "post-author"] },
36
32
  "profile": { "type": "string", "minLength": 1 },
37
33
  "composer_id": {
38
34
  "oneOf": [
@@ -16,7 +16,10 @@
16
16
  "properties": {
17
17
  "protocol": { "const": "context.indexer.workset-view-materialization-request/v1" },
18
18
  "handler": { "const": "context.materialize-indexer-workset-view/v1" },
19
- "resource_id": { "const": "authorized-indexer-workset-view" },
19
+ "resource_id": {
20
+ "type": "string",
21
+ "pattern": "^authorized-indexer-workset-view(?:/task-[0-9]{3})?$"
22
+ },
20
23
  "workset_digest": { "$ref": "#/$defs/digest" },
21
24
  "execution_request_digest": { "$ref": "#/$defs/digest" },
22
25
  "view_digest": { "$ref": "#/$defs/digest" },
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: context-authorize-current-indexer-provider-program
3
+ description: Resolve the current Context Gate for an exact non-sandboxed Indexer Provider program.
4
+ metadata:
5
+ agent-graph: path:../../provider.yaml
6
+ agent-graph.graph: indexer
7
+ agent-graph.entry: current-provider-program-authorization
8
+ ---
9
+
10
+ # Authorize the current Provider program
11
+
12
+ Read the exact program report in `gate.resolution_action.input`. Resolve only the current Gate:
13
+
14
+ - return `stage: provider-program-authorization`;
15
+ - return `decision: approved` only when the user approved it or the Route says the Gate is resolved
16
+ by session authority;
17
+ - otherwise return `decision: rejected`.
18
+
19
+ Do not change Provider identity, program content, scope, limits, or authority. Submit the value to
20
+ the Route's only `complete-current` command and then follow the newly returned Route.
@@ -18,20 +18,19 @@ the guide's `indexer-provider-unavailable` handling instead of substituting a
18
18
  different version or cache.
19
19
 
20
20
  The current Action input already contains the exact requirements and
21
- CLI-bundled catalog. Report those bundled entries together with other Indexer
22
- entry Skills already visible in this conversation. For an exact Skill root
23
- already exposed by the Host, read only `SKILL.md` frontmatter and the sibling
24
- `context-indexer.yaml`: the manifest version is authoritative and
25
- `metadata.context-provider-version` must match it. Do not load Provider guidance
26
- until selection. Group the same Skill name and exact version into one
27
- conversation item with all observed source types; an installed copy of the
28
- same CLI-bundled identity is not another Provider. Keep different versions
29
- separate, never use source count or discovery order as precedence, and do not
30
- scan plugin caches or persist this discovery list.
21
+ CLI-bundled catalog. Select applicable Providers using that input and the Skills
22
+ already visible in this conversation. Do not run a separate catalog command,
23
+ enumerate every installed Skill, or require a discovery report/confirmation.
24
+ For a selected shipped Provider, copy its exact version, integrity and
25
+ cli-bundled distribution from the supplied catalog. The same Skill/version
26
+ visible in the Host is a projection, not another Provider or a reason for Host
27
+ resolution. If selecting a relevant external Skill, read only its exact
28
+ Host-exposed frontmatter and sibling `context-indexer.yaml` needed to identify
29
+ it; manifest version is authoritative. Do not guess missing versions, substitute
30
+ a different version, or scan caches. Read Provider guidance only when selected.
31
31
 
32
32
  When the Graph enters through `markdown-provider`, first require the completed
33
- capture report and report the visible `context-markdown-indexer*` Skills before
34
- building the route input. Treat only the report's exact `source_inputs` as
33
+ capture report. Treat only the report's exact `source_inputs` as
35
34
  current evidence. Do not infer semantic ownership from filenames, titles, or
36
35
  headings, and do not persist the discovery list. Capture proves byte/currentness
37
36
  only; the selected Markdown Provider remains responsible for semantic indexing.
@@ -45,8 +44,10 @@ indexers:
45
44
  - <one complete selected Indexer registry entry>
46
45
  ```
47
46
 
48
- `host_visible_skills` contains only non-CLI observations already visible to
49
- the Host. `indexers` contains the semantic registry entries selected for the
47
+ `host_visible_skills` contains only relevant non-CLI observations already
48
+ visible to the Host; leave it empty for a CLI-bundled selection without external
49
+ observations. It is not an inventory of installed Skills. `indexers` contains
50
+ the semantic registry entries selected for the
50
51
  unchanged requirements in the Action input. Select portable distribution
51
52
  locators and exact versions and integrities. Each required
52
53
  requirement/domain/source/module owner cell needs one primary Indexer;
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: context-resolve-current-indexer-gate
3
+ description: Resolve the current Indexer structure or layout Gate using the exact current Route input and output schema.
4
+ metadata:
5
+ agent-graph: path:../../provider.yaml
6
+ agent-graph.graph: indexer
7
+ agent-graph.entry: current-lifecycle
8
+ ---
9
+
10
+ # Resolve the current Indexer Gate
11
+
12
+ Use this Skill only when the current Indexer Route exposes it as
13
+ `gate.resolution_action`. Read the Route input and the resolution Action output
14
+ schema before deciding.
15
+
16
+ For `stage: structure-review`, inspect the complete semantic structure Resource
17
+ and return either `approved` or `request-adjustment`. Include specific feedback
18
+ when requesting adjustment.
19
+
20
+ For `stage: layout-confirmation`, use the supplied change reports and the
21
+ user's decision. Return either `approved` or `rejected`. Include specific
22
+ feedback when rejecting. A non-delegatable layout Gate must not be approved on
23
+ the user's behalf.
24
+
25
+ Submit exactly one existing `context.indexer.current-action-input/v2` value to
26
+ the Route's completion command. Do not invent a lifecycle continuation
27
+ envelope, a second approval protocol, or additional audit data.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: context-resolve-current-indexer-provider
3
+ description: Resolve the exact Host-backed Provider request selected by the current Context workflow Route.
4
+ metadata:
5
+ agent-graph: path:../../provider.yaml
6
+ agent-graph.graph: indexer
7
+ agent-graph.entry: current-provider-resolution
8
+ ---
9
+
10
+ # Resolve the current Indexer Provider
11
+
12
+ Use only the Host Action Resource required by the current Route. Materialize that Resource once and
13
+ return one `context.indexer.current-action-input/v2` value with `stage` set to
14
+ `provider-resolution` and `result` set to the complete Host Action result. If the Host also returns
15
+ the managed output named by the Route, include it as `managed_output` without changing its ref,
16
+ digest, or value.
17
+
18
+ Do not discover another Provider, substitute a version, read Provider files directly, or recreate
19
+ the Host result. Submit the value to the Route's only `complete-current` command and then follow the
20
+ newly returned Route.
@@ -1,32 +1,39 @@
1
1
  ---
2
2
  name: context-run-indexer-agent-step
3
- description: Execute one Context-authorized Indexer workset using only the current Route input, resolved Provider instructions, and authorized workset View.
3
+ description: Execute one bounded batch of Context-authorized Indexer worksets using the current Route input, shared Provider instructions, and each task's authorized View.
4
4
  metadata:
5
5
  agent-graph: path:../../provider.yaml
6
6
  agent-graph.graph: indexer
7
7
  agent-graph.entry: agent-step
8
8
  ---
9
9
 
10
- # Run one Indexer Agent step
10
+ # Run one bounded Indexer Agent batch
11
11
 
12
12
  Read the current Route action input and every required Resource marked `read-required`.
13
- Use only the materialized `resolved-indexer-instructions`, the supplied workset authority,
14
- and the single `authorized-indexer-workset-view`. The View already contains the exact facts,
15
- dependencies, Provider fragments, and Author authority authorized for this workset. Do not
13
+ Use only the materialized `resolved-indexer-instructions`, the supplied transport worksets,
14
+ and each task's `authorized-indexer-workset-view/task-NNN`. Match Views and outputs only through
15
+ the short `task_key`; do not copy internal digests into the semantic result. Each View contains the
16
+ exact facts, dependencies, Provider fragments, and Author authority authorized for that task. Do not
16
17
  construct evidence read requests, manage pages or cursors, discover another Skill, read a
17
18
  Provider path, widen source scope, run an unauthorized Indexer or parser, or invent missing
18
19
  evidence.
19
20
 
20
- Author the stage-specific operation Result described by the Action output schema. Copy dynamic
21
- authority values only from the Route input or authorized View; in particular,
22
- `consumed_input_view_digest` means `run_request.composition_input.view_digest`, not the
23
- authorized View's own digest.
21
+ Return exactly one `results[]` entry for every task in the current batch, in task-key order. Each
22
+ entry carries its `task_key` and the existing stage-specific semantic Result. A single-task batch
23
+ still uses the same array shape. Copy dynamic authority values only from the Route input or that
24
+ task's authorized View.
24
25
 
25
26
  For a Partition Result, read `partition-authority` before choosing each group subject. A string
26
27
  changes only the local key and preserves `base_subject_key` namespace and kind. Use an explicit
27
28
  subject object only when its kind is listed in `subject_key_contract.kinds`; never invent a kind
28
29
  from a page title, operation name, framework term, or business vocabulary.
29
30
 
31
+ `subject_intent` describes the reader-subject outcome, not the source file's role. Use `primary`
32
+ when the group owns a reader subject. Use `enrich-or-independent` for a publishable supplemental
33
+ view such as test or example behavior: Context reuses a matching subject when available and creates
34
+ an independent subject otherwise. Do not emit `supporting`; material that must never become a reader
35
+ subject must not be emitted as a group.
36
+
30
37
  For an Author Result, a selected parser Fact is an immutable projection, not material for a new
31
38
  Fact shape. Build it only from the matching View items:
32
39
 
@@ -39,8 +46,14 @@ Fact shape. Build it only from the matching View items:
39
46
 
40
47
  Build each EvidenceBinding from that same source-span dependency's `evidence_ref`, `source_ref`,
41
48
  `module_ref`, `locator`, and `content_digest`. Do not infer a new locator or digest from prose.
42
- Do not invent or manually copy read-receipt, execution-receipt, or stable-result digests. The Host
43
- integration must use Context's protocol builders to derive content-addressed fields and finalize
44
- exactly `context.indexer.agent-step-result/v1`; Context performs the existing dependency, schema,
45
- owner, scope, and workset validation before reporting success. Never report success merely because
46
- the envelope or prose looks valid.
49
+ For behavior, read the Author View's `source-text` items. Their `spans` contain the authorized
50
+ source lines; `source_span_refs` link back to existing dependency nodes, not new evidence identities.
51
+ Overlapping ranges appear once. A signature or call name alone does not establish behavior absent
52
+ from those lines. Do not copy these process-only carriers into reader Markdown.
53
+ Do not invent or manually copy read-receipt, execution-receipt, or stable-result digests. Submit
54
+ exactly `context.indexer.current-action-input/v2` through the Route's completion command; Context
55
+ derives internal envelopes and performs dependency, schema, owner, scope, and per-workset validation
56
+ before reporting each task accepted. Read the completion's `outcomes`, then continue directly from
57
+ its `next` Route and ready Resource paths. Do not run `context status` or either Resource materializer
58
+ between successful batches. A failed item is retried from its returned task-only skeleton; already
59
+ accepted peers are not repeated. Never report success merely because the envelope or prose looks valid.
@@ -18,20 +18,25 @@ Read
18
18
  `node_modules/@c4a/context/docs/guides/indexer-provider-and-customization.md`,
19
19
  then follow the root `context` Skill's Indexer instructions and the exact
20
20
  structured outcomes returned by `context indexer ...`. Start by forming and
21
- confirming requirements when `src/indexers.yaml` is absent or stale; otherwise
21
+ confirming requirements when `src/indexers.yaml` is absent or stale. When the
22
+ Route returns `configuration`, edit the named project file and re-evaluate;
23
+ do not submit a lifecycle Result or repeatedly run an unconfigured project. Otherwise
22
24
  continue the current registry selection, Provider resolution, execution,
23
25
  reconciliation, mechanical validation, layout, and Candidate compile subroute. The Indexer
24
26
  Graph is the authority for each substep. Never skip directly to compile and
25
27
  never synthesize a Provider Result or a default plan.
26
28
 
29
+ When the current subroute is a Gate, follow `gate.resolution_action` rather
30
+ than looking for a top-level `action`. Read its Skill and output schema, use its
31
+ Route input, and submit the resulting value through the Route completion
32
+ command. The Indexer Graph owns the Gate identity, authority, delegation and
33
+ resolution Action; do not replace them with an inferred command or handler.
34
+
27
35
  Stop on the first Host permission, non-delegatable Gate, validation failure, or
28
36
  human decision. Once current Candidates have been compiled, return control to
29
37
  `context status --format json`; the workspace Graph will select Knowledge
30
- Review. The Action output is only:
31
-
32
- ```json
33
- {
34
- "protocol": "context.indexer.lifecycle-continuation/v1",
35
- "outcome": "follow-indexer-route"
36
- }
37
- ```
38
+ Review. This outer Action has no payload of its own and must never be submitted
39
+ through `complete-current`. Context projects it to the one current Indexer
40
+ subroute; follow that Route's command and output schema exactly. If project
41
+ configuration was edited, re-run `context status --format json` to obtain the
42
+ new revision instead of inventing a lifecycle continuation result.
@@ -1,50 +1,62 @@
1
1
  ---
2
2
  name: context-run-indexer-post-author-composer
3
- description: Execute one CLI-authorized post-author composer request without changing primary facts, identity, scope, or composer selection.
3
+ description: Execute one bounded batch of CLI-authorized post-author composer tasks without changing primary facts, identity, scope, or composer selection.
4
4
  metadata:
5
5
  agent-graph: path:../../provider.yaml
6
6
  agent-graph.graph: indexer
7
7
  agent-graph.entry: post-author-composer-step
8
8
  ---
9
9
 
10
- # Run one post-author composer
10
+ # Run a post-author composer batch
11
11
 
12
12
  Read both required Route resources before acting:
13
13
 
14
14
  - `resolved-indexer-instructions` defines the selected Composer's job;
15
- - `authorized-indexer-workset-view` is the complete, bounded PrimaryResult View.
15
+ - each `authorized-indexer-workset-view/task-NNN` is one complete, bounded PrimaryResult View.
16
16
 
17
17
  Use only the target aliases and source aliases exposed by that View and the current Route.
18
18
  Do not discover another Skill or Composer, scan project files outside the View, change a
19
19
  SubjectKey, rewrite the primary Result, or widen the target set.
20
20
 
21
+ Return exactly one result for every task key in the Action input. Keep task results
22
+ independent: one empty or failed result must not replace another task's proposal.
23
+
21
24
  Return only the minimal semantic JSON accepted by the current Route:
22
25
 
23
26
  ```json
24
27
  {
25
28
  "stage": "post-author",
26
- "outcome": "complete",
27
- "proposals": [
29
+ "results": [
28
30
  {
29
- "target": "target:1",
30
- "artifact_kind": "content",
31
- "title": "Reader-facing title",
32
- "summary": "Why this derived page is useful",
33
- "sections": [
34
- {
35
- "key": "overview",
36
- "heading": "Overview",
37
- "markdown": "Reader-facing content",
38
- "source_refs": ["fact:1"]
39
- }
40
- ]
31
+ "task_key": "task-001",
32
+ "result": {
33
+ "stage": "post-author",
34
+ "outcome": "complete",
35
+ "proposals": [
36
+ {
37
+ "target": "target:1",
38
+ "artifact_kind": "content",
39
+ "title": "Reader-facing title",
40
+ "summary": "Why this derived page is useful",
41
+ "sections": [
42
+ {
43
+ "key": "overview",
44
+ "heading": "Overview",
45
+ "markdown": "Reader-facing content",
46
+ "source_refs": ["fact:1"]
47
+ }
48
+ ]
49
+ }
50
+ ],
51
+ "diagnostics": []
52
+ }
41
53
  }
42
- ],
43
- "diagnostics": []
54
+ ]
44
55
  }
45
56
  ```
46
57
 
47
- If no derived Artifact is needed, return `outcome: "complete"` with an empty
48
- `proposals` array. If the bounded inputs cannot be processed, return `outcome: "failed"`
49
- with at least one diagnostic. Context expands aliases, validates evidence and policy,
50
- creates internal fragments and digests, then resumes the same production state machine.
58
+ If a task needs no derived Artifact, return `outcome: "complete"` with an empty
59
+ `proposals` array for that task. If one bounded input cannot be processed, return
60
+ `outcome: "failed"` with at least one diagnostic for that task and still return the
61
+ other task results. Context expands aliases, validates evidence and policy, creates
62
+ internal fragments and digests, then resumes the same production state machine.
@@ -1,15 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "context.indexer.lifecycle-continuation/v1",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "required": ["protocol", "outcome"],
7
- "properties": {
8
- "protocol": {
9
- "const": "context.indexer.lifecycle-continuation/v1"
10
- },
11
- "outcome": {
12
- "const": "follow-indexer-route"
13
- }
14
- }
15
- }
@@ -1,26 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "context.indexer.layer-fragment-request/v1",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "required": ["protocol", "operation", "phase", "target_layer_ref", "target_layer_integrity", "target_bundle_digest", "allowed_fragment_kinds", "allowed_target_refs", "workset", "composer_ref", "composer_selection_entry_digest", "current_profile_binding_digest", "primary_result_view", "request_digest"],
7
- "properties": {
8
- "protocol": { "const": "context.indexer.layer-fragment-request/v1" },
9
- "operation": { "const": "main-index" },
10
- "phase": { "const": "post-author" },
11
- "target_layer_ref": { "type": "string", "minLength": 1 },
12
- "target_layer_integrity": { "$ref": "#/$defs/digest" },
13
- "target_bundle_digest": { "$ref": "#/$defs/digest" },
14
- "allowed_fragment_kinds": { "const": ["derived-artifact-proposal"] },
15
- "allowed_target_refs": { "type": "array", "items": { "type": "string" } },
16
- "workset": { "type": "object" },
17
- "composer_ref": { "type": "string", "minLength": 1 },
18
- "composer_selection_entry_digest": { "$ref": "#/$defs/digest" },
19
- "current_profile_binding_digest": { "$ref": "#/$defs/digest" },
20
- "primary_result_view": { "type": "object" },
21
- "request_digest": { "$ref": "#/$defs/digest" }
22
- },
23
- "$defs": {
24
- "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
25
- }
26
- }