Skip to content

Sync to coordinated core release: principal/subject split, attachment atomicity, guard removal - #61

Merged
cuibonobo merged 1 commit into
mainfrom
claude/issues-50-51-52-hrchah
Aug 16, 2026
Merged

Sync to coordinated core release: principal/subject split, attachment atomicity, guard removal#61
cuibonobo merged 1 commit into
mainfrom
claude/issues-50-51-52-hrchah

Conversation

@cuibonobo

Copy link
Copy Markdown
Member

Summary

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:

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.

Test plan

  • pnpm typecheck
  • pnpm lint
  • pnpm build
  • pnpm test — 115 tests passing, including new coverage for delegation, _config/_app/reserved-key invariants, version-history write-gating, permission stripping, and double-open protection

Closes #50, #51, #52.

https://claude.ai/code/session_01HSEQ51HctZ9fVqsS8ooNmY


Generated by Claude Code

… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Principal/subject: adopt forSession(); lookupToken().entityId no longer exists and will break silently on upgrade

2 participants