repo-build-skill 0.1.0 → 0.1.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.
@@ -4,13 +4,13 @@
4
4
  "name": "Auny LLC"
5
5
  },
6
6
  "metadata": {
7
- "version": "0.1.0",
7
+ "version": "0.1.2",
8
8
  "description": "Skill pack that teaches your AI to build, release and launch a GitHub repo: stack pick, README, AGENTS.md, llms.txt, repo SEO and AEO, trusted publishing."
9
9
  },
10
10
  "plugins": [
11
11
  {
12
12
  "name": "repo-build-skill",
13
- "version": "0.1.0",
13
+ "version": "0.1.2",
14
14
  "description": "Skill pack that teaches your AI to build, release and launch a GitHub repo: stack pick, README, AGENTS.md, llms.txt, repo SEO and AEO, trusted publishing.",
15
15
  "author": {
16
16
  "name": "Auny LLC"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-build-skill",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Skill pack that teaches your AI to build, release and launch a GitHub repo: stack pick, README, AGENTS.md, llms.txt, repo SEO and AEO, trusted publishing.",
5
5
  "author": {
6
6
  "name": "Auny LLC"
package/CHANGELOG.md CHANGED
@@ -6,6 +6,25 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.2] - 2026-10-19
10
+
11
+ ### Added
12
+
13
+ - `set sync` vendors the set drift-check wrapper `scripts/check-set.mjs` and pins its sha256 as `check_sha256` in `.repo-build/set.lock.json`. The wrapper compares the renderer and set data hashes before it imports the renderer, then checks the README and llms.txt blocks offline.
14
+
15
+ ### Changed
16
+
17
+ - `S_DRIFT` fails when the vendored wrapper differs from its pin, is missing or is a symlink. A lock written before 0.1.2 still passes and names the `set sync` upgrade.
18
+ - `set sync` checks that every destination is absent or a regular file before its first write, so a refused path leaves the tree untouched.
19
+
20
+ ## [0.1.1] - 2026-10-19
21
+
22
+ ### Changed
23
+
24
+ - Published from GitHub Actions with npm provenance through trusted publishing. The package contents match 0.1.0.
25
+
26
+ ## [0.1.0] - 2026-10-19
27
+
9
28
  ### Added
10
29
 
11
30
  - The 0.1.0 skill pack teaches framing, stack choice, scaffolding, writing, discovery, release, site planning, launch and maintenance.
@@ -16,4 +35,7 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
16
35
  - Public synthetic outcome fixtures and dated package measurements make claims reproducible.
17
36
  - Release, proof refresh and repository health workflows document the maintenance loop.
18
37
 
19
- [Unreleased]: https://github.com/aunysillyme/repo-build-skill/commits/main/
38
+ [Unreleased]: https://github.com/aunysillyme/repo-build-skill/compare/v0.1.2...HEAD
39
+ [0.1.2]: https://github.com/aunysillyme/repo-build-skill/compare/v0.1.1...v0.1.2
40
+ [0.1.1]: https://github.com/aunysillyme/repo-build-skill/compare/b10da76...v0.1.1
41
+ [0.1.0]: https://github.com/aunysillyme/repo-build-skill/tree/b10da76
package/REPO_SETTINGS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Repository settings
2
2
 
3
3
  These values were set and read back with `gh api` in the public flip pass on 2026-10-19.
4
- The npm row is read back after the first registry publish.
4
+ The npm row was read back after 0.1.1 published from GitHub Actions on 2026-10-19.
5
5
 
6
6
  ## Metadata
7
7
 
@@ -31,7 +31,7 @@ Use GitHub's default repository link preview.
31
31
  | Administrator enforcement | Disabled for maintainer-reviewed automation PRs | `false` |
32
32
  | Sponsorships | Enabled with account-default funding links | `hasSponsorshipsEnabled: true` |
33
33
  | Description and topics | Match package.json and facts.json | description equal, 20 topics |
34
- | npm listing | Version, description, README, bin, funding and homepage match the tag | read back after the first publish |
34
+ | npm listing | Version, description, README, bin, funding and homepage match the tag | `0.1.1` equals tag `v0.1.1` (`scripts/verify-registry.sh` PASS), provenance attested |
35
35
 
36
36
  The [Scaffold settings instructions](skills/repo-build-skill/references/stages/03-scaffold.md#settings-at-the-public-flip) provide the exact API commands.
37
37
  Run `npx repo-build-skill check . --online` after setting the public values.
package/docs/RULES.md CHANGED
@@ -8,7 +8,7 @@ Why: The first screen gives the reader a definition.
8
8
 
9
9
  Pass: A bold lead in the first ten lines equals facts.lead.
10
10
 
11
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/01-frame.md#gate)
11
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/01-frame.md#gate)
12
12
 
13
13
  ## H_INSTALL: Install on the first screen
14
14
 
@@ -18,7 +18,7 @@ Why: A reader can try the project immediately.
18
18
 
19
19
  Pass: The install command occurs in the first forty lines.
20
20
 
21
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
21
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
22
22
 
23
23
  ## H_FENCE: Short front-page examples
24
24
 
@@ -28,7 +28,7 @@ Why: Short examples leave room for what the tool gives.
28
28
 
29
29
  Pass: Fenced README blocks have at most eight lines or a reasoned allow marker.
30
30
 
31
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
31
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
32
32
 
33
33
  ## H_FAQ: Common questions answer searches
34
34
 
@@ -38,7 +38,7 @@ Why: Question headings make answers easy to find.
38
38
 
39
39
  Pass: Common questions contains four to six H3 headings.
40
40
 
41
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
41
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
42
42
 
43
43
  ## H_UNINSTALL: Explain removal
44
44
 
@@ -48,7 +48,7 @@ Why: People can reverse an install.
48
48
 
49
49
  Pass: An installer has an uninstall command in README.
50
50
 
51
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/02-stack.md#gate)
51
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/02-stack.md#gate)
52
52
 
53
53
  ## H_FLOOR: Professional repository files
54
54
 
@@ -58,7 +58,7 @@ Why: Community files explain use, contribution and maintenance.
58
58
 
59
59
  Pass: Every floor file, issue form and check workflow is present and non-empty.
60
60
 
61
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
61
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
62
62
 
63
63
  ## H_LINK: Local links resolve
64
64
 
@@ -68,7 +68,7 @@ Why: Readers can follow the promised next step.
68
68
 
69
69
  Pass: Relative Markdown links and heading anchors exist.
70
70
 
71
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
71
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
72
72
 
73
73
  ## H_ABSENCE: Headings name useful content
74
74
 
@@ -78,7 +78,7 @@ Why: Positive headings say what the reader gets.
78
78
 
79
79
  Pass: Headings describe the content they give.
80
80
 
81
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
81
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
82
82
 
83
83
  ## A_AGENTS: Agent instructions cover use and contribution
84
84
 
@@ -88,7 +88,7 @@ Why: Agents need commands and project context.
88
88
 
89
89
  Pass: AGENTS.md has use and contribute headings and fewer than 200 lines.
90
90
 
91
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
91
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
92
92
 
93
93
  ## A_IMPORT: One agent instruction source
94
94
 
@@ -98,7 +98,7 @@ Why: An import keeps host instructions in sync.
98
98
 
99
99
  Pass: CLAUDE.md includes the exact line @AGENTS.md.
100
100
 
101
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
101
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
102
102
 
103
103
  ## A_CMD: Documented script commands exist
104
104
 
@@ -108,7 +108,7 @@ Why: A command should work when copied.
108
108
 
109
109
  Pass: Every npm run command named in AGENTS.md exists in package scripts.
110
110
 
111
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
111
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
112
112
 
113
113
  ## A_SKILL_SPEC: Skills follow the portable format
114
114
 
@@ -118,7 +118,7 @@ Why: A host can identify a skill from its metadata.
118
118
 
119
119
  Pass: Each SKILL.md has a valid name, description and size.
120
120
 
121
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
121
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
122
122
 
123
123
  ## M_LLMS_SHAPE: A readable llms.txt index
124
124
 
@@ -128,7 +128,7 @@ Why: Agents and search readers get a labelled map.
128
128
 
129
129
  Pass: An H1, blockquote and sections with labelled absolute links exist.
130
130
 
131
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
131
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
132
132
 
133
133
  ## M_LLMS_LEAD: One lead across readers
134
134
 
@@ -138,7 +138,7 @@ Why: A shared definition keeps summaries accurate.
138
138
 
139
139
  Pass: The llms.txt blockquote equals facts.lead.
140
140
 
141
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md#gate)
141
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md#gate)
142
142
 
143
143
  ## M_ENTITY: One product name
144
144
 
@@ -148,7 +148,7 @@ Why: One entity name keeps registry and repository answers aligned.
148
148
 
149
149
  Pass: README and llms.txt H1 headings equal the manifest product name.
150
150
 
151
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/05-discover.md#gate)
151
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/05-discover.md#gate)
152
152
 
153
153
  ## R_DESC: One compact description
154
154
 
@@ -158,7 +158,7 @@ Why: Search cards use the same definition as the package.
158
158
 
159
159
  Pass: Description has at most 160 characters and all declared copies agree.
160
160
 
161
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/05-discover.md#gate)
161
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/05-discover.md#gate)
162
162
 
163
163
  ## R_TOPICS: Search topics use registry keywords
164
164
 
@@ -168,7 +168,7 @@ Why: Topics describe the same package across surfaces.
168
168
 
169
169
  Pass: At most twenty slug topics, each also a keyword.
170
170
 
171
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/05-discover.md#gate)
171
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/05-discover.md#gate)
172
172
 
173
173
  ## R_META: Package metadata connects its surfaces
174
174
 
@@ -178,7 +178,7 @@ Why: People can find the project, license and support route.
178
178
 
179
179
  Pass: Homepage, repository, bugs and license fields are present.
180
180
 
181
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
181
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
182
182
 
183
183
  ## R_VERSION: Version sites agree
184
184
 
@@ -188,7 +188,7 @@ Why: The same release is named on every package surface.
188
188
 
189
189
  Pass: Manifest, lock and plugin versions equal package version.
190
190
 
191
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/06-release.md#gate)
191
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/06-release.md#gate)
192
192
 
193
193
  ## R_FILES: Publish only the reviewed files
194
194
 
@@ -198,7 +198,7 @@ Why: An allowlist defines what a user receives.
198
198
 
199
199
  Pass: A files allowlist covers binary targets and lifecycle install scripts are absent.
200
200
 
201
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/06-release.md#gate)
201
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/06-release.md#gate)
202
202
 
203
203
  ## W_PERMS: Declare least privilege
204
204
 
@@ -208,7 +208,7 @@ Why: A default read token limits a compromised step.
208
208
 
209
209
  Pass: Every workflow declares read-only or empty default permissions.
210
210
 
211
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
211
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
212
212
 
213
213
  ## W_OIDC: Publish identity stays in the publish job
214
214
 
@@ -218,7 +218,7 @@ Why: Identity permission belongs to the release step that needs it.
218
218
 
219
219
  Pass: Only a job named publish declares id-token: write, and it runs no install, build or package script.
220
220
 
221
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/06-release.md#gate)
221
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/06-release.md#gate)
222
222
 
223
223
  ## W_PIN: Actions use full SHA pins and version comments
224
224
 
@@ -228,7 +228,7 @@ Why: A commit pin identifies the exact action code.
228
228
 
229
229
  Pass: Every remote action uses forty hex characters and a version comment.
230
230
 
231
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
231
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
232
232
 
233
233
  ## W_CREDS: Keep credentials and caches out of release runs
234
234
 
@@ -238,7 +238,7 @@ Why: Later commands need only their explicit permissions, and a tag release must
238
238
 
239
239
  Pass: Each checkout step sets persist-credentials: false, and a tag-triggered workflow turns package-manager caching off.
240
240
 
241
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
241
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
242
242
 
243
243
  ## W_INJECT: Treat event values as data
244
244
 
@@ -248,7 +248,7 @@ Why: Untrusted event text must not become shell code.
248
248
 
249
249
  Pass: No event, head_ref or input interpolation appears in run values or github-script bodies.
250
250
 
251
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
251
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
252
252
 
253
253
  ## W_TAG: Check the release tag before publishing
254
254
 
@@ -258,7 +258,7 @@ Why: A tag must identify the artifact version being published.
258
258
 
259
259
  Pass: A version comparison precedes the publish job or publish command.
260
260
 
261
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/06-release.md#gate)
261
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/06-release.md#gate)
262
262
 
263
263
  ## P_PATH: Keep home paths private
264
264
 
@@ -268,7 +268,7 @@ Why: Local usernames are private environment details.
268
268
 
269
269
  Pass: Home paths use placeholder usernames in contents and filenames.
270
270
 
271
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
271
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
272
272
 
273
273
  ## P_EMAIL: Publish only approved contact addresses
274
274
 
@@ -278,7 +278,7 @@ Why: A contact address should be an explicit public choice.
278
278
 
279
279
  Pass: Email addresses are in the allowlist or a standard example or noreply domain.
280
280
 
281
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
281
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
282
282
 
283
283
  ## P_TOKEN: Keep token-shaped values private
284
284
 
@@ -288,7 +288,7 @@ Why: A public artifact must not carry access credentials.
288
288
 
289
289
  Pass: Token-shaped strings and private key headers are absent.
290
290
 
291
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
291
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
292
292
 
293
293
  ## P_LIST: Apply the maintainer privacy lists
294
294
 
@@ -298,7 +298,7 @@ Why: Private names are supplied locally by the maintainer.
298
298
 
299
299
  Pass: Untracked list files contain no matches in the public tree or history.
300
300
 
301
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
301
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
302
302
 
303
303
  ## F_PROOF: Dated package measurements
304
304
 
@@ -308,7 +308,7 @@ Why: A dated command lets a reader reproduce a number.
308
308
 
309
309
  Pass: Each row records value, unit, command, measured, expires, package_version and subject package.
310
310
 
311
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/09-maintain.md#gate)
311
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/09-maintain.md#gate)
312
312
 
313
313
  ## C_CREDITS: Credit upstream work
314
314
 
@@ -318,7 +318,7 @@ Why: A licence and source link preserve the origin of a technique.
318
318
 
319
319
  Pass: Credits rows contain project, link, licence and use, and README links CREDITS.md.
320
320
 
321
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/09-maintain.md#gate)
321
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/09-maintain.md#gate)
322
322
 
323
323
  ## S_DRIFT: Rendered set blocks match the vendor files
324
324
 
@@ -326,9 +326,9 @@ Reader: registries. Stage: 09-maintain. Severity: error.
326
326
 
327
327
  Why: One renderer keeps related repository descriptions aligned.
328
328
 
329
- Pass: README, llms.txt and renderer hash equal the vendored contract.
329
+ Pass: README, llms.txt, renderer and check wrapper hashes equal the vendored contract.
330
330
 
331
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/09-maintain.md#gate)
331
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/09-maintain.md#gate)
332
332
 
333
333
  ## S_STALE: The set lock matches its source
334
334
 
@@ -338,7 +338,7 @@ Why: A maintainer can refresh an adopted set when its source changes.
338
338
 
339
339
  Pass: The fetched source hash equals the lock hash.
340
340
 
341
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/09-maintain.md#gate)
341
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/09-maintain.md#gate)
342
342
 
343
343
  ## O_ABOUT: GitHub About matches facts
344
344
 
@@ -348,7 +348,7 @@ Why: Search readers see the same identity on GitHub.
348
348
 
349
349
  Pass: Description, homepage and topics match the facts source.
350
350
 
351
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/05-discover.md#gate)
351
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/05-discover.md#gate)
352
352
 
353
353
  ## O_REGISTRY: Registry listing matches its tag
354
354
 
@@ -358,7 +358,7 @@ Why: A registry receipt proves the published artifact.
358
358
 
359
359
  Pass: Version, description, tagged README and attestation agree.
360
360
 
361
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/06-release.md#gate)
361
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/06-release.md#gate)
362
362
 
363
363
  ## O_PVR: Private vulnerability reports are enabled
364
364
 
@@ -368,4 +368,4 @@ Why: Security reports have a private route.
368
368
 
369
369
  Pass: Public GitHub repositories enable private vulnerability reporting.
370
370
 
371
- Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
371
+ Learn: [Stage reference](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md#gate)
@@ -10,7 +10,7 @@ description: "Teaches you to frame, pick a stack for, scaffold, write, release a
10
10
  license: MIT
11
11
  compatibility: "Web access for each stage's live re-check; without it the work proceeds and marks those facts UNVERIFIED."
12
12
  metadata:
13
- version: "0.1.0"
13
+ version: "0.1.2"
14
14
  ---
15
15
 
16
16
  # Repository build skill
@@ -1274,7 +1274,7 @@ Rows begin BLOCKED. Attach actual output or a dated manual receipt before assign
1274
1274
  |---|---|---|
1275
1275
  | F_PROOF | Unmet requirement: Each row records value, unit, command, measured, expires, package_version and subject package. | F_PROOF: checker receipt, initially BLOCKED |
1276
1276
  | C_CREDITS | Unmet requirement: Credits rows contain project, link, licence and use, and README links CREDITS.md. | C_CREDITS: checker receipt, initially BLOCKED |
1277
- | S_DRIFT | Unmet requirement: README, llms.txt and renderer hash equal the vendored contract. | S_DRIFT: checker receipt, initially BLOCKED |
1277
+ | S_DRIFT | Unmet requirement: README, llms.txt, renderer and check wrapper hashes equal the vendored contract. | S_DRIFT: checker receipt, initially BLOCKED |
1278
1278
  | S_STALE | Unmet requirement: The fetched source hash equals the lock hash. | S_STALE: checker receipt, initially BLOCKED |
1279
1279
  <!-- gate:end -->
1280
1280
 
package/llms.txt CHANGED
@@ -6,48 +6,48 @@ Install: `npx repo-build-skill`
6
6
 
7
7
  ## Docs
8
8
 
9
- - [repo-build-skill](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/README.md): repo-build-skill
10
- - [Documentation](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/docs/README.md): Documentation
11
- - [Installer contract](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/docs/INSTALLER.md): Installer contract
12
- - [Repository checker](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/docs/CHECKER.md): Repository checker
13
- - [Evaluation and package proof](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/docs/EVALUATION.md): Evaluation and package proof
14
- - [Repository checks](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/docs/RULES.md): Repository checks
15
- - [Stack card](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/docs/STACK.md): Stack card
9
+ - [repo-build-skill](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/README.md): repo-build-skill
10
+ - [Documentation](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/docs/README.md): Documentation
11
+ - [Installer contract](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/docs/INSTALLER.md): Installer contract
12
+ - [Repository checker](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/docs/CHECKER.md): Repository checker
13
+ - [Evaluation and package proof](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/docs/EVALUATION.md): Evaluation and package proof
14
+ - [Repository checks](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/docs/RULES.md): Repository checks
15
+ - [Stack card](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/docs/STACK.md): Stack card
16
16
 
17
17
  ## Reference
18
18
 
19
- - [Repository build skill](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/SKILL.md): Repository build skill
20
- - [Acceptance checks](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/acceptance-checks.md): Acceptance checks
21
- - [Ask date](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/ask-date.md): Ask date
22
- - [Discoverability](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/discoverability.md): Discoverability
23
- - [Installer](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/installer.md): Installer
24
- - [Launch venues](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/launch-venues.md): Launch venues
25
- - [Coding agents](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/readers/agents.md): Coding agents
26
- - [Answer engines](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/readers/answer-engines.md): Answer engines
27
- - [People](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/readers/people.md): People
28
- - [Registries](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/readers/registries.md): Registries
29
- - [Binary releases](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/release/binaries.md): Binary releases
30
- - [Release contract](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/release/contract.md): Release contract
31
- - [npm release](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/release/npm.md): npm release
32
- - [PyPI release](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/release/pypi.md): PyPI release
33
- - [Skills and plugins release](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/release/skills-and-plugins.md): Skills and plugins release
34
- - [Cloudflare Workers release](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/release/workers.md): Cloudflare Workers release
35
- - [Frame](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/01-frame.md): Frame
36
- - [Stack card](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/02-stack.md): Stack card
37
- - [Scaffold](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/03-scaffold.md): Scaffold
38
- - [README / AGENTS.md / llms.txt](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/04-write.md): README / AGENTS.md / llms.txt
39
- - [SEO and AEO for repos](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/05-discover.md): SEO and AEO for repos
40
- - [Release with trusted publishing](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/06-release.md): Release with trusted publishing
41
- - [Product site](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/07-site.md): Product site
42
- - [Launch venues](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/08-launch.md): Launch venues
43
- - [Maintenance](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/skills/repo-build-skill/references/stages/09-maintain.md): Maintenance
19
+ - [Repository build skill](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/SKILL.md): Repository build skill
20
+ - [Acceptance checks](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/acceptance-checks.md): Acceptance checks
21
+ - [Ask date](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/ask-date.md): Ask date
22
+ - [Discoverability](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/discoverability.md): Discoverability
23
+ - [Installer](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/installer.md): Installer
24
+ - [Launch venues](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/launch-venues.md): Launch venues
25
+ - [Coding agents](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/readers/agents.md): Coding agents
26
+ - [Answer engines](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/readers/answer-engines.md): Answer engines
27
+ - [People](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/readers/people.md): People
28
+ - [Registries](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/readers/registries.md): Registries
29
+ - [Binary releases](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/release/binaries.md): Binary releases
30
+ - [Release contract](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/release/contract.md): Release contract
31
+ - [npm release](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/release/npm.md): npm release
32
+ - [PyPI release](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/release/pypi.md): PyPI release
33
+ - [Skills and plugins release](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/release/skills-and-plugins.md): Skills and plugins release
34
+ - [Cloudflare Workers release](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/release/workers.md): Cloudflare Workers release
35
+ - [Frame](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/01-frame.md): Frame
36
+ - [Stack card](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/02-stack.md): Stack card
37
+ - [Scaffold](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/03-scaffold.md): Scaffold
38
+ - [README / AGENTS.md / llms.txt](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/04-write.md): README / AGENTS.md / llms.txt
39
+ - [SEO and AEO for repos](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/05-discover.md): SEO and AEO for repos
40
+ - [Release with trusted publishing](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/06-release.md): Release with trusted publishing
41
+ - [Product site](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/07-site.md): Product site
42
+ - [Launch venues](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/08-launch.md): Launch venues
43
+ - [Maintenance](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/skills/repo-build-skill/references/stages/09-maintain.md): Maintenance
44
44
 
45
45
  ## Optional
46
46
 
47
- - [Credits](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/CREDITS.md): Credits
48
- - [Contributing](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/CONTRIBUTING.md): Contributing
49
- - [Provenance](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/docs/PROVENANCE.md): Provenance
50
- - [repo-build-skill chat bundle](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.0/docs/bundles/chat-upload.md): repo-build-skill chat bundle
47
+ - [Credits](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/CREDITS.md): Credits
48
+ - [Contributing](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/CONTRIBUTING.md): Contributing
49
+ - [Provenance](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/docs/PROVENANCE.md): Provenance
50
+ - [repo-build-skill chat bundle](https://github.com/aunysillyme/repo-build-skill/blob/v0.1.2/docs/bundles/chat-upload.md): repo-build-skill chat bundle
51
51
 
52
52
  <!-- set:start -->
53
53
  ## Part of a set
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-build-skill",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "repo-build-skill": "bin/repo-build-skill.mjs"
@@ -4,7 +4,7 @@ description: "Teaches you to frame, pick a stack for, scaffold, write, release a
4
4
  license: MIT
5
5
  compatibility: "Web access for each stage's live re-check; without it the work proceeds and marks those facts UNVERIFIED."
6
6
  metadata:
7
- version: "0.1.0"
7
+ version: "0.1.2"
8
8
  ---
9
9
 
10
10
  # Repository build skill
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-build-skill",
3
- "packageVersion": "0.1.0",
3
+ "packageVersion": "0.1.2",
4
4
  "budgets": {
5
5
  "skillMd": 6144,
6
6
  "skillMdLines": 120,
@@ -195,7 +195,7 @@
195
195
  "assets": [
196
196
  {
197
197
  "path": "SKILL.md",
198
- "sha256": "26a6721e2b757e928b45f534ec77bc36208dd27f7637a42087a4195633f22549",
198
+ "sha256": "b59d29c638ac2a0852c1777cb175e08523419825bddcf2bbdd288f4fb0fddb65",
199
199
  "kind": "asset"
200
200
  },
201
201
  {
@@ -425,7 +425,7 @@
425
425
  },
426
426
  {
427
427
  "path": "references/stages/09-maintain.md",
428
- "sha256": "affa18a5dcef0a9c7666ffc872a263b6ba1fb4cc71aeb1b1fbf5e8f71a1fd35d",
428
+ "sha256": "71e81f4b7d1e814e6d09edfe24e2afce7a12d321d5e8eb0705402ed382d3cfb8",
429
429
  "kind": "stage"
430
430
  }
431
431
  ]
@@ -61,6 +61,6 @@ Rows begin BLOCKED. Attach actual output or a dated manual receipt before assign
61
61
  |---|---|---|
62
62
  | F_PROOF | Unmet requirement: Each row records value, unit, command, measured, expires, package_version and subject package. | F_PROOF: checker receipt, initially BLOCKED |
63
63
  | C_CREDITS | Unmet requirement: Credits rows contain project, link, licence and use, and README links CREDITS.md. | C_CREDITS: checker receipt, initially BLOCKED |
64
- | S_DRIFT | Unmet requirement: README, llms.txt and renderer hash equal the vendored contract. | S_DRIFT: checker receipt, initially BLOCKED |
64
+ | S_DRIFT | Unmet requirement: README, llms.txt, renderer and check wrapper hashes equal the vendored contract. | S_DRIFT: checker receipt, initially BLOCKED |
65
65
  | S_STALE | Unmet requirement: The fetched source hash equals the lock hash. | S_STALE: checker receipt, initially BLOCKED |
66
66
  <!-- gate:end -->
@@ -2,6 +2,6 @@ import { rule,fail } from '../rule.mjs';
2
2
  import { readOptional,jsonOptional,digest } from '../../io.mjs';
3
3
  import { request } from '../online.mjs';
4
4
  export default [
5
- rule('S_DRIFT','registries','09-maintain','Rendered set blocks match the vendor files','One renderer keeps related repository descriptions aligned.','README, llms.txt and renderer hash equal the vendored contract.',async c=>{const {checkSet}=await import('../../set.mjs');const r=checkSet(c.root);return r.code===0?[]:[fail('.repo-build/set.json',r.message||'Set blocks or renderer differ from their lock.')];},{applies:c=>c.exists('.repo-build/set.json')}),
5
+ rule('S_DRIFT','registries','09-maintain','Rendered set blocks match the vendor files','One renderer keeps related repository descriptions aligned.','README, llms.txt, renderer and check wrapper hashes equal the vendored contract.',async c=>{const {checkSet}=await import('../../set.mjs');const r=checkSet(c.root);if(r.code!==0)return [fail('.repo-build/set.json',r.message||'Set blocks or renderer differ from their lock.')];return r.notice?[{status:'PASS',file:'.repo-build/set.lock.json',line:1,message:r.notice}]:[];},{applies:c=>c.exists('.repo-build/set.json')}),
6
6
  rule('S_STALE','registries','09-maintain','The set lock matches its source','A maintainer can refresh an adopted set when its source changes.','The fetched source hash equals the lock hash.',async c=>{if(c.env.CI)return [{status:'NOT APPLICABLE',message:'maintainer-run only'}];const lock=jsonOptional(c.root,'.repo-build/set.lock.json');if(!lock?.source)return [fail('.repo-build/set.lock.json','Record the set source.')];if(typeof lock.source!=='string'||!/^https:\/\//i.test(lock.source))return [fail('.repo-build/set.lock.json','The set source must be an https URL.')];const text=await request(c,lock.source,{raw:true});return text!==null&&digest(text)===lock.sha256?[]:[fail('.repo-build/set.lock.json','The source set changed; run set sync.')];},{mode:'online',applies:c=>c.exists('.repo-build/set.json')})
7
7
  ];
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ import { createHash } from 'node:crypto';
3
+ import { lstatSync, readFileSync } from 'node:fs';
4
+ import { dirname, join, resolve } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const usage = 'Usage: node scripts/check-set.mjs [--root <dir>]';
8
+ const fix = 'run npx repo-build-skill set sync (maintainer-run, outside CI)';
9
+ const renderer = '.repo-build/render-set.mjs';
10
+ const vendored = '.repo-build/set.json';
11
+ const lockFile = '.repo-build/set.lock.json';
12
+ const inputs = [renderer, vendored, lockFile, 'README.md', 'llms.txt'];
13
+ const identities = ['.repo-build/facts.json', 'package.json'];
14
+ /** @param {Uint8Array} bytes */
15
+ const sha256 = bytes => createHash('sha256').update(bytes).digest('hex');
16
+
17
+ /**
18
+ * Read one input as bytes. Every component below the root must be a real entry (no symlink) and the file regular.
19
+ * @param {string} root
20
+ * @param {string} file
21
+ * @param {boolean} [optional]
22
+ */
23
+ function readInput(root, file, optional = false) {
24
+ let path = root;
25
+ let stat;
26
+ for (const part of file.split('/')) {
27
+ path = join(path, part);
28
+ try {
29
+ stat = lstatSync(path);
30
+ } catch (error) {
31
+ if (optional && error.code === 'ENOENT') return null;
32
+ throw Error(`${file}: missing or unreadable`);
33
+ }
34
+ if (stat.isSymbolicLink()) throw Error(`${file}: symlinks are not allowed`);
35
+ }
36
+ if (!stat.isFile()) throw Error(`${file}: not a regular file`);
37
+ return readFileSync(path);
38
+ }
39
+
40
+ try {
41
+ const args = process.argv.slice(2);
42
+ if (args.length && (args.length !== 2 || args[0] !== '--root' || !args[1] || args[1].startsWith('--'))) throw Error(usage);
43
+ const root = args.length ? resolve(args[1]) : resolve(dirname(fileURLToPath(import.meta.url)), '..');
44
+ const bytes = new Map(inputs.map(file => [file, readInput(root, file)]));
45
+ for (const file of identities) {
46
+ const input = readInput(root, file, true);
47
+ if (input !== null) bytes.set(file, input);
48
+ }
49
+ if (!identities.some(file => bytes.has(file))) throw Error('Set checking needs facts.json or package.json');
50
+ const lock = JSON.parse(bytes.get(lockFile).toString('utf8'));
51
+ for (const key of ['renderer_sha256', 'vendored_sha256']) {
52
+ if (!lock || typeof lock[key] !== 'string' || !/^[a-f0-9]{64}$/.test(lock[key])) throw Error(`Invalid ${lockFile}: ${key}`);
53
+ }
54
+ // Pins first: renderer code is imported only after its exact bytes match the lock.
55
+ const drift = [];
56
+ for (const [file, key] of [[renderer, 'renderer_sha256'], [vendored, 'vendored_sha256']]) {
57
+ if (sha256(bytes.get(file)) !== lock[key]) drift.push(file);
58
+ }
59
+ if (!drift.length) {
60
+ // Import the hashed bytes themselves, never a second copy from disk.
61
+ const { renderSet } = await import(`data:text/javascript;base64,${bytes.get(renderer).toString('base64')}`);
62
+ drift.push(...renderSet({ root, check: true }).changed);
63
+ }
64
+ if (drift.length) {
65
+ for (const file of drift) console.error(`SET_DRIFT: ${file}: ${fix}`);
66
+ process.exitCode = 1;
67
+ } else {
68
+ console.log('Set blocks and pinned hashes match.');
69
+ }
70
+ } catch (error) {
71
+ console.error(`SET_CHECK: ${error instanceof Error ? error.message : String(error)}`);
72
+ process.exitCode = 2;
73
+ }
package/src/set.mjs CHANGED
@@ -8,6 +8,10 @@ export { validateSet, renderSet, renderBlocks, replaceBlock, currentName, plainL
8
8
  export const sha256 = bytes => createHash('sha256').update(bytes).digest('hex');
9
9
  const rendererPath = fileURLToPath(new URL('./render-set.mjs', import.meta.url));
10
10
  export const rendererBytes = () => fs.readFileSync(rendererPath);
11
+ export const WRAPPER = 'scripts/check-set.mjs';
12
+ const wrapperPath = fileURLToPath(new URL('./check-set.mjs', import.meta.url));
13
+ export const wrapperBytes = () => fs.readFileSync(wrapperPath);
14
+ const UPGRADE = `Set lock predates check_sha256; run set sync (maintainer-run, outside CI) to vendor ${WRAPPER} and pin its hash.`;
11
15
  export function checkSet(root = process.cwd()) {
12
16
  try {
13
17
  const rendered = renderSet({ root, check: true });
@@ -15,6 +19,8 @@ export function checkSet(root = process.cwd()) {
15
19
  const renderer = readRegular(root, '.repo-build/render-set.mjs');
16
20
  if (sha256(renderer) !== lock.renderer_sha256) return { code: 1, message: 'Vendored set renderer differs from lock.', changed: [...rendered.changed, '.repo-build/render-set.mjs'] };
17
21
  if (lock.vendored_sha256 && sha256(readRegular(root, '.repo-build/set.json')) !== lock.vendored_sha256) return { code: 1, message: 'Vendored set data differs from lock.', changed: [...rendered.changed, '.repo-build/set.json'] };
22
+ if (!Object.hasOwn(lock, 'check_sha256')) return rendered.code ? rendered : { ...rendered, message: `${rendered.message} ${UPGRADE}`, notice: UPGRADE };
23
+ if (sha256(readRegular(root, WRAPPER)) !== lock.check_sha256) return { code: 1, message: 'Set check wrapper differs from lock.', changed: [...rendered.changed, WRAPPER] };
18
24
  return rendered;
19
25
  } catch (error) { return { code: 1, message: error.message, changed: [] }; }
20
26
  }
@@ -76,15 +82,22 @@ export async function syncSet({ root = process.cwd(), fetchImpl = globalThis.fet
76
82
  commit = Array.isArray(commits) ? commits[0]?.sha ?? null : commits.sha ?? null;
77
83
  if (commit !== null && !/^[a-f0-9]{40,64}$/i.test(commit)) throw Error('GitHub returned an invalid set commit');
78
84
  }
79
- const bytes = Buffer.from(JSON.stringify(set, null, 2) + '\n'), renderer = rendererBytes();
80
- const lock = { source, commit, sha256: sha256(sourceBytes), vendored_sha256: sha256(bytes), renderer_sha256: sha256(renderer), fetched: new Date(now).toISOString().slice(0, 10) };
85
+ const bytes = Buffer.from(JSON.stringify(set, null, 2) + '\n'), renderer = rendererBytes(), wrapper = wrapperBytes();
86
+ const lock = { source, commit, sha256: sha256(sourceBytes), vendored_sha256: sha256(bytes), renderer_sha256: sha256(renderer), check_sha256: sha256(wrapper), fetched: new Date(now).toISOString().slice(0, 10) };
81
87
  const blocks = renderBlocks(set, currentName(root));
88
+ // The wrapper is written before the lock that pins it.
82
89
  const outputs = [
83
- ['.repo-build/set.json', bytes], ['.repo-build/render-set.mjs', renderer], ['.repo-build/set.lock.json', JSON.stringify(lock, null, 2) + '\n'],
84
- ...[['README.md', blocks.readme], ['llms.txt', blocks.llms]].map(([rel, block]) => [rel, replaceBlock(fs.readFileSync(safeOutput(root, rel), 'utf8'), block)]),
90
+ ['.repo-build/set.json', bytes], ['.repo-build/render-set.mjs', renderer], [WRAPPER, wrapper], ['.repo-build/set.lock.json', JSON.stringify(lock, null, 2) + '\n'],
85
91
  ];
86
- for (const [rel] of outputs) safeOutput(root, rel);
87
- fs.mkdirSync(safeOutput(root, '.repo-build'), { recursive: true });
92
+ const blocksByFile = [['README.md', blocks.readme], ['llms.txt', blocks.llms]];
93
+ for (const [rel] of [...outputs, ...blocksByFile]) {
94
+ const full = safeOutput(root, rel);
95
+ let info;
96
+ try { info = fs.lstatSync(full); } catch (error) { if (error.code !== 'ENOENT') throw error; }
97
+ if (info && !info.isFile()) throw Error(`Expected regular file: ${rel}`);
98
+ }
99
+ outputs.push(...blocksByFile.map(([rel, block]) => [rel, replaceBlock(fs.readFileSync(safeOutput(root, rel), 'utf8'), block)]));
100
+ for (const dir of ['.repo-build', 'scripts']) fs.mkdirSync(safeOutput(root, dir), { recursive: true });
88
101
  for (const [rel, output] of outputs) fs.writeFileSync(safeOutput(root, rel), output);
89
102
  return { code: 0, message: 'Set synchronized and rendered.', lock };
90
103
  } catch (error) { return { code: error.code === 'ENOENT' || error instanceof SyntaxError ? 2 : 3, message: error.message }; }