@workflow-cannon/workspace-kit 0.8.0 → 0.10.0
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 +21 -5
- package/dist/cli/run-command.d.ts +11 -0
- package/dist/cli/run-command.js +143 -0
- package/dist/cli.js +19 -146
- package/dist/core/config-cli.js +5 -5
- package/dist/core/config-metadata.js +3 -3
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/policy.d.ts +11 -1
- package/dist/core/policy.js +41 -22
- package/dist/core/transcript-completion-hook.js +41 -3
- package/dist/core/workspace-kit-config.d.ts +2 -1
- package/dist/core/workspace-kit-config.js +4 -29
- package/dist/modules/approvals/index.js +2 -2
- package/dist/modules/documentation/runtime.js +30 -6
- package/dist/modules/improvement/index.js +15 -3
- package/dist/modules/improvement/transcript-sync-runtime.d.ts +5 -0
- package/dist/modules/improvement/transcript-sync-runtime.js +17 -0
- package/package.json +2 -1
- package/src/modules/documentation/README.md +39 -0
- package/src/modules/documentation/RULES.md +70 -0
- package/src/modules/documentation/config.md +14 -0
- package/src/modules/documentation/index.ts +120 -0
- package/src/modules/documentation/instructions/document-project.md +44 -0
- package/src/modules/documentation/instructions/documentation-maintainer.md +81 -0
- package/src/modules/documentation/instructions/generate-document.md +44 -0
- package/src/modules/documentation/runtime.ts +870 -0
- package/src/modules/documentation/schemas/documentation-schema.md +54 -0
- package/src/modules/documentation/state.md +8 -0
- package/src/modules/documentation/templates/AGENTS.md +84 -0
- package/src/modules/documentation/templates/ARCHITECTURE.md +71 -0
- package/src/modules/documentation/templates/PRINCIPLES.md +122 -0
- package/src/modules/documentation/templates/RELEASING.md +96 -0
- package/src/modules/documentation/templates/ROADMAP.md +131 -0
- package/src/modules/documentation/templates/SECURITY.md +53 -0
- package/src/modules/documentation/templates/SUPPORT.md +40 -0
- package/src/modules/documentation/templates/TERMS.md +61 -0
- package/src/modules/documentation/templates/runbooks/consumer-cadence.md +55 -0
- package/src/modules/documentation/templates/runbooks/parity-validation-flow.md +68 -0
- package/src/modules/documentation/templates/runbooks/release-channels.md +30 -0
- package/src/modules/documentation/templates/workbooks/phase2-config-policy-workbook.md +42 -0
- package/src/modules/documentation/templates/workbooks/task-engine-workbook.md +42 -0
- package/src/modules/documentation/templates/workbooks/transcript-automation-baseline.md +68 -0
- package/src/modules/documentation/types.ts +51 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{{{AI Documentation Directive}}}
|
|
2
|
+
|
|
3
|
+
# Workflow Cannon Terms
|
|
4
|
+
|
|
5
|
+
Project-specific glossary for consistent language across AI-agent guidance, planning, execution, and release workflows.
|
|
6
|
+
|
|
7
|
+
## How to use this glossary
|
|
8
|
+
|
|
9
|
+
{{{
|
|
10
|
+
Rules for adopting and extending terms.
|
|
11
|
+
Method:
|
|
12
|
+
1) Read the existing `docs/maintainers/TERMS.md` introduction if present.
|
|
13
|
+
2) Emphasize operational definitions and single primary source per term.
|
|
14
|
+
Output format:
|
|
15
|
+
- 3-5 bullets.
|
|
16
|
+
Validation:
|
|
17
|
+
- Instruct readers to add terms here before broad adoption in other docs.
|
|
18
|
+
}}}
|
|
19
|
+
|
|
20
|
+
## Definition surfaces
|
|
21
|
+
|
|
22
|
+
{{{
|
|
23
|
+
List where canonical definitions live vs enforcement surfaces.
|
|
24
|
+
Method:
|
|
25
|
+
1) Reproduce structure from `docs/maintainers/TERMS.md`: glossary, principles, README/ROADMAP/ARCHITECTURE, TASKS, RELEASING, `.cursor/rules`, `tasks/*.md` as applicable.
|
|
26
|
+
2) Verify paths exist before listing.
|
|
27
|
+
Output format:
|
|
28
|
+
- Bullet list; each bullet names a surface and its role with **bold** label.
|
|
29
|
+
Validation:
|
|
30
|
+
- Use consistent path formatting; no broken links.
|
|
31
|
+
}}}
|
|
32
|
+
|
|
33
|
+
## Terms and definitions
|
|
34
|
+
|
|
35
|
+
{{{
|
|
36
|
+
Maintain the glossary entries for this project.
|
|
37
|
+
Method:
|
|
38
|
+
1) Read the current `docs/maintainers/TERMS.md` term list and preserve entries unless superseded by `docs/maintainers/DECISIONS.md` or explicit renames.
|
|
39
|
+
2) For each term, keep three sub-bullets aligned under the term:
|
|
40
|
+
- **Definition**: …
|
|
41
|
+
- **Defined in**: path(s)
|
|
42
|
+
- **Enforced in**: path(s) or mechanism
|
|
43
|
+
3) Add new terms when they appear repeatedly in `.workspace-kit/tasks/state.json`, `ROADMAP.md`, or `.cursor/rules` without definitions.
|
|
44
|
+
4) Fix indentation so **Definition** / **Defined in** / **Enforced in** are nested under the term bullet, not orphaned.
|
|
45
|
+
Output format:
|
|
46
|
+
- One top-level bullet per term with nested three-line pattern above.
|
|
47
|
+
Validation:
|
|
48
|
+
- Alphabetize or group by theme consistently with the prior file; do not duplicate term names.
|
|
49
|
+
}}}
|
|
50
|
+
|
|
51
|
+
## Related docs
|
|
52
|
+
|
|
53
|
+
{{{
|
|
54
|
+
Cross-link README, principles, roadmap, tasks, releasing.
|
|
55
|
+
Method:
|
|
56
|
+
1) Verify paths exist.
|
|
57
|
+
Output format:
|
|
58
|
+
- Bulleted list.
|
|
59
|
+
Validation:
|
|
60
|
+
- Include at least `README.md`, `.ai/PRINCIPLES.md`, `docs/maintainers/ROADMAP.md`, `.workspace-kit/tasks/state.json`, `docs/maintainers/RELEASING.md` when present.
|
|
61
|
+
}}}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{{{AI Documentation Directive}}}
|
|
2
|
+
|
|
3
|
+
# Consumer Update Cadence
|
|
4
|
+
|
|
5
|
+
Defines update cadence states for `@workflow-cannon/workspace-kit` consumers and transition validation requirements.
|
|
6
|
+
|
|
7
|
+
## Cadence states
|
|
8
|
+
|
|
9
|
+
{{{
|
|
10
|
+
Document cadence states and channel intent.
|
|
11
|
+
Method:
|
|
12
|
+
1) Read `docs/maintainers/runbooks/consumer-cadence.md`.
|
|
13
|
+
2) Preserve state names and dist-tags.
|
|
14
|
+
Output format:
|
|
15
|
+
- Markdown table with state, meaning, npm dist-tag, and consumer action.
|
|
16
|
+
Validation:
|
|
17
|
+
- State names and tags must match release-channel policy docs.
|
|
18
|
+
}}}
|
|
19
|
+
|
|
20
|
+
## State transitions
|
|
21
|
+
|
|
22
|
+
{{{
|
|
23
|
+
Describe allowed transition paths and recandidate flow.
|
|
24
|
+
Method:
|
|
25
|
+
1) Read maintainer cadence runbook.
|
|
26
|
+
2) Preserve candidate/stable/patch flow semantics.
|
|
27
|
+
Output format:
|
|
28
|
+
- Diagram block or concise bullets.
|
|
29
|
+
Validation:
|
|
30
|
+
- Do not introduce unsupported transition paths.
|
|
31
|
+
}}}
|
|
32
|
+
|
|
33
|
+
## Required validation per transition
|
|
34
|
+
|
|
35
|
+
{{{
|
|
36
|
+
Capture required checks for each transition path.
|
|
37
|
+
Method:
|
|
38
|
+
1) Read `docs/maintainers/release-gate-matrix.md` and cadence runbook.
|
|
39
|
+
Output format:
|
|
40
|
+
- Subsections by transition with numbered validation steps.
|
|
41
|
+
Validation:
|
|
42
|
+
- Keep parity and fixture validation requirements explicit.
|
|
43
|
+
}}}
|
|
44
|
+
|
|
45
|
+
## Related documents
|
|
46
|
+
|
|
47
|
+
{{{
|
|
48
|
+
List gate/release/task references used for cadence decisions.
|
|
49
|
+
Method:
|
|
50
|
+
1) Use related section from maintainer runbook.
|
|
51
|
+
Output format:
|
|
52
|
+
- Bullets with paths and short purpose.
|
|
53
|
+
Validation:
|
|
54
|
+
- Include only existing files.
|
|
55
|
+
}}}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{{{AI Documentation Directive}}}
|
|
2
|
+
|
|
3
|
+
# Parity Validation Flow
|
|
4
|
+
|
|
5
|
+
Canonical ordered command chain for validating packaged-artifact parity in `@workflow-cannon/workspace-kit`.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
{{{
|
|
10
|
+
State why parity validation exists and when it is required.
|
|
11
|
+
Method:
|
|
12
|
+
1) Read `docs/maintainers/runbooks/parity-validation-flow.md` and `docs/maintainers/RELEASING.md`.
|
|
13
|
+
2) Emphasize packaged-artifact truth and release-gate requirement.
|
|
14
|
+
Output format:
|
|
15
|
+
- One short paragraph.
|
|
16
|
+
Validation:
|
|
17
|
+
- Preserve release-gate intent; do not weaken fail-closed language.
|
|
18
|
+
}}}
|
|
19
|
+
|
|
20
|
+
## Canonical command chain
|
|
21
|
+
|
|
22
|
+
{{{
|
|
23
|
+
Produce the ordered parity command sequence and expected outcomes.
|
|
24
|
+
Method:
|
|
25
|
+
1) Read `docs/maintainers/runbooks/parity-validation-flow.md`.
|
|
26
|
+
2) Preserve step ordering and command names exactly.
|
|
27
|
+
Output format:
|
|
28
|
+
- Markdown table: Step | Command | Expected exit | Output artifact | Machine-parseable.
|
|
29
|
+
Validation:
|
|
30
|
+
- Commands must match runnable scripts/paths in repository.
|
|
31
|
+
}}}
|
|
32
|
+
|
|
33
|
+
## Failure behavior
|
|
34
|
+
|
|
35
|
+
{{{
|
|
36
|
+
Describe hard-failure handling for any non-zero parity step.
|
|
37
|
+
Method:
|
|
38
|
+
1) Read `scripts/run-parity.mjs` behavior as documented in maintainer runbook.
|
|
39
|
+
Output format:
|
|
40
|
+
- 3-4 bullets.
|
|
41
|
+
Validation:
|
|
42
|
+
- Must indicate stop-on-fail behavior and evidence capture.
|
|
43
|
+
}}}
|
|
44
|
+
|
|
45
|
+
## Evidence contract
|
|
46
|
+
|
|
47
|
+
{{{
|
|
48
|
+
Document parity evidence location and key fields.
|
|
49
|
+
Method:
|
|
50
|
+
1) Read `docs/maintainers/runbooks/parity-validation-flow.md`.
|
|
51
|
+
2) Validate schema reference path.
|
|
52
|
+
Output format:
|
|
53
|
+
- Bullets for location, schema, and key fields.
|
|
54
|
+
Validation:
|
|
55
|
+
- Keep artifact path and schema path exact.
|
|
56
|
+
}}}
|
|
57
|
+
|
|
58
|
+
## Related documents
|
|
59
|
+
|
|
60
|
+
{{{
|
|
61
|
+
List closely related release and cadence docs.
|
|
62
|
+
Method:
|
|
63
|
+
1) Read links from maintainer parity runbook.
|
|
64
|
+
Output format:
|
|
65
|
+
- Bulleted paths with short purpose notes.
|
|
66
|
+
Validation:
|
|
67
|
+
- Only include files that exist.
|
|
68
|
+
}}}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{{{AI Documentation Directive}}}
|
|
2
|
+
|
|
3
|
+
# Release Channels
|
|
4
|
+
|
|
5
|
+
Operational mapping for `canary`, `stable`, and `lts` channels.
|
|
6
|
+
|
|
7
|
+
## Channel mapping
|
|
8
|
+
|
|
9
|
+
{{{
|
|
10
|
+
Produce channel to dist-tag/tag/label/compatibility mapping.
|
|
11
|
+
Method:
|
|
12
|
+
1) Read `docs/maintainers/runbooks/release-channels.md`.
|
|
13
|
+
2) Read `docs/maintainers/data/compatibility-matrix.json`.
|
|
14
|
+
Output format:
|
|
15
|
+
- Markdown table with channel columns used by maintainer doc.
|
|
16
|
+
Validation:
|
|
17
|
+
- Values must match compatibility matrix source.
|
|
18
|
+
}}}
|
|
19
|
+
|
|
20
|
+
## Promotion and rollback
|
|
21
|
+
|
|
22
|
+
{{{
|
|
23
|
+
Describe promotion prerequisites and rollback strategy.
|
|
24
|
+
Method:
|
|
25
|
+
1) Read channel runbook and release gate docs.
|
|
26
|
+
Output format:
|
|
27
|
+
- 3 concise bullets.
|
|
28
|
+
Validation:
|
|
29
|
+
- Preserve forward-fix rollback model (no tag mutation).
|
|
30
|
+
}}}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{{{AI Documentation Directive}}}
|
|
2
|
+
|
|
3
|
+
# Phase 2 workbook — config, policy, local task cutover
|
|
4
|
+
|
|
5
|
+
Binding design baseline for configuration and policy behavior in `v0.4.0`.
|
|
6
|
+
|
|
7
|
+
## Scope and non-goals
|
|
8
|
+
|
|
9
|
+
{{{
|
|
10
|
+
Summarize Phase 2 scope and explicit non-goals.
|
|
11
|
+
Method:
|
|
12
|
+
1) Read `docs/maintainers/workbooks/phase2-config-policy-workbook.md`.
|
|
13
|
+
2) Preserve task coverage and non-goal statements.
|
|
14
|
+
Output format:
|
|
15
|
+
- Short scope line + 3-5 non-goal bullets.
|
|
16
|
+
Validation:
|
|
17
|
+
- Keep references aligned to current task-engine state.
|
|
18
|
+
}}}
|
|
19
|
+
|
|
20
|
+
## Config precedence and merge semantics
|
|
21
|
+
|
|
22
|
+
{{{
|
|
23
|
+
Document layered precedence and merge model.
|
|
24
|
+
Method:
|
|
25
|
+
1) Extract precedence stack and merge behavior from maintainer workbook.
|
|
26
|
+
Output format:
|
|
27
|
+
- Numbered precedence list and one merge-semantics note.
|
|
28
|
+
Validation:
|
|
29
|
+
- Order must remain exact and deterministic.
|
|
30
|
+
}}}
|
|
31
|
+
|
|
32
|
+
## Policy and approvals baseline
|
|
33
|
+
|
|
34
|
+
{{{
|
|
35
|
+
Capture sensitive operation gating and approval model.
|
|
36
|
+
Method:
|
|
37
|
+
1) Read workbook sections for sensitive operations and approvals.
|
|
38
|
+
Output format:
|
|
39
|
+
- Operation table + approval bullets.
|
|
40
|
+
Validation:
|
|
41
|
+
- Preserve fail-closed policy behavior and actor resolution order.
|
|
42
|
+
}}}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{{{AI Documentation Directive}}}
|
|
2
|
+
|
|
3
|
+
# Task Engine Schema Workbook
|
|
4
|
+
|
|
5
|
+
Design workbook for Task Engine lifecycle, transitions, persistence, and guard behavior.
|
|
6
|
+
|
|
7
|
+
## Design decisions
|
|
8
|
+
|
|
9
|
+
{{{
|
|
10
|
+
Capture resolved design decisions and rationale.
|
|
11
|
+
Method:
|
|
12
|
+
1) Read `docs/maintainers/workbooks/task-engine-workbook.md`.
|
|
13
|
+
2) Preserve canonical choices for lifecycle, persistence, evidence, and command surfaces.
|
|
14
|
+
Output format:
|
|
15
|
+
- Markdown decision table.
|
|
16
|
+
Validation:
|
|
17
|
+
- Keep decisions consistent with current runtime behavior and tests.
|
|
18
|
+
}}}
|
|
19
|
+
|
|
20
|
+
## State model and transitions
|
|
21
|
+
|
|
22
|
+
{{{
|
|
23
|
+
Document lifecycle states and transition contract.
|
|
24
|
+
Method:
|
|
25
|
+
1) Use state/transition sections from maintainer workbook.
|
|
26
|
+
Output format:
|
|
27
|
+
- State list and allowed transition table.
|
|
28
|
+
Validation:
|
|
29
|
+
- Transition rules must match runtime guard behavior.
|
|
30
|
+
}}}
|
|
31
|
+
|
|
32
|
+
## Persistence and evidence contract
|
|
33
|
+
|
|
34
|
+
{{{
|
|
35
|
+
Describe state store schema and transition evidence requirements.
|
|
36
|
+
Method:
|
|
37
|
+
1) Read persistence/evidence sections from maintainer workbook.
|
|
38
|
+
Output format:
|
|
39
|
+
- Store schema summary and evidence field bullets.
|
|
40
|
+
Validation:
|
|
41
|
+
- Store path and required evidence fields must match implementation.
|
|
42
|
+
}}}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{{{AI Documentation Directive}}}
|
|
2
|
+
|
|
3
|
+
# Transcript Automation Baseline (Phase 5)
|
|
4
|
+
|
|
5
|
+
Canonical design baseline for transcript intelligence automation.
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
{{{
|
|
10
|
+
Capture baseline scope and compatibility expectation for follow-on tasks.
|
|
11
|
+
Method:
|
|
12
|
+
1) Read `docs/maintainers/workbooks/transcript-automation-baseline.md` and `docs/maintainers/ROADMAP.md`.
|
|
13
|
+
2) Preserve task ranges and compatibility constraints.
|
|
14
|
+
Output format:
|
|
15
|
+
- 2 bullets.
|
|
16
|
+
Validation:
|
|
17
|
+
- Task IDs must match task-engine state and roadmap wording.
|
|
18
|
+
}}}
|
|
19
|
+
|
|
20
|
+
## Command model
|
|
21
|
+
|
|
22
|
+
{{{
|
|
23
|
+
Describe transcript automation commands and behavioral contract.
|
|
24
|
+
Method:
|
|
25
|
+
1) Read improvement module docs and maintainer workbook.
|
|
26
|
+
2) Preserve command names and policy sensitivity.
|
|
27
|
+
Output format:
|
|
28
|
+
- Bullets grouped by command.
|
|
29
|
+
Validation:
|
|
30
|
+
- Command names must exist in module instruction surfaces.
|
|
31
|
+
}}}
|
|
32
|
+
|
|
33
|
+
## Config and cadence contract
|
|
34
|
+
|
|
35
|
+
{{{
|
|
36
|
+
Document config keys and cadence decision rules.
|
|
37
|
+
Method:
|
|
38
|
+
1) Read `src/modules/improvement/config.md` and maintainer workbook.
|
|
39
|
+
2) Preserve default values and skip/generate rules.
|
|
40
|
+
Output format:
|
|
41
|
+
- Key list plus cadence rule bullets.
|
|
42
|
+
Validation:
|
|
43
|
+
- Keys and defaults must match current config metadata.
|
|
44
|
+
}}}
|
|
45
|
+
|
|
46
|
+
## Safety and observability boundaries
|
|
47
|
+
|
|
48
|
+
{{{
|
|
49
|
+
Summarize privacy/safety constraints and output diagnostics requirements.
|
|
50
|
+
Method:
|
|
51
|
+
1) Read maintainer workbook and improvement module behavior docs.
|
|
52
|
+
Output format:
|
|
53
|
+
- 4-6 bullets.
|
|
54
|
+
Validation:
|
|
55
|
+
- Keep local-only transcript archive default and policy-gated generation behavior.
|
|
56
|
+
}}}
|
|
57
|
+
|
|
58
|
+
## Rollout guardrails
|
|
59
|
+
|
|
60
|
+
{{{
|
|
61
|
+
State constraints for future changes to this baseline.
|
|
62
|
+
Method:
|
|
63
|
+
1) Read roadmap + workbook guardrail language.
|
|
64
|
+
Output format:
|
|
65
|
+
- 2-3 bullets.
|
|
66
|
+
Validation:
|
|
67
|
+
- Require same-change updates for compatibility-impacting baseline changes.
|
|
68
|
+
}}}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type DocumentationGenerateOptions = {
|
|
2
|
+
dryRun?: boolean;
|
|
3
|
+
overwrite?: boolean;
|
|
4
|
+
overwriteAi?: boolean;
|
|
5
|
+
overwriteHuman?: boolean;
|
|
6
|
+
strict?: boolean;
|
|
7
|
+
maxValidationAttempts?: number;
|
|
8
|
+
allowWithoutTemplate?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type DocumentationConflict = {
|
|
12
|
+
source: string;
|
|
13
|
+
reason: string;
|
|
14
|
+
severity: "warn" | "stop";
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type DocumentationValidationIssue = {
|
|
18
|
+
check: "schema" | "section-coverage" | "template-resolution" | "write-boundary" | "conflict";
|
|
19
|
+
message: string;
|
|
20
|
+
resolved: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type DocumentationGenerationEvidence = {
|
|
24
|
+
documentType: string;
|
|
25
|
+
filesRead: string[];
|
|
26
|
+
filesWritten: string[];
|
|
27
|
+
filesSkipped: string[];
|
|
28
|
+
validationIssues: DocumentationValidationIssue[];
|
|
29
|
+
conflicts: DocumentationConflict[];
|
|
30
|
+
attemptsUsed: number;
|
|
31
|
+
timestamp: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type DocumentationGenerateResult = {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
aiOutputPath?: string;
|
|
37
|
+
humanOutputPath?: string;
|
|
38
|
+
evidence: DocumentationGenerationEvidence;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type DocumentationBatchResult = {
|
|
42
|
+
ok: boolean;
|
|
43
|
+
results: DocumentationGenerateResult[];
|
|
44
|
+
summary: {
|
|
45
|
+
total: number;
|
|
46
|
+
succeeded: number;
|
|
47
|
+
failed: number;
|
|
48
|
+
skipped: number;
|
|
49
|
+
timestamp: string;
|
|
50
|
+
};
|
|
51
|
+
};
|