doctrina-cli 0.14.0 → 0.15.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 +1 -1
- package/package.json +1 -1
- package/src/commands/analyze.js +56 -0
- package/src/commands/context.js +32 -5
- package/src/commands/contract.js +59 -19
- package/src/commands/coverage.js +110 -8
- package/src/commands/doctor.js +55 -5
- package/src/commands/next.js +24 -1
- package/src/commands/skill.js +186 -3
- package/src/commands/triage.js +248 -0
- package/src/commands/validate.js +91 -4
- package/src/commands/verify.js +114 -3
- package/src/commands/work.js +37 -3
- package/src/index.js +2 -1
- package/src/lib/commands.js +16 -4
- package/src/lib/pipeline.js +161 -0
- package/src/lib/runtime.js +683 -0
- package/templates/AGENTS.md.template +3 -3
- package/templates/contract.md.template +74 -3
- package/templates/spec.md.template +22 -0
|
@@ -34,8 +34,7 @@ prompt and approves; do not make them run the CLI or hand-author artifacts.
|
|
|
34
34
|
## Doctrina command surface (generated — reach for these, don't hand-author)
|
|
35
35
|
|
|
36
36
|
Every command, with the moment you reach for it. The CLI scaffolds from
|
|
37
|
-
canonical templates and
|
|
38
|
-
hand-authoring. Flags and detail: `doctrina <command> --help`.
|
|
37
|
+
canonical templates and syncs `index.json`. Flags: `doctrina <cmd> --help`.
|
|
39
38
|
**Bootstrap**
|
|
40
39
|
- `doctrina init` — scaffold AGENTS.md and .doctrina/. *When:* starting a project that has no AGENTS.md yet.
|
|
41
40
|
- `doctrina intake` — store the intent and print the bootstrap playbook. *When:* you have a full project description and no specs yet.
|
|
@@ -51,7 +50,8 @@ hand-authoring. Flags and detail: `doctrina <command> --help`.
|
|
|
51
50
|
- `doctrina handoff (before compaction/handover)` — a resume note: open work, task state, next command. *When:* BEFORE compaction or handing over to another session.
|
|
52
51
|
- `doctrina constitution` — accepted ADRs and product non-goals. *When:* you need the standing rules before deciding something.
|
|
53
52
|
**Change**
|
|
54
|
-
- `doctrina
|
|
53
|
+
- `doctrina triage` — classify the lane (product/runtime/chore) and check the declared runtime surface. *When:* a request arrives — BEFORE scaffolding, especially if it smells like an incident.
|
|
54
|
+
- `doctrina work "<prompt>" (--capability · --chore · --from-diff · --quiet)` — scaffold a change and print the playbook to execute. *When:* a request arrives that changes behaviour (triage says PRODUCT).
|
|
55
55
|
- `doctrina spec new|list|set` — create, list, and edit capability specs. *When:* a capability needs creating or its headers advancing.
|
|
56
56
|
- `doctrina change new|apply|archive|check|tick|diff|abandon` — new / apply / archive / check / tick / diff / abandon. *When:* driving a change through its lifecycle by hand.
|
|
57
57
|
- `doctrina contract new|list|check` — own and verify the integration surface. *When:* the change touches ports, env vars, or public endpoints.
|
|
@@ -32,11 +32,82 @@ Variables the running system requires, named IDENTICALLY across code,
|
|
|
32
32
|
`.env.example`, and infra (compose/helm). `doctrina contract check` warns
|
|
33
33
|
when a variable here is missing from `.env.example` — the DATABASE_URL /
|
|
34
34
|
KAFKA_BROKER drift class.
|
|
35
|
+
|
|
36
|
+
Values declares an ENUM when the variable is one. Write the alternation
|
|
37
|
+
with escaped pipes so the table survives: `none\|critical\|serious`.
|
|
38
|
+
check then fails an .env.example value outside the set (RT04), and warns
|
|
39
|
+
when the consumer never mentions any member — an enum nothing validates.
|
|
40
|
+
Leave Values empty or `—` for free-form variables.
|
|
41
|
+
-->
|
|
42
|
+
|
|
43
|
+
| Variable | Required | Values | Example |
|
|
44
|
+
|--------------|----------|--------|-------------------------------------------|
|
|
45
|
+
| DATABASE_URL | yes | — | postgres://user:pass@localhost:5432/app |
|
|
46
|
+
|
|
47
|
+
## Wiring
|
|
48
|
+
|
|
49
|
+
<!--
|
|
50
|
+
Where each variable's value COMES FROM, and what reads it. This is the
|
|
51
|
+
table that closes the gap between "I configured it" and "the process saw
|
|
52
|
+
it": a variable can be set in the CI provider and still never reach the
|
|
53
|
+
program, because no `env:` line ever exports it.
|
|
54
|
+
|
|
55
|
+
Origin vars | secrets | literal | local
|
|
56
|
+
vars and secrets are CI-injected, and CI injects the EMPTY
|
|
57
|
+
STRING for one that is unset — not "absent". That is why a
|
|
58
|
+
`getenv(NAME, default)` default silently never applies.
|
|
59
|
+
Workflow repo-relative path to the workflow/pipeline file.
|
|
60
|
+
Job/Step the job (or step) whose env: block must export it.
|
|
61
|
+
Consumer the file that reads it.
|
|
62
|
+
|
|
63
|
+
`doctrina contract check` then verifies (RT01/RT02) that the workflow
|
|
64
|
+
really exports it, from the origin and under the name declared, and
|
|
65
|
+
(RT03) that the consumer does not give it a default only an ABSENT
|
|
66
|
+
value would trigger.
|
|
67
|
+
|
|
68
|
+
Delete the rows that do not apply. A contract with no Wiring rows is
|
|
69
|
+
not "verified" — it is unchecked, and check says so.
|
|
70
|
+
-->
|
|
71
|
+
|
|
72
|
+
| Variable | Origin | Workflow | Job/Step | Consumer |
|
|
73
|
+
|----------|--------|----------|----------|----------|
|
|
74
|
+
| <NAME> | vars | <path> | <job> | <file> |
|
|
75
|
+
|
|
76
|
+
## Selectors
|
|
77
|
+
|
|
78
|
+
<!--
|
|
79
|
+
The test selectors (BDD tags, suite names, filter expressions) this
|
|
80
|
+
project DISPATCHES on. A selector that matches nothing runs zero cases
|
|
81
|
+
and still exits 0 — a green job that tested nothing.
|
|
82
|
+
|
|
83
|
+
Source glob for the files the selectors live in.
|
|
84
|
+
Pattern a regex whose FIRST GROUP captures the selector name.
|
|
85
|
+
Used by the selectors a pipeline actually dispatches on.
|
|
86
|
+
|
|
87
|
+
Doctrina knows no test runner: it extracts with the pattern you declare
|
|
88
|
+
and checks each selector in "Used by" against what it found (RT05),
|
|
89
|
+
naming a near-miss when only the separator differs.
|
|
90
|
+
|
|
91
|
+
Example (Behave): features/**/*.feature with pattern @([a-z0-9_-]+)
|
|
92
|
+
-->
|
|
93
|
+
|
|
94
|
+
| Selector | Source | Pattern | Used by |
|
|
95
|
+
|----------|--------|---------|---------|
|
|
96
|
+
| <NAME> | <glob> | <regex> | <tag> |
|
|
97
|
+
|
|
98
|
+
## Budgets
|
|
99
|
+
|
|
100
|
+
<!--
|
|
101
|
+
Ceilings that are a CONTRACT, not a preference: token limits, payload
|
|
102
|
+
caps, timeouts. Direction distinguishes what goes IN from what comes
|
|
103
|
+
OUT, because they fail differently — and `doctrina analyze` refuses a
|
|
104
|
+
change that "fixes" an overflow by raising an OUTPUT ceiling, which
|
|
105
|
+
buys headroom by truncating what mattered rather than sending less.
|
|
35
106
|
-->
|
|
36
107
|
|
|
37
|
-
|
|
|
38
|
-
|
|
39
|
-
|
|
|
108
|
+
| Limit | Direction | Value |
|
|
109
|
+
|--------|--------------|---------|
|
|
110
|
+
| <NAME> | input/output | <count> |
|
|
40
111
|
|
|
41
112
|
## Interfaces
|
|
42
113
|
|
|
@@ -71,6 +71,28 @@ Easy Approach to Requirements Syntax. Use one of the five forms per item:
|
|
|
71
71
|
|
|
72
72
|
-
|
|
73
73
|
|
|
74
|
+
### Pipeline
|
|
75
|
+
|
|
76
|
+
<!--
|
|
77
|
+
OPTIONAL, and only for capabilities with an ORDER. The five EARS forms
|
|
78
|
+
state each requirement independently and truthfully, and say nothing about
|
|
79
|
+
sequence: "when the run finishes, append a summary" and "when the analysis
|
|
80
|
+
completes, publish the dashboard" both pass every gate, and neither says
|
|
81
|
+
the dashboard needs the analysis to have run first. The result ships green
|
|
82
|
+
and one run stale.
|
|
83
|
+
|
|
84
|
+
Declare the order and the artifact each step hands on. `doctrina validate`
|
|
85
|
+
then enforces the one invariant a numbered list cannot: a step may only
|
|
86
|
+
require what an EARLIER step produced.
|
|
87
|
+
|
|
88
|
+
1. run-suite — produces `reports/results.json`
|
|
89
|
+
2. analyse — requires `reports/results.json`, produces `reports/analysis.md`
|
|
90
|
+
3. publish — requires `reports/analysis.md`
|
|
91
|
+
|
|
92
|
+
Mark inputs that come from outside the pipeline `(external)`. Delete this
|
|
93
|
+
section when the capability has no ordering.
|
|
94
|
+
-->
|
|
95
|
+
|
|
74
96
|
## Acceptance criteria
|
|
75
97
|
|
|
76
98
|
<!--
|