Repository navigation
chore(deps): bump core to 0.37 and commons to 0.31 - #4
Merged
Merged
Conversation
Permissions are associations now. `Permission` is replaced by
`AuthorityAssociation` — a `permission` element whose bit is its label and
whose grantee carries a required `role`, or an `anyone` element spelling
world-read affirmatively — and `associations` narrows to `DataAssociation[]`
so an app editing tags is never handed the ACL.
The plugin reads both sets rather than writing them, so no module needed a
code change: `StackRecord`'s two projections keep an association loop from
ever seeing an authority element. The test fixtures and the playground seed
move to `[{ kind: 'anyone', label: 'read' }]`.
Attachment candidates now sort by core's own total order (`createdAt`, then
`id`) rather than `createdAt` alone, so two uploads landing in the same
millisecond stage the same way on every build. The association's new
`attachmentRecordId` stays unread on purpose, and `assets.ts` says why:
content addressing gives a fileId exactly one staged path, so resolving
which upload a reference came from would pick the same string.
Correct `docs/design.md § Rebuilding on change`, which the no-bump work
invalidated. Since 0.33-0.35 the journal-tier ops — associate, dissociate,
permissions, reparent, unlist, list — leave `version` and `updatedAt` exactly
where they stand, so the sketched `updatedAt: { after }` gate would skip a
rebuild for precisely the edits this plugin cares about: adding a record to a
site, scoping one with `for-site`, embedding an attachment, moving a page,
publishing a draft. The gate moves after load and fingerprints the index,
associations and permissions included; a watching `--serve` reads
`RecordChange.ops`, never `version`.
Existing databases must be recreated — the SQLite schema is create-if-not-
exists only and ships no migration.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Syncs the plugin to
@haverstack/core0.37.0 /@haverstack/commons0.31.0, up from 0.31.0 / 0.25.0. The headline change is that record permissions are associations now.Permissions are associations
Permissionis gone. A record's ACL isAuthorityAssociation[]— apermissionelement whose bit is its label and whosegranteecarries a requiredrole, or ananyoneelement spelling world-read affirmatively.[{ access: 'public' }]becomes[{ kind: 'anyone', label: 'read' }], and theassociationskey narrows toDataAssociation[].No
src/module needed a code change for it. The plugin reads both sets and writes neither, and core partitions them into two projections over one table, so an association loop can never be handed an ACL element. The churn is test fixtures plus the playground seed.The part the compiler could not catch
docs/design.md § Rebuilding on changedocumented a "did anything change?" gate built onRecordFilter.updatedAt. That query still typechecks and is now unsound.Six ops —
associate,dissociate,permissions,reparent,unlist,list— leaveversionandupdatedAtexactly where they stand (NO_BUMP_OPSin core'srecord-changes.ts). Between them they cover site membership,for-sitescoping,embedattachments, page moves and publishing a draft — most of what a site owner changes between builds. The gate would have skipped rebuilds for precisely those edits.The section now puts the gate after load, fingerprinting the index including associations and permissions. That shape also catches purges, which the
updatedAtgate never did. The watch-mode section readsRecordChange.ops, neverversion.Smaller calls
createdAt, thenid), so two uploads landing in the same millisecond stage identically on every build.attachmentRecordIdpointer is deliberately not read, andassets.tssays why: content addressing gives a fileId exactly one staged path and the embed map points every known filename at it, so resolving the originating upload would pick the same string.Breaking: existing databases must be recreated
Core 0.35 moved permissions into the
associationstable and tookparentIdoff the version tier. The SQLite schema isCREATE TABLE IF NOT EXISTSonly and ships no migration, so an older database opens and then fails on the first permission write — itsassociationstable keeps akindconstraint refusingpermission/anyoneand has norelated_roleorattachment_record_idcolumn.Verification
All five CI checks pass locally (
format:check,lint, 86 tests,build,typecheck).Dogfooded end to end in
eleventy-exampleagainst a recreated stack: seed → inspect → check → build for both sites across default / custom / ejected templates → publish dry-run, real write, idempotent re-run, and cross-site canonical. 19 files out, embeds substituted to distinct fileIds, unlisted records built but absent from sitemap and feeds,collections.*populated.The no-bump semantics were confirmed empirically rather than taken from the changelog:
associate+mutate({ unlisted: false })+grantAccesson a seeded article moved it onto a second site's listing, into the sitemap and into the feed, whileversionstayed at 2 andupdatedAtnever moved.Release
Carries one pending minor changeset and no version commit, so merging lets the changesets bot open its usual
chore: version packagesPR and cut 0.2.1 → 0.3.0.🤖 Generated with Claude Code
https://claude.ai/code/session_0159RJgPRGz3VpwQGUoALrqB