Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

Close out cross-contract-refs: migrate docs, record shipped, delete workspace (TML-2500 M4) - #770

Merged
wmadden-electric merged 10 commits into
mainfrom
tml-2500-m4-docs-closeout
Jun 8, 2026
Merged

wmadden-electric merged 10 commits into
mainfrom
tml-2500-m4-docs-closeout

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

This is the documentation + close-out milestone (M4) for the cross-contract-refs project. All four implementation milestones have merged — M1 #745, M2 #752, M3a #756, M3b #765 — shipping cross-contract-space foreign-key references end-to-end. This PR migrates the project's durable knowledge into the canonical doc surfaces, records the project as shipped in the umbrella tracker, lands the final-retro lessons, and deletes the transient project workspace.

What shipped (recap, for the reader without context)

An app contract can now declare a foreign key from a local model to a model owned by an extension's contract space. The headline example, live in examples/supabase:

types {
  Uuid = String @db.Uuid
}

namespace public {
  model Profile {
    id     String @id @default(uuid())
    userId Uuid   @unique
    user   supabase:auth.AuthUser @relation(fields: [userId], references: [id], onDelete: Cascade)
    @@map("profile")
  }
}

The planner lowers this to a real Postgres FK (REFERENCES "auth"."users"("id") ON DELETE CASCADE), and a hermetic integration test proves the cascade fires against a live database.

Where the knowledge landed (M4.1)

The design knowledge that lived in the transient projects/cross-contract-refs/ workspace migrated to three canonical, self-contained surfaces:

  • Subsystem doc — a new "Cross-contract FK references" subsection in docs/architecture docs/subsystems/6. Ecosystem Extensions & Packs.md (the extension hub). Records the current shape: the presence-based optional spaceId discriminator on ForeignKeyReference, dependency-graph construction, namespace-ownership rules, the aggregate-loader resolution rule, and the __unbound__ DDL-qualification consequence.
  • ADR 226 — docs/architecture docs/adrs/ADR 226 - Cross-contract foreign-key references.md. Records the decisions: presence-based discrimination (chosen so local-FK JSON stays byte-identical), implicit extensionPacks resolution, the DAG + reverse-reference rejection, namespace ownership, Option-B non-navigable relations, the colon-prefix PSL grammar, and no-diagnostic cascade. Cross-links ADR 212 / 221 / 225.
  • Authoring rulecard — .agents/rules/cross-contract-fk-authoring.mdc. The actionable Do/Don't for authoring a cross-contract FK, including the hard-won M3b lesson that the FK source column must match the target's native type (types { Uuid = String @db.Uuid }), and that @db.X is type-constructor syntax (only valid inside a types {} block), not a field attribute.

Bookkeeping (M4.2)

  • The umbrella tracker (projects/supabase-integration/README.md) status row flipped to ✅ Done & closed with the four PR links, and its link repointed from the (now-deleted) project spec to the durable subsystem doc.
  • The one durable dangling link — packages/3-extensions/supabase/README.md pointing into the project dir — repointed to ADR 226 / the subsystem doc.

Final retro (M4.3)

Per the mandatory-final-retro invariant, the process lessons from this project's execution landed in durable drive/ calibration surfaces:

  • drive/spec/README.md — spec illustrative snippets (PSL grammar, IR shapes) must be re-verified against shipped code before execution, not copied as fact. (This project hit it four times.)
  • drive/calibration/model-tier.md — a worked example confirming the existing "pin the dispatch tier explicitly, don't inherit" rule.
  • drive/calibration/dod.md — test-dispatch briefs need a "claims preserved" acceptance criterion: state what the test proves, on the right surface.

Definition of Done — verified

AC Status Evidence
AC1 (TS cross-contract ref, non-navigable) ✅ M2 #752
AC2 (PSL cross-contract ref, round-trip) ✅ M2 #752 + M3a #756
AC3 (__unbound__ unqualified REFERENCES) ✅ M3a #756
AC4 (cascade permitted, DDL has ON DELETE CASCADE) ✅ M2 #752 + M3b #765
AC5 (missing-pack diagnostic, both surfaces) ✅ M2 #752
AC6 (primitive collision + cycle rejection) ✅ M1 #745
AC7 (live FK in pg_constraint, verifier clean) ✅ M3a #756 + M3b #765
AC8 (round-trip property test) ✅ M1 #745
AC9 (TML-2459 local FK tests unchanged) ✅ all milestones
AC10 (pnpm lint:deps clean) ✅ all milestones

All slices merged; mandatory final retro complete; durable docs landed; no open ADRs blocking.

Deletion

projects/cross-contract-refs/ is removed. Verified before deletion: trace integrity passes (89 events, 9 dispatches, all round/dispatch pairs matched); no durable file (packages/, examples/, docs/, .agents/) references the deleted path; pnpm build + pnpm typecheck unaffected (nothing imports from projects/). References to cross-contract-refs that remain in other project workspaces (supabase-integration, postgres-rls, etc.) are transient-to-transient and get cleaned at those projects' own close-outs.

Validation

  • pnpm typecheck: 138/138
  • pnpm lint: 79/79
  • pnpm lint:rules:symlinks: clean (the new rulecard wired)
  • pnpm build: clean

Refs: TML-2500.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guidance for cross-contract foreign-key references, including authoring conventions and architectural design decisions.
    • Updated ecosystem extensions documentation with cross-contract reference patterns and resolution behavior.
    • Enhanced calibration and code verification documentation with improved guidance for test authoring and snippet validation.

wmadden and others added 5 commits June 8, 2026 16:09
…+ ADR 226 + authoring rulecard)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…rable docs

Replace the fictional `source: 'local'|'space'` / `TargetFieldRef` union
with the real presence-based `spaceId?` shape from `ForeignKeyReference`.
Use `__unbound__` (IR/DDL sentinel) in planner/DDL contexts; leave
`__unspecified__` (parser sentinel) in PSL-authoring contexts. Update the
ADR grammar example from `User` to `AuthUser` for consistency.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Flip the umbrella status row to ✅ Done & closed (M1–M3b PR numbers),
fix supabase:auth.User → supabase:auth.AuthUser, repoint the project-dir
link in the umbrella and the durable dangling link in the supabase
extension README to the new subsystem doc + ADR 226.

Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ounding, model-tier, test-claims)

Three process lessons from the TML-2500 cross-contract-refs retro:
- drive/spec/README.md: executors must re-verify illustrative snippets against shipped code before treating them as fact
- drive/calibration/model-tier.md: worked example — M3b dispatches inherited orchestrator tier silently for a full milestone
- drive/calibration/dod.md: test-dispatch briefs must state what the test proves and on the right surface (claims-preserved AC)

Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The project's durable knowledge migrated to canonical surfaces in M4.1
(subsystem doc § Cross-contract FK references, ADR 226, and the
cross-contract-fk-authoring rulecard); the umbrella tracker records it
shipped (M4.2); and the final-retro lessons landed in drive/ calibration
surfaces (M4.3). The transient project workspace — specs, plans, slice
artefacts, reviews, learnings, trace — has served its purpose and is
removed here.

Closes the cross-contract-refs project. All implementation milestones
merged: M1 #745, M2 #752, M3a #756, M3b #765.

Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner June 8, 2026 14:31
@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@wmadden-electric, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 54 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 818c14cf-5ce8-492c-8182-ba4f54230cc5

📥 Commits

Reviewing files that changed from the base of the PR and between c0bb9de and 13304ff.

📒 Files selected for processing (3)
  • docs/architecture docs/adrs/ADR 226 - Cross-contract foreign-key references.md
  • docs/architecture docs/subsystems/6. Ecosystem Extensions & Packs.md
  • skills/extension-author/prisma-next-extension-upgrade/upgrades/0.12-to-0.13/instructions.md
📝 Walkthrough

Walkthrough

This PR documents the framework design and authoring model for cross-contract foreign-key references. It introduces ADR 226, authoring conventions, ecosystem integration guidance, and supporting process/validation updates. All changes are documentation-only with no code changes.

Changes

Cross-contract foreign-key references: design and authoring documentation

Layer / File(s) Summary
Core cross-contract FK architecture (ADR 226)
docs/architecture docs/adrs/ADR 226 - Cross-contract foreign-key references.md
ADR 226 documents the decision to allow apps to declare foreign keys targeting extension-owned tables via the same authoring surface, with the framework emitting real DB FK constraints and verifying cross-space relationships via an optional spaceId on the FK carrier. Covers design components (handle branding, dependency graph constraints, non-navigable relations), consequences, and alternatives considered.
Ecosystem extension and pack integration
docs/architecture docs/subsystems/6. Ecosystem Extensions & Packs.md
New section documents how cross-contract FK references fit into the extension/pack ecosystem, defining dependency graphs, namespace ownership rules, implicit resolution via the contract aggregate, PSL (colon-prefix) and TS (branded handles) authoring surfaces, __unbound__ DDL qualification, v0.1 non-navigability, and permitted referential actions.
Cross-contract FK authoring conventions rulecard
.agents/rules/cross-contract-fk-authoring.mdc
Complete rulecard defining TS and PSL authoring conventions: TS approach with model/pack imports and extensionPacks wiring; PSL colon-prefixed type syntax; mandatory native-type matching with PSL types {} aliases and @db.* usage; TS field-builder guidance; and operational notes on onDelete, non-navigability, and ADR references.
Supporting process and reference updates
drive/calibration/dod.md, drive/calibration/model-tier.md, drive/spec/README.md, packages/3-extensions/supabase/README.md
New test-dispatch brief overlay requiring tests to specify proven behavior and correct surface (SQL for non-navigable cross-space tables); worked example documenting tier defaulting behavior; spec grounding guidance requiring illustrative snippets to be re-verified against shipped code; and Supabase pack reference update (type name correction to AuthUser and doc location consolidation).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • prisma/prisma-next#752: This PR implements the cross-contract FK semantics in code (TS/PSL spaceId handling, colon-prefix parsing, lowering, and non-navigable relation emission) that the main PR documents.
  • prisma/prisma-next#460: Supabase integration planning explicitly includes the "cross-contract-refs" workstream, which directly aligns with this PR's new ADR and rulecards documenting cross-contract foreign-key reference semantics.

Poem

🐰 A rabbit's verse on cross-contract delights:

spaceId hops through foreign keys with care,
PSL's colon-prefix guides the way,
Non-navigable relations in v0.1 declare—
Native types must match, no exceptions, we say.
Extensions now reference, the schema expands,
Architecture and guidance in rabbit's own hands. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective of the pull request: closing out the cross-contract-refs project by migrating documentation, recording completion, and deleting the workspace.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-2500-m4-docs-closeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +336 to +345
The FK reference carrier in Contract IR (`ForeignKeyReference`) uses a presence-based optional `spaceId` to distinguish local from cross-space references:

```ts
export class ForeignKeyReference extends SqlNode {
readonly namespaceId: NamespaceId; // UNBOUND_NAMESPACE_ID ('__unbound__') for single-namespace refs
readonly tableName: string;
readonly columns: readonly string[];
declare readonly spaceId?: string; // absent = local; present = cross-space
}
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too low-level for subsystem docs, this belongs in an ADR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 36ccbfc — removed the ForeignKeyReference class block and the presence-based-discrimination internals from the subsystem doc, replaced with a plain behavioral description plus the existing ADR 226 link. The IR-level detail lives in ADR 226 where it belongs.


#### Resolution rule

Cross-space resolution happens at the lowering boundary (Contract IR → Schema IR). The same aggregate the framework already builds from `extensionPacks` is the resolver — there is no separate PSL `use` directive or TS resolver call. If the named space is not in the aggregate, lowering fails fast with a diagnostic naming the missing pack.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unintelligible jargon

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 36ccbfc — rewrote it without the IR-plane jargon: "When the contract is compiled, each cross-space reference is resolved against the loaded extension contracts — the same set declared in extensionPacks. A reference to a space that isn't declared, or to a model/column that doesn't exist in it, fails fast with a diagnostic that names the missing pack."


```ts
import { AuthUser } from '@prisma-next/extension-supabase/contract';
import supabasePack from '@prisma-next/extension-supabase/pack';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import supabasePack from '@prisma-next/extension-supabase/pack';
import supabaseExtension from '@prisma-next/extension-supabase/pack';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 36ccbfc — renamed the import binding to supabaseExtension and propagated it to the extensionPacks: [supabaseExtension] usage in the same example so it stays consistent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a rule?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right — it shouldn't be a rule. Deleted .agents/rules/cross-contract-fk-authoring.mdc in 36ccbfc. The authoring how-to it carried duplicated the subsystem doc's authoring section; the one genuinely-useful part (native-type matching: @db.X is a types-block constructor, not a field attribute) is folded into the subsystem doc's authoring section as a "Native-type matching" note. The three references to the rulecard (subsystem doc + two in ADR 226) are repointed/removed.

Lead with the decision + a grounding example (the PSL an author writes
and the DDL it produces), build the design as connected narrative rather
than a flat list, and move rejected options into an "Alternatives
considered" section at the end so the body stays focused on what was
decided.

Strip references that don't belong in long-lived documentation: the
Linear ticket from Status, "before this work / pre-226 / v0.1"
project-phase framing, and the prior-work reference in the AST note.
Technical content (presence-based spaceId discrimination, the
__unbound__/__unspecified__ layer split, the colon-prefix grammar,
native-type matching) is unchanged.

Signed-off-by: Will Madden <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/architecture` docs/adrs/ADR 226 - Cross-contract foreign-key
references.md:
- Around line 87-91: Add a language tag to the fenced code block containing the
grammar for "type_ref ::= [ <space>: ] <namespace>. <name> ..." so the fence
becomes e.g. ```text or ```ebnf (or another appropriate language identifier) to
satisfy MD040; locate the fence around the type_ref grammar and prepend the
chosen language after the opening backticks.

In `@packages/3-extensions/supabase/README.md`:
- Around line 63-65: Update this README.md to remove transient "projects/..."
links and replace them with stable documentation/package references: change the
`projects/postgres-rls/spec.md` link used in the "postgres-rls" line to the
durable package or architecture spec for RLS, replace the
`projects/explicit-namespace-dsl/spec.md` link referenced in
"explicit-namespace-dsl", and repoint the `ADR 226` and cross-contract FK link
(`supabase:auth.AuthUser`) to the canonical ADR or architecture docs location;
do the same for the other occurrences noted at lines 71-72 so the README only
references long-lived docs or package docs rather than any `projects/` paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: b881d666-c133-46ee-9938-8964a87ccd65

📥 Commits

Reviewing files that changed from the base of the PR and between c99fae0 and c0bb9de.

⛔ Files ignored due to path filters (13)
  • projects/cross-contract-refs/plan.md is excluded by !projects/**
  • projects/cross-contract-refs/rollups/2026-06-05-opening.md is excluded by !projects/**
  • projects/cross-contract-refs/slices/M1/plan.md is excluded by !projects/**
  • projects/cross-contract-refs/slices/M1/spec.md is excluded by !projects/**
  • projects/cross-contract-refs/slices/M2/plan.md is excluded by !projects/**
  • projects/cross-contract-refs/slices/M2/spec.md is excluded by !projects/**
  • projects/cross-contract-refs/slices/M3a/plan.md is excluded by !projects/**
  • projects/cross-contract-refs/slices/M3a/spec.md is excluded by !projects/**
  • projects/cross-contract-refs/slices/M3b/plan.md is excluded by !projects/**
  • projects/cross-contract-refs/slices/M3b/spec.md is excluded by !projects/**
  • projects/cross-contract-refs/spec.md is excluded by !projects/**
  • projects/cross-contract-refs/trace.jsonl is excluded by !projects/**
  • projects/supabase-integration/README.md is excluded by !projects/**
📒 Files selected for processing (7)
  • .agents/rules/cross-contract-fk-authoring.mdc
  • docs/architecture docs/adrs/ADR 226 - Cross-contract foreign-key references.md
  • docs/architecture docs/subsystems/6. Ecosystem Extensions & Packs.md
  • drive/calibration/dod.md
  • drive/calibration/model-tier.md
  • drive/spec/README.md
  • packages/3-extensions/supabase/README.md

Comment on lines 63 to 65
- **RLS authoring + policies** — [`postgres-rls`](../../../projects/postgres-rls/spec.md) (`.rls(...)` builder, PSL `policy { … }` blocks, content-addressed wire names, `pg_policies` verifier).
- **Cross-contract FK to `auth.users`** — [`cross-contract-refs`](../../../projects/cross-contract-refs/spec.md) (`supabase:auth.User` PSL grammar; cross-space references in the TS builder).
- **Cross-contract FK to `auth.users`** — [cross-contract FK references](../../../docs/architecture%20docs/subsystems/6.%20Ecosystem%20Extensions%20%26%20Packs.md) (`supabase:auth.AuthUser` PSL grammar; cross-space references in the TS builder). See also [ADR 226](../../../docs/architecture%20docs/adrs/ADR%20226%20-%20Cross-contract%20foreign-key%20references.md).
- **Explicit namespace-qualified queries** (`db.sql.auth.users`) — [`explicit-namespace-dsl`](../../../projects/explicit-namespace-dsl/spec.md).

@coderabbitai coderabbitai Bot Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace remaining projects/ links with durable docs references in this README.

This package README is long-lived, but it still links to transient projects/... artifacts. Please repoint these to stable architecture/package docs to avoid future dead links after workspace cleanup.

Based on learnings: “Ensure that all READMEs and system documentation under any 'packages' or 'docs' directory do not reference transient project artifacts located under a 'projects' directory.”

Also applies to: 71-72

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/3-extensions/supabase/README.md` around lines 63 - 65, Update this
README.md to remove transient "projects/..." links and replace them with stable
documentation/package references: change the `projects/postgres-rls/spec.md`
link used in the "postgres-rls" line to the durable package or architecture spec
for RLS, replace the `projects/explicit-namespace-dsl/spec.md` link referenced
in "explicit-namespace-dsl", and repoint the `ADR 226` and cross-contract FK
link (`supabase:auth.AuthUser`) to the canonical ADR or architecture docs
location; do the same for the other occurrences noted at lines 71-72 so the
README only references long-lived docs or package docs rather than any
`projects/` paths.

Source: Learnings

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, and the rule is right — but these point to sibling projects that haven't shipped yet (postgres-rls, explicit-namespace-dsl, the umbrella, extension-supabase), so there's no durable doc to repoint them at. The cross-contract-refs link on the line above was repointed to ADR 226 because that project just shipped its durable docs. The pattern this close-out follows is: each durable→project link gets repointed at that project's own close-out (which is what just happened here for cross-contract-refs). Repointing the others now would mean pointing at docs that don't exist yet. Flagging to the operator to confirm — left as-is for now since they're live (not yet dead) links to shaped-but-unshipped work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wmadden-electric, that makes sense — the pattern is sound. Links to in-progress sibling projects are live references with no durable target to substitute yet; repointing at close-out is the right moment. I'll record the nuance so future reviews don't flag these prematurely.

🐇 ~


✏️ Learnings added
Learnt from: wmadden-electric
Repo: prisma/prisma-next PR: 770
File: packages/3-extensions/supabase/README.md:63-65
Timestamp: 2026-06-08T14:47:33.413Z
Learning: In `packages/3-extensions/supabase/README.md` (and similar package READMEs in prisma/prisma-next), `projects/` links to sibling projects that have **not yet shipped** are acceptable — there is no durable doc to repoint them to yet. The convention is: each `projects/` link gets repointed to its canonical durable doc (ADR, subsystem doc, or package README) only at that project's own close-out PR. Do not flag unshipped-project links as violations of the "no transient project references" rule; only flag them once the project has shipped and the durable doc exists.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: wmadden
Repo: prisma/prisma-next PR: 746
File: examples/supabase/tsconfig.json:2-2
Timestamp: 2026-06-06T19:15:12.496Z
Learning: In the prisma-next monorepo, tsconfig.json files should extend the base config using the scoped package name with the `@` prefix: `"extends": ["prisma-next/tsconfig/base"]`. Do NOT use `"prisma-next/tsconfig/base"` (without `@`) — that will fail to resolve. Do not reference relative paths to the root tsconfig.base.json; prefer the package-based extension for maintainability across the monorepo.

Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-08T11:12:59.729Z
Learning: Applies to **/*.{md,mdc} : Keep docs current (READMEs, rules, links): `.agents/rules/doc-maintenance.mdc`.

Learnt from: wmadden
Repo: prisma/prisma-next PR: 51
File: agent-os/specs/2025-12-05-db-init-command/verifications/branch-3-runner.md:20-20
Timestamp: 2025-12-28T05:53:44.429Z
Learning: In code reviews across the repository, preserve the domain-specific term "SQL family instance" when referring to an instantiated SqlControlFamilyInstance that provides control-plane operations. Do not replace it with generic terms like "database connection" or "configuration". Treat this phrase as an architectural concept consistently used throughout the codebase.

Learnt from: wmadden
Repo: prisma/prisma-next PR: 193
File: packages/1-framework/2-authoring/psl-parser/README.md:57-57
Timestamp: 2026-03-01T16:19:49.924Z
Learning: Do not reference transient project artifacts (e.g., under projects/ such as specs, plans, milestone documents) from durable system documentation (package READMEs, architecture/docs under docs/). Remove or replace these references with links to stable architecture docs or package-level documentation that ages well as milestones evolve. Apply this pattern to all Markdown documentation files (READMEs and docs) across the repo.

Learnt from: wmadden
Repo: prisma/prisma-next PR: 193
File: packages/2-sql/2-authoring/contract-psl/README.md:72-73
Timestamp: 2026-03-01T16:20:08.178Z
Learning: Ensure that all READMEs and system documentation under any 'packages' or 'docs' directory do not reference transient project artifacts located under a 'projects' directory. Project planning docs, specs, and milestones are ephemeral and should not be linked from durable documentation. If cross-references are necessary, link only to stable, versioned, or archived artifacts, and clearly indicate any transient references to aid long-term maintenance.

Learnt from: wmadden
Repo: prisma/prisma-next PR: 234
File: packages/3-extensions/sql-orm-client/README.md:22-24
Timestamp: 2026-03-23T10:03:25.419Z
Learning: In prisma/prisma-next documentation (e.g., READMEs and architecture docs), treat `ExecutionPlan` and `SqlQueryPlan` as intentionally distinct types and do not recommend collapsing/merging them into a single term. `ExecutionPlan` is a contract-level type from `prisma-next/contract`, while `SqlQueryPlan` is a lane-level type from `prisma-next/sql-relational-core` that carries the AST, params, and meta; both are actively used and map to different architectural layers.

wmadden and others added 3 commits June 8, 2026 16:42
…stem doc, drop rulecard

- Remove ForeignKeyReference class block from subsystem doc (ADR-level detail); replace with a plain behavioral sentence + ADR 226 link
- Rewrite "lowering boundary (Contract IR → Schema IR)" jargon as plain English
- Rename supabasePack → supabaseExtension in TS examples (import + extensionPacks usage)
- Add native-type matching subsection to authoring surfaces (PSL @db.X type-constructor rule, Postgres rejection, TS field builder guidance)
- Delete .agents/rules/cross-contract-fk-authoring.mdc; run pnpm rules:sync to remove symlinks
- Remove trailing rulecard reference from subsystem doc authoring section
- Remove two cross-contract-fk-authoring rulecard references from ADR 226

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…upabase README diff

TML-2500 M4 updated packages/3-extensions/supabase/README.md (link
from old project spec to canonical docs + ADR 226). The
check:upgrade-coverage gate requires the instructions.md to be touched
whenever packages/3-extensions/ is in the diff; adds the HTML comment
noting this is an incidental docs-only change.

Signed-off-by: Will Madden <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric enabled auto-merge (squash) June 8, 2026 14:52
@wmadden-electric
wmadden-electric merged commit 4e34d66 into main Jun 8, 2026
19 checks passed
@wmadden-electric
wmadden-electric deleted the tml-2500-m4-docs-closeout branch June 8, 2026 14:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants