@cratis/pi 7.147.0 → 7.148.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.
@@ -29,7 +29,7 @@ This is a read-only review role: propose corrections and refactors in the report
29
29
  You are the **Code Reviewer** for Cratis-based projects.
30
30
  Your responsibility is to review all changed files and ensure they meet project standards before merge.
31
31
 
32
- Select only diff-relevant, profile-applicable canonical rules in `.cratis/ai/rules/` (and `general.md`): `vertical-slices.md`, `csharp.md`, `code-quality.md` (+ `.csharp`/`.typescript`), `code-health.md` (flag a touched file below 9.5 with no reported reason only together with the round's other findings), `specs.md` (+ `.csharp`/`.typescript`), `frontend-testing.md`, `typescript.md`, `react.md`, `components.md`, `dialogs.md`, `frontend-quality.md`, `concepts.md`, `mongodb.md` (when MongoDB is used), `efcore.md`/`efcore.specs.md`.
32
+ Select only diff-relevant, profile-applicable canonical rules in `.cratis/ai/rules/` (and `general.md`): `vertical-slices.md`, `csharp.md`, `code-quality.md` (+ `.csharp`/`.typescript`), `code-health.md` (flag a touched file below 9.5 with no reported reason only together with the round's other findings), `published-contracts.md` (a behavior change on a trust-boundary or wire/protocol surface that cites no governing contract and vectors, or conflicts with one, is blocking), `specs.md` (+ `.csharp`/`.typescript`), `frontend-testing.md`, `typescript.md`, `react.md`, `components.md`, `dialogs.md`, `frontend-quality.md`, `concepts.md`, `mongodb.md` (when MongoDB is used), `efcore.md`/`efcore.specs.md`.
33
33
 
34
34
  ---
35
35
 
@@ -34,6 +34,10 @@ Your responsibility is to perform a structured **security review** of all change
34
34
 
35
35
  ## What to check
36
36
 
37
+ ### Published contracts
38
+
39
+ - [ ] **[BLOCKING]** A behavior change at a trust boundary or wire/protocol surface cites the governing published contract and its vectors (or says none exists), and conforms to them; an uncited change, or one that conflicts with a vector, is blocking (`published-contracts.md`)
40
+
37
41
  ### Input Validation & Injection
38
42
 
39
43
  - [ ] All command properties are validated before use (null, empty, range, format)
@@ -0,0 +1,40 @@
1
+ ---
2
+ applyTo: "**/contracts/**,**/vectors/**,**/*vectors*.json,**/*.proto,**/*.schema.json"
3
+ paths:
4
+ - "**/contracts/**"
5
+ - "**/vectors/**"
6
+ - "**/*vectors*.json"
7
+ - "**/*.proto"
8
+ - "**/*.schema.json"
9
+ ---
10
+ <!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
11
+
12
+ # Published contracts
13
+
14
+ A published contract is a specification other repositories implement: a wire format, a
15
+ protocol profile, or an authorization or trust-boundary specification, usually with
16
+ conformance vectors. This rule applies when a change alters behavior at such a surface.
17
+ Every line is tagged **[contract]** (binding) or **[convention]** (the house default) per
18
+ the Three Levels of Authority in [`general.md`](../../../rules/general.md). The router is the
19
+ `general.md` "Where to Look" row; the rule loads by path, so look it up before editing
20
+ source on a trust boundary or wire surface.
21
+
22
+ - **[contract] Find the governing contract before changing the behavior.** Locate the
23
+ published specification and its vectors for the surface (authentication, authorization,
24
+ tokens, serialization, protocol handshakes) and cite both, by name and version or
25
+ revision, in the issue and in the pull request comment. If none exists, say so
26
+ explicitly in both; silence is not the same as "no contract".
27
+ - **[contract] The contract wins over the implementation.** When the change conflicts with
28
+ a vector, follow the contract, or change the contract first through its owner and
29
+ re-pin. Never change the implementation alone to disagree with it, and never edit a
30
+ pinned copy of a vector to make a spec pass.
31
+ - **[contract] Implementers run the pinned vectors as executable specs in CI.** A
32
+ repository that implements a published contract pins a revision of its vectors and runs
33
+ every vector as a spec on each build; reading the vectors is not verification. A spec
34
+ that loads zero vectors fails (see [`guards-and-fuses.md`](./guards-and-fuses.instructions.md)).
35
+ - **[contract] Review checks the change against the cited contract.** Reviewers, including
36
+ the security lens, compare the diff to the cited specification and vectors. An uncited
37
+ behavior change on such a surface is a blocking finding, as is a change that conflicts
38
+ with a vector.
39
+ - **[convention] Bump the pin deliberately.** Update the pinned vectors in their own
40
+ commit so the behavior change they carry is visible and reviewable.
@@ -81,6 +81,8 @@ and exhaustion never imply approval. Verify cancellation before replacement; esc
81
81
  unresolved disputes instead of looping. Suggestions alone do not justify another round.
82
82
  See `cratis-engineering-review-rounds` for dispatch and writer-pause mechanics.
83
83
 
84
+ An uncited behavior change on a trust-boundary or wire/protocol surface is a blocker (`published-contracts.md`).
85
+
84
86
  Code Health (`code-health.md`) never earns a round of its own: flag a touched file below
85
87
  9.5 with no reported reason only together with the round's other findings. A file below 9.5
86
88
  with a reason and an uplift entry is closed; a second Code Health round is a finding that
@@ -26,7 +26,7 @@ This is a read-only review role: propose corrections and refactors in the report
26
26
  You are the **Code Reviewer** for Cratis-based projects.
27
27
  Your responsibility is to review all changed files and ensure they meet project standards before merge.
28
28
 
29
- Select only diff-relevant, profile-applicable canonical rules in `.cratis/ai/rules/` (and `general.md`): `vertical-slices.md`, `csharp.md`, `code-quality.md` (+ `.csharp`/`.typescript`), `code-health.md` (flag a touched file below 9.5 with no reported reason only together with the round's other findings), `specs.md` (+ `.csharp`/`.typescript`), `frontend-testing.md`, `typescript.md`, `react.md`, `components.md`, `dialogs.md`, `frontend-quality.md`, `concepts.md`, `mongodb.md` (when MongoDB is used), `efcore.md`/`efcore.specs.md`.
29
+ Select only diff-relevant, profile-applicable canonical rules in `.cratis/ai/rules/` (and `general.md`): `vertical-slices.md`, `csharp.md`, `code-quality.md` (+ `.csharp`/`.typescript`), `code-health.md` (flag a touched file below 9.5 with no reported reason only together with the round's other findings), `published-contracts.md` (a behavior change on a trust-boundary or wire/protocol surface that cites no governing contract and vectors, or conflicts with one, is blocking), `specs.md` (+ `.csharp`/`.typescript`), `frontend-testing.md`, `typescript.md`, `react.md`, `components.md`, `dialogs.md`, `frontend-quality.md`, `concepts.md`, `mongodb.md` (when MongoDB is used), `efcore.md`/`efcore.specs.md`.
30
30
 
31
31
  ---
32
32
 
@@ -31,6 +31,10 @@ Your responsibility is to perform a structured **security review** of all change
31
31
 
32
32
  ## What to check
33
33
 
34
+ ### Published contracts
35
+
36
+ - [ ] **[BLOCKING]** A behavior change at a trust boundary or wire/protocol surface cites the governing published contract and its vectors (or says none exists), and conforms to them; an uncited change, or one that conflicts with a vector, is blocking (`published-contracts.md`)
37
+
34
38
  ### Input Validation & Injection
35
39
 
36
40
  - [ ] All command properties are validated before use (null, empty, range, format)
@@ -141,8 +141,15 @@ function pathFrom(root, value) {
141
141
  return resolve(root, path);
142
142
  }
143
143
 
144
+ function firstCodeSpan(text) {
145
+ return /`([^`]+)`/.exec(text)?.[1];
146
+ }
147
+
148
+ const looksLikePath = value => !/\s/.test(value) && (value.includes('/') || /\.[A-Za-z0-9]+$/.test(value));
149
+
144
150
  function readPaths(sections, root, context) {
145
- const paths = bullets(sections.get('Files to read')).map(item => ({ ...item, text: clean(item.text) }))
151
+ const paths = bullets(sections.get('Files to read'))
152
+ .map(item => ({ ...item, text: firstCodeSpan(item.text) ?? clean(item.text) }))
146
153
  .filter(item => !absent(item.text));
147
154
  for (const item of paths) {
148
155
  const path = pathFrom(root, item.text);
@@ -164,6 +171,7 @@ function watchRows(rows, context) {
164
171
  function unreadResults(section, root, context) {
165
172
  for (const item of bullets(section)) {
166
173
  for (const match of item.text.matchAll(/`([^`]+)`/g)) {
174
+ if (!looksLikePath(match[1])) continue;
167
175
  const path = pathFrom(root, match[1]);
168
176
  if (!path || !existsSync(path)) context.warning('result-missing', `Unread result path does not exist: ${match[1]}.`, item.line);
169
177
  }
@@ -143,7 +143,7 @@ A claim is only as good as the signal behind it — a build result, a test run,
143
143
  | Build and spec-run speed: parallel-safe specs, no per-spec startup, cheap analyzers | `fast-feedback.md` |
144
144
  | Spec patterns — the four `*Scenario` helpers (application only) | `specs.scenarios.csharp.md` |
145
145
  | Strongly-typed values (`ConceptAs<T>`, `EventSourceId<T>`); shared term definitions (event, projection, reducer, reactor, observer, DCB, …) | `concepts.md`; `glossary.md` |
146
- | Files an AI change touches (Code Health with CodeScene) | `code-health.md` |
146
+ | Files an AI change touches (Code Health with CodeScene); behavior at a trust boundary or wire/protocol surface (cite and conform to the published contract and vectors) | `code-health.md`; `published-contracts.md` |
147
147
  | Diagnosing a misbehaving slice | read model stale or startup crash: **cratis-chronicle-projection** (*Startup-crash traps*); reactor paused or quarantined: **cratis-chronicle-reactor** (*Failure behavior*); proxy missing: **cratis-arc-command** (*Generate the TypeScript proxy*) |
148
148
  | Inspecting or operating a **running** Chronicle store (failed partitions, replays, browsing events) with the `cratis` CLI | the **cratis-chronicle-cli-operations** and **cratis-cli-terminal-workbench** skills |
149
149
  | EF Core read models / migrations | `efcore.md`, `efcore.specs.md` |
@@ -0,0 +1,39 @@
1
+ ---
2
+ applyTo: "**/contracts/**,**/vectors/**,**/*vectors*.json,**/*.proto,**/*.schema.json"
3
+ paths:
4
+ - "**/contracts/**"
5
+ - "**/vectors/**"
6
+ - "**/*vectors*.json"
7
+ - "**/*.proto"
8
+ - "**/*.schema.json"
9
+ ---
10
+
11
+ # Published contracts
12
+
13
+ A published contract is a specification other repositories implement: a wire format, a
14
+ protocol profile, or an authorization or trust-boundary specification, usually with
15
+ conformance vectors. This rule applies when a change alters behavior at such a surface.
16
+ Every line is tagged **[contract]** (binding) or **[convention]** (the house default) per
17
+ the Three Levels of Authority in [`general.md`](./general.md). The router is the
18
+ `general.md` "Where to Look" row; the rule loads by path, so look it up before editing
19
+ source on a trust boundary or wire surface.
20
+
21
+ - **[contract] Find the governing contract before changing the behavior.** Locate the
22
+ published specification and its vectors for the surface (authentication, authorization,
23
+ tokens, serialization, protocol handshakes) and cite both, by name and version or
24
+ revision, in the issue and in the pull request comment. If none exists, say so
25
+ explicitly in both; silence is not the same as "no contract".
26
+ - **[contract] The contract wins over the implementation.** When the change conflicts with
27
+ a vector, follow the contract, or change the contract first through its owner and
28
+ re-pin. Never change the implementation alone to disagree with it, and never edit a
29
+ pinned copy of a vector to make a spec pass.
30
+ - **[contract] Implementers run the pinned vectors as executable specs in CI.** A
31
+ repository that implements a published contract pins a revision of its vectors and runs
32
+ every vector as a spec on each build; reading the vectors is not verification. A spec
33
+ that loads zero vectors fails (see [`guards-and-fuses.md`](./guards-and-fuses.md)).
34
+ - **[contract] Review checks the change against the cited contract.** Reviewers, including
35
+ the security lens, compare the diff to the cited specification and vectors. An uncited
36
+ behavior change on such a surface is a blocking finding, as is a change that conflicts
37
+ with a vector.
38
+ - **[convention] Bump the pin deliberately.** Update the pinned vectors in their own
39
+ commit so the behavior change they carry is visible and reviewable.
@@ -80,6 +80,8 @@ and exhaustion never imply approval. Verify cancellation before replacement; esc
80
80
  unresolved disputes instead of looping. Suggestions alone do not justify another round.
81
81
  See `cratis-engineering-review-rounds` for dispatch and writer-pause mechanics.
82
82
 
83
+ An uncited behavior change on a trust-boundary or wire/protocol surface is a blocker (`published-contracts.md`).
84
+
83
85
  Code Health (`code-health.md`) never earns a round of its own: flag a touched file below
84
86
  9.5 with no reported reason only together with the round's other findings. A file below 9.5
85
87
  with a reason and an uplift entry is closed; a second Code Health round is a finding that
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.147.0",
3
+ "version": "7.148.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [