@cratis/pi 7.153.3 → 7.153.5
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/agents/backend-developer.md +1 -1
- package/package/corpus/agents/planner.md +1 -1
- package/package/corpus/agents/slice-implementer.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/application-profile.instructions.md +2 -2
- package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +2 -2
- package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +1 -1
- package/package/corpus/harnesses/pi/agents/backend-developer.md +1 -1
- package/package/corpus/harnesses/pi/agents/planner.md +1 -1
- package/package/corpus/harnesses/pi/agents/slice-implementer.md +1 -1
- package/package/corpus/hooks/README.md +9 -8
- package/package/corpus/hooks/agent-stop.md +2 -1
- package/package/corpus/hooks/scripts/quality-gates.json +7 -6
- package/package/corpus/rules/application-profile.md +2 -2
- package/package/corpus/rules/github-actions.md +2 -2
- package/package/corpus/rules/vertical-slices.md +1 -1
- package/package/corpus/skills/cratis-arc-command/references/proxy-generation.md +15 -11
- package/package/corpus/skills/cratis-arc-configuration/references/symptoms.md +1 -1
- package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +2 -2
- package/package.json +1 -1
|
@@ -55,7 +55,7 @@ Load **cratis-application-slice-conformance** when it is installed; read the ski
|
|
|
55
55
|
1. **Determine the namespace root** by reading an existing source file to identify the convention (e.g. `Studio`, `Library`, `MyApp`).
|
|
56
56
|
2. **Read existing slices** in the same feature to understand naming, existing concepts, and events you may reference.
|
|
57
57
|
3. **Create a single `.cs` file** at `<Feature>/<Slice>/<Slice>.cs` (under the app source root; an optional `<Module>/` may group the feature — there is **no** top-level `Features/` wrapper).
|
|
58
|
-
4. **Validate** by building Debug *and* Release (Debug regenerates the TypeScript proxies and compiles `#if DEBUG` spec code; build Release with `-p:CratisProxiesOutputPath=` to skip re-running proxy generation).
|
|
58
|
+
4. **Validate** by building Debug *and* Release (Debug regenerates the TypeScript proxies and compiles `#if DEBUG` spec code; build Release with `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) to skip re-running proxy generation).
|
|
59
59
|
5. Fix all compiler errors and warnings before handing back.
|
|
60
60
|
|
|
61
61
|
---
|
|
@@ -89,7 +89,7 @@ For an explicitly requested large application scope, adapt this optional numbere
|
|
|
89
89
|
|
|
90
90
|
### Phase 3 — Build [run: Debug, then Release]
|
|
91
91
|
3. Run `dotnet build -c Debug` to validate spec code and generate TypeScript proxies.
|
|
92
|
-
4. Run `dotnet build -c Release -p:CratisProxiesOutputPath=` as a build-only release check.
|
|
92
|
+
4. Run `dotnet build -c Release -p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) as a build-only release check.
|
|
93
93
|
|
|
94
94
|
### Phase 4 — Frontend [delegate to: frontend-developer]
|
|
95
95
|
5. Create React component(s) beside the slice in `<AppSourceRoot>/<Module?>/<Feature>/<Slice>/`.
|
|
@@ -71,7 +71,7 @@ Read the contract and the slice-type skills fully first; most slices need no que
|
|
|
71
71
|
Assume visibly only for non-behavioral details: missing labels use spaced command/property names; isolation may need fresh test identifiers; file placement inside the slice, conversion of invalid spec names and unspecified layout follow local conventions. Record each address, choice and consequence if wrong in the fallback record. Never infer a business name or rule from this exception. `blocked` means a person must decide, not that asking felt safer.
|
|
72
72
|
|
|
73
73
|
### Phase 2 — Backend
|
|
74
|
-
Update the existing realization or, for a new slice, write `<Module>/<Feature>/<Slice>/<Slice>.cs` with all backend artifacts (declaration order per `general.md`). **Gate:** build clean in **Debug and Release** (zero errors/warnings — Debug validates `#if DEBUG` spec code and regenerates the TypeScript proxies; build Release with `-p:CratisProxiesOutputPath=` to skip re-running proxy generation).
|
|
74
|
+
Update the existing realization or, for a new slice, write `<Module>/<Feature>/<Slice>/<Slice>.cs` with all backend artifacts (declaration order per `general.md`). **Gate:** build clean in **Debug and Release** (zero errors/warnings — Debug validates `#if DEBUG` spec code and regenerates the TypeScript proxies; build Release with `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) to skip re-running proxy generation).
|
|
75
75
|
|
|
76
76
|
### Phase 3 — Specs
|
|
77
77
|
When a slice is re-delivered (the contract gained specifications), diff the contract's specification list against the existing spec classes first: each missing specification is the work list, even when the backend is unchanged. A slice is done only when every contract specification has an executable spec that passes; there is no contract specification without a spec equivalent. A spec changes only after an approved contract revision, and unaffected assertions are preserved.
|
|
@@ -77,14 +77,14 @@ Tagged **[contract]** (framework-enforced) or **[convention]** (house default).
|
|
|
77
77
|
- **Phase 2 — Specs.** Mandatory for every slice type. Start with plain calls for pure command/validator/reducer decisions with supplied read-model state; add the scenarios the decision table in [specs.scenarios.csharp.md](./specs.scenarios.csharp.instructions.md) obligates, and follow it for shared setup and cost budgets. **Gate:** tests pass.
|
|
78
78
|
- **Phase 3 — Frontend.** Build from the generated proxies, register in the composition page, wire routing. **Gate:** lint, conditional test, build.
|
|
79
79
|
|
|
80
|
-
**Backend before frontend, always** — the frontend depends on proxies that exist only after a successful build. Generate proxies from the **Debug** build (house convention); verify Release without re-running the generator: `dotnet build -c Release -p:CratisProxiesOutputPath
|
|
80
|
+
**Backend before frontend, always** — the frontend depends on proxies that exist only after a successful build. Generate proxies from the **Debug** build (house convention); verify Release without re-running the generator: `dotnet build -c Release -p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later; the empty path covers earlier Arc). Why that property, and what to do when nothing is generated: the **cratis-arc-command** skill's proxy-generation reference.
|
|
81
81
|
|
|
82
82
|
## Quality Gates
|
|
83
83
|
|
|
84
84
|
| Phase | Command (app-pinned) | Pass criteria |
|
|
85
85
|
| --- | --- | --- |
|
|
86
86
|
| Backend | build (Debug) | zero errors, zero warnings — validates `#if DEBUG` spec code and regenerates proxies |
|
|
87
|
-
| Backend | build (Release) | zero errors, zero warnings — build-only check; pass `-p:CratisProxiesOutputPath=` to skip
|
|
87
|
+
| Backend | build (Release) | zero errors, zero warnings — build-only check; pass `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) to skip proxy generation |
|
|
88
88
|
| Specs | test | zero failures |
|
|
89
89
|
| Frontend | lint | zero errors |
|
|
90
90
|
| Frontend | test | zero failures when frontend specs/behavior changed |
|
|
@@ -106,8 +106,8 @@ capacity numbers into workflows or guidance.
|
|
|
106
106
|
## Arc proxies
|
|
107
107
|
|
|
108
108
|
- Workflows never generate Arc TypeScript proxies; the client commits them. Every `dotnet
|
|
109
|
-
build`/`publish` of an Arc project passes `-p:CratisProxiesOutputPath=`
|
|
110
|
-
|
|
109
|
+
build`/`publish` of an Arc project passes `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=`
|
|
110
|
+
(Skip needs Arc 22.185.1 or later; the empty path covers earlier Arc). See the
|
|
111
111
|
**cratis-arc-command** proxy-generation reference.
|
|
112
112
|
|
|
113
113
|
## Automation that writes back
|
|
@@ -25,7 +25,7 @@ This file is the reference for *what* goes in each part of a slice. Layout, slic
|
|
|
25
25
|
|
|
26
26
|
## Proxy generation — the build dependency
|
|
27
27
|
|
|
28
|
-
A `dotnet build` with `CratisProxiesOutputPath` set generates a typed TypeScript proxy per command and query next to the slice's `.cs` — the generator target has **no configuration condition**; running it from the Debug build is the house convention (one configuration owns the generated files, so Release never rewrites them differently). The generator reads PDB sequence points only to name output files after their source file, and only when `CratisProxiesUseSourceFileAsOutputFile` is on; Arc's own remark says which types retain that information *can differ* between Debug and Release, which is one more reason to let a single configuration generate. Until the backend compiles, **no proxy files exist** and frontend code cannot reference them. **Backend → build → frontend, always** — backend and frontend for the same slice cannot be done in parallel. When a subsequent Release build is only there to verify the app compiles in that configuration, skip proxy regeneration with `dotnet build -c Release -p:CratisProxiesOutputPath=` rather than letting it re-run the generator against a different compilation. Never edit a generated proxy (`// @generated by Cratis` header); fix the C# source and rebuild.
|
|
28
|
+
A `dotnet build` with `CratisProxiesOutputPath` set generates a typed TypeScript proxy per command and query next to the slice's `.cs` — the generator target has **no configuration condition**; running it from the Debug build is the house convention (one configuration owns the generated files, so Release never rewrites them differently). The generator reads PDB sequence points only to name output files after their source file, and only when `CratisProxiesUseSourceFileAsOutputFile` is on; Arc's own remark says which types retain that information *can differ* between Debug and Release, which is one more reason to let a single configuration generate. Until the backend compiles, **no proxy files exist** and frontend code cannot reference them. **Backend → build → frontend, always** — backend and frontend for the same slice cannot be done in parallel. When a subsequent Release build is only there to verify the app compiles in that configuration, skip proxy regeneration with `dotnet build -c Release -p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) rather than letting it re-run the generator against a different compilation. Never edit a generated proxy (`// @generated by Cratis` header); fix the C# source and rebuild.
|
|
29
29
|
|
|
30
30
|
## Model-bound — no controllers **[contract]**
|
|
31
31
|
|
|
@@ -50,7 +50,7 @@ Load **cratis-application-slice-conformance** when it is installed; read the ski
|
|
|
50
50
|
1. **Determine the namespace root** by reading an existing source file to identify the convention (e.g. `Studio`, `Library`, `MyApp`).
|
|
51
51
|
2. **Read existing slices** in the same feature to understand naming, existing concepts, and events you may reference.
|
|
52
52
|
3. **Create a single `.cs` file** at `<Feature>/<Slice>/<Slice>.cs` (under the app source root; an optional `<Module>/` may group the feature — there is **no** top-level `Features/` wrapper).
|
|
53
|
-
4. **Validate** by building Debug *and* Release (Debug regenerates the TypeScript proxies and compiles `#if DEBUG` spec code; build Release with `-p:CratisProxiesOutputPath=` to skip re-running proxy generation).
|
|
53
|
+
4. **Validate** by building Debug *and* Release (Debug regenerates the TypeScript proxies and compiles `#if DEBUG` spec code; build Release with `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) to skip re-running proxy generation).
|
|
54
54
|
5. Fix all compiler errors and warnings before handing back.
|
|
55
55
|
|
|
56
56
|
---
|
|
@@ -85,7 +85,7 @@ For an explicitly requested large application scope, adapt this optional numbere
|
|
|
85
85
|
|
|
86
86
|
### Phase 3 — Build [run: Debug, then Release]
|
|
87
87
|
3. Run `dotnet build -c Debug` to validate spec code and generate TypeScript proxies.
|
|
88
|
-
4. Run `dotnet build -c Release -p:CratisProxiesOutputPath=` as a build-only release check.
|
|
88
|
+
4. Run `dotnet build -c Release -p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) as a build-only release check.
|
|
89
89
|
|
|
90
90
|
### Phase 4 — Frontend [delegate to: frontend-developer]
|
|
91
91
|
5. Create React component(s) beside the slice in `<AppSourceRoot>/<Module?>/<Feature>/<Slice>/`.
|
|
@@ -66,7 +66,7 @@ Read the contract and the slice-type skills fully first; most slices need no que
|
|
|
66
66
|
Assume visibly only for non-behavioral details: missing labels use spaced command/property names; isolation may need fresh test identifiers; file placement inside the slice, conversion of invalid spec names and unspecified layout follow local conventions. Record each address, choice and consequence if wrong in the fallback record. Never infer a business name or rule from this exception. `blocked` means a person must decide, not that asking felt safer.
|
|
67
67
|
|
|
68
68
|
### Phase 2 — Backend
|
|
69
|
-
Update the existing realization or, for a new slice, write `<Module>/<Feature>/<Slice>/<Slice>.cs` with all backend artifacts (declaration order per `general.md`). **Gate:** build clean in **Debug and Release** (zero errors/warnings — Debug validates `#if DEBUG` spec code and regenerates the TypeScript proxies; build Release with `-p:CratisProxiesOutputPath=` to skip re-running proxy generation).
|
|
69
|
+
Update the existing realization or, for a new slice, write `<Module>/<Feature>/<Slice>/<Slice>.cs` with all backend artifacts (declaration order per `general.md`). **Gate:** build clean in **Debug and Release** (zero errors/warnings — Debug validates `#if DEBUG` spec code and regenerates the TypeScript proxies; build Release with `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) to skip re-running proxy generation).
|
|
70
70
|
|
|
71
71
|
### Phase 3 — Specs
|
|
72
72
|
When a slice is re-delivered (the contract gained specifications), diff the contract's specification list against the existing spec classes first: each missing specification is the work list, even when the backend is unchanged. A slice is done only when every contract specification has an executable spec that passes; there is no contract specification without a spec equivalent. A spec changes only after an approved contract revision, and unaffected assertions are preserved.
|
|
@@ -564,7 +564,7 @@ the managed gates running unchanged.
|
|
|
564
564
|
|
|
565
565
|
**Gated** (`Stop`, exit 2): the app-pinned commands from the Quality Gates table in
|
|
566
566
|
`general.md` and the steps in [`agent-stop.md`](./agent-stop.md) — Debug build, specs, Release
|
|
567
|
-
build (with `-p:CratisProxiesOutputPath=` per `general.md`, so the proxy generator does not
|
|
567
|
+
build (with `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` per `general.md`, so the proxy generator does not
|
|
568
568
|
re-run and touch already-correct generated files), frontend lint / compile / compile-specs /
|
|
569
569
|
test.
|
|
570
570
|
|
|
@@ -879,18 +879,19 @@ Fundamentals, Components — see [`../rules/framework.md`](../rules/framework.md
|
|
|
879
879
|
slices and should disable them in its `cratis-patterns.local.json`; a repository whose application
|
|
880
880
|
source root is not `Source/` re-scopes the `paths` globs there too.
|
|
881
881
|
|
|
882
|
-
|
|
883
|
-
`
|
|
884
|
-
`-p:
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
committed by the client, never in CI, so CI builds always
|
|
882
|
+
**`CratisProxiesSkip` is the proxy generator's off switch.** From Arc 22.185.1 the generator's
|
|
883
|
+
target runs only when `CratisProxiesOutputPath` is non-empty and `CratisProxiesSkip` is not
|
|
884
|
+
`true`, so `-p:CratisProxiesSkip=true` skips it even when the output path is set. Before 22.185.1
|
|
885
|
+
an empty `-p:CratisProxiesOutputPath=` is the off switch, and older Arc ignores `CratisProxiesSkip`
|
|
886
|
+
silently (MSBuild accepts unknown `-p:` names), so the shipped gates pass both. Proxies are
|
|
887
|
+
generated and committed by the client, never in CI, so CI builds always skip generation.
|
|
888
888
|
|
|
889
889
|
The Debug/Release split applies to the shipped client-side local gates only: Release clears the
|
|
890
890
|
path, and the committing client's Debug gate does not, because `general.md` makes the Debug build
|
|
891
891
|
the canonical trigger for regenerating the TypeScript proxies the frontend phase depends on, and
|
|
892
892
|
the client commits the result. A consuming repository's CI never copies the Debug proxy step; it
|
|
893
|
-
passes `-p:CratisProxiesOutputPath=`
|
|
893
|
+
passes `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or
|
|
894
|
+
later) in every configuration.
|
|
894
895
|
|
|
895
896
|
## Unattended runs
|
|
896
897
|
|
|
@@ -26,8 +26,9 @@ When the agent finishes a session, verify the work against **fresh signals** bef
|
|
|
26
26
|
```
|
|
27
27
|
3. **Build Release** from repository root — build-only check; skip re-running proxy generation:
|
|
28
28
|
```
|
|
29
|
-
dotnet build -c Release -p:CratisProxiesOutputPath=
|
|
29
|
+
dotnet build -c Release -p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=
|
|
30
30
|
```
|
|
31
|
+
(`CratisProxiesSkip` is Arc 22.185.1+; the empty output path covers older Arc.)
|
|
31
32
|
4. **Run specs/tests for every affected project** — use the project's test command; if you cannot isolate the affected scope, run the repository-level test command.
|
|
32
33
|
5. **Frontend** (when frontend files changed) — run lint, the type/build check, and frontend tests.
|
|
33
34
|
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
" { \"gates\": [ { \"id\": \"frontend-lint\", \"workingDirectory\": \"Source/App\" } ] }",
|
|
68
68
|
"",
|
|
69
69
|
"Commands are pinned to .cratis/ai/rules/general.md 'Quality Gates' and .cratis/ai/hooks/agent-stop.md.",
|
|
70
|
-
"Note the Release build passes -p:
|
|
71
|
-
"generator does not re-run and touch already-correct generated files.
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
70
|
+
"Note the Release build passes -p:CratisProxiesSkip=true per general.md so the proxy",
|
|
71
|
+
"generator does not re-run and touch already-correct generated files. From Arc 22.185.1 that",
|
|
72
|
+
"is the off switch: the target skips when CratisProxiesSkip is true even if the output path is",
|
|
73
|
+
"set. Older Arc ignores it silently, so the command also clears CratisProxiesOutputPath, which",
|
|
74
|
+
"older Arc honors (the target requires it to be non-empty).",
|
|
75
75
|
"The Debug/Release split is for these client-side local hooks only: the committing client's",
|
|
76
76
|
"Debug gate omits the override because general.md makes Debug the canonical proxy-regeneration",
|
|
77
77
|
"trigger, and the client commits the result. CI never copies that Debug proxy step: it passes",
|
|
78
|
-
"-p:CratisProxiesOutputPath= in every configuration."
|
|
78
|
+
"-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath= (Skip needs Arc 22.185.1 or later) in every configuration."
|
|
79
79
|
],
|
|
80
80
|
"enabled": true,
|
|
81
81
|
"failFast": true,
|
|
@@ -186,6 +186,7 @@
|
|
|
186
186
|
"build",
|
|
187
187
|
"--configuration",
|
|
188
188
|
"Release",
|
|
189
|
+
"-p:CratisProxiesSkip=true",
|
|
189
190
|
"-p:CratisProxiesOutputPath="
|
|
190
191
|
]
|
|
191
192
|
},
|
|
@@ -76,14 +76,14 @@ Tagged **[contract]** (framework-enforced) or **[convention]** (house default).
|
|
|
76
76
|
- **Phase 2 — Specs.** Mandatory for every slice type. Start with plain calls for pure command/validator/reducer decisions with supplied read-model state; add the scenarios the decision table in [specs.scenarios.csharp.md](./specs.scenarios.csharp.md) obligates, and follow it for shared setup and cost budgets. **Gate:** tests pass.
|
|
77
77
|
- **Phase 3 — Frontend.** Build from the generated proxies, register in the composition page, wire routing. **Gate:** lint, conditional test, build.
|
|
78
78
|
|
|
79
|
-
**Backend before frontend, always** — the frontend depends on proxies that exist only after a successful build. Generate proxies from the **Debug** build (house convention); verify Release without re-running the generator: `dotnet build -c Release -p:CratisProxiesOutputPath
|
|
79
|
+
**Backend before frontend, always** — the frontend depends on proxies that exist only after a successful build. Generate proxies from the **Debug** build (house convention); verify Release without re-running the generator: `dotnet build -c Release -p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later; the empty path covers earlier Arc). Why that property, and what to do when nothing is generated: the **cratis-arc-command** skill's proxy-generation reference.
|
|
80
80
|
|
|
81
81
|
## Quality Gates
|
|
82
82
|
|
|
83
83
|
| Phase | Command (app-pinned) | Pass criteria |
|
|
84
84
|
| --- | --- | --- |
|
|
85
85
|
| Backend | build (Debug) | zero errors, zero warnings — validates `#if DEBUG` spec code and regenerates proxies |
|
|
86
|
-
| Backend | build (Release) | zero errors, zero warnings — build-only check; pass `-p:CratisProxiesOutputPath=` to skip
|
|
86
|
+
| Backend | build (Release) | zero errors, zero warnings — build-only check; pass `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) to skip proxy generation |
|
|
87
87
|
| Specs | test | zero failures |
|
|
88
88
|
| Frontend | lint | zero errors |
|
|
89
89
|
| Frontend | test | zero failures when frontend specs/behavior changed |
|
|
@@ -105,8 +105,8 @@ capacity numbers into workflows or guidance.
|
|
|
105
105
|
## Arc proxies
|
|
106
106
|
|
|
107
107
|
- Workflows never generate Arc TypeScript proxies; the client commits them. Every `dotnet
|
|
108
|
-
build`/`publish` of an Arc project passes `-p:CratisProxiesOutputPath=`
|
|
109
|
-
|
|
108
|
+
build`/`publish` of an Arc project passes `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=`
|
|
109
|
+
(Skip needs Arc 22.185.1 or later; the empty path covers earlier Arc). See the
|
|
110
110
|
**cratis-arc-command** proxy-generation reference.
|
|
111
111
|
|
|
112
112
|
## Automation that writes back
|
|
@@ -24,7 +24,7 @@ This file is the reference for *what* goes in each part of a slice. Layout, slic
|
|
|
24
24
|
|
|
25
25
|
## Proxy generation — the build dependency
|
|
26
26
|
|
|
27
|
-
A `dotnet build` with `CratisProxiesOutputPath` set generates a typed TypeScript proxy per command and query next to the slice's `.cs` — the generator target has **no configuration condition**; running it from the Debug build is the house convention (one configuration owns the generated files, so Release never rewrites them differently). The generator reads PDB sequence points only to name output files after their source file, and only when `CratisProxiesUseSourceFileAsOutputFile` is on; Arc's own remark says which types retain that information *can differ* between Debug and Release, which is one more reason to let a single configuration generate. Until the backend compiles, **no proxy files exist** and frontend code cannot reference them. **Backend → build → frontend, always** — backend and frontend for the same slice cannot be done in parallel. When a subsequent Release build is only there to verify the app compiles in that configuration, skip proxy regeneration with `dotnet build -c Release -p:CratisProxiesOutputPath=` rather than letting it re-run the generator against a different compilation. Never edit a generated proxy (`// @generated by Cratis` header); fix the C# source and rebuild.
|
|
27
|
+
A `dotnet build` with `CratisProxiesOutputPath` set generates a typed TypeScript proxy per command and query next to the slice's `.cs` — the generator target has **no configuration condition**; running it from the Debug build is the house convention (one configuration owns the generated files, so Release never rewrites them differently). The generator reads PDB sequence points only to name output files after their source file, and only when `CratisProxiesUseSourceFileAsOutputFile` is on; Arc's own remark says which types retain that information *can differ* between Debug and Release, which is one more reason to let a single configuration generate. Until the backend compiles, **no proxy files exist** and frontend code cannot reference them. **Backend → build → frontend, always** — backend and frontend for the same slice cannot be done in parallel. When a subsequent Release build is only there to verify the app compiles in that configuration, skip proxy regeneration with `dotnet build -c Release -p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=` (Skip needs Arc 22.185.1 or later) rather than letting it re-run the generator against a different compilation. Never edit a generated proxy (`// @generated by Cratis` header); fix the C# source and rebuild.
|
|
28
28
|
|
|
29
29
|
## Model-bound — no controllers **[contract]**
|
|
30
30
|
|
|
@@ -28,7 +28,8 @@ queries and read models, and set an output path:
|
|
|
28
28
|
Install `@cratis/arc` and `@cratis/arc.react` on the frontend side.
|
|
29
29
|
|
|
30
30
|
The package adds a `CratisProxyGenerator` target that runs `AfterTargets="AfterBuild"`,
|
|
31
|
-
and its condition is `'$(CratisProxiesOutputPath)' != ''
|
|
31
|
+
and its condition is `'$(CratisProxiesOutputPath)' != '' and '$(CratisProxiesSkip)' != 'true'
|
|
32
|
+
and '$(DisableProxyGenerator)' != 'true'` (earlier Arc checks only the path). **A missing output
|
|
32
33
|
path is not an error — the target simply never runs and nothing is generated.**
|
|
33
34
|
That is the first thing to check when a build succeeds but no proxies appear.
|
|
34
35
|
|
|
@@ -48,6 +49,7 @@ switches without a declared default are off when absent.
|
|
|
48
49
|
| Property | Default | Effect |
|
|
49
50
|
| --- | --- | --- |
|
|
50
51
|
| `CratisProxiesOutputPath` | empty | Where to write. Empty disables generation entirely |
|
|
52
|
+
| `CratisProxiesSkip` | off | `true` skips the generator even when the output path is set (see Skipping generation) |
|
|
51
53
|
| `CratisProxiesInputAssembly` | empty | Overrides the assembly to read |
|
|
52
54
|
| `CratisProxiesIncremental` | `true` | Requires Arc 22.138.0; reuse unchanged owned output; set `false` to regenerate every build |
|
|
53
55
|
| `CratisProxiesFileHeader` | project setting | Requires Arc 22.123.0; otherwise uses `.editorconfig` `file_header_template`, or no header; `none` disables it |
|
|
@@ -106,16 +108,18 @@ On the frontend, the generated route already starts with the API prefix.
|
|
|
106
108
|
changes a command or query builds Debug, generates the proxies and commits them
|
|
107
109
|
with the change. CI builds compile against the committed proxies; a CI build that
|
|
108
110
|
regenerates them produces diffs nobody commits or drift that exists only on the
|
|
109
|
-
runner. Every CI build of an Arc project passes `-p:
|
|
110
|
-
|
|
111
|
+
runner. Every CI build of an Arc project passes `-p:CratisProxiesSkip=true
|
|
112
|
+
-p:CratisProxiesOutputPath=` in every configuration.
|
|
111
113
|
|
|
112
|
-
`-p:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
`
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
Requires Arc 22.185.1 or later for `-p:CratisProxiesSkip=true`, Arc's off switch; fall
|
|
115
|
+
back to an empty `-p:CratisProxiesOutputPath=` on older Arc.
|
|
116
|
+
|
|
117
|
+
The `CratisProxyGenerator` target runs only when `CratisProxiesOutputPath` is non-empty
|
|
118
|
+
and `CratisProxiesSkip` is not `true`, so Skip works even when the project sets the
|
|
119
|
+
output path. Older Arc ignores `CratisProxiesSkip` silently (MSBuild accepts unknown
|
|
120
|
+
`-p:` names), so a build that must work on both passes both. Prefer `CratisProxiesSkip`;
|
|
121
|
+
`DisableProxyGenerator` is only an alias of it in current Arc, and elsewhere works only
|
|
122
|
+
where a repository defines it (the Chronicle kernel `Core.csproj` does).
|
|
119
123
|
|
|
120
124
|
## What the generator extracts for client-side validation
|
|
121
125
|
|
|
@@ -153,7 +157,7 @@ property.
|
|
|
153
157
|
|
|
154
158
|
| Symptom | Cause |
|
|
155
159
|
| --- | --- |
|
|
156
|
-
| Nothing is generated | `CratisProxiesOutputPath` is unset, or the project did not build |
|
|
160
|
+
| Nothing is generated | `CratisProxiesOutputPath` is unset, `CratisProxiesSkip` is `true`, or the project did not build |
|
|
157
161
|
| Files appear under an unexpected folder | The folder mirrors the namespace; change the namespace or use `NamespaceRoot`/`CratisProxiesSegmentsToSkip` |
|
|
158
162
|
| Stale proxies after a rename | `dotnet clean` then `dotnet build`; the generator does not delete by default |
|
|
159
163
|
| A rule validates on the server but not in the browser | The rule is not in the extractable set above |
|
|
@@ -4,7 +4,7 @@ Each row is a first hypothesis; confirm before changing.
|
|
|
4
4
|
|
|
5
5
|
| Symptom | Setting to check |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| Build succeeds but no TypeScript proxies appear | `CratisProxiesOutputPath` is empty; the generator target runs only when
|
|
7
|
+
| Build succeeds but no TypeScript proxies appear | `CratisProxiesOutputPath` is empty, or `-p:CratisProxiesSkip=true` is set; the generator target runs only when the path is set and Skip is not `true` |
|
|
8
8
|
| Generated client calls return 404 | Generator and host route settings differ: prefix, segments to skip, name inclusion (skip and include are inverses) |
|
|
9
9
|
| Requests go to the wrong path behind a gateway | `apiBasePath` duplicated `/api` or missing the deployment prefix; `origin` bypassing the dev proxy |
|
|
10
10
|
| Every request is anonymous after `AddCratis()`; endpoints return 401 | `TrustForwardedIdentityHeaders` is `false` by default; enable only behind an ingress that authenticates and replaces the headers |
|
|
@@ -60,8 +60,8 @@ before an external effect. A request to verify does not authorize a push.
|
|
|
60
60
|
and API regeneration checks; never hand-edit generated files. A package bump
|
|
61
61
|
regenerates the checked-in snapshots that pin versions, in the same commit.
|
|
62
62
|
Arc TypeScript proxies are generated and committed by the client, never in CI:
|
|
63
|
-
CI, and local gates that mirror CI, pass `-p:CratisProxiesOutputPath=`
|
|
64
|
-
the
|
|
63
|
+
CI, and local gates that mirror CI, pass `-p:CratisProxiesSkip=true -p:CratisProxiesOutputPath=`
|
|
64
|
+
(Skip needs Arc 22.185.1 or later; the empty path covers earlier Arc); only the
|
|
65
65
|
client's own Debug hook regenerates proxies. See the
|
|
66
66
|
**cratis-arc-command** proxy-generation reference.
|
|
67
67
|
|