@c4a/context-cli 0.6.1-beta.4 → 0.6.1-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/context-cli",
3
- "version": "0.6.1-beta.4",
3
+ "version": "0.6.1-beta.5",
4
4
  "type": "module",
5
5
  "description": "Local CLI for capturing, compiling, and governing knowledge workspaces",
6
6
  "license": "MIT",
@@ -21,8 +21,9 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@c4a/agent-graph": "0.2.3",
24
- "@c4a/context": "0.6.1-beta.4",
24
+ "@c4a/context": "0.6.1-beta.5",
25
25
  "commander": "^11.0.0",
26
+ "fast-xml-parser": "^5.10.1",
26
27
  "handlebars": "^4.7.8",
27
28
  "ink": "^5.0.0",
28
29
  "jiti": "^2.7.0",
package/plugins/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1-beta.4
1
+ 0.6.1-beta.5
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "context",
3
3
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
4
- "version": "0.6.1-beta.4",
4
+ "version": "0.6.1-beta.5",
5
5
  "author": {
6
6
  "name": "c4a"
7
7
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context",
3
- "version": "0.6.1-beta.4",
3
+ "version": "0.6.1-beta.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.1-beta.4",
21
+ "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.1-beta.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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "context",
3
3
  "displayName": "C4A Context",
4
- "version": "0.6.1-beta.4",
4
+ "version": "0.6.1-beta.5",
5
5
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
6
6
  "author": {
7
7
  "name": "Context4AI",
@@ -2,7 +2,7 @@
2
2
  "schema": "agent-graph.bundle.v1",
3
3
  "provider": {
4
4
  "id": "c4a/context",
5
- "version": "0.6.1-beta.4"
5
+ "version": "0.6.1-beta.5"
6
6
  },
7
7
  "providerManifest": "provider.yaml",
8
8
  "graphs": [
@@ -153,7 +153,7 @@
153
153
  {
154
154
  "id": "context.sdk.project-api",
155
155
  "path": "resources/manuals/reference/project-api.md",
156
- "digest": "sha256:9156aeb7142cfe1412d20378564f6c04645015d86bde51d004852d3478c2013c"
156
+ "digest": "sha256:c3a306c5022de31f501211a23bdbceb741d6069b087c138a6db70bd8071e87dd"
157
157
  },
158
158
  {
159
159
  "id": "context.sdk.template-variables",
@@ -273,7 +273,7 @@
273
273
  {
274
274
  "id": "procedure.code-extraction",
275
275
  "path": "resources/procedures/code-extraction.md",
276
- "digest": "sha256:35e32f68c2e3142271e178964fb08079e340cf2b7ea3f7714121e951248d2e08"
276
+ "digest": "sha256:0563be260b3c37f1c7a1a9c831ba3a0c01a872ec3ddc64fd28d414e3c876f7e2"
277
277
  },
278
278
  {
279
279
  "id": "procedure.document-capture",
@@ -318,12 +318,12 @@
318
318
  {
319
319
  "id": "procedure.source-boundary",
320
320
  "path": "resources/procedures/source-boundary.md",
321
- "digest": "sha256:6ae8d7f2477fedf32c5550adb8b7ab79d5fd1ab74c8748bc56b2fcfcd2734330"
321
+ "digest": "sha256:ccd32232599c90312a1fac930363bc7486ede1842a702a524cdc2fe4ce9a1467"
322
322
  },
323
323
  {
324
324
  "id": "procedure.source-capture-detailed",
325
325
  "path": "resources/procedures/source-capture-detailed.md",
326
- "digest": "sha256:fa7e10572ecec08e5fda44a0e6ff38d019ff6d35a7533f8185f743bca835c196"
326
+ "digest": "sha256:c62f54d99adc3d4e7902e10ed3bf4ca066ddb5d85949d8ea44e6800f8c699c3f"
327
327
  },
328
328
  {
329
329
  "id": "procedure.verify-and-repair",
@@ -451,7 +451,7 @@
451
451
  },
452
452
  {
453
453
  "path": "provider.yaml",
454
- "digest": "sha256:eeb8cce29af50ee696ff1594ab705992afac9c04ac2ad48831f0bd69aeb99f78"
454
+ "digest": "sha256:6c17411a95ef31e6b29eff1bc4a2ed89421cb126852cfaffd6fb5c553ef96cd8"
455
455
  },
456
456
  {
457
457
  "path": "resources/diagnostics/projection-stale.md",
@@ -511,7 +511,7 @@
511
511
  },
512
512
  {
513
513
  "path": "resources/manuals/reference/project-api.md",
514
- "digest": "sha256:9156aeb7142cfe1412d20378564f6c04645015d86bde51d004852d3478c2013c"
514
+ "digest": "sha256:c3a306c5022de31f501211a23bdbceb741d6069b087c138a6db70bd8071e87dd"
515
515
  },
516
516
  {
517
517
  "path": "resources/manuals/reference/template-variables.md",
@@ -523,7 +523,7 @@
523
523
  },
524
524
  {
525
525
  "path": "resources/procedures/code-extraction.md",
526
- "digest": "sha256:35e32f68c2e3142271e178964fb08079e340cf2b7ea3f7714121e951248d2e08"
526
+ "digest": "sha256:0563be260b3c37f1c7a1a9c831ba3a0c01a872ec3ddc64fd28d414e3c876f7e2"
527
527
  },
528
528
  {
529
529
  "path": "resources/procedures/document-capture.md",
@@ -559,11 +559,11 @@
559
559
  },
560
560
  {
561
561
  "path": "resources/procedures/source-boundary.md",
562
- "digest": "sha256:6ae8d7f2477fedf32c5550adb8b7ab79d5fd1ab74c8748bc56b2fcfcd2734330"
562
+ "digest": "sha256:ccd32232599c90312a1fac930363bc7486ede1842a702a524cdc2fe4ce9a1467"
563
563
  },
564
564
  {
565
565
  "path": "resources/procedures/source-capture-detailed.md",
566
- "digest": "sha256:fa7e10572ecec08e5fda44a0e6ff38d019ff6d35a7533f8185f743bca835c196"
566
+ "digest": "sha256:c62f54d99adc3d4e7902e10ed3bf4ca066ddb5d85949d8ea44e6800f8c699c3f"
567
567
  },
568
568
  {
569
569
  "path": "resources/procedures/verify-and-repair.md",
@@ -633,5 +633,5 @@
633
633
  "graphDependencies": {
634
634
  "workspace": []
635
635
  },
636
- "digest": "sha256:205b1a6b67593d9ef793fb6468bb5bb03f534bd37a16aa762cb6689a43bc2a00"
636
+ "digest": "sha256:219c68c8c55ac6cfe34d968bc96271fc418ad31f0b6bf4c5ef48998292a2dad9"
637
637
  }
@@ -1,6 +1,6 @@
1
1
  schema: agent-graph.provider.v1
2
2
  id: c4a/context
3
- version: 0.6.1-beta.4
3
+ version: 0.6.1-beta.5
4
4
  name: Context workflow
5
5
  description: Internal work contract for Context knowledge workspaces.
6
6
  graphs:
@@ -338,9 +338,17 @@ Register each source with
338
338
  flag: `--url`, `--doc-token`, or `--wiki-token`. Multiple documents may share
339
339
  one date batch; when `--module` is omitted, the CLI derives an opaque,
340
340
  credential-safe module id. Capture reads the
341
- remote document through the CLI runner, writes normalized snapshot files under
342
- `sources/lark/<date>/` as sibling document files tracked by one date-level `manifest.json`, and does not write access credentials into the
343
- workspace.
341
+ remote document through the CLI runner as structured Docx XML. Context keeps a
342
+ redacted XML audit asset, projects supported blocks deterministically into
343
+ readable Markdown, and registers external resources such as document citations,
344
+ images, video, whiteboards, and Base references in the snapshot manifest even
345
+ when their binary content is not downloaded. The projection does not infer or
346
+ summarize document meaning. Its fidelity report closes discovered blocks against
347
+ converted and intentionally skipped blocks; a non-empty unsupported block is a
348
+ fidelity error and prevents downstream Review until capture support is fixed.
349
+ Snapshot files live under `sources/lark/<date>/` as sibling document files
350
+ tracked by one date-level `manifest.json`. Access credentials and transient
351
+ signed media URLs are not written into the workspace.
344
352
 
345
353
  Use a typed document reference in project declarations:
346
354
 
@@ -648,6 +656,56 @@ lookup exact when multiple files contain the same symbol name, kind, and digest;
648
656
  the complete ref remains opaque to agents. New pages keep only top-level
649
657
  `candidate_fingerprint` and do not emit `code_origin`.
650
658
 
659
+ ### `extractCustom`
660
+
661
+ Use a project-owned extractor when code facts cannot be represented by the
662
+ TypeScript symbol extractor, for example a language-specific parser or an
663
+ aggregated repository protocol:
664
+
665
+ ```ts
666
+ extractCustom({
667
+ id: "extract:service:protocol",
668
+ sources: [service],
669
+ collection: "codegraph",
670
+ extract: async ({ projectRoot }) => ({
671
+ candidates: [{
672
+ nodeRef: "service/protocol",
673
+ kind: "protocol",
674
+ visibility: "exported",
675
+ module: "service",
676
+ markdown: renderProtocol(projectRoot),
677
+ evidence: [{
678
+ source: "20260811/service",
679
+ file: "src/protocol.ts",
680
+ symbol: "protocol",
681
+ kind: "variable",
682
+ digest: "0123456789ab",
683
+ }],
684
+ review: {
685
+ title: "Service protocol",
686
+ summary: "Aggregated protocol boundary.",
687
+ signals: ["source-backed"],
688
+ reason: "Review the project-owned extraction.",
689
+ },
690
+ }],
691
+ }),
692
+ });
693
+ ```
694
+
695
+ `sources` is the complete registered repo scope for the phase. Every candidate
696
+ and edge carries structured `evidence`; the CLI validates that evidence against
697
+ the declared sources, creates canonical `source_ref` values, writes the symbol
698
+ index, candidate ledger and Review snapshots atomically, and records a phase
699
+ fingerprint. `context status` therefore treats this phase exactly like another
700
+ pending code extraction target, and Review can verify snapshot freshness
701
+ without a placeholder `extractTs` phase.
702
+
703
+ The extractor returns knowledge semantics (`nodeRef`, rendered Markdown,
704
+ Review summary and source-backed evidence). It must not write `knowledge/`,
705
+ `.tmp/context-runtime/lifecycle/candidates.jsonl`, extraction fingerprints or
706
+ Review snapshots directly. Context owns those files and preserves rejected and
707
+ unchanged-approved decisions across reruns.
708
+
651
709
  ### `reviewValidity`
652
710
 
653
711
  Declare the review step for a collection:
@@ -719,8 +777,9 @@ customPhase("custom:20260712/sample:review", async (ctx) => {
719
777
  });
720
778
  ```
721
779
 
722
- Custom phases are an escape hatch. Prefer built-in factories for source,
723
- extract, review, and package workflows. The supported runtime helpers are:
780
+ Custom phases are an orchestration escape hatch. Use `extractCustom()` instead
781
+ when project code needs to publish codegraph candidates. The supported runtime
782
+ helpers are:
724
783
 
725
784
  - `ctx.ensureSources(...)` for repo source readiness.
726
785
  - `ctx.extract.ts(...)` for declared TypeScript extraction.
@@ -42,3 +42,9 @@ package inventory's `structure.relationship_coverage` to distinguish a current
42
42
  source-backed extraction that found no approved edges from an older or
43
43
  otherwise unknown relationship mode. Never infer missing edges from symbol
44
44
  co-occurrence, filenames, or package size.
45
+
46
+ When the built-in TypeScript extractor cannot represent the code source, use a
47
+ declared `extractCustom` phase. The project-owned callback returns candidate
48
+ semantics plus structured source evidence; Context owns canonical refs,
49
+ fingerprints, candidate storage, Review snapshots, freshness, and rerun cleanup.
50
+ Do not use a generic `customPhase` callback to write lifecycle files directly.
@@ -30,6 +30,12 @@ them. A date-only inspection addresses the batch; `<date>/<module>` addresses
30
30
  one source. Register a confirmed multi-source request as one serial batch
31
31
  mutation instead of running registry writes in parallel.
32
32
 
33
+ To retire a registered source, first run `context source remove <source-id>
34
+ --format json`. This is a read-only preview that lists every project, candidate,
35
+ or approved-knowledge reference. Only after those references are intentionally
36
+ resolved may the route use `--yes`; the CLI never silently deletes referenced
37
+ knowledge or another source's materialized files.
38
+
33
39
  Repository readiness checks are mechanical and may run after the boundary is
34
40
  registered. Clone, fetch, checkout, install, build, test, and other external
35
41
  repository operations need separate authority. File and remote-document
@@ -51,6 +51,16 @@ user's language. Never hand-write captured source snapshots: the
51
51
  CLI owns normalisation (NFC, BOM strip, line endings) and the `content_hash`
52
52
  contract, so any manual edit breaks idempotency.
53
53
 
54
+ Lark capture obtains the structured XML representation and produces two
55
+ separate artifacts: XML audit evidence and a deterministic readable Markdown
56
+ projection. Do not treat raw XML as Markdown and do not rewrite it yourself.
57
+ Inspect the returned fidelity status and diagnostics. Warnings describe an
58
+ explicitly skipped empty block; errors mean non-empty evidence or a resource
59
+ locator could not be preserved and the workflow must not proceed to Align,
60
+ Compile, or Review. The CLI, not the plugin, parses the document. The plugin
61
+ only displays the structured counts and diagnostics returned by the current
62
+ source resource.
63
+
54
64
  ### Code capture diagnostics
55
65
 
56
66
  Do not run hand-written dependency preflight commands before code extraction or