Skip to content

fix(pm-stack): resolve snapshot pipeline defaults to the laptop trees (#4889) - #9780

Merged
dezren39 merged 1 commit into
mainfrom
queue/8039-4889-snapshot-defaults
Nov 14, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/8039-4889-snapshot-defaults

Conversation

@dezren39

@dezren39 dezren39 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Closes the script-defaults half of #4889 (task 8039); the cron-definition half landed 2026-11-10.

Problem

append-usage-snapshots.ts (and its siblings collect-fleet-feed.ts, backfill-usage-snapshots.ts) defaulted the quota view, provider registry, and snapshot outbox to the ~/workspace goal tree. On the laptop that tree is a stub with no quota-view.md: the stewardship append step died with ENOENT, and the collector silently drained a stub outbox instead of the real one in ~/.local/state/pm-aggregator.

Change

New shared pm-stack/aggregator/src/default-paths.ts picks the default only when no env override is set:

  • view/registry → ~/hatch-personal/workspace/goals/... mirror when present,
  • outbox → ~/.local/state/pm-aggregator/usage-snapshot-outbox.jsonl when the state dir exists,
  • otherwise the historical ~/workspace defaults (sandbox/CI unchanged).

Explicit env overrides keep winning; no change to record derivation or dedupe.

Verification (on the laptop)

  • Bare bun run scripts/append-usage-snapshots.ts (no env): exit 0, appended 26 records to the real state-dir outbox.
  • With the collector's env set: exit 0, records land at the override path (verified against a temp outbox).
  • Named tests pass: append-usage-snapshots-argv-6961, append-usage-snapshots-by-3295, backfill-usage-snapshots-argv-6973, backfill-usage-snapshots-dir-3330.
  • Full aggregator suite: fail set identical to unmodified main (40 pre-existing failures, 0 introduced). tsc --noEmit cannot run in a bare worktree (missing bun type defs) — same failure on unmodified main.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…#4889)

append-usage-snapshots.ts, collect-fleet-feed.ts and
backfill-usage-snapshots.ts defaulted the quota view, provider registry
and snapshot outbox to the ~/workspace goal tree. On the laptop that
tree is a stub with no quota-view.md: the stewardship append step died
with ENOENT and the fleet-feed collector silently drained a stub
outbox instead of the real one.

New shared src/default-paths.ts picks the default when no env override
is set: view/registry resolve to the ~/hatch-personal mirror of the
goal workspaces when present, the outbox to the collector's
~/.local/state/pm-aggregator dir when it exists, falling back to the
historical ~/workspace defaults otherwise. Explicit env overrides
(QUOTA_VIEW_PATH, QUOTA_REGISTRY_PATH, USAGE_SNAPSHOT_OUTBOX_PATH,
PROVIDER_USAGE_SNAPSHOT_PATH) keep winning; record derivation and
dedupe are unchanged. This is the script-defaults half of #4889 (the
cron-definition half landed 2026-11-10).

Verified on the laptop: bare `bun run scripts/append-usage-snapshots.ts`
(no env) exits 0 and appends 26 records to
~/.local/state/pm-aggregator/usage-snapshot-outbox.jsonl; with the
collector env set, records land at the override path as before. The
four named tests pass (argv-6961, by-3295, argv-6973, dir-3330) and the
full aggregator suite's fail set is identical to unmodified main
(40 pre-existing failures, 0 introduced).
@dezren39
dezren39 requested a review from a team as a code owner November 14, 2026 05:44
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T05:44:59.347151Z
We couldn’t complete this review. Comment @codex review to try again.
3975ba6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit a5bc476 into main Nov 14, 2026
@dezren39
dezren39 deleted the queue/8039-4889-snapshot-defaults branch November 14, 2026 05:45
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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