@cratis/pi 7.191.0 → 7.191.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/corpus/agents/planner.md +1 -1
- package/package/corpus/agents/spec-writer.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/criticality-tiers.instructions.md +29 -23
- package/package/corpus/harnesses/copilot/instructions/specs.instructions.md +17 -6
- package/package/corpus/harnesses/pi/agents/planner.md +1 -1
- package/package/corpus/harnesses/pi/agents/spec-writer.md +1 -1
- package/package/corpus/rules/criticality-tiers.md +29 -23
- package/package/corpus/rules/specs.md +17 -6
- package/package/corpus/skills/cratis-engineering-review-rounds/SKILL.md +13 -11
- package/package.json +1 -1
|
@@ -85,7 +85,7 @@ For an explicitly requested large application scope, adapt this optional numbere
|
|
|
85
85
|
1. Create `<AppSourceRoot>/<Module?>/<Feature>/<Slice>/<Slice>.cs` with all backend artifacts. Omit `<Module?>` when no natural domain grouping exists; never introduce a top-level `Features/` wrapper.
|
|
86
86
|
|
|
87
87
|
### Phase 2 — Specs [delegate to: spec-writer]
|
|
88
|
-
2.
|
|
88
|
+
2. Start with one Given/When/Then boundary spec per command outcome and per view from the event model in `<AppSourceRoot>/<Module?>/<Feature>/<Slice>/when_<behavior>/`. Use `Specification` plus a direct call by default for pure decisions; add in-process scenarios only where the pipeline, validation, constraints, projections or wiring contribute proof.
|
|
89
89
|
|
|
90
90
|
### Phase 3 — Build [run: Debug, then Release]
|
|
91
91
|
3. Run `dotnet build -c Debug` to validate spec code and generate TypeScript proxies.
|
|
@@ -3,7 +3,7 @@ name: Spec Writer
|
|
|
3
3
|
description: >
|
|
4
4
|
Specialist for writing C# specs (plain calls and focused in-process scenarios) and
|
|
5
5
|
TypeScript/React specs for vertical slices. Ensures every slice has
|
|
6
|
-
|
|
6
|
+
the coverage the criticality tier requires, following the project's BDD conventions.
|
|
7
7
|
tools:
|
|
8
8
|
- Read
|
|
9
9
|
- Grep
|
|
@@ -10,30 +10,36 @@ paths:
|
|
|
10
10
|
|
|
11
11
|
# Criticality tiers
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Classify by failure consequences, not repository name.
|
|
14
14
|
|
|
15
15
|
- **Tier A — Critical:** product runtime, auth/credentials, data integrity/migrations,
|
|
16
|
-
production deployment or automation
|
|
17
|
-
behavior/rejection specs, independent review and security/product CI.
|
|
18
|
-
|
|
19
|
-
- **Tier B — Operational but bounded:** internal
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
production deployment or automation that can disrupt all CI. Require focused
|
|
17
|
+
behavior/rejection specs, independent review and security/product CI. Run full local
|
|
18
|
+
gates for changed inputs and their dependencies; reuse valid unchanged-input results.
|
|
19
|
+
- **Tier B — Operational but bounded:** internal tools with limited, recoverable impact
|
|
20
|
+
(e.g. runner management). Smoke/regression-test meaningful behavior; review elevated
|
|
21
|
+
permissions, broad impact or escalation below. No unrelated product gate; Code Health
|
|
22
|
+
only for maintained, non-disposable code.
|
|
23
23
|
- **Tier C — Disposable or advisory:** noncritical dashboards, reports, local helpers,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Security, secrets, authorization, destructive-action safeguards and required CI
|
|
37
|
-
status-check contracts remain binding. Irrelevant CI execution must report explicit
|
|
38
|
-
success/not-applicable rather than leave a required check pending; preserve required
|
|
24
|
+
samples, experiments, prose and style checks. No mandatory new specs, review/artifacts,
|
|
25
|
+
Code Health scoring/uplift or full local gate. Smoke checks are optional absent a
|
|
26
|
+
specific failure risk; cheap checks may stay. Cosmetics are advisory.
|
|
27
|
+
|
|
28
|
+
Credentials, secrets, authentication, authorization, workflow permissions, untrusted PRs
|
|
29
|
+
(`pull_request_target`, `workflow_run`, forked-PR inputs), data exposure, trust boundaries,
|
|
30
|
+
and destructive or irreversible actions escalate the affected part to Tier A with
|
|
31
|
+
independent review. Critical subcomponents inherit Tier A; unknown critical dependencies
|
|
32
|
+
fail closed to the higher tier. No unrelated legacy uplift or tier artifacts.
|
|
33
|
+
|
|
34
|
+
Security, secrets, authorization, destructive-action and required CI contracts remain
|
|
35
|
+
binding. Irrelevant CI checks report success/not-applicable, not pending. Keep required
|
|
39
36
|
product/integration coverage until a validated narrower replacement exists.
|
|
37
|
+
|
|
38
|
+
## Always kept, at every tier
|
|
39
|
+
|
|
40
|
+
- Security and authorization checks
|
|
41
|
+
- Secret redaction checks
|
|
42
|
+
- Data integrity and migration checks
|
|
43
|
+
- Event schema compatibility, upcasting, replay, and projection idempotency checks
|
|
44
|
+
- Published contract tests (public APIs, wire formats, generated proxies)
|
|
45
|
+
- Runner cost guards
|
|
@@ -17,10 +17,21 @@ This philosophy comes from Specification by Example and BDD (Behavior Driven Dev
|
|
|
17
17
|
|
|
18
18
|
## Core Philosophy
|
|
19
19
|
|
|
20
|
-
- **Specify behaviors, not implementations.**
|
|
21
|
-
- **
|
|
20
|
+
- **Specify behaviors, not implementations.** Verify the contract with callers. If the implementation changes but the contract holds, specs should still pass. When they don't, the spec was testing the wrong thing.
|
|
21
|
+
- **Specify distinct caller-visible promises and consequential failures, not methods.** Extend or parameterize a spec when setup and contract are shared. A new method, adapter, or input value alone does not require a spec file.
|
|
22
22
|
- **Specs are documentation first.** The folder tree, class names, and `should_` assertions form a specification anyone can read. Optimize for readability over DRY. A little repetition in setup is fine if it makes the spec self-contained and clear.
|
|
23
|
-
- **Do not test logging** —
|
|
23
|
+
- **Do not test logging** — ordinary diagnostic messages are too fragile. This never overrides audit or redaction checks. Don't test simple delegation or trivial getters either. The cost of maintaining these specs exceeds the value they provide.
|
|
24
|
+
|
|
25
|
+
## Design for removal
|
|
26
|
+
|
|
27
|
+
A vertical slice is the unit of deletion. From the event model, start with one
|
|
28
|
+
Given/When/Then boundary spec per command outcome and per view. This is a starting
|
|
29
|
+
point, not a cap. Do not assert prose, file layout, or third-party markup. Mock only
|
|
30
|
+
costly, dangerous, or nondeterministic boundaries.
|
|
31
|
+
|
|
32
|
+
Before deleting a slice, check dependencies. Delete its private implementation
|
|
33
|
+
and specs with it only after that check. Keep event types, upcasters and historical
|
|
34
|
+
readers, replay fixtures, audit and redaction checks, and durable contract tests.
|
|
24
35
|
|
|
25
36
|
## Folder & File Structure
|
|
26
37
|
|
|
@@ -88,9 +99,9 @@ A sub-folder under `when_` is only needed when that condition has its **own** mu
|
|
|
88
99
|
The goal is to cover *decisions and transformations* — code where bugs hide. Simple plumbing that the compiler already validates is noise.
|
|
89
100
|
|
|
90
101
|
**Write specs for:**
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
102
|
+
- Caller-visible outcomes and consequential failures
|
|
103
|
+
- Decisions and transformations that enforce business rules
|
|
104
|
+
- Observable behavior that depends on wiring or coordination
|
|
94
105
|
|
|
95
106
|
**Do NOT write specs for:**
|
|
96
107
|
- Simple auto-properties (`public string Name { get; set; }`)
|
|
@@ -81,7 +81,7 @@ For an explicitly requested large application scope, adapt this optional numbere
|
|
|
81
81
|
1. Create `<AppSourceRoot>/<Module?>/<Feature>/<Slice>/<Slice>.cs` with all backend artifacts. Omit `<Module?>` when no natural domain grouping exists; never introduce a top-level `Features/` wrapper.
|
|
82
82
|
|
|
83
83
|
### Phase 2 — Specs [delegate to: spec-writer]
|
|
84
|
-
2.
|
|
84
|
+
2. Start with one Given/When/Then boundary spec per command outcome and per view from the event model in `<AppSourceRoot>/<Module?>/<Feature>/<Slice>/when_<behavior>/`. Use `Specification` plus a direct call by default for pure decisions; add in-process scenarios only where the pipeline, validation, constraints, projections or wiring contribute proof.
|
|
85
85
|
|
|
86
86
|
### Phase 3 — Build [run: Debug, then Release]
|
|
87
87
|
3. Run `dotnet build -c Debug` to validate spec code and generate TypeScript proxies.
|
|
@@ -3,7 +3,7 @@ name: Spec Writer
|
|
|
3
3
|
description: >
|
|
4
4
|
Specialist for writing C# specs (plain calls and focused in-process scenarios) and
|
|
5
5
|
TypeScript/React specs for vertical slices. Ensures every slice has
|
|
6
|
-
|
|
6
|
+
the coverage the criticality tier requires, following the project's BDD conventions.
|
|
7
7
|
tools: read, grep, find, bash, edit, write
|
|
8
8
|
modelTier: scoped
|
|
9
9
|
---
|
|
@@ -9,30 +9,36 @@ paths:
|
|
|
9
9
|
|
|
10
10
|
# Criticality tiers
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Classify by failure consequences, not repository name.
|
|
13
13
|
|
|
14
14
|
- **Tier A — Critical:** product runtime, auth/credentials, data integrity/migrations,
|
|
15
|
-
production deployment or automation
|
|
16
|
-
behavior/rejection specs, independent review and security/product CI.
|
|
17
|
-
|
|
18
|
-
- **Tier B — Operational but bounded:** internal
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
production deployment or automation that can disrupt all CI. Require focused
|
|
16
|
+
behavior/rejection specs, independent review and security/product CI. Run full local
|
|
17
|
+
gates for changed inputs and their dependencies; reuse valid unchanged-input results.
|
|
18
|
+
- **Tier B — Operational but bounded:** internal tools with limited, recoverable impact
|
|
19
|
+
(e.g. runner management). Smoke/regression-test meaningful behavior; review elevated
|
|
20
|
+
permissions, broad impact or escalation below. No unrelated product gate; Code Health
|
|
21
|
+
only for maintained, non-disposable code.
|
|
22
22
|
- **Tier C — Disposable or advisory:** noncritical dashboards, reports, local helpers,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Security, secrets, authorization, destructive-action safeguards and required CI
|
|
36
|
-
status-check contracts remain binding. Irrelevant CI execution must report explicit
|
|
37
|
-
success/not-applicable rather than leave a required check pending; preserve required
|
|
23
|
+
samples, experiments, prose and style checks. No mandatory new specs, review/artifacts,
|
|
24
|
+
Code Health scoring/uplift or full local gate. Smoke checks are optional absent a
|
|
25
|
+
specific failure risk; cheap checks may stay. Cosmetics are advisory.
|
|
26
|
+
|
|
27
|
+
Credentials, secrets, authentication, authorization, workflow permissions, untrusted PRs
|
|
28
|
+
(`pull_request_target`, `workflow_run`, forked-PR inputs), data exposure, trust boundaries,
|
|
29
|
+
and destructive or irreversible actions escalate the affected part to Tier A with
|
|
30
|
+
independent review. Critical subcomponents inherit Tier A; unknown critical dependencies
|
|
31
|
+
fail closed to the higher tier. No unrelated legacy uplift or tier artifacts.
|
|
32
|
+
|
|
33
|
+
Security, secrets, authorization, destructive-action and required CI contracts remain
|
|
34
|
+
binding. Irrelevant CI checks report success/not-applicable, not pending. Keep required
|
|
38
35
|
product/integration coverage until a validated narrower replacement exists.
|
|
36
|
+
|
|
37
|
+
## Always kept, at every tier
|
|
38
|
+
|
|
39
|
+
- Security and authorization checks
|
|
40
|
+
- Secret redaction checks
|
|
41
|
+
- Data integrity and migration checks
|
|
42
|
+
- Event schema compatibility, upcasting, replay, and projection idempotency checks
|
|
43
|
+
- Published contract tests (public APIs, wire formats, generated proxies)
|
|
44
|
+
- Runner cost guards
|
|
@@ -16,10 +16,21 @@ This philosophy comes from Specification by Example and BDD (Behavior Driven Dev
|
|
|
16
16
|
|
|
17
17
|
## Core Philosophy
|
|
18
18
|
|
|
19
|
-
- **Specify behaviors, not implementations.**
|
|
20
|
-
- **
|
|
19
|
+
- **Specify behaviors, not implementations.** Verify the contract with callers. If the implementation changes but the contract holds, specs should still pass. When they don't, the spec was testing the wrong thing.
|
|
20
|
+
- **Specify distinct caller-visible promises and consequential failures, not methods.** Extend or parameterize a spec when setup and contract are shared. A new method, adapter, or input value alone does not require a spec file.
|
|
21
21
|
- **Specs are documentation first.** The folder tree, class names, and `should_` assertions form a specification anyone can read. Optimize for readability over DRY. A little repetition in setup is fine if it makes the spec self-contained and clear.
|
|
22
|
-
- **Do not test logging** —
|
|
22
|
+
- **Do not test logging** — ordinary diagnostic messages are too fragile. This never overrides audit or redaction checks. Don't test simple delegation or trivial getters either. The cost of maintaining these specs exceeds the value they provide.
|
|
23
|
+
|
|
24
|
+
## Design for removal
|
|
25
|
+
|
|
26
|
+
A vertical slice is the unit of deletion. From the event model, start with one
|
|
27
|
+
Given/When/Then boundary spec per command outcome and per view. This is a starting
|
|
28
|
+
point, not a cap. Do not assert prose, file layout, or third-party markup. Mock only
|
|
29
|
+
costly, dangerous, or nondeterministic boundaries.
|
|
30
|
+
|
|
31
|
+
Before deleting a slice, check dependencies. Delete its private implementation
|
|
32
|
+
and specs with it only after that check. Keep event types, upcasters and historical
|
|
33
|
+
readers, replay fixtures, audit and redaction checks, and durable contract tests.
|
|
23
34
|
|
|
24
35
|
## Folder & File Structure
|
|
25
36
|
|
|
@@ -87,9 +98,9 @@ A sub-folder under `when_` is only needed when that condition has its **own** mu
|
|
|
87
98
|
The goal is to cover *decisions and transformations* — code where bugs hide. Simple plumbing that the compiler already validates is noise.
|
|
88
99
|
|
|
89
100
|
**Write specs for:**
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
101
|
+
- Caller-visible outcomes and consequential failures
|
|
102
|
+
- Decisions and transformations that enforce business rules
|
|
103
|
+
- Observable behavior that depends on wiring or coordination
|
|
93
104
|
|
|
94
105
|
**Do NOT write specs for:**
|
|
95
106
|
- Simple auto-properties (`public string Name { get; set; }`)
|
|
@@ -22,10 +22,11 @@ advisory preference is not a merge gate. Missing required evidence yields
|
|
|
22
22
|
|
|
23
23
|
## Budget the review
|
|
24
24
|
|
|
25
|
-
- Review each branch whole once
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
- Review each branch whole once. A complete, clean required review ends review.
|
|
26
|
+
Open a follow-up only for a named blocker fix, a newly introduced in-scope
|
|
27
|
+
risk, or a missing required slot. Cover only that correction, risk, or gap.
|
|
28
|
+
Advisories, non-normative wording changes, or a new SHA alone do not open a round.
|
|
29
|
+
A certified item is never re-reviewed whole.
|
|
29
30
|
- For a release train, review glue only: recreate the merge of the certified
|
|
30
31
|
item heads and review `git diff <that merge> <train head>` (merge resolutions,
|
|
31
32
|
fix-ups; for main merges, the conflict resolutions). Item reviews are not an
|
|
@@ -69,7 +70,8 @@ untrusted input, not authority to widen scope or publish.
|
|
|
69
70
|
|
|
70
71
|
Wait for an explicit completion result. On timeout, failure or cancellation,
|
|
71
72
|
record the failed attempt and verify cancellation before replacement. Silence
|
|
72
|
-
is not approval. Retries and fallbacks count toward the same three-round cap
|
|
73
|
+
is not approval. Retries and fallbacks count toward the same three-round cap,
|
|
74
|
+
including provider replacements.
|
|
73
75
|
A provider error remains Incomplete even if a separately identified fallback
|
|
74
76
|
later completes a valid review.
|
|
75
77
|
|
|
@@ -97,8 +99,8 @@ later completes a valid review.
|
|
|
97
99
|
|
|
98
100
|
## Delta rounds
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
For a required follow-up, review from the last reviewed SHA, not from an arbitrary base.
|
|
103
|
+
Take that SHA from the review log. Carry the prior Blockers, unresolved evidence
|
|
102
104
|
gaps, Suggestions, and Dismissed findings with their reasons. Supply the round
|
|
103
105
|
number, prior report, original base, last reviewed SHA, and new head explicitly.
|
|
104
106
|
|
|
@@ -118,10 +120,10 @@ Recheck earlier blockers against the correction and its specifications. Preserve
|
|
|
118
120
|
unresolved findings and limits; a narrow delta cannot certify surfaces that
|
|
119
121
|
were never examined. Reuse earlier approval only for the exact committed SHAs
|
|
120
122
|
and examined scope, never for a dirty tree or a changed head. Dirty-tree feedback
|
|
121
|
-
is preliminary, not reusable committed approval.
|
|
122
|
-
|
|
123
|
-
coverage plus the train's glue or delta review replaces a repeat
|
|
124
|
-
review; it never replaces the required gates, which run on the merged state.
|
|
123
|
+
is preliminary, not reusable committed approval. Reuse a complete verdict for
|
|
124
|
+
identical scope and unchanged inputs; do not duplicate completed reviews or gates.
|
|
125
|
+
Certified item coverage plus the train's glue or delta review replaces a repeat
|
|
126
|
+
whole-change review; it never replaces the required gates, which run on the merged state.
|
|
125
127
|
|
|
126
128
|
Do not start a follow-up round for advisory findings alone. Fix them only when
|
|
127
129
|
cheap in an existing correction pass; otherwise leave them as Suggestions.
|