@c4a/context-cli 0.6.3 → 0.6.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.
- package/README.md +23 -2
- package/README.zh-CN.md +15 -1
- package/cli.js +5121 -4008
- package/docs/context-debug-event-v1.schema.json +2 -0
- package/docs/debug-tracing.md +8 -0
- package/package.json +4 -4
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/providers/context/actions/inspect-code-extraction.yaml +5 -0
- package/providers/context/graphs/workspace.yaml +2 -1
- package/providers/context/manifest.json +41 -23
- package/providers/context/provider.yaml +1 -1
- package/providers/context/resources/dialogue/code-extraction.md +11 -0
- package/providers/context/resources/dialogue/package-output.md +9 -0
- package/providers/context/resources/manuals/guides/package-outputs.md +19 -5
- package/providers/context/resources/manuals/reference/code-extractors.md +94 -0
- package/providers/context/resources/manuals/reference/package-templates.md +63 -0
- package/providers/context/resources/manuals/reference/project-api.md +35 -0
- package/providers/context/resources/procedures/code-extraction.md +23 -0
- package/providers/context/resources/procedures/package-output.md +21 -0
- package/providers/context/resources/semantic/align/gates.md +2 -2
- package/providers/context/resources/semantic/align/structure-planning.md +8 -3
package/docs/debug-tracing.md
CHANGED
|
@@ -55,6 +55,9 @@ The event stream records:
|
|
|
55
55
|
- Agent Graph evaluation revision, status, selected route, alternatives, and
|
|
56
56
|
whether the observable graph position changed;
|
|
57
57
|
- managed workflow action start and completion with deterministic receipts;
|
|
58
|
+
- execution-scope open and close events, including whether a deterministic
|
|
59
|
+
action ran in-process or in a child process and whether every short-lived
|
|
60
|
+
resource was released;
|
|
58
61
|
- the reason and graph position at which a managed loop stopped.
|
|
59
62
|
|
|
60
63
|
`trace_id` groups the workspace-local debug history, `sequence` defines replay order,
|
|
@@ -64,6 +67,11 @@ can animate `agent-graph.evaluated` events whose `data.transition.changed` is
|
|
|
64
67
|
true, then associate intervening command and action events by sequence and
|
|
65
68
|
invocation identity.
|
|
66
69
|
|
|
70
|
+
Execution-scope events are runtime evidence, not workflow facts. They make
|
|
71
|
+
resource ownership and cleanup observable without changing a Route or adding
|
|
72
|
+
workspace state. Durable knowledge mutations are still audited through the
|
|
73
|
+
normal action receipt, revision, close, and verify results.
|
|
74
|
+
|
|
67
75
|
## Inspect and export
|
|
68
76
|
|
|
69
77
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c4a/context-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local CLI for capturing, compiling, and governing knowledge workspaces",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"node": ">=20"
|
|
21
21
|
},
|
|
22
22
|
"bin": {
|
|
23
|
-
"context": "
|
|
23
|
+
"context": "cli.js"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@c4a/agent-graph": "0.2.
|
|
27
|
-
"@c4a/context": "0.6.
|
|
26
|
+
"@c4a/agent-graph": "0.2.5",
|
|
27
|
+
"@c4a/context": "0.6.5",
|
|
28
28
|
"commander": "^11.0.0",
|
|
29
29
|
"fast-xml-parser": "^5.10.1",
|
|
30
30
|
"handlebars": "^4.7.8",
|
package/plugins/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.6.
|
|
1
|
+
0.6.5
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "c4a"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"skills": "./skills/",
|
|
19
19
|
"interface": {
|
|
20
20
|
"displayName": "C4A Context",
|
|
21
|
-
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.
|
|
21
|
+
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.5",
|
|
22
22
|
"longDescription": "Create a Context workspace and use agent-guided next steps to register sources, run extraction, review candidates, build package outputs, and verify health without silently mutating source repositories.",
|
|
23
23
|
"developerName": "c4a",
|
|
24
24
|
"category": "Productivity",
|
|
@@ -289,6 +289,7 @@ nodes:
|
|
|
289
289
|
- id: choose-extraction-scope
|
|
290
290
|
kind: gate
|
|
291
291
|
reasonCode: route.extract.scope-required
|
|
292
|
+
inspectionAction: actions/inspect-code-extraction.yaml
|
|
292
293
|
gate:
|
|
293
294
|
id: extraction-scope
|
|
294
295
|
prompt: Confirm which registered code modules and symbol boundaries should enter code knowledge.
|
|
@@ -318,7 +319,7 @@ nodes:
|
|
|
318
319
|
- resources/procedures/project-configuration.md
|
|
319
320
|
- resources/procedures/code-extraction.md
|
|
320
321
|
- resources/views/source-current.yaml
|
|
321
|
-
- resources/manuals/reference/
|
|
322
|
+
- resources/manuals/reference/code-extractors.md
|
|
322
323
|
|
|
323
324
|
- id: extract-next
|
|
324
325
|
kind: action
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"schema": "agent-graph.bundle.v1",
|
|
3
3
|
"provider": {
|
|
4
4
|
"id": "c4a/context",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.5"
|
|
6
6
|
},
|
|
7
7
|
"providerManifest": "provider.yaml",
|
|
8
8
|
"graphs": [
|
|
9
9
|
{
|
|
10
10
|
"id": "workspace",
|
|
11
11
|
"path": "graphs/workspace.yaml",
|
|
12
|
-
"digest": "sha256:
|
|
12
|
+
"digest": "sha256:83c1b8feb410398a34051810cbefffe8fc86dd44211d32e049d3007ecea24d7e"
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"actions": [
|
|
@@ -78,6 +78,11 @@
|
|
|
78
78
|
"path": "actions/extract-next.yaml",
|
|
79
79
|
"digest": "sha256:3d5e26cbdd912c9be666ce423b19456b31ab67da53c4e01a1a1c7a3dc1e6420a"
|
|
80
80
|
},
|
|
81
|
+
{
|
|
82
|
+
"id": "inspect-code-extraction",
|
|
83
|
+
"path": "actions/inspect-code-extraction.yaml",
|
|
84
|
+
"digest": "sha256:214cf9b0f9645ec7164a779ab5779ccf5b3e3132b10f8f9f666213d048f582b1"
|
|
85
|
+
},
|
|
81
86
|
{
|
|
82
87
|
"id": "inspect-document-classification",
|
|
83
88
|
"path": "actions/inspect-document-classification.yaml",
|
|
@@ -158,17 +163,17 @@
|
|
|
158
163
|
{
|
|
159
164
|
"id": "context.sdk.package-outputs",
|
|
160
165
|
"path": "resources/manuals/guides/package-outputs.md",
|
|
161
|
-
"digest": "sha256:
|
|
166
|
+
"digest": "sha256:dd9e8c21ece757a683b9ebf219d3bd6235b9a0ada43b537f143b3f2eacbb8eb9"
|
|
162
167
|
},
|
|
163
168
|
{
|
|
164
169
|
"id": "context.sdk.package-templates",
|
|
165
170
|
"path": "resources/manuals/reference/package-templates.md",
|
|
166
|
-
"digest": "sha256:
|
|
171
|
+
"digest": "sha256:c42ea22df144db608ab5dc3718704b2e42c0e7a4fe51ca322dfbe705f0619549"
|
|
167
172
|
},
|
|
168
173
|
{
|
|
169
174
|
"id": "context.sdk.project-api",
|
|
170
175
|
"path": "resources/manuals/reference/project-api.md",
|
|
171
|
-
"digest": "sha256:
|
|
176
|
+
"digest": "sha256:0e21f44f9c239abf176da0bcf4094f2b1d0085f31240b97b85a8b44d4633493e"
|
|
172
177
|
},
|
|
173
178
|
{
|
|
174
179
|
"id": "context.sdk.template-variables",
|
|
@@ -178,7 +183,7 @@
|
|
|
178
183
|
{
|
|
179
184
|
"id": "context.semantic.align.align-gates",
|
|
180
185
|
"path": "resources/semantic/align/gates.md",
|
|
181
|
-
"digest": "sha256:
|
|
186
|
+
"digest": "sha256:517be59f675022a5d9e3fa04f9b35f801a80fc32aa42084dac8bce8a45481fea"
|
|
182
187
|
},
|
|
183
188
|
{
|
|
184
189
|
"id": "context.semantic.align.candidate-resolution",
|
|
@@ -193,7 +198,7 @@
|
|
|
193
198
|
{
|
|
194
199
|
"id": "context.semantic.align.structure-planning",
|
|
195
200
|
"path": "resources/semantic/align/structure-planning.md",
|
|
196
|
-
"digest": "sha256:
|
|
201
|
+
"digest": "sha256:73d7d1cb49ad27691e7baa29003fa1736fc8a7036c6094f40f733e62fd3c1aad"
|
|
197
202
|
},
|
|
198
203
|
{
|
|
199
204
|
"id": "context.semantic.compile.index",
|
|
@@ -243,7 +248,7 @@
|
|
|
243
248
|
{
|
|
244
249
|
"id": "dialogue.code-extraction",
|
|
245
250
|
"path": "resources/dialogue/code-extraction.md",
|
|
246
|
-
"digest": "sha256:
|
|
251
|
+
"digest": "sha256:5aa3b52dcf9cd9bd058baea7dadb123eead162a1ec7640cc63c7c359e71922e3"
|
|
247
252
|
},
|
|
248
253
|
{
|
|
249
254
|
"id": "dialogue.document-capture",
|
|
@@ -273,7 +278,7 @@
|
|
|
273
278
|
{
|
|
274
279
|
"id": "dialogue.package-output",
|
|
275
280
|
"path": "resources/dialogue/package-output.md",
|
|
276
|
-
"digest": "sha256:
|
|
281
|
+
"digest": "sha256:fcf64598b9a505c764ae4984ff4d63a7010143f749ba454e220752f737306612"
|
|
277
282
|
},
|
|
278
283
|
{
|
|
279
284
|
"id": "dialogue.repository-source-recovery",
|
|
@@ -290,6 +295,11 @@
|
|
|
290
295
|
"path": "resources/dialogue/structure-confirmation.md",
|
|
291
296
|
"digest": "sha256:4f9667860bb555c2cf236237c5a21644b7a2b249a452337d83087fa4c389dc2d"
|
|
292
297
|
},
|
|
298
|
+
{
|
|
299
|
+
"id": "manual.reference.code-extractors",
|
|
300
|
+
"path": "resources/manuals/reference/code-extractors.md",
|
|
301
|
+
"digest": "sha256:6af1a9ea24b59bd5cb2125296e04d19529c92be77910e5e768251e6c4bd7902a"
|
|
302
|
+
},
|
|
293
303
|
{
|
|
294
304
|
"id": "procedure.close-and-build",
|
|
295
305
|
"path": "resources/procedures/close-and-build.md",
|
|
@@ -298,7 +308,7 @@
|
|
|
298
308
|
{
|
|
299
309
|
"id": "procedure.code-extraction",
|
|
300
310
|
"path": "resources/procedures/code-extraction.md",
|
|
301
|
-
"digest": "sha256:
|
|
311
|
+
"digest": "sha256:dce77b35fffbba51cbc8d6bc9d2abe2924229a6248eb9585b90e63ab9e05e37a"
|
|
302
312
|
},
|
|
303
313
|
{
|
|
304
314
|
"id": "procedure.document-capture",
|
|
@@ -323,7 +333,7 @@
|
|
|
323
333
|
{
|
|
324
334
|
"id": "procedure.package-output",
|
|
325
335
|
"path": "resources/procedures/package-output.md",
|
|
326
|
-
"digest": "sha256:
|
|
336
|
+
"digest": "sha256:5d93de483e668fe77c5eaabb3ae52d4d9c36f73b61e264fd40d53f7f4d008bf8"
|
|
327
337
|
},
|
|
328
338
|
{
|
|
329
339
|
"id": "procedure.project-configuration",
|
|
@@ -436,6 +446,10 @@
|
|
|
436
446
|
"path": "actions/extract-next.yaml",
|
|
437
447
|
"digest": "sha256:3d5e26cbdd912c9be666ce423b19456b31ab67da53c4e01a1a1c7a3dc1e6420a"
|
|
438
448
|
},
|
|
449
|
+
{
|
|
450
|
+
"path": "actions/inspect-code-extraction.yaml",
|
|
451
|
+
"digest": "sha256:214cf9b0f9645ec7164a779ab5779ccf5b3e3132b10f8f9f666213d048f582b1"
|
|
452
|
+
},
|
|
439
453
|
{
|
|
440
454
|
"path": "actions/inspect-document-classification.yaml",
|
|
441
455
|
"digest": "sha256:973889832e3adfba4fa019b3dfadda35fe22536c44ef97efba2299e6cdd65786"
|
|
@@ -490,11 +504,11 @@
|
|
|
490
504
|
},
|
|
491
505
|
{
|
|
492
506
|
"path": "graphs/workspace.yaml",
|
|
493
|
-
"digest": "sha256:
|
|
507
|
+
"digest": "sha256:83c1b8feb410398a34051810cbefffe8fc86dd44211d32e049d3007ecea24d7e"
|
|
494
508
|
},
|
|
495
509
|
{
|
|
496
510
|
"path": "provider.yaml",
|
|
497
|
-
"digest": "sha256:
|
|
511
|
+
"digest": "sha256:bcf4649a83ca09e4562f83ab8919bdfcaa1134866706506876ce6172a393856c"
|
|
498
512
|
},
|
|
499
513
|
{
|
|
500
514
|
"path": "resources/diagnostics/projection-stale.md",
|
|
@@ -510,7 +524,7 @@
|
|
|
510
524
|
},
|
|
511
525
|
{
|
|
512
526
|
"path": "resources/dialogue/code-extraction.md",
|
|
513
|
-
"digest": "sha256:
|
|
527
|
+
"digest": "sha256:5aa3b52dcf9cd9bd058baea7dadb123eead162a1ec7640cc63c7c359e71922e3"
|
|
514
528
|
},
|
|
515
529
|
{
|
|
516
530
|
"path": "resources/dialogue/document-capture.md",
|
|
@@ -534,7 +548,7 @@
|
|
|
534
548
|
},
|
|
535
549
|
{
|
|
536
550
|
"path": "resources/dialogue/package-output.md",
|
|
537
|
-
"digest": "sha256:
|
|
551
|
+
"digest": "sha256:fcf64598b9a505c764ae4984ff4d63a7010143f749ba454e220752f737306612"
|
|
538
552
|
},
|
|
539
553
|
{
|
|
540
554
|
"path": "resources/dialogue/repository-source-recovery.md",
|
|
@@ -554,15 +568,19 @@
|
|
|
554
568
|
},
|
|
555
569
|
{
|
|
556
570
|
"path": "resources/manuals/guides/package-outputs.md",
|
|
557
|
-
"digest": "sha256:
|
|
571
|
+
"digest": "sha256:dd9e8c21ece757a683b9ebf219d3bd6235b9a0ada43b537f143b3f2eacbb8eb9"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"path": "resources/manuals/reference/code-extractors.md",
|
|
575
|
+
"digest": "sha256:6af1a9ea24b59bd5cb2125296e04d19529c92be77910e5e768251e6c4bd7902a"
|
|
558
576
|
},
|
|
559
577
|
{
|
|
560
578
|
"path": "resources/manuals/reference/package-templates.md",
|
|
561
|
-
"digest": "sha256:
|
|
579
|
+
"digest": "sha256:c42ea22df144db608ab5dc3718704b2e42c0e7a4fe51ca322dfbe705f0619549"
|
|
562
580
|
},
|
|
563
581
|
{
|
|
564
582
|
"path": "resources/manuals/reference/project-api.md",
|
|
565
|
-
"digest": "sha256:
|
|
583
|
+
"digest": "sha256:0e21f44f9c239abf176da0bcf4094f2b1d0085f31240b97b85a8b44d4633493e"
|
|
566
584
|
},
|
|
567
585
|
{
|
|
568
586
|
"path": "resources/manuals/reference/template-variables.md",
|
|
@@ -574,7 +592,7 @@
|
|
|
574
592
|
},
|
|
575
593
|
{
|
|
576
594
|
"path": "resources/procedures/code-extraction.md",
|
|
577
|
-
"digest": "sha256:
|
|
595
|
+
"digest": "sha256:dce77b35fffbba51cbc8d6bc9d2abe2924229a6248eb9585b90e63ab9e05e37a"
|
|
578
596
|
},
|
|
579
597
|
{
|
|
580
598
|
"path": "resources/procedures/document-capture.md",
|
|
@@ -594,7 +612,7 @@
|
|
|
594
612
|
},
|
|
595
613
|
{
|
|
596
614
|
"path": "resources/procedures/package-output.md",
|
|
597
|
-
"digest": "sha256:
|
|
615
|
+
"digest": "sha256:5d93de483e668fe77c5eaabb3ae52d4d9c36f73b61e264fd40d53f7f4d008bf8"
|
|
598
616
|
},
|
|
599
617
|
{
|
|
600
618
|
"path": "resources/procedures/project-configuration.md",
|
|
@@ -634,11 +652,11 @@
|
|
|
634
652
|
},
|
|
635
653
|
{
|
|
636
654
|
"path": "resources/semantic/align/gates.md",
|
|
637
|
-
"digest": "sha256:
|
|
655
|
+
"digest": "sha256:517be59f675022a5d9e3fa04f9b35f801a80fc32aa42084dac8bce8a45481fea"
|
|
638
656
|
},
|
|
639
657
|
{
|
|
640
658
|
"path": "resources/semantic/align/structure-planning.md",
|
|
641
|
-
"digest": "sha256:
|
|
659
|
+
"digest": "sha256:73d7d1cb49ad27691e7baa29003fa1736fc8a7036c6094f40f733e62fd3c1aad"
|
|
642
660
|
},
|
|
643
661
|
{
|
|
644
662
|
"path": "resources/semantic/compile/index.md",
|
|
@@ -696,5 +714,5 @@
|
|
|
696
714
|
"graphDependencies": {
|
|
697
715
|
"workspace": []
|
|
698
716
|
},
|
|
699
|
-
"digest": "sha256:
|
|
717
|
+
"digest": "sha256:b6e58683cf5ef86192337938b45e2bc4cbafb2512944786e9ab9e76a438dfa94"
|
|
700
718
|
}
|
|
@@ -16,11 +16,22 @@ Describe the proposed code scope before SDK fields. State:
|
|
|
16
16
|
- that the first run or later deltas produce Review candidates rather than
|
|
17
17
|
approved Markdown.
|
|
18
18
|
|
|
19
|
+
Also state the inspected manifest signals and the chosen extractor in one
|
|
20
|
+
sentence. Say whether the selected capability covers the module directly or
|
|
21
|
+
whether a project-owned adapter supplies the missing mapping. Do not ask the
|
|
22
|
+
user to choose between parser package names unless two genuinely incompatible
|
|
23
|
+
technical choices remain.
|
|
24
|
+
|
|
19
25
|
If a selected package lacks a standard entry, offer two Context-owned choices:
|
|
20
26
|
configure source-relative API roots, or use scan mode for all declarations in
|
|
21
27
|
the confirmed file scope. Do not ask the user to change source code or package
|
|
22
28
|
metadata to satisfy Context.
|
|
23
29
|
|
|
30
|
+
For a non-TypeScript source or an aggregated repository protocol, explain that
|
|
31
|
+
the project will use `extractCustom()`. If an optional structural extractor is
|
|
32
|
+
available, use it for syntax facts and keep project-specific classification in
|
|
33
|
+
the project callback; do not imply that installing it adds a new CLI phase.
|
|
34
|
+
|
|
24
35
|
Run the route-selected dry-run first. Report discovered, AST-analyzed, skipped,
|
|
25
36
|
symbol, relation, and candidate counts separately, plus resolved entries,
|
|
26
37
|
exported/internal counts, symbol-kind counts, and the proposed knowledge tree.
|
|
@@ -25,6 +25,15 @@ package namespace. Ask whether Skills need a short optional prefix, then
|
|
|
25
25
|
maintain their complete final names in the template. Do not expose downstream
|
|
26
26
|
layout terminology or ask for platform-specific identity fields.
|
|
27
27
|
|
|
28
|
+
Also ask how referenced resources should be delivered. Offer Git raw links,
|
|
29
|
+
bundled files, or explicit omission. Git raw may derive a commit-pinned GitHub
|
|
30
|
+
URL when the workspace is in Git, or use an author-provided HTTPS `urlPrefix`
|
|
31
|
+
for resources published from another repository. A literal branch in that
|
|
32
|
+
prefix is an explicit project choice, not a Context default. If neither local
|
|
33
|
+
Git nor an explicit prefix is available, offer only bundle or omit.
|
|
34
|
+
State that publishing the referenced resources and making private raw hosts
|
|
35
|
+
reachable are the package author's responsibility; Context does not probe them.
|
|
36
|
+
|
|
28
37
|
Do not offer a hidden `both` shortcut. If the user wants multiple outputs,
|
|
29
38
|
declare and inspect one first, then obtain confirmation for the next. Mention
|
|
30
39
|
`kbPackage` and `llmsPackage` only after the semantic output choice.
|
|
@@ -96,11 +96,25 @@ task workflows. Authors may explicitly accept the generic default when it is
|
|
|
96
96
|
intentionally sufficient.
|
|
97
97
|
|
|
98
98
|
When approved pages reference materialized document resources, Context keeps
|
|
99
|
-
their production copies in content-addressed `knowledge/assets/` paths.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
their production copies in content-addressed `knowledge/assets/` paths. New KB
|
|
100
|
+
setup should offer Git raw delivery first. It rewrites package links to either
|
|
101
|
+
an automatically derived raw prefix or an explicit author-provided prefix.
|
|
102
|
+
Context does not check whether resource files are committed, pushed, or
|
|
103
|
+
remotely readable; that is the package author's responsibility. With no
|
|
104
|
+
explicit prefix, supported remotes use an immutable commit URL. An explicit
|
|
105
|
+
prefix can contain `{commit}` when the Context workspace is in Git, or name a
|
|
106
|
+
mutable branch when that lifecycle is intentional; a literal prefix also works
|
|
107
|
+
when resources are published from a separate repository.
|
|
108
|
+
|
|
109
|
+
Workspaces without usable Git or an explicit raw prefix can choose bundled
|
|
110
|
+
delivery, which copies only selected resources to `others/assets/`, or explicit
|
|
111
|
+
omission, which does not copy resources and reports that links remain
|
|
112
|
+
unresolved. Bundled output may
|
|
113
|
+
optionally install `sharp` in the workspace and configure
|
|
114
|
+
`assets.optimize`; Context itself has no image dependency. Optimization changes
|
|
115
|
+
only `dist/`, content-addresses smaller WebP output, and leaves `sources/` and
|
|
116
|
+
`knowledge/assets/` unchanged. Source audit XML and capture reports are never
|
|
117
|
+
distributed as reader assets. See [Lark Resource Materialization](./lark-resources.md).
|
|
104
118
|
|
|
105
119
|
The same inventory exposes `structure.relationship_coverage`. It records
|
|
106
120
|
whether selected codegraph pages have current source-backed AST relationship
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: manual.reference.code-extractors
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Extractor Selection
|
|
8
|
+
|
|
9
|
+
Use this manual only when the current code-extraction Route asks the Agent to
|
|
10
|
+
choose or declare an extractor. The CLI reports repository facts; the Agent
|
|
11
|
+
chooses how those facts become source-backed code knowledge.
|
|
12
|
+
|
|
13
|
+
## Inspect Before Declaring
|
|
14
|
+
|
|
15
|
+
Run every read-only inspection command returned by the extraction-scope Gate.
|
|
16
|
+
The result identifies each confirmed module and its recognized `manifests`.
|
|
17
|
+
Treat these as deterministic technology signals, not as product semantics:
|
|
18
|
+
|
|
19
|
+
| Signal | Technology candidate |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `package.json` | TypeScript, TSX, JavaScript, or JSX |
|
|
22
|
+
| `go.mod` | Go |
|
|
23
|
+
| `Cargo.toml` | Rust |
|
|
24
|
+
| `pyproject.toml` or `setup.py` | Python |
|
|
25
|
+
| `pom.xml` or `build.gradle` | Java or JVM |
|
|
26
|
+
| multiple manifests | a mixed module that may need more than one extractor |
|
|
27
|
+
|
|
28
|
+
Do not select `extractTs()` merely because a repository contains some
|
|
29
|
+
TypeScript. Decide against the exact confirmed module and include boundary. A
|
|
30
|
+
mixed module may compose multiple structural passes; parser selection is not an
|
|
31
|
+
exclusive repository-wide switch.
|
|
32
|
+
|
|
33
|
+
## Selection Order
|
|
34
|
+
|
|
35
|
+
Use the narrowest reusable capability that covers the confirmed source:
|
|
36
|
+
|
|
37
|
+
1. Use a Context-owned phase when its contract matches the source.
|
|
38
|
+
2. Otherwise use a reusable structural package inside `extractCustom()`.
|
|
39
|
+
3. If no reusable package covers the syntax or repository protocol, implement a
|
|
40
|
+
project-owned adapter and keep it in the Context workspace.
|
|
41
|
+
|
|
42
|
+
Current reusable capabilities are:
|
|
43
|
+
|
|
44
|
+
| Source fact | Preferred capability | Lifecycle integration |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| TypeScript/TSX package or file scope | `extractTs()` | Context-owned phase |
|
|
47
|
+
| Go declarations, imports, calls, and common HTTP routes | `@c4a/extract-go` | call from `extractCustom()` |
|
|
48
|
+
| Rush workspace packages, tags, dependencies, entries, and owners | `@c4a/extract-rush` | call from `extractCustom()`; may complement a language extractor |
|
|
49
|
+
| React Router route declarations | `extractReactRouterRoutes()` from `@c4a/extract-ts` | call from `extractCustom()`; complements TypeScript symbols |
|
|
50
|
+
| Rust, Python, Java/JVM, or an unsupported framework/protocol | no assumed built-in parser | project-owned `extractCustom()` adapter |
|
|
51
|
+
|
|
52
|
+
An optional package does not create a new CLI phase. Add it as an explicit
|
|
53
|
+
workspace dependency, then map its structural facts to candidates in the
|
|
54
|
+
project callback. Do not add a parser package when its documented coverage does
|
|
55
|
+
not match the inspected source.
|
|
56
|
+
|
|
57
|
+
## Read The Contract Before Extending
|
|
58
|
+
|
|
59
|
+
Before editing `src/index.ts`, read the relevant installed public manual or
|
|
60
|
+
package README. Do not infer APIs from bundled JavaScript.
|
|
61
|
+
|
|
62
|
+
- Context lifecycle and `extractCustom()`:
|
|
63
|
+
`node_modules/@c4a/context/docs/reference/project-api.md`
|
|
64
|
+
- Generic plugin protocol:
|
|
65
|
+
`node_modules/@c4a/extract/README.md`
|
|
66
|
+
- TypeScript:
|
|
67
|
+
`node_modules/@c4a/extract-ts/README.md`
|
|
68
|
+
- Go:
|
|
69
|
+
`node_modules/@c4a/extract-go/README.md`
|
|
70
|
+
- Rush:
|
|
71
|
+
`node_modules/@c4a/extract-rush/README.md`
|
|
72
|
+
|
|
73
|
+
If an optional package is not installed, use this capability matrix to decide
|
|
74
|
+
whether it is relevant, add only that dependency, and then read its shipped
|
|
75
|
+
README before implementing the callback.
|
|
76
|
+
|
|
77
|
+
A project-owned adapter may use an existing parser, compiler API, or command
|
|
78
|
+
whose output is deterministic. It must return source-backed candidates through
|
|
79
|
+
`extractCustom()`; it must not write lifecycle, knowledge, or Review files.
|
|
80
|
+
Framework-specific classification and rendering remain in the project. The CLI
|
|
81
|
+
and structural parser must not infer product meaning.
|
|
82
|
+
|
|
83
|
+
## Decision To Report
|
|
84
|
+
|
|
85
|
+
Before the first extraction preview, state briefly:
|
|
86
|
+
|
|
87
|
+
- the inspected module and manifest signals;
|
|
88
|
+
- the selected Context phase or structural package;
|
|
89
|
+
- whether coverage is complete or which facts remain project-owned; and
|
|
90
|
+
- why another available extractor is not needed.
|
|
91
|
+
|
|
92
|
+
If no current capability can parse the source reliably, stop at configuration
|
|
93
|
+
and report the missing generic capability. Do not silently emit an empty
|
|
94
|
+
codegraph or reuse an unrelated parser.
|
|
@@ -37,6 +37,10 @@ kbPackage({
|
|
|
37
37
|
foldDirectoryIndexes: true,
|
|
38
38
|
maxInlineEntries: 50,
|
|
39
39
|
},
|
|
40
|
+
assets: {
|
|
41
|
+
delivery: "git-raw",
|
|
42
|
+
urlPrefix: "https://code.example.com/team/knowledge/raw/{commit}",
|
|
43
|
+
},
|
|
40
44
|
});
|
|
41
45
|
```
|
|
42
46
|
|
|
@@ -58,8 +62,67 @@ llmsPackage({
|
|
|
58
62
|
| `template` | yes | Project-relative template directory or `{ path, vars }`. |
|
|
59
63
|
| `select` | no | Approved knowledge selector. Omit to include all approved knowledge. Supports internal `collections`, OKF `okfRoots`, and `include` / `exclude` path patterns relative to `knowledge/`. |
|
|
60
64
|
| `navigation` | no | KB directory-index policy. Defaults to `{ foldDirectoryIndexes: true, maxInlineEntries: 50 }`. |
|
|
65
|
+
| `assets` | no | Resource delivery: Git raw links, bundled files, or explicit omission. New KB setup should offer Git raw first. Omit for legacy byte-for-byte bundling. |
|
|
61
66
|
| `distribution` | no | Legacy input accepted from older workspaces. It no longer changes package paths and should not be added to new declarations. |
|
|
62
67
|
|
|
68
|
+
Use Git raw delivery when resources are published from a Git repository.
|
|
69
|
+
Without `urlPrefix`, the Context workspace must be inside Git; GitHub remotes
|
|
70
|
+
are derived automatically and pinned to the current commit. Other hosts accept
|
|
71
|
+
an explicit HTTPS prefix. `{commit}` is replaced only when the workspace is
|
|
72
|
+
inside Git, because Context must resolve the current commit. A workspace outside
|
|
73
|
+
Git must use a literal, already-published prefix without `{commit}`. Context
|
|
74
|
+
appends the project-relative `knowledge/assets/...` path.
|
|
75
|
+
|
|
76
|
+
The resolved commit and raw URL participate in package freshness, so changing
|
|
77
|
+
Git HEAD or the selected remote makes an existing package stale. Context does
|
|
78
|
+
not check whether resources are committed, pushed, or remotely readable;
|
|
79
|
+
publishing them is the package author's responsibility. A literal branch in the
|
|
80
|
+
prefix is allowed but intentionally follows that mutable branch. The configured
|
|
81
|
+
raw host must be reachable by the eventual package consumers.
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
assets: {
|
|
85
|
+
delivery: "git-raw",
|
|
86
|
+
urlPrefix: "https://code.example.com/team/knowledge/raw/{commit}",
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Outside Git, use a literal published prefix or choose bundled delivery or
|
|
91
|
+
explicit omission:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
assets: {
|
|
95
|
+
delivery: "git-raw",
|
|
96
|
+
urlPrefix: "https://code.example.com/team/knowledge/raw/published-assets",
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
assets: { delivery: "bundle" }
|
|
102
|
+
assets: { delivery: "omit" } // keeps unresolved links and reports them
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Bundled resources are copied byte-for-byte unless image optimization is
|
|
106
|
+
configured. When optimizable PNG/JPEG resources exceed 20 MiB, build and status
|
|
107
|
+
return `package.assets.optimization-recommended`. To optimize bundled output:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
bun add -D sharp
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
assets: {
|
|
115
|
+
delivery: "bundle",
|
|
116
|
+
optimize: { processor: "sharp", mode: "lossless-webp" },
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`optimize.mode: "webp"` additionally accepts `quality` from 1 to 100. Both modes accept
|
|
121
|
+
an optional positive `maxDimension`; images are never enlarged. Context adopts
|
|
122
|
+
a generated image only when it is smaller, uses a digest-derived `.webp` path,
|
|
123
|
+
and rewrites package links. A configured but missing processor blocks before
|
|
124
|
+
the previous `dist/` package is replaced.
|
|
125
|
+
|
|
63
126
|
`template` is required. Do not call `kbPackage({ name })` or
|
|
64
127
|
`llmsPackage({ name })`.
|
|
65
128
|
|
|
@@ -745,6 +745,41 @@ Review summary and source-backed evidence). It must not write `knowledge/`,
|
|
|
745
745
|
Review snapshots directly. Context owns those files and preserves rejected and
|
|
746
746
|
unchanged-approved decisions across reruns.
|
|
747
747
|
|
|
748
|
+
#### Optional structural extractors
|
|
749
|
+
|
|
750
|
+
For the manifest-to-capability decision and unsupported-language extension
|
|
751
|
+
boundary, read [Code Extractor Selection](./code-extractors.md) before declaring
|
|
752
|
+
the phase.
|
|
753
|
+
|
|
754
|
+
`extractCustom()` may consume optional community packages without making them
|
|
755
|
+
Context CLI dependencies:
|
|
756
|
+
|
|
757
|
+
```ts
|
|
758
|
+
import { indexGoRepository } from "@c4a/extract-go";
|
|
759
|
+
import { extractCustom } from "@c4a/context";
|
|
760
|
+
|
|
761
|
+
extractCustom({
|
|
762
|
+
id: "extract:service:codegraph",
|
|
763
|
+
sources: [service],
|
|
764
|
+
collection: "codegraph",
|
|
765
|
+
extract: async ({ projectRoot }) => {
|
|
766
|
+
const facts = await indexGoRepository(resolveServiceCheckout(projectRoot));
|
|
767
|
+
return { candidates: buildServiceCandidates(facts) };
|
|
768
|
+
},
|
|
769
|
+
});
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
Available structural libraries include:
|
|
773
|
+
|
|
774
|
+
- `@c4a/extract-go`: Go declarations, imports, calls, and common HTTP routes;
|
|
775
|
+
- `@c4a/extract-rush`: Rush projects, tags, entries, dependencies, and owners;
|
|
776
|
+
- `@c4a/extract-ts`: TypeScript extraction and `extractReactRouterRoutes()`.
|
|
777
|
+
|
|
778
|
+
The packages return syntax and repository facts only. They do not classify
|
|
779
|
+
product meaning, choose candidate identities, or write lifecycle state. The
|
|
780
|
+
knowledge project owns that mapping. Context CLI does not auto-install these
|
|
781
|
+
packages and does not expose a built-in Go or Rush phase.
|
|
782
|
+
|
|
748
783
|
### `reviewValidity`
|
|
749
784
|
|
|
750
785
|
Declare the review step for a collection:
|