6.8 KiB
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.