Skip to content

pm-stack(aggregator): health-surface inbox tests fail on main — loadConfig({}) throws the fixture-mode guard (conflicts-1282.test.ts) #5364

Closed

Description

@dezren39

pm-stack(aggregator): health-surface inbox tests fail on main — loadConfig({}) throws the fixture-mode guard

Summary

Two aggregator tests are red on main: the whole "health surface counts the inbox (#1282 slice 1)" block in test/conflicts-1282.test.ts. Both tests call loadConfig({}), and loadConfig now refuses an empty env by design — so the tests throw before buildHealth ever runs. The aggregator suite's merge-time signal (.github/workflows/pm-aggregator-tests.yml) is red on main until this is fixed.

Evidence (verified 2026-11-04, origin/main fd961f654)

  • pm-stack/aggregator/test/conflicts-1282.test.ts:186 and :199: cfg: loadConfig({}) in both health tests.
  • pm-stack/aggregator/src/config.ts:118-123 (parseAggregatorSource): with PM_AGG_SOURCE unset and PM_AGG_DEV not "1", it throws Refusing to serve fixture data outside explicit dev mode: PM_AGG_SOURCE=null; set PM_AGG_SOURCE=live, or PM_AGG_SOURCE=fixtures with PM_AGG_DEV=1. That guard is intentional (a non-dev deployment must never silently serve canned data) and must not be weakened.
  • Every other test that calls loadConfig passes an explicit env: test/config.test.ts uses { PM_AGG_DEV: "1" } / { PM_AGG_SOURCE: "live" }, test/checkout-drift.test.ts:91 uses loadConfig({ PM_AGG_DEV: "1" }). The two health tests are the outliers.
  • Reproduction (laptop, detached worktree at fd961f654):
    • Full suite: bun test → 1574 pass / 2 fail (1576 tests, 115 files). Both failures are exactly these two tests.
    • Isolated: bun test ./test/events.test.ts ./test/conflicts-1282.test.ts → 40 pass / 2 fail, with the stack parseAggregatorSource (src/config.ts:123) → loadConfig (src/config.ts:131) → conflicts-1282.test.ts:186 (and :199).

Failing tests:

  1. health surface counts the inbox (#1282 slice 1) > buildHealth carries the count and the page renders it
  2. health surface counts the inbox (#1282 slice 1) > a health view assembled without the inbox says so instead of inventing zero

Why it matters

Fix direction

Pass an explicit dev/fixtures env to loadConfig in the two tests, matching the established precedent (loadConfig({ PM_AGG_DEV: "1" }), as in checkout-drift.test.ts:91). The tests already pass mode: "fixtures" to buildHealth, so the config env should agree. Do not change src/config.ts's guard.

Acceptance criteria

  • bun test in pm-stack/aggregator at main: 0 failures (both health tests pass, in isolation and in the full suite).
  • test/config.test.ts still passes — the fixture-mode guard in src/config.ts is unchanged.
  • No production-code change is needed; if one turns out to be needed, it is called out on this issue first.

Dedup / related

Activity

  1. added
    kind/ciCI/CD pipelines, workflows, and build automation
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    priority/highImportant and time-sensitive
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 4, 2026
  2. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b (new-issue-creator job, Lane B)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-04T08:20Z (verification completed ~08:55Z)
    • Found via: filed this run
    • Task: Filed after verifying on the laptop at origin/main fd961f6: full aggregator suite 1574 pass / 2 fail, both failures in this issue's two health tests; isolated rerun reproduces with the config.ts:123 fixture-mode guard stack. Fix is the two-line test-env change described in the issue (loadConfig({ PM_AGG_DEV: "1" }), per checkout-drift.test.ts:91 precedent); the config guard itself must not be weakened.
    • Expectation: effort xs — done when the aggregator suite is 0-fail on main and config.test.ts still passes.
    • Links: queue packet packet-5364-fix.json (repo-health-code-pilot)
  3. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  6. 19 remaining items

  7. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: handed off
    task: 9367
    worker: repo-worker-code
    lane: 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc
    execution_lane: opencode
    issue: #5364
    at: 2026-11-05T06:50:46.990Z
    summary: Triage confirmed the focused regression on main c7a0982: the targeted run had 18 pass and the two inbox health tests fail at loadConfig's intentional fixture guard; config tests pass. Full-suite run had 1397 pass, 23 fail, and 2 errors with unrelated laptop/environment failures also present. Classified as kind/test, small-fix, priority/high, effort/xs. Follow-up task 9914 is queued for the two test-only env fixes; production guard remains out of scope. Labels now reflect the queued follow-up.

  8. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  9. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: done
    task: 9367
    worker: repo-worker-code
    lane: 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc
    execution_lane: opencode
    issue: #5364
    at: 2026-11-05T06:51:26.286Z
    summary: Triage task 9367 completed as triaged. Follow-up small-fix task 9914 is queued; issue #5364 remains open and its labels reflect the queued work.

  10. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  11. added a commit that references this issue on Nov 5, 2026
  12. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/ciCI/CD pipelines, workflows, and build automationkind/testTest coverage, test infrastructure, or test-only fixespriority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions