feat(contracts): API tab showing declared operations and what each stage serves #568
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!568
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/contract-operations-tab"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Phase 2b: read the ingested contract back. The tab is sourced only from the compiled contract, so it cannot drift from the code that produced it — which is the whole point of Phase 1.
Stacked on #567 (which is stacked on #564). Base is
feat/contract-ingest, so this diff is only the read side.Plan: https://7n04n7hhuesf.postplan.dev — Phase 2, tasks 2.5–2.6.
The stage join is the commit
contract.forAppreturns the newest snapshot, its operations grouped for display, and one row per stage saying which contract that stage is actually serving. The join key is the commit, not a foreign key: a contract is a fact about a revision, and a deployment records the revision it runs, so the two meet without either side knowing about the other.That gives three states per stage, and the middle one is the interesting one:
currentbehindno contractforAppreturnslatest: nullrather than throwing when nothing has published. An app with no Effect contract is normal, not an error.UI
A new "API" tab listing operations by group with method, route, visibility, resolved authentication, p99 target and status codes. It flags an operation whose declared authentication its middleware does not back, which is the drift Phase 1's compiler detects.
It is a lazy tab, so
app-detail-tabs.behavior.test.tsxgains its mock — without that the existing test breaks.Verification
22 new tests. The projection helpers (
groupOperations,resolveStageContracts) are exported and tested directly rather than through a mocked database; grouping sorts rather than trusting read order, because Postgres does not promise one. Typecheck clean across api and web.🤖 Generated with Claude Code
271e1d07a638660c898f38660c898fd17f328394