Skip to content

docs(backlog): B-0449 — bg-services slice 5 subscriber-agent design pass#3046

Merged
AceHack merged 2 commits into
mainfrom
docs-b0449-bg-services-slice-5-subscriber-agent-design-2026-05-13
May 13, 2026
Merged

docs(backlog): B-0449 — bg-services slice 5 subscriber-agent design pass#3046
AceHack merged 2 commits into
mainfrom
docs-b0449-bg-services-slice-5-subscriber-agent-design-2026-05-13

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 13, 2026

Summary

Files the named architectural gap the bg-services README explicitly calls out: "subscribers don't yet exist" — the missing layer between nudges-land-on-bus and foreground-loop-optional.

Design proposal

Three architectures considered:

Option Shape Pro Con
A One subscriber per topic (3 processes) Simple per-topic logic; failure isolation 3 processes to monitor; duplicated boilerplate
B Unified subscriber daemon (1 process, dispatches) One process; reusable polling; cross-topic awareness Monolith failure mode
C (recommended) subscribeOnce(topic, handler) library; cron-tick function call Composes with existing cron; surface-agnostic; failure-isolated; DST-compatible Subscriber latency = cron tick latency (1min)

Option C composes with the per-tick discipline shipped in PR #3042: the subscriber call lives in step 1 (refresh), envelopes get queued into step 3 (pick speculative work).

Why design-pass first

The architectural decision cascades into 3 services × N handlers of implementation. Separating design (this row) from implementation (B-0450/B-0451/B-0452 follow-ups) lets future-Otto read the rationale rather than re-derive it.

Substrate-honest

Design-pass only — no code shipped here. Implementation work tracked separately. The row IS the architectural substrate.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 13, 2026 22:37
@AceHack AceHack enabled auto-merge (squash) May 13, 2026 22:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new P1 backlog design-pass row (B-0449) that proposes the subscriber-agent architecture for bg-services slice 5, and updates the backlog index to include it (and B-0448).

Changes:

  • Introduces B-0449 design doc describing three subscriber-layer architecture options and recommending a cron-tick subscribeOnce library approach.
  • Captures acceptance criteria and follow-up slice breakdown (B-0450/B-0451/B-0452) for the subscriber pattern.
  • Updates docs/BACKLOG.md to list B-0448 and B-0449.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/backlog/P1/B-0449-bg-services-slice-5-subscriber-agent-design-pass-2026-05-13.md New backlog row documenting the proposed subscriber-agent architecture and acceptance criteria for slice 5.
docs/BACKLOG.md Adds index entries for B-0448 and B-0449 under P1.

AceHack and others added 2 commits May 13, 2026 18:42
…ass (closes foreground-optional gap)

Files the named architectural gap the bg-services README explicitly
calls out: "subscribers don't yet exist" — the missing layer between
"nudges land on bus" and "foreground loop optional."

Design pass proposes Option C: subscribe-once library + cron-tick
function call (vs daemon process). Rationale: composes with existing
cron infrastructure, surface-agnostic across CLI/Desktop/cloud,
failure-isolated, DST-compatible.

This is a DESIGN-PASS row; implementation breaks into B-0450/B-0451/B-0452
(per-topic handlers). Lands the architectural decision as substrate so
future-Otto cold-booting can read the rationale rather than re-derive it.

Co-Authored-By: Claude <noreply@anthropic.com>
…esign (Copilot P1)

Copilot P1: design row was internally inconsistent — said subscribeOnce
reads `/tmp/zeta-bus/` but required tests using a fake bus dir.
Aligned with existing `tools/bus/bus.ts` + `tools/bus/claim.ts`
convention: honor `ZETA_BUS_DIR` env var (defaults to `/tmp/zeta-bus/`),
so production and tests inject the same way.

Also clarified `seen.json` placement: same configurable bus directory,
so the consumed-marker discipline composes with the same env-var.

Co-Authored-By: Claude <noreply@anthropic.com>
@AceHack AceHack force-pushed the docs-b0449-bg-services-slice-5-subscriber-agent-design-2026-05-13 branch from 88a04ef to 8d7ef19 Compare May 13, 2026 22:42
Copilot AI review requested due to automatic review settings May 13, 2026 22:42
@AceHack AceHack merged commit 8077181 into main May 13, 2026
24 checks passed
@AceHack AceHack deleted the docs-b0449-bg-services-slice-5-subscriber-agent-design-2026-05-13 branch May 13, 2026 22:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

created: 2026-05-13
last_updated: 2026-05-13
depends_on: [B-0400, B-0440, B-0441, B-0442]
composes_with: [B-0402, B-0448]
AceHack added a commit that referenced this pull request May 13, 2026
…inues

Records: PR #3046 (Otto-Desktop's B-0449 design) merged since previous
tick. Speculative pickup audited `.claude/rules/` for staleness adjacent
to the session's hygiene sweep; found `rule-0-no-sh-files.md` still
naming three already-ported `tools/hygiene/audit-*.sh` files as
outstanding TS-port debt. PR #3048 updates the rule + surfaces the
`.gemini/service/*.sh` design question separately.

Co-Authored-By: Claude <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 13, 2026
…ared (#3048)

* docs(rules): Rule 0 — mark the 3 legacy hygiene .sh violations as cleared

The "Legacy violations" callout in `.claude/rules/rule-0-no-sh-files.md`
listed three `tools/hygiene/audit-*.sh` files as outstanding TS-port
debt. All three have since been ported to `.ts` and the corresponding
`.sh` files removed from the tree:

  tools/hygiene/audit-lost-files.sh      → audit-lost-files.ts
  tools/hygiene/audit-trajectories.sh    → audit-trajectories.ts
  tools/hygiene/audit-backlog-items.sh   → audit-backlog-items.ts

Update the rule to reflect the cleared state. Also surface the one
remaining design question that an `.sh` audit raises: the Lior agent's
`.gemini/service/install-lior-service.sh` + `lior-loop.sh` are install-
graph by intent but live outside `tools/setup/`. Note that as a
separate design question (out-of-scope for Rule 0 itself) rather than
silently leaving the rule's "only tools/setup/" phrasing ambiguous.

Substrate-hygiene continuation of the 9 → 0 dangling-ref sweep started
this session.

Co-Authored-By: Claude <noreply@anthropic.com>

* shard(tick): 2249Z — Rule 0 staleness cleared; substrate cascade continues

Records: PR #3046 (Otto-Desktop's B-0449 design) merged since previous
tick. Speculative pickup audited `.claude/rules/` for staleness adjacent
to the session's hygiene sweep; found `rule-0-no-sh-files.md` still
naming three already-ported `tools/hygiene/audit-*.sh` files as
outstanding TS-port debt. PR #3048 updates the rule + surfaces the
`.gemini/service/*.sh` design question separately.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 14, 2026
…ference card (#3153)

* docs(rules): add ID allocation discipline section to otto-channels reference card

Yesterday's B-0449 collision empirically validated a gap in the channels
reference rule: agents pick monotonically-increasing IDs (B-NNNN backlog
row numbers) by checking on-disk state but not in-flight PRs, race-condition
manifests when peer Otto is filing concurrently.

Adds new section "ID allocation discipline (multi-surface)" after Lane
discipline, requiring BOTH:

1. On-disk check (find docs/backlog → grep B-[0-9]+ → tail)
2. In-flight check (gh pr list --search "B-NNNN")

Empirical anchor: 2026-05-13 collision where Otto on Desktop picked B-0449
for PR #3052, but Otto on CLI had B-0449 in flight via PR #3046 (bg-services
slice 5). Resolved by PR #3053 renumber to B-0450 + PR #3054 shadow lesson log.

Also adds:
- Item 7 to Operational discipline list pointing at new section
- Composes-with entries for PR #3053, PR #3054, refresh-before-decide.md
- /tmp/zeta-otto-id-alloc as example task-specific worktree path

Re-authoring of work lost in yesterday's session crash (was on /tmp/zeta-otto-desktop
which got cleaned up). The substrate gap is still real; the empirical anchor still
holds; the rule update is still valuable.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(rules): use portable find (drop GNU-only -printf flag) — Codex P2

The on-disk check in the ID allocation discipline section used 'find -printf'
which is GNU-only and fails on BSD find (macOS default). Replaced with the
portable pattern: 'find ... -type f | grep -oE "B-[0-9]+"' — the B-NNNN
pattern only appears once per filename in practice, so extracting from full
paths is equivalent.

Verified portable: ran the new command, output matches expected (top 3 row IDs).

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants