Skip to content

aggregator(feed): feed.ts does not parse — isUnmatchedCharge is missing its closing brace (merged in 4d7f643e3, #2445) #3452

Closed

Description

@dezren39

Found by queue task 5363 (lane C) while typechecking an unrelated change; verified identical on clean origin/main at 70c206250 — pre-existing, not caused by that change.

Evidence (pm-stack/aggregator/src/feed.ts):

  • export function isUnmatchedCharge(...) (~line 350) returns typeof v.merchant === "string" && isFiniteNumber(v.amountUsd) && typeof v.at === "string"; and the function is never closed — the next block comment + export function isChargeRow follow inside its body.
  • bun build src/feed.ts --no-bundle → error: Unexpected export at line 358 (export function isChargeRow).
  • bunx tsc --noEmit → src/feed.ts(552,1): error TS1005: '}' expected.
  • bun test test/feed.test.ts → 0 pass / 1 fail (parse error).
  • Introduced in 4d7f643e3 "fix(aggregator): sanitize feed charges at loadFeed — isChargeRow drop-and-count… (aggregator(feed): isFleetFeed never checks charges — one malformed row crashes /quota, a non-array object silently empties the charges strip #2445)": the isChargeRow insertion landed inside/after isUnmatchedCharge and dropped its closing brace.

Fix: add the missing } closing isUnmatchedCharge before the isChargeRow comment block. Acceptance: bun build src/feed.ts parses, bun test test/feed.test.ts runs, bunx tsc --noEmit reports no feed.ts error. Note the aggregator test suite and typecheck are red on main until this lands, so other aggregator PRs cannot use them as a signal.

Acceptance criteria

  • bun build src/feed.ts parses with no error and bun test test/feed.test.ts runs (pass/fail on assertions, not on a parse error).
  • bunx tsc --noEmit reports no error in src/feed.ts.
  • The change is exactly the missing closing brace for isUnmatchedCharge (plus, at most, formatting) — no behavior change to any feed function.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    on Nov 1, 2026
  2. developing-today commented on Nov 1, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: introduced by 4d7f643 (#2445); noticed and filed by queue task 5363 while landing PR #3454 (#2551) — #3454's body explicitly lists this as pre-existing breakage it did not fix, and I verified #3454 touched only token-adapter.ts, so this issue is still live on main.

    Notes: priority/high because the aggregator test suite and typecheck are red on main until this lands, which blinds every other aggregator PR's CI signal. The fix itself is one brace (effort/xs). Risk: minimal.

    Suggested approach: add the brace, verify with the three commands in the acceptance criteria via CI.

    🤖 Agent note · done

    • Agent: fleet monitor
    • Session / ID: repo-fleet-monitor run 2026-11-01T10:12Z
    • Found via: monitor reconciliation
    • Task: intake enrichment (protocol §5) — acceptance criteria appended, labels normalized, this review posted
    • Expectation: effort as labelled; done = acceptance criteria on the issue met by a fix PR
  4. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    priority/highImportant and time-sensitive
    effort/xsTrivial: expected under 30 minutes of work
    source/queue-workerFiled or worked by the queue/worker pilot
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 1, 2026
  5. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7396 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

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

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (triage — closing with evidence)

    • Agent: queue worker (repo-worker-code), Lane P shift (lane code-p)
    • Session / ID: queue task 7396 (repo-health-code-pilot)

    Triage verdict — the parse error no longer exists at current main

    Verified fresh 2026-11-04 ~00:20Z, two independent sources:

    1. Current main source (via gh api, origin/main): isUnmatchedCharge now sits at pm-stack/aggregator/src/feed.ts:554 and is properly closed — and it is not the old body with a brace pasted on: the aggregator(feed): charge gates accept negative/zero amounts and non-date 'at' — isChargeRow and isUnmatchedCharge pass rows no producer can emit, falsifying the charges total and attention-flag severity #3458 follow-up work rewrote both charge guards wholesale (isRecord gate, amountUsd > 0, isIsoDate(v.at)), landing via PR aggregator(feed): reject impossible charge rows #4424 (merge 5c49f480, 2026-11-02T17:06Z, branch queue/6105-3458-charge-row-guard). The rewrite superseded the defective 4d7f643e3 shape entirely, closing brace included.
    2. The issue's own acceptance commands, executed (laptop, aggregator checkout at a main from 2026-11-03):
      • bun build src/feed.ts --no-bundle → exit 0, no error.
      • bun test test/feed.test.ts → 67 pass / 0 fail (runs on assertions, not parse errors).
      • bunx tsc --noEmit → 0 errors in src/feed.ts. (One unrelated pre-existing error exists in test/overview.test.ts — HealthView.conflicts — a different file and concern, observed identically during queue task 8693's run.)

    All three acceptance criteria are met at current main, so this closes as already_done: no brace-only PR is needed, and manufacturing one would churn a file that has since been deliberately rewritten.

    Side observation (already tracked, not filed again): the laptop primary clone ~/git/code could not fast-forward during this check — it carries one local repo-keeper-style commit (a9a392d2f, 1 ahead / 24 behind) plus the untracked .opencode/service-local.json. That state is exactly what open issue #5209 (pm-git-sync failing every cycle on the untracked file) and closed #4464 (repo-keeper snapshot divergence) track; the acceptance runs above used the checkout as-is and were also confirmed against the origin/main source read.

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

Metadata

Metadata

Assignees

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/queue-workerFiled or worked by the queue/worker pilottask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions