@printpractical/cruze 0.0.4 → 0.0.6
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 +8 -8
- package/dist/adapters/inbound/cli/cli_context.js +2 -0
- package/dist/adapters/inbound/cli/commands/documents.js +5 -1
- package/dist/adapters/inbound/cli/commands/status.js +4 -1
- package/dist/adapters/inbound/cli/commands.js +5 -1
- package/dist/adapters/inbound/cli/parse_command.js +4 -0
- package/dist/app/use_cases/approve_artifact.js +26 -1
- package/dist/app/use_cases/new_work_item.js +1 -1
- package/dist/domain/approvals/agent_approval.js +68 -0
- package/dist/domain/config.js +30 -2
- package/dist/domain/journal.js +11 -1
- package/dist/domain/status/next_step.js +2 -2
- package/dist/domain/status/verification.js +3 -2
- package/dist/domain/validation/plan_rules.js +2 -0
- package/dist/domain/validation/size_rules.js +36 -0
- package/dist/domain/validation/work_item_rules.js +2 -0
- package/dist/domain/versions/rule_versions.js +3 -0
- package/package.json +1 -1
- package/skills/architect/SKILL.md +2 -2
- package/skills/architect/feature.md +9 -2
- package/skills/architect/walkthrough.md +22 -19
- package/skills/build/SKILL.md +6 -5
- package/skills/formats/SKILL.md +1 -1
- package/skills/formats/reference/config.md +11 -1
- package/skills/formats/reference/work-items.md +1 -1
- package/skills/formats/templates/change.md +1 -1
- package/skills/formats/templates/feature.md +1 -1
- package/skills/formats/templates/standalone-change.md +1 -1
- package/skills/land/SKILL.md +1 -1
- package/skills/plan/SKILL.md +4 -4
- package/skills/plan/tasks.md +2 -1
- package/skills/realign/notes/0.0.5.md +38 -0
- package/skills/realign/notes/0.0.6.md +44 -0
- package/skills/realign/notes.md +2 -0
- package/skills/research/SKILL.md +7 -1
- package/skills/rethink/SKILL.md +5 -1
- package/skills/rethink/levels.md +4 -4
- package/skills/roles/SKILL.md +23 -11
- package/skills/roles/code-reviewer.md +1 -1
- package/skills/roles/design-reviewer.md +6 -3
- package/skills/roles/verifier.md +3 -2
- package/skills/verify/SKILL.md +10 -6
- package/src/adapters/inbound/cli/cli_context.ts +2 -0
- package/src/adapters/inbound/cli/commands/documents.ts +5 -1
- package/src/adapters/inbound/cli/commands/status.ts +4 -1
- package/src/adapters/inbound/cli/commands.ts +5 -1
- package/src/adapters/inbound/cli/parse_command.ts +4 -0
- package/src/app/use_cases/approve_artifact.ts +26 -1
- package/src/app/use_cases/new_work_item.ts +1 -1
- package/src/domain/approvals/agent_approval.ts +68 -0
- package/src/domain/config.ts +30 -2
- package/src/domain/journal.ts +11 -1
- package/src/domain/status/next_step.ts +2 -2
- package/src/domain/status/verification.ts +3 -2
- package/src/domain/validation/plan_rules.ts +2 -0
- package/src/domain/validation/size_rules.ts +36 -0
- package/src/domain/validation/work_item_rules.ts +2 -0
- package/src/domain/versions/rule_versions.ts +3 -0
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
# The design walkthrough
|
|
2
2
|
|
|
3
|
-
The walkthrough
|
|
3
|
+
The walkthrough hands the design to the user in one message: a short overview in plain terms, then the documents to review in full. The documents are the design, and the user reads them faster than you can retell them, so present the whole design at once and wait for one answer: approval, or comments.
|
|
4
4
|
|
|
5
|
-
At feature scope,
|
|
5
|
+
At feature scope, cover only what the feature adds, changes or removes. At project scope, cover the whole architecture, the layer rules, the roadmap and the walking skeleton.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## The overview
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
2. **Where it sits.** The `VIEW-context` diagram, or at feature scope, the contexts the feature touches.
|
|
11
|
-
3. **The domain.** The domain-model class diagram, then each new or changed entity: its invariants, its states and who owns it.
|
|
12
|
-
4. **How it runs.** For each key flow, show its `sequenceDiagram` and walk one scenario through it step by step, including one failure path. This is the part the user must be able to retell.
|
|
13
|
-
5. **The seams.** Each new or changed port with its operations and their contracts, then the adapter behind each one and the library it adopts.
|
|
14
|
-
6. **Dependencies.** Every new dependency, named out loud with its purpose and the approval behind it. Also the components you chose to build yourself, with the reason.
|
|
15
|
-
7. **Where the code goes.** Each new element next to its module, file path and layer, and the layer rules those files must obey. At project scope, also the `layers:` in `.cruze/config.yaml`.
|
|
16
|
-
8. **The slices.** The changes in order, with what each delivers and builds, and why the first is first. At project scope, the roadmap's phases and the walking skeleton instead.
|
|
17
|
-
9. **Decisions and review.** The settled decisions and ADRs, each review finding with its disposition, and the points where a fresh implementer could still build something different.
|
|
9
|
+
Write it in the glossary's terms, as what callers can do and what happens when they do, not as a list of elements. Keep it to what the user can read in a minute.
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
1. **What it does.** The intent in two sentences. Then one line per use case, or at feature scope per requirement: who asks for what, what they get, and the main way it fails.
|
|
12
|
+
2. **What it touches.** Each new external system, and each new dependency named with its purpose and the approval behind it. Also each component you chose to build yourself, with the reason.
|
|
13
|
+
3. **The slices.** The changes in order, one line each, saying what each delivers and why the first is first. At project scope, the roadmap's phases and the walking skeleton instead.
|
|
14
|
+
4. **What is yours to decide.** The review findings the roles skill brings to the user, any `cruze validate` warning still standing, such as a change over its size limit, any point where a fresh implementer could still build something different, and any rule you challenged that the user overrode.
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
## The documents
|
|
17
|
+
|
|
18
|
+
List each file the user should read in full, with the sections that changed:
|
|
19
|
+
|
|
20
|
+
- Feature scope: the feature's `feature.md`, and the ADRs it adds.
|
|
21
|
+
- Project scope: `docs/architecture.md`, the `layers:` in `.cruze/config.yaml`, `docs/roadmap.md`, the walking-skeleton `change.md`, and the ADRs in `docs/adr/`.
|
|
22
|
+
|
|
23
|
+
The diagrams are Mermaid inside those files. Say where the user can render them, such as an editor preview or GitHub, rather than pasting them.
|
|
24
|
+
|
|
25
|
+
End the message with: "Read these in full, then tell me what to change, or approve. Do you approve this design?"
|
|
22
26
|
|
|
23
27
|
## Ending
|
|
24
28
|
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
4.
|
|
29
|
-
5. Done when the user says they approve.
|
|
29
|
+
1. Answer a question from the documents, pointing to the file and section, and answer only what was asked.
|
|
30
|
+
2. A request for changes is not an approval. Apply the changes and run `cruze validate`. When the user edited the documents themselves, read their diff and run `cruze validate` on it. When the changes touch placement, dependency direction, adopt-or-build decisions, port contracts or flows, run a new design review on the diff alone. Then say in a few lines what changed and where, and ask again.
|
|
31
|
+
3. When the user rejects the design outright, don't approve anything. Ask what is wrong. When the problem is what to build, go back to `envision`; when it is the whole approach, restart this step's design; when the user wants to stop, leave the work unapproved and say how to resume.
|
|
32
|
+
4. Done when the user says they approve.
|
package/skills/build/SKILL.md
CHANGED
|
@@ -19,10 +19,11 @@ Build turns an approved plan into code, one task at a time. Each task starts wit
|
|
|
19
19
|
3. **Read the plan and the design.** Read the change's `change.md` and its feature's `feature.md`. Read the full body of every element the change builds, and every scenario it delivers. Read `commands:` in `.cruze/config.yaml`.
|
|
20
20
|
4. **Build each open task in order,** following the task loop below. Skip the tasks already ticked in `## Progress`.
|
|
21
21
|
5. **Finish.** When every task is ticked:
|
|
22
|
-
- Run the
|
|
22
|
+
- Run the format, lint and build commands and the full suite, as `.agents/skills/cruze-formats/reference/config.md` defines it under `commands`.
|
|
23
23
|
- Run `cruze check` and `cruze trace`, and quote their results.
|
|
24
|
+
- When all of them pass, record the commit they ran at with `cruze journal add checks --set commit=<commit> --item <ref>`, where the commit is the output of `git rev-parse --short HEAD`. Verify quotes this instead of running the suite again.
|
|
24
25
|
- Commit the progress record with a message such as `chore: record progress on <change>`.
|
|
25
|
-
- Done when all of them pass.
|
|
26
|
+
- Done when all of them pass and the checks are recorded.
|
|
26
27
|
|
|
27
28
|
## The task loop
|
|
28
29
|
|
|
@@ -31,7 +32,7 @@ For task `T<n>`:
|
|
|
31
32
|
1. **Read it.** Note its owner, its files, the IDs it proves, and the test plan rows for those IDs.
|
|
32
33
|
2. **Red.** Write the tests for the IDs it proves, at the seams the test plan names, carrying the IDs. Run them, and see them fail for the reason you expect.
|
|
33
34
|
3. **Green.** Write the least code that makes them pass, in the task's files. Code that belongs to another task, or another change, waits for it, even when the next change will need it.
|
|
34
|
-
4. **Check.** Run `cruze check <the task's files>`, the formatter and the linter, and fix what they report. Run the tests the task touched,
|
|
35
|
+
4. **Check.** Run `cruze check <the task's files>`, the formatter and the linter, and fix what they report. Run the tests the task touched. When `commands:` has a `test_full`, run `test` too, since it is the fast tier. Otherwise run the rest of the suite only when it is quick.
|
|
35
36
|
5. **Commit** with a Conventional Commit message naming the task, such as `feat(access): console session state machine (T2)`.
|
|
36
37
|
6. **Tick it.** Run `cruze task done T<n>`, which records the commit. Its progress edit rides along in the next commit.
|
|
37
38
|
|
|
@@ -43,10 +44,10 @@ Done for a task when its tests pass, `cruze check` passes for its files, the com
|
|
|
43
44
|
|
|
44
45
|
The plan is design. Within a task you decide only what is local and reversible.
|
|
45
46
|
|
|
46
|
-
- **Record it and carry on** for a task-level choice: a private helper in another file of the same module, a private type, or two tasks' commits swapped for a reason. Run `cruze task deviation T<n> "<what you did and why>"`.
|
|
47
|
+
- **Record it and carry on** for a task-level choice: a private helper in another file of the same module, a private type, a fixture or harness added to the test support module that the task's tests need, or two tasks' commits swapped for a reason. The test support module is in every test-writing task's scope, so extend it rather than writing a private helper in a test file. Run `cruze task deviation T<n> "<what you did and why>"`.
|
|
47
48
|
- **Stop and offer `rethink`** when the code needs any of these:
|
|
48
49
|
- a new element, port operation or scenario;
|
|
49
|
-
- a file outside the owner's module;
|
|
50
|
+
- a file outside the owner's module, other than the test support module;
|
|
50
51
|
- a change to an approved scenario's behaviour, or to its test;
|
|
51
52
|
- a dependency the design doesn't name.
|
|
52
53
|
|
package/skills/formats/SKILL.md
CHANGED
|
@@ -66,7 +66,7 @@ The CLI owns some content so that routine bookkeeping never changes a design:
|
|
|
66
66
|
- A block between `<!-- cruze:managed -->` and `<!-- /cruze:managed -->` is written only by the CLI.
|
|
67
67
|
- A `- Status: planned` or `- Status: built` item in an element body is written only by the CLI. Elements that have code (`ENT`, `UC`, `PORT`, `ADP`, `FLOW`, `MOD`) and scenarios (`SCN`) carry one.
|
|
68
68
|
- Both are excluded from every hash. Read them freely; change them only through `cruze` commands:
|
|
69
|
-
- `cruze approve` adds missing statuses to the architecture, sets built elements back to planned with `--replan`, and binds a change to its branch.
|
|
69
|
+
- `cruze approve` adds missing statuses to the architecture, sets built elements back to planned with `--replan`, and binds a change to its branch. With `--by-agent` it approves a change whose plan review closed, and with `--restamp-unchanged` it re-stamps work a rethink left unchanged, recording that the agent gave the approval.
|
|
70
70
|
- `cruze task` records progress, and `cruze features` edits the feature map.
|
|
71
71
|
- `cruze land` merges work, marks it built and fills the Commands and Layout sections of `AGENTS.md`.
|
|
72
72
|
- `cruze roadmap prune` and `cruze abandon` update the roadmap's status.
|
|
@@ -27,6 +27,12 @@ commands:
|
|
|
27
27
|
|
|
28
28
|
review:
|
|
29
29
|
command: ["claude", "-p", "--allowedTools", "Read Grep Glob Bash(git diff:*) Bash(git log:*) Bash(git show:*) Bash(cruze:*) Bash(cargo:*)"]
|
|
30
|
+
decide: exceptions
|
|
31
|
+
|
|
32
|
+
changes:
|
|
33
|
+
min_builds: 3
|
|
34
|
+
max_scenarios: 30
|
|
35
|
+
max_tasks: 25
|
|
30
36
|
|
|
31
37
|
layers:
|
|
32
38
|
- name: inventory-domain
|
|
@@ -50,8 +56,12 @@ layers:
|
|
|
50
56
|
| `check.max_types` | Budget of top-level types per source file. |
|
|
51
57
|
| `check.exceptions` | Files allowed past a budget, or Rust test files allowed under `src/` (`test-placement`), each with a `path` and a `reason`. `realign` adds entries whose reason ends `scheduled in <ref>`, and landing that change removes them. |
|
|
52
58
|
| `layers` | Each layer has a `name`, the `paths` it covers, and `may_import`, the layers it may depend on. |
|
|
53
|
-
| `commands` | The project's commands by name, such as `test` or `run`. The walking-skeleton change fills them in, and `cruze land` copies them into the Commands section of `AGENTS.md`. |
|
|
59
|
+
| `commands` | The project's commands by name, such as `test` or `run`. The walking-skeleton change fills them in, and `cruze land` copies them into the Commands section of `AGENTS.md`. When the suite has a slow tier, such as UI, device or end-to-end tests, `test` runs only the fast tier and `test_full` runs everything. The full suite is `test_full` when it is set, and `test` otherwise. |
|
|
54
60
|
| `review.command` | The program and arguments `cruze review` runs to start an agent in a fresh context, with the prompt on standard input. Optional. `cruze init` sets it for Claude Code to run in print mode, allowed to read the project and run `git diff`, `git log`, `git show` and `cruze`. The verifier runs the system, so add the project's build and run commands. When it is unset, or its program isn't installed, `cruze review` hands the role's prompt back to the calling agent to run in a helper. |
|
|
61
|
+
| `review.decide` | Which review findings the user decides. `exceptions`, the default: only findings whose fix changes behaviour, a designed port or contract, or another decision the user owns, and any the agent wouldn't simply fix as proposed. The agent fixes the rest and lists them. `all`: the user decides every finding. |
|
|
62
|
+
| `changes.min_builds` | A feature's change that builds fewer elements than this gets a `change-too-small` warning: merge it into the change it continues. Default `3`. |
|
|
63
|
+
| `changes.max_scenarios` | A change that delivers more scenarios than this gets a `change-too-large` warning: split it. Default `30`. |
|
|
64
|
+
| `changes.max_tasks` | A plan with more tasks than this gets a `plan-too-large` warning. Default `25`. |
|
|
55
65
|
|
|
56
66
|
Rules for layers:
|
|
57
67
|
|
|
@@ -35,7 +35,7 @@ Templates: [../templates/feature.md](../templates/feature.md), [../templates/cha
|
|
|
35
35
|
|
|
36
36
|
A standalone change adds `## Intent`, `## Adopt or build`, `## Spec delta` and `## Architecture delta` before its `## Scope`, in the same format as a feature's. Its scope covers every ID in its own deltas, plus any `planned` elements from the living docs that it builds.
|
|
37
37
|
|
|
38
|
-
A feature is designed in two steps. Feature-scope `envision` writes the intent, settled decisions and spec delta, and leaves `## Architecture delta` as `None.` and the Changes table empty. `architect` writes the architecture delta and the changes. Until the Changes table has a row, `cruze validate` reports the feature as `not-designed` (a warning), skips the coverage rules, and `cruze approve` refuses it. A feature of more than 6 changes gets a `feature-size` warning: split it, because one design review can't hold it.
|
|
38
|
+
A feature is designed in two steps. Feature-scope `envision` writes the intent, settled decisions and spec delta, and leaves `## Architecture delta` as `None.` and the Changes table empty. `architect` writes the architecture delta and the changes. Until the Changes table has a row, `cruze validate` reports the feature as `not-designed` (a warning), skips the coverage rules, and `cruze approve` refuses it. A feature of more than 6 changes gets a `feature-size` warning: split it, because one design review can't hold it. A change outside the size band in `changes:` of `.cruze/config.yaml` gets `change-too-small` (it builds fewer than 3 elements, in a feature of several changes) or `change-too-large` (it delivers more than 30 scenarios), and a plan of more than 25 tasks gets `plan-too-large`.
|
|
39
39
|
|
|
40
40
|
`architect` writes a standalone change's design sections and its scope, and leaves the test plan table empty and the tasks section blank. Until `plan` fills them, `cruze validate` reports the change as `not-planned` (a warning), skips the task and test plan rules, and `cruze approve` refuses it.
|
|
41
41
|
|
package/skills/land/SKILL.md
CHANGED
|
@@ -13,7 +13,7 @@ Land makes finished work part of the living model. `cruze land` merges the chang
|
|
|
13
13
|
2. **Bring in main.** Merge or rebase the branch onto an up-to-date main, and resolve conflicts.
|
|
14
14
|
- `journal.jsonl` files merge by keeping every line; `cruze init` sets that up in `.gitattributes`. When that file lacks the rule, keep both sides' lines.
|
|
15
15
|
- When an `approvals.json` conflicts, take main's version of it. Then run `cruze status`, and re-approve what it shows stale, as step 3 describes.
|
|
16
|
-
- Resolve code conflicts as usual, then run the
|
|
16
|
+
- Resolve code conflicts as usual, then run the full suite. When main came in without code conflicts, leave the full suite to CI.
|
|
17
17
|
3. **Run `cruze status`.** When the change or its feature shows `upstream changed`, another branch landed changes to elements it cites. Then:
|
|
18
18
|
- Show the user the diff of each changed element, and check that the change's code and tests still hold against it.
|
|
19
19
|
- When they still hold, re-approve the stale documents: the feature first, then the change. The change's verification carries over when its own design didn't change.
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cruze-plan
|
|
3
|
-
description: Turns the next change into a test plan and ordered tasks with file targets, reviews the plan in a fresh context, and
|
|
3
|
+
description: Turns the next change into a test plan and ordered tasks with file targets, reviews the plan in a fresh context, and approves it on the branch that will build it once the review closes, leaving you to object or go straight to build.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Plan
|
|
@@ -26,7 +26,7 @@ Plan turns one designed change into work an implementer can do without guessing:
|
|
|
26
26
|
10. **Record decisions and risks.** Put task-level choices you made under `## Settled decisions`. Under `## Risks`, name the riskiest task and how its test catches the failure. Remove every template guide.
|
|
27
27
|
11. **Validate.** Run `cruze validate`. Done when it reports no errors for the change.
|
|
28
28
|
12. **Review the plan.** Commit the plan, then run the review in `.agents/skills/cruze-roles/SKILL.md` with the design reviewer and its plan rubric, `review=plan`, and `--item <ref>`.
|
|
29
|
-
13. **Approve.**
|
|
29
|
+
13. **Approve.** Run `cruze approve <ref> --by-agent` on this branch and quote its result. The plan carries no design of its own, so once its review has closed, with no blocker open and a disposition for every finding, you approve it for the user. The approval binds the change to the branch. When it refuses with `plan-review-open`, do what it names. A blocker still open after round 2 goes to the user, and once they decide it, they approve the plan themselves with `cruze approve <ref>`.
|
|
30
30
|
14. **Commit** with a message such as `docs: plan <change>`.
|
|
31
31
|
|
|
32
32
|
## When the plan needs design
|
|
@@ -44,9 +44,9 @@ Say what is missing and why, then send the change to `rethink` at feature level.
|
|
|
44
44
|
|
|
45
45
|
The walking-skeleton change also makes CI and the project's tooling real. Its plan adds:
|
|
46
46
|
|
|
47
|
-
- `commands:` in `.cruze/config.yaml`: the format, lint, build, test and run commands, as the language's standard tooling runs them.
|
|
47
|
+
- `commands:` in `.cruze/config.yaml`: the format, lint, build, test and run commands, as the language's standard tooling runs them. When some tests are much slower than the rest, such as UI or device tests, `test` runs the fast tier and `test_full` the whole suite, so build can run `test` after every task.
|
|
48
48
|
- A task that adds the language's format, lint, build and test steps to CI (`.github/workflows/ci.yml`), before the Cruze steps `cruze init` put there. The task proves the flow its smoke test runs.
|
|
49
49
|
|
|
50
50
|
## Next step
|
|
51
51
|
|
|
52
|
-
`build`, on this branch.
|
|
52
|
+
Show the user the test plan table, the tasks in order and the risks, and say the plan is approved. They can object, and you amend the plan, run its review on the diff, and approve again. Otherwise the next step is `build`, on this branch.
|
package/skills/plan/tasks.md
CHANGED
|
@@ -9,6 +9,7 @@ A task is one owner, the files it writes, and the IDs it proves. Build does them
|
|
|
9
9
|
- The composition root comes last.
|
|
10
10
|
- Put fakes just before the first task whose test needs them.
|
|
11
11
|
- Each task's test can fail first and then pass, using only what earlier tasks built.
|
|
12
|
+
- A test that expects a default or empty result, such as no prompt, an empty list, `nil` or `0`, passes against a stub that returns it. Name in the task the break it is first seen failing against, such as "fails against a model that always shows the prompt".
|
|
12
13
|
- When the project's lint rejects unused code, such as `cargo clippy -- -D warnings`, put each new item in the task of its first user, or in a task whose own test uses it. Each task then commits green on its own.
|
|
13
14
|
3. **Write one line per task:**
|
|
14
15
|
|
|
@@ -17,7 +18,7 @@ A task is one owner, the files it writes, and the IDs it proves. Build does them
|
|
|
17
18
|
- T7: `OpenConsole` in `src/access/app/open_console.rs`, proves UC-access.open-console, SCN-access.direct-serial
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
- Owner and paths in backticks. Every path is a file the architecture assigns to that owner, or a test or support file.
|
|
21
|
+
- Owner and paths in backticks. Every path is a file the architecture assigns to that owner, or a test or support file. List the test support files the task extends, such as a shared harness or fixture, so its tests reuse them.
|
|
21
22
|
- A task proves the elements it builds, and each scenario whose test goes green in it.
|
|
22
23
|
- A task that only sets up tooling proves the flow or scenario its checks run.
|
|
23
24
|
4. **Find the callers.** For each signature, default or setting a task changes, search the code for every use of it, including tests that start the real binary or read the setting. Add each file that must change to the task. Done when no task will need a file it doesn't list.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Realign notes: 0.0.5
|
|
2
|
+
|
|
3
|
+
## New work only
|
|
4
|
+
|
|
5
|
+
### review-exceptions: The user decides only the review findings that are theirs
|
|
6
|
+
- Applies to: new work only
|
|
7
|
+
- Rule: `.agents/skills/cruze-roles/SKILL.md`, "Running a review", round 1, steps 3 to 5
|
|
8
|
+
|
|
9
|
+
### plan-approved-by-agent: A plan is approved once its review closes, without stopping for the user
|
|
10
|
+
- Applies to: new work only
|
|
11
|
+
- Rule: `.agents/skills/cruze-plan/SKILL.md`, "Steps", step 13
|
|
12
|
+
|
|
13
|
+
### rethink-restamps: A rethink re-stamps the work it didn't change
|
|
14
|
+
- Applies to: new work only
|
|
15
|
+
- Rule: `.agents/skills/cruze-rethink/SKILL.md`, "Steps", step 6
|
|
16
|
+
|
|
17
|
+
### change-too-small: A feature's change builds at least 3 elements
|
|
18
|
+
- Applies to: new work only
|
|
19
|
+
- Rule: `.agents/skills/cruze-architect/feature.md`, step 12
|
|
20
|
+
- Detect: validate:change-too-small
|
|
21
|
+
|
|
22
|
+
### change-too-large: A change delivers at most 30 scenarios
|
|
23
|
+
- Applies to: new work only
|
|
24
|
+
- Rule: `.agents/skills/cruze-architect/feature.md`, step 12
|
|
25
|
+
- Detect: validate:change-too-large
|
|
26
|
+
|
|
27
|
+
### plan-too-large: A plan has at most 25 tasks
|
|
28
|
+
- Applies to: new work only
|
|
29
|
+
- Rule: `.agents/skills/cruze-architect/feature.md`, step 12
|
|
30
|
+
- Detect: validate:plan-too-large
|
|
31
|
+
|
|
32
|
+
### concerns-per-size: Reviewers list concerns in proportion to the work
|
|
33
|
+
- Applies to: new work only
|
|
34
|
+
- Rule: `.agents/skills/cruze-roles/code-reviewer.md`, "Findings"
|
|
35
|
+
|
|
36
|
+
### reverify-changed-plan: A plan changed after verify needs verifying again, whoever approved it
|
|
37
|
+
- Applies to: new work only
|
|
38
|
+
- Rule: `.agents/skills/cruze-verify/SKILL.md`
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Realign notes: 0.0.6
|
|
2
|
+
|
|
3
|
+
## New work only
|
|
4
|
+
|
|
5
|
+
### suite-once-per-commit: The full test suite runs once per commit, and verify quotes build's result
|
|
6
|
+
- Applies to: new work only
|
|
7
|
+
- Rule: `.agents/skills/cruze-verify/SKILL.md`, "Steps", step 2
|
|
8
|
+
|
|
9
|
+
### test-tiers: A project with slow tests can split them into test and test_full
|
|
10
|
+
- Applies to: new work only
|
|
11
|
+
- Rule: `.agents/skills/cruze-formats/reference/config.md`
|
|
12
|
+
- Fix: when the full suite takes more than a few minutes, move it to `test_full` under `commands:` and make `test` the fast tier
|
|
13
|
+
|
|
14
|
+
### test-support-in-scope: Build extends the test support module without a rethink
|
|
15
|
+
- Applies to: new work only
|
|
16
|
+
- Rule: `.agents/skills/cruze-build/SKILL.md`, "Deviations"
|
|
17
|
+
|
|
18
|
+
### name-the-break: Plan names the break for a test that passes against a stub
|
|
19
|
+
- Applies to: new work only
|
|
20
|
+
- Rule: `.agents/skills/cruze-plan/tasks.md`, step 2
|
|
21
|
+
|
|
22
|
+
### round-2-by-agent: The agent checks round 2 when every blocker was fixed as proposed
|
|
23
|
+
- Applies to: new work only
|
|
24
|
+
- Rule: `.agents/skills/cruze-roles/SKILL.md`, "Running a review", round 2
|
|
25
|
+
|
|
26
|
+
### size-before-approval: Size warnings are cleared or accepted before a feature is approved
|
|
27
|
+
- Applies to: new work only
|
|
28
|
+
- Rule: `.agents/skills/cruze-architect/feature.md`, step 12
|
|
29
|
+
|
|
30
|
+
### verify-every-claim: Research checks claims about the language, platform and external systems
|
|
31
|
+
- Applies to: new work only
|
|
32
|
+
- Rule: `.agents/skills/cruze-research/SKILL.md`, "Adopt or build", step 7
|
|
33
|
+
|
|
34
|
+
### cross-section-consistency: The design reviewer checks cross-cutting rules, interleavings and stale prose
|
|
35
|
+
- Applies to: new work only
|
|
36
|
+
- Rule: `.agents/skills/cruze-roles/design-reviewer.md`, "Rubric", item 8
|
|
37
|
+
|
|
38
|
+
### one-message-walkthrough: The design walkthrough is one overview, then the documents in full
|
|
39
|
+
- Applies to: new work only
|
|
40
|
+
- Rule: `.agents/skills/cruze-architect/walkthrough.md`
|
|
41
|
+
|
|
42
|
+
### quoted-titles: New features and changes quote their title in the header
|
|
43
|
+
- Applies to: new work only
|
|
44
|
+
- Rule: `.agents/skills/cruze-formats/templates/change.md`
|
package/skills/realign/notes.md
CHANGED
package/skills/research/SKILL.md
CHANGED
|
@@ -17,7 +17,13 @@ Run these steps for each component in a design that isn't domain logic. Domain l
|
|
|
17
17
|
4. Recommend one. Adopt a library, or build with a concrete reason: the behaviour is specific to this product, no candidate meets a stated constraint, every candidate brings disproportionate risk or complexity, or the capability is the product itself. Avoiding a dependency is not a reason on its own.
|
|
18
18
|
5. Record the result as a row in the `## Adopt or build` table of the feature or standalone change, as Component, Decision, Choice and Reason. At project scope, record it as the adapter's `Adopts` fact, and put rows for anything no adapter owns in the walking-skeleton change's `## Adopt or build`. When the evidence runs longer than the reason, write it to `.cruze/notes/<date>-<slug>.md` and cite that note in the reason.
|
|
19
19
|
6. Take the recommendation to the user. Adopting means a new dependency, which follows `.agents/skills/cruze-dependency-approval/SKILL.md`. Building commodity functionality is the user's call as well.
|
|
20
|
-
7. Verify what the design will rely on. List each claim the design
|
|
20
|
+
7. Verify what the design will rely on. List each claim the design or its testing approach makes about anything it doesn't build:
|
|
21
|
+
- an adopted library or tool: the features or flags it needs, and each command the design spells out, such as a CI step;
|
|
22
|
+
- the language or runtime, such as whether a trait with async methods can be used as a trait object;
|
|
23
|
+
- the platform's test environment, such as which permissions a test process gets;
|
|
24
|
+
- an external system the product talks to, such as what a broker logs or how it answers.
|
|
25
|
+
|
|
26
|
+
Once the user has approved any dependency involved, check each claim by running it: build a scratch project outside the repository with exactly the declared features, and run each command there or with `--help`, or run the external system and watch it. When a claim can't be run, check it in that version's source, and say so. Write the features into the `Adopts` fact or the row's Choice.
|
|
21
27
|
|
|
22
28
|
Done when every non-domain component in the design has a row with a decision and a reason, and every claim the design relies on is verified, with how.
|
|
23
29
|
|
package/skills/rethink/SKILL.md
CHANGED
|
@@ -18,7 +18,11 @@ Finding a design flaw mid-build is information, not failure. Rethink amends the
|
|
|
18
18
|
3. **Load the standards.** Read `.agents/skills/cruze-grilling/SKILL.md`. At feature or architecture level, also read `.agents/skills/cruze-hexagonal-design/SKILL.md`. Also read the format reference for the document you will amend: `.agents/skills/cruze-formats/reference/architecture.md`, `specs.md`, `work-items.md` or `durable-docs.md`.
|
|
19
19
|
4. **Amend that level,** following the level's section in [levels.md](levels.md). Settle any decision the amendment needs with the user, and record it as that level records decisions.
|
|
20
20
|
5. **Keep completed work.** A ticked task stays ticked unless the amendment changes its owner, its files, or what it proves. Reopen each task that changed with `cruze task reopen T<n> "<what changed>"`. Its commits stay in history, and build redoes the task.
|
|
21
|
-
6. **Re-approve what went stale.** Run `cruze status` and work from the top down
|
|
21
|
+
6. **Re-approve what went stale.** Run `cruze status` and work from the top down. The amended document comes first, and the user approves it as its level says. Then take each feature or change it lists as `upstream changed`, whose own text you didn't edit:
|
|
22
|
+
- Read the diff of the elements it names, and check the work still holds against them. When it doesn't, amend it too, and the user approves it as an amended document.
|
|
23
|
+
- When it holds, re-stamp it with `cruze approve <ref> --restamp-unchanged`. The CLI refuses work whose own text changed, a project document, and a change with a task reopened since its approval; the user re-approves those.
|
|
24
|
+
|
|
25
|
+
Tell the user, in one line each, what you re-stamped and why it still holds. They can object, and that document goes to them. A change's verification carries over when its own design didn't change.
|
|
22
26
|
7. **Record the rethink.** Draft the entry and show it to the user in one line. When they confirm, run:
|
|
23
27
|
|
|
24
28
|
```sh
|
package/skills/rethink/levels.md
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
1. Edit the change's `## Test plan` or `## Tasks` so they are right. The scope doesn't change at this level; a scope change is a feature-level rethink.
|
|
6
6
|
2. Run `cruze validate`. Done when it reports no errors for the change.
|
|
7
7
|
3. Run the plan review from `.agents/skills/cruze-roles/SKILL.md` on the diff alone, with the design reviewer's plan rubric and `review=plan`.
|
|
8
|
-
4. Re-approve with `cruze approve <change
|
|
8
|
+
4. Re-approve with `cruze approve <change> --by-agent` once the review has closed, as plan does.
|
|
9
9
|
|
|
10
10
|
## Feature
|
|
11
11
|
|
|
12
12
|
1. Edit the feature's `## Spec delta`, `## Architecture delta` or `## Changes`. For a standalone change, edit its own deltas and scope. Write complete bodies, as `architect` does, and keep the scope rules.
|
|
13
13
|
2. Run `cruze validate`. Done when it reports no errors for the feature or its changes.
|
|
14
|
-
3. Run the design review from the roles skill on the diff alone, with `review=design`.
|
|
15
|
-
4. Re-approve the feature. For each of its changes that shows as stale,
|
|
14
|
+
3. Run the design review from the roles skill on the diff alone, with `review=design`. Run the walkthrough of the changed parts, following `.agents/skills/cruze-architect/walkthrough.md`.
|
|
15
|
+
4. Re-approve the feature. For each of its changes that shows as stale, check it against the diff. When the amendment touches the change's scope, test plan or tasks, update them to match, reopen touched tasks, run the plan review on the diff, and re-approve it with `cruze approve <change> --by-agent`. When it doesn't, re-stamp the change as the skill's step 6 describes.
|
|
16
16
|
5. When a change hasn't been created yet, only the feature's Changes row changes; `plan` picks it up.
|
|
17
17
|
|
|
18
18
|
## Architecture
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
- **A prefactor**, otherwise. From an up-to-date main, run `architect "<prefactor>"`, which designs it as a standalone change, then `plan`, `build`, `verify` and `land` it before the current change continues.
|
|
27
27
|
6. Run `cruze status`. Every document citing a changed element shows `upstream changed`:
|
|
28
28
|
- When the document's own delta changes that element, rewrite the delta so it keeps your amendment. `cruze approve` refuses it with `rebase-required` until you do. Then approve it with `--rebase <ID>`.
|
|
29
|
-
- Otherwise,
|
|
29
|
+
- Otherwise, check the document against the element's diff, and re-stamp it or amend it as the skill's step 6 describes.
|
|
30
30
|
|
|
31
31
|
## Vision
|
|
32
32
|
|
package/skills/roles/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cruze-roles
|
|
3
|
-
description: Prompts for Cruze's fresh-context roles (the design reviewer, code reviewer, verifier and researcher), how to run one, and how to take a review through its two rounds to a disposition for every finding. Use when a Cruze workflow step says to run a role, a review or research in a fresh context.
|
|
3
|
+
description: Prompts for Cruze's fresh-context roles (the design reviewer, code reviewer, verifier and researcher), how to run one, and how to take a review through its two rounds to a disposition for every finding, with the user deciding only the exceptions. Use when a Cruze workflow step says to run a role, a review or research in a fresh context.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Roles
|
|
@@ -30,26 +30,38 @@ A review has at most two rounds. Only blockers can force the second one.
|
|
|
30
30
|
|
|
31
31
|
1. Commit the documents under review (`docs: <artifact> for design review`), so the fixes in round 2 have a diff. Then run the reviewer on the complete artifact.
|
|
32
32
|
2. Record the round: `cruze journal add review --set review=<design|plan|code> --set round=1 --set blockers=<n> --set concerns=<n> --set nits=<n>`, with the counts from the report's last line, adding `--item <ref>` for a feature or change.
|
|
33
|
-
3.
|
|
34
|
-
-
|
|
33
|
+
3. **Sort the findings.** A finding is an **exception**, which the user decides, when any of these holds:
|
|
34
|
+
- Its fix changes behaviour: it adds, removes or rewrites a requirement or scenario, or changes what a person sees or does beyond what the spec says. Making the code or the plan meet a scenario as written is not a change of behaviour.
|
|
35
|
+
- Its fix changes a port, a port's `Operations` or a public contract that the approved design names.
|
|
36
|
+
- Its fix changes another decision the grilling skill leaves to the user: a context, dependency direction or a dependency.
|
|
37
|
+
- You recommend anything but `fixed`: waiving, deferring or rejecting it, or a rethink because it needs a design change.
|
|
38
|
+
- You would fix it differently from the reviewer's proposed fix.
|
|
39
|
+
|
|
40
|
+
Every other finding is yours, blockers included: you fix it as the reviewer proposes. When `review.decide` in `.cruze/config.yaml` is `all`, every finding is an exception.
|
|
41
|
+
4. **Present them in one message.** First each exception, with your recommended disposition and why:
|
|
42
|
+
- `fixed`: you will change the work as the finding proposes.
|
|
35
43
|
- `waived`: the finding is right, but the user accepts the risk.
|
|
36
44
|
- `deferred`: it belongs to later work. When it is future scope, add it with `cruze features add <slug> --summary <text> --goals <ids>`.
|
|
37
45
|
- `rejected`: the finding is wrong, with the reason.
|
|
38
46
|
|
|
39
47
|
A finding whose fix would change an approved element, such as one marked `Needs design change`, is never `deferred` or `waived`. Recommend `rethink` at that element's level now. Once the rethink is done and the code follows it, record the finding as `fixed`.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
|
|
49
|
+
Then one line for each finding you are fixing yourself. When there are no exceptions, say what you are fixing and carry on without waiting. The user can object to any line until the work is approved, and that finding becomes an exception: revert its fix and let them decide it.
|
|
50
|
+
5. **Record every disposition:** `cruze journal add disposition --set finding="<rubric item>: <summary>" --set disposition=<fixed|waived|deferred|rejected> --set reason="<reason>" --set review=<design|plan|code> --set decided=<agent|user>`, with the same `--item`. Use `decided=user` for each exception, once the user decides it, and `decided=agent` for each finding you fixed yourself. The CLI refuses `decided=agent` for anything but `fixed`. A recorded disposition is never raised again.
|
|
51
|
+
6. Apply every `fixed` change, then run `cruze validate`. Done when it reports no errors.
|
|
52
|
+
7. When a finding could be caught by a tool, such as a layering, naming or size rule, tell the user which `cruze check` rule or linter setting would catch it next time.
|
|
43
53
|
|
|
44
54
|
### Round 2
|
|
45
55
|
|
|
46
|
-
Run round 2 only when a round-1 blocker was fixed.
|
|
56
|
+
Run round 2 only when a round-1 blocker was fixed. It checks only whether those blockers are fixed, and raises nothing new.
|
|
47
57
|
|
|
48
|
-
1.
|
|
49
|
-
2.
|
|
50
|
-
3.
|
|
58
|
+
1. **Choose who checks.** When every blocker was fixed exactly as the reviewer proposed, check the fixes yourself: a fresh reviewer re-reading a fix it proposed finds nothing new. When any blocker was fixed differently from the proposal, or its fix reaches past what the finding names, run the reviewer.
|
|
59
|
+
2. **Check them yourself:** read each blocker's finding against the diff of its fix, and run `cruze validate`. A blocker is fixed when the diff does what the proposal says and validate reports no new errors.
|
|
60
|
+
3. **Or run the reviewer** again with its usual inputs, plus the round-1 blockers and the diff of their fixes. It may be the round-1 reviewer resumed, since that context never saw the conversation that produced the work (with `cruze review`: `--round 2 --blockers <file> --base <round-1 commit>`).
|
|
61
|
+
4. Record the round with `round=2`, the blockers still open, `concerns=0`, and `checked_by=agent` or `checked_by=reviewer`.
|
|
62
|
+
5. Take any blocker still open to the user, who fixes it now, waives it or starts a rethink. There is no round 3.
|
|
51
63
|
|
|
52
|
-
Done when every finding has a journaled disposition and
|
|
64
|
+
Done when every finding has a journaled disposition, and every exception, and every blocker left open in round 2, has the user's decision.
|
|
53
65
|
|
|
54
66
|
## The settled ledger
|
|
55
67
|
|
|
@@ -46,7 +46,7 @@ Each finding has this shape:
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
- A **blocker** means a scenario fails or is untested, a protected test was weakened, a layering rule is broken, an unapproved dependency was added, or an adapter can't honour its port's `Operations`. A finding that needs a design change is a blocker. Everything else is a **concern**.
|
|
49
|
-
- List every blocker. List at most 5 concerns, the most important first. Count the rest as nits without listing them.
|
|
49
|
+
- List every blocker. List at most 5 concerns, or one per 5 tasks of the change when that is more, the most important first. Count the rest as nits without listing them. Report only what would go wrong: no concerns is a valid report, and a small change usually has few.
|
|
50
50
|
- Drop any finding that contradicts the settled ledger. The only exception is a blocker with new evidence, which you mark `New evidence:` and explain.
|
|
51
51
|
- When a finding could be caught mechanically, add `Check: <the cruze check rule or linter setting that would catch it>`.
|
|
52
52
|
- In round 2, report only whether each round-1 blocker is fixed, as `fixed` or `open` with the reason. Raise nothing new.
|
|
@@ -28,8 +28,11 @@ Review against these items and nothing else. Each finding names one.
|
|
|
28
28
|
8. **Consistency.** The design agrees with `docs/architecture.md`, the accepted ADRs and what earlier changes landed, or changes them explicitly through a `MODIFIED` operation or a new ADR. Its own elements agree with each other. Check every pair, not a sample:
|
|
29
29
|
- each use case's `Output` and `Errors` against the `FLOW`s that serve it and the `XC` rules that apply to it;
|
|
30
30
|
- each adapter's duties against the port it implements and the `XC` rules it follows;
|
|
31
|
-
- each guarantee, such as "always fits" or "never returns", against the limits and failures that bound it
|
|
32
|
-
|
|
31
|
+
- each guarantee, such as "always fits" or "never returns", against the limits and failures that bound it;
|
|
32
|
+
- each `XC` rule against the other `XC` rules, the `RULE` elements and the `layers:` in `.cruze/config.yaml`, such as a logging rule that every module logs against a build rule that forbids the logging import;
|
|
33
|
+
- each pair of use cases that change the same state, for an interleaving that leaves it wrong, against the concurrency rule in `XC`;
|
|
34
|
+
- at feature scope, the prose in `docs/architecture.md` the delta makes untrue, such as an Overview sentence or a `D<n>` line describing an element the delta splits or replaces.
|
|
35
|
+
9. **Slicing.** Each change is a vertical slice that delivers scenarios end to end and can land on its own. The order respects `Depends on`, and the first change proves the design end to end. Each change carries enough work to be worth its own plan review, code review and verify: changes that build one or two elements each on the same adapters or screens, in a chain, are one change split too fine. A change that one verifier run can't hold is split too coarse. A `change-too-small`, `change-too-large` or `feature-size` warning from `cruze validate` is a finding, unless a decision records the user accepting it. A change `Builds` an element only when its delivered scenarios prove the whole body; an element whose duties arrive in several changes is split into elements that each arrive whole. `Depends on` names every earlier change that builds something this change's scenarios need. At project scope, the roadmap starts with the walking skeleton, and every goal in the release is covered.
|
|
33
36
|
10. **Ambiguity.** Name each point where a fresh implementer could reasonably build something different from what the user expects.
|
|
34
37
|
|
|
35
38
|
## Plan rubric
|
|
@@ -56,7 +59,7 @@ Each finding has this shape:
|
|
|
56
59
|
```
|
|
57
60
|
|
|
58
61
|
- A **blocker** means building from the design as written would produce wrong behaviour, a layering violation or an untestable scenario. Two elements that contradict each other are always a blocker, because an implementer has to pick one. Everything else is a **concern**.
|
|
59
|
-
- List every blocker. List at most 5 concerns, the most important first. Count the rest as nits without listing them.
|
|
62
|
+
- List every blocker. List at most 5 concerns, or for a plan one per 5 tasks when that is more, the most important first. Count the rest as nits without listing them. Report only what would go wrong: no concerns is a valid report, and a small artifact usually has few.
|
|
60
63
|
- Drop any finding that contradicts the settled ledger. The only exception is a blocker with new evidence, which you mark `New evidence:` and explain.
|
|
61
64
|
- When a finding could be caught mechanically, add `Check: <the cruze check rule or linter setting that would catch it>`.
|
|
62
65
|
- In round 2, report only whether each round-1 blocker is fixed, as `fixed` or `open` with the reason. Raise nothing new.
|
package/skills/roles/verifier.md
CHANGED
|
@@ -6,11 +6,12 @@ You check that a change actually works when someone uses it. The tests passing i
|
|
|
6
6
|
|
|
7
7
|
- The change's `change.md`, and its `feature.md` when it belongs to a feature. The scenarios it delivers are listed under `Delivers` in its scope, and written out in the spec delta.
|
|
8
8
|
- The project's commands, from `commands:` in `.cruze/config.yaml`, and from `README.md` when they aren't there.
|
|
9
|
+
- The mechanical checks' results, with the commit they ran at.
|
|
9
10
|
- The flows in `docs/architecture.md` that serve those scenarios.
|
|
10
11
|
|
|
11
12
|
## Work
|
|
12
13
|
|
|
13
|
-
1. **Build.** Build the system and
|
|
14
|
+
1. **Build.** Build the system with the project's build command, and record whether it passed. The test suite already ran at the commit in your inputs, and CI runs it again before the merge, so don't run it. Run a single test only when it is how a scenario reaches its real front door, such as a UI test that drives the app.
|
|
14
15
|
2. **Trace.** Run `cruze trace --change <ref>` and record its result.
|
|
15
16
|
3. **Run each scenario.** For every scenario the change delivers:
|
|
16
17
|
- Set up its GIVEN with real things where you can: configuration files, directories, a local test server, a pseudo-terminal. Put them in a temporary directory outside the project.
|
|
@@ -35,4 +36,4 @@ One block per scenario:
|
|
|
35
36
|
- Notes: <surprises from probing, or what a person needs to run it>
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
Before the blocks, list the build
|
|
39
|
+
Before the blocks, list the build and trace commands with their results, and the commit the mechanical checks ran at. End with one line: `Pass: <n>. Fail: <n>. Could not run: <n>.`
|
package/skills/verify/SKILL.md
CHANGED
|
@@ -10,18 +10,22 @@ Verify answers one question: does this change work when someone uses it? Green t
|
|
|
10
10
|
## Steps
|
|
11
11
|
|
|
12
12
|
1. **Check it is ready.** Run `cruze next`. It must name `verify` for this change, on this branch. Find the base commit the change branched from with `git merge-base main HEAD`.
|
|
13
|
-
2. **Run the mechanical checks.** Run
|
|
13
|
+
2. **Run the mechanical checks.** Run `cruze validate`, `cruze check --ci` and `cruze trace --change <ref>`, and quote each result.
|
|
14
|
+
- Run `cruze journal list --event checks --item <ref>`. When its last entry's commit has no code changes since, that is when `git diff --quiet <commit> HEAD -- . ':(exclude)docs' ':(exclude).cruze'` succeeds, quote that entry for the format, lint, build and test commands instead of running them again.
|
|
15
|
+
- Otherwise run the format, lint and build commands and the full suite, as `.agents/skills/cruze-formats/reference/config.md` defines it under `commands`. When they pass, record them with `cruze journal add checks --set commit=<commit> --item <ref>`, where the commit is the output of `git rev-parse --short HEAD`.
|
|
16
|
+
- When one fails, fix the code in a commit and run them again. When a fix needs design, stop and offer `rethink`.
|
|
14
17
|
3. **Check the dependencies.** Follow "Checking" in `.agents/skills/cruze-dependency-approval/SKILL.md` against the base commit. An unrecorded dependency is a blocker.
|
|
15
|
-
4. **Run the verifier.** Run the verifier role from `.agents/skills/cruze-roles/SKILL.md` for the change. It must be able to build and run the system. When it runs through `cruze review`, check that `review.command` in `.cruze/config.yaml` allows the project's build and run commands, and add them with the user's agreement. Done when you have its report, with a result for every delivered scenario.
|
|
16
|
-
5. **Review the code.** Run the review in the roles skill with the code reviewer, `review=code`, `--item <ref>` and the base commit. Fix each finding
|
|
18
|
+
4. **Run the verifier.** Run the verifier role from `.agents/skills/cruze-roles/SKILL.md` for the change, with the mechanical checks' results and the commit they ran at. It must be able to build and run the system. When it runs through `cruze review`, check that `review.command` in `.cruze/config.yaml` allows the project's build and run commands, and add them with the user's agreement. Done when you have its report, with a result for every delivered scenario.
|
|
19
|
+
5. **Review the code.** Run the review in the roles skill with the code reviewer, `review=code`, `--item <ref>` and the base commit. Fix each finding whose disposition is `fixed` in a commit, running the tests each fix touches, and `test` when `commands:` has a `test_full`. Then check the fixes in round 2.
|
|
17
20
|
6. **Write the manual test script** as `manual-test.md` in the change folder, following [manual-test.md](manual-test.md). Commit it.
|
|
18
|
-
7. **
|
|
21
|
+
7. **Check the fixes once.** When code changed since the last `checks` entry, run the format, lint and build commands and the full suite once more, and record them as in step 2. Done when the last `checks` entry is at a commit with no code changes since.
|
|
22
|
+
8. **Report.** Show the user four things:
|
|
19
23
|
- The mechanical checks, one line each.
|
|
20
24
|
- The verifier's result for every scenario.
|
|
21
25
|
- The review's outcome, with each finding's disposition.
|
|
22
26
|
- The path to `manual-test.md`, with a recommendation to run it before accepting.
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
9. **Ask for the decision:** "Do you accept this change, or send it back?"
|
|
28
|
+
10. **Record it** with `cruze journal add verification --set result=accepted --set summary="<one line>" --item <ref>`, or `result=sent-back`. On sent-back, say what goes back:
|
|
25
29
|
- A defect in code a task already built: `cruze task reopen T<n> "<reason>"`, then `build`.
|
|
26
30
|
- A design that can't deliver the scenario: `rethink`.
|
|
27
31
|
|
|
@@ -13,8 +13,12 @@ export async function runValidate(context: CliContext): Promise<CommandResult> {
|
|
|
13
13
|
|
|
14
14
|
export async function runApprove(context: CliContext, args: string[], options: Options): Promise<CommandResult> {
|
|
15
15
|
requireArgs(args, ["document"]);
|
|
16
|
-
|
|
16
|
+
if (options.byAgent && options.restampUnchanged) throw new UsageError("--by-agent and --restamp-unchanged are alternatives");
|
|
17
|
+
const agent = options.byAgent ? "plan-review" : options.restampUnchanged ? "rethink" : undefined;
|
|
18
|
+
const report = await approveArtifact(context, args[0] ?? "", { replan: options.replan, rebase: options.rebase, ...(agent === undefined ? {} : { agent }) });
|
|
17
19
|
const lines = [`Approved ${report.artifact} (${report.hash.slice(0, 19)}), pinned to ${report.upstream.length} upstream element(s).`];
|
|
20
|
+
if (report.basis === "plan-review") lines.push("Approved for the user: its plan review closed with no blocker open.");
|
|
21
|
+
if (report.restamped !== undefined) lines.push(`Re-stamped for the user: its own design is unchanged, and only ${report.restamped.join(", ")} changed.`);
|
|
18
22
|
if (report.stamped.length > 0) lines.push(`Marked ${report.stamped.length} element(s) planned.`);
|
|
19
23
|
if (report.bound !== undefined) lines.push(`Bound the change to branch ${report.bound}.`);
|
|
20
24
|
if (report.replanned.length > 0) lines.push(`Set back to planned: ${report.replanned.join(", ")}.`);
|