Repository navigation
feat(serving): give patches readable company addresses - #211
Conversation
Astra reviewReviewed StandardsNo merge-blocking method or YAGNI findings. Name allocation uses the unique index inside the publish transaction; the existing Patches, Content and Door boundaries are retained. The content URL, tier-specific CSP and route handoff are explicitly requested by #195, not unrequested future machinery. SpecNo merge-blocking intent findings. The change covers company-scoped names, explicit-name refusals, filename-derived collision suffixes, name preservation on updates, rename redirects and reclamation, deletion freeing names, address/version/content routes, and the CLI/wire/documentation cutover. Higher-tier publishing remains refused. Verification:
Summary: Standards: 0 blockers, worst issue: none. Spec: 0 blockers, worst issue: none. |
|
Review of #211 against #195 ( StandardsDocumented
Smells (judgement)
Shotgun edits match “Hit every surface”; not a smell here. No UI-consistency findings. No Effect import/runtime/Schema-compile breaches. Spec(a) Missing or partial Done when: “a rename redirects the old name with 308 until a new patch takes it, after which the redirect is gone for good.” Done when: “ Spec: “ Done when: “two patches racing for one name leave one winner.” Spec: “delete frees it.” Spec: “ (b) Scope creep Content URLs send (c) Implemented but wrong None beyond the untested Issue 195 intent vs what landed#195’s admitted-at-merge line is the product: every patch has a name and an address; nothing else changes in what serves. That is what landed. Identity stays the id. The share link is The only real intent gap is proof, not shape: the done-when cases above are implemented and mostly untested on the HTTP path. A user or agent gets the experience 195 promised: open MethodThe method is the right small one. Uniqueness lives only on INSERT INTO patch_names (company_id, name, patch_id, current)
VALUES (...)
ON CONFLICT (company_id, name) DO UPDATE
SET patch_id = EXCLUDED.patch_id, current = true
WHERE NOT patch_names.current
RETURNING nameNo pre-check. Empty Rename claims the new name before retiring the old. That is the opposing-rename deadlock fix, and the test actually holds both Routing is one
No correctness bug in the claim/rename protocol. This is the smallest model that makes “the index is truth, claim is atomic, rename cannot swap” unsurprising. YAGNIKeep. Cut or simplify.
A partial unique index on Tests to add, not smoke: HTTP 308 + reclaim-by-second-patch, Standards: 7 findings (3 documented, 4 smells). Worst: Spec: 7 findings (6 missing/partial coverage of done-when, 1 scope-creep). Worst: |
|
Addressed the reviews in 5f8d093. Read both discussion comments, the Reviews tab, and inline review comments; the latter two were empty. No new review findings appeared after the push. Fixed
Kept, with reasons
Verification and merge state
|
Implement #195 on the existing publish stack: atomic name claims and redirects, address and content routes, CLI --name, seed backfill, and updated contracts.
5f8d093 to
8b8798f
Compare
…212) Patch-owned resources need a durable home separate from platform records, without creating databases for companies that only publish primitive-free patches. Add lazy, resumable company-database provisioning with bounded connection pools and transactional patch locks. Keep resource inventory consistent with schema changes, reclaim orphaned namespaces and files, and provide the same inventory services through a directory-backed PGlite development layer. Wire migrations and configuration through the server, dev runner and test harnesses. Stacked on #211 (`sdk/195-addresses`); this PR intentionally targets that branch and contains only the company-database work. Uses `0005_company_database_baseline` because `0004_invites_expiry` already occupies the issue's proposed migration number. Closes #196. ## Verification - `pnpm lint` — passed. - `pnpm typecheck` — passed. - `pnpm test` — 395 tests passed across 41 files. - Postgres and PGlite coverage includes provisioning recovery, capacity exhaustion, inventory consistency and orphan reclamation. Implemented with GPT-6 Astra in the Oh My Pi harness.
The /d links were replaced by readable addresses in #211. Without the leftover route, /d/<x> still answers the HTML 404 through the address handler (no company handle is one character). The bare-handle 404 moves into the catch-all test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit d1e7cbf2c9d7cfe4ae70a415d80b064c34d1dc48)
Patches still used opaque
/d/<id>links. Every patch now has a company-scoped name and a readable address, without changing who can open it or how tier-0 pages render.Publishing assigns names atomically, preserves them on file updates, and supports explicit renames with
--name. Old names redirect until reclaimed; deletion frees them. Address, version and internal content routes preserve the existing door and cache rules, and/d/*now returns 404. The wire contract, seed backfill, CLI, docs and public skill are updated together.Stacked on #210 (
sdk/194-publish, issue #194). This PR builds on its existingpublishflow and must land after it.Closes #195.
Verification
Implemented with GPT-6 Astra in the Oh My Pi harness.