feat(assets): immediate per-bind asset upload (Asset-B4 close-out)#93
Merged
Conversation
A freshly-bound asset's chunks now push to the durable node the moment its asset_refs row lands (when the blob plane is live), instead of waiting for the next relay state change. The connect-time drain still subsumes this for correctness; the new onAssetBound hook is the latency path. Fires only for refs the reconcile CREATED (never pre-existing), contained per-invocation, per-pair in-flight dedupe against the drain. Shared assetUploadDeps builder extracted (drain + immediate = 2 call sites). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes out Asset-B4 — the last open item from the lazy-fetch lifecycle: an immediate per-bind upload trigger.
What
onAssetBoundpost-commit hook on the entities service: fires ONLY forasset_refsrows the reconcile created (never pre-existing ones, so a no-op property update can't re-trigger), contained per-invocation like the sibling hooks.uploadBoundAssetNowin main: single-pair push via the existinguploadBoundAssetIfPendingwhen the blob plane is live; per-pair in-flight dedupe against the connect-time drain; fail-safe logging.assetUploadDepsbuilder extracted (drain + immediate — 2 call sites, per the DRY rule).Why the drain wasn't enough
The connect-time drain subsumes per-bind for correctness but only runs on relay state changes — an asset bound mid-session waited for the next reconnect before its bytes reached the durable node. This is the latency path.
OQ-238
Stays resolved as landed in pt.1: no separate
assets.bindcapability — the entity-write gate that authorized the property write authorizes the ref reconcile; serve-side access enforcement is OQ-237 (Asset-B7 territory). Docs updated in the harness plan alongside this PR.Tests
🤖 Generated with Claude Code