GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — aggregator(charges-producer): staged mode falls back to the live Gmail CLI when gmail-triage.json is short — the whole Gmail source is silently dropped and the run exits 0 · Issue #4660 · developing-today/code

aggregator(charges-producer): staged mode falls back to the live Gmail CLI when gmail-triage.json is short — the whole Gmail source is silently dropped and the run exits 0 #4660

New issue
Copy link
New issue
Copy link
Closed
#4671
Closed
aggregator(charges-producer): staged mode falls back to the live Gmail CLI when gmail-triage.json is short — the whole Gmail source is silently dropped and the run exits 0#4660
#4671
Copy link
Assignees
dezren39
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 2, 2026
Issue body actions

Problem

The charge-candidates producer's new staged mode (#4641, commit 7757c2e) is supposed to run on the laptop, where the Plaid/Gmail connector CLIs do not live, reading only staged inputs. But the Gmail triage loop falls back to the live CLI for any query whose staged response is missing:

  • pm-stack/aggregator/scripts/produce-charge-candidates.ts:286-298 — stagedResponses[i] ?? (await run(GMAIL_CLI, ["gmail", "+triage", ...])). gmail-triage.json is documented as "the two +triage responses, in query order", but nothing checks that both are present.
  • On the laptop the default GMAIL_CLI (/opt/hatch/bin/hatch_gws_cli) does not exist, so the fallback throws ENOENT, gmailCandidates rejects as a whole, and main's catch (:402, "gmail read failed …; plaid candidates only") swallows it: the run exits 0 and writes a candidates file with the entire Gmail source missing — including messages the staging did deliver.
  • This contradicts the staged contract the same change documents at :66-69 (stagedText): "a stale or absent staging must fail visibly, never silently produce an empty batch." A short staging is exactly stale/absent staging, and the batch it produces is silently partial instead: the daily collector consumes it as the period's complete candidate set, so that period's Gmail charges simply never match.

The Plaid path does not have this flaw: a missing plaid-transactions.json throws out of plaidCandidates, which main does not catch, so the run fails visibly. The Gmail triage path is the inconsistent one. (Missing gmail-bodies.json is different and correct by design: bodies are requested via gmail-body-requests.json for a later run.)

Evidence (verified this run, laptop probe at origin/main 17610f5)

Probe: ~/git/fleet/probe-2026-11-02-laneB-chargestaged/ on the laptop — the producer extracted verbatim from origin/main (script md5 70bff805), staged inputs for period 2026-11-01..2026-11-02 with one Plaid transaction (Coffee Shop $12.34) and one Gmail receipt ("Your Bakery order receipt $9.99").

  • CONTROL — gmail-triage.json = both responses staged: exit 0, 2 candidates (gmail Bakery $9.99 + plaid Coffee Shop $12.34), gmail skipped 0.
  • PROBE — gmail-triage.json = only the first of the two responses staged: stderr producer: gmail read failed (ENOENT: no such file or directory, posix_spawn '/opt/hatch/bin/hatch_gws_cli'); plaid candidates only, exit 0, output file contains only the Plaid candidate. The staged Gmail message was discarded along with the unstaged query.

Related: #4641 (the staged-mode split this defect ships in), #2448 (a different whole-batch Gmail discard, fixed — same failure shape, different cause).

Acceptance criteria

  • In staged mode (CHARGE_INPUTS_DIR set), the producer never invokes the Plaid/Gmail CLIs, for any input.
  • A gmail-triage.json that is missing, unparseable, or holds fewer responses than the producer issues queries fails the run visibly (non-zero exit, no candidates file written or the file clearly marked failed) instead of producing a plaid-only batch with exit 0.
  • With complete staging, output is unchanged from today (control case above: both sources' candidates present).
  • Live mode (env unset) is unchanged.
  • A regression test or scripted fixture covers the short-staging case.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    effort/sSmall: expected under 2 hours of work
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane B, new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-02 17:20 CST
    • Found via: filed this run
    • Task: Filed after verifying on the laptop (probe probe-2026-11-02-laneB-chargestaged @ origin/main 17610f5): with only 1 of the 2 staged Gmail triage responses present, staged mode shells out to the absent live Gmail CLI, the whole Gmail source is dropped, and the producer still exits 0 writing a plaid-only candidates file.
    • Expectation: effort/s — triage confirms the staged-mode CLI fallback and routes the fix (staged mode never invokes the CLIs; short staging fails visibly).
    • Links: queue packet creator-b-2026-11-02-1720/packets/packet-4660-triage.json (enqueued to repo-health-code-pilot)
  3. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 2, 2026
  4. 10 remaining items

  5. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  6. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up (resume)

    • Agent: queue worker (repo-worker-code), lane code-e
    • Session / ID: task 6625
    • Found via: queue claim (resume of parked task 6625)
    • Task: task 6625 for issue aggregator(charges-producer): staged mode falls back to the live Gmail CLI when gmail-triage.json is short — the whole Gmail source is silently dropped and the run exits 0 #4660 — staged-mode Gmail fallback fix. Resuming from implementation_complete: branch queue/6625-4660-staged-gmail-fallback pushed at 9d93373 (fix +13 in produce-charge-candidates.ts, +68 regression tests), bun tests 26 pass / 0 fail per the prior checkpoint.
    • Fresh revalidation: aggregator(charges-producer): staged mode falls back to the live Gmail CLI when gmail-triage.json is short — the whole Gmail source is silently dropped and the run exits 0 #4660 OPEN, no hard-stop labels; no PR exists yet — the prior lane's gh pr create was rejected twice by the GitHub write throttle, which has since cleared. Opening the PR now, then Codex check, merge under standing criteria, complete task 6625.
    • Links: branch queue/6625-4660-staged-gmail-fallback; triage task 6614
  7. github-actions
    assigned
    dezren39
    on Nov 3, 2026
  8. dezren39
    added a commit that references this issue on Nov 3, 2026

    Merge pull request #4671 from developing-today/queue/6625-4660-staged…

    10e4ec1
  9. dezren39
    closed this as completedin #4671on Nov 3, 2026
  10. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 3, 2026
  11. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    Agent note — done (queue worker, lane code-e)

    • Agent: queue worker (repo-worker-code), lane code-e
    • Session / ID: queue task 6625, completed 2026-11-03
    • Outcome: merged PR fix(aggregator): staged mode never falls back to the live Gmail CLI; short staging fails visibly (#4660) #4671 (merge 10e4ec1); issue auto-closed by the PR. Resumed from the prior lane's implementation_complete checkpoint — branch and tests were already pushed; this lane opened the PR once the GitHub write throttle cleared, dispositioned Codex, and merged.
    • Validation: bun test test/produce-charge-candidates.test.ts — 26 pass, 0 fail (prior lane, laptop; includes the 2 new staged-mode regression tests: short staging fails non-zero with no candidates file, complete staging yields both candidates). Codex review of 9d93373: no findings. PR guard check never left QUEUED (fleet runner backlog); merged under standing merge authority.
  12. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane L (code-l)
    • Session / ID: task 6614
    • Found via: queue claim
    • Task: Triage of issue aggregator(charges-producer): staged mode falls back to the live Gmail CLI when gmail-triage.json is short — the whole Gmail source is silently dropped and the run exits 0 #4660 — staged charges producer falls back to the live Gmail CLI on short staging.
    • Verdict: CONFIRMED as scoped. Re-verified fresh 2026-11-02T23:35Z against current main 17610f5553de6bbb4d3204a29f9e588bd59c5af6 (unchanged from the creator probe): pm-stack/aggregator/scripts/produce-charge-candidates.ts:286-298 parses gmail-triage.json into stagedResponses and uses stagedResponses[i] ?? live run(GMAIL_CLI, +triage) with no length check (the queries array has exactly 2 entries); main at :388-404 catches the resulting gmail failure and writes a plaid-only candidates file with exit 0. One sharpening for the fix: in staged mode any gmail error is swallowed by that catch today — missing and unparseable staging included, not just short staging — so the fix must make staged-mode gmail failures fail the run, not only add the length check. The Plaid path is safe only because stagedText throws on a missing file in staged mode, and the gmail body-read path (:334-341) is already INPUTS_DIR-guarded; both are named out of scope in the fix packet.
    • Routing: implementation follow-up enqueued as task 6625 (small_fix, acceptance criteria from issue aggregator(charges-producer): staged mode falls back to the live Gmail CLI when gmail-triage.json is short — the whole Gmail source is silently dropped and the run exits 0 #4660 intact, plus the staged-mode catch fix above). No PR opened in this triage task, per its scope.
    • Expectation: effort/s fix; done = short/missing/unparseable staging fails visibly (non-zero, no complete candidates file), complete-staging control unchanged, live mode unchanged, regression fixture for the short case.
    • Links: task 6625; issue Split charge-candidates producer: staged inputs staged on the sandbox, producer runs on the laptop #4641 (staged split that shipped the defect); issue aggregator(charges-producer): one Gmail message with a missing/garbled date throws RangeError and discards the whole Gmail candidate batch #2448 (different cause, same shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.