Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/fleet-schedule-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ preserved. OpenChamber scheduled tasks remain on the configured
`opencode-route` / `workhorse` route. The separate #3026 claimant /
executor remains on its own protocol.

### 2b. Laptop systemd user timers (47 listed: 43 enabled, 1 installed-but-disabled; 4 Nix-configured pending deployment)
### 2b. Laptop systemd user timers (48 listed: 43 enabled, 1 installed-but-disabled; 5 Nix-configured pending deployment)

The OS-timer half of surface 2. Cadence is the unit's own `OnCalendar`/`OnUnitActiveUSec` spec, read live from `systemctl --user show`. Specs are recorded **complete** — the full effective calendar expression, date **and** time components (e.g. `*-*-* *:*:00`); never truncate a spec to a date-only prefix, because a bare `*-*-*` normalizes to daily at midnight and misstates the cadence (issue #5313). Prompt/brief pointer is the unit file in `~/.config/systemd/user/` (or its Nix store target for linked units). Installed-but-disabled timer units ARE listed in this table and marked `(disabled)` after the unit name: the registry inventories what is installed on the laptop, not only what is currently scheduled, so a disabled unit stays visible until it is uninstalled (reconciled 2026-11-04, issue #5661).

Expand Down Expand Up @@ -408,6 +408,7 @@ The OS-timer half of surface 2. Cadence is the unit's own `OnCalendar`/`OnUnitAc
| `pm-projector-reconcile.timer` | `OnCalendar=*-*-* *:00/15:00` | `pm-projector-reconcile.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `pm-tunnel-watchdog.timer` (Nix-configured; not yet loaded) | `OnUnitActiveSec=2min,OnBootSec=2min` (not live-verified) | `pm-tunnel-watchdog.service` | laptop (user systemd) | not recorded | not recorded | 2026-11-11 | 2026-11-11 |
| `quota-gatherer.timer` | `OnCalendar=*-*-* *:00/15:00` | `quota-gatherer.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-22 |
| `quota-weekly-review.timer` | `OnCalendar=Mon *-*-* 07:20:00` | `quota-weekly-review.service` | laptop (user systemd; code#12701; NixOS module `services.pm-stack`, package `pkgs/pm-aggregator` — Stage-3 S7 weekly forecast-accuracy review: posts the report to epic #12694, S6 proposal PRs only, never edits config; Nix-configured pending deployment) | not recorded | not recorded | 2026-11-23 | 2026-11-23 |
| `repo-archive-backup.timer` | `OnCalendar=*-*-* 05:15:00` | `repo-archive-backup.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `repo-universe-issue-check.timer` | `OnCalendar=*-*-* 00:00:00` | `repo-universe-issue-check.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `queue-coverage-reconcile.timer` (repo-shipped, not yet installed) | `OnCalendar=*-*-* *:41:00` | `queue-coverage-reconcile.service` | laptop (user systemd; code#7016) | not recorded | not recorded | 2026-11-08 | 2026-11-08 |
Expand Down
39 changes: 39 additions & 0 deletions nixos/services/pm-stack/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,34 @@ in
};
};

quota-weekly-review = {
Unit = {
Description = "Quota weekly review — Stage-3 S7 forecast-accuracy report to epic #12694 (NixOS; packaged pm-aggregator, #12701)";
After = [ "network-online.target" ];
};
Service = {
Type = "oneshot";
TimeoutStartSec = 900;
WorkingDirectory = aggState;
# The job reads the snapshot store + S1/S3 products from
# the aggregator state dir, and — like the fleet-feed
# collector — the route config and git operations from
# the checkout: S6 proposal PRs are opened from the
# checkout and NEAR_PCT is read from its derive.ts.
ExecStart = builtins.concatStringsSep " " [
"${pmAggregator}/bin/pm-aggregator-quota-weekly-review"
"--store-dir ${aggState}/snapshots"
"--route-config ${home}/git/code/.opencode/opencode.jsonc"
"--forecast ${aggState}/quota-forecast.json"
"--shadow ${aggState}/quota-shadow-placement.json"
"--out-dir ${aggState}/weekly-review"
"--repo-root ${home}/git/code"
"--open-prs"
"--post"
];
};
};

# fleet-feed-collector is the one unit still running from
# the checkout, deliberately (code#8171 follow-up): its script
# derives repo-root paths from its own file location — it
Expand Down Expand Up @@ -652,6 +680,17 @@ in
Install.WantedBy = [ "timers.target" ];
};

quota-weekly-review = {
Unit.Description = "Run the Stage-3 weekly forecast-accuracy review on Mondays at 07:20 local (pm-stack, #12701)";
Timer = {
OnCalendar = "Mon *-*-* 07:20:00";
RandomizedDelaySec = 60;
Persistent = true;
Unit = "quota-weekly-review.service";
};
Install.WantedBy = [ "timers.target" ];
};

fleet-feed-collector = {
Unit.Description = "Collect the fleet feed for the laptop aggregator every ~5 minutes";
Timer = {
Expand Down
2 changes: 2 additions & 0 deletions pkgs/pm-aggregator/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ stdenvNoCC.mkDerivation {
--add-flags "run $out/libexec/pm-aggregator/scripts/generate-digest.ts"
makeWrapper ${lib.getExe bun} $out/bin/pm-aggregator-export-turso-stores \
--add-flags "run $out/libexec/pm-aggregator/scripts/export-turso-stores.ts"
makeWrapper ${lib.getExe bun} $out/bin/pm-aggregator-quota-weekly-review \
--add-flags "run $out/libexec/pm-aggregator/scripts/quota-weekly-review.ts"
runHook postInstall
'';

Expand Down
3 changes: 2 additions & 1 deletion pm-stack/aggregator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"provenance:check": "bun run scripts/check-provenance-matrix.ts",
"typecheck": "bunx tsc --noEmit",
"build:css": "tailwindcss -i src/ui.css -o src/assets/app.css",
"proposals:quota-reweight": "bun run scripts/quota-reweight-proposals.ts"
"proposals:quota-reweight": "bun run scripts/quota-reweight-proposals.ts",
"review:quota-weekly": "bun run scripts/quota-weekly-review.ts"
},
"devDependencies": {
"@playwright/test": "1.64.0",
Expand Down
Loading