@cratis/pi 7.168.1 → 7.168.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/harnesses/copilot/instructions/application-profile.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/capability-is-not-authority.instructions.md +4 -0
- package/package/corpus/harnesses/copilot/instructions/guards-and-fuses.instructions.md +6 -0
- package/package/corpus/rules/application-profile.md +1 -1
- package/package/corpus/rules/capability-is-not-authority.md +4 -0
- package/package/corpus/rules/guards-and-fuses.md +6 -0
- package/package.json +1 -1
|
@@ -51,7 +51,7 @@ Tagged **[contract]** (framework-enforced) or **[convention]** (house default).
|
|
|
51
51
|
4. **[contract] Events never carry the event-source id** — it is implicit in the event context.
|
|
52
52
|
5. **[contract] `[Key]` / `[Subject]` are distinct.** `[Key]` is for event-source/read-model/projection key resolution; `[Subject]` is compliance identity only. Don't put either on an `EventSourceId<T>` value (it already is both); use them only for non-`EventSourceId<T>` values.
|
|
53
53
|
6. **[contract] Avoid nullable event properties** — Chronicle's analyzer warns on them. Model optional facts as a separate event; resolve nullable command inputs to a non-null sentinel before constructing the event. **Likewise `Handle()` never returns a nullable event or `null` for "nothing to do"** — Arc treats a `null` result as success with nothing appended, so the caller is told a command succeeded that never happened. Missing state or a failed rule is a rejection: return `Result<TEvent, ValidationResult>` with `ValidationResult.Error(...)`, or reject in a validator or `Provide()`. Optional `ICommandOperation` returns are a separate contract and unaffected.
|
|
54
|
-
7. **[convention] New events use plain `[EventType]`** — the type name is the id, public contracts included; "public" never implies a UUID or any explicit id. This is a house convention (decision 152), not a Chronicle contract: Chronicle accepts any string id. An explicit id is allowed only (a) to keep an already-persisted id after a CLR rename, or (b) to resolve a cross-package short-name collision (`MultipleEventTypesWithSameIdFound`). Never change an existing persisted id. Schema changes get a new generation + an `EventTypeMigration<TUpgrade,TPrevious>` (never edit stored-event semantics silently). An enum that only gains a member, or has one renamed, is the exception — Chronicle accepts that in place; a *removed* or *renumbered* member still needs a generation, plus a value map saying what the old values became.
|
|
54
|
+
7. **[convention] New events use plain `[EventType]`** — the type name is the id, public contracts included; "public" never implies a UUID or any explicit id. This is a house convention (decision 152), not a Chronicle contract: Chronicle accepts any string id. An explicit id is allowed only (a) to keep an already-persisted id after a CLR rename, or (b) to resolve a cross-package short-name collision (`MultipleEventTypesWithSameIdFound`). Never change an existing persisted id. Schema changes get a new generation + an `EventTypeMigration<TUpgrade,TPrevious>` (never edit stored-event semantics silently). An enum that only gains a member, or has one renamed, is the exception — Chronicle accepts that in place; a *removed* or *renumbered* member still needs a generation, plus a value map saying what the old values became. Gates: see [guards-and-fuses.md](./guards-and-fuses.instructions.md).
|
|
55
55
|
8. **[convention] Every `[EventType]` has an XML `<summary>`** — a Cratis C# documentation convention (not a Chronicle rule); events live in the log forever, so record why they exist.
|
|
56
56
|
9. **[convention] `[ReadModel]` properties carry no default values** except semantically meaningful enum initial states and `[SetValue<T>]`-driven `bool` flags. False defaults hide missing projection wiring.
|
|
57
57
|
10. **[contract] AutoMap is on by default — never call `.AutoMap()`.** Match property names so AutoMap wires them; diverge with `[SetFrom<T>]` / fluent `.Set().To()` only for genuine name differences. Re-enable `.AutoMap()` only inside a scope where it was disabled with `.NoAutoMap()`.
|
package/package/corpus/harnesses/copilot/instructions/capability-is-not-authority.instructions.md
CHANGED
|
@@ -45,5 +45,9 @@ Levels of Authority in [`general.md`](../../../rules/general.md).
|
|
|
45
45
|
packets or briefs.** Never use real credentials or personal data in examples.
|
|
46
46
|
- **[contract] Legacy extraction uses Git read-only:** never checkout, reset or stash
|
|
47
47
|
the legacy repository; do not touch a live checkout the brief excludes.
|
|
48
|
+
- **[contract] A human-only production request carries necessity evidence:** the actual
|
|
49
|
+
trigger (diff or data) and an independent check against real system behavior that the
|
|
50
|
+
action is needed, not just a correct procedure. Reviewers ask "is this action needed?".
|
|
51
|
+
Example: attach the system's own check on the same diff before asking for a demanded repair.
|
|
48
52
|
- **[convention] Prefer the narrowest capability that does the job.** Reaching for the
|
|
49
53
|
broadest available grant makes the next reader assume it was authorized.
|
|
@@ -60,6 +60,12 @@ one does.
|
|
|
60
60
|
- **[contract] Re-read preconditions immediately before each mutation and stop when drift
|
|
61
61
|
invalidates the authorized scope, safety assumptions, or recovery plan.** Benign drift
|
|
62
62
|
within an already authorized bounded pass does not require another confirmation.
|
|
63
|
+
- **[contract] A deploy gate asks the system of record; it does not predict it.** A gate
|
|
64
|
+
for Chronicle event-type registration calls Chronicle's read-only registration check, or
|
|
65
|
+
carries a contract spec against Chronicle's comparison for every change class (enum
|
|
66
|
+
extension, enum rename, optional or required property added, property removed, retype).
|
|
67
|
+
A reimplemented copy drifts: one demanded a registry repair for an enum-only change
|
|
68
|
+
Chronicle accepts in place ([application-profile.md](./application-profile.instructions.md) rule 7).
|
|
63
69
|
- **[convention] When the targets were not already established in the conversation, show
|
|
64
70
|
the dry-run list and act on it once the user has answered.** A user who has reviewed
|
|
65
71
|
and authorized those targets is not asked to approve the same pass again. The list is a
|
|
@@ -50,7 +50,7 @@ Tagged **[contract]** (framework-enforced) or **[convention]** (house default).
|
|
|
50
50
|
4. **[contract] Events never carry the event-source id** — it is implicit in the event context.
|
|
51
51
|
5. **[contract] `[Key]` / `[Subject]` are distinct.** `[Key]` is for event-source/read-model/projection key resolution; `[Subject]` is compliance identity only. Don't put either on an `EventSourceId<T>` value (it already is both); use them only for non-`EventSourceId<T>` values.
|
|
52
52
|
6. **[contract] Avoid nullable event properties** — Chronicle's analyzer warns on them. Model optional facts as a separate event; resolve nullable command inputs to a non-null sentinel before constructing the event. **Likewise `Handle()` never returns a nullable event or `null` for "nothing to do"** — Arc treats a `null` result as success with nothing appended, so the caller is told a command succeeded that never happened. Missing state or a failed rule is a rejection: return `Result<TEvent, ValidationResult>` with `ValidationResult.Error(...)`, or reject in a validator or `Provide()`. Optional `ICommandOperation` returns are a separate contract and unaffected.
|
|
53
|
-
7. **[convention] New events use plain `[EventType]`** — the type name is the id, public contracts included; "public" never implies a UUID or any explicit id. This is a house convention (decision 152), not a Chronicle contract: Chronicle accepts any string id. An explicit id is allowed only (a) to keep an already-persisted id after a CLR rename, or (b) to resolve a cross-package short-name collision (`MultipleEventTypesWithSameIdFound`). Never change an existing persisted id. Schema changes get a new generation + an `EventTypeMigration<TUpgrade,TPrevious>` (never edit stored-event semantics silently). An enum that only gains a member, or has one renamed, is the exception — Chronicle accepts that in place; a *removed* or *renumbered* member still needs a generation, plus a value map saying what the old values became.
|
|
53
|
+
7. **[convention] New events use plain `[EventType]`** — the type name is the id, public contracts included; "public" never implies a UUID or any explicit id. This is a house convention (decision 152), not a Chronicle contract: Chronicle accepts any string id. An explicit id is allowed only (a) to keep an already-persisted id after a CLR rename, or (b) to resolve a cross-package short-name collision (`MultipleEventTypesWithSameIdFound`). Never change an existing persisted id. Schema changes get a new generation + an `EventTypeMigration<TUpgrade,TPrevious>` (never edit stored-event semantics silently). An enum that only gains a member, or has one renamed, is the exception — Chronicle accepts that in place; a *removed* or *renumbered* member still needs a generation, plus a value map saying what the old values became. Gates: see [guards-and-fuses.md](./guards-and-fuses.md).
|
|
54
54
|
8. **[convention] Every `[EventType]` has an XML `<summary>`** — a Cratis C# documentation convention (not a Chronicle rule); events live in the log forever, so record why they exist.
|
|
55
55
|
9. **[convention] `[ReadModel]` properties carry no default values** except semantically meaningful enum initial states and `[SetValue<T>]`-driven `bool` flags. False defaults hide missing projection wiring.
|
|
56
56
|
10. **[contract] AutoMap is on by default — never call `.AutoMap()`.** Match property names so AutoMap wires them; diverge with `[SetFrom<T>]` / fluent `.Set().To()` only for genuine name differences. Re-enable `.AutoMap()` only inside a scope where it was disabled with `.NoAutoMap()`.
|
|
@@ -44,5 +44,9 @@ Levels of Authority in [`general.md`](./general.md).
|
|
|
44
44
|
packets or briefs.** Never use real credentials or personal data in examples.
|
|
45
45
|
- **[contract] Legacy extraction uses Git read-only:** never checkout, reset or stash
|
|
46
46
|
the legacy repository; do not touch a live checkout the brief excludes.
|
|
47
|
+
- **[contract] A human-only production request carries necessity evidence:** the actual
|
|
48
|
+
trigger (diff or data) and an independent check against real system behavior that the
|
|
49
|
+
action is needed, not just a correct procedure. Reviewers ask "is this action needed?".
|
|
50
|
+
Example: attach the system's own check on the same diff before asking for a demanded repair.
|
|
47
51
|
- **[convention] Prefer the narrowest capability that does the job.** Reaching for the
|
|
48
52
|
broadest available grant makes the next reader assume it was authorized.
|
|
@@ -59,6 +59,12 @@ one does.
|
|
|
59
59
|
- **[contract] Re-read preconditions immediately before each mutation and stop when drift
|
|
60
60
|
invalidates the authorized scope, safety assumptions, or recovery plan.** Benign drift
|
|
61
61
|
within an already authorized bounded pass does not require another confirmation.
|
|
62
|
+
- **[contract] A deploy gate asks the system of record; it does not predict it.** A gate
|
|
63
|
+
for Chronicle event-type registration calls Chronicle's read-only registration check, or
|
|
64
|
+
carries a contract spec against Chronicle's comparison for every change class (enum
|
|
65
|
+
extension, enum rename, optional or required property added, property removed, retype).
|
|
66
|
+
A reimplemented copy drifts: one demanded a registry repair for an enum-only change
|
|
67
|
+
Chronicle accepts in place ([application-profile.md](./application-profile.md) rule 7).
|
|
62
68
|
- **[convention] When the targets were not already established in the conversation, show
|
|
63
69
|
the dry-run list and act on it once the user has answered.** A user who has reviewed
|
|
64
70
|
and authorized those targets is not asked to approve the same pass again. The list is a
|