Skip to content

pm-stack: sync-decision-events kill switch returns 0 before parseArgs, so invalid args silently succeed (from PR #9341) #9794

Closed

Description

@dezren39

Finding (from PR review)

PR #9341 (merged, feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335)) adds the sync-decision-events.ts operator script. Codex's P1 finding: the kill switch returns success before arguments are parsed, so with DECISION_EVENTS_SYNC=0 an invocation such as --targte webhook (typo) silently exits 0 instead of reporting a usage error — violating the operator-script contract (root AGENTS.md) that every unaccounted-for argument produces a non-zero usage error. (Cap-excess backlog body, prepared 2026-11-13 by pr-comment-review; not yet filed.)

"With DECISION_EVENTS_SYNC=0, the script returns success before validating arguments, so an invocation such as --targte webhook silently succeeds instead of reporting a usage error. This violates the operator-script contract in AGENTS.md, which requires every unaccounted-for argument to produce a non-zero usage error. Move parseArgs() ahead of the kill-switch return so disabled invocations still validate their command line."

No-response / still-live evidence (verified 2026-11-14)

  • Thread unresolved, no replies (GraphQL reviewThreads: isResolved=false, 1 comment); no fix commit after the comment (only a merge of origin/main, 66940fb15f).
  • On current main, pm-stack/aggregator/scripts/sync-decision-events.ts:101-105: the DECISION_EVENTS_SYNC === "0" check returns 0 at line 103, and parseArgs() is only called at line 105 — disabled invocations never validate their command line.
  • Dedupe: no issue found by comment id or keywords.

Acceptance criteria

  • parseArgs() runs before the kill-switch return, so a disabled invocation with an invalid argument exits 2 with the usage error, and a valid disabled invocation still exits 0 as a no-op.
  • Or: a documented decision on this issue that this behavior is accepted, with the reasoning recorded.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/lowNice to have; do when convenient
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 14, 2026
  2. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code-b — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-b posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  5. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 14, 2026
  6. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Released by repo-worker-code-b (outcome: done). PR #10113 MERGED (1bd2c80): parseArgs() moved ahead of the DECISION_EVENTS_SYNC kill switch; disabled+invalid exits 2, disabled+valid exits 0 no-op, enabled paths unchanged, decision tests pass. Issue #9794 CLOSED.

  7. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up / already done verified

  8. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    state: done (already_done — re-served claim)
    task: 17170 (lane any-d, repo-worker-code)

    Verified fresh by lane any-d: issue #9794 is CLOSED; the fix landed in PR #10113 (MERGED 2026-11-14T16:12:06Z, merge commit 1bd2c80) — parseArgs() moved ahead of the DECISION_EVENTS_SYNC kill switch, so disabled+invalid exits 2, disabled+valid exits 0 as a no-op, enabled paths unchanged. Also independently verified by lane code-c (note 2026-11-14T18:55:57Z). No duplicate work performed; task 17170 completes as already_done.

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

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/pr-comment-reviewFiled by the pr-comment-review jobstatus/donestatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions