Follow-ups from PR #38 review: ctx.storage / docker update persistence nits #43
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Non-blocking findings from the approving review on #38 (review at
033d6b0). None block correctness today; collected here so they don't get lost.8 MB cap has no test — including the UTF-8 fix. Replacing the size check with
json.length > MAX_VALUE_BYTES * 1000leaves all nine storage tests green, so the UTF-16→UTF-8 measurement fix can be silently reintroduced. Add:assertRejects(() => kv.set("docker", "k", "ä".repeat(5 * 1024 * 1024)))— over the cap in UTF-8 bytes, under it in UTF-16 code units, so it pins the fix and not merely the cap.Per-poll prune trades a phantom for a hole.
pruneUpdateson everyrefreshStackstick keys off currently listed containers, so a poll landing during a manualdocker compose down/up -dwindow drops those verdicts until the next sweep (up toCHECK_INTERVAL_MS). ScopedrefreshUpdates(project)heals the action path; an operator's own compose run has nothing. Airtight variant if wanted:let seededFromStorage = stored != null, prune only while set, clear on first successful prune or sweep — covers the boot ghost without a way to lose a live verdict.Pruned map is never persisted. Only
refreshUpdateswrites storage, so a poll-pruned ghost stays in themodule_kvrow and is re-seeded (then re-pruned) every boot. Self-correcting, but a host whose registry sweeps keep failing accumulates dead verdicts in/dataand resurrects them on every restart.mod.ts:71comment overstates. "The immediate stacks tick below" is only unconditional whileINTERVAL_MS≤ 5 min — above that,ctx.scheduler.everybecomes a real schedule (host.ts:409) wherefirstRun: "immediate"doesn't fire if the schedule row already exists (service.ts:1334-1337,catchUp: "skip"), leaving the rehydrated map unpruned/un-re-derived for a whole interval. Fix the comment (or the gap).Nothing tests that a sweep persists anything. In
mod_teststorage.setis a noop andstorage.getreturns a literal, so the"updates"key literals atmod.ts:77andmod.ts:344are never checked against each other — a typo in either leaves the feature dead with a green suite. Capture whatsetwas called with, feed it into a secondctxFor, assert the verdicts come back.Positional insert in
storage.ts(INSERT INTO module_kv VALUES (?, ?, ?, ?), alsostorage_test.ts:106). A migration 11 adding a column breaks the insert at runtime. Name the four columns.Related: #39 (storage listing capability, carries the never-auto-delete-on-load-failure constraint).