@c4a/context-cli 0.5.33-alpha.4 → 0.5.35-beta.1

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 CHANGED
@@ -59,6 +59,8 @@ context capture --inbox
59
59
  context capture --code packages/extract --plan --format json
60
60
  context capture --code --module packages/extract --version-from package
61
61
  context capture --code # refresh existing code capture config
62
+ context compile --code <source-slug>
63
+ context compile --close
62
64
 
63
65
  # In Claude Code, align → compile → drop are agent-driven
64
66
  /context:align # agent classifies raw into a Node tree; user confirms
@@ -80,6 +82,8 @@ Agent-facing output should be stable by construction: shared protocol/schema/loo
80
82
 
81
83
  `source_ref` is an opaque citation token. Copy it into citations and decisions exactly as printed; do not parse it or dereference it as a file path. Human/report views may show clickable files for user inspection. Developer/debug-only `context debug ...` commands may expose storage paths for diagnostics, but those values are not production Agent workflow inputs.
82
84
 
85
+ Code knowledge uses a code-first route. `context capture --code` records a raw code snapshot; `context compile --code <source-slug>` materializes it into package/category/symbol Nodes such as `pkg`, `pkg/components`, and `pkg/symbol/button`. Package roots and category files are navigation surfaces, while concrete symbol Nodes carry code-owned Sections and can later retain doc-owned examples or manual notes. Agents should address these Nodes by slug and query metadata (`source_id`, `source_type`, `evidence_kind`, `source_ref`, `code_projection_status`) rather than by source file paths.
86
+
83
87
  ## Developer Storage Layout
84
88
 
85
89
  The following tree describes the CLI-owned storage implementation for developers and operators. It is not the production Agent workflow contract.
@@ -130,7 +134,7 @@ Workflow payload exploration uses a single Agent-facing query protocol:
130
134
  | `context extract <path>` | CLI | Read-only developer/debug print of an extraction; never writes workspace files and is not part of the production Agent workflow. |
131
135
  | `context debug <workflow\|source\|workspace\|storage\|command\|snapshot> ...` | CLI | Developer/debug-only path diagnostics. Output is storage-coupled and not a production Agent workflow input. |
132
136
  | `context align --scan \| --finalize -` | CLI | Workflow helpers driven by the `/context:align` skill pipeline. `--scan` returns workflow payload names, scopes, digests, and `generation_policy` when workspace language is configured; agents inspect `align-segments` through `context workflow show --payload align-segments --view blocks --token-budget 2000 --unwrap --format json`, then narrow with `--source`, `--heading`, or CLI-provided `how_to_explore[]`. `--unwrap` only removes the workflow metadata envelope. Finalize by submitting an `align-structure-decision` document through stdin; the CLI resolves the current align-segments payload automatically. `--schema <name>` prints the exact align workflow input schemas. |
133
- | `context compile --scan-changes [--delegated] \| --context <slug> [--view source-refs] \| --node-cycle <slug> --input - --accept-safe-defaults \| --draft <slug> --input - --plan --prepare \| --close` | CLI | Workflow helpers driven by the `/context:compile` skill pipeline. `--scan-changes` returns the incremental compile workset; the context entrypoint prepares durable NodeContext, generation policy, and coverage workflow payloads, then prints semantic payload handles. `--view source-refs --token-budget 2000` is a budgeted projection of `NodeContext.raw_snippets[]` for copying citation handles into draft `source_refs[]`; it is not a separate data source. Coverage payloads are inspected with `context workflow show --payload coverage-candidates --view coverage-summary --token-budget 2000 --unwrap --format json` and narrowed with `--view coverage --type <issue-type>` or `--node <slug>`. `--node-cycle` is the low-friction per-node path: it validates the submitted draft, prepares reconcile, accepts mechanically safe defaults, and applies only when no semantic judgment remains (`status: applied` / `partial-applied` / `review-required`). Manual `--draft --prepare → reconcile review/apply` remains the fallback for questions and unsupported evidence. `--delegated` is a one-time, workflow-level authorization recorded on the initial scan/context/draft/node-cycle command; it lets the CLI auto-accept low-risk weak source support but never bypasses unsupported evidence, type drift, schema errors, or destructive gates. Normal handoff uses stdin and current workflow payloads; digest flags are optional stale guards, not values agents need to extract. `--save-input` is only an explicit debug scratch copy, not workspace truth. |
137
+ | `context compile --code [source-slug] \| --scan-changes [--delegated] \| --context <slug> [--view source-refs] \| --node-cycle <slug> --input - --accept-safe-defaults \| --draft <slug> --input - --plan --prepare \| --close` | CLI | `--code` is the deterministic code projection route: it turns captured code snapshots into package/category/symbol knowledge Nodes and does not enter draft/reconcile. Workflow helpers driven by the `/context:compile` skill pipeline handle prose/doc knowledge. `--scan-changes` returns the incremental compile workset; the context entrypoint prepares durable NodeContext, generation policy, and coverage workflow payloads, then prints semantic payload handles. `--view source-refs --token-budget 2000` is a budgeted projection of `NodeContext.raw_snippets[]` for copying citation handles into draft `source_refs[]`; it is not a separate data source. Coverage payloads are inspected with `context workflow show --payload coverage-candidates --view coverage-summary --token-budget 2000 --unwrap --format json` and narrowed with `--view coverage --type <issue-type>` or `--node <slug>`. `--node-cycle` is the low-friction per-node path: it validates the submitted draft, prepares reconcile, accepts mechanically safe defaults, and applies only when no semantic judgment remains (`status: applied` / `partial-applied` / `review-required`). Manual `--draft --prepare → reconcile review/apply` remains the fallback for questions and unsupported evidence. `--delegated` is a one-time, workflow-level authorization recorded on the initial scan/context/draft/node-cycle command; it lets the CLI auto-accept low-risk weak source support but never bypasses unsupported evidence, type drift, schema errors, or destructive gates. Normal handoff uses stdin and current workflow payloads; digest flags are optional stale guards, not values agents need to extract. `--save-input` is only an explicit debug scratch copy, not workspace truth. |
134
138
  | `context workflow show --payload <name> --view <view> [--token-budget <n>]` | CLI | Inspect workflow payloads through semantic views. High-frequency views are `node-context --view source-refs`, `coverage-candidates --view coverage-summary`, `coverage-candidates --view coverage`, and `align-segments --view blocks`. Follow returned `how_to_explore[]` commands for narrowing or budget expansion. |
135
139
  | `context mdrive <group> <verb>` | CLI | Knowledge primitive shell: node / section / edge / query / verify / glossary / workspace. Node/query results include `node_class` to distinguish concrete entities from term definitions. `context mdrive verify workspace --experimental` adds heuristic quality warnings for very thin concrete entities and terms that have grown beyond definition shape; these are warnings, not entity-count limits. `context mdrive query --stats-only` prints only workspace counts; run `context mdrive --help` for subcommands. |
136
140
  | `context drop <source-id\|url> --plan [--save-output [file]]` / `context drop --apply-plan --reason <text> --yes` | CLI | Plans and applies source retraction through the current drop workflow. `drop --plan` stores the canonical `drop-plan` workflow payload; `--save-output` is only an optional human-readable scratch copy, not a later input. `reconcile prepare --mode drop` reads the current workflow plan, `reconcile review --decisions -` stores the ready review when semantic decisions are needed, and `drop --apply-plan` consumes the current workflow plan/review without plan or decisions files. |
@@ -138,7 +142,7 @@ Workflow payload exploration uses a single Agent-facing query protocol:
138
142
  | `context verify` | CLI | Whole-workspace verify (schema, Section mount matrix, contains acyclicity, dropped-source references, dangling `src-N`, body ad-hoc headings, domain-inline-child, duplicate slug). |
139
143
  | `context doctor` | CLI | Workspace diagnostics for current workflow, align output, knowledge, caches, evidence, coverage, semantic ledger, and archive state. |
140
144
  | `context status [--format json\|table]` | CLI | Workspace overview + next-action suggestions. |
141
- | `context query "<question>" [--intent <intent>] [--scope <slug>] [--tag <tag>] [--domain <slug>]` | CLI | Local knowledge query with hit/miss/select protocol. Intents: `orientation` (workspace map, supports `--tag` / `--domain` filters and a token-budgeted Slug Map + Summary), `node_lookup` (BM25 candidate Nodes from query text), `node_view` (open a known Node by slug), `section_search` (BM25 inside a chosen Node), `impact_analysis` (structural relations), `recall` (archive / reconciliation audit). Without `--intent`, the CLI infers from the flags supplied. BM25 only — no vector embeddings. |
145
+ | `context query "<question>" [--intent <intent>] [--scope <slug>] [--evidence code\|prose\|all] [--tag <tag>] [--domain <slug>]` | CLI | Local knowledge query with hit/miss/select protocol. Intents: `orientation` (workspace map, supports `--tag` / `--domain` filters and a token-budgeted Slug Map + Summary), `node_lookup` (BM25 candidate Nodes from query text), `node_view` (open a known Node by slug), `section_search` (BM25 inside a chosen Node), `impact_analysis` (structural relations), `recall` (archive / reconciliation audit). Code package/category scopes search their contains subtree; concrete symbol scopes can return both code-owned and doc-owned Sections. JSON hits expose `source_id`, `source_type`, `evidence_kind`, `source_ref`, and code projection metadata when present. Without `--intent`, the CLI infers from the flags supplied. BM25 only — no vector embeddings. |
142
146
  | `/context:query <question>`, `/context:align`, `/context:compile`, `/context:capture`, `/context:drop`, `/context:status`, `/context:purge` | Agent | Skill-driven wrappers around the CLI. Read flows (`query`, `status`) answer directly with cited evidence; write flows (`align`, `compile`, `capture`, `drop`, `purge`) produce structured JSON/YAML per skill contract and confirm destructive steps with the user. |
143
147
  | `/context:context <free text>` | Agent | Fuzzy router over the above. |
144
148