@cratis/pi 7.168.4 → 7.170.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.
@@ -22,7 +22,7 @@ Every rule here serves **ease of use**, **productivity**, and **maintainability*
22
22
  - **Lovable APIs** — APIs should be pleasant to use: sane defaults, flexible, extensible, overridable. If an API feels awkward, it is wrong.
23
23
  - **Easy to do things right, hard to do things wrong** — convention over configuration; artifact discovery by naming/attributes; minimal boilerplate. The framework guides you into the pit of success.
24
24
  - **Events are facts** — immutable records of what happened. Past tense, one purpose, never ambiguous. If you reach for a nullable property on an event, you need a second event.
25
- - **Strongly-typed primitives are the foundation — get them right first.** The most important, load-bearing decisions in every slice are the domain primitives: `ConceptAs<T>` value types and `EventSourceId<T>` identities (never raw `Guid`/`string`/`int` for a domain value); `ConceptValidator<T>` for invariants that travel with a value everywhere it appears; `CommandValidator<T>` for command-level rules; and past-tense, self-describing `[EventType]` names. They make the model type-safe end to end, rules enforceable in one place and events trustworthy forever; a slice built on sloppy primitives is wrong however good the rest is.
25
+ - **Strongly-typed primitives are the foundation — get them right first.** The most important, load-bearing decisions in every slice are the domain primitives: `ConceptAs<T>` value types and `EventSourceId<T>` identities (never raw `Guid`/`string`/`int` for a domain value); `ConceptValidator<T>` for invariants that travel with a value everywhere it appears; `CommandValidator<T>` for command-level rules; and past-tense, self-describing `[EventType]` names. They keep the model type-safe, rules enforceable in one place and events trustworthy; a slice on sloppy primitives is wrong however good the rest is.
26
26
  - **High cohesion through vertical slices** — everything for a behavior lives together: backend, frontend, specs. Navigate by feature, not by technical layer.
27
27
  - **Full-stack type safety** — shared models flow from C# through proxy generation to TypeScript. End-to-end typing without manual synchronization.
28
28
  - **Specialization over reuse** — focused, purpose-built read models over one model reused across conflicting scenarios.
@@ -96,8 +96,8 @@ A claim is only as good as the signal behind it — a build result, a test run,
96
96
  - **Check at the right frequency.** Run affected-project checks while iterating; a prompt ending is not task completion. Before claiming a task complete or pushing/opening a PR, run the full CI-equivalent gates required for that repository (including its Tier 1/2 policy where applicable). A change-selected hook gate is not a substitute for the repository's full CI matrix. After a fix, re-run the gate that failed. Don't argue yourself to green.
97
97
  - **Gate configuration:** shipped defaults `.cratis/ai/hooks/scripts/quality-gates.json`; project overrides `.cratis/ai/quality-gates.project.json` shallow-merge by gate id (command without requires drops inherited packageScripts). `CRATIS_HOOKS_GATES` replaces defaults; project overrides still apply.
98
98
  - **A green build is not behavioral correctness.** Compilation proves it builds, not that the slice does the right thing — that's what specs and exercising the UI are for.
99
- - **Report the conclusion and what you didn't verify, in a line or two.** Show the output when asked, when a claim is contested, or when the check failed — see [verification-discipline.md](./verification-discipline.md).
100
-
99
+ - **Incidents:** analyse the cause first; choose the narrowest fix for it; state its cost and when it can be removed (**cratis-engineering-post-mortem**).
100
+ - **Report the conclusion and what you didn't verify, in a line or two.** Show output when asked, contested or failed — see [verification-discipline.md](./verification-discipline.md).
101
101
  ---
102
102
 
103
103
  # Application profile
@@ -172,9 +172,9 @@ A claim is only as good as the signal behind it — a build result, a test run,
172
172
 
173
173
  - **Rules define invariants; skills define workflows.** A skill may refine how to apply a rule but must not contradict it. On conflict, follow the stricter invariant and fix the stale artifact.
174
174
  - The user's instructions take precedence over guidelines provided in a skill. This does not override safety rules or hooks; skills must still follow rules.
175
- - **Skills and rules are the authoritative answer.** If not answered there, ask. Don't infer Cratis behavior from package internals.
175
+ - **Skills and rules are authoritative.** If unanswered, ask; don't infer Cratis behavior from package internals.
176
176
  - Only make high-confidence suggestions.
177
- - When a user asks how to get help, has a question not answered by the docs, or wants to discuss design, point them to the [Cratis Discord](https://discord.gg/kt4AMpV8WV); direct confirmed bugs to GitHub issues.
177
+ - For help, unanswered questions or design discussion, point users to the [Cratis Discord](https://discord.gg/kt4AMpV8WV); direct confirmed bugs to GitHub issues.
178
178
  - In Cratis organization repositories (a `github.com/Cratis/<repo>` Git `origin`), update dependency manifests / lockfiles / `global.json` / NuGet config as needed for the task; avoid unrelated version churn and call out version bumps in the PR description. In other repositories, don't change them unless explicitly asked.
179
179
  - When asked to **ship** or **land** changes, use the **ship-changes** prompt (`.cratis/ai/prompts/ship-changes.prompt.md`); invoking it is what authorizes the branch → commits → push → PR → merge → cleanup chain it describes. A request to only commit, only push, or only open a PR authorizes exactly that step, under [Git commits](./git-commits.md) and [Pull requests](./pull-requests.md) — do not route it through ship-changes and do not add the later steps.
180
180
 
@@ -182,7 +182,7 @@ A claim is only as good as the signal behind it — a build result, a test run,
182
182
 
183
183
  - **American English** in all code, comments, and docs (initialize, behavior, color, serialize…).
184
184
  - Treat warnings as errors; never suppress warning output.
185
- - Reuse the active terminal for commands; create a new one only when the current one is busy or fails.
185
+ - Reuse the active terminal; open a new one only when it is busy or fails.
186
186
  - All files start with the standard license header:
187
187
 
188
188
  ```csharp
@@ -90,6 +90,16 @@ to verify it; the
90
90
  checklist in the public-safe reference finds nothing. Zero violations is a
91
91
  pass.
92
92
 
93
+ ## Fix proportionately
94
+
95
+ An error, failed run or production incident is first a question, not a mandate for new rules. Analyse it, then pick the narrowest change that addresses the analysed cause.
96
+
97
+ - **Analyse first:** reproduce it or collect the evidence, find the root cause, and size it: how often, who is affected, the blast radius, and whether it is already fixed upstream.
98
+ - **Separate containment from the fix.** Containment is temporary, reversible, scoped to the incident, and has an expiry or removal condition. The fix is the smallest change at the root cause.
99
+ - **Prefer fixing the defect over adding policy.** A new rule, gate, ban, mandatory manual step or blanket hardening needs evidence that the failure recurs or is severe, a stated ongoing cost (what it slows or blocks for everyone), the narrower alternatives considered, an owner and a review condition. One incident is not a pattern.
100
+ - **Never trade a rare failure for permanent friction** on every change or release. If the mitigation costs more than the failure it prevents, it is the wrong mitigation.
101
+ - **Remove it when the cause is fixed.** Link the incident from the rule so a later reader can retire it.
102
+
93
103
  ## Pitfalls
94
104
 
95
105
  - **Hearsay as fact.** "Someone said" belongs in the unverified claims list until a
@@ -102,6 +112,9 @@ pass.
102
112
  - **A check that accepts any answer.** A smoke test or health check that cannot
103
113
  see the failing path, or that accepts the wrong status, is a detection gap;
104
114
  name it and assert the exact result.
115
+ - **One incident, one blanket.** A new gate, ban or freeze for a single incident, with
116
+ no cost or removal condition. Pick the narrowest fix for the analysed cause; see
117
+ "Fix proportionately".
105
118
  - **A protective hold with no end.** A disabled job, a freeze or a manual
106
119
  override needs an owner, an expiry and something that watches it; otherwise
107
120
  the protection becomes the next incident. Prefer a gate that blocks the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.168.4",
3
+ "version": "7.170.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [