@esneiderbravo/speclaw 0.2.1 → 0.3.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/dist/modules/foundation/assets/docs/standards/lawbook.template.md +3 -1
- package/dist/modules/foundation/assets/docs/standards/testing-standards.template.md +12 -3
- package/dist/modules/lawbook/assets/rules/spec-reports-disciplines.md +78 -0
- package/dist/modules/lawbook/assets/rules/spec-tasks-mandatory-steps.md +5 -3
- package/dist/modules/lawbook/assets/skills/build/SKILL.md +15 -3
- package/dist/modules/lawbook/assets/skills/draft/SKILL.md +5 -2
- package/dist/modules/lawbook/engine.js +1 -1
- package/package.json +1 -1
|
@@ -32,7 +32,9 @@ itself — never delegates it.
|
|
|
32
32
|
## Reports
|
|
33
33
|
|
|
34
34
|
Every change carries a `reports/` folder. `build` writes one report per
|
|
35
|
-
discipline it touched (`backend.md`,
|
|
35
|
+
discipline it touched, named for that discipline — an open set (`backend.md`,
|
|
36
|
+
`frontend.md`, `api.md`, `database.md`, `infra.md`, … — `api.md` required
|
|
37
|
+
whenever the change touches an API surface) recording what was tested
|
|
36
38
|
and the real results — unit, integration, and end-to-end as applicable — with
|
|
37
39
|
the commands run and their output. It is evidence of testing that travels with
|
|
38
40
|
the change; the archive is blocked until at least one discipline report exists.
|
|
@@ -45,9 +45,18 @@ suppressing a linter or deleting a test.
|
|
|
45
45
|
## Reports — evidence travels with the change
|
|
46
46
|
|
|
47
47
|
Every change records its testing under `lawbook/changes/<name>/reports/`, one
|
|
48
|
-
file per discipline it touched
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
file per discipline it touched, named for that discipline. The set is open, not
|
|
49
|
+
fixed: `backend.md`, `frontend.md`, and `api.md` are the common ones, but write
|
|
50
|
+
`database.md`, `infra.md`, `security.md`, `performance.md`, `e2e.md`, etc. when
|
|
51
|
+
the change exercises those concerns. `build` produces them; archiving is blocked
|
|
52
|
+
until the change has at least one discipline report.
|
|
53
|
+
|
|
54
|
+
`api.md` is **mandatory whenever the change touches an API surface** — a new or
|
|
55
|
+
modified endpoint, its contract, its status codes, or its auth/permission or
|
|
56
|
+
ordering guarantees — and a `backend.md` unit report does not substitute for it.
|
|
57
|
+
It documents the method and path, the auth/permissions, the response shape and
|
|
58
|
+
every status code the change governs, any ordering guarantee, and how the
|
|
59
|
+
contract was exercised (test client and/or `curl`) kept isolated from live data.
|
|
51
60
|
|
|
52
61
|
Each report MUST follow a fixed structure, so the evidence is reproducible rather
|
|
53
62
|
than improvised:
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Require one test report per discipline a change touches (an open set — backend, frontend, api, database, infra, security, performance, e2e, …), with the api report mandatory whenever the change touches an API surface.
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Spec Reports: Discipline Coverage
|
|
7
|
+
|
|
8
|
+
A change's evidence of testing lives under `lawbook/changes/<name>/reports/`, as
|
|
9
|
+
**one file per discipline the change actually touched**, named for that
|
|
10
|
+
discipline (`<discipline>.md`) — never a single lumped report.
|
|
11
|
+
|
|
12
|
+
## 1. The set of disciplines is open — name what the change touched
|
|
13
|
+
|
|
14
|
+
There is no fixed list. Write a report for each area of concern the change
|
|
15
|
+
exercised, and omit the ones it did not. Common disciplines include, but are
|
|
16
|
+
**not limited to**:
|
|
17
|
+
|
|
18
|
+
- **`backend.md`** — domain/service logic, persistence, jobs.
|
|
19
|
+
- **`frontend.md`** — UI flows, components, client state.
|
|
20
|
+
- **`api.md`** — the endpoint contract itself (see §2).
|
|
21
|
+
- **`database.md`** — schema changes, migrations, data integrity.
|
|
22
|
+
- **`infra.md`** — IaC, CI/CD pipelines, deployment/runtime config.
|
|
23
|
+
- **`security.md`** — authn/authz, secrets, attack surface.
|
|
24
|
+
- **`performance.md`** — benchmarks, load, latency budgets.
|
|
25
|
+
- **`e2e.md`** — full cross-service or cross-layer journeys.
|
|
26
|
+
- **`mobile.md`**, **`contract.md`**, **`data.md`**, **`accessibility.md`**, …
|
|
27
|
+
|
|
28
|
+
When a change touches a concern none of these names fit, coin a clear
|
|
29
|
+
`<discipline>.md` for it rather than folding it into an ill-fitting bucket. The
|
|
30
|
+
goal is that the evidence a reviewer needs for each concern is where they expect
|
|
31
|
+
it — not that reports match a checklist.
|
|
32
|
+
|
|
33
|
+
## 2. The API report is mandatory whenever an API surface is touched
|
|
34
|
+
|
|
35
|
+
`api` is called out because it is the discipline most often (wrongly) absorbed
|
|
36
|
+
into `backend` and lost. When a change **adds or modifies an API surface** — a
|
|
37
|
+
new or changed endpoint, its request/response contract, its status codes, or its
|
|
38
|
+
auth/permission or ordering guarantees — you MUST write `api.md`. This is not
|
|
39
|
+
optional:
|
|
40
|
+
|
|
41
|
+
- A `backend.md` unit report does **not** substitute for it — the contract
|
|
42
|
+
(shape, status codes, auth, ordering) is a distinct concern a service-unit
|
|
43
|
+
report does not capture.
|
|
44
|
+
- A `frontend.md` report does **not** substitute for it either.
|
|
45
|
+
|
|
46
|
+
A change that touches no endpoint or contract MAY omit `api.md`.
|
|
47
|
+
|
|
48
|
+
`api.md` MUST document the contract: the method and path, the auth and
|
|
49
|
+
permissions required, the response shape and **every** status code the change
|
|
50
|
+
governs (e.g. `200`/`401`/`403`/`404`), and any ordering or consistency
|
|
51
|
+
guarantee. It MUST record how the contract was exercised — a test client and/or a
|
|
52
|
+
live request such as `curl` — and, per the verification-safety rule, how that
|
|
53
|
+
exercise stayed isolated from any live data store (read-only, ephemeral store, or
|
|
54
|
+
rolled-back transaction — never a write to real data without authorization).
|
|
55
|
+
|
|
56
|
+
## 3. Every report follows the required structure
|
|
57
|
+
|
|
58
|
+
Regardless of discipline, each report keeps the fixed structure so evidence is
|
|
59
|
+
reproducible, not improvised: title + header (discipline · change · date ·
|
|
60
|
+
branch · cwd) → gates-and-results table (each check, exact command, real result
|
|
61
|
+
with pass/fail counts) → tests added/updated → spec-scenario coverage table
|
|
62
|
+
(every `#### Scenario` mapped to how it was verified) → pre-existing/unrelated
|
|
63
|
+
failures (with proof, or "none") → pending manual steps (or "none") → one-line
|
|
64
|
+
verdict. See the `build` skill (Step 5) and
|
|
65
|
+
`docs/standards/testing-standards.md`.
|
|
66
|
+
|
|
67
|
+
When a test kind does not yet apply (e.g. no unit runner), the report says so in
|
|
68
|
+
place of that evidence and records the gates and manual verification that stood
|
|
69
|
+
in.
|
|
70
|
+
|
|
71
|
+
## 4. Reports gate the archive
|
|
72
|
+
|
|
73
|
+
`lawbook_archive` refuses to archive while `reports/` holds no discipline report
|
|
74
|
+
(the `reports/README.md` scaffold does not count). Which disciplines a change
|
|
75
|
+
touched — and therefore which reports are owed, including `api.md` for any
|
|
76
|
+
API-touching change — is the agent's responsibility to judge and satisfy before
|
|
77
|
+
archiving; the engine gate counts files but cannot infer the set of concerns a
|
|
78
|
+
change exercised.
|
|
@@ -21,9 +21,11 @@ steps, branch convention, and testing/documentation requirements.
|
|
|
21
21
|
(see `docs/standards/testing-standards.md`).
|
|
22
22
|
- Perform manual verification of the behavior — **the agent executes this
|
|
23
23
|
itself, never the user.**
|
|
24
|
-
- Produce the discipline reports under `reports/`
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
- Produce the discipline reports under `reports/` — one per discipline the change
|
|
25
|
+
touched, from an open set (`backend.md`, `frontend.md`, `api.md`, `database.md`,
|
|
26
|
+
`infra.md`, … — `api.md` is required whenever the change touches an API surface;
|
|
27
|
+
see the `spec-reports-disciplines` rule) with the unit/integration/e2e results
|
|
28
|
+
for what the feature touched.
|
|
27
29
|
- Update the technical documentation the change touches.
|
|
28
30
|
- Archive the change within the same PR (the `archive` command / `lawbook_archive`
|
|
29
31
|
tool).
|
|
@@ -62,9 +62,21 @@ authorization you obtained).
|
|
|
62
62
|
## Step 5 — Write the discipline reports (mandatory)
|
|
63
63
|
|
|
64
64
|
Record the evidence of testing under `lawbook/changes/<name>/reports/`, one file
|
|
65
|
-
per discipline the change touched
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
per discipline the change touched, named for that discipline. The set is **open,
|
|
66
|
+
not a fixed list** — `backend.md`, `frontend.md`, and `api.md` are the common
|
|
67
|
+
ones, but write `database.md`, `infra.md`, `security.md`, `performance.md`,
|
|
68
|
+
`e2e.md`, etc. when the change exercises those concerns, and coin a clear
|
|
69
|
+
`<discipline>.md` for anything none of them fit. Omit disciplines the change did
|
|
70
|
+
not touch; the archive is blocked until at least one discipline report exists.
|
|
71
|
+
|
|
72
|
+
**`api.md` is mandatory whenever the change touches an API surface** — a new or
|
|
73
|
+
modified endpoint, its request/response contract, its status codes, or its
|
|
74
|
+
auth/permission or ordering guarantees. A `backend.md` unit report does not
|
|
75
|
+
substitute for it: the contract is a distinct concern. In `api.md` document the
|
|
76
|
+
method and path, the auth/permissions, the response shape and every status code
|
|
77
|
+
the change governs (e.g. `200`/`401`/`403`/`404`), any ordering guarantee, and
|
|
78
|
+
how the contract was exercised (test client and/or `curl`) — kept isolated from
|
|
79
|
+
any live data store per Step 4.
|
|
68
80
|
|
|
69
81
|
Each report MUST follow this structure, in order — the fixed shape is what makes
|
|
70
82
|
the evidence trustworthy and reproducible, rather than left to improvisation:
|
|
@@ -68,8 +68,11 @@ Create under `lawbook/changes/<name>/`:
|
|
|
68
68
|
manual verification executed by the agent; discipline reports produced; docs
|
|
69
69
|
updated; archive within the PR).
|
|
70
70
|
- **reports/** — create the folder with a short `reports/README.md` naming the
|
|
71
|
-
discipline reports
|
|
72
|
-
|
|
71
|
+
discipline reports the change will need — one per discipline it touches, from an
|
|
72
|
+
open set (`backend.md`, `frontend.md`, `api.md`, `database.md`, `infra.md`,
|
|
73
|
+
`security.md`, … — and `api.md` is required when the change touches any API
|
|
74
|
+
surface) that `build` will fill, following the required report structure
|
|
75
|
+
(header · gates table ·
|
|
73
76
|
tests added · spec-scenario coverage · pre-existing failures · pending manual ·
|
|
74
77
|
verdict — see the `build` skill, Step 5). Every change ships this folder;
|
|
75
78
|
archive is blocked until it holds at least one discipline report.
|
|
@@ -26,7 +26,7 @@ mandatory_task_steps:
|
|
|
26
26
|
- "Review and update the affected tests."
|
|
27
27
|
- "Run the quality gates and verify they pass (see docs/standards/testing-standards.md)."
|
|
28
28
|
- "Perform manual verification of the behavior — the agent executes this itself, never the user."
|
|
29
|
-
- "Produce the discipline reports under reports/ (unit/integration/e2e results for what the feature touched
|
|
29
|
+
- "Produce the discipline reports under reports/ — one per discipline touched, from an open set (e.g. backend.md, frontend.md, api.md, database.md, infra.md, security.md; api.md is required whenever the change touches an API surface) — with the unit/integration/e2e results for what the feature touched."
|
|
30
30
|
- "Update the technical documentation touched by the change."
|
|
31
31
|
- "Archive the change within the same PR (lawbook:archive)."
|
|
32
32
|
|