fix(share): allow explicit short links for small plans - #1475
Conversation
Fixes backnotprop#1427. Make short-link creation available for every shareable small plan while preserving explicit uploads, immutable pastes, and current-content encryption.
Correction to my earlier rerun advice: the failure is now reproduced and fixed in
Minimal reproduction, confirmed on both macOS and Linux with Bun 1.3.14: bun test apps/opencode-plugin/plan-review-lifecycle.test.ts packages/server/annotate.test.tsBefore: the exact four CI failures. The correction resolves all seven plan/history path constructions at use time. A regression changes data-directory overrides after import and checks isolated writes/read visibility; it fails against the original code. No polling, sleeps, skipped tests, or weakened assertions were added. Verification: unprivileged Linux ordered three-file suite 83 pass, 0 fail; this branch's local full suite 4,303 pass, 907 skip, 0 fail, plus typecheck. Local full-suite environment uses a disposable HOME and the pinned Bun 1.3.14; upstream Actions verifies the Linux CI environment. Independent Standards and Spec reviews found no issues. Final upstream verification: all checks on the corrected head are green (publication-only jobs are intentionally skipped on PRs). Test workflow and Release build/smoke workflow both passed, including Linux/macOS/Windows binary smoke checks. No maintainer rerun is needed. |
Resolve plan and history paths from the active data-directory configuration instead of capturing a temporary test override at import time. This reproduces and fixes the four order-dependent annotate CI failures reported in backnotprop#1464; keep both successful persistence and failed-write draft recovery assertions intact.
|
Reviewed in depth - the feature itself passes: privacy contract holds (upload only ever fires from the button's onClick, no effect/retry path; PLANNOTATOR_SHARE=disabled suppresses the whole tab so the button can never render), revert-verification confirms the new tests genuinely guard the feature, and the stacked storage.ts change is byte-identical to #1473's. One blocker before merge: the new test "offers an explicit replacement for an edited small incoming encrypted snapshot" is flaky - 6 failures in 10 runs of the exact CI invocation ( Suggested fix: wait on content rather than URL inequality - poll until Two optional cosmetic notes, non-blocking: the small-plan button renders inside the amber warning container with no warning text (a neutral container might fit better when Happy to merge as soon as the flake is fixed - everything else is done. |
|
Addressed in
|
Fixes #1427.
Summary
Offer Create short link for every shareable small plan, not only after a previous link was invalidated. This resolves the issue's open UI choice without adding invalidation-history state.
The production change removes only the size-based action gate in
ExportModal; large-URL warnings remain size-gated. Existing sharing capabilities, payload/encryption, immutable-paste lifecycle, and generation callback are unchanged. Creation still requires the explicit button click—no automatic uploads.Verification
DOM_TESTS=1, Bun 1.3.14). Cover fresh-small eligibility, stale incoming link invalidation, explicit replacement, decrypting current annotations, original-paste immutability, and disabled/unsupported capabilities.bun testwith repository-pinned Bun 1.3.14, disposable HOME, and local macOS environment (CIunset): 4,302 passed, 907 skipped, 0 failed. An earlier concurrent run hit the unrelated Pi stdio timeout; that test passed independently and the complete suite then passed.bun run typecheck,git diff --check, and review → hook production builds: passed.No pending PR addressing this issue was found in the open-PR inventory or issue timeline before starting; the inventory was rechecked before publication.
CI correction (
3cbe5712)Resolved the import-order bug behind #1464: storage now resolves the active data directory for every plan/history read and write instead of retaining an early test's temporary override. Added a regression for changing that override after import; no sleeps, retries, or weakened assertions. The ordered OpenCode→annotate reproduction fails four tests before this fix and passes after it on both macOS and Linux. Unprivileged Linux verification: 83 pass, 0 fail. Latest local full suite: 4,303 pass, 907 skip, 0 fail; typecheck passes.