@c4a/context-cli 0.6.0-beta.8 → 0.6.1-beta.2
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/LICENSE +21 -0
- package/README.md +156 -139
- package/README.zh-CN.md +172 -0
- package/cli.js +20593 -5728
- package/docs/quickstart.md +10 -5
- package/package.json +19 -3
- package/plugins/README.md +47 -121
- package/plugins/README_CN.md +40 -105
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/continue.md +28 -11
- package/plugins/claude/commands/init.md +14 -5
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/codex/skills/continue/SKILL.md +28 -12
- package/plugins/codex/skills/init/SKILL.md +14 -6
- package/plugins/cursor/.cursor-plugin/plugin.json +2 -3
- package/plugins/cursor/README.md +2 -2
- package/plugins/cursor/commands/context-continue.md +28 -11
- package/plugins/cursor/commands/context-init.md +14 -5
- package/plugins/skills/context-continue/SKILL.md +28 -12
- package/plugins/skills/context-init/SKILL.md +14 -6
- package/providers/context/actions/align-next.yaml +6 -0
- package/providers/context/actions/apply-managed-review.yaml +6 -0
- package/providers/context/actions/apply-structure-confirmation.yaml +6 -0
- package/providers/context/actions/build-next.yaml +5 -0
- package/providers/context/actions/capture-next.yaml +6 -0
- package/providers/context/actions/close-approved-knowledge.yaml +5 -0
- package/providers/context/actions/compile-next.yaml +6 -0
- package/providers/context/actions/configure-code-extraction.yaml +6 -0
- package/providers/context/actions/configure-document-capture.yaml +6 -0
- package/providers/context/actions/configure-package-output.yaml +6 -0
- package/providers/context/actions/configure-prose-lifecycle.yaml +6 -0
- package/providers/context/actions/ensure-repository-sources.yaml +5 -0
- package/providers/context/actions/extract-next.yaml +6 -0
- package/providers/context/actions/inspect-document-classification.yaml +5 -0
- package/providers/context/actions/inspect-review.yaml +5 -0
- package/providers/context/actions/inspect-structure.yaml +5 -0
- package/providers/context/actions/maintain-evidence.yaml +6 -0
- package/providers/context/actions/materialize-context-view.yaml +8 -0
- package/providers/context/actions/register-source-batch.yaml +7 -0
- package/providers/context/actions/repair-project-entry.yaml +6 -0
- package/providers/context/actions/repair-verification.yaml +5 -0
- package/providers/context/actions/repair-workspace-state.yaml +6 -0
- package/providers/context/codes.yaml +38 -0
- package/providers/context/graphs/workspace.yaml +469 -0
- package/providers/context/manifest.json +610 -0
- package/providers/context/provider.yaml +12 -0
- package/providers/context/resources/diagnostics/verification.md +21 -0
- package/providers/context/resources/diagnostics/workspace-state.md +27 -0
- package/providers/context/resources/dialogue/code-extraction.md +34 -0
- package/providers/context/resources/dialogue/document-capture.md +29 -0
- package/providers/context/resources/dialogue/document-classification.md +32 -0
- package/providers/context/resources/dialogue/evidence-maintenance.md +26 -0
- package/providers/context/resources/dialogue/human-gates.md +34 -0
- package/providers/context/resources/dialogue/knowledge-review.md +27 -0
- package/providers/context/resources/dialogue/package-output.md +32 -0
- package/providers/context/resources/dialogue/source-boundary.md +29 -0
- package/providers/context/resources/dialogue/structure-confirmation.md +44 -0
- package/providers/context/resources/manuals/guides/package-outputs.md +250 -0
- package/providers/context/resources/manuals/reference/package-templates.md +372 -0
- package/providers/context/resources/manuals/reference/project-api.md +644 -0
- package/providers/context/resources/manuals/reference/template-variables.md +247 -0
- package/providers/context/resources/procedures/close-and-build.md +20 -0
- package/providers/context/resources/procedures/code-extraction.md +30 -0
- package/providers/context/resources/procedures/document-capture.md +31 -0
- package/providers/context/resources/procedures/document-classification.md +20 -0
- package/providers/context/resources/procedures/evidence-maintenance.md +21 -0
- package/providers/context/resources/procedures/knowledge-review.md +25 -0
- package/providers/context/resources/procedures/package-output.md +31 -0
- package/providers/context/resources/procedures/project-configuration.md +22 -0
- package/providers/context/resources/procedures/prose-align.md +23 -0
- package/providers/context/resources/procedures/prose-compile.md +20 -0
- package/providers/context/resources/procedures/source-boundary.md +37 -0
- package/{plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md → providers/context/resources/procedures/source-capture-detailed.md} +28 -19
- package/providers/context/resources/procedures/verify-and-repair.md +20 -0
- package/{plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/candidate-resolution.md +13 -0
- package/{plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/density-profile.md +11 -0
- package/{plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/gates.md +13 -0
- package/{plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures → providers/context/resources/semantic/align}/structure-planning.md +38 -4
- package/providers/context/resources/semantic/compile/index.md +31 -0
- package/providers/context/resources/views/package-current.yaml +6 -0
- package/providers/context/resources/views/review-current.yaml +6 -0
- package/providers/context/resources/views/source-current.yaml +6 -0
- package/providers/context/resources/views/structure-current.yaml +6 -0
- package/providers/context/resources/views/verification-current.yaml +6 -0
- package/providers/context/resources/views/workspace-current.yaml +6 -0
- package/providers/context/schemas/evidence-maintenance-input.schema.json +30 -0
- package/providers/context/schemas/source-batch-input.schema.json +189 -0
- package/providers/context/scripts/render-context-view.mjs +21 -0
- package/plugin/.claude-plugin/plugin.json.template +0 -16
- package/plugin/.codex-plugin/plugin.json.template +0 -38
- package/plugin/.cursor-plugin/plugin.json.template +0 -29
- package/plugin/README.md +0 -158
- package/plugin/README_CN.md +0 -142
- package/plugin/assets/icon.svg +0 -3
- package/plugin/assets/logo.svg +0 -3
- package/plugin/assets/workflow-en.png +0 -0
- package/plugin/assets/workflow.png +0 -0
- package/plugin/commands/continue.md +0 -34
- package/plugin/commands/init.md +0 -21
- package/plugin/skills/skill-continue-workflow/SKILL.md +0 -235
- package/plugin/skills/skill-init-workspace/SKILL.md +0 -74
- package/plugin/skills/skill-package-output/SKILL.md +0 -180
- package/plugin/skills/skill-prose-align/SKILL.md +0 -322
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugin/skills/skill-prose-compile/SKILL.md +0 -287
- package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugin/skills/skill-review-gate/SKILL.md +0 -141
- package/plugin/skills/skill-source-scope/SKILL.md +0 -531
- package/plugin/skills/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/assets/icon.svg +0 -3
- package/plugins/assets/workflow-en.png +0 -0
- package/plugins/assets/workflow.png +0 -0
- package/plugins/claude/skills/skill-continue-workflow/SKILL.md +0 -235
- package/plugins/claude/skills/skill-init-workspace/SKILL.md +0 -74
- package/plugins/claude/skills/skill-package-output/SKILL.md +0 -180
- package/plugins/claude/skills/skill-prose-align/SKILL.md +0 -322
- package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/claude/skills/skill-prose-compile/SKILL.md +0 -287
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/claude/skills/skill-review-gate/SKILL.md +0 -141
- package/plugins/claude/skills/skill-source-scope/SKILL.md +0 -531
- package/plugins/claude/skills/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/codex/assets/workflow-en.png +0 -0
- package/plugins/codex/assets/workflow.png +0 -0
- package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +0 -235
- package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +0 -74
- package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +0 -180
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +0 -322
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +0 -287
- package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +0 -141
- package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +0 -531
- package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +0 -235
- package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +0 -74
- package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +0 -180
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +0 -322
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +0 -287
- package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +0 -141
- package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +0 -531
- package/plugins/cursor/assets/icon.svg +0 -3
- package/plugins/cursor/assets/workflow-en.png +0 -0
- package/plugins/cursor/assets/workflow.png +0 -0
- package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +0 -235
- package/plugins/cursor/skills/skill-init-workspace/SKILL.md +0 -74
- package/plugins/cursor/skills/skill-package-output/SKILL.md +0 -180
- package/plugins/cursor/skills/skill-prose-align/SKILL.md +0 -322
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/cursor/skills/skill-prose-compile/SKILL.md +0 -287
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/cursor/skills/skill-review-gate/SKILL.md +0 -141
- package/plugins/cursor/skills/skill-source-scope/SKILL.md +0 -531
- package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +0 -235
- package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +0 -74
- package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +0 -180
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +0 -322
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +0 -287
- package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +0 -141
- package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +0 -531
- package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +0 -235
- package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +0 -74
- package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +0 -180
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +0 -322
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +0 -287
- package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +0 -141
- package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +0 -531
- package/scripts/build-plugin.ts +0 -658
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: context.sdk.project-api
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Project API
|
|
8
|
+
|
|
9
|
+
Import from `@c4a/context` in `src/index.ts`.
|
|
10
|
+
|
|
11
|
+
## `defineProject`
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { defineProject } from "@c4a/context";
|
|
15
|
+
|
|
16
|
+
export default defineProject({
|
|
17
|
+
sources: [],
|
|
18
|
+
phases: [],
|
|
19
|
+
packages: [],
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The project file is executable TypeScript, but the preferred style is a small
|
|
24
|
+
declaration list. Put heavy logic in imported transform files.
|
|
25
|
+
|
|
26
|
+
## Sources
|
|
27
|
+
|
|
28
|
+
A source is a stable knowledge boundary, not only a display label. Repo, file,
|
|
29
|
+
and Lark sources use a date batch plus a concrete module name; multiple code or
|
|
30
|
+
document modules may share the date. The flattened selector `YYYYMMDD/module`
|
|
31
|
+
is the source identity used by phases, snapshot paths, and source refs.
|
|
32
|
+
Codegraph NodeRef/ViewRef and knowledge paths use the stable module name without
|
|
33
|
+
the date:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
knowledge/<collection>/<slug>.md
|
|
37
|
+
knowledge/<collection>/<containment>/<slug>.md # only for an intentional hierarchy
|
|
38
|
+
knowledge/codegraph/<module>/symbol/<slug>.md
|
|
39
|
+
repo:<date>/<module>#symbol:...
|
|
40
|
+
file:<date>/<module>/<document>#span:...
|
|
41
|
+
lark:<date>/<module>/<document>#span:...
|
|
42
|
+
capture:file:<date>/<module>
|
|
43
|
+
align:lark:<date>/<module>:architecture
|
|
44
|
+
dist/<source-name>-kb/...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Choose the module boundary before extraction. In a monorepo, register each
|
|
48
|
+
confirmed package/subdirectory under the same date batch. A repo root that
|
|
49
|
+
resolves to multiple modules is for inspection; it is not an extraction unit.
|
|
50
|
+
Approved codegraph paths use the stable module name; the date remains only in
|
|
51
|
+
source selectors, phase ids, and evidence refs:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
knowledge/codegraph/module-a/...
|
|
55
|
+
knowledge/codegraph/module-b/...
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For prose Views, omit `containment` when the page is an independent collection
|
|
59
|
+
entry. The CLI then derives `knowledge/<collection>/<slug>.md`. Set
|
|
60
|
+
`containment` only when the approved structure intentionally places the page
|
|
61
|
+
under a parent path; it is not a required source/module wrapper.
|
|
62
|
+
|
|
63
|
+
The registry stores this as one date entry containing several `modules` entries,
|
|
64
|
+
and materializes each module at `sources/repo/<date>/<module>`.
|
|
65
|
+
Repo module names are project-wide codegraph identities and therefore cannot be
|
|
66
|
+
reused under another date batch. Refresh an existing module through its original
|
|
67
|
+
date/module selector.
|
|
68
|
+
When a repo module and the Context workspace share the same Git root, the CLI
|
|
69
|
+
normalizes even an absolute `--local` input into a path relative to the
|
|
70
|
+
workspace and stores the package directory as `subpath`. Materialized repo
|
|
71
|
+
links always use relative symlink targets. This keeps the registry and links
|
|
72
|
+
valid when the whole checkout moves. Cross-repository absolute checkout roots
|
|
73
|
+
remain absolute because no shared movable root can be assumed.
|
|
74
|
+
The date entry must be a valid calendar date in `YYYYMMDD` form. Use
|
|
75
|
+
`context source ensure <date>` or `context source inspect <date>` for the whole
|
|
76
|
+
batch, and `<date>/<module>` when targeting one module.
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
sources:
|
|
80
|
+
- name: "20260712"
|
|
81
|
+
modules:
|
|
82
|
+
- name: module-a
|
|
83
|
+
local: ../monorepo
|
|
84
|
+
subpath: packages/module-a
|
|
85
|
+
git:
|
|
86
|
+
remote: https://git.example.com/product/monorepo.git
|
|
87
|
+
ref: <full-commit-sha>
|
|
88
|
+
- name: module-b
|
|
89
|
+
local: ../monorepo
|
|
90
|
+
subpath: packages/module-b
|
|
91
|
+
git:
|
|
92
|
+
remote: https://git.example.com/product/monorepo.git
|
|
93
|
+
ref: <full-commit-sha>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
File and Lark registries use the same outer shape. Their modules hold local
|
|
97
|
+
document boundaries or remote document identities:
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
sources:
|
|
101
|
+
- name: "20260712"
|
|
102
|
+
modules:
|
|
103
|
+
- name: local-manual
|
|
104
|
+
local: ../manual
|
|
105
|
+
- name: api-guide
|
|
106
|
+
local: ../api-guide
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Batch source registration
|
|
110
|
+
|
|
111
|
+
Use one command when a user confirms several source modules together:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
context source add batch [YYYYMMDD] --input <sources.yaml|json|-> --format json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The payload is a non-empty `sources` array. Every item requires `type`. Repo
|
|
118
|
+
also requires `module` and accepts `local`/`remote`/`ref`. File requires `local`
|
|
119
|
+
and accepts `include`; Lark accepts exactly one of `url`, `docToken`, or
|
|
120
|
+
`wikiToken` plus optional `title`. File/Lark `module` is optional and is derived
|
|
121
|
+
with the same lowercase path-safe rule as the single-source commands. Resolved
|
|
122
|
+
module identities must be unique across the batch.
|
|
123
|
+
|
|
124
|
+
Source mutations share a project write lock, and every registry file is
|
|
125
|
+
replaced atomically. Never run separate `source add` processes in parallel. A
|
|
126
|
+
batch executes items in order; if a runtime item fails, its error lists the
|
|
127
|
+
completed items and the same payload may be rerun idempotently.
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
sources:
|
|
131
|
+
- name: "20260712"
|
|
132
|
+
modules:
|
|
133
|
+
- name: user-manual
|
|
134
|
+
url: https://example.larksuite.com/wiki/example-a
|
|
135
|
+
- name: migration-guide
|
|
136
|
+
url: https://example.larksuite.com/wiki/example-b
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### `source(name)`
|
|
140
|
+
|
|
141
|
+
Reference one registered source by name. The reference is type-neutral in
|
|
142
|
+
project code; each phase resolves it through the registry and checks whether it
|
|
143
|
+
is a repo, file, or lark source:
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
import { source } from "@c4a/context";
|
|
147
|
+
|
|
148
|
+
const productDocs = source("product-docs");
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### `source(namespace, module)`
|
|
152
|
+
|
|
153
|
+
Reference one registered repo module. Use the date batch and module name
|
|
154
|
+
returned by `context source add repo`:
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
const moduleA = source("20260712", "module-a");
|
|
158
|
+
const moduleB = source("20260712", "module-b");
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
These references resolve to `20260712/module-a` and `20260712/module-b`;
|
|
162
|
+
extraction and verification remain independent.
|
|
163
|
+
|
|
164
|
+
### `source(namespace, module, { type })`
|
|
165
|
+
|
|
166
|
+
Reference one file or Lark module under a date batch:
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
const localManual = source("20260712", "local-manual", { type: "file" });
|
|
170
|
+
const userManual = source("20260712", "user-manual", { type: "lark" });
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
These references produce module-scoped phase ids and manifest entries without
|
|
174
|
+
treating the date as one document identity. Captured document files remain
|
|
175
|
+
siblings under `sources/file|lark/<date>/` and share the date-level
|
|
176
|
+
`manifest.json`; the logical `date/module` identity does not create another
|
|
177
|
+
directory level.
|
|
178
|
+
|
|
179
|
+
For a confirmed multi-document request, declare one capture phase per module.
|
|
180
|
+
While any module is uncaptured, `context status --format json` selects either
|
|
181
|
+
the `route.capture.configuration-required` Route with
|
|
182
|
+
`workflow.current.configuration`, or the `route.capture.pending-target` Route
|
|
183
|
+
with the next declared command in `workflow.current.commands`.
|
|
184
|
+
|
|
185
|
+
Each command item declares its effect and availability. The current route's
|
|
186
|
+
`gate` identifies the decision and authority boundary. Write commands are bound
|
|
187
|
+
to the workflow revision; after one succeeds, rerun status instead of reusing
|
|
188
|
+
the old command.
|
|
189
|
+
|
|
190
|
+
### `allSources("repo")`
|
|
191
|
+
|
|
192
|
+
Reference all repo sources as one collection:
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
import { allSources } from "@c4a/context";
|
|
196
|
+
|
|
197
|
+
const repoSources = allSources("repo");
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Use `allSources("repo")` only when the project should list every registered
|
|
201
|
+
repo module. Prefer a specific `source("date", "module")` for extraction phases.
|
|
202
|
+
|
|
203
|
+
## Phases
|
|
204
|
+
|
|
205
|
+
Phases declare reads and writes. The runtime can inspect them, dry-run them, and
|
|
206
|
+
record per-phase logs.
|
|
207
|
+
|
|
208
|
+
The API exposes the current declared workflow only. Declare file/lark sources,
|
|
209
|
+
capture phases, prose structure gates, source-bound compile phases, code
|
|
210
|
+
extraction phases, review gates, close/build, and packages explicitly. The CLI
|
|
211
|
+
then routes work through `context status`, `context run <phase-id>`, `context
|
|
212
|
+
review html/apply`, `context close`, `context verify`, and `context build`.
|
|
213
|
+
|
|
214
|
+
### Status declaration coverage
|
|
215
|
+
|
|
216
|
+
`context status --format json --view full` includes a `declarationGraph` and
|
|
217
|
+
`configurationGaps` for document workflows. Each row reports capture, align,
|
|
218
|
+
compile, and Review coverage for a canonical source plus collection. Gaps are
|
|
219
|
+
non-blocking before structure confirmation. Once a structure is confirmed,
|
|
220
|
+
compile routing is exact: phase selection uses canonical source plus collection,
|
|
221
|
+
and candidate progress remains bound to the current `structure_digest`. A
|
|
222
|
+
compile phase from another collection is never used as fallback.
|
|
223
|
+
|
|
224
|
+
Captured align targets that do not yet have an active confirmed structure are
|
|
225
|
+
reported in `pendingStructureTargets`. They remain unfinished even when the
|
|
226
|
+
currently active structures have been closed, verified, and built. Missing
|
|
227
|
+
compile or Review declarations route to `needs-prose-configuration`; once the
|
|
228
|
+
declarations are complete, status returns the exact align investigation command
|
|
229
|
+
for the next target. A built package does not freeze the workspace or require a
|
|
230
|
+
new workspace for later sources.
|
|
231
|
+
|
|
232
|
+
`context status --format json` defaults to the compact workflow route, target,
|
|
233
|
+
progress, counts, and aggregated diagnostics. Use `--view full` only when
|
|
234
|
+
source, phase, package, and lifecycle inventories are needed for debugging.
|
|
235
|
+
|
|
236
|
+
### Current-conversation managed execution
|
|
237
|
+
|
|
238
|
+
`context status --managed --format json` exposes
|
|
239
|
+
`executionMode: { mode: "managed", scope: "current-conversation" }` and resolves
|
|
240
|
+
eligible human gates into immediate commands. The flag is deliberately absent
|
|
241
|
+
from `defineProject`: callers start each workflow evaluation loop with managed
|
|
242
|
+
status, then execute the returned revision-bound command unchanged. Returned
|
|
243
|
+
commands carry a compact current-conversation marker instead of repeating every
|
|
244
|
+
authority. A later process or conversation gets ordinary human-gated behavior
|
|
245
|
+
by default.
|
|
246
|
+
|
|
247
|
+
Managed Review is atomic and scope-validated:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
context review approve-all <collection> --managed --format json
|
|
251
|
+
context review approve-all --all --managed --format json
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Managed structure confirmation and Review use only the revision-bound commands
|
|
255
|
+
returned by `workflow.current`. Source boundaries and unread source bodies,
|
|
256
|
+
external operations, payload validation, deterministic close, and verification
|
|
257
|
+
errors are never bypassed.
|
|
258
|
+
|
|
259
|
+
### `captureFile`
|
|
260
|
+
|
|
261
|
+
Capture a registered file source into a committed normalized document snapshot.
|
|
262
|
+
Default file capture treats `.md` files as document bodies. For MDX
|
|
263
|
+
documentation sites that use `_meta.json` route metadata, declare the processor
|
|
264
|
+
in `src/index.ts`:
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
captureFile({ source: docs, processor: mdxJsonDocs() });
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
With that processor, `.md` and `.mdx` are document bodies. Included
|
|
271
|
+
`_meta.json` files are captured as route metadata assets, surfaced in
|
|
272
|
+
`read-plan` / `source-index`, and mechanically projected into
|
|
273
|
+
`__context_route_metadata.md` so route facts can be cited as evidence. The route
|
|
274
|
+
projection records the canonical extensionless route form instead of treating a
|
|
275
|
+
local `.html` URL as the source of truth.
|
|
276
|
+
|
|
277
|
+
MDX component text is extracted separately: string props such as `title`,
|
|
278
|
+
`label`, `description`, `href`, `to`, and component children are projected into
|
|
279
|
+
`__context_mdx_component_text.md` as generated evidence. The original `.mdx`
|
|
280
|
+
file remains in the snapshot unchanged. If a documentation page renders body
|
|
281
|
+
text only at runtime from application code or remote data, configure that
|
|
282
|
+
documentation site as an explicit source boundary instead of hand-writing route
|
|
283
|
+
or body facts.
|
|
284
|
+
|
|
285
|
+
```ts
|
|
286
|
+
captureFile({ source: docs });
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Phase id:
|
|
290
|
+
|
|
291
|
+
```text
|
|
292
|
+
capture:file:<source-name>
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Register the source first with
|
|
296
|
+
`context source add file [YYYYMMDD] --module <module> --local <path>`.
|
|
297
|
+
The first registration requires `--local`; the registry may later keep `local`
|
|
298
|
+
only as a refresh hint while committed snapshots remain verifiable. Multiple
|
|
299
|
+
file modules may share one date. When `--module` is omitted, the CLI derives it
|
|
300
|
+
from the local file or directory name.
|
|
301
|
+
|
|
302
|
+
### `captureLark`
|
|
303
|
+
|
|
304
|
+
Capture a registered Lark / Feishu document source into a committed normalized
|
|
305
|
+
Markdown snapshot:
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
captureLark({ source: handbook });
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Phase id:
|
|
312
|
+
|
|
313
|
+
```text
|
|
314
|
+
capture:lark:<source-name>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Register each source with
|
|
318
|
+
`context source add lark [YYYYMMDD] --module <module>` and exactly one identity
|
|
319
|
+
flag: `--url`, `--doc-token`, or `--wiki-token`. Multiple documents may share
|
|
320
|
+
one date batch; when `--module` is omitted, the CLI derives an opaque,
|
|
321
|
+
credential-safe module id. Capture reads the
|
|
322
|
+
remote document through the CLI runner, writes normalized snapshot files under
|
|
323
|
+
`sources/lark/<date>/` as sibling document files tracked by one date-level `manifest.json`, and does not write access credentials into the
|
|
324
|
+
workspace.
|
|
325
|
+
|
|
326
|
+
Use a typed document reference in project declarations:
|
|
327
|
+
|
|
328
|
+
```ts
|
|
329
|
+
const handbook = source("20260712", "user-manual", { type: "lark" });
|
|
330
|
+
const localDocs = source("20260712", "local-manual", { type: "file" });
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### `alignProse`
|
|
334
|
+
|
|
335
|
+
Open the prose structure gate for document evidence:
|
|
336
|
+
|
|
337
|
+
```ts
|
|
338
|
+
alignProse({
|
|
339
|
+
source: docs,
|
|
340
|
+
collection: "architecture",
|
|
341
|
+
});
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
`collection` is an internal knowledge classification, not a package directory.
|
|
345
|
+
Package build maps `codegraph`/`business`/`product` to `wikis/`,
|
|
346
|
+
`architecture`/`sop`/`faq`/`decision`/`incident` to `guides/`,
|
|
347
|
+
`standards`/`test` to `rules/`, and `feats` to `feats/`. The complete output
|
|
348
|
+
contract is documented in [Package Outputs](../guides/package-outputs.md).
|
|
349
|
+
|
|
350
|
+
When `source("name")` is type-neutral, the SDK may declare
|
|
351
|
+
`align:source:<source-name>:architecture`; the CLI resolves it to
|
|
352
|
+
`align:file:<source-name>:architecture` or `align:lark:<source-name>:architecture` after
|
|
353
|
+
reading the registry.
|
|
354
|
+
|
|
355
|
+
Align is a gated workflow. It produces and validates a structure draft, not
|
|
356
|
+
final approved body:
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
context run align:file:<source-name>:architecture --view read-plan --format json
|
|
360
|
+
context run align:file:<source-name>:architecture --view source-index --compact --format json
|
|
361
|
+
context run align:file:<source-name>:architecture --view span-detail --span <source-ref> --format json
|
|
362
|
+
context run align:file:<source-name>:architecture --view span-text --span <source-ref> --format json
|
|
363
|
+
context run align:file:<source-name>:architecture --view schema --format json
|
|
364
|
+
context run align:file:<source-name>:architecture --view semantic-rules --format json
|
|
365
|
+
context run align:file:<source-name>:architecture --validate --input <structure.yaml> --format json
|
|
366
|
+
context run align:file:<source-name>:architecture --view diagnostics --input <structure.yaml> --format json
|
|
367
|
+
context run align:file:<source-name>:architecture --view structure-summary --input <structure.yaml> --format json
|
|
368
|
+
context run align:file:<source-name>:architecture --stage --input <structure.yaml> --format json
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
`--validate`, `--stage`, and `--confirm` are mutually exclusive operations. An
|
|
372
|
+
`--input` without an operation is rejected unless the selected view explicitly
|
|
373
|
+
consumes that input. Deterministic boundary repairs run internally before the
|
|
374
|
+
result is returned. Successful validation returns a stage command with the
|
|
375
|
+
same file path. JSON run output keeps `next_action` first;
|
|
376
|
+
schema and full reports stay behind explicit Views, while `--verbose` restores
|
|
377
|
+
the full phase result and repeated contracts. Long diagnostics return a compact
|
|
378
|
+
first page plus an exact diagnostics continuation command.
|
|
379
|
+
|
|
380
|
+
Align and compile evidence results include `semantic_rules`. Its `required`
|
|
381
|
+
array is the rule subset selected for the current judgment, with a selection
|
|
382
|
+
reason and content digest for each rule. `handle`, `digest`, and
|
|
383
|
+
`rules_version` are stable cache checks: reuse a loaded ruleset only while its
|
|
384
|
+
content remains in the active context and both handle and digest still match.
|
|
385
|
+
After context compaction, resume the paginated `semantic-rules` View for the
|
|
386
|
+
returned required subset; a handle alone does not imply that the rule text is
|
|
387
|
+
still available.
|
|
388
|
+
|
|
389
|
+
Document evidence boundaries are deterministic rather than semantic.
|
|
390
|
+
`source-index` and `chunks` mark Markdown AST blocks with
|
|
391
|
+
`boundary_role: "markdown-ast-block"` and `section_candidate: true`.
|
|
392
|
+
`span-text`/`span-detail` mark each returned page as
|
|
393
|
+
`range_role: "transport-page"` and `section_candidate: false`; pagination line
|
|
394
|
+
ranges are never structure boundaries. Structure validation blocks repeated
|
|
395
|
+
fixed-width line grids that cut through AST blocks and reports sections that
|
|
396
|
+
cross multiple heading paths, without classifying document topics.
|
|
397
|
+
|
|
398
|
+
After capture, the capture phase itself exposes collection-neutral `read-plan`,
|
|
399
|
+
`source-index`, `span-detail`, `span-text`, and other read-only evidence views.
|
|
400
|
+
Status selects `route.document.classification-required` until every captured
|
|
401
|
+
target has an evidence-backed, user-confirmed align declaration. Align then
|
|
402
|
+
adds `schema` and `structure-summary` for structure work. Agents should not
|
|
403
|
+
inspect `sources/` or `.tmp` directly.
|
|
404
|
+
|
|
405
|
+
Compile `read-plan`, `blockers`, and `diagnostics` Views are workspace-read-only
|
|
406
|
+
and may run concurrently. Compile `--validate`, compile `--stage`, structure
|
|
407
|
+
confirmation, Review apply, and close are serial operations.
|
|
408
|
+
|
|
409
|
+
Structure payloads use `schema_version: "context.structure.v1"` and canonical
|
|
410
|
+
`file:` / `lark:` `#span` source refs. A one-file-to-one-page plan is represented
|
|
411
|
+
as ordinary `nodes[]` and `views[]` in the structure. It does not bypass
|
|
412
|
+
structure confirmation or compile. Continuity applies to each Section, while one View/Page may
|
|
413
|
+
contain multiple independently retrievable continuous Sections. Deterministic
|
|
414
|
+
boundary splitting is applied internally during validate/stage; it is not a
|
|
415
|
+
separate Agent-authored payload or approval step.
|
|
416
|
+
|
|
417
|
+
### `compileProse`
|
|
418
|
+
|
|
419
|
+
Compile confirmed prose structure into reviewable source-bound draft pages:
|
|
420
|
+
|
|
421
|
+
```ts
|
|
422
|
+
compileProse({
|
|
423
|
+
source: docs,
|
|
424
|
+
collection: "architecture",
|
|
425
|
+
});
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
When `source("name")` is type-neutral, the SDK may declare
|
|
429
|
+
`compile:source:<source-name>:architecture`; the CLI resolves it to
|
|
430
|
+
`compile:file:<source-name>:architecture` or `compile:lark:<source-name>:architecture` after
|
|
431
|
+
reading the registry.
|
|
432
|
+
|
|
433
|
+
Phase id:
|
|
434
|
+
|
|
435
|
+
```text
|
|
436
|
+
compile:file:<source-name>:architecture
|
|
437
|
+
compile:lark:<source-name>:architecture
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
Compile requires confirmed `unapproved/structure.yaml`. It freezes the current
|
|
441
|
+
structure for the compile round; if the user wants to change nodes, section
|
|
442
|
+
ownership, or relationships, return to the align/structure gate.
|
|
443
|
+
|
|
444
|
+
Common commands:
|
|
445
|
+
|
|
446
|
+
```bash
|
|
447
|
+
context run compile:file:<source-name>:architecture --view read-plan --format json
|
|
448
|
+
context run compile:file:<source-name>:architecture --validate --format json
|
|
449
|
+
context run compile:file:<source-name>:architecture --stage --format json
|
|
450
|
+
context run compile:file:<source-name>:architecture --view diagnostics --format json
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Compile validates the complete confirmed source/collection slot before writing
|
|
454
|
+
any candidate, then materializes the slot atomically. Section bodies are
|
|
455
|
+
source-mirrored from the confirmed spans; the Agent does not create a separate
|
|
456
|
+
compile-actions payload. Each canonical source plus collection remains an
|
|
457
|
+
independent structure slot. When other captured align targets remain pending,
|
|
458
|
+
status routes to those slots before opening one collection-level Review
|
|
459
|
+
payload. `context close` is blocked while a planned View is unprepared, still
|
|
460
|
+
draft, or rejected without a structure revision.
|
|
461
|
+
|
|
462
|
+
Relationships stay in `structure.yaml` typed edges in current output; compile
|
|
463
|
+
does not infer relationships or inject relation markers into verbatim body.
|
|
464
|
+
|
|
465
|
+
### `extractTs`
|
|
466
|
+
|
|
467
|
+
Extract exported TypeScript / TSX symbols into draft candidates:
|
|
468
|
+
|
|
469
|
+
```ts
|
|
470
|
+
extractTs({
|
|
471
|
+
source: componentLib,
|
|
472
|
+
collection: "codegraph",
|
|
473
|
+
});
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Options:
|
|
477
|
+
|
|
478
|
+
| Field | Meaning |
|
|
479
|
+
|---|---|
|
|
480
|
+
| `source` | `source("date", "module")` for one repo module |
|
|
481
|
+
| `collection` | Code extraction uses `"codegraph"` |
|
|
482
|
+
| `include` | Optional glob list inside the selected source; default is `["src/**/*.{ts,tsx}"]` |
|
|
483
|
+
| `mode` | `"exports"` (default) traces public exports from automatic or configured entries; `"scan"` uses every file matched by `include` as an entry root |
|
|
484
|
+
| `entries` | Optional source-relative entry files for `"exports"` mode. They override `package.json` entry detection and live only in the Context project configuration |
|
|
485
|
+
| `exportedOnly` | Defaults to `true` in `"exports"` mode and `false` in `"scan"` mode |
|
|
486
|
+
| `transform` | Optional markdown transform function or functions |
|
|
487
|
+
|
|
488
|
+
`source` is the only package/module boundary. `include` narrows files inside
|
|
489
|
+
that source; it does not select a second module. Standard packages can omit
|
|
490
|
+
`entries` and use `package.json` `exports`, `main`, or `bin` detection. For a
|
|
491
|
+
non-standard package, configure `entries` in the Context project instead of
|
|
492
|
+
editing the source repository:
|
|
493
|
+
|
|
494
|
+
```ts
|
|
495
|
+
extractTs({
|
|
496
|
+
source: componentLib,
|
|
497
|
+
collection: "codegraph",
|
|
498
|
+
include: ["src/**/*.ts"],
|
|
499
|
+
entries: ["src/api.ts"],
|
|
500
|
+
});
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
When the intended knowledge scope is every declaration in the selected files
|
|
504
|
+
rather than a public export graph, use `mode: "scan"`. Scan mode does not accept
|
|
505
|
+
`entries`; `include` supplies its file roots.
|
|
506
|
+
|
|
507
|
+
Entry failures use the stable machine code `NO_ENTRY_DETECTED`. This includes
|
|
508
|
+
`entries: []`, exports mode with no detected/configured entry, and scan mode
|
|
509
|
+
with no files matched by `include`; these cases never succeed silently.
|
|
510
|
+
|
|
511
|
+
TypeScript extraction reads the selected module's `tsconfig.json` or
|
|
512
|
+
`jsconfig.json`. JSONC comments/trailing commas, local or installed `extends`,
|
|
513
|
+
`compilerOptions.baseUrl`, and `compilerOptions.paths` are used for export
|
|
514
|
+
tracing and internal dependency relations, so aliases such as `@/*` resolve to
|
|
515
|
+
their source files.
|
|
516
|
+
|
|
517
|
+
In monorepos, make each package/subdirectory a module boundary. Register the
|
|
518
|
+
chosen package path with `context source add repo [YYYYMMDD] --module <module> --local <package-dir>` and
|
|
519
|
+
reference it with `source("<date>", "<module>")`.
|
|
520
|
+
Do not use `include` to choose a
|
|
521
|
+
package from a larger monorepo source.
|
|
522
|
+
|
|
523
|
+
Use `context source inspect <date>/<module>` to list detected module/package
|
|
524
|
+
boundaries before choosing the source. Use `context run <phase-id> --dry-run
|
|
525
|
+
--format json` to check the resolved modules, file counts, symbol counts, and
|
|
526
|
+
candidate estimate before writing `unapproved/entities.jsonl`. The dry-run
|
|
527
|
+
preview also includes `knowledgeTree` and `knowledgePathExamples`, which show
|
|
528
|
+
where approved Markdown will land after review apply.
|
|
529
|
+
Its module and total summaries distinguish `discoveredFiles`, `analyzedFiles`,
|
|
530
|
+
`skippedFiles`, `symbols`, and `relations`. Module summaries also expose the
|
|
531
|
+
resolved `entryFiles`, exported/internal symbol counts, and a structural
|
|
532
|
+
`candidateKinds` count. These fields describe extractor output only; the CLI
|
|
533
|
+
does not infer which symbols are meaningful to a particular product or
|
|
534
|
+
audience. Modules with skipped files include the deterministic traversal
|
|
535
|
+
reason, such as files not reachable from exports-mode entries.
|
|
536
|
+
|
|
537
|
+
Phase id shape:
|
|
538
|
+
|
|
539
|
+
```text
|
|
540
|
+
extract:<source-name-or-repo>:codegraph
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Codegraph extraction has two execution policies:
|
|
544
|
+
|
|
545
|
+
- `context run <phase-id>` is the Agent/user default. The first run sends every
|
|
546
|
+
code symbol to Review. Later runs preserve unchanged approved symbols and send
|
|
547
|
+
only `add`, `update`, and `remove` deltas to Review. After every phase result,
|
|
548
|
+
the Agent re-evaluates `context status --format json`; only
|
|
549
|
+
`workflow.current` decides whether Review is now required.
|
|
550
|
+
- `context run <phase-id> --auto-promote` is the explicit CI/CD path. It is valid
|
|
551
|
+
only for `phase.extract.ts` codegraph phases, applies deterministic code deltas
|
|
552
|
+
without Review, refreshes deterministic close when approved knowledge changed,
|
|
553
|
+
then runs project verification. Close or verification errors make the command
|
|
554
|
+
fail; JSON output reports applied/materialized/removed counts plus a `close`
|
|
555
|
+
state of `refreshed`, `current`, or `not-required`. Package build remains a
|
|
556
|
+
separate pipeline step; existing package outputs are reported stale.
|
|
557
|
+
|
|
558
|
+
This policy never auto-promotes architecture, business, decision, test, or
|
|
559
|
+
other semantic knowledge. Agents must not infer a human gate from a phase-local
|
|
560
|
+
result. Human gates and their inspection/resolution Actions are exposed only by
|
|
561
|
+
`workflow.current`.
|
|
562
|
+
|
|
563
|
+
Approved codegraph sections use the local evidence form
|
|
564
|
+
`src-N#symbol:<file>:<symbol>:<kind>@<digest>`. The file segment makes reverse
|
|
565
|
+
lookup exact when multiple files contain the same symbol name, kind, and digest;
|
|
566
|
+
the complete ref remains opaque to agents. New pages keep only top-level
|
|
567
|
+
`candidate_fingerprint` and do not emit `code_origin`.
|
|
568
|
+
|
|
569
|
+
### `reviewValidity`
|
|
570
|
+
|
|
571
|
+
Declare the review step for a collection:
|
|
572
|
+
|
|
573
|
+
```ts
|
|
574
|
+
reviewValidity({ collection: "codegraph" });
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
Declare one review gate for all current draft collections:
|
|
578
|
+
|
|
579
|
+
```ts
|
|
580
|
+
reviewValidity({ scope: "all" });
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
Phase id:
|
|
584
|
+
|
|
585
|
+
```text
|
|
586
|
+
review:codegraph:validity
|
|
587
|
+
review:all:validity
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
The review HTML and apply flow are CLI-owned.
|
|
591
|
+
|
|
592
|
+
This phase marks a human review gate when current candidates exist. Agents
|
|
593
|
+
should run `context review html <collection> --open --format json` or `context
|
|
594
|
+
review html --all --open --format json`, confirm the returned `opened` field,
|
|
595
|
+
and wait for the user-copied payload. They should not run the phase as an
|
|
596
|
+
automatic approval step or synthesize a payload themselves.
|
|
597
|
+
|
|
598
|
+
The only batch-wide exception is explicit current-conversation fully managed
|
|
599
|
+
authority. In that mode, follow the `context status --managed` route to
|
|
600
|
+
`context review approve-all ... --managed`; the CLI validates the exact current
|
|
601
|
+
scope before applying one default-approved decision.
|
|
602
|
+
|
|
603
|
+
The gate is batch-scoped: prose waits for every planned View across all active
|
|
604
|
+
structure slots and every declared `pendingStructureTargets` item in the round;
|
|
605
|
+
codegraph waits for every pending extract phase in the confirmed module round.
|
|
606
|
+
Candidate count/hash therefore describes the complete current batch rather than
|
|
607
|
+
one page, source slot, or module. Deterministic close later merges all active
|
|
608
|
+
slots into `knowledge/structure.yaml`.
|
|
609
|
+
|
|
610
|
+
`status.structureBatch` lists unclassified, configuration-required, pending,
|
|
611
|
+
and active structure slots together with the execution policy for the round.
|
|
612
|
+
|
|
613
|
+
If the user explicitly asks for an automated or quick approval/rejection path,
|
|
614
|
+
use the scoped quick commands instead of hand-writing a payload:
|
|
615
|
+
|
|
616
|
+
```bash
|
|
617
|
+
context review approve <candidate-id> --collection <collection>
|
|
618
|
+
context review reject <candidate-id> --all
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
These commands still compute the current review scope and apply the same
|
|
622
|
+
candidate-id gate as the copied payload flow. They are not a replacement for the
|
|
623
|
+
default human review gate.
|
|
624
|
+
|
|
625
|
+
### `customPhase`
|
|
626
|
+
|
|
627
|
+
Use only when the typed factories cannot express a project-specific workflow:
|
|
628
|
+
|
|
629
|
+
```ts
|
|
630
|
+
const sample = source("20260712", "sample");
|
|
631
|
+
|
|
632
|
+
customPhase("custom:20260712/sample:review", async (ctx) => {
|
|
633
|
+
await ctx.ensureSources({ source: sample });
|
|
634
|
+
await ctx.extract.ts(extractTs({ source: sample, collection: "codegraph" }));
|
|
635
|
+
await ctx.review.html(reviewValidity({ collection: "codegraph" }));
|
|
636
|
+
});
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
Custom phases are an escape hatch. Prefer built-in factories for source,
|
|
640
|
+
extract, review, and package workflows. The supported runtime helpers are:
|
|
641
|
+
|
|
642
|
+
- `ctx.ensureSources(...)` for repo source readiness.
|
|
643
|
+
- `ctx.extract.ts(...)` for declared TypeScript extraction.
|
|
644
|
+
- `ctx.review.html(...)` for the human review HTML gate.
|