SIGN IN SIGN UP

fix: [ENG-2858] address follow-up review on tool-mode dream

Three nits flagged in the second auto-review pass:

finalize.ts: pre-read stat() guard for --archive-file. Without it,
`readFile` would slurp arbitrary bytes (multi-GB stray file, or a fifo)
into memory before the existing 200-line cap ever fires. New cap:
256 KB — covers 200 paths × ~1 KB headroom while bailing early on
pathological inputs.

dream-session.ts: distinguish 'already-archived' from 'rename-failed'.
Two back-to-back finalizes on overlapping paths (allowed by stateless
v1) can race — the loser's readFile or rename throws ENOENT after the
winner's rename completes. The skipped reason set now surfaces that
distinctly so agents triaging skipped paths don't re-scan to figure
out which 'rename-failed' entries were really benign races.

topic-loader.ts: accept both double- and single-quoted attribute
values. HTML5 allows both; hand-authored topics may use either. Without
this, a human-authored `<bv-topic related='@security/jwt'>` would
silently lose its `related=` attr and the link generator would keep
re-surfacing that pair.

The fourth follow-up (bm25-pair-discovery concurrency throttle) is
deferred — reviewer explicitly said "happy to defer if tracked",
and it warrants its own retrieval-tuning pass on a real large tree.
N
Nguyễn Thuận Phát committed
dcbb12169132c201650729a26b5b88cb4c074210
Parent: a2e79ac