Skip to content

docs(adr): ADR-0052 keys a hook's context to the app's DB (#1211) - #1212

Merged
borisno2 merged 1 commit into
mainfrom
claude/triage-1211-a09793
Sep 6, 2026
Merged

docs(adr): ADR-0052 keys a hook's context to the app's DB (#1211)#1212
borisno2 merged 1 commit into
mainfrom
claude/triage-1211-a09793

Conversation

@borisno2

@borisno2 borisno2 commented Sep 6, 2026

Copy link
Copy Markdown
Member

Amends ADR-0052 so the Prisma 8 keying carries a hook's context deliberately, rather than re-landing the gap #1211 reports on main.

Why

ADR-0052's "Hook arguments" section keys item, resolvedData and needs — and says nothing about context. That omission looks like an oversight rather than a decision: under the record's own keying, the generated Context is StackContext<DB, S, PluginServices> over the contract-derived DB, but a hook's context would still resolve over a default. On main today that default is PrismaClientLike = any, so AccessControlledDB<any> is a mapped type over keyof any intersected with an index signature — assignable to nothing, and happy to accept context.db.typoedListName.

Confirmed against the published @opensaas/stack-core@0.41.0 dist:

  • context.db.typoedListName compiles
  • assigning a hook's context to a client-specific db fails TS2322"Property 'lessonSchedule' is missing in type AccessControlledDB<any>"
  • a narrow structural seam fails identically — the named delegates are absent, not loosely typed

The record's "Core gains the generics and loses any" consequence already deletes PrismaClientLike and AccessControlledDB's structural probing. Without this amendment, the hook args are left reading a default that no longer exists.

What it records

Docs only: one ADR section, no package or code changes, so no changeset.

Related

🤖 Generated with Claude Code

The Hook arguments section keyed `item`, `resolvedData` and `needs` but left
`context` unparameterised, so the Prisma 8 keying would have re-landed the
gap #1211 reports on main: a hook's context resolves over `PrismaClientLike =
any`, `AccessControlledDB<any>` is assignable to nothing, and a typo'd
delegate type-checks.

Records that TypeInfo carries the app's DB and core's hook types read
`context` off it, and that main's pre-contract fix establishes the same seam
rather than a second mechanism.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e9a542d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
stack-docs Ready Ready Preview Sep 6, 2026 10:41am UTC

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Core Package Coverage (./packages/core)

Status Category Percentage Covered / Total
🟢 Lines 94.4% (🎯 65%) 1756 / 1860
🟢 Statements 92.63% (🎯 65%) 1898 / 2049
🟢 Functions 97.53% (🎯 62%) 277 / 284
🟢 Branches 86.41% (🎯 50%) 1399 / 1619
File CoverageNo changed files found.
Generated in workflow #1992 for commit e9a542d by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for UI Package Coverage (./packages/ui)

Status Category Percentage Covered / Total
🔵 Lines 78.45% 244 / 311
🔵 Statements 77.95% 251 / 322
🔵 Functions 69.81% 74 / 106
🔵 Branches 66.94% 160 / 239
File CoverageNo changed files found.
Generated in workflow #1992 for commit e9a542d by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for CLI Package Coverage (./packages/cli)

Status Category Percentage Covered / Total
🔵 Lines 79% 1547 / 1958
🔵 Statements 78.81% 1615 / 2049
🔵 Functions 86.11% 217 / 252
🔵 Branches 69.66% 758 / 1088
File CoverageNo changed files found.
Generated in workflow #1992 for commit e9a542d by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Auth Package Coverage (./packages/auth)

Status Category Percentage Covered / Total
🔵 Lines 99.49% 196 / 197
🔵 Statements 98.13% 211 / 215
🔵 Functions 100% 45 / 45
🔵 Branches 91.26% 188 / 206
File CoverageNo changed files found.
Generated in workflow #1992 for commit e9a542d by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Storage Package Coverage (./packages/storage)

Status Category Percentage Covered / Total
🔵 Lines 78.57% 220 / 280
🔵 Statements 80.06% 245 / 306
🔵 Functions 86.07% 68 / 79
🔵 Branches 75.88% 214 / 282
File CoverageNo changed files found.
Generated in workflow #1992 for commit e9a542d by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for RAG Package Coverage (./packages/rag)

Status Category Percentage Covered / Total
🔵 Lines 47.97% 355 / 740
🔵 Statements 48.14% 377 / 783
🔵 Functions 54.26% 70 / 129
🔵 Branches 42.55% 180 / 423
File CoverageNo changed files found.
Generated in workflow #1992 for commit e9a542d by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)

Status Category Percentage Covered / Total
🔵 Lines 100% 40 / 40
🔵 Statements 100% 40 / 40
🔵 Functions 100% 9 / 9
🔵 Branches 100% 19 / 19
File CoverageNo changed files found.
Generated in workflow #1992 for commit e9a542d by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)

Status Category Percentage Covered / Total
🔵 Lines 100% 68 / 68
🔵 Statements 100% 71 / 71
🔵 Functions 100% 15 / 15
🔵 Branches 97.87% 46 / 47
File CoverageNo changed files found.
Generated in workflow #1992 for commit e9a542d by the Vitest Coverage Report Action

@borisno2
borisno2 merged commit 98d5fc6 into main Sep 6, 2026
6 checks passed
@borisno2
borisno2 deleted the claude/triage-1211-a09793 branch September 6, 2026 10:52
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.

1 participant