Skip to content

Commit c1ad5b0

Browse files
committed
fix(review): should-fix nits — task_timed_out fanout, NUL-byte test file, decompose docs
- task_timed_out added to the Linear fanout filter (fanout-task-events.ts): a standalone iteration that times out now settles (👀→✅/❌ + terminal reply) instead of maturing to 🔄 forever. Matches the Jira/Slack defaults. - orchestration-e2e.test.ts: replaced 2 raw NUL bytes (composite-key separators in template literals) with the \u0000 escape — identical runtime, but git no longer flags the 23.6KB file binary so its diffs are reviewable. - LINEAR_SETUP_GUIDE: the onboard-project example + flag list omitted the REAL, required --decompose-allowed flag (off by default), so following the guide verbatim made bgagent:decompose/:auto silently run as a single task. Added it + regenerated the Starlight mirror. (Larger should-fix/fast-follow items — orchestration-row TTLs across seed call sites, 4 IAM grant scope-downs, StatusIndex hot partition, baseline-build memoization, handler splits, shared Linear client — deferred to a tracked follow-up; each merits its own PR + regression surface.) cdk + docs green.
1 parent 89bfea4 commit c1ad5b0

6 files changed

Lines changed: 25 additions & 11 deletions

File tree

cdk/src/handlers/fanout-task-events.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ export const CHANNEL_DEFAULTS: Record<NotificationChannel, ReadonlySet<string>>
181181
// are excluded for the same reason — N comments rather than 1.
182182
linear: new Set<string>([
183183
...TERMINAL_EVENT_TYPES,
184+
// review should-fix: include task_timed_out so a Linear standalone iteration
185+
// that TIMES OUT still settles (its 👀→✅/❌ + terminal reply come through the
186+
// fanout plane). Without it a timed-out iteration's threaded reply matured to
187+
// 🔄 and never resolved. Matches the Jira/Slack defaults, which already have it.
188+
'task_timed_out',
184189
]),
185190
// Jira posts a single deterministic final-status comment on terminal
186191
// events — the Jira analogue of the Linear default above (issue #573).

cdk/test/handlers/fanout-task-events.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,16 @@ describe('fanout-task-events: per-channel filter contract (design §6.2)', () =>
350350
]);
351351
});
352352

353-
test('Linear subscribes to terminal events only (post-once final-status comment)', () => {
353+
test('Linear subscribes to terminal events + task_timed_out (post-once final-status comment)', () => {
354+
// review should-fix: task_timed_out added so a Linear standalone iteration
355+
// that times out still settles (matches Jira/Slack, which already had it).
354356
const f = CHANNEL_DEFAULTS.linear;
355357
expect([...f].sort()).toEqual([
356358
'task_cancelled',
357359
'task_completed',
358360
'task_failed',
359361
'task_stranded',
362+
'task_timed_out',
360363
]);
361364
});
362365

@@ -483,12 +486,12 @@ describe('fanout-task-events: routeEvent (per-channel dispatch)', () => {
483486
expect([...outcome.dispatched].sort()).toEqual(['github', 'jira', 'linear', 'slack']);
484487
});
485488

486-
test('task_timed_out routes to Slack + Jira (Linear default predates it)', async () => {
487-
// ``task_timed_out`` is a distinct terminal event the orchestrator
488-
// emits. Slack and Email-... actually email does NOT include it; the
489-
// Jira default (added in #573) does, Linear's (#239) does not.
489+
test('task_timed_out routes to Slack + Jira + Linear (all three now subscribe)', async () => {
490+
// ``task_timed_out`` is a distinct terminal event the orchestrator emits.
491+
// Slack (#239) + Jira (#573) always had it; Linear now does too (review
492+
// should-fix) so a timed-out standalone iteration settles. Email excludes it.
490493
const outcome = await routeEvent(mk('task_timed_out'));
491-
expect([...outcome.dispatched].sort()).toEqual(['jira', 'slack']);
494+
expect([...outcome.dispatched].sort()).toEqual(['jira', 'linear', 'slack']);
492495
});
493496

494497
test('agent_error routes only to Slack', async () => {

cdk/test/handlers/linear-webhook-processor-orchestration.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ describe('linear-webhook-processor — #247 orchestration routing', () => {
198198
// parent start signal mirrored — 👀 reaction + In Progress — via upsertEpicPanel.
199199
expect(upsertStatusCommentMock).toHaveBeenCalled();
200200
expect(swapIssueReactionMock).toHaveBeenCalledWith(expect.anything(), expect.any(String), 'eyes');
201+
// The 5th arg (allowSameTypeRegression, #9b) is passed by the shared rollup
202+
// re-open path; harmless on this forward Backlog→In Progress mirror.
201203
expect(transitionIssueStateMock).toHaveBeenCalledWith(
202-
expect.anything(), expect.any(String), 'started', ['In Progress'],
204+
expect.anything(), expect.any(String), 'started', ['In Progress'], true,
203205
);
204206
});
205207

10 Bytes
Binary file not shown.

docs/guides/LINEAR_SETUP_GUIDE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ Paste the secret at the prompt. ABCA stores it on the workspace's per-workspace
9090

9191
```bash
9292
bgagent linear list-projects --slug <slug> # find the project UUID
93-
bgagent linear onboard-project <project-uuid> --repo owner/repo --label abca
93+
# Add --decompose-allowed if you want the bgagent:decompose / bgagent:auto
94+
# planning flow on this project (it is OFF by default).
95+
bgagent linear onboard-project <project-uuid> --repo owner/repo --label abca --decompose-allowed
9496
```
9597

9698
Default trigger label is `bgagent`; pass `--label <name>` to override.
9799

98-
Optional flags on `onboard-project`: `--team-id` (Linear team UUID, debug only), `--region`, `--stack-name`.
100+
Optional flags on `onboard-project`: `--decompose-allowed` (enable the `bgagent:decompose` / `bgagent:auto` Mode-B planning flow — **off by default**, so without it those labels silently run as a single task), `--team-id` (Linear team UUID, debug only), `--region`, `--stack-name`.
99101

100102
### 7. Test
101103

docs/src/content/docs/using/Linear-setup-guide.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ Paste the secret at the prompt. ABCA stores it on the workspace's per-workspace
9494

9595
```bash
9696
bgagent linear list-projects --slug <slug> # find the project UUID
97-
bgagent linear onboard-project <project-uuid> --repo owner/repo --label abca
97+
# Add --decompose-allowed if you want the bgagent:decompose / bgagent:auto
98+
# planning flow on this project (it is OFF by default).
99+
bgagent linear onboard-project <project-uuid> --repo owner/repo --label abca --decompose-allowed
98100
```
99101

100102
Default trigger label is `bgagent`; pass `--label <name>` to override.
101103

102-
Optional flags on `onboard-project`: `--team-id` (Linear team UUID, debug only), `--region`, `--stack-name`.
104+
Optional flags on `onboard-project`: `--decompose-allowed` (enable the `bgagent:decompose` / `bgagent:auto` Mode-B planning flow — **off by default**, so without it those labels silently run as a single task), `--team-id` (Linear team UUID, debug only), `--region`, `--stack-name`.
103105

104106
### 7. Test
105107

0 commit comments

Comments
 (0)