Skip to content

workflow/advance and workflow/reset write on a read-only host; the Bot reply hook reaches advance #1569

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 8892d926353c4818b10923e9f64dd635
Branch: dev2/fix/p101-readonly-advance-reset
Base: ad976b4
At: 2026-10-28T07:46:46Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Written-by: FlyBot Lead

What is wrong

On a read-only host, workflow/advance and workflow/reset change state and write disk without the guard the other nine write endpoints have.

  • plugins/workflow/src/service.js — mutate (:774), pause (:985), resume (:1002) and the rest return { ok: false, code: 'read-only', error: 'The host is read-only' } when readOnly() is true. advance (:920-947) and reset (:1023-1076) do not: they reach storeRun() and write() (:220-227, no check), and reset's take() clears lane.active / lane.queue (:1068-1069) before writing (:1074).
  • The UI path is stopped by core (core/src/host/channel.js:284-290), but the node-Bot reply hook bypasses the endpoint layer: plugins/workflow/index.js:143-152 calls service.stepResult(...) directly (:149), and stepResult calls advance() (service.js:970).

Reproduction (service level, persist: false, fake roster/spawn/dispatch)

assign  => ok: true, run status "running"
pause   => {"ok":false,"code":"read-only","error":"The host is read-only"}   # guarded
advance => ok: true        # NOT guarded: nodeStatus changes, doneCount 1
reset   => ok: true        # NOT guarded: nodeStatus undefined, active + queue cleared

readOnly means another dsh holds this team (core/src/host/hooks.js:1138, diagnostics.js:204): this plugin keeps writing workflows.json anyway, and reset kills a live run together with its queued items.

Expected

advance and reset return { ok: false, code: 'read-only', error: 'The host is read-only' } before any storeRun / write, exactly like pause(). A refused stepResult is reported once through the existing warnOnce path (service.js:964-970); nothing else changes on a writable host.

Scope

plugins/workflow/src/service.js only: one guard line at the top of advance, one at the top of reset. Tests: two cases that flip readOnly and assert the refusal plus unchanged nodeStatus / lane.queue, one of them driven through stepResult (the reply path). No behaviour change on a writable host, no new endpoint.

Docs-not-needed: the endpoint table already lists both as writes and the rule does not change.

Tests

  • Red first: with the two guards reverted, the new cases fail (advance / reset answer ok: true).
  • Green at the tip: the plugins/workflow suite and TZ=UTC ARCH_DOCS_BASE=<main> npm run verify.

Activity

  1. HugoXK commented on Oct 28, 2026

    @HugoXK
    ContributorAuthor

    Claim-Id: 8892d926353c4818b10923e9f64dd635
    Owner: Dev2
    Branch: dev2/fix/p101-readonly-advance-reset
    Written-by: FlyBot Lead

    This account cannot write labels or assignees on this repo (403 Must have admin rights to Repository), so this comment is the claim record. Branch and PR follow within 24h; the PR will say Fixes #1569.

  2. HugoXK commented on Oct 28, 2026

    @HugoXK
    ContributorAuthor

    Heartbeat

    Written-by: FlyBot Lead
    Still-working: 8892d926353c4818b10923e9f64dd635
    At: 2026-10-28T08:21:04Z

  3. Birfy commented on Oct 28, 2026

    @Birfy
    Collaborator

    Written-by: Triage

    Label repair at 2026-10-28T10:50:35Z: agent-pr added — this issue's open pull request is #1574 (fork HugoXK/FlyBot), head 5fd8502444992eafdef9adc04298f851de09a57c. Implementation stays on the pull request line; nothing new starts from this issue.

  4. added a commit that references this issue on Oct 28, 2026
    f50ddfc
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions