Repository navigation
feat(patches): make publishing replay-safe - #210
Conversation
Astra reviewReviewed StandardsNo merge-blocking method or YAGNI findings. Spec
VerificationExercised the source CLI with a loopback HTTP stub and disposable state:
These reproduce CLI behavior, not live-server E2E. No source files changed; temporary state and probe removed. Summary: Standards: 0 blockers. Spec: 3 blockers; worst is replay publishing saved content under a different user/company. |
Code review — PR 210 vs issue #194Reviewed along two axes (Standards, Spec) plus method, YAGNI, and replay-safety, because #194's job is a prefactor: one publish verb, a version record that can carry every later tier, and a lost acknowledgement that must not mint a second version. Intent match. The ticket asked for file-mode Standards
Vocabulary (patches CONTEXT.md). Avoid upload. Left in hunks this PR edited: UI ( CLI / ADR-0004 shape. Pending persist, replay-before-file/release, Smell (judgement): SpecCore contract is present: (a) Missing or partialNone against ticket 194. (b) Not asked forPending-object machinery. Ticket: “tier and content checks → the existing create-or-update path.” Diff adds Extra version column. Spec §8 lists Config surface. Wire leftover. Spec §8 success body has no (c) Implemented but wrongRefused bytes are no longer rolled back immediately. Old path deleted the object on Replay is not the stored JSON bytes. Ticket: “same digest: the stored response verbatim.” Handler stores MethodThe model is the right smallest one for the real constraint (one version per attempt; a lost 201 must not mint another). Storing the success body on the version row, unique on
CLI persist-whole-attempt, resent first, clear after cache apply, keep on 5xx / failed cache write: smallest durable recovery, and the tests for lost 201 after a release change and failed cache write are the ones that matter. The pending-object table is the heavier half. The old comment in YAGNIBeautiful and small:
Heavier than this ticket needs:
Replay-safetyServer invariant holds for lost 201/200 (including after a release change), digest mismatch → 409, identical concurrent creates (including quota=1), unreferenced-object reclaim, and committed bytes surviving a lost ack. CLI hole in Auth and body-read run before replay. A 401 on the retry never sees the stored success. 429 is not a settled outcome of this key: new attempts consume Clear only payload-definitive refusals ( Surfaces (#194 + hit-every-surface)Hit: wire ( Leftover upload as product language in files this PR already touched ( Summary
I would keep the stored-response design and the CLI persist-and-resent. I would fix the 4xx-clear before merge, encode the success body through the schema (and return that on replay), and treat |
|
Addressed both review comments in f71264f, with the concurrency model corrected in 2282a57 ( Fixed
Kept, with reasons
Verification
Packaging correctionCI on f71264f exposed a real packaging defect: Final CI: all six required checks passed on latest head |
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 existing `publish` flow and must land after it. Closes #195. ## Verification - 361 tests across 38 files; typecheck, lint, build and formatting passed. - Packed CLI end-to-end flow and isolated real-server/browser checks passed. - Standards and spec reviews completed. The opposing-rename deadlock was reproduced on PostgreSQL, fixed and covered by a regression test. Implemented with GPT-6 Astra in the Oh My Pi harness.
Publishing needs a manifest and version record that can carry every runtime tier, and retrying after a lost response must not create another version.
Replace upload with manifest-based publish and durable CLI recovery. Store the original response for replay, stamp each version, and reclaim failed publish objects without deleting committed content. This change admits only tier 0 with no provisioned resources and updates the CLI, docs, skills, and baseline migration together.
Stacked directly on
main; the PR base ismain.Validation:
pnpm lint,pnpm typecheck,pnpm test(345 tests), andpnpm test:packed-cli-e2epassed. Standards and specification review findings are resolved.Closes #194.
Implemented with GPT-6 Astra in the Oh My Pi coding harness.