Office (2/5): tracker writes from the Office — answer, retry, delegate, snooze, close (ADR 0008 posture ruling) #307

Closed
opened 2026-10-28 17:25:35 +00:00 by ben · 11 comments
Owner

Slice 2 of 5 of the Office (Ben's ask 2026-10-26). Depends on the read-only Office slice.

Why human

One-way-door ruling — a security-posture widening. Today the Floor is read-only against the factory; its only side effect is the #296 Claude thread. This slice makes the Floor write to the tracker (comments, labels, assignees). Proposed default ruling below; Ben accepts it by swapping this ticket to ready-for-agent (or amends it in a comment).

Proposed default ruling (→ ADR 0008)

  1. Writes use the signed-in viewer's own Forgejo token (auth.tokenFor, the path threads already use) — never the operator's or the factory's token. Sign-in off (localhost operator posture) → writes use the operator token the Floor already reads with, and the Office says so in its header.
  2. Every write is a comment + a label change, never a label change alone: the comment records the decision, who made it, and that it came from the Office (a body marker, body-marker-lib.sh style), so the tracker stays the durable record.
  3. Writes are queued with a ~10 s undo window before they leave the server; u undoes the last one. A refused write (403/409/stale state) surfaces on the item, never silently.
  4. The server re-reads the ticket before writing and refuses if it left the Outbox meanwhile (a worker claimed it, someone else answered) — the browser's view is never the only guard (the #296 rule).
  5. FLOOR_OFFICE_WRITES=off hides every write action (the threads' off-switch pattern).
  6. Mattermost: an Office answer to an issue with an open ask thread also posts the reply into that thread and confirms it :white_check_mark:, so ask-human.sh never resumes a stale round. (Alternative to rule out: leave chat alone.)

What to build (once ruled)

Actions in the Decide pane, each one keystroke, auto-advancing to the next item:

Verb Action Tracker effect
answer pick option / write own comment the ruling, add ready-for-agent, remove ready-for-human (exactly resume-parked-asks.sh's re-arm)
unstick retry with note comment, add ready-for-agent, remove agent-blocked
every delegate set assignee + comment; the item leaves "who: me"
every snooze until Office-side hide-until (server state file, like threads' state); no tracker write
every close (wontfix / duplicate of #n) comment + close (+ wontfix)

Plus a session receipt ("cleared N · delegated N · snoozed N · left N").

Acceptance

  1. ADR 0008 committed with the ruling; CONTEXT.md / README posture text updated (the README's "read-only" sections).
  2. Each action proven in server.test.js against the fake tracker: right comment, right label PUT/DELETE (GOTCHAS 2: never labels-in-PATCH), viewer token used, stale-state refusal, undo inside the window sends nothing.
  3. FLOOR_OFFICE_WRITES=off → no write routes (404) and no enabled buttons.
  4. Repo test loop green; journal entry + STATUS row.
Slice 2 of 5 of the Office (Ben's ask 2026-10-26). Depends on the read-only Office slice. ## Why human **One-way-door ruling — a security-posture widening.** Today the Floor is read-only against the factory; its only side effect is the #296 Claude thread. This slice makes the Floor **write to the tracker** (comments, labels, assignees). Proposed default ruling below; Ben accepts it by swapping this ticket to `ready-for-agent` (or amends it in a comment). ## Proposed default ruling (→ ADR 0008) 1. **Writes use the signed-in viewer's own Forgejo token** (`auth.tokenFor`, the path threads already use) — never the operator's or the factory's token. Sign-in off (localhost operator posture) → writes use the operator token the Floor already reads with, and the Office says so in its header. 2. **Every write is a comment + a label change, never a label change alone**: the comment records the decision, who made it, and that it came from the Office (a body marker, `body-marker-lib.sh` style), so the tracker stays the durable record. 3. **Writes are queued with a ~10 s undo window** before they leave the server; `u` undoes the last one. A refused write (403/409/stale state) surfaces on the item, never silently. 4. **The server re-reads the ticket before writing** and refuses if it left the Outbox meanwhile (a worker claimed it, someone else answered) — the browser's view is never the only guard (the #296 rule). 5. `FLOOR_OFFICE_WRITES=off` hides every write action (the threads' off-switch pattern). 6. **Mattermost:** an Office answer to an issue with an open ask thread also posts the reply into that thread and confirms it `:white_check_mark:`, so `ask-human.sh` never resumes a stale round. (Alternative to rule out: leave chat alone.) ## What to build (once ruled) Actions in the Decide pane, each one keystroke, auto-advancing to the next item: | Verb | Action | Tracker effect | |---|---|---| | answer | pick option / write own | comment the ruling, add `ready-for-agent`, remove `ready-for-human` (exactly `resume-parked-asks.sh`'s re-arm) | | unstick | retry with note | comment, add `ready-for-agent`, remove `agent-blocked` | | every | delegate | set assignee + comment; the item leaves "who: me" | | every | snooze until | Office-side hide-until (server state file, like threads' state); no tracker write | | every | close (wontfix / duplicate of #n) | comment + close (+ `wontfix`) | Plus a session receipt ("cleared N · delegated N · snoozed N · left N"). ## Acceptance 1. ADR 0008 committed with the ruling; `CONTEXT.md` / README posture text updated (the README's "read-only" sections). 2. Each action proven in `server.test.js` against the fake tracker: right comment, right label PUT/DELETE (GOTCHAS 2: never labels-in-PATCH), viewer token used, stale-state refusal, undo inside the window sends nothing. 3. `FLOOR_OFFICE_WRITES=off` → no write routes (404) and no enabled buttons. 4. Repo test loop green; journal entry + STATUS row.
Author
Owner

Ruling (Ben, 2026-10-30): the proposed default ruling is accepted as written — all six points, including the Mattermost reply-and-confirm (point 6). Write it up as ADR 0008 and build the slice. Swapped ready-for-human → ready-for-agent on Ben's instruction. Still blocked by #306 (read-only Office), so it is picked up after that lands.

**Ruling (Ben, 2026-10-30): the proposed default ruling is accepted as written** — all six points, including the Mattermost reply-and-confirm (point 6). Write it up as ADR 0008 and build the slice. Swapped `ready-for-human` → `ready-for-agent` on Ben's instruction. Still blocked by #306 (read-only Office), so it is picked up after that lands.

⚠️ Swarm is starving. This repo's swarm has yielded 3 consecutive ticks (most recent reason: slots-busy) with 7 ready-for-agent ticket(s) still open — the host's shared heavy slots have been busy (two long drains hold both slots on every host), so no worker has claimed for them. New tickets here are waiting behind other repos' work; this repo has now declared a want-file so a peer's queue-draining run frees its slot after the current ticket. A human may want to check host capacity.

Ruled by agent under ADR 0174 — veto anytime. Automated starvation signal (Matou/dev-factory #213): posted once per episode, cleared on the next real claim.

⚠️ **Swarm is starving.** This repo's swarm has yielded **3 consecutive ticks** (most recent reason: `slots-busy`) with **7** ready-for-agent ticket(s) still open — the host's shared heavy slots have been busy (two long drains hold both slots on every host), so no worker has claimed for them. New tickets here are waiting behind other repos' work; this repo has now declared a want-file so a peer's queue-draining run frees its slot after the current ticket. A human may want to check host capacity. Ruled by agent under ADR 0174 — veto anytime. Automated starvation signal (Matou/dev-factory #213): posted once per episode, cleared on the next real claim.

⚠️ Swarm is starving. This repo's swarm has yielded 3 consecutive ticks (most recent reason: slots-busy) with 7 ready-for-agent ticket(s) still open — the host's shared heavy slots have been busy (two long drains hold both slots on every host), so no worker has claimed for them. New tickets here are waiting behind other repos' work; this repo has now declared a want-file so a peer's queue-draining run frees its slot after the current ticket. A human may want to check host capacity.

Ruled by agent under ADR 0174 — veto anytime. Automated starvation signal (Matou/dev-factory #213): posted once per episode, cleared on the next real claim.

⚠️ **Swarm is starving.** This repo's swarm has yielded **3 consecutive ticks** (most recent reason: `slots-busy`) with **7** ready-for-agent ticket(s) still open — the host's shared heavy slots have been busy (two long drains hold both slots on every host), so no worker has claimed for them. New tickets here are waiting behind other repos' work; this repo has now declared a want-file so a peer's queue-draining run frees its slot after the current ticket. A human may want to check host capacity. Ruled by agent under ADR 0174 — veto anytime. Automated starvation signal (Matou/dev-factory #213): posted once per episode, cleared on the next real claim.

⚠️ Swarm is starving. This repo's swarm has yielded 3 consecutive ticks (most recent reason: slots-busy) with 6 ready-for-agent ticket(s) still open — the host's shared heavy slots have been busy (two long drains hold both slots on every host), so no worker has claimed for them. New tickets here are waiting behind other repos' work; this repo has now declared a want-file so a peer's queue-draining run frees its slot after the current ticket. A human may want to check host capacity.

Ruled by agent under ADR 0174 — veto anytime. Automated starvation signal (Matou/dev-factory #213): posted once per episode, cleared on the next real claim.

⚠️ **Swarm is starving.** This repo's swarm has yielded **3 consecutive ticks** (most recent reason: `slots-busy`) with **6** ready-for-agent ticket(s) still open — the host's shared heavy slots have been busy (two long drains hold both slots on every host), so no worker has claimed for them. New tickets here are waiting behind other repos' work; this repo has now declared a want-file so a peer's queue-draining run frees its slot after the current ticket. A human may want to check host capacity. Ruled by agent under ADR 0174 — veto anytime. Automated starvation signal (Matou/dev-factory #213): posted once per episode, cleared on the next real claim.

swarm-claim host=matou-dev-server-01 run=26264
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=26264 (automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=26269
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=26269 (automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=26268
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=26268 (automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=26295
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=26295 (automated multi-host claim — lowest live claim id works this ticket)

⚠️ Swarm is starving. This repo's swarm has yielded 3 consecutive ticks (most recent reason: slots-busy) with 5 ready-for-agent ticket(s) still open — the host's shared heavy slots have been busy (two long drains hold both slots on every host), so no worker has claimed for them. New tickets here are waiting behind other repos' work; this repo has now declared a want-file so a peer's queue-draining run frees its slot after the current ticket. A human may want to check host capacity.

Ruled by agent under ADR 0174 — veto anytime. Automated starvation signal (Matou/dev-factory #213): posted once per episode, cleared on the next real claim.

⚠️ **Swarm is starving.** This repo's swarm has yielded **3 consecutive ticks** (most recent reason: `slots-busy`) with **5** ready-for-agent ticket(s) still open — the host's shared heavy slots have been busy (two long drains hold both slots on every host), so no worker has claimed for them. New tickets here are waiting behind other repos' work; this repo has now declared a want-file so a peer's queue-draining run frees its slot after the current ticket. A human may want to check host capacity. Ruled by agent under ADR 0174 — veto anytime. Automated starvation signal (Matou/dev-factory #213): posted once per episode, cleared on the next real claim.

⏩ independent reviewer for #307 — verdict unauthenticated

review JSON
{
  "verdict": "unauthenticated",
  "findings": []
}
:fast_forward: **independent reviewer** for #307 — verdict `unauthenticated` <details><summary>review JSON</summary> ```json { "verdict": "unauthenticated", "findings": [] } ``` </details>

close-report for #307 — status success

✅ close-report gates passed — every claim verified against the pushed worker branch sandcastle/worker/20261105-004228-d59980 (pre-land — the host promotes it to main only after its post-run verify, #193/#283); issue closed.

envelope
{
  "issue": 307,
  "status": "success",
  "commits": [
    "4cf034fe7cc3a426a9c8702fb06eb8119f9fc38d"
  ],
  "changed_files": [
    "CONTEXT.md",
    "STATUS.md",
    "docs/adr/0008-the-office-writes-to-the-tracker.md",
    "docs/journal/2026-11-05-307.md",
    "fleet-tui/README.md",
    "fleet-tui/floor/server/office-chat.js",
    "fleet-tui/floor/server/office-chat.test.js",
    "fleet-tui/floor/server/office-writes.js",
    "fleet-tui/floor/server/office-writes.test.js",
    "fleet-tui/floor/server/office.test.js",
    "fleet-tui/floor/server/server.js",
    "fleet-tui/floor/server/server.test.js",
    "fleet-tui/floor/web/office.js",
    "fleet-tui/floor/web/src/components/OfficeApp.vue",
    "fleet-tui/floor/web/src/composables/useFeed.js",
    "fleet-tui/floor/web/src/composables/useOfficeWrites.js",
    "fleet-tui/floor/web/src/office.test.js",
    "fleet-tui/floor/web/src/styles/office.css"
  ],
  "tests": [
    {
      "command": "cd fleet-tui/floor && node --test server/*.test.js",
      "exit_code": 0
    },
    {
      "command": "bash tests/floor-server-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/docs-budget-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash onboarding/tests/vendor-manifest-coverage-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "ADR 0008 committed with the ruling; CONTEXT.md / README posture text updated": "docs/adr/0008-the-office-writes-to-the-tracker.md (all six points of Ben's accepted ruling); CONTEXT.md Office entry and fleet-tui/README.md Office section updated from read-only to the write posture",
    "Each action proven in server.test.js: right comment, right label PUT/DELETE (never labels-in-PATCH), viewer token, stale-state refusal, undo sends nothing": "server/server.test.js 'Office writes, signed in' asserts the office-action comment, add ready-for-agent via POST /labels + DELETE /labels/{id} (answer/unstick), assignee-PATCH (delegate), wontfix add + state-PATCH close, token tok-ben, a no-labels-in-PATCH assertion, a stale #99 refusal with no comment; 'undo inside the window' asserts no comment leaves the server",
    "FLOOR_OFFICE_WRITES=off -> no write routes (404) and no enabled buttons": "server/server.test.js 'Office writes off' asserts /office/state, /office/undo and the action route all 404 and /auth/me officeWrites:false; web/office.js decideButtons(verb,false) -> every button live:false (server/office.test.js), web/src/office.test.js asserts every decide action disabled with writes off",
    "Repo test loop green; journal entry + STATUS row": "node --test server suite 196/196 green, floor-server-test.sh + docs-budget + vendor-manifest-coverage green (the two repo-loop reds, list-ready-tasks-test.sh and run-swarm-ready-list-test.sh, are pre-existing and fail identically on a clean tree — they make live #307 tracker calls the sandbox cannot reach); docs/journal/2026-11-05-307.md added and STATUS.md dev-factory consumer row updated in this commit"
  },
  "summary": "The Office now writes to the tracker (answer/unstick/delegate/snooze/close) under ADR 0008's guards — viewer token, comment+label, undo window, re-read, off-switch, and the Mattermost ask-thread confirm — all proven offline in the node test suite.",
  "blockers": []
}
**close-report** for #307 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261105-004228-d59980` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 307, "status": "success", "commits": [ "4cf034fe7cc3a426a9c8702fb06eb8119f9fc38d" ], "changed_files": [ "CONTEXT.md", "STATUS.md", "docs/adr/0008-the-office-writes-to-the-tracker.md", "docs/journal/2026-11-05-307.md", "fleet-tui/README.md", "fleet-tui/floor/server/office-chat.js", "fleet-tui/floor/server/office-chat.test.js", "fleet-tui/floor/server/office-writes.js", "fleet-tui/floor/server/office-writes.test.js", "fleet-tui/floor/server/office.test.js", "fleet-tui/floor/server/server.js", "fleet-tui/floor/server/server.test.js", "fleet-tui/floor/web/office.js", "fleet-tui/floor/web/src/components/OfficeApp.vue", "fleet-tui/floor/web/src/composables/useFeed.js", "fleet-tui/floor/web/src/composables/useOfficeWrites.js", "fleet-tui/floor/web/src/office.test.js", "fleet-tui/floor/web/src/styles/office.css" ], "tests": [ { "command": "cd fleet-tui/floor && node --test server/*.test.js", "exit_code": 0 }, { "command": "bash tests/floor-server-test.sh", "exit_code": 0 }, { "command": "bash tests/docs-budget-test.sh", "exit_code": 0 }, { "command": "bash onboarding/tests/vendor-manifest-coverage-test.sh", "exit_code": 0 } ], "criteria": { "ADR 0008 committed with the ruling; CONTEXT.md / README posture text updated": "docs/adr/0008-the-office-writes-to-the-tracker.md (all six points of Ben's accepted ruling); CONTEXT.md Office entry and fleet-tui/README.md Office section updated from read-only to the write posture", "Each action proven in server.test.js: right comment, right label PUT/DELETE (never labels-in-PATCH), viewer token, stale-state refusal, undo sends nothing": "server/server.test.js 'Office writes, signed in' asserts the office-action comment, add ready-for-agent via POST /labels + DELETE /labels/{id} (answer/unstick), assignee-PATCH (delegate), wontfix add + state-PATCH close, token tok-ben, a no-labels-in-PATCH assertion, a stale #99 refusal with no comment; 'undo inside the window' asserts no comment leaves the server", "FLOOR_OFFICE_WRITES=off -> no write routes (404) and no enabled buttons": "server/server.test.js 'Office writes off' asserts /office/state, /office/undo and the action route all 404 and /auth/me officeWrites:false; web/office.js decideButtons(verb,false) -> every button live:false (server/office.test.js), web/src/office.test.js asserts every decide action disabled with writes off", "Repo test loop green; journal entry + STATUS row": "node --test server suite 196/196 green, floor-server-test.sh + docs-budget + vendor-manifest-coverage green (the two repo-loop reds, list-ready-tasks-test.sh and run-swarm-ready-list-test.sh, are pre-existing and fail identically on a clean tree — they make live #307 tracker calls the sandbox cannot reach); docs/journal/2026-11-05-307.md added and STATUS.md dev-factory consumer row updated in this commit" }, "summary": "The Office now writes to the tracker (answer/unstick/delegate/snooze/close) under ADR 0008's guards — viewer token, comment+label, undo window, re-read, off-switch, and the Mattermost ask-thread confirm — all proven offline in the node test suite.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/dev-factory#307
No description provided.