Tenant portal-snapshot Runs bun lib/operations/portal-snapshot-cron.ts --once
— 0 */6 * * * UTC via in-process Bun.cron complement (OS primary
0 8 * * * local via portal:snapshot:cron:register)
Proof portal-snapshot-cron-v1 · snapshot-data-plane-v1 (CLI/types)
Catalog not in MAINTENANCE_RUNBOOKS / spine — CLI · OS cron · in-process register only
Scope-aware data-plane captures (not registry bake — see ops-snapshot.md):
snapshots/<id>.txt (scope=prediction mae=…)snapshots/index.jsonlsnapshot-scopes.ts| Layer | API | Schedule | Owner |
|---|---|---|---|
| Primary | Bun.cron(path, schedule, title) |
0 8 * * * local |
OS (launchd/crontab) |
| Complement | Bun.cron(schedule, handler) |
0 */6 * * * UTC |
in-process register API (lib/operations/portal-snapshot-cron.ts) |
Contract: docs/harness/cron.md
# Manual / CI
bun run portal-cli snapshot run --scope prediction
bun run portal:snapshot:once
bun run portal:snapshot:once -- --dry-run
# OS-persistent (primary)
bun run portal:snapshot:cron:register
bun run portal:snapshot:cron:preview
bun run portal:snapshot:cron:remove
# In-process complement (daemon owns lifetime; not wired into serve-public)
PORTAL_SNAPSHOT_CRON=1 bun lib/operations/portal-snapshot-cron.ts
| Variable | Default | Effect |
|---|---|---|
PORTAL_SNAPSHOT_SCOPES |
prediction |
Comma list: prediction,portal,gaps,limits |
PORTAL_SNAPSHOT_OS_SCHEDULE |
0 8 * * * |
OS cron (local time) |
PORTAL_SNAPSHOT_INPROCESS_SCHEDULE |
0 */6 * * * |
In-process (UTC) |
SNAPSHOT_BASE_URL |
http://localhost:3000 |
Fetch origin |
PORTAL_SNAPSHOT_DIR |
snapshots |
Output root |
Package scripts: portal:snapshot · portal:snapshot:once · portal:snapshot:cron:*
· portal-cli snapshot cron …
bun run portal:snapshot:once -- --dry-run or bun test tests/portal-snapshot-cron.test.ts exits non-zero.
Also: empty snapshots/index.jsonl after expected captures, or portal-cli snapshot grep
finds no recent scope=prediction rows when report was rebaked.
bun run portal:snapshot:once -- --dry-runbun test tests/portal-snapshot-cron.test.ts · bun run test:portal-snapshot:cron-osSNAPSHOT_BASE_URL=http://127.0.0.1:8787 bun run portal:snapshot:oncebun run portal-cli snapshot list --scope predictionbun run check:snapshot:typesDo not delete OS cron registration only to green a local daemon.
Remove when CI always runs portal:snapshot:once after prediction report bake
and OS cron owns daily capture.
Retirement verified false — set tenants.portal-snapshot=true in
lib/harness/ci-owned-tenants.json
when CI owns the periodic refresh (today the tenant is CLI/OS/in-process only).
Owner // owner: platform / portal data-plane Fresh-rerun
bun test tests/portal-snapshot-cron.test.ts
prediction-report.mdops-snapshot.mdbun run docs:tenant-portal-snapshotbun test tests/portal-snapshot-cron.test.ts
bun run check:snapshot:types
bun run test:portal-snapshot:cron-os
bun run test:cron