Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs: update the changelog entry to describe the causal requeue test (#3376)
[._.]/ Adam Eivy67ab479efa48
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 35a761204b..0f6a741ed2 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -165,7 +165,7 @@- **[issue-3359] The prompt-integrity snapshot now pins prompt bytes instead of the machine that generated it.** `taskPromptDefaults.test.js` hashes every current and preserved-historical prompt body against a checked-in snapshot, because editing a preserved body silently strands every other install on a prompt it can no longer recognize as an upgradable default. Prompt bodies embed this install's API origin, so hashing normalized it away first — but only the *runtime* origin, while the historical bodies written before that interpolation existed hardcode `http://localhost:5555`. The snapshot therefore only reproduced on a machine whose own origin happened to equal that literal: set a custom host, or merely run the suite in a shell with `PORT` set (as every CoS agent does), and five untouched bodies hashed differently and the suite failed reporting drift that had not happened. Regenerating the snapshot there would have been the damaging fix — it blesses whatever edited a preserved body, which is the one thing this test exists to catch. Hashing now collapses the frozen legacy origin too, which reproduces the committed snapshot byte for byte on every install, and the shared hasher is what both the test and a new `scripts/regen-prompt-integrity-snapshot.js` use, so the regeneration path can no longer normalize differently from the assertion. The guard is also in the CI planner's always-run list now: it covers a cross-install contract nothing else covers, so no impact scope may scope it out.- **[issue-3365] A pinned browser read now closes its own scratch tab, instead of every call site being expected to remember.** `navigateToUrlPinned` opens a fresh Chrome tab per call and tore it down itself on a refusal, but on success handed the caller a tab the caller was supposed to close — a convention that had already been broken twice, once leaving a tab behind for every catalog URL ingested and once for every Stacker News identity check, each fixed by hand-writing another close at the call site. The function already knows which case it is in: a caller that passes `evaluateExpression` did its DOM read on that same session and wants nothing back, while a caller that omits one wants the tab *as* the deliverable. So teardown now defaults to on exactly when an expression was supplied, the three read call sites no longer close anything, and the browser handoff and `POST /api/browser/navigate` still get their tab. `closeAfterRead: false` remains for a future caller that wants to read and keep the tab.- **[issue-3372] The server suite no longer fails two tests just because it was run from a CoS agent's worktree.** `resolveInstallRoot()` refuses a pinned data root that resolves into `data/cos/worktrees/…`, so worktree-version code can never be talked into reading or writing the live install's data (#1947) — and two tests were quietly leaning on the ambient working directory in a way that tripped exactly that guard. The relative-pin test expected `join(process.cwd(), 'some/rel')`, which inside a claim worktree resolves to a worktree path the resolver correctly refuses; the install-state test asserted that the migration ledger is read from `PATHS.installRoot`, which inside a worktree is itself a worktree path the reader deliberately short-circuits, so the call it asserted never happened. Both now pin the value they depend on — a stubbed cwd and a fixed non-worktree install root — instead of inheriting it from wherever the suite happens to be checked out. The refusal behavior is unchanged and now has a test for the relative-pin case too, and the install-state test asserts its pinned root differs from the code checkout, so it is a real check rather than a tautology on a normal install.-- **[issue-3376] A second machine's stale snapshot can no longer undo a requeue and throw away where the retry was supposed to resume.** Federated peers reconcile a task they both hold by lifecycle rank, on the reasoning that a task only ever moves forward — so the higher status is the newer truth. Two paths break that assumption by design: the orphan sweep and the retry-hold release from #3373 both move a task from `in_progress` back to `pending`, and that write is precisely the one that records the branch and worktree a retry should resume from. A peer still holding its pre-requeue view therefore won the merge on rank alone, restoring `in_progress` and discarding the resume pointer with it, so the retry that eventually ran started from an empty tree and redid work that was already committed. The `challenged` status already had an exemption for exactly this shape; `in_progress` versus `pending` now has the same one, decided by which side was edited most recently. A peer that genuinely just spawned still wins over an older `pending`, `completed` still wins outright over both, and because the rule depends only on the pair, both machines pick the same record no matter which one initiates the sweep. The wire format is unchanged — only how a conflict resolves locally — so an older peer converges on the next sweep exactly as it does today.+- **[issue-3376] A second machine's stale snapshot can no longer undo a requeue and throw away where the retry was supposed to resume.** Federated peers reconcile a task they both hold by lifecycle rank, on the reasoning that a task only ever moves forward — so the higher status is the newer truth. Two paths break that assumption by design: the orphan sweep and the retry-hold release from #3373 both move a task from `in_progress` back to `pending`, and that write is precisely the one that records the branch and worktree a retry should resume from. A peer still holding its pre-requeue view therefore won the merge on rank alone, restoring `in_progress` and discarding the resume pointer with it, so the retry that eventually ran started from an empty tree and redid work that was already committed. The `challenged` status already had an exemption for this shape; `in_progress` versus `pending` now has one too — but a stricter one, because 'whichever side was edited most recently' turned out to be the wrong test. An ordinary edit landing on a peer's stale `pending` copy also carries a newer timestamp, and letting that win would revert a task an agent is actively running and invite a second agent onto it, which is worse than the delayed retry being fixed. So the requeue now stamps itself, and the merge asks whether that requeue happened after the spawn the other side is reporting; every other pairing falls through to the old behavior, including for a peer running a version too old to stamp. Two things the requeue depends on came along with it: the lease that the requeue deliberately releases is no longer re-attached by the separate claim merge — which had been quietly re-imposing it and blocking the retry for a full lease window — while a lease held by the requeued record itself is still honored, since a dispatch takes its lease a moment before it flips the task to running. And two peers looking at the same claim with the same owner and expiry but a different claim time now settle on one of them instead of each keeping its own forever. The wire format is unchanged, so an older peer converges on the next sweep exactly as it does today.## Three.js Models