Repository navigation
Closed
Labels
area:docsTouches the docs areaarea:serverTouches the server areaready-for-agentFully specified, ready for an AFK agent
Description
Parent
Auth: Clerk, companies and machine tokens on tier 0, spec §4.
What to build
The prefactor: the operator's routes, the admin scope and pins leave before the schema is rewritten, so the data ticket after this one moves tables and nothing else. After this PR the API is mint, me, upload and delete; a bearer token has no scopes to check and no route acts on another bearer's token; nothing on the instance can be pinned.
Do
- Remove from the wire and the server:
GET /api/patches/:patchId(the moderated read),GET /api/principals/:principalId/patches,POST /api/patches/:patchId/disable,POST .../pin,POST .../unpin; the schemasModeratedPatch,PatchView,PrincipalPatches,Pinned,DisableRequest;hasScopeand every scope check (uploadanddeletebecome owner-only by the token's principal, as they are for a non-admin today); the scope-shapedForbiddenrefusal text.POST /api/tokensandPOST /api/tokens/:apiTokenId/revokego in the same PR, withCreateTokenRequest,CreatedTokenandRevokedToken: their only guard was the admin scope, and a revoke-by-id route with no guard would let any bearer revoke any token between this PR and the next. Nothing calls them but thepatchy-mint-tokenskill, which is deleted here with its line indocs/SKILL_DISTRIBUTION.md. The self-service mint and/api/mestay until the data ticket. - Remove pins whole:
Patches.setPinned,findForModeration,listByPrincipal,disable, theModerationOptions; thepinned_atcolumn and its partial index from the patches baseline (edit the baseline in place: nothing is deployed, andpnpm dev resetis the documented answer to a ledger that changed shape); the pin term in the not-expired predicate and in the sweep. patch.disabledleaves the analytics events;patch.deletedloses itsadminproperty.- Re-render
docs/API.md; the CLI README and thepatchyskill lose nothing here (neither documents these routes), but check. - Glossary: Pinned patch and Moderation leave
packages/patches/CONTEXT.md; Retire and Delete lose their "reached by moderation" and "or operator" clauses; the intro's route list shrinks.docs/product.md§ The operator gains the one line from The operator is Patchy, not a token: its surfaces are a separate login and separate dashboards, never a company in the product and never in thepatchyCLI.packages/companies/CONTEXT.md's Operator entry gets the same line. - Tests: delete the moderation and pin suites; keep the sweep's suite green without the pin case.
Surfaces
The wire contract; vocabulary and product shape; migrations (the baseline edit is not a new record, so the three migrator call sites are untouched); reverse states (pin and unpin leave together).
Done when
-
pnpm test,pnpm typecheck,pnpm lintand the packed e2e pass. -
docs/API.mdlists four routes and noAdmin scopesentence anywhere. -
grep -r pinned_atandgrep -r hasScopefind nothing outside git history. - The glossary and product edits above are in the same PR.
Decisions implemented
The operator is Patchy, not a token; spec §4.
Blocked by
None (can start immediately).
Metadata
Metadata
Assignees
Labels
area:docsTouches the docs areaarea:serverTouches the server areaready-for-agentFully specified, ready for an AFK agent
Activity
chore(patches): remove operator routes and pins