10 KiB
Implementation routing 2026-10-22 — storage-cors-3
Dispatch independently reproduced all7 scratch scenarios using dispatch imports at7369f1fe (runtime diff0 vsc5b678f7):3pass/4fail, naturalexit1/29.89ms/network0. Temporary ownership ONLY js/nostr/videoEventBuffer.js and js/services/nostrService.js plus new uniquely named focused regression/integrity/evidence files. This supersedes investigation-only restriction for these two boundaries; existing client.js and app/feedCoordinator.js remain read-only.
Separate commits: first buffer timestamp-safe deletion (recordTombstone already protects strictly newer active content; remove no valid newer version), then service snapshot/persistent eligibility + obsolete affected-record cleanup. Retain failed baseline and independently failing mutants for every new scenario. Do not invent root/address/author rules or broaden deletion across authors; use existing authoritative tombstone semantics and verified conversion path. Cover deletion-marker ID differing from original; late older tombstone against newer live; late older content; multiple versions/unrelated roots/authors; deleted/invalid persistent entries; empty-result persistence so deleted-only caches do not resurrect; warm/second-load/latest-consumer and stale-subscription controls. Preserve live cache/moderation/access/ordering and publication semantics. Report any preexisting identity weakness separately rather than opportunistic rewrite.
Coordinator stale-refresh result remains OPEN: current scratch pauses actual feed engine decorator and calls actual coordinator, but is not full registered UI lifecycle proof. Gather faithful registered-feed/view/disposal overlap evidence only after first fixes; no coordinator/app edits yet. No tests/runner/helpers changes to bypass contract. If new test needs explicit registration, ask dispatch for narrow ownership. Run focused suites, failing restored mutants and lint; request serialized full gate before product submit; QA holds narrow Firefox browser slot. Normal gates/durable ancestry mandatory. No real signer/cloud/relay/deletion/credential operations.
Current assignment 2026-10-22: storage-cors-3 — feed/view tombstone stale-refresh
Supersedes old idle/storage2 and deferred3 scope below. Read dispatch campaign brief, PROGRAM/RULE-CHANGES/KNOWN_ISSUES and docs/nips before Nostr investigation. Inspect own worktree and safely fast-forward clean branch to unstable; preserve any unexpected work; report SHA, claim item3, send read/next-action. Read actual tombstone/deletion/cache/view lifecycle; reproduce delete ingest followed by stale refresh/late older event/view switch with synthetic offline events/controlled IO. Check unrelated live/newer valid content and existing deletion semantics; do not invent new policy. Source read/scratch/unique evidence/backlog only; NO product/committed test edits until demonstrated defect and precise ownership routing. App/feed/services/Nostr shared modules remain read-only for now. No real signer/relay/cloud/credentials/delete; no browser/build/full suite/normal product submission yet, QA owns initial expensive/browser slot. Focused offline checks permitted, env -u NODE_TEST_CONTEXT. Report path and strict failed/control counts or already-fixed evidence, proposed smallest files/retained regression and remaining limits. No optional new storage work after this slice without campaign routing.
Archived assignment history (not current routing)
Area: Storage CORS reliability (storage-cors)
Current assignment: storage-cors-2 — best-effort cleanup metadata guard
Investigation independently confirmed by dispatch:actual R2Service.resolveConnection→StorageService metadata→deleteVideoStorage rejects2 malformed cached cases(bucket number/publicBaseUrl object),6 controls pass,zero network attempts. /tmp/bitvid-dispatch-delete-audit.mjs exit1(expected0 rejections,actual2) after controls. App/edit callers catch this,so do not claim note deletion itself blocked. Best-effort/no-throw cleanup contract is violated.
Temporary explicit product ownership for this item overrides prior roster exclusion ONLY for deleteVideoStorage in js/services/r2Service.js,plus new focused tests/storage-delete-malformed-settings.test.mjs and unique integrity/evidence. Normalize only primitive strings/validate malformed fields safely;preserve structured skip/result semantics,never coerce arbitrary objects into URL/credentials,never widen owner base or content-addressed key collection. Cover malformed cached resolution and meaningful direct caller/settings types,valid owned/external+prefix-sibling,locked/external,partial failure and generic-S3/provider controls. No blanket catch masking valid-operation failures without structured result. No real SDK/cloud/delete calls.
Mirror rule decision from actual code:duplicated upload hashing/magnet logic stays untouched in BOTH services. s3UploadService has NO deleteVideoStorage counterpart (dispatch rg verified);the existing provider-aware R2Service delete method already handles genericS3. Do not add a duplicate delete implementation or unrelated upload edits merely to touch two files. Explain this in integrity/decision evidence and prove both supported provider paths;if a duplicated affected counterpart is found,route before edits. No s3UploadService write without that evidence.
Read test integrity;new retained real-service regression must reject old helper (all affected malformed cases),mutants restored. Focused existing delete/key suites+lint/build;no full/browser until dispatch slot. QA actual-app baseline gets next bounded browser slot;you may implement/focused now. Commit item2,merge verified unstable,normal full gate/durable ancestry then close. No upload/CORS/retention-policy/features/owner-bucket behavior changes. Feed audit deferred3,not cancelled. Send ready/blocker/landing/final with exact claims and limits.
Archived completed assignment: storage-cors-1 — preservation fix routed
Implementation routed after worker and independent dispatch offline reproduction: adding second origin replaces the entire existing rule, existingRulesPreserved0/1. Dispatch command env -u NODE_TEST_CONTEXT node /tmp/bitvid-dispatch-storage-cors-reproduce.mjs exits1 at strict false!==true after all5 characterization controls. No cloud IO.
Now implement only s3-multipart.js plus GetBucketCorsCommand export in s3-client.js and new storage-cors-preservation test/integrity note. Preserve every existing rule and all fields verbatim; add a separate existing-default-shaped rule for uncovered requested origins without broadening arbitrary rules. Idempotence: no PUT when existing equivalent default rule already covers all requested origins; explicitly test equivalent-rule detection and repeated calls. Missing config only on NoSuchCORSConfiguration; other read failures propagate with no PUT. Do not guess wildcard equivalence or merge restrictive/custom rule semantics. Preserve empty-origin no-op. Tests must use actual helper/command export, fake transport only, cover existing rules/wildcards/duplicates/no-config/read-denied/idempotence and bounded provider errors; do not silently replace on read failure. Do not change current default methods/headers/TTL as unrelated policy; if SDK/provider limits make safe preservation impossible, report before broadening. Offline mutants for every new scenario; preserve normal assertions/gates. Relevant focused storage suites/lint/build; request full-suite slot (client ahead), no browser/cloud need. CLI/test/lander launches clear NODE_TEST_CONTEXT. Commit item1, merge unstable, normal queue/durable ancestry before close; no premature qualification of real S3.
Historical investigation context follows; its before-product restriction is superseded by the routed scope above.
Bounded parallel trial: validate todo/TODO_2026-06-16_r2-followups.md CORS replace-not-merge report at current HEAD. Dispatch inspected ensureBucketCors in js/storage/s3-multipart.js: constructs PutBucketCors with requested origins only, no GetBucketCors. This is evidence for investigation, not proof every caller loses policy. Trace actual callers and required existing-origin behavior. Reproduce offline via real helper and fake S3 transport/SDK boundary: an existing origin/rule, adding a second origin, idempotent repeated call, missing config and read-failure cases. No cloud credentials/network/bucket mutation.
First report smallest demonstrated loss plus proposed preservation semantics/files to dispatch before product changes. Inspect AWS command export in s3-client read-only. You own s3-multipart.js/s3-client.js and new tests/storage-cors-preservation.test.mjs only after fix routing; no R2/S3 upload service copies, app, signer or UI edits. Existing wildcard/method/header/non-origin rule semantics must not be guessed; read failure must not silently overwrite a policy. Do not add broad SDK/dependency upgrade. If stale/already fixed, close with evidence and propose next independent TODO. No browser initially. Relevant focused storage checks, lint, full normal gate/build after approved fix; ask dispatch before expensive runs. Integrity notes docs/testing/storage-cors-integrity.md.
Coordination and limits
Send dispatch a read/next-action acknowledgement immediately, then claim your item and keep .task current. Record start/end UTC and time blocked by tools/browser/gates. Report exact SHA/commands/counts/unverified scope; mailbox on blocker, reproduced result, landing and final. Read RULE-CHANGES, PROGRAM, KNOWN_ISSUES, repo memory, and test-integrity before changes. New tests require failing mutants; no weakened expectations/retries/sleeps. Product/test fixes must be scoped from demonstrated evidence. No shared TEST_INTEGRITY.md or docs/TODO.md edits: keep uniquely prefixed integrity/evidence notes under docs/testing and ask dispatch to integrate status. Do not edit another area worktree or stop another process. Full-suite runs and product landings need dispatch resource coordination (one expensive gate at a time, unchanged normal landq). Focused offline checks can overlap. Commit named files via fleet tool; merge unstable, never rebase; normal queue/durable status+ancestry before close. No subagents initially. No deploy/push/spend/real-wallet/production-data/secrets/scheduler/kit changes. Preserve preview3000. Public network/real buckets/signers/peers forbidden in fixtures.