---
title: Cut per-item and trace noise from league cron job logs
type: task
status: completed
description: >-
  Four league cron emitters (Sleeper unmatched-player lines, projections simulation debug, backup
  set -x trace, a repeated Node module-type warning) fill /var/log/league; replace them with per-run
  outcome counts.
base_uri: user:task/league/cut-league-cron-log-noise.md
created_at: '2026-10-14T03:41:00.481Z'
entity_id: 946ae87f-4272-4430-9fd3-653ed9ca3e6a
finished_at: '2026-10-15T05:18:32.895Z'
observations:
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
owner_identity_uri: █████████████████████████
priority: Medium
public_read: true
started_at: '2026-10-14T03:47:00.090Z'
tags:
  - user:tag/league-xo-football.md
updated_at: '2026-10-15T05:18:32.895Z'
visibility_analyzed_at: '2026-11-05T23:48:41.682Z'
---

## Problem

Four league cron jobs write per-item chatter or trace output into `/var/log/league`, which fills the per-file cap and buries the one number that matters. Measured 2026-10-13 on the league host:

- `import-players-sleeper.log` — 100,416 `get-player no player rows found for query: ...` lines in the current file (about 12 MB/day). The script enables the `get-player` namespace, so `libs-server/find-player-row.mjs:390` logs every unmatched Sleeper id. The match rate is a data-quality measure and is nowhere in the run's output.
- `process-projections.log` — about 20 MB/day from the hourly run. `scripts/process-projections.mjs` enables `simulation:*` (lines 70 and 1496), printing load/simulate/correlation-matrix lines per player and per game.
- `league-postgres-backup.log` — `scripts/postgres-backup.sh` runs under `set -x` (line 3) every 15 minutes, so the log is a shell trace (78 MB since 2026-09-19).
- 86 of the job logs repeat a `MODULE_TYPELESS_PACKAGE_JSON` warning on every run: `app/core/data-views-fields/declared-column-params.js` is ESM imported from server code, with no module type declared for it, so Node reparses it each time.

## Plan

- [x] `import-players-sleeper.mjs`: drop `get-player` from the enabled namespaces, and print one `console.log` outcome line per run with the matched and unmatched counts (the "count what you linked" rule in `docs/guides/scripts.md`). Spec the count. `find-player-row.mjs` itself enabled `get-player` at module scope, so the enable moved into its CLI `main()`.
- [x] `process-projections.mjs`: drop `simulation:*` from both `enable_debug_namespaces` calls; keep a per-run summary through `console.log`.
- [x] `postgres-backup.sh`: remove `set -x` and echo explicit outcome lines (dump path, size, retention pruned). This also removes the risk, noted on task `████████████████████████████████`, of the trace printing a credential.
- [x] Declare the module type of the field registry by renaming the 37 server-loaded `.js` files in `app/core/data-views-fields` to `.mjs` (all but `index.js` and `cell-presentation.js`, which stay client-only `.js`). Node warns once per `package.json`, so `declared-column-params.js` is only the first of them; every cron and pm2 entry but four loads all 37, and nothing outside that directory is typeless. Rewrite the in-directory specifiers, the 15 outside imports, the `aggregator_module` constant in `read-client-field-registry.mjs`, the parity spec's helper list and fs paths, and the two `db/gates` path references. Webpack needs no config change (`.mjs` is in `resolve.extensions` and `fullySpecified` is off). Rejected: a scoped `package.json` breaks the `#constants` subpath import; root `"type":"module"` puts about 1,100 SPA files under strict ESM in webpack; a Node flag hides the warning instead of fixing it. Confirm with a webpack build and a cron-shaped run.
- [x] After deploy, re-measure each stream's daily growth on the league host against the figures above.

## Done when

Each of the three streams grows at a small fraction of its 2026-10-13 rate, the Sleeper run prints its match counts, and no job log contains `MODULE_TYPELESS_PACKAGE_JSON`.
