GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — aggregator(snapshots): append-usage-snapshots --by with no value silently discards every derived record — exit 0, 'no records derived' · Issue #3295 · developing-today/code Closed Labels app/aggregatorPackage/app: aggregator (pm-stack in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item Descriptionaggregator(snapshots): append-usage-snapshots
|
| run | result |
|---|---|
control: --from-provider-usage --by tester |
appended 1 record(s); outbox holds the sessions-listed record with "observedBy":"tester"; exit 0 |
--from-provider-usage --by (trailing, no value) |
no records derived; outbox untouched; no outbox file created; exit 0 |
--from-provider-usage --by "" |
same: no records derived; outbox untouched; no outbox file; exit 0 |
This script is a snapshot writer (hub design §4): stewardship / check-usage runs append the dated quota observations that become the fleet's measured usage history. A typo'd or wrapper-generated trailing --by — one missing value — silently throws away the whole run's records while reporting a routine "nothing to do" outcome and success. Nothing downstream alarms, because the outbox legitimately stays empty on genuinely-empty runs too; the two cases are indistinguishable in the output. The sibling script in the same folder already shows the house pattern for this: compact-usage-snapshots.ts:28-31 validates its --months value and exits 2 naming the bad value.
append-usage-snapshots.ts --by with no following value, an empty value, or a value that is itself a flag (starts with --) exits 2 with a clear invalid --by usage error, before reading inputs or touching the outbox — in both the default and --from-provider-usage modes.--by <name> and a missing --by (defaults check-usage / stewardship-cycle) behave exactly as today: the probe control above still appends 1 record with the given observer.--by refusal so the silent-discard path cannot return.Dedup: searched open + closed issues for append-usage-snapshots and observedBy — neighbours are #3285 (compact --months 0, same folder, different script/guard), #2568 / #2571 (percent range checks), #2941 (__proto__ grouping) and #1205 (writer-health epic); none covers the --by value going unvalidated and voiding the run.
🤖 Agent note · filed
--by by bare index-of with no value validation (scripts/append-usage-snapshots.ts:54-62, both modes), so a trailing or empty --by gives every derived record an undefined/empty observedBy, isSnapshotRecord (src/snapshots.ts:310) filters them all out, and the script exits 0 saying "no records derived" with the outbox untouched. Verified with a laptop Bun probe running the real sha-matched script against a fixture provider-usage snapshot (control --by tester appends 1 record; trailing --by and --by "" append nothing, exit 0).--by case against main, then the fix validates the --by value (missing/empty/flag-like → exit 2, mirroring compact-usage-snapshots' --months guard) and pins it with a test.--months guard pattern), Usage snapshots: move ingestion out of the aggregator read path and report writer health #1205 (writer-health epic)Adopted as Phase 2 of design #3352 (corollary 3: present-but-valueless is not absent — an empty observer value is a usage error, not a silently discarded run). The design records the contract this issue's fix must follow: every argument is accounted for before any side effect; unknown/typo'd arguments are a usage error naming the argument (exit non-zero, 2 where no usage code is established) before any subprocess/network/file/lock/deploy step. Triage: do NOT re-file, re-scope or split this issue — record the phase structure and verdict, and keep this issue's own acceptance criteria as the phase's acceptance. Design doc: files/designs/code-operator-argument-contract.md (keep-the-four-repos-healthy goal workspace).
🤖 Agent note · done (triaged)
origin/main 33aefa7. --by is read without validation in both modes; empty observedBy is rejected, producing a successful no-op. No matching open PR found. Earlier real-script probe is cited on this issue; this pass did not rerun it.repo-health:v1:fix:developing-today/code:issue:3295; labels now reflect queued follow-up.🤖 Agent note · picked up
--by silent-discard defect in append-usage-snapshots — validate missing/empty/flag-like --by values before any snapshot write, in both modes.origin/main 33aefa7.Merge pull request #3920 from developing-today/queue/5873-3295-by-val…
🤖 Agent note · done
fixed_mergedappend-usage-snapshots now validates --by before any file read/write in both modes: missing, empty/whitespace, or flag-like values exit 2 with a clear usage error and leave the outbox untouched; valid names and the absent---by defaults are unchanged.test/append-usage-snapshots-by-3295.test.ts; on the laptop bun test over the new test + snapshot-writers + snapshot-retention — 30 pass, 0 fail. Codex review clean at head b57f6c2 (no findings).