@afokapu/atdd-bun 0.2.0 → 0.3.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.
- package/README.md +27 -1
- package/integrity.json +933 -0
- package/package.json +3 -2
- package/src/cli.ts +9 -0
- package/src/index.ts +2 -0
- package/src/integrity.ts +165 -0
- package/src/register.ts +9 -0
- package/src/setup.ts +7 -2
- package/templates/agents/AGENTS.block.md +1 -1
- package/templates/agents/atdd/SKILL.md +2 -0
- package/templates/agents/atdd-bun.integrity.test.ts +5 -0
- package/templates/github/atdd-bun.yml +1 -0
package/README.md
CHANGED
|
@@ -166,12 +166,13 @@ when they are absent. It never overwrites another hook path, an existing
|
|
|
166
166
|
generated workflow, or an existing skill unless you explicitly pass `--replace`. Installing the dependency alone deliberately does
|
|
167
167
|
neither: package installation must not mutate a repository through postinstall.
|
|
168
168
|
|
|
169
|
-
Use `hooks install`, `ci init`, or `
|
|
169
|
+
Use `hooks install`, `ci init`, `agent init`, or `integrity init` when only one surface is wanted:
|
|
170
170
|
|
|
171
171
|
```sh
|
|
172
172
|
bun run atdd-bun hooks install
|
|
173
173
|
bun run atdd-bun ci init
|
|
174
174
|
bun run atdd-bun agent init
|
|
175
|
+
bun run atdd-bun integrity init
|
|
175
176
|
```
|
|
176
177
|
|
|
177
178
|
The hooks enforce protected-branch blocking, micro-commit limits, mass-delete
|
|
@@ -230,6 +231,31 @@ it stays correct as they change; after upgrading, refresh it with
|
|
|
230
231
|
`bun run atdd-bun agent init --replace`. The skill steers the agent; the
|
|
231
232
|
profiles, hooks, and CI remain the enforcement.
|
|
232
233
|
|
|
234
|
+
## Integrity: files agents must not change
|
|
235
|
+
|
|
236
|
+
Coding agents can edit anything on the machine they run on, including
|
|
237
|
+
`node_modules/@afokapu/atdd-bun`, the files this package generates, and
|
|
238
|
+
`atdd-bun.yaml`. `init` therefore writes `atdd-bun.integrity.test.ts` (into the
|
|
239
|
+
`[test] root` from `bunfig.toml`, if one is set), and the generated CI workflow
|
|
240
|
+
runs `bun run atdd-bun integrity` before enforcement. Both run the same check:
|
|
241
|
+
|
|
242
|
+
| Checked | Canonical source | Restore |
|
|
243
|
+
|---|---|---|
|
|
244
|
+
| Every file of the installed package | `integrity.json`, the hashes published with the package | `bun install --force` |
|
|
245
|
+
| The dependency is an npm version range, locked to the registry with an integrity hash | npm | `bun add -d @afokapu/atdd-bun` |
|
|
246
|
+
| The CI workflow, both skills, the `AGENTS.md` block, and the integrity test | what the installed version generates (its version stamp is ignored) | `bun run atdd-bun init --replace` |
|
|
247
|
+
| `atdd-bun.yaml` is not looser than on the branch being merged into | the merge base; for a push to the base branch, the previous commit | `git checkout <base> -- atdd-bun.yaml` |
|
|
248
|
+
|
|
249
|
+
A failure is addressed to the agent: it lists every changed file with its
|
|
250
|
+
restore command and tells it to stop and ask a human instead of working around
|
|
251
|
+
the check. Locally, this is a reminder an agent can still ignore, because
|
|
252
|
+
anything on its machine can be edited. In CI the check runs on a clean install,
|
|
253
|
+
so its verdict cannot be faked. Loosening the policy remains possible, as a
|
|
254
|
+
separate change a human approves.
|
|
255
|
+
|
|
256
|
+
After upgrading to a version that changes generated files, run
|
|
257
|
+
`bun run atdd-bun init --replace` and commit the result.
|
|
258
|
+
|
|
233
259
|
## CI: the merge gate
|
|
234
260
|
|
|
235
261
|
Generate the repository-owned workflow with:
|