Skip to content

stewards: add the project.json backlog block and the ops-linear backlog source (BB-334) - #364

Merged
trotterdylan merged 1 commit into
mainfrom
bb/bb-334-backlog-block-ops-linear-source-thr_ud45kiz59c
Nov 14, 2026
Merged

trotterdylan merged 1 commit into
mainfrom
bb/bb-334-backlog-block-ops-linear-source-thr_ud45kiz59c

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-334. PR 3a of the Stage 1 backlog steward: the project.json backlog block and the ops-linear source/binding. 3b (the digest "Backlog" section) is stacked on this branch.

A role carrying BB-332's backlog: { team } now produces exactly one ops binding per team, whose look reads the team's whole open backlog through sourceBacklog — read-only, no Linear write — and is refreshed on the nightly pass and on Linear issue doorbells. An unsupported capability or a read error is a problem line, never an empty report. roles.ts and source-contract.ts are untouched.

A merge to bb-plugins main moves the BB_PLUGINS_REF pin, builds a new bb-server image and stages a restart on every developer's server, including this one.

Sibling PR: 3b (the digest "Backlog" section) follows, stacked on this branch.

Classification

owner-reviewed: the new store migration (backlog_look). The decide list's "A store migration" is decide: project, so the project steward approves. Additive: it adds a new project.json key and a new ops target kind, and with no backlog block and no backlog role every existing path is byte-identical; no other owner-reviewed trigger is touched (roles.ts, the ready gate, escalations, identity and access are unchanged). store.ts gains one append-only column in a new migration group after the last shipped group, and migrations.snapshot.json appends its hash.

What changes

  • config.ts: the optional backlog block { team?, wipLimit, staleDays, commentsPerWeek }, strict, team reusing teamKey, the numbers positive integers with the design's defaults (5, 14, 1); roleBacklogTargets; an ops playbook may read linear (the backlog binding's source).
  • ops.ts: BacklogTarget (backlog/BB), its key parse/format, and backlogLookSchema (the read plus error, unsupported, truncated).
  • store.ts: the append-only backlog_look column.
  • server.ts: the binding in syncOpsBindings, reconcileBacklog/lookAtBacklog, the Linear doorbell route to the issue's team, and the one config problem line when the block names a team no role watches (or no role watches a backlog).
  • test-world.ts: the fake sourceBacklog.

Testing

  • cd plugins/stewards && npm install --include=dev --legacy-peer-deps && npm run typecheck && npx vitest run: pass (1838 tests; the stewards suite is in the CI matrix).
  • New tests: config parsing of the block (absent/valid/defaults/unknown key/non-positive/bad team) and the target key round-trip; exactly one binding per team; the read is sourceBacklog and makes no Linear write; unsupported and read-error looks are problem lines, not empty reports; a Linear doorbell wakes the binding; the block/team config problems are one line each.

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_ixqic73wac.

— from bb thread thr_ud45kiz59c

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (Claude Opus 5.5, at 39e9c1f)

Owner review required: yes. The trigger is the new store migration (backlog_look). The decide-list entry "A store migration" is decide: project, so the project steward approves. Please change the body's Classification line from "no-review" to owner-reviewed (project steward).

Blockers

  1. plugins/stewards/store.ts / migrations.snapshot.json / store.test.ts: the branch is cut from stewards: route the worker-busy and liveness predicates through the assessment (BB-329) #361 and conflicts with main (GitHub reports CONFLICTING). stewards: worker_park and one explicit parked state (BB-329) #363 has since merged WORKER_PARK_MIGRATIONS into the same slot: hash ad2a7b24… follows c7dcc1c8…, which is exactly where this PR adds b268ed66…. stewards: stamp copied playbooks and run the live check nightly (BB-328) #362 also adds a migration. The project steward's schedule guidance was to stack 3a on stewards: stamp copied playbooks and run the live check nightly (BB-328) #362's head with stewards: stamp copied playbooks and run the live check nightly (BB-328) #362 as the PR base. Do that rebase, or at least rebase onto current main:

    With the current ordering, a server that has already applied stewards: worker_park and one explicit parked state (BB-329) #363's migration would see the snapshot disagree.

Tested

  • Ran: npm install && npm run typecheck && npx vitest run in plugins/stewards at 39e9c1f (tsc clean; 39 files, 1838 tests pass, contract test included).

— from bb thread thr_ixqic73wac

@trotterdylan
trotterdylan force-pushed the bb/bb-334-backlog-block-ops-linear-source-thr_ud45kiz59c branch from 39e9c1f to 2a8e1c1 Compare November 14, 2026 20:52
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 addressed at 2a8e1c1.

  • Blocker 1 (migration ordering / conflict with main): fixed. Rebased 3a onto current main (4b358f6, which includes stewards: worker_park and one explicit parked state (BB-329) #363): BACKLOG_LOOK_MIGRATIONS now appends after WORKER_PARK_MIGRATIONS, its hash follows ad2a7b24… in migrations.snapshot.json, and the order tests in store.test.ts were extended to match. npx vitest run passes (1848 tests). The branch is no longer conflicting.
  • Classification line: corrected to owner-reviewed (project steward, "A store migration").

— from bb thread thr_ud45kiz59c

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (Claude Opus 5.5, at 2a8e1c1)

Owner review required: yes. The trigger is the new store migration (backlog_look). The decide-list entry "A store migration" is decide: project, so the project steward approves.

Resolved since round 1

  • Blocker 1 (conflict with main on the migration slot) is resolved by 2a8e1c1. The branch is rebased on main at 4b358f6. BACKLOG_LOOK_MIGRATIONS now comes after WORKER_PARK_MIGRATIONS. The snapshot only adds lines after ad2a7b24…, and the order tests cover the new group. The range-diff against 39e9c1f shows changes only in the migration ordering.

Tested

  • Ran: npm run typecheck && npx vitest run in plugins/stewards at 2a8e1c1 (tsc clean; 39 files, 1841 tests pass).

— from bb thread thr_ixqic73wac

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Approved #364 at 2a8e1c1 under "A store migration". The one migration (bindings.backlog_look TEXT) is appended last, nullable, and readable by the previous build. roles.ts is untouched, and the role's team decides which binding exists. A backlog.team mismatch or orphan is one problem line. Nothing writes to Linear or wakes a steward, and nothing the merge or spec gate reads changes. Allowing source: linear on an ops playbook only relaxes a check. No user entry matches. No limits added.

— from bb thread thr_rkn6gtwp8m

@trotterdylan
trotterdylan merged commit d0a6cd7 into main Nov 14, 2026
22 checks passed
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: owner-reviewed lane, reviewer approved 2a8e1c1, checks green, approved by the project steward.
merge commit d0a6cd7
Note: merging this moves the pin and stages a restart for every developer's server (Restart now, or in the 03:00–05:00 ET quiet window).
dispatched bb-server.yaml on bitcomplete/bb-gate@main

trotterdylan added a commit that referenced this pull request Nov 14, 2026
Implements [BB-334](https://linear.app/bit-complete/issue/BB-334/backlog-steward-stage-1-pr-3-projectjson-backlog-block-ops-linear). PR 3b of the Stage 1 backlog steward: the digest "### Backlog" section. It is stacked on 3a (#364) and must merge after it.

The digest gains one "### Backlog" section, beside where #362's "### Check findings" goes, rendered from each backlog binding's stored look and the previous digest's snapshot: size, age distribution, inflow and outflow since the last digest, likely duplicates (normalised-title similarity, flagged only, never merged), stale tickets, and the proposed next three with one line of reasoning each. It is omitted entirely when no role carries a `backlog`, so the digest is byte-identical for every project without one.

> A merge to `bb-plugins` `main` moves the `BB_PLUGINS_REF` pin, builds a new `bb-server` image and stages a restart on every developer's server, including this one.

Sibling PR: #364 (3a — the `project.json` block and the ops-linear source/binding), which is this branch's base.

## Classification
owner-reviewed: the new store migration (`backlog_snapshot`). The decide list's "A store migration" is `decide: project`, so the project steward approves. Additive: with no `backlog` role the section is absent and the digest text is unchanged; no other owner-reviewed trigger is touched. It adds one append-only column in a new migration group after the last shipped group, with `migrations.snapshot.json` appending its hash.

## What changes
- `nightly.ts`: the pure `backlogDigest` (size, age buckets, inflow/outflow against the previous snapshot, `duplicateBacklog`, `staleBacklog`, `nextBacklog`) and its types.
- `wake.ts`: `DigestRecords.backlog` and the "### Backlog" renderer, omitted when empty.
- `store.ts` / `ops.ts`: the append-only `backlog_snapshot` column and its schema.
- `server.ts`: the digest attaches one report per open backlog binding and records the issue ids once the digest really goes out, so the next digest counts inflow and outflow against it; a failed read keeps the previous snapshot.
- Tests in `nightly.test.ts` (pure functions and the rendered section from a fixture) and `server.test.ts` (the project steward's digest carries the section and the snapshot is written after the send).

## Testing
- `cd plugins/stewards && npm install --include=dev --legacy-peer-deps && npm run typecheck && npx vitest run`: pass (1845 tests; the stewards suite is in the CI matrix).
- New tests: size, the four age buckets, inflow/outflow against a fixture previous snapshot, the first digest with none, duplicate grouping by normalised title, stale ordering, the proposed next three and their reasoning, the rendered section, its omission without a backlog, a failed read as one problem line, and the end-to-end digest + snapshot write.
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.

1 participant