Sync to coordinated core release: principal/subject split, attachment atomicity, guard removal - #61
Merged
Merged
Conversation
… atomicity, superseded guard removal Bumps @haverstack/core to the coordinated release (0.9.0) now that its packaging blocker (core#167) has cleared, and does the three-issue sync batch that depended on it in one pass: - Adopts forSession() and the principal/subject split everywhere the server resolves identity (auth middleware, every route, token issuance), replacing the removed TokenSession.entityId field. POST /tokens gains onBehalfOf; GET /records gains ?principalId=. (#50) - Deletes the three route-level policy guards (and the unscoped stack.get() pre-fetch backing them) now that ScopedStack enforces them natively, and adds coverage for the invariants that arrive free: _config protection, _app binding rules, reserved content keys, non-owner _attachment@1 create refusal, the version-history write gate, and permission stripping on snapshots. Pins double-open protection and documents the WAL sidecar files. (#51, discharges #41) - POST /attachments now stores bytes and creates the _attachment@1 record atomically via ScopedStack.putAttachment(), returning the record instead of a bare fileId, and enforces the size limit while streaming the body instead of buffering first. (#52, folds in #46) Also adopts the wire-format's typed error body ({error:{code,message}}) repository-wide via wire-types' serializeError(), since #52 specified it for the new attachment denials and the alternative was a one-off shape that would need redoing once #33 lands anyway. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HSEQ51HctZ9fVqsS8ooNmY
This was referenced Aug 16, 2026
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.
Summary
Bumps
@haverstack/coreto the coordinated release (0.9.0) now that its packaging blocker (core#167) has cleared, and does the three-issue sync batch that depended on it in one pass:lookupToken().entityIdno longer exists and will break silently on upgrade #50 — AdoptsforSession()and the principal/subject split everywhere the server resolves identity (auth middleware, every route, token issuance), replacing the removedTokenSession.entityIdfield.POST /tokensgainsonBehalfOf;GET /recordsgains?principalId=.stack.get()pre-fetch backing them) now thatScopedStackenforces them natively, and adds coverage for the invariants that arrive free:_configprotection,_appbinding rules, reserved content keys, non-owner_attachment@1create refusal, the version-history write gate, and permission stripping on snapshots. Pins double-open protection and documents the WAL sidecar files.POST /attachmentsnow stores bytes and creates the_attachment@1record atomically viaScopedStack.putAttachment(), returning the record instead of a barefileId, and enforces the size limit while streaming the body instead of buffering first.Also adopts the wire-format's typed error body (
{error:{code,message}}) repository-wide viawire-types'serializeError(), since #52 specified it for the new attachment denials and the alternative was a one-off shape that would need redoing once #33 lands anyway.Test plan
pnpm typecheckpnpm lintpnpm buildpnpm test— 115 tests passing, including new coverage for delegation,_config/_app/reserved-key invariants, version-history write-gating, permission stripping, and double-open protectionCloses #50, #51, #52.
https://claude.ai/code/session_01HSEQ51HctZ9fVqsS8ooNmY
Generated by Claude Code