~bigbes/sr-ht-ecore · parade

main · last commit 18 hours ago · 7bghjra2

← Back to the parade

sr-ht-ecore-c6h Add Flush and a stamping ReadFrom to assets.writer; fix its stale Unwrap comment Lined Up

status: open P2 bug
bd update sr-ht-ecore-c6h --claim bd close sr-ht-ecore-c6h
Created byEugene Blikh
Ownerbigbes@gmail.com
Created2026-08-17T20:36:19Z
Updated2026-08-17T20:36:19Z
Description
What is wrong: two defects in sr-ht-ecore/assets/assets.go::writer. (a) writer stamps the asset cache policy at commit time but hooks only WriteHeader and Write, not Flush — the exact shape fixed once in mcphttp (3bd158f) and once independently in artifacts (6c44e03). A response committed through a flush would leave without the asset's cache-control headers. (b) middleware.startTracker.ReadFrom exists specifically so static assets aren't a buffered copy loop, but in the documented wiring assets.writer sits inside startTracker directly under ServeContent, so the copy sees *assets.writer, finds no io.ReaderFrom on it, and startTracker.ReadFrom is never reached — a real performance regression against its own doc-comment's stated reason for existing.

Why it matters: (a) fails safe today (unreachable because http.FileServer/ServeContent never flush before writing) but is worth closing before it becomes a live bug a third time, as it already has twice elsewhere. Also, assets.writer.Unwrap's doc comment carries the same sentence 00d7582 retracted in mcphttp, and it is only true here because of this same missing Flush — so fixing (a) makes the comment wrong too and both must move together. (b) is a pure, currently-live performance regression.

Correct variant: sr-ht-ecore/mcphttp/cache.go::cacheWriter (all three commit hooks plus the corrected Unwrap wording) and sr-ht-ecore/middleware/middleware.go::startTracker (which additionally has Hijack and ReadFrom).

Fix: add func (w *writer) Flush() { w.stamp(); _ = http.NewResponseController(w.ResponseWriter).Flush() } and a ReadFrom that calls w.stamp() first; rewrite the Unwrap doc comment to mcphttp's corrected wording.

Confidence: verified (method sets tabulated across all three ecore wrappers).

Audit: D15 (cross-repo audit, 2026-08-17)

Depends on

No outgoing dependencies.

Depended on by

Nothing depends on this issue.

No comments.

  • Eugene Blikh created the issue · 2026-08-17T23:36:19Z
Stored rows — what this pane was built from, as read
issues 1 row
id sr-ht-ecore-c6h
content_hash 98b5db48f712ccd79a818a6e116c2e791c80fb936da39eacb3e1c3efa743705e
title Add Flush and a stamping ReadFrom to assets.writer; fix its stale Unwrap comment
description What is wrong: two defects in sr-ht-ecore/assets/assets.go::writer. (a) writer stamps the asset cache policy at commit time but hooks only WriteHeader and Write, not Flush — the exact shape fixed once in mcphttp (3bd158f) and once independently in artifacts (6c44e03). A response committed through a flush would leave without the asset's cache-control headers. (b) middleware.startTracker.ReadFrom exists specifically so static assets aren't a buffered copy loop, but in the documented wiring assets.writer sits inside startTracker directly under ServeContent, so the copy sees *assets.writer, finds no io.ReaderFrom on it, and startTracker.ReadFrom is never reached — a real performance regression against its own doc-comment's stated reason for existing. Why it matters: (a) fails safe today (unreachable because http.FileServer/ServeContent never flush before writing) but is worth closing before it becomes a live bug a third time, as it already has twice elsewhere. Also, assets.writer.Unwrap's doc comment carries the same sentence 00d7582 retracted in mcphttp, and it is only true here because of this same missing Flush — so fixing (a) makes the comment wrong too and both must move together. (b) is a pure, currently-live performance regression. Correct variant: sr-ht-ecore/mcphttp/cache.go::cacheWriter (all three commit hooks plus the corrected Unwrap wording) and sr-ht-ecore/middleware/middleware.go::startTracker (which additionally has Hijack and ReadFrom). Fix: add func (w *writer) Flush() { w.stamp(); _ = http.NewResponseController(w.ResponseWriter).Flush() } and a ReadFrom that calls w.stamp() first; rewrite the Unwrap doc comment to mcphttp's corrected wording. Confidence: verified (method sets tabulated across all three ecore wrappers). Audit: D15 (cross-repo audit, 2026-08-17)
design
acceptance_criteria
notes
status open
priority 2
issue_type bug
assignee NULL
estimated_minutes NULL
created_at 2026-08-17T20:36:19Z
created_by Eugene Blikh
owner bigbes@gmail.com
updated_at 2026-08-17T20:36:19Z
closed_at NULL
closed_by_session
external_ref NULL
spec_id
compaction_level 0
compacted_at NULL
compacted_at_commit NULL
original_size NULL
sender
ephemeral 0
wisp_type
pinned 0
is_template 0
mol_type
work_type
source_system
metadata �{}
source_repo
close_reason
event_kind
actor
target
payload
await_type
await_id
timeout_ns 0
waiters
hook_bead
role_bead
agent_state
last_activity NULL
role_type
rig
due_at NULL
defer_until NULL
no_history 0
started_at NULL
is_blocked 0
events 1 row
id 01a01170-7a0a-772f-9305-82b957e6bdbc
issue_id sr-ht-ecore-c6h
event_type created
actor Eugene Blikh
old_value
new_value
comment NULL
created_at 2026-08-17T23:36:19Z