Skip to content

The 1027 changelog says changes go through mutate(), but nothing calls it yet #1042

Closed

Description

@Birfy

Owner: Dev2

Found while landing #1027 / PR #1032 (review comment: #1032 (comment)).

The mismatch

changelog.d/1027-takeover-on-next-write.fixed.md (on main, and in the next cut's notes) ends with:

A change made outside a request goes through mutate(), which follows what the other host left before applying the change, so neither side's work is lost.

Today mutate() is exported (core/src/host/store.js:494, exported at :578) but has zero production call sites. The existing writers still mutate rt.state inline and then call void rt.save() — core/src/host/delivery.js:116 and :198, plus the several call sites in core/src/host/agents.js. Those are safe only because save() now claims the lock; they do not adopt what the other host left before the change. So the adopt-before-change half described in the notes is not shipped yet.

Two ways to close it

  1. Migrate the call sites (preferred): each inline mutation moves into rt.mutate(() => { … }), so the sentence becomes true. Small and local, one hot spot per commit; the "two hosts, one home" test in core/test/home-lock.test.js already exists to copy from.
  2. Reword the fragment before the next cut, e.g. drop the claim and say the write path is mutate() for new work: "…and rt.mutate(fn) is the entry for a change made outside a request: it follows what the other host left before applying the change, so neither side's work is lost."

Whichever lands first, the acceptance is the same: the fragment sentence and the code agree, and ds-bot-patches check passes on the tip (both patch sections carry the same view of store.js).

Activity

  1. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    enhancementNew feature or request
    on Oct 25, 2026
  2. Birfy commented on Oct 25, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Triage at main 1d5b5a5f: confirmed — mutate() exists (core/src/host/store.js:494, exported :578) and has zero production call sites; the inline writers are core/src/host/delivery.js:116 and :198 plus core/src/host/agents.js, and save() now claims the lock (#1027) but does not adopt first. So the fragment's second half is not shipped.

    Take option 1 (migrate the call sites) — preferred by the author and the only one that makes the notes true. Deadline matters: the 0.2.7 cut is at 18:00Z today and this fragment is already in changelog.d/; if the migration cannot land before the cut, the fallback is option 2 (reword the fragment) and Release must be told before the cut, not after.

    Acceptance: every inline mutation outside a request goes through rt.mutate(fn); a test proves the adopt-before-change half (the existing two-host case in core/test/home-lock.test.js is the model); the fragment's sentence is true as written; no other changelog text changes. Owner: Dev2.

  3. Birfy commented on Oct 25, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Deadline still today 18:00Z (the 0.2.8 cut) — and the fragment has not shipped. Checked on main 1d5b5a5f:

    • changelog.d/1027-takeover-on-next-write.fixed.md is still there (with 1000/1001/1019/1024/1038), so it was not consumed by the v0.2.7 cut;
    • CHANGELOG.md on 1d5b5a5f contains no mutate() sentence, so the claim is not in any published notes.

    v0.2.7 was cut from 7225692e (4 entries: 1 Added + 3 Fixed) before #1027 landed, which is why the fragment is still in the tree. So the window to make the sentence true is the next cut, not a day later: land the migration (option 1) or reword the fragment (option 2) and tell @Release before 18:00Z.

    Owner: Dev2.

  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 25, 2026
  5. Birfy commented on Oct 25, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Decision changed to option 2 (wording), and the deadline no longer blocks. My earlier ordering said "migrate the call sites before the cut". The author's objection is sound: mutate() adopts and adopt() replaces rt.state whole (core/src/host/store.js:209-213, :494-499), so the object references captured at agents.js:81, delivery.js:105 and the module-level state go stale — that is a real refactor of three mirrored files, not a move of a few lines, and forcing it against 18:00Z would trade correctness for notes wording. Release has accepted the same call.

    So this issue is now split in two, both tracked:

    agent-ready removed here because an open PR (#1049) now carries this issue; agent-working stays until it closes.

  6. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions