@cratis/pi 7.158.0 → 7.158.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/skills/cratis-arc-authentication-authorization-and-identity/SKILL.md +7 -0
- package/package/corpus/skills/cratis-arc-authentication-authorization-and-identity/references/authorization.md +73 -0
- package/package/corpus/skills/cratis-documentation-writing/SKILL.md +43 -127
- package/package/corpus/skills/cratis-documentation-writing/references/writing-guidance.md +110 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +21 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +6 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +54 -126
- package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +6 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/concepts-and-types.md +38 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/generated-values-and-responses.md +19 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +61 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/validate-rules.md +7 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/verification.json +1 -5
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +21 -8
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +3 -3
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +1 -1
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +51 -97
- package/package/corpus/skills/cratis-screenplay-projections/references/mapping-sources.md +33 -0
- package/package/corpus/skills/cratis-screenplay-projections/references/outbound-every.md +12 -0
- package/package/corpus/skills/cratis-screenplay-projections/references/reducers.md +40 -0
- package/package/corpus/skills/cratis-screenplay-projections/references/stage-admission.md +18 -0
- package/package/corpus/skills/cratis-screenplay-projections/verification.json +2 -3
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +61 -134
- package/package/corpus/skills/cratis-screenplay-read-surface/references/passive.md +78 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/references/performer-bodies.md +29 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/references/query-execution.md +21 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/references/screen-levels.md +51 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/verification.json +5 -2
- package/package/corpus/skills/cratis-screenplay-reverse-engineering/references/synthesis-rules.md +7 -4
- package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +21 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +15 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +12 -2
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +1 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +7 -122
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/voice-guidance.md +139 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/verification.json +9 -9
- package/package.json +1 -1
|
@@ -110,6 +110,13 @@ Current behavior:
|
|
|
110
110
|
The context carries `Principal`, `Target`, `Resource` and `ReceivedAt`.
|
|
111
111
|
The old synchronous `IAuthorizationEvaluator.IsAuthorized` rejects policy-bearing
|
|
112
112
|
declarations.
|
|
113
|
+
- **Policies that decide from recorded state.** Derive from
|
|
114
|
+
`StateAwareAuthorizationPolicy<TState>` (implement `GetKey`, `Read`, `Decide`) and
|
|
115
|
+
register it like any named policy. It fails closed: a missing key, absent state, a
|
|
116
|
+
failed read and a rejecting decision all deny and none throws. It is the hand-written
|
|
117
|
+
counterpart of a Screenplay policy with `reads`. Admission only: later state changes
|
|
118
|
+
do not revoke. Requires Arc 22.181.0. Read
|
|
119
|
+
[authorization](references/authorization.md#policies-that-decide-from-recorded-state).
|
|
113
120
|
- **Schemes.** `AuthenticationSchemes` is honored on the ASP.NET Core host and
|
|
114
121
|
rejected at startup on the standalone Core host.
|
|
115
122
|
- **Composition.** Stacked attributes **AND**; only a role list is OR. A method's
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
- Attributes
|
|
7
7
|
- Composition and precedence
|
|
8
8
|
- Named policies
|
|
9
|
+
- Policies that decide from recorded state
|
|
9
10
|
- Guests and anonymous policies
|
|
10
11
|
- Evaluation order
|
|
11
12
|
- Baselines: two separate mechanisms
|
|
@@ -38,6 +39,8 @@ Requires Arc 22.51.0 for `IdentityDiscovery`, which controls the users/tenants/d
|
|
|
38
39
|
|
|
39
40
|
On an Arc older than 22.21.0 only Arc's own attributes count, and only `Roles` is evaluated: `Policy` and `AuthenticationSchemes` are read by nothing, so `[Authorize(Policy = "…")]` enforces nothing, and Microsoft's `[Authorize]`/`[AllowAnonymous]` are **not** enforced on model-bound commands and read models (a command protected only with Microsoft's attribute is open to every caller). Either upgrade, or use only Arc's attributes with roles and treat everything else as unenforced. Do not write a policy-protected endpoint on an Arc older than 22.23.0.
|
|
40
41
|
|
|
42
|
+
Requires Arc 22.181.0 for `StateAwareAuthorizationPolicy<TState>` and `StateDenialReason` (first release tag that contains them).
|
|
43
|
+
|
|
41
44
|
Requires Arc 22.31.2 for identity and declaration continuity to be rechecked around policy evaluation.
|
|
42
45
|
|
|
43
46
|
Requires Arc 22.43.0 for forwarded identity headers to need a host-wide trust opt-in; older versions trust them from any caller.
|
|
@@ -133,6 +136,76 @@ public record <Name>(...)
|
|
|
133
136
|
in a fresh execution scope. `ICurrentPrincipalAccessor` then exposes the
|
|
134
137
|
selected identity.
|
|
135
138
|
|
|
139
|
+
## Policies that decide from recorded state
|
|
140
|
+
|
|
141
|
+
Use `StateAwareAuthorizationPolicy<TState>` (`Cratis.Arc.Authorization`, `TState : class`) when
|
|
142
|
+
access depends on something the application recorded, such as the plan of the asset a command
|
|
143
|
+
acts on or the author of an article. It implements `IAuthorizationPolicy`, so it is registered,
|
|
144
|
+
referenced and evaluated exactly like any other named policy. It is the hand-written counterpart of a
|
|
145
|
+
Screenplay policy with `reads` (see `cratis-screenplay-command-surface`); a rendered model
|
|
146
|
+
generates the equivalent.
|
|
147
|
+
|
|
148
|
+
```csharp
|
|
149
|
+
public class DataQualityEnabled(IAssetPlans plans) : StateAwareAuthorizationPolicy<AssetPlan>
|
|
150
|
+
{
|
|
151
|
+
protected override object? GetKey(AuthorizationPolicyContext context) =>
|
|
152
|
+
(context.Resource as CommandContext)?.Command is RequestScopedToken command ? command.AssetId : null;
|
|
153
|
+
|
|
154
|
+
protected override async ValueTask<AssetPlan?> Read(object key, CancellationToken cancellationToken) =>
|
|
155
|
+
await plans.Find((AssetId)key, cancellationToken);
|
|
156
|
+
|
|
157
|
+
protected override bool Decide(ClaimsPrincipal principal, AssetPlan state) => state.DataQuality;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
builder.Services.AddArcAuthorizationPolicy<DataQualityEnabled>("DataQualityEnabled"); // before Build()
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
```csharp
|
|
164
|
+
[Authorize(Policy = "DataQualityEnabled")]
|
|
165
|
+
[Command]
|
|
166
|
+
public record RequestScopedToken(AssetId AssetId) { /* ... */ }
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
| Member | Contract |
|
|
170
|
+
| --- | --- |
|
|
171
|
+
| `GetKey(AuthorizationPolicyContext)` | `object?`. Take the key from `context.Resource` (the `CommandContext` or `QueryContext`). Return `null` to deny |
|
|
172
|
+
| `Read(object key, CancellationToken)` | `ValueTask<TState?>`. Fetch the state, typically a read model through your own lookup. Return `null` when none is recorded |
|
|
173
|
+
| `Decide(ClaimsPrincipal, TState)` | `bool`. Compare the state with the caller |
|
|
174
|
+
| `OnDenied(context, StateDenialReason, Exception?)` | virtual, default does nothing. Log or count the cause |
|
|
175
|
+
|
|
176
|
+
**Fail-closed behavior** (from `IsAuthorized` in source), in evaluation order:
|
|
177
|
+
|
|
178
|
+
| Situation | Result | `StateDenialReason` |
|
|
179
|
+
| --- | --- | --- |
|
|
180
|
+
| `GetKey` returns `null` or throws | denied | `NoKey` |
|
|
181
|
+
| `Read` returns `null` (no read model instance) | denied | `NotFound` |
|
|
182
|
+
| `Read` throws (store unavailable, any exception) | denied | `ReadFailed` |
|
|
183
|
+
| `Decide` returns `false` | denied | `Rejected` |
|
|
184
|
+
| `Decide` throws | denied | `Rejected` |
|
|
185
|
+
| Cancellation (`OperationCanceledException` while the token is cancelled) | **propagates**, not a denial | none |
|
|
186
|
+
|
|
187
|
+
Absence never allows, and none of the denials throws, so a denial stays distinguishable from a
|
|
188
|
+
server error only through `OnDenied`. A `Read` that returns a default or empty `TState` instead of
|
|
189
|
+
`null` is your decision and `Decide` then sees it; return `null` for "nothing recorded".
|
|
190
|
+
|
|
191
|
+
Limits:
|
|
192
|
+
|
|
193
|
+
- It is an admission check. The read does not enrol in decision reads and access granted when
|
|
194
|
+
the state later changes is not revoked. A read model can lag the events that produced it, so a
|
|
195
|
+
rule that must hold under concurrent writers belongs in the handler as a protected decision
|
|
196
|
+
read (`cratis-chronicle-decision-reads`), not only in a policy.
|
|
197
|
+
- The default registration is authenticated callers only; an unauthenticated caller is never
|
|
198
|
+
evaluated unless the policy opts in with `evaluatesAnonymous: true`, which a state-aware policy
|
|
199
|
+
rarely should.
|
|
200
|
+
- To end a live observable subscription when the state changes, Arc main also has
|
|
201
|
+
`StateAwareEmissionGuard<TState>` (Requires Arc 22.184.0 or later).
|
|
202
|
+
- To specify a policy, call `IsAuthorized` with a hand-built `AuthorizationPolicyContext` and seed the
|
|
203
|
+
state your `Read` override returns. Cover absent state, a failing read, a missing key and a rejecting decision.
|
|
204
|
+
|
|
205
|
+
Sources: `StateAwareAuthorizationPolicy.cs`, `StateDenialReason.cs` and
|
|
206
|
+
`AuthorizationPolicyServiceCollectionExtensions.cs` in `Cratis/Arc` `Source/DotNET/Arc.Core/Authorization`;
|
|
207
|
+
Arc documentation `backend/csharp/core/authorization.md`.
|
|
208
|
+
|
|
136
209
|
## Guests and anonymous policies
|
|
137
210
|
|
|
138
211
|
By default **a policy requires an authenticated principal**, even when the policy
|
|
@@ -33,6 +33,29 @@ The [documentation rule](../../rules/documentation.md) owns Platform naming and
|
|
|
33
33
|
product-claim constraints; do not turn an umbrella label into a dependency on
|
|
34
34
|
all components.
|
|
35
35
|
|
|
36
|
+
## Completion checklist
|
|
37
|
+
|
|
38
|
+
A page is done when:
|
|
39
|
+
|
|
40
|
+
- The page has a deliberate primary purpose; short supporting context helps
|
|
41
|
+
the reader proceed, while substantial digressions link to their own pages.
|
|
42
|
+
- The audience and their goal were identified before writing, and the first
|
|
43
|
+
screen serves that goal. The first working path needs no unexplained setup
|
|
44
|
+
or up-front choice among configuration alternatives, and it is safe to run
|
|
45
|
+
on a developer machine as written.
|
|
46
|
+
- Examples teach intended idioms and identify relevant traps without turning
|
|
47
|
+
a tutorial into an exhaustive list of alternatives.
|
|
48
|
+
- Examples are source-verified, complete at their stated scope, and show a
|
|
49
|
+
checkable result; longer examples come from compiling sample or spec source.
|
|
50
|
+
Explanations of what happened match the backend the reader built.
|
|
51
|
+
- The entry point, terminology, and next-step links fit the surrounding docs.
|
|
52
|
+
- A new or materially changed journey has fresh-context reader evidence, or
|
|
53
|
+
explicitly reports that review as unavailable. Missing steps and guessed
|
|
54
|
+
prerequisites are gaps, not reader success.
|
|
55
|
+
- All internal links resolve; all external links are real.
|
|
56
|
+
- Mermaid blocks are syntactically valid.
|
|
57
|
+
- The file ends with a single trailing newline.
|
|
58
|
+
|
|
36
59
|
## Classify before writing
|
|
37
60
|
|
|
38
61
|
Determine which quadrant the page belongs to before drafting:
|
|
@@ -112,94 +135,6 @@ and neighboring pages; ask only when the alternatives change the outcome.
|
|
|
112
135
|
reread is useful but is not independent reader evidence. Check claims,
|
|
113
136
|
examples, accessibility, links, and the owning gates separately.
|
|
114
137
|
|
|
115
|
-
Use support questions and user feedback as evidence: ask what they searched
|
|
116
|
-
for, where they looked, and which step failed. Repair the entry link, wording,
|
|
117
|
-
or example as appropriate; adding another FAQ entry alone may not fix discovery.
|
|
118
|
-
The docs are also the answer surface for Prompter and Chronicle MCP, so treat
|
|
119
|
-
a repeated question as a signal to investigate the page, its entry route, or
|
|
120
|
-
the product behavior behind it. Reduce a report to the page and the
|
|
121
|
-
sentence-level change the reader expected. Make an in-scope fix when the
|
|
122
|
-
evidence supports one; otherwise report the gap and suggest an issue, opening
|
|
123
|
-
one only when asked.
|
|
124
|
-
[Cratis site specifics](references/cratis-site.md) lists the signals Prompter
|
|
125
|
-
actually records.
|
|
126
|
-
|
|
127
|
-
## Writing style
|
|
128
|
-
|
|
129
|
-
The voice is **direct, practical, and opinionated** — an experienced colleague
|
|
130
|
-
explaining something to a capable developer, confident but never condescending.
|
|
131
|
-
|
|
132
|
-
- **Active voice, present tense.** "Chronicle appends the event", not "The
|
|
133
|
-
event is appended by Chronicle."
|
|
134
|
-
- Address the reader when giving an action: "You configure…". In reference
|
|
135
|
-
and explanation, let the API or component be the subject when that is clearer.
|
|
136
|
-
- **Lead with the reader's problem and payoff.** Explain why a capability
|
|
137
|
-
matters before its configuration, except in a terse how-to or reference.
|
|
138
|
-
- Develop explanations in connected paragraphs. Use headings to locate them,
|
|
139
|
-
lists for real steps, and tables for comparisons; do not fragment reasoning
|
|
140
|
-
into a series of labeled boundaries.
|
|
141
|
-
- Focus on public behavior. Explain what happens behind an example when the
|
|
142
|
-
reader needs it to understand the result, without turning the page into an
|
|
143
|
-
internal implementation manual.
|
|
144
|
-
- Teach the intended idioms: show the conventional shape of a solution and
|
|
145
|
-
explain why a tempting non-idiomatic approach causes trouble. Distinguish a
|
|
146
|
-
framework requirement from a house convention; avoid making a workaround the
|
|
147
|
-
first example a newcomer copies.
|
|
148
|
-
- State limitations, maturity, compatibility, and when the simpler approach
|
|
149
|
-
is preferable. Link to third-party docs instead of retelling them. Say that
|
|
150
|
-
an experimental or preview surface is experimental on its own first screen;
|
|
151
|
-
a sidebar link or published guide does not tell the reader.
|
|
152
|
-
- Use a [Mermaid](https://mermaid-js.github.io/mermaid/#/) diagram where
|
|
153
|
-
architecture, a sequence, or state transitions are clearer drawn than
|
|
154
|
-
told. A diagram replaces topology prose; it does not decorate a page.
|
|
155
|
-
- Vary sentence and paragraph rhythm; avoid templated openings and filler.
|
|
156
|
-
A voice edit must never weaken a technical caveat or invent experience.
|
|
157
|
-
- **American English only**: `color` not `colour`, `behavior` not `behaviour`,
|
|
158
|
-
`organize` not `organise`, `initialize` not `initialise`.
|
|
159
|
-
|
|
160
|
-
## AI-assisted drafting
|
|
161
|
-
|
|
162
|
-
Use AI to find gaps, compare terminology and review a draft, but do not let
|
|
163
|
-
plausible generated prose decide what problem the product solves. Ground the
|
|
164
|
-
reader journey in observed use cases and have the owning maintainer review
|
|
165
|
-
structural changes. A style pass cannot establish technical correctness.
|
|
166
|
-
Do not rewrite an entire corpus into one repeated template.
|
|
167
|
-
|
|
168
|
-
An AI-drafted narrative is a first draft, not a finished page. Give the model
|
|
169
|
-
the reader, the scenario, the terminology and the source evidence up front;
|
|
170
|
-
then revise the result against that evidence and the
|
|
171
|
-
**cratis-writing-voice-and-cadence** constructions before it ships. Tell the
|
|
172
|
-
reviewer the narrative was AI-drafted (in the review request, a PR comment or
|
|
173
|
-
the commit message, never in the PR description, which is published as the
|
|
174
|
-
release note) so they read it as prose, not only as a diff.
|
|
175
|
-
|
|
176
|
-
For machine-readable delivery and retrieval checks, use
|
|
177
|
-
**cratis-llm-friendly-documentation**; publishing `llms-full.txt` alone does
|
|
178
|
-
not prove that an assistant can find the right page or cite it accurately.
|
|
179
|
-
|
|
180
|
-
## Examples and maintenance
|
|
181
|
-
|
|
182
|
-
Use **cratis-technical-examples** to choose between a short verified
|
|
183
|
-
illustration and a snippet extracted from compiling, tested sample source.
|
|
184
|
-
Never transcribe an API from memory, hand-translate an unsupported client, or
|
|
185
|
-
claim a pasted block is runnable when it requires unstated setup. Show the
|
|
186
|
-
command and observable output for a substantial walkthrough.
|
|
187
|
-
|
|
188
|
-
Adding a backend or client to a product also changes pages the product's own
|
|
189
|
-
checks don't scan, such as cross-product and site-level pages. Search them for
|
|
190
|
-
single-language claims ("in C#", C#-only APIs presented as universal) and for
|
|
191
|
-
series indexes whose description, reading order or production claims no longer
|
|
192
|
-
hold.
|
|
193
|
-
|
|
194
|
-
Edit the *authored* file, never a synced copy. The Cratis site derives each
|
|
195
|
-
product page's edit link from that source path, so don't hand-author
|
|
196
|
-
`editUrl` in product frontmatter. Recheck examples against the supported
|
|
197
|
-
version when that version changes. A review of docs is not complete just
|
|
198
|
-
because the site builds: syntax and behavior are different checks.
|
|
199
|
-
|
|
200
|
-
A page is done for this change, not finished forever. Expect to revisit its
|
|
201
|
-
wording, structure and examples as readers hit them.
|
|
202
|
-
|
|
203
138
|
## Guide the next useful action
|
|
204
139
|
|
|
205
140
|
Give enough context to choose a relevant path, then place each prerequisite
|
|
@@ -220,6 +155,20 @@ Preserve semantic order, accessibility and text/AI export meaning. Select the
|
|
|
220
155
|
relevant perspectives in [reader review](references/reader-review.md),
|
|
221
156
|
proportionately, without requiring a reviewer for every lens.
|
|
222
157
|
|
|
158
|
+
## Examples
|
|
159
|
+
|
|
160
|
+
Use **cratis-technical-examples** to choose between a short verified
|
|
161
|
+
illustration and a snippet extracted from compiling, tested sample source.
|
|
162
|
+
Never transcribe an API from memory, hand-translate an unsupported client, or
|
|
163
|
+
claim a pasted block is runnable when it requires unstated setup. Show the
|
|
164
|
+
command and observable output for a substantial walkthrough.
|
|
165
|
+
|
|
166
|
+
Adding a backend or client to a product also changes pages the product's own
|
|
167
|
+
checks don't scan, such as cross-product and site-level pages. Search them for
|
|
168
|
+
single-language claims ("in C#", C#-only APIs presented as universal) and for
|
|
169
|
+
series indexes whose description, reading order or production claims no longer
|
|
170
|
+
hold.
|
|
171
|
+
|
|
223
172
|
## Cratis platform specifics
|
|
224
173
|
|
|
225
174
|
Read [Cratis site specifics](references/cratis-site.md) before writing a
|
|
@@ -228,43 +177,10 @@ Cratis product page. It covers the teaching components (`YouWillLearn`,
|
|
|
228
177
|
maturity and preview labeling, cross-product compatibility, the Prompter
|
|
229
178
|
feedback signal, and who decides page structure.
|
|
230
179
|
|
|
231
|
-
##
|
|
232
|
-
|
|
233
|
-
- Read the existing documentation around the page you are writing first, and
|
|
234
|
-
match its tone, style, and terminology. If it is "event source" there, it is
|
|
235
|
-
"event source" everywhere.
|
|
236
|
-
- Do not copy content from existing pages unless explicitly asked; link
|
|
237
|
-
instead.
|
|
238
|
-
- Do not fabricate URLs or version numbers — link only to resources you can
|
|
239
|
-
verify exist.
|
|
240
|
-
|
|
241
|
-
## Keep editorial research private
|
|
242
|
-
|
|
243
|
-
Keep stylistic influences and editorial research in private working notes,
|
|
244
|
-
not documentation, GitHub issues, pull requests, release notes or other public
|
|
245
|
-
text. Develop each reader journey from Cratis product evidence rather than
|
|
246
|
-
copying another project's structure or claims. This does not remove third-party
|
|
247
|
-
integration names, necessary API identifiers or links readers need to use them.
|
|
248
|
-
|
|
249
|
-
## Completion checklist
|
|
250
|
-
|
|
251
|
-
A page is done when:
|
|
180
|
+
## More guidance
|
|
252
181
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
on a developer machine as written.
|
|
259
|
-
- Examples teach intended idioms and identify relevant traps without turning
|
|
260
|
-
a tutorial into an exhaustive list of alternatives.
|
|
261
|
-
- Examples are source-verified, complete at their stated scope, and show a
|
|
262
|
-
checkable result; longer examples come from compiling sample or spec source.
|
|
263
|
-
Explanations of what happened match the backend the reader built.
|
|
264
|
-
- The entry point, terminology, and next-step links fit the surrounding docs.
|
|
265
|
-
- A new or materially changed journey has fresh-context reader evidence, or
|
|
266
|
-
explicitly reports that review as unavailable. Missing steps and guessed
|
|
267
|
-
prerequisites are gaps, not reader success.
|
|
268
|
-
- All internal links resolve; all external links are real.
|
|
269
|
-
- Mermaid blocks are syntactically valid.
|
|
270
|
-
- The file ends with a single trailing newline.
|
|
182
|
+
Read [writing guidance](references/writing-guidance.md) when you draft or
|
|
183
|
+
revise prose (voice, American English, diagrams, AI-assisted drafting), when
|
|
184
|
+
you handle reader feedback or support questions, when you edit or maintain an
|
|
185
|
+
existing page (authored source, `editUrl`, matching neighboring terminology),
|
|
186
|
+
or before putting editorial research anywhere public.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Documentation writing guidance
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Use reader feedback as evidence
|
|
6
|
+
- Writing style
|
|
7
|
+
- AI-assisted drafting
|
|
8
|
+
- Maintenance
|
|
9
|
+
- Contextual awareness
|
|
10
|
+
- Keep editorial research private
|
|
11
|
+
|
|
12
|
+
Detail that supports the workflow in `SKILL.md`: reader feedback, voice,
|
|
13
|
+
AI-assisted drafting, maintenance and editorial hygiene. The completion
|
|
14
|
+
checklist stays in `SKILL.md`.
|
|
15
|
+
|
|
16
|
+
## Use reader feedback as evidence
|
|
17
|
+
|
|
18
|
+
Use support questions and user feedback as evidence: ask what they searched
|
|
19
|
+
for, where they looked, and which step failed. Repair the entry link, wording,
|
|
20
|
+
or example as appropriate; adding another FAQ entry alone may not fix discovery.
|
|
21
|
+
The docs are also the answer surface for Prompter and Chronicle MCP, so treat
|
|
22
|
+
a repeated question as a signal to investigate the page, its entry route, or
|
|
23
|
+
the product behavior behind it. Reduce a report to the page and the
|
|
24
|
+
sentence-level change the reader expected. Make an in-scope fix when the
|
|
25
|
+
evidence supports one; otherwise report the gap and suggest an issue, opening
|
|
26
|
+
one only when asked.
|
|
27
|
+
[Cratis site specifics](cratis-site.md) lists the signals Prompter
|
|
28
|
+
actually records.
|
|
29
|
+
|
|
30
|
+
## Writing style
|
|
31
|
+
|
|
32
|
+
The voice is **direct, practical, and opinionated** — an experienced colleague
|
|
33
|
+
explaining something to a capable developer, confident but never condescending.
|
|
34
|
+
|
|
35
|
+
- **Active voice, present tense.** "Chronicle appends the event", not "The
|
|
36
|
+
event is appended by Chronicle."
|
|
37
|
+
- Address the reader when giving an action: "You configure…". In reference
|
|
38
|
+
and explanation, let the API or component be the subject when that is clearer.
|
|
39
|
+
- **Lead with the reader's problem and payoff.** Explain why a capability
|
|
40
|
+
matters before its configuration, except in a terse how-to or reference.
|
|
41
|
+
- Develop explanations in connected paragraphs. Use headings to locate them,
|
|
42
|
+
lists for real steps, and tables for comparisons; do not fragment reasoning
|
|
43
|
+
into a series of labeled boundaries.
|
|
44
|
+
- Focus on public behavior. Explain what happens behind an example when the
|
|
45
|
+
reader needs it to understand the result, without turning the page into an
|
|
46
|
+
internal implementation manual.
|
|
47
|
+
- Teach the intended idioms: show the conventional shape of a solution and
|
|
48
|
+
explain why a tempting non-idiomatic approach causes trouble. Distinguish a
|
|
49
|
+
framework requirement from a house convention; avoid making a workaround the
|
|
50
|
+
first example a newcomer copies.
|
|
51
|
+
- State limitations, maturity, compatibility, and when the simpler approach
|
|
52
|
+
is preferable. Link to third-party docs instead of retelling them. Say that
|
|
53
|
+
an experimental or preview surface is experimental on its own first screen;
|
|
54
|
+
a sidebar link or published guide does not tell the reader.
|
|
55
|
+
- Use a [Mermaid](https://mermaid-js.github.io/mermaid/#/) diagram where
|
|
56
|
+
architecture, a sequence, or state transitions are clearer drawn than
|
|
57
|
+
told. A diagram replaces topology prose; it does not decorate a page.
|
|
58
|
+
- Vary sentence and paragraph rhythm; avoid templated openings and filler.
|
|
59
|
+
A voice edit must never weaken a technical caveat or invent experience.
|
|
60
|
+
- **American English only**: `color` not `colour`, `behavior` not `behaviour`,
|
|
61
|
+
`organize` not `organise`, `initialize` not `initialise`.
|
|
62
|
+
|
|
63
|
+
## AI-assisted drafting
|
|
64
|
+
|
|
65
|
+
Use AI to find gaps, compare terminology and review a draft, but do not let
|
|
66
|
+
plausible generated prose decide what problem the product solves. Ground the
|
|
67
|
+
reader journey in observed use cases and have the owning maintainer review
|
|
68
|
+
structural changes. A style pass cannot establish technical correctness.
|
|
69
|
+
Do not rewrite an entire corpus into one repeated template.
|
|
70
|
+
|
|
71
|
+
An AI-drafted narrative is a first draft, not a finished page. Give the model
|
|
72
|
+
the reader, the scenario, the terminology and the source evidence up front;
|
|
73
|
+
then revise the result against that evidence and the
|
|
74
|
+
**cratis-writing-voice-and-cadence** constructions before it ships. Tell the
|
|
75
|
+
reviewer the narrative was AI-drafted (in the review request, a PR comment or
|
|
76
|
+
the commit message, never in the PR description, which is published as the
|
|
77
|
+
release note) so they read it as prose, not only as a diff.
|
|
78
|
+
|
|
79
|
+
For machine-readable delivery and retrieval checks, use
|
|
80
|
+
**cratis-llm-friendly-documentation**; publishing `llms-full.txt` alone does
|
|
81
|
+
not prove that an assistant can find the right page or cite it accurately.
|
|
82
|
+
|
|
83
|
+
## Maintenance
|
|
84
|
+
|
|
85
|
+
Edit the *authored* file, never a synced copy. The Cratis site derives each
|
|
86
|
+
product page's edit link from that source path, so don't hand-author
|
|
87
|
+
`editUrl` in product frontmatter. Recheck examples against the supported
|
|
88
|
+
version when that version changes. A review of docs is not complete just
|
|
89
|
+
because the site builds: syntax and behavior are different checks.
|
|
90
|
+
|
|
91
|
+
A page is done for this change, not finished forever. Expect to revisit its
|
|
92
|
+
wording, structure and examples as readers hit them.
|
|
93
|
+
|
|
94
|
+
## Contextual awareness
|
|
95
|
+
|
|
96
|
+
- Read the existing documentation around the page you are writing first, and
|
|
97
|
+
match its tone, style, and terminology. If it is "event source" there, it is
|
|
98
|
+
"event source" everywhere.
|
|
99
|
+
- Do not copy content from existing pages unless explicitly asked; link
|
|
100
|
+
instead.
|
|
101
|
+
- Do not fabricate URLs or version numbers — link only to resources you can
|
|
102
|
+
verify exist.
|
|
103
|
+
|
|
104
|
+
## Keep editorial research private
|
|
105
|
+
|
|
106
|
+
Keep stylistic influences and editorial research in private working notes,
|
|
107
|
+
not documentation, GitHub issues, pull requests, release notes or other public
|
|
108
|
+
text. Develop each reader journey from Cratis product evidence rather than
|
|
109
|
+
copying another project's structure or claims. This does not remove third-party
|
|
110
|
+
integration names, necessary API identifiers or links readers need to use them.
|
|
@@ -49,6 +49,27 @@ The reference fold admits only root-property set/clear from literals or event
|
|
|
49
49
|
properties; other mappings block planning. Publication is unrouted and reactions
|
|
50
50
|
can observe the new public fact. A route filter therefore cannot select publication.
|
|
51
51
|
|
|
52
|
+
Events an outbound projection publishes count as producers: a routed fact, an
|
|
53
|
+
`every`/`all` scope and compile-time source-type inference all see them, and a
|
|
54
|
+
published instance keeps the event source and context of the fact that produced it.
|
|
55
|
+
An `every` scope folds every producible event type, so inference needs those facts to
|
|
56
|
+
share one source type. A projection that combines `from` and `every` over different
|
|
57
|
+
producible event types is refused as ambiguous (`InvalidSemanticContract`, no `PLAY`
|
|
58
|
+
code), because the published event would have no single source type:
|
|
59
|
+
|
|
60
|
+
```screenplay excerpt
|
|
61
|
+
// Refused: PackOrder produces OrderPacked keyed by an OrderId, while another
|
|
62
|
+
// producer's event is keyed by a different type; `every` folds both.
|
|
63
|
+
projection OrderShippedPublisher => OrderShipped
|
|
64
|
+
every
|
|
65
|
+
status = "packed"
|
|
66
|
+
from OrderPacked
|
|
67
|
+
carrier = carrier
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Fold one source type, or map each event in its own `from` and drop `every`.
|
|
71
|
+
Requires Screenplay 5.2.0 (`screenplay --version`).
|
|
72
|
+
|
|
52
73
|
This complete source uses the released publication specification form:
|
|
53
74
|
|
|
54
75
|
```screenplay
|
|
@@ -113,6 +113,12 @@ the input selection or not; nested paths and read aliases fail binding): keep th
|
|
|
113
113
|
the invoked command or the implementation. A compiler that stops before ESM v6 binds none of this
|
|
114
114
|
(`PLAY0268`).
|
|
115
115
|
|
|
116
|
+
A top-level `trigger` that fails to bind does not refuse the whole model when a host uses
|
|
117
|
+
admissible compilation (Screenplay 5.2.0): the trigger is excluded, the reactions and
|
|
118
|
+
specifications that depend on it are excluded after it, and independent slices still bind. Strict
|
|
119
|
+
binding still refuses the whole model. Read toolchain
|
|
120
|
+
[executable subset](../cratis-screenplay-toolchain/references/executable-subset.md).
|
|
121
|
+
|
|
116
122
|
## Refusals and recovery redelivery
|
|
117
123
|
|
|
118
124
|
Invocation refusal selectors, `$refusal` branch values and `acknowledge`
|