Skip to content

Commit b0e7ba7

Browse files
aspiersclaude
andcommitted
docs(agents): document permission-set sync in the add-a-lexicon checklist
The "Adding / modifying a lexicon" steps covered codegen, ERD, README/SKILL, SCHEMAS.md, format, check, and changeset — but never the permission sets. Each authWrite.json enumerates every type:"record" collection in its namespace (the list is both the grant and its boundary; no wildcards allowed inside a set), so a new org.hypercerts.* / app.certified.* record lexicon is NOT grantable via the published set until added to the matching set — and must be removed when deleted. Add a step spelling this out, including the own-namespace-authority rule (each record goes only in its own namespace's set) and the non-record exemption (query/object/permission-set defs are not repo collections). Links to docs/design/permission-sets.md for the full rationale. Prettier also renumbered the list (fixing a pre-existing duplicate-"4" bug). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 240c059 commit b0e7ba7

1 file changed

Lines changed: 28 additions & 9 deletions

File tree

AGENTS.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,29 @@ scripts/ Build and codegen scripts
234234
- Generate types in `generated/` (including vendored external lexicons)
235235
- Auto-generate `generated/exports.ts` with all exports
236236

237-
3. Update `ERD.puml` as appropriate:
237+
3. Update the relevant **permission set** if appropriate:
238+
- The `permission-set` lexicons (`lexicons/org/hypercerts/authWrite.json`
239+
and `lexicons/app/certified/authWrite.json`) each enumerate **every
240+
`type: "record"` collection in their namespace** — the list is both
241+
the grant and its boundary, with no wildcards allowed inside a set.
242+
- When you **add** a new `org.hypercerts.*` or `app.certified.*` record
243+
lexicon, add its NSID to the matching set's `permissions[].collection`
244+
list, or it will not be grantable via the published set. Likewise
245+
**remove** the NSID when you delete a record lexicon.
246+
- A set may only reference collections under **its own namespace
247+
authority**, so `org.hypercerts.*` records go in
248+
`org.hypercerts.authWrite` and `app.certified.*` records in
249+
`app.certified.authWrite` — never the other set.
250+
- This does not apply to non-record defs (e.g. `query`, `object`, or
251+
`permission-set` lexicons themselves), which are not repo collections.
252+
- See [docs/design/permission-sets.md](docs/design/permission-sets.md)
253+
for the full rationale.
254+
255+
4. Update `ERD.puml` as appropriate:
238256
- **Include all fields except facet fields** (they're cosmetic and
239257
don't affect structure)
240258

241-
4. Update `README.md` and `SKILL.md` as appropriate:
259+
5. Update `README.md` and `SKILL.md` as appropriate:
242260
- If `README.md` or
243261
`.agents/skills/building-with-hypercerts-lexicons/SKILL.md`
244262
already references that lexicon, **both files must be updated**
@@ -263,17 +281,18 @@ scripts/ Build and codegen scripts
263281
valid export names, `$type` strings, and API call signatures.
264282
This will catch many (but not all) documentation errors.
265283

266-
5. Run `npm run gen-schemas-md` to regenerate `SCHEMAS.md`
284+
6. Run `npm run gen-schemas-md` to regenerate `SCHEMAS.md`
267285

268-
6. Run `npm run format` to ensure everything is formatted correctly
286+
7. Run `npm run format` to ensure everything is formatted correctly
269287
via Prettier
270288

271-
7. Run `npm run check` to validate, typecheck, and build
289+
8. Run `npm run check` to validate, typecheck, and build
272290

273-
8. **REQUIRED: Create a changeset file** using the `writing-changesets` skill
274-
- **This step is MANDATORY for ALL changes that affect users**
275-
- See the `writing-changesets` skill for details on changeset requirements
276-
- Use the skill - do NOT write changeset files manually
291+
9. **REQUIRED: Create a changeset file** using the `writing-changesets` skill
292+
293+
- **This step is MANDATORY for ALL changes that affect users**
294+
- See the `writing-changesets` skill for details on changeset requirements
295+
- Use the skill - do NOT write changeset files manually
277296

278297
**No manual edits needed!** Everything is automatically regenerated.
279298

0 commit comments

Comments
 (0)