Office (5/5): clerk briefs — a cheap Claude pass writes a structured brief per Outbox item #310

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

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

Why

An Outbox item should be decidable in under a minute. The raw ask text, the newest comment, or a PR body is often a long read. A short structured brief per item — what's asked, the options, what each option does, a recommendation — is the Office's main speed lever.

What to build

A clerk: a cheap Claude pass (cheapest model in SWARM_MODEL_MAP, via the same signed-in claude the threads use) per Outbox item, producing:

asking:   one line
options:  2–4, each with its effect
recommend: one option + one-line why
resolved?: evidence it may already be fixed, or none
  • Stored on the ticket as a marked comment (body-marker style), so the brief is tracker-native and every viewer sees the same one; re-run only when the ticket's updated_at moves past the brief's. The Office shows the brief above the raw ask, and the brief's options become the answer verb's numbered keys.
  • Runs Floor-side on a bounded worker (cap concurrent passes like FLOOR_THREAD_MAX), FLOOR_CLERK=off switch, and a per-cycle cap so a 77-item Outbox can't burst spend.
  • The clerk is told to propose and never to decide: it posts no label changes.

Acceptance

  1. Fake-claude fixture tests: brief parsed and stored; a stale brief re-run on updated_at change; a fresh one skipped; malformed clerk output → no brief, raw ask shown, logged.
  2. Spend: the cap and the off switch proven in tests; README states the expected per-item cost.
  3. Repo test loop green; journal entry.
Slice 5 of 5 of the Office (Ben's ask 2026-10-26). Depends on the stacks slice. ## Why An Outbox item should be decidable in under a minute. The raw ask text, the newest comment, or a PR body is often a long read. A short structured **brief** per item — what's asked, the options, what each option does, a recommendation — is the Office's main speed lever. ## What to build A **clerk**: a cheap Claude pass (cheapest model in `SWARM_MODEL_MAP`, via the same signed-in `claude` the threads use) per Outbox item, producing: ``` asking: one line options: 2–4, each with its effect recommend: one option + one-line why resolved?: evidence it may already be fixed, or none ``` - Stored **on the ticket** as a marked comment (body-marker style), so the brief is tracker-native and every viewer sees the same one; re-run only when the ticket's `updated_at` moves past the brief's. The Office shows the brief above the raw ask, and the brief's options become the answer verb's numbered keys. - Runs Floor-side on a bounded worker (cap concurrent passes like `FLOOR_THREAD_MAX`), `FLOOR_CLERK=off` switch, and a per-cycle cap so a 77-item Outbox can't burst spend. - The clerk is told to propose and never to decide: it posts no label changes. ## Acceptance 1. Fake-claude fixture tests: brief parsed and stored; a stale brief re-run on `updated_at` change; a fresh one skipped; malformed clerk output → no brief, raw ask shown, logged. 2. Spend: the cap and the off switch proven in tests; README states the expected per-item cost. 3. Repo test loop green; journal entry.

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

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

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

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

⏩ independent reviewer for #310 — verdict unauthenticated

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

close-report for #310 — status success

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

envelope
{
  "issue": 310,
  "status": "success",
  "commits": [
    "60c41ca9ed9889729e91a574d603b0457f87632e"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/journal/2026-11-05-310.md",
    "fleet-tui/floor/deploy/README.md",
    "fleet-tui/floor/server/clerk.js",
    "fleet-tui/floor/server/clerk.test.js",
    "fleet-tui/floor/server/office.test.js",
    "fleet-tui/floor/server/server.js",
    "fleet-tui/floor/web/office.js",
    "fleet-tui/floor/web/src/components/OfficeApp.vue",
    "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": "cd fleet-tui/floor && npx vitest run",
      "exit_code": 0
    },
    {
      "command": "cd fleet-tui/floor && npx vite build",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do bash \"$t\"; done (full repo loop)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "1. Fake-claude fixture tests: brief parsed and stored; a stale brief re-run on updated_at change; a fresh one skipped; malformed clerk output -> no brief, raw ask shown, logged": "server/clerk.test.js (node --test, fake claude child + fake tracker): 'a stale item with no brief is parsed and STORED' (posts a marked comment, brief in the map); 'a stale brief is RE-RUN on an updated_at change' (PATCHes the existing comment, not a duplicate); 'a FRESH brief is skipped' (no pass, no write); 'malformed clerk output -> NO brief written, counted malformed, and logged'; office.js officeBrief + server/office.test.js prove the raw ask is shown when the brief is null/malformed.",
    "2. Spend: the cap and the off switch proven in tests; README states the expected per-item cost": "server/clerk.test.js: 'the per-cycle cap bounds the passes RUN' (cycleMax=2 over 5 items -> 2 passes), 'the concurrency cap bounds passes IN FLIGHT to maxRunning' (peak<=2), 'off switch: a clerk with no model runs no cycle'; clerkEnabled covers FLOOR_CLERK=off. fleet-tui/floor/deploy/README.md states the per-item cost (one short cheapest-tier turn, order ~$0.003) and every switch (FLOOR_CLERK / FLOOR_CLERK_MODEL / FLOOR_CLERK_MAX / FLOOR_CLERK_CYCLE_MAX / FLOOR_CLERK_INTERVAL_MS).",
    "3. Repo test loop green; journal entry": "Full loop (tests/*.sh + onboarding/tests/*.sh) runs clean (0 FAIL) including floor-server-test.sh, fleet-tui-test.sh, collector-test.sh, docs-budget-test.sh, vendor-manifest-coverage-test.sh; the floor node suite is 177/177, vitest 45/45, vite build OK. Journal: docs/journal/2026-11-05-310.md; STATUS.md Office row updated in the same commit."
  },
  "summary": "The Office clerk (fleet-tui/floor/server/clerk.js) writes a cheap structured brief per Outbox item as a tracker-native marked comment, bounded by concurrency/per-cycle caps and FLOOR_CLERK=off; the Office surfaces it above the raw ask with its options as the answer verb's numbered keys.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #310 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261104-185608-12e745` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 310, "status": "success", "commits": [ "60c41ca9ed9889729e91a574d603b0457f87632e" ], "changed_files": [ "STATUS.md", "docs/journal/2026-11-05-310.md", "fleet-tui/floor/deploy/README.md", "fleet-tui/floor/server/clerk.js", "fleet-tui/floor/server/clerk.test.js", "fleet-tui/floor/server/office.test.js", "fleet-tui/floor/server/server.js", "fleet-tui/floor/web/office.js", "fleet-tui/floor/web/src/components/OfficeApp.vue", "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": "cd fleet-tui/floor && npx vitest run", "exit_code": 0 }, { "command": "cd fleet-tui/floor && npx vite build", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do bash \"$t\"; done (full repo loop)", "exit_code": 0 } ], "criteria": { "1. Fake-claude fixture tests: brief parsed and stored; a stale brief re-run on updated_at change; a fresh one skipped; malformed clerk output -> no brief, raw ask shown, logged": "server/clerk.test.js (node --test, fake claude child + fake tracker): 'a stale item with no brief is parsed and STORED' (posts a marked comment, brief in the map); 'a stale brief is RE-RUN on an updated_at change' (PATCHes the existing comment, not a duplicate); 'a FRESH brief is skipped' (no pass, no write); 'malformed clerk output -> NO brief written, counted malformed, and logged'; office.js officeBrief + server/office.test.js prove the raw ask is shown when the brief is null/malformed.", "2. Spend: the cap and the off switch proven in tests; README states the expected per-item cost": "server/clerk.test.js: 'the per-cycle cap bounds the passes RUN' (cycleMax=2 over 5 items -> 2 passes), 'the concurrency cap bounds passes IN FLIGHT to maxRunning' (peak<=2), 'off switch: a clerk with no model runs no cycle'; clerkEnabled covers FLOOR_CLERK=off. fleet-tui/floor/deploy/README.md states the per-item cost (one short cheapest-tier turn, order ~$0.003) and every switch (FLOOR_CLERK / FLOOR_CLERK_MODEL / FLOOR_CLERK_MAX / FLOOR_CLERK_CYCLE_MAX / FLOOR_CLERK_INTERVAL_MS).", "3. Repo test loop green; journal entry": "Full loop (tests/*.sh + onboarding/tests/*.sh) runs clean (0 FAIL) including floor-server-test.sh, fleet-tui-test.sh, collector-test.sh, docs-budget-test.sh, vendor-manifest-coverage-test.sh; the floor node suite is 177/177, vitest 45/45, vite build OK. Journal: docs/journal/2026-11-05-310.md; STATUS.md Office row updated in the same commit." }, "summary": "The Office clerk (fleet-tui/floor/server/clerk.js) writes a cheap structured brief per Outbox item as a tracker-native marked comment, bounded by concurrency/per-cycle caps and FLOOR_CLERK=off; the Office surfaces it above the raw ask with its options as the answer verb's numbered keys.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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#310
No description provided.