@cratis/pi 7.100.0 → 7.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/package/corpus/agents/backend-developer.md +1 -0
  2. package/package/corpus/agents/browser-operator.md +44 -0
  3. package/package/corpus/agents/code-reviewer.md +4 -0
  4. package/package/corpus/agents/coordinator.md +1 -0
  5. package/package/corpus/agents/frontend-developer.md +1 -0
  6. package/package/corpus/agents/orchestrator.md +1 -0
  7. package/package/corpus/agents/performance-reviewer.md +4 -0
  8. package/package/corpus/agents/planner.md +1 -0
  9. package/package/corpus/agents/repository-investigation-reviewer.md +4 -0
  10. package/package/corpus/agents/repository-investigator.md +1 -0
  11. package/package/corpus/agents/screenplay-modeler.md +1 -0
  12. package/package/corpus/agents/screenplay-renderer.md +1 -0
  13. package/package/corpus/agents/screenplay-reviewer.md +4 -0
  14. package/package/corpus/agents/security-reviewer.md +4 -0
  15. package/package/corpus/agents/slice-implementer.md +1 -0
  16. package/package/corpus/agents/spec-writer.md +1 -0
  17. package/package/corpus/harnesses/copilot/instructions/browser.instructions.md +46 -0
  18. package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +17 -0
  19. package/package/corpus/harnesses/copilot/instructions/local-work-artifacts.instructions.md +3 -0
  20. package/package/corpus/harnesses/copilot/instructions/review-reports.instructions.md +11 -0
  21. package/package/corpus/harnesses/copilot/instructions/secrets.instructions.md +35 -0
  22. package/package/corpus/harnesses/pi/agents/backend-developer.md +1 -0
  23. package/package/corpus/harnesses/pi/agents/browser-operator.md +41 -0
  24. package/package/corpus/harnesses/pi/agents/code-reviewer.md +4 -0
  25. package/package/corpus/harnesses/pi/agents/coordinator.md +1 -0
  26. package/package/corpus/harnesses/pi/agents/frontend-developer.md +1 -0
  27. package/package/corpus/harnesses/pi/agents/orchestrator.md +1 -0
  28. package/package/corpus/harnesses/pi/agents/performance-reviewer.md +4 -0
  29. package/package/corpus/harnesses/pi/agents/planner.md +1 -0
  30. package/package/corpus/harnesses/pi/agents/repository-investigation-reviewer.md +4 -0
  31. package/package/corpus/harnesses/pi/agents/repository-investigator.md +1 -0
  32. package/package/corpus/harnesses/pi/agents/screenplay-modeler.md +1 -0
  33. package/package/corpus/harnesses/pi/agents/screenplay-renderer.md +1 -0
  34. package/package/corpus/harnesses/pi/agents/screenplay-reviewer.md +4 -0
  35. package/package/corpus/harnesses/pi/agents/security-reviewer.md +4 -0
  36. package/package/corpus/harnesses/pi/agents/slice-implementer.md +1 -0
  37. package/package/corpus/harnesses/pi/agents/spec-writer.md +1 -0
  38. package/package/corpus/harnesses/pi/extensions/cratis-hooks/index.ts +19 -6
  39. package/package/corpus/harnesses/pi/extensions/cratis-hooks/quality-gate.ts +10 -1
  40. package/package/corpus/hooks/README.md +8 -0
  41. package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +458 -0
  42. package/package/corpus/hooks/settings.template.json +4 -0
  43. package/package/corpus/rules/browser.md +45 -0
  44. package/package/corpus/rules/general.md +2 -0
  45. package/package/corpus/rules/github-actions.md +17 -0
  46. package/package/corpus/rules/local-work-artifacts.md +3 -0
  47. package/package/corpus/rules/review-reports.md +11 -0
  48. package/package/corpus/rules/secrets.md +34 -0
  49. package/package/corpus/skills/cratis-ci-pipeline-performance/LICENSE +2 -0
  50. package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +201 -0
  51. package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +158 -0
  52. package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +86 -0
  53. package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +70 -0
  54. package/package/corpus/skills/cratis-ci-pipeline-performance/references/publish-pipelines.md +67 -0
  55. package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +117 -0
  56. package/package/corpus/skills/cratis-ci-pipeline-performance/references/runner-sizing-and-images.md +65 -0
  57. package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +73 -0
  58. package/package/corpus/skills/cratis-ci-pipeline-performance/references/sources.md +33 -0
  59. package/package/corpus/skills/cratis-ci-pipeline-performance/references/test-setup-cost.md +82 -0
  60. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/ci-timings.sh +356 -0
  61. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/fixtures/jobs/1003.json +79 -0
  62. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/fixtures/jobs/1007.json +79 -0
  63. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/fixtures/jobs/1010.json +79 -0
  64. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/fixtures/runs.json +102 -0
  65. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/LICENSE +2 -0
  66. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +244 -0
  67. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +86 -0
  68. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +87 -0
  69. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/go-jvm-python-elixir.md +83 -0
  70. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/npm-yarn.md +78 -0
  71. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +60 -0
  72. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +97 -0
  73. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/scripts/cratis-local-packages.sh +778 -0
  74. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/scripts/npm-restore-check.cjs +109 -0
  75. package/package/profile-catalog.json +2 -0
  76. package/package.json +3 -2
@@ -0,0 +1,102 @@
1
+ [
2
+ {
3
+ "databaseId": 1001,
4
+ "event": "pull_request",
5
+ "headBranch": "feat",
6
+ "status": "completed",
7
+ "conclusion": "success",
8
+ "attempt": 1,
9
+ "createdAt": "2030-01-01T01:00:00Z",
10
+ "updatedAt": "2030-01-01T01:10:00Z"
11
+ },
12
+ {
13
+ "databaseId": 1002,
14
+ "event": "pull_request",
15
+ "headBranch": "feat",
16
+ "status": "completed",
17
+ "conclusion": "success",
18
+ "attempt": 1,
19
+ "createdAt": "2030-01-01T02:00:00Z",
20
+ "updatedAt": "2030-01-01T02:20:00Z"
21
+ },
22
+ {
23
+ "databaseId": 1003,
24
+ "event": "pull_request",
25
+ "headBranch": "feat",
26
+ "status": "completed",
27
+ "conclusion": "success",
28
+ "attempt": 1,
29
+ "createdAt": "2030-01-01T03:00:00Z",
30
+ "updatedAt": "2030-01-01T03:30:00Z"
31
+ },
32
+ {
33
+ "databaseId": 1004,
34
+ "event": "pull_request",
35
+ "headBranch": "feat",
36
+ "status": "completed",
37
+ "conclusion": "failure",
38
+ "attempt": 1,
39
+ "createdAt": "2030-01-01T04:00:00Z",
40
+ "updatedAt": "2030-01-01T04:05:00Z"
41
+ },
42
+ {
43
+ "databaseId": 1005,
44
+ "event": "pull_request",
45
+ "headBranch": "feat",
46
+ "status": "completed",
47
+ "conclusion": "cancelled",
48
+ "attempt": 1,
49
+ "createdAt": "2030-01-01T05:00:00Z",
50
+ "updatedAt": "2030-01-01T05:02:00Z"
51
+ },
52
+ {
53
+ "databaseId": 1006,
54
+ "event": "pull_request",
55
+ "headBranch": "feat",
56
+ "status": "completed",
57
+ "conclusion": "success",
58
+ "attempt": 2,
59
+ "createdAt": "2030-01-01T06:00:00Z",
60
+ "updatedAt": "2030-01-01T06:40:00Z"
61
+ },
62
+ {
63
+ "databaseId": 1007,
64
+ "event": "push",
65
+ "headBranch": "main",
66
+ "status": "completed",
67
+ "conclusion": "success",
68
+ "attempt": 1,
69
+ "createdAt": "2030-01-01T07:00:00Z",
70
+ "updatedAt": "2030-01-01T07:15:00Z"
71
+ },
72
+ {
73
+ "databaseId": 1008,
74
+ "event": "pull_request",
75
+ "headBranch": "feat",
76
+ "status": "completed",
77
+ "conclusion": "skipped",
78
+ "attempt": 1,
79
+ "createdAt": "2030-01-01T08:00:00Z",
80
+ "updatedAt": "2030-01-01T08:00:00Z"
81
+ },
82
+ {
83
+ "databaseId": 1009,
84
+ "event": "pull_request",
85
+ "headBranch": "feat",
86
+ "status": "in_progress",
87
+ "conclusion": "",
88
+ "attempt": 1,
89
+ "createdAt": "2030-01-01T09:00:00Z",
90
+ "updatedAt": "2030-01-01T09:01:00Z"
91
+ },
92
+ {
93
+ "databaseId": 1010,
94
+ "event": "pull_request",
95
+ "headBranch": "feat",
96
+ "status": "completed",
97
+ "conclusion": "success",
98
+ "attempt": 1,
99
+ "createdAt": "2030-01-01T10:00:00Z",
100
+ "updatedAt": "2030-01-01T10:25:00Z"
101
+ }
102
+ ]
@@ -0,0 +1,2 @@
1
+ Copyright (c) Cratis. All rights reserved.
2
+ Licensed under the MIT license. See LICENSE file in the canonical Cratis/AI repository for the full license text.
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: cratis-engineering-local-cross-repo-verification
3
+ description: Proves lower-layer Cratis fixes in downstream repositories using local packages and images. Use when a lower-layer fix must be proven in a consumer, before the producer PR for a consumer bug, before requesting or waiting on a release, or when reproducing a consumer bug against lower-layer main. Not for single-repo changes, released-version pin bumps, CI changes, or shipping; use the ship-changes prompt for shipping and cratis-release-notes for release text.
4
+ license: LICENSE
5
+ compatibility: Bash and git on macOS or Linux; Windows through WSL. Requires the ecosystem tools used by the selected recipe.
6
+ ---
7
+
8
+ <!-- Copyright (c) Cratis. All rights reserved. -->
9
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
10
+
11
+ # Local cross-repository verification
12
+
13
+ ## Decide before waiting
14
+
15
+ Use real locally built packages to prove a producer fix at its consumer's package
16
+ boundary. A **producer** builds the changed library or image; a **consumer** is the
17
+ downstream repository that reproduces the bug. Start before opening the producer
18
+ PR whose purpose is that consumer bug, rather than publishing just to find out.
19
+ Also use this loop to compare the consumer against lower-layer main.
20
+
21
+ **Local verification replaces waiting, not shipping.** After local proof, release
22
+ the producer through the normal authorized workflow and bump the consumer to the
23
+ released version. Local feeds, pins and images never go into production or a PR.
24
+ Single-repository work needs its own regression specs, not this overlay. Released
25
+ pin updates use ordinary dependency maintenance; CI changes use the
26
+ [github-actions rule](../../rules/github-actions.md). Shipping uses the
27
+ [ship-changes prompt](../../prompts/ship-changes.prompt.md); release text uses
28
+ [cratis-release-notes](../cratis-release-notes/SKILL.md).
29
+
30
+ ## Prepare
31
+
32
+ Execute [scripts/cratis-local-packages.sh](scripts/cratis-local-packages.sh), not
33
+ an improvised replacement. Run `bash "$local" <command> --help` for inputs and
34
+ errors. Requires bash and git; add dotnet for NuGet, node and Yarn for npm, Docker
35
+ for images, or the selected language toolchain. Check availability first:
36
+
37
+ ```bash
38
+ local=/absolute/path/to/skill/scripts/cratis-local-packages.sh
39
+ producer=/absolute/path/to/producer
40
+ consumer=/absolute/path/to/consumer
41
+ bash --version
42
+ git --version
43
+ command -v dotnet # substitute node/yarn/docker for the selected recipe
44
+ ```
45
+
46
+ The helper works with macOS bash 3.2 and Linux; Windows requires WSL. Match kernel
47
+ publish RID and image architecture to the consumer daemon: `linux-arm64` and
48
+ `arm64`, or `linux-x64` and `amd64`. Do not claim performance equivalence from a
49
+ Debug build or across architectures.
50
+
51
+ Check disk space and preserve existing edits in both repositories. Use an isolated
52
+ worktree when a build regenerates tracked output. Inspect the consumer's own CI
53
+ commands before choosing the build, regression spec and full gate commands.
54
+
55
+ ## Copy this checklist
56
+
57
+ - [ ] Reproduce the consumer bug and select its regression spec/app action.
58
+ - [ ] Generate one stamp; build and pack the producer's full dependency closure.
59
+ - [ ] If needed, publish the kernel and assets, then build a matching local image.
60
+ - [ ] Activate the consumer overlay and select the local image.
61
+ - [ ] Build the consumer, run its regression specs/app action and required gates.
62
+ - [ ] On failure, diagnose, fix the producer, create a distinct stamp and repeat.
63
+ - [ ] Run `check` before every consumer commit and push, and on the producer.
64
+ - [ ] Restore overlays, unset environment overrides, and run `check` again.
65
+ - [ ] Review stamp-scoped `clean` dry-run targets, then apply cleanup.
66
+
67
+ ### 1. Stamp
68
+
69
+ ```bash
70
+ stamp=$(bash "$local" stamp "$producer")
71
+ ```
72
+
73
+ Format: `<next-patch>-local.<12-digit-UTC-minute>.g<sha7>`, based on the highest reachable
74
+ `vX.Y.Z` tag. Next-patch prereleases sort above the existing release; arbitrary
75
+ `0.0.0-local` versions can violate transitive minimums and cause **NU1605**
76
+ downgrades. Confirm tags cover the consumer's released constraints. With no tag,
77
+ the helper warns and falls back to a base that must be checked before proceeding.
78
+ The `g` prefix keeps even an all-digit SHA nonnumeric in SemVer.
79
+ Use the identical stamp for packages and images. A changed build needs a distinct
80
+ stamp; do not overwrite a cached version (the minute and commit determine it).
81
+
82
+ ### 2. Build and pack
83
+
84
+ Run the producer's CI-equivalent build/specs first. NuGet packing builds in Release:
85
+
86
+ ```bash
87
+ bash "$local" pack-nuget "$producer" "$stamp" path/to/producer.slnx
88
+ ```
89
+
90
+ For npm, complete the repository build before
91
+ `bash "$local" pack-npm "$producer" "$stamp"`. Pass: nonzero package count and
92
+ exit `0`. Inspect package dependencies: every locally changed dependency ID must
93
+ resolve to the stamp, not a published fallback. Chronicle's client solution filter
94
+ can omit `Cratis.Chronicle.CodeAnalysis`; pack its code-analysis package project
95
+ separately. A successful pack alone does not prove dependency closure.
96
+
97
+ ### 3. Build an image when needed
98
+
99
+ Follow the kernel recipe below before building; it needs published binaries and
100
+ Workbench `wwwroot`. From the producer root, for the selected architecture:
101
+
102
+ ```bash
103
+ docker build -f Docker/DevelopmentSlim/Dockerfile \
104
+ -t "cratis/chronicle:$stamp-development-slim" .
105
+ docker image inspect "cratis/chronicle:$stamp-development-slim"
106
+ ```
107
+
108
+ Pass: build exits `0` and inspection shows the expected tag and architecture.
109
+ Never push these images. Testcontainers uses a local image when the selected tag
110
+ exists in its daemon; ensure the test process uses that same daemon.
111
+
112
+ ### 4. Use in the consumer
113
+
114
+ ```bash
115
+ bash "$local" use-nuget "$consumer" "$stamp" Cratis.Chronicle
116
+ # Source the absolute session/env path printed by use-nuget.
117
+ # For npm instead: bash "$local" use-npm "$consumer" "$stamp"
118
+ export CHRONICLE_KERNEL_VERSION="$stamp" # Studio integration specs, if used
119
+ ```
120
+
121
+ Pass: the helper reports overridden IDs and restore resolves them to local
122
+ artifacts. Follow any printed `--configfile` instruction. Run Yarn install after
123
+ `use-npm`; it adds file-tarball resolutions, not links to source folders.
124
+
125
+ ### 5. Build and exercise the consumer
126
+
127
+ From the consumer root, with the printed NuGet environment sourced:
128
+
129
+ ```bash
130
+ dotnet build path/to/consumer.slnx -c Release -warnaserror
131
+ dotnet test path/to/Integration.csproj -c Release --no-build --filter '<regression>'
132
+ ```
133
+
134
+ Substitute the repository's actual commands; for frontend fixes run build, lint,
135
+ specs and the previously broken UI action. Pass: the reproducing spec/action now
136
+ succeeds, at least one intended filtered spec actually ran, and the consumer's
137
+ required CI-equivalent gates pass. Zero matched tests is not proof. Studio local
138
+ Debug builds skip analyzers: pass its full-build switch when matching CI. Read the recipe
139
+ for that switch. On failure, change the producer and repeat with a distinct stamp;
140
+ do not request a release to debug the next round.
141
+
142
+ ### 6. Check before commit or push
143
+
144
+ ```bash
145
+ bash "$local" check "$consumer"
146
+ bash "$local" check "$producer"
147
+ ```
148
+
149
+ Pass: exit `0`, reported file count, `0 leaks`. The scan examines added/changed
150
+ tracked lines against HEAD (or `--staged`) plus non-ignored untracked file contents.
151
+ It detects stamped local versions, the configured feed path, NuGet overlay/source
152
+ properties, package-version updates and local npm file/link/portal references.
153
+ It does not inspect committed history, ignored files, active shell variables or
154
+ all resolved dependencies. A clean diff can report zero files; it is not proof
155
+ that the overlay was inactive. Inspect actual resolution and restore explicitly.
156
+
157
+ ### 7. Restore
158
+
159
+ ```bash
160
+ bash "$local" restore "$consumer"
161
+ unset DirectoryPackagesPropsPath RestoreAdditionalProjectSources CHRONICLE_KERNEL_VERSION
162
+ bash "$local" check "$consumer"
163
+ ```
164
+
165
+ Pass: restoration exits `0`, local overlay files are removed and `check` reports
166
+ `0 leaks`. npm restore accepts overlay-only resolutions and local tarball lockfile
167
+ entries after Yarn install; unrelated edits are refused with backups retained.
168
+ Review conflicts and restore only overlay changes manually, then retry. Never
169
+ overwrite unrelated work. Reinstall released npm dependencies
170
+ and clear image/compose/Gradle selection too. Check the producer for codegen drift;
171
+ Workbench builds can regenerate tracked proxies. Prefer a throwaway worktree, or
172
+ use `git checkout -- <generated-path>` only after proving those edits are disposable
173
+ build output, not pre-existing work.
174
+
175
+ ### 8. Clean
176
+
177
+ ```bash
178
+ bash "$local" clean "$consumer" --stamp "$stamp"
179
+ # Review listed subjects and stop task-owned containers first.
180
+ bash "$local" clean "$consumer" --stamp "$stamp" --apply
181
+ ```
182
+
183
+ Pass: expected subjects listed, then removed without force. Cleanup covers local
184
+ feed packages, NuGet version folders, discoverable Yarn cache entries, local image
185
+ tags and registered sessions; unresolved npm backups block it. Missing Docker/Yarn
186
+ probes are reported as skipped cleanup, not proof those stores are empty. Default
187
+ fuse: 500 subjects; investigate an unexpectedly large list instead of raising it.
188
+ Prefer `--stamp` to `--all` on shared machines.
189
+
190
+ ## Configuration and results
191
+
192
+ The trusted shell config `${XDG_CONFIG_HOME:-$HOME/.config}/cratis/local-packages.env`
193
+ is sourced before defaults. Do not put credentials in it. Environment settings:
194
+
195
+ | Setting | Default / purpose |
196
+ | --- | --- |
197
+ | `CRATIS_LOCAL_FEED` | `${XDG_CACHE_HOME:-$HOME/.cache}/cratis/local-feed`; outside tracked files |
198
+ | `CRATIS_LOCAL_SESSION_DIR` | `<absolute-git-dir>/cratis-local`; per-worktree overlays/backups |
199
+ | `NUGET_PACKAGES` | `$HOME/.nuget/packages`; shared cache, unique version folders |
200
+ | `CRATIS_LOCAL_CLEAN_MAX` | `500`; cleanup subject fuse |
201
+ | `CRATIS_LOCAL_RUN` | Optional executable wrapper receiving `build <label> -- <command...>` |
202
+
203
+ If the environment has a build queue wrapper, set `CRATIS_LOCAL_RUN` to its absolute
204
+ executable path. The helper wraps pack steps only; run other heavy builds, image
205
+ builds and container specs through that environment's wrapper separately. No queue
206
+ wrapper is required by the corpus. Global `--dry-run` prints mutations while still
207
+ doing read-only discovery.
208
+
209
+ Helper exit codes: `0` success, `1` findings/failed operation, `2` cannot run or
210
+ invalid input. Neither `1` nor `2` is a pass. After script changes, execute
211
+ `bash "$local" --self-test`; pass requires printed passed/skipped counts and exit
212
+ `0`. npm overlay/restore tests run when node is on the inherited PATH; real packing
213
+ is not exercised by this hermetic self-test. Report any unrun ecosystem checks.
214
+
215
+ ## Why the local loop
216
+
217
+ A release chain runs producer PR, producer CI and publication, then a consumer
218
+ pin bump and consumer CI, with hand-offs between each step. For a Chronicle fix
219
+ consumed by Studio that is roughly 15–25 minutes of publishing, a bump pull
220
+ request and another 20–30 minutes of consumer CI, and in practice hours of
221
+ latency between them. A fix that turns out not to work repeats all of it.
222
+
223
+ The local loop for the same chain, in run time: packing the client packages
224
+ about 1–2 minutes, publishing the kernel a few minutes, building the image
225
+ seconds with a warm layer cache, building the consumer's spec project about
226
+ 6 minutes, and an integration spec class seconds to minutes. Every iteration
227
+ stays local. A shared build queue adds its own waiting time on top; that is
228
+ machine load, not part of the loop.
229
+
230
+ The loop also surfaces incompatibilities before anything ships: a consumer that
231
+ does not yet supply what a newer kernel requires at startup fails here, in
232
+ minutes, instead of after a release and a pin bump.
233
+
234
+ ## Conditional recipes
235
+
236
+ - Read [references/dotnet-nuget.md](references/dotnet-nuget.md) when using NuGet, CPM, source mapping or IDE restore.
237
+ - Read [references/npm-yarn.md](references/npm-yarn.md) when packing frontend libraries or restoring Yarn overlays.
238
+ - Read [references/docker-images.md](references/docker-images.md) when publishing a kernel or selecting images in a consumer.
239
+ - Read [references/go-jvm-python-elixir.md](references/go-jvm-python-elixir.md) when the boundary uses another language toolchain.
240
+ - Read [references/worked-examples.md](references/worked-examples.md) when following Chronicle → Studio, Fundamentals → Arc or Components → Studio.
241
+ - Read [references/other-environments.md](references/other-environments.md) when running on another developer machine or an agent host.
242
+
243
+ Read `scripts/npm-restore-check.cjs` when inspecting the read-only npm restoration
244
+ guard; `restore` executes it when npm files differ from the saved overlay state.
@@ -0,0 +1,86 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # Docker images
5
+
6
+ ## Chronicle kernel
7
+
8
+ Use the producer's current Dockerfile as the source for build inputs. For
9
+ `Docker/DevelopmentSlim/Dockerfile`, both published kernel output and Workbench
10
+ assets must exist before `docker build`. From the Chronicle root:
11
+
12
+ ```bash
13
+ # Native arm64 daemon; use linux-x64 and out/x64 for an amd64 daemon.
14
+ dotnet publish Source/Kernel/Server/Server.csproj -c Release -r linux-arm64 \
15
+ -p:PublishReadyToRun=true -p:DefineConstants=DEVELOPMENT \
16
+ -o Source/Kernel/Server/out/arm64 \
17
+ "-p:Version=$stamp" "-p:PackageVersion=$stamp"
18
+ cd Source/Workbench
19
+ yarn install --immutable
20
+ yarn build
21
+ cd ../..
22
+ docker build --platform linux/arm64 -f Docker/DevelopmentSlim/Dockerfile \
23
+ -t "cratis/chronicle:$stamp-development-slim" .
24
+ docker image inspect "cratis/chronicle:$stamp-development-slim"
25
+ ```
26
+
27
+ Run each heavy command through the host's queue wrapper when one exists. The
28
+ Workbench build produces `Source/Workbench/wwwroot`; do not substitute an empty
29
+ folder to get a green Docker build. Its build can regenerate tracked proxies.
30
+ Check the diff immediately; use an isolated worktree or revert only known
31
+ disposable generated drift before repeating. A broad checkout can destroy work.
32
+
33
+ Keep the development publish flags aligned with the producer's CI: the
34
+ `DEVELOPMENT` constant enables test reset APIs; ReadyToRun affects throughput.
35
+ The Docker copy script selects `out/arm64` or `out/x64` according to the image
36
+ architecture. Keep the publish RID, output folder and Docker platform aligned.
37
+ The development-slim image has no embedded MongoDB: the test/compose network must
38
+ supply it. `Docker/Development/Dockerfile` is the bundled-development alternative;
39
+ build it with `-f Docker/Development/Dockerfile` and tag it
40
+ `cratis/chronicle:$stamp-development`. Inspect its current inputs too; do not
41
+ substitute that tag for a fixture requiring `-development-slim`. Debug vs Release builds can differ materially in throughput; keep
42
+ Release for comparable kernel performance and state the actual architecture.
43
+
44
+ ## Consumer selection
45
+
46
+ Studio integration specs select the local stamped kernel through:
47
+
48
+ ```bash
49
+ export CHRONICLE_KERNEL_VERSION="$stamp"
50
+ # Run Studio's actual regression spec and integration gates in this shell.
51
+ ```
52
+
53
+ Its fixture selects `cratis/chronicle:<version>-development-slim`. Do not put the
54
+ suffix in `CHRONICLE_KERNEL_VERSION` twice. Testcontainers can use the pre-existing
55
+ tag without a registry push. Inspect its logs to confirm that tag was started;
56
+ a custom pull policy may override local reuse. The image must be in the daemon
57
+ the test process actually uses, not merely another Docker context.
58
+
59
+ Chronicle Aspire hosting follows the package version for kernel image selection:
60
+ consume the stamped Aspire package too, and ensure its selected image suffix
61
+ exists locally. Inspect the generated resource/image configuration rather than
62
+ assuming Studio's environment override applies to Aspire.
63
+
64
+ Kotlin consumers with the kernel-image Gradle option can pass the full local tag:
65
+
66
+ ```bash
67
+ ./gradlew test "-PchronicleKernelImage=cratis/chronicle:$stamp-development-slim"
68
+ ```
69
+
70
+ Confirm that the consumer build actually wires this property into its fixture;
71
+ Gradle can accept unused project properties without selecting another image.
72
+
73
+ Other consumers can use an untracked compose override with the stamped `image:`
74
+ value, or their fixture's documented image option. Run `docker compose config`
75
+ with the same compose files/options to inspect the resulting selection. Never
76
+ commit a local tag or push the image as part of local proof.
77
+
78
+ ## Stop, restore, clean
79
+
80
+ After proof, stop task-owned containers, unset `CHRONICLE_KERNEL_VERSION`, remove
81
+ only task-owned compose overrides and run the helper's `restore` plus `check`.
82
+ Review `clean --stamp "$stamp"` and then `clean --stamp "$stamp" --apply`.
83
+ The helper lists matching tags and runs `docker rmi` without force; images still
84
+ in use can fail removal. Resolve the owning container instead of adding `-f`.
85
+ A Docker probe unavailable or over its deadline is a reported skip, not evidence
86
+ that no local tags remain. Do not replace this with global Docker pruning.
@@ -0,0 +1,87 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # .NET and NuGet
5
+
6
+ ## CPM overlay
7
+
8
+ Execute the helper from the entry point. `pack-nuget PRODUCER STAMP TARGET...`
9
+ passes `PackageVersion` and `Version` to Release `dotnet pack`. Use the entire
10
+ changed dependency closure, not just the top-level package. Unchanged dependencies
11
+ may remain released; inspect the resulting nuspec and restore graph to distinguish
12
+ them from an accidental published fallback.
13
+
14
+ `use-nuget CONSUMER STAMP [ID...]` requires a root `Directory.Packages.props`.
15
+ Without IDs it selects every package with `<id>.<stamp>.nupkg` in the feed,
16
+ including transitive dependencies absent from the consumer props. The generated
17
+ overlay imports the consumer's real props, uses `PackageVersion Update` for IDs
18
+ already pinned there and `PackageVersion Include` for the others, and enables
19
+ `CentralPackageTransitivePinningEnabled` so the added IDs pin transitive packages.
20
+ An `Update` alone cannot add an absent ID. It does not copy or edit the props in git.
21
+
22
+ ```bash
23
+ bash "$local" use-nuget "$consumer" "$stamp" Cratis.Chronicle Cratis.Chronicle.CodeAnalysis
24
+ # Source the absolute env path printed by the command.
25
+ source /absolute/session/path/env
26
+ cd "$consumer"
27
+ dotnet restore path/to/consumer.slnx
28
+ dotnet build path/to/consumer.slnx -c Release --no-restore -warnaserror
29
+ ```
30
+
31
+ The printed properties are `DirectoryPackagesPropsPath` and
32
+ `RestoreAdditionalProjectSources`. For an IDE, launch it from that shell, or pass
33
+ the printed `-p:` properties explicitly to its build. Verify restore uses the
34
+ stamp in `obj/project.assets.json`; shell environment changes do not reconfigure
35
+ an already-running IDE. A config overlay printed below must also reach IDE restore.
36
+
37
+ The `CRATIS_LOCAL_RUN` adapter applies to pack steps, not these restore/build
38
+ commands; route each heavy command separately through the host's build queue.
39
+
40
+ ## Source mapping
41
+
42
+ If a tracked root NuGet config has `packageSourceMapping`, the helper prints an
43
+ additional restore command with `--configfile <session>/nuget.config`. Use it.
44
+ The generated config preserves existing entries, makes relative sources absolute,
45
+ adds a `cratis-local` source, removes exact selected-ID mappings from remote
46
+ sources, and maps those IDs exactly to the local source. Exact local matches take
47
+ precedence over wildcard patterns. Inspect the generated config and restore output
48
+ for nested/imported/unsupported configuration; do not assume this is a general
49
+ NuGet XML rewriter. An incomplete mapping or existing `cratis-local` key is refused.
50
+
51
+ ## Versions and cache
52
+
53
+ Generate a fresh stamp with the helper, not `0.0.0-local`. The next-patch prerelease
54
+ must sort above the versions required transitively or NuGet may report NU1605.
55
+ A stale highest tag or dependency with a newer minimum needs investigation, not a
56
+ warning suppression. The suffix is `-local.<12-digit-UTC-minute>.g<sha7>`; the `g` prefix makes an
57
+ all-digit SHA unambiguously nonnumeric in SemVer. Dirty edits are not encoded.
58
+ Wait for a distinct UTC minute or commit before repacking changed contents.
59
+
60
+ The existing global cache is shared safely only because local versions have
61
+ unique directories. Do not repack changed bits under the same version. Use
62
+ `clean --stamp "$stamp"` to list that stamp's version folders, then `--apply`
63
+ after review; do not delete the entire NuGet cache.
64
+
65
+ ## Non-CPM escape
66
+
67
+ The helper refuses a consumer without root CPM props. Use an untracked isolated
68
+ project/worktree copy with explicit `PackageReference` versions and restore with
69
+ `--source "$CRATIS_LOCAL_FEED/nuget"` plus the normal remote sources. Supply every
70
+ needed source because `--source` replaces configured sources. Inspect the resolved
71
+ graph. Never edit versions intended to ship merely to make local proof work.
72
+
73
+ ## Restoration and drift
74
+
75
+ `restore` removes session props, generated config and env files, then runs `check`.
76
+ It cannot unset variables in the calling shell:
77
+
78
+ ```bash
79
+ bash "$local" restore "$consumer"
80
+ unset DirectoryPackagesPropsPath RestoreAdditionalProjectSources
81
+ bash "$local" check "$consumer"
82
+ ```
83
+
84
+ Inspect producer and consumer diffs. Workbench builds in particular can regenerate
85
+ tracked proxies. Prefer a throwaway worktree; revert only known disposable output
86
+ with `git checkout -- <generated-path>` after checking it was clean beforehand.
87
+ No blanket checkout/reset is part of this workflow.
@@ -0,0 +1,83 @@
1
+ <!-- Copyright (c) Cratis. All rights reserved. -->
2
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
3
+
4
+ # Other language boundaries
5
+
6
+ These are manual equivalents, not additional helper subcommands. Discover the
7
+ producer/consumer build conventions first. Keep local configuration outside
8
+ tracked files, preserve edits, run consumer regression specs, remove substitutions
9
+ and inspect the diff before commit/push. The helper's leak check does not recognize
10
+ all Go, Gradle, Python or Mix substitutions; manual inspection is required too.
11
+
12
+ ## Go modules
13
+
14
+ Prefer an untracked workspace for a source-level reproduction:
15
+
16
+ ```bash
17
+ # In an ignored scratch directory, using absolute producer/consumer module paths:
18
+ go work init /absolute/consumer/module /absolute/producer/module
19
+ export GOWORK="$PWD/go.work"
20
+ cd /absolute/consumer/module
21
+ go test ./...
22
+ ```
23
+
24
+ The producer's module path must match the dependency; add the actual module roots
25
+ in a multi-module repository. Alternatively use `go mod edit
26
+ -replace=example.org/producer=/absolute/producer/module` in a disposable consumer
27
+ copy. `replace` changes go.mod, so never commit it; preserve the original file and
28
+ remove only that override afterward. Workspace/replace testing does not prove a
29
+ published module archive's contents. If packaging is part of the bug, also inspect
30
+ and test the release module layout. Unset `GOWORK` and inspect go.mod/go.sum and
31
+ workspace files after proof; a scratch workspace must not be committed.
32
+
33
+ ## Kotlin / JVM
34
+
35
+ For compatible Gradle builds, use composite substitution:
36
+
37
+ ```bash
38
+ cd /absolute/consumer
39
+ ./gradlew --include-build /absolute/producer test
40
+ ```
41
+
42
+ Gradle substitutes matching project coordinates; inspect `dependencies` or
43
+ `dependencyInsight` to confirm the intended module, rather than trusting a green
44
+ task that still used a released artifact. Where composites do not match the
45
+ published layout, publish the producer's configured publications with
46
+ `./gradlew publishToMavenLocal` using `$stamp` as the configured publication
47
+ version, then select that version through an untracked consumer init
48
+ script/repository override. Configure
49
+ `mavenLocal()` only in that override and confirm effective coordinates. Do not
50
+ assume every build accepts a generic version property. Remove only that local
51
+ version's artifacts after review, not the whole Maven cache. Remove overrides and
52
+ inspect settings/build scripts and lockfiles before commit/push.
53
+
54
+ ## Python
55
+
56
+ Prefer the actual wheel for package-boundary proof, in a disposable virtualenv:
57
+
58
+ ```bash
59
+ # Requires the repository's existing build frontend; do not install tools blindly.
60
+ python -m build --wheel --outdir /absolute/scratch/wheels /absolute/producer
61
+ python -m venv /absolute/scratch/venv
62
+ /absolute/scratch/venv/bin/python -m pip install /absolute/scratch/wheels/<wheel>.whl
63
+ # Install the consumer's remaining dependencies and execute its regression tests
64
+ # with that interpreter, confirming it did not replace the selected wheel.
65
+ ```
66
+
67
+ If the consumer needs an editable install, use that environment's `pip install -e
68
+ /absolute/producer` and state that this proves source integration, not wheel
69
+ contents. Inspect installed versions and module paths; reusing a global Python
70
+ can silently exercise another copy. Never record absolute wheel/editable paths in
71
+ shipped requirements or lockfiles. Remove the task-owned virtualenv/wheels after
72
+ review and inspect the consumer diff.
73
+
74
+ ## Elixir
75
+
76
+ In an isolated consumer copy, temporarily replace the relevant Mix dependency
77
+ with its exact project name and `path: "/absolute/producer"`; use `override: true`
78
+ only where transitive resolution requires that substitution. Run `mix deps.get`
79
+ and the consumer's regression `mix test` tasks. Inspect `mix deps` for the selected
80
+ path. This tests local source, not the contents of a Hex release. Restore only the
81
+ local dependency edit and corresponding lockfile change; re-fetch released deps
82
+ before final gates. Inspect mix.exs/mix.lock and remove task-owned build/cache
83
+ outputs without deleting unrelated work.