@cratis/pi 7.51.1 → 7.51.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.
@@ -1,5 +1,19 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/*.cs,**/*.csproj,**/*.ts,**/*.tsx,**/*.go,**/go.mod,**/go.sum,**/*.kt,**/*.kts,**/*.java,**/*.ex,**/*.exs,**/*.play"
3
+ paths:
4
+ - "**/*.cs"
5
+ - "**/*.csproj"
6
+ - "**/*.ts"
7
+ - "**/*.tsx"
8
+ - "**/*.go"
9
+ - "**/go.mod"
10
+ - "**/go.sum"
11
+ - "**/*.kt"
12
+ - "**/*.kts"
13
+ - "**/*.java"
14
+ - "**/*.ex"
15
+ - "**/*.exs"
16
+ - "**/*.play"
3
17
  profile: application
4
18
  ---
5
19
  <!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
@@ -77,7 +77,7 @@ When changing a description, run trigger evaluations before and after when autho
77
77
 
78
78
  ## 11. Always-on content
79
79
 
80
- Keep `general.md` to facts needed in every session, at most 200 lines. Warn above 24,000 bytes and above 60,000 combined bytes for rules without `paths`; line length alone can hide context bloat. Review globally applied Copilot instructions above 4,000 characters. These budgets leave room for source and task context, rather than promising a token count.
80
+ Keep `general.md` to facts needed in every session, at most 200 lines. Warn above 24,000 bytes and above 91,000 combined bytes for rules without `paths`; line length alone can hide context bloat. Review globally applied Copilot instructions above 4,000 characters. These budgets leave room for source and task context, rather than promising a token count.
81
81
 
82
82
  Use path-scoped rules for file-specific invariants and skills for particular operations. Hooks and CI enforce mechanical constraints; natural-language rules do not replace permission controls.
83
83
 
@@ -1,5 +1,7 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/.cratis/**"
3
+ paths:
4
+ - "**/.cratis/**"
3
5
  ---
4
6
  <!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
5
7
 
@@ -1,5 +1,11 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/*.sh,**/*.ps1,**/scripts/**,**/.github/workflows/**,**/.cratis/ai/hooks/**"
3
+ paths:
4
+ - "**/*.sh"
5
+ - "**/*.ps1"
6
+ - "**/scripts/**"
7
+ - "**/.github/workflows/**"
8
+ - "**/.cratis/ai/hooks/**"
3
9
  ---
4
10
  <!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
5
11
 
@@ -1,5 +1,11 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/*.sh,**/*.ps1,**/scripts/**,**/.github/workflows/**,**/.cratis/ai/hooks/**"
3
+ paths:
4
+ - "**/*.sh"
5
+ - "**/*.ps1"
6
+ - "**/scripts/**"
7
+ - "**/.github/workflows/**"
8
+ - "**/.cratis/ai/hooks/**"
3
9
  ---
4
10
  <!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
5
11
 
@@ -49,11 +49,19 @@ function matchesSelection(name: string, applyTo: string[], selected: AiConfigura
49
49
  const needsCSharp = scope.includes('.cs');
50
50
  const needsTypeScript = scope.includes('.ts') || name === 'rtk.md' || name.endsWith('/rtk.md');
51
51
  const needsGo = scope.includes('.go') || scope.includes('go.mod') || scope.includes('go.sum');
52
+ const needsKotlin = scope.includes('.kt');
53
+ const needsJava = scope.includes('.java');
54
+ const needsElixir = scope.includes('.ex');
52
55
  const needsDocumentation = scope.includes('md');
53
- if (!needsCSharp && !needsTypeScript && !needsGo && !needsDocumentation) return true;
56
+ // A scope that also names model files (`.play`) is not tied to one language, so it is always kept.
57
+ if (scope.includes('.play')) return true;
58
+ if (!needsCSharp && !needsTypeScript && !needsGo && !needsKotlin && !needsJava && !needsElixir && !needsDocumentation) return true;
54
59
  return (needsCSharp && languages.includes('csharp')) ||
55
60
  (needsTypeScript && languages.includes('typescript')) ||
56
61
  (needsGo && languages.includes('go')) ||
62
+ (needsKotlin && languages.includes('kotlin')) ||
63
+ (needsJava && languages.includes('java')) ||
64
+ (needsElixir && languages.includes('elixir')) ||
57
65
  (needsDocumentation && (selected.profiles ?? []).includes('cratis/documentation'));
58
66
  }
59
67
 
@@ -1,5 +1,19 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/*.cs,**/*.csproj,**/*.ts,**/*.tsx,**/*.go,**/go.mod,**/go.sum,**/*.kt,**/*.kts,**/*.java,**/*.ex,**/*.exs,**/*.play"
3
+ paths:
4
+ - "**/*.cs"
5
+ - "**/*.csproj"
6
+ - "**/*.ts"
7
+ - "**/*.tsx"
8
+ - "**/*.go"
9
+ - "**/go.mod"
10
+ - "**/go.sum"
11
+ - "**/*.kt"
12
+ - "**/*.kts"
13
+ - "**/*.java"
14
+ - "**/*.ex"
15
+ - "**/*.exs"
16
+ - "**/*.play"
3
17
  profile: application
4
18
  ---
5
19
 
@@ -76,7 +76,7 @@ When changing a description, run trigger evaluations before and after when autho
76
76
 
77
77
  ## 11. Always-on content
78
78
 
79
- Keep `general.md` to facts needed in every session, at most 200 lines. Warn above 24,000 bytes and above 60,000 combined bytes for rules without `paths`; line length alone can hide context bloat. Review globally applied Copilot instructions above 4,000 characters. These budgets leave room for source and task context, rather than promising a token count.
79
+ Keep `general.md` to facts needed in every session, at most 200 lines. Warn above 24,000 bytes and above 91,000 combined bytes for rules without `paths`; line length alone can hide context bloat. Review globally applied Copilot instructions above 4,000 characters. These budgets leave room for source and task context, rather than promising a token count.
80
80
 
81
81
  Use path-scoped rules for file-specific invariants and skills for particular operations. Hooks and CI enforce mechanical constraints; natural-language rules do not replace permission controls.
82
82
 
@@ -1,5 +1,7 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/.cratis/**"
3
+ paths:
4
+ - "**/.cratis/**"
3
5
  ---
4
6
 
5
7
  # `.cratis/` is configuration, never a place to produce things
@@ -1,5 +1,11 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/*.sh,**/*.ps1,**/scripts/**,**/.github/workflows/**,**/.cratis/ai/hooks/**"
3
+ paths:
4
+ - "**/*.sh"
5
+ - "**/*.ps1"
6
+ - "**/scripts/**"
7
+ - "**/.github/workflows/**"
8
+ - "**/.cratis/ai/hooks/**"
3
9
  ---
4
10
 
5
11
  # Exit codes and wrappers
@@ -102,7 +102,7 @@ A claim is only as good as the signal behind it — a build result, a test run,
102
102
 
103
103
  # Application profile
104
104
 
105
- > **Building an application on Cratis?** Project layout, slice types, slice naming, the seventeen slice rules, the implementation workflow and the application quality gates are in [application-profile.md](./application-profile.md), which loads only for repositories that select an application profile. If you are contributing to a Cratis framework repo, see **Framework profile** below.
105
+ > **Building an application on Cratis?** Project layout, slice types, slice naming, the seventeen slice rules, the implementation workflow and the application quality gates are in [application-profile.md](./application-profile.md), which is scoped to source files in every supported language and to `.play` models and is installed only for repositories that select an application profile; read it before starting application work. If you are contributing to a Cratis framework repo, see **Framework profile** below.
106
106
 
107
107
  **Model first.** When an accepted `.play` model covers the scope, or the repository has opted in, the `.play` model is the source of truth for behavior: change the model first, verify it, then render it or gap-fill from it, and never edit Stage-managed output, take code as a shortcut around the model, or weaken protection (authorization, `@pii`, rules) to make a model compile or render. Opted in means the model root (the folder holding the project's `.play` files) holds a committed `.play` file (`git ls-tree -r --name-only HEAD` lists a `.play` file there, narrowed to `-- <root>` when a root is configured), or the project explicitly set `mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install output, an installed profile or skill, a `.play` file outside the root or an untracked or uncommitted draft is not opt-in, and a behavior is a contract only when an accepted model under the root covers it (accepted means committed: staged or untracked files under the root are drafts; a committed file with uncommitted working-tree edits is a model change in progress, and its HEAD version is the contract until the change is committed; committing a model under the root is the team's act of acceptance and opts the repository in; an explicitly configured but empty root also counts as opted in). Otherwise stay code-first; the entry-point session may propose a model at most once per session (never for trivial, bug-fix, infrastructure, client, framework or brownfield-maintenance work), and infrastructure, client and adapter work stays in code at any level. Trivial changes keep the proportional-delegation policy. The master decision rule is in **cratis-screenplay-modeling-lifecycle** (router: **cratis-screenplay-event-modeling**); if the Screenplay skills are not installed, say so and do not author `.play` from memory.
108
108
 
@@ -129,7 +129,9 @@ A claim is only as good as the signal behind it — a build result, a test run,
129
129
  | **AI Corpus Profiles** — what profiles exist and how to configure them | `profiles.md` |
130
130
  | **Contributing to a Cratis framework repo** (framework profile) | `framework.md`; creating a repository in the Cratis organization: `new-repository-intake.md` |
131
131
  | Slice anatomy (commands, `Provide()`, validators, events, projections, read models, reactors, constraints, compliance, cross-slice) | `vertical-slices.md` |
132
- | C# / TypeScript style | `csharp.md`, `typescript.md` |
132
+ | C# / TypeScript style and code-quality principles | `csharp.md`, `typescript.md`, `code-quality.md`, `code-quality.csharp.md`, `code-quality.typescript.md` |
133
+ | Kotlin / Java / Elixir style; Orleans grains; reactors; GitHub Actions workflows | `kotlin.md`, `java.md`, `elixir.md`, `orleans.md`, `reactors.md`, `github-actions.md` |
134
+ | Documentation pages (`Documentation/`): structure, voice, examples, editing | `documentation.md`, `documentation-structure-and-formatting.md`, `writing-cratis-docs.md`, `editing-cratis-docs.md`, `writing-correct-examples.md` |
133
135
  | Go style, source and module files | `go.md`; framework contributors also read `go-engineering.md`; product APIs use `cratis-chronicle-client-go`, `cratis-arc-go` and `cratis-fundamentals-concept-go` |
134
136
  | Service lifetimes — why anything taking a scoped dependency is scoped or transient, never a singleton | `csharp.md` |
135
137
  | React + Arc + Cratis Components + MVVM + dialogs | `react.md`, `components.md`, `dialogs.md` |
@@ -141,15 +143,15 @@ A claim is only as good as the signal behind it — a build result, a test run,
141
143
  | 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*) |
142
144
  | 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 |
143
145
  | EF Core read models / migrations | `efcore.md`, `efcore.specs.md` |
144
- | PRs / commits | `pull-requests.md`, `git-commits.md` |
146
+ | Before writing a commit message, committing, pushing or opening/editing a PR: read both | `git-commits.md`, `pull-requests.md` |
145
147
  | Reading, citing and superseding a decision record | the **cratis-engineering-decision-record** skill |
146
148
  | Whether you are allowed to do the thing you are able to do | `capability-is-not-authority.md` |
147
149
  | What must stop and ask a human | `capability-is-not-authority.md` (absent authority for a consequential effect: stop and ask) |
148
150
  | What counts as evidence that something works | `verification-discipline.md` |
149
- | Where session notes, plans and handovers may live | `local-work-artifacts.md` |
151
+ | Before writing a session note, plan or handover: where they may live (`.ai-work/` only) | `local-work-artifacts.md` |
150
152
  | What may be written into the `.cratis/` folder (configuration and the corpus only, never deliverables) | `cratis-folder-is-configuration.md` |
151
- | Exit-code meaning and wrappers that lose a verdict | `exit-codes-and-wrappers.md` |
152
- | Writing a scan, allowlist or destructive pass that cannot pass vacuously | `guards-and-fuses.md` |
153
+ | Exit-code meaning, scripts and wrappers that lose a verdict | `exit-codes-and-wrappers.md` |
154
+ | Writing a scan, allowlist, script or CI check, or a destructive pass, that cannot pass vacuously | `guards-and-fuses.md` |
153
155
  | How the shared corpus is installed, updated and rolled back | `ai-distribution.md` |
154
156
  | Code-level event modeling / schema migration / calling commands from code / paging / cross-cutting metadata / multi-tenancy | the matching skills |
155
157
  | Building or changing behavior in an opted-in repository (see Model first above), or designing an information system, business process or information flow: **model first** | the **cratis-screenplay-event-modeling** skill (decision rule), then **cratis-screenplay-modeling-lifecycle** and one phase skill; per-surface `cratis-screenplay-*` skills for syntax |
@@ -1,5 +1,11 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/*.sh,**/*.ps1,**/scripts/**,**/.github/workflows/**,**/.cratis/ai/hooks/**"
3
+ paths:
4
+ - "**/*.sh"
5
+ - "**/*.ps1"
6
+ - "**/scripts/**"
7
+ - "**/.github/workflows/**"
8
+ - "**/.cratis/ai/hooks/**"
3
9
  ---
4
10
 
5
11
  # Guards, scans and fuses
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.51.1",
3
+ "version": "7.51.2",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [
package/src/index.ts CHANGED
@@ -83,11 +83,19 @@ function ruleMatchesConfiguration(path: string, content: string, configuration:
83
83
  const needsCSharp = applyTo.includes('.cs');
84
84
  const needsTypeScript = applyTo.includes('.ts') || path.endsWith('/rtk.md');
85
85
  const needsGo = applyTo.includes('.go') || applyTo.includes('go.mod') || applyTo.includes('go.sum');
86
+ const needsKotlin = applyTo.includes('.kt');
87
+ const needsJava = applyTo.includes('.java');
88
+ const needsElixir = applyTo.includes('.ex');
86
89
  const needsDocumentation = applyTo.includes('md');
87
- if (!needsCSharp && !needsTypeScript && !needsGo && !needsDocumentation) return true;
90
+ // A scope that also names model files (`.play`) is not tied to one language, so it is always kept.
91
+ if (applyTo.includes('.play')) return true;
92
+ if (!needsCSharp && !needsTypeScript && !needsGo && !needsKotlin && !needsJava && !needsElixir && !needsDocumentation) return true;
88
93
  return (needsCSharp && languages.includes('csharp')) ||
89
94
  (needsTypeScript && languages.includes('typescript')) ||
90
95
  (needsGo && languages.includes('go')) ||
96
+ (needsKotlin && languages.includes('kotlin')) ||
97
+ (needsJava && languages.includes('java')) ||
98
+ (needsElixir && languages.includes('elixir')) ||
91
99
  (needsDocumentation && selectedProfiles.includes('cratis/documentation'));
92
100
  }
93
101