Skip to content

fix(pm-stack): strict argv for the quota exporters + projector CLI — the lenient opt() idiom left from the #3352 inventory #8650

Closed

Description

@dezren39

Follow-up from the Phase 3 closing inventory of #3352 (posted on #3353): these argv consumers sit outside #3353's named scopes (the pm-stack quota exporters live at pm-stack/<name>/*.mjs, not pm-stack/*/scripts/; the projector is a service CLI), so they were dispositioned (b) there with this issue as the named follow-up. Each parses by membership test (args.indexOf(name) opt() idiom / process.argv.includes) with no unknown-argument rejection — the #3352 costume-1 pattern: a typo'd flag is silently ignored and the run proceeds with defaults.

Files

  • pm-stack/cloudflare-export/cloudflare-quota-export.mjs — opt() idiom in main(); unknown args ignored; writes export outputs.
  • pm-stack/supabase-export/supabase-quota-export.mjs — same opt() idiom; unknown args ignored; writes export outputs.
  • pm-stack/meta-exporter/meta-quota-export.mjs — same opt() idiom; unknown args ignored; writes export outputs.
  • pm-stack/projector/src/cli.ts — subcommand from process.argv[2], values via indexOf, --no-ack via includes; unknown flags ignored on a CLI whose reconcile path acks work.

Work

Apply the #3352 contract per tool (per-tool strict parsing, no shared library): declare each tool's whole command line, reject anything unaccounted for with a usage error naming the offending argument, exit 2, before any fetch/write/ack side effect. Value options follow corollary 3 (present-but-valueless is not absent). Check callers (systemd units, timers, stewardship invocations, docs) for arguments that were previously ignored, per #3353 step 5, and name any caller fix in the closing evidence.

Acceptance

Activity

  1. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    on Nov 11, 2026
  2. developing-today commented on Nov 11, 2026

    @developing-today
    Contributor
  3. added this to the PM stack coherence milestone on Nov 12, 2026
  4. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Agent note — triaged, task 18717 for issue #8650 (lane any-e)

  5. added
    status/triagedTriaged and routed (see agent note)
    priority/normalOrdinary priority (the default)
    effort/sSmall: expected under 2 hours of work
    kind/refactorCode restructuring with no behavior change
    on Nov 17, 2026
  6. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code / lane code-f (scheduled OpenChamber lane). Queue task 20204. Revalidated issue open; implementing strict argv for projector CLI only.

  7. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/triagedTriaged and routed (see agent note)
    on Nov 17, 2026
  8. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Implementation / probe evidence for PR #11278: pm-stack/projector/src/cli.ts now validates full argv before opening/migrating the DB. Subprocess probes: 9 passed; invalid reconcile and queue-view invocations (unknown flags, unknown command, positional args, missing/flag-shaped values, invalid format) all exit 2, name the offending token, emit no stdout, and do not create the configured SQLite DB file. This proves no DB migration or queue-view ack occurs. Full projector suite: 171 passed. Valid manual queue-view invocation with --tasks / --window-hours 24 / --consumer queue-view / --no-ack / --format json returned JSON successfully. Caller audit: package wrapper invokes CLI with no args (default reconcile); systemd timer triggers wrapper; queue-view is documented manual invocation; no previously-ignored caller args found.

  9. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Done: PR #11278 merged at a6635cc30b9885269c7f108e12e522608d9a4a13; #8650 closed by the merge. Targeted probes 9/9 and full projector suite 171/171 passed. Evidence also linked on #3353.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/sSmall: expected under 2 hours of workepic/pm-stackReprioritization program epic (2026-11-12)kind/refactorCode restructuring with no behavior changepriority/normalOrdinary priority (the default)status:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions