Screenshot guardrails: name every screenshot not COMPLETE on 409 ASSET_IN_POST_PROCESSING (submit, validate; stuck after 5 min in UPLOAD_COMPLETE), apple screenshots --repair-stuck replaces only those in place, part uploads without Expect: 100-continue (failed part deletes the reservation, one retry, never committed), storebound api --confirm <operationId> for agents' plain writes (never owner-only)

This commit is contained in:
CRTkafa 2026-10-21 12:40:26 +07:00
parent 164182012f
commit 00756e6908
19 changed files with 475 additions and 45 deletions

View file

@ -32,6 +32,7 @@ import { createOnce } from '../lib/upsert';
import { elapsed, heartbeat, type HeartbeatOptions, mb, share, withHeartbeat } from '../lib/progress';
import { pump } from '../lib/runner';
import * as rt from '../lib/rt';
import { partHeaders } from './screenshot-health';
const TAG = 'upload';
@ -94,8 +95,7 @@ export async function sendParts(o: SendPartsOptions): Promise<void> {
try {
for (const [i, op] of o.ops.entries()) {
current = i + 1;
const headers: Record<string, string> = {};
for (const h of op.requestHeaders ?? []) headers[h.name] = h.value;
const headers = partHeaders(op);
const body = new Uint8Array(slice(o.file, op.offset, op.length));
for (let attempt = 1; ; attempt++) {
const left = o.deadline - now();