@c4a/context-cli 0.6.0-beta.4 → 0.6.0-beta.6

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 (56) hide show
  1. package/README.md +17 -2
  2. package/cli.js +20831 -18799
  3. package/package.json +2 -2
  4. package/plugin/skills/skill-continue-workflow/SKILL.md +25 -2
  5. package/plugin/skills/skill-prose-align/SKILL.md +25 -9
  6. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  7. package/plugin/skills/skill-prose-compile/SKILL.md +17 -5
  8. package/plugin/skills/skill-review-gate/SKILL.md +38 -9
  9. package/plugin/skills/skill-source-scope/SKILL.md +197 -102
  10. package/plugin/skills/skill-source-scope/references/capture-source.md +32 -12
  11. package/plugins/VERSION +1 -1
  12. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +25 -2
  14. package/plugins/claude/skills/skill-prose-align/SKILL.md +25 -9
  15. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  16. package/plugins/claude/skills/skill-prose-compile/SKILL.md +17 -5
  17. package/plugins/claude/skills/skill-review-gate/SKILL.md +38 -9
  18. package/plugins/claude/skills/skill-source-scope/SKILL.md +197 -102
  19. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +32 -12
  20. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  21. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +25 -2
  22. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  23. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +25 -9
  24. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +17 -5
  25. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +38 -9
  26. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +32 -12
  27. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +197 -102
  28. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +25 -2
  29. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  30. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +25 -9
  31. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +17 -5
  32. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +38 -9
  33. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +32 -12
  34. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +197 -102
  35. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  36. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +25 -2
  37. package/plugins/cursor/skills/skill-prose-align/SKILL.md +25 -9
  38. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  39. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +17 -5
  40. package/plugins/cursor/skills/skill-review-gate/SKILL.md +38 -9
  41. package/plugins/cursor/skills/skill-source-scope/SKILL.md +197 -102
  42. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +32 -12
  43. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +25 -2
  44. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  45. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +25 -9
  46. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +17 -5
  47. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +38 -9
  48. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +32 -12
  49. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +197 -102
  50. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +25 -2
  51. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +5 -3
  52. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +25 -9
  53. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +17 -5
  54. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +38 -9
  55. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +32 -12
  56. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +197 -102
package/README.md CHANGED
@@ -55,7 +55,9 @@ node_modules/@c4a/context/templates/package-templates/
55
55
  Agents should read these files instead of probing `node_modules/@c4a/context/dist`
56
56
  with temporary scripts.
57
57
 
58
- For local checkout development and link installs, see [DEVELOPMENT.md](./DEVELOPMENT.md).
58
+ For the complete source, link, plugin, and npm-mode development workflow, see
59
+ the workspace [DEVELOPMENT.md](../../DEVELOPMENT.md). CLI plugin-specific notes
60
+ remain in this package's [DEVELOPMENT.md](./DEVELOPMENT.md).
59
61
 
60
62
  ## Project-local quick tour
61
63
 
@@ -77,6 +79,11 @@ context source add repo sample-lib --local ../sample-lib
77
79
  # Do not register the parent monorepo and use extractTs.include as a package selector.
78
80
  context source add repo sample-lib --local ../packages/sample-lib
79
81
 
82
+ # Keep non-standard TypeScript entry roots in the Context project src/index.ts.
83
+ # Do not add package.json entry fields or source files solely for Context.
84
+ # extractTs({ source, collection: "codegraph", include: ["src/**/*.ts"], entries: ["src/api.ts"] })
85
+ # Use mode: "scan" instead when every include-matched file is a scan root.
86
+
80
87
  # Optional overrides when origin / HEAD cannot be inferred:
81
88
  context source add repo sample-lib \
82
89
  --local ../sample-lib \
@@ -132,20 +139,28 @@ For project workflows, `context` is a semantic service. Agents should call the C
132
139
  | `context init [project-dir] [--name <name>] [--dev]` | CLI | Create a project-local context workspace. Defaults to `context/`; use `.` to initialize the current directory. Use `--dev` for local checkout testing before `@c4a/context` is published. |
133
140
  | `context source add repo <name> --local <repo-or-subdir> [--remote <url>] [--ref <sha>]` | CLI | Register a repo source and pin it to a commit. Local paths may point at a monorepo subdirectory; the CLI stores the git root plus subpath, and materializes the source view to the subdirectory. Remote and ref are inferred from local origin / HEAD when omitted. Short SHAs are resolved to full commits when the local repo is available. |
134
141
  | `context source ensure [name]` | CLI | Validate and materialize local source symlinks. Missing remotes only produce hints; the CLI does not clone or checkout automatically. |
142
+ | `context source add batch [date] --input <file|->` | CLI | Register multiple repo, file, or Lark modules under one project write lock from YAML/JSON input. Repo modules are explicit; file/Lark modules may be derived when omitted. |
135
143
  | `context source list|get <name>` | CLI | Inspect the repo source registry and readiness metadata. |
136
144
  | `context source inspect [name]` | CLI | Detect module/package boundaries in registered repo sources without extraction. Use this before extracting monorepo roots; it prints package names, paths, versions when available, and suggested source registration commands. |
137
145
  | `context run --list` | CLI | List phases declared by `src/index.ts`. |
138
- | `context run <phase-id> [--dry-run]` | CLI | Inspect or run one declared phase. Dry run prints reads/writes and, for extract phases when sources are ready, a resolved preview with modules, file counts, symbol counts, candidate estimates, and module error hints. It does not mutate project files. |
146
+ | `context run <phase-id> [--dry-run] [--auto-promote]` | CLI | Inspect or run one declared phase. Extract dry-run separates discovered, AST-analyzed, skipped, symbol, and relation counts. Missing/empty entries fail with `NO_ENTRY_DETECTED`; TypeScript aliases come from tsconfig/jsconfig `baseUrl` and `paths`. Codegraph defaults to first-run full Review and later delta-only Review; `--auto-promote` applies deterministic codegraph deltas, refreshes deterministic close when needed, then verifies. Existing package outputs become stale and remain an explicit downstream build step. |
139
147
  | `context review html [collection] [--open]` | CLI | Render the local self-contained HTML review surface under `.tmp/context-runtime/review/`, emit a clickable `file://` URL, and optionally open it with the system browser. |
140
148
  | `context review list [collection]` | CLI | List draft candidates for CLI-oriented review. |
141
149
  | `context review apply <payload-file>` | CLI | Apply copied review decisions; approved entities materialize to `knowledge/`, rejected entities remain in `unapproved/entities.jsonl`. |
142
150
  | `context review approve|reject <candidate-id> --collection <collection>` / `--all` | CLI | Scoped quick marking for a single draft candidate when the user explicitly authorizes an automated or quick path. |
151
+ | `context review migrate-codegraph-refs` | CLI | Upgrade legacy approved codegraph refs to `src-N#symbol:<file>:<symbol>:<kind>@<digest>`, remove redundant `code_origin`, and verify. Rerun declared codegraph extraction first; this metadata migration does not repeat Review. |
143
152
  | `context build` | CLI | Build declared project packages from approved knowledge into `dist/<package-name>/`. |
144
153
  | `context verify [--format table\|json]` | CLI | Validate the project skeleton, registry, unapproved ledger, approved Markdown, source refs, and package outputs. |
145
154
  | `context status [--format json\|table]` | CLI | Workspace overview + a canonical `next:` hint. Agent plugins expose this workflow as `/context:continue`; do not add or call `context continue`. |
146
155
 
147
156
  Commands that require a project exit with a workspace-not-found error if run outside a directory tree containing a `package.json` `context.project=true` / `context.entry` marker. `context init` is the command that creates one.
148
157
 
158
+ For a beta.5 project that reports `approved-source-ref-ambiguous`, upgrade in
159
+ this order: rerun each declared codegraph extraction phase to create the current
160
+ file-aware symbol index, run `context review migrate-codegraph-refs`, then run
161
+ `context verify`. The migration preserves approved content and review decisions;
162
+ it changes only code evidence identity and removes the old `code_origin` copy.
163
+
149
164
  ## Development
150
165
 
151
166
  Source lives at [`packages/context-cli/`](./src) in this workspace.