Skip to content

feat(pm-stack): add pm-core scheduler seam for quota and feed jobs - #12905

Open
dezren39 wants to merge 1 commit into
mainfrom
codex/agent-next-01-8570-schedulers
Open

dezren39 wants to merge 1 commit into
mainfrom
codex/agent-next-01-8570-schedulers

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • make the quota gatherer and fleet-feed collector importable without changing their CLI entry points
  • add the first pm-core scheduler seam with 15-minute quota and 5-minute fleet-feed cadences
  • enforce single-flight jobs and write-only success/error audit records

Evidence

  • cd pm-stack/aggregator && bun test test/pm-core-scheduler.test.ts — 3 passed, 0 failed
  • cd pm-stack/aggregator && bunx tsc --noEmit — passed
  • git diff --check — passed
  • ran locally from origin/main at commit 2006080757b

Scope

This is the schedulers-first slice of #8570. It does not cut over systemd units or fold projector reads yet; those remain the next slices.

Refs #8570


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

@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 04:47
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8856fb68-2492-4990-bd3b-6b9ce7284258
Commits

Reviewing files that changed from the base of the PR and between 1db3530 and 2006080.

Files selected for processing: 4

  • pm-stack/aggregator/scripts/collect-fleet-feed.ts
  • pm-stack/aggregator/scripts/gather-quota.ts
  • pm-stack/aggregator/src/pm-core-scheduler.ts
  • pm-stack/aggregator/test/pm-core-scheduler.test.ts
  • 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T04:50:05.183582Z 2006080 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2006080757

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

start() {
if (timers.size > 0) return;
for (const job of Object.keys(jobs) as SchedulerJobName[]) {
timers.set(job, setTimer(() => void runNow(job), cadence[job]));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle audit-write failures in scheduled callbacks

If writeAudit rejects because its destination is unavailable or full, runNow catches the initial failure but then awaits another write to the same failing sink, allowing that rejection to escape. The interval callback discards the returned promise without a rejection handler, so an audit-storage failure becomes an unhandled rejection in the hosting process instead of an isolated scheduler error. Handle audit failures separately and attach a rejection handler to timer-triggered runs so failure of the write-only audit sink cannot disrupt both jobs.

Useful? React with 👍 / 👎.

@dezren39
dezren39 removed the request for review from a team November 23, 2026 05:55

This branch has not been deployed

No deployments
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