@c4a/context-cli 0.6.0-beta.3 → 0.6.0-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.
Files changed (28) hide show
  1. package/README.md +6 -1
  2. package/cli.js +21613 -20964
  3. package/package.json +2 -2
  4. package/plugin/skills/skill-continue-workflow/SKILL.md +4 -1
  5. package/plugin/skills/skill-review-gate/SKILL.md +6 -0
  6. package/plugin/skills/skill-source-scope/SKILL.md +38 -3
  7. package/plugins/VERSION +1 -1
  8. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  9. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +4 -1
  10. package/plugins/claude/skills/skill-review-gate/SKILL.md +6 -0
  11. package/plugins/claude/skills/skill-source-scope/SKILL.md +38 -3
  12. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  13. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +4 -1
  14. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +6 -0
  15. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +38 -3
  16. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +4 -1
  17. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +6 -0
  18. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +38 -3
  19. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  20. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +4 -1
  21. package/plugins/cursor/skills/skill-review-gate/SKILL.md +6 -0
  22. package/plugins/cursor/skills/skill-source-scope/SKILL.md +38 -3
  23. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +4 -1
  24. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +6 -0
  25. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +38 -3
  26. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +4 -1
  27. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +6 -0
  28. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +38 -3
@@ -41,6 +41,16 @@ Choose and validate what may become draft knowledge.
41
41
  source.
42
42
  - `extractTs.include` filters files inside the selected source; it is not a
43
43
  package/module selector.
44
+ - Do not ask users to add `exports`, `main`, `bin`, or a new entry file to the
45
+ source repository solely for extraction. Standard package entries are
46
+ auto-detected; non-standard API roots belong in Context-owned
47
+ `extractTs.entries`. When the confirmed scope is all declarations in matched
48
+ files, use `mode: "scan"` instead of inventing an entry.
49
+ - Empty or undetected entries must return `NO_ENTRY_DETECTED`; never treat an
50
+ empty extraction as success. Configure `entries`, or choose scan mode only
51
+ when every matched file is the intended scope.
52
+ - TypeScript extraction follows tsconfig/jsconfig `extends`, `baseUrl`, and
53
+ `paths`. Aliases such as `@/` do not require changes to the source repository.
44
54
  - Use `context source inspect <source-name> --format json` for module choices.
45
55
  - Before first real extraction, generate a no-write preview and show module
46
56
  counts plus `knowledgeTree` / `knowledgePathExamples` to the user. Use
@@ -364,8 +374,16 @@ show counts plus the planned `knowledge/` tree.
364
374
  Only after the user confirms this product-level scope, declare the chosen date
365
375
  source with `source("YYYYMMDD")`, add the TypeScript extraction phase, and add
366
376
  the human review phase. Use `include` only for a file-level filter within the
367
- chosen source boundary. Mention the internal API names only in code-change
368
- summaries, or when the user asks for implementation details.
377
+ chosen source boundary. If the package has no standard detected entry, keep the
378
+ source repository unchanged and ask whether its intended knowledge surface is:
379
+
380
+ - a public API graph rooted at specific files — configure source-relative
381
+ `entries` that are also matched by `include`; or
382
+ - all declarations in the matched files — configure `mode: "scan"`, which uses
383
+ no entries and includes internal symbols by default.
384
+
385
+ Mention the internal API names only in code-change summaries, or when the user
386
+ asks for implementation details.
369
387
 
370
388
  ### Step 5 — Show The Pre-extraction Preview
371
389
 
@@ -378,7 +396,8 @@ context run <extract-phase-id> --dry-run --format json
378
396
  Show the user:
379
397
 
380
398
  - resolved source and module/package list;
381
- - file, symbol, and candidate estimate counts;
399
+ - discovered, AST-analyzed, skipped, symbol, relation, and candidate estimate
400
+ counts, including each skipped reason;
382
401
  - `knowledgeTree`;
383
402
  - several `knowledgePathExamples`.
384
403
 
@@ -412,6 +431,22 @@ matches it, run:
412
431
  context run <extract-phase-id>
413
432
  ```
414
433
 
434
+ Read the structured result before routing. For codegraph, the first run returns
435
+ all code candidates with `next_action.human_gate=true`; later runs return only
436
+ added/updated/removed symbols, while unchanged approved symbols stay approved.
437
+ If `next_action.human_gate=false`, do not open Review and continue with status.
438
+
439
+ Only when the user explicitly requests a non-interactive CI/CD codegraph sync,
440
+ run:
441
+
442
+ ```bash
443
+ context run <extract-phase-id> --auto-promote --format json
444
+ ```
445
+
446
+ This applies deterministic codegraph deltas and verifies them. A nonzero exit or
447
+ verification issue is a pipeline failure. Never use `--auto-promote` for prose
448
+ or semantic collections.
449
+
415
450
  If the preview reports modules outside the confirmed source boundary, do not
416
451
  run extraction. Ask the user to choose the corrected source boundary.
417
452
 
@@ -128,7 +128,10 @@ do not forward a long raw transcript unless requested.
128
128
  3. If status says `needs-prose-compile` or `structure-ready`, or the user asks
129
129
  to turn confirmed structure into source-bound draft pages, follow
130
130
  `skill-prose-compile.md`.
131
- 4. If status says `compile-ready-for-review` or review is needed, follow
131
+ 4. If the latest phase result has `next_action.human_gate=false`, follow its
132
+ command and do not invent a Review gate. If status says
133
+ `compile-ready-for-review`, or the latest result has
134
+ `next_action.human_gate=true`, follow
132
135
  `skill-review-gate.md`.
133
136
  5. If status says `compile-close-needed`, run `context close --format json`
134
137
  unless CLI diagnostics require human repair, then return to **Step 1**.
@@ -16,6 +16,9 @@ Run the human review gate. The user decides approval or rejection.
16
16
  ## TL;DR
17
17
 
18
18
  - The agent never approves or rejects candidates on the user's behalf.
19
+ - Enter this skill only when the preceding command returns
20
+ `next_action.human_gate=true`. A no-delta codegraph run returns false and does
21
+ not need Review.
19
22
  - Use `context review html <collection> --open` for visual review.
20
23
  - `<collection>` is an internal production collection such as `architecture`,
21
24
  `sop`, `decision`, or `standards`; it is not an OKF package root such as
@@ -29,6 +32,9 @@ Run the human review gate. The user decides approval or rejection.
29
32
  `context review approve <candidate-id> --collection <collection>` /
30
33
  `context review reject <candidate-id> --collection <collection>` or `--all`;
31
34
  these commands still enforce the current scoped candidate-id gate.
35
+ - `context run <extract-phase-id> --auto-promote` is a separate, explicit
36
+ codegraph-only CI/CD policy. It may apply code add/update/remove deltas and
37
+ verify them without this gate; it never applies to semantic knowledge.
32
38
 
33
39
  <procedures>
34
40
 
@@ -41,6 +41,16 @@ Choose and validate what may become draft knowledge.
41
41
  source.
42
42
  - `extractTs.include` filters files inside the selected source; it is not a
43
43
  package/module selector.
44
+ - Do not ask users to add `exports`, `main`, `bin`, or a new entry file to the
45
+ source repository solely for extraction. Standard package entries are
46
+ auto-detected; non-standard API roots belong in Context-owned
47
+ `extractTs.entries`. When the confirmed scope is all declarations in matched
48
+ files, use `mode: "scan"` instead of inventing an entry.
49
+ - Empty or undetected entries must return `NO_ENTRY_DETECTED`; never treat an
50
+ empty extraction as success. Configure `entries`, or choose scan mode only
51
+ when every matched file is the intended scope.
52
+ - TypeScript extraction follows tsconfig/jsconfig `extends`, `baseUrl`, and
53
+ `paths`. Aliases such as `@/` do not require changes to the source repository.
44
54
  - Use `context source inspect <source-name> --format json` for module choices.
45
55
  - Before first real extraction, generate a no-write preview and show module
46
56
  counts plus `knowledgeTree` / `knowledgePathExamples` to the user. Use
@@ -364,8 +374,16 @@ show counts plus the planned `knowledge/` tree.
364
374
  Only after the user confirms this product-level scope, declare the chosen date
365
375
  source with `source("YYYYMMDD")`, add the TypeScript extraction phase, and add
366
376
  the human review phase. Use `include` only for a file-level filter within the
367
- chosen source boundary. Mention the internal API names only in code-change
368
- summaries, or when the user asks for implementation details.
377
+ chosen source boundary. If the package has no standard detected entry, keep the
378
+ source repository unchanged and ask whether its intended knowledge surface is:
379
+
380
+ - a public API graph rooted at specific files — configure source-relative
381
+ `entries` that are also matched by `include`; or
382
+ - all declarations in the matched files — configure `mode: "scan"`, which uses
383
+ no entries and includes internal symbols by default.
384
+
385
+ Mention the internal API names only in code-change summaries, or when the user
386
+ asks for implementation details.
369
387
 
370
388
  ### Step 5 — Show The Pre-extraction Preview
371
389
 
@@ -378,7 +396,8 @@ context run <extract-phase-id> --dry-run --format json
378
396
  Show the user:
379
397
 
380
398
  - resolved source and module/package list;
381
- - file, symbol, and candidate estimate counts;
399
+ - discovered, AST-analyzed, skipped, symbol, relation, and candidate estimate
400
+ counts, including each skipped reason;
382
401
  - `knowledgeTree`;
383
402
  - several `knowledgePathExamples`.
384
403
 
@@ -412,6 +431,22 @@ matches it, run:
412
431
  context run <extract-phase-id>
413
432
  ```
414
433
 
434
+ Read the structured result before routing. For codegraph, the first run returns
435
+ all code candidates with `next_action.human_gate=true`; later runs return only
436
+ added/updated/removed symbols, while unchanged approved symbols stay approved.
437
+ If `next_action.human_gate=false`, do not open Review and continue with status.
438
+
439
+ Only when the user explicitly requests a non-interactive CI/CD codegraph sync,
440
+ run:
441
+
442
+ ```bash
443
+ context run <extract-phase-id> --auto-promote --format json
444
+ ```
445
+
446
+ This applies deterministic codegraph deltas and verifies them. A nonzero exit or
447
+ verification issue is a pipeline failure. Never use `--auto-promote` for prose
448
+ or semantic collections.
449
+
415
450
  If the preview reports modules outside the confirmed source boundary, do not
416
451
  run extraction. Ask the user to choose the corrected source boundary.
417
452