GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work · Issue #10432 · developing-today/code

pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work #10432

New issue
Copy link
New issue
Copy link
Closed
#10447
Closed
pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work#10432
#10447
Copy link
Labels
status:done

Description

@dezren39
dezren39
opened on Nov 15, 2026
Issue body actions

Summary

pm-stack/shared-schema/orchestration-writer.py ignores extra positional command-line arguments. It treats only sys.argv[1] as the optional orchestration JSON path and never rejects additional arguments, so unaccounted arguments are silently dropped while the script proceeds into its normal work (secret fetches, Management API SQL writes, read-back verification).

This violates the repo's operator-script argument contract: every operator script must declare its whole command line and parse strictly against that declaration before any subprocess, network, file write, lock, or deploy step; anything unaccounted for is a usage error with a non-zero exit (AGENTS.md "Operator script argument contract (#3352)", doc/agents/operator-script-argument-contract.md).

Evidence

  • Script: pm-stack/shared-schema/orchestration-writer.py (writer for pm stack → Supabase phase 1 (#3142): orchestration state into Supabase tables, orchestration.json becomes a generated export #5005 / Long-term: migrate the pm stack into Supabase — refactor component state into schemas for central management #3142 orchestration-state cutover).
  • Declared/documented usage: orchestration-writer.py [path-to-orchestration.json] (header, lines ~30-33).
  • Arg handling: path = sys.argv[1] if len(sys.argv) > 1 else <default> (around line 99), with no check that len(sys.argv) <= 2 and no usage error for extra args. No argparse/strict parsing is present.
  • Repro (verified 2026-11-15, from repo root):
# first arg is used, second is silently ignored; script proceeds past argv handling
printf '%s' '{"runId":"x","generatedAt":"x","version":1}' > /tmp/ow-ok.json
python3 pm-stack/shared-schema/orchestration-writer.py /tmp/ow-ok.json /tmp/ow-ignored-extra.json
# observed: exit 1 with "SQL failed (HTTP 400)... invalid input syntax for type timestamp..." 
# (script read the first file, ignored /tmp/ow-ignored-extra.json, fetched secrets, and attempted SQL)
  • Contrast with strict scripts in repo (e.g. pm-stack/host-health-collector.py rejects unknown args via argparse with exit 2 before work).

Why it matters

This is a DB-writing operator script (inserts/replaces orchestration rows via Supabase Management API). Silently ignoring an extra argument can hide a typo or a mistaken invocation (wrong/missing flag style, extra path) while the script still performs network and database operations against the interpreted input. A strict usage error before any work prevents accidental or misleading runs.

Acceptance criteria / suggested fix shape

  • Reject unaccounted CLI arguments (any extra positional args, or unknown flags if flags are not part of the declared contract) with a clear usage error on stderr and non-zero exit (exit 2 consistent with argparse/contract examples) before any subprocess, secret fetch, network request, file read/write, or database step.
  • Preserve existing valid behavior: no args uses the default path; exactly one positional arg uses that path.
  • State the argument contract in the script header comment (per doc/agents/operator-script-argument-contract.md / sibling operator scripts).
  • Add/adjust a targeted test covering rejection of extra args if a test harness exists for this script (or document verification if none exists), without weakening existing behavior.

Activity

  1. developing-today commented on Nov 15, 2026

    @developing-today
    developing-todayBot
    on Nov 15, 2026 – with developing.today
    Contributor
    More actions

    CODE-3777

  2. dezren39 commented on Nov 15, 2026

    @dezren39
    dezren39
    on Nov 15, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo queue worker, lane code-b (repo-worker-code)
    • Task: task 17352 for issue pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work #10432 (small_fix: reject unaccounted CLI arguments in pm-stack/shared-schema/orchestration-writer.py).
    • Fresh check: issue pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work #10432 is OPEN, no labels at all — no hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit), no status/needs-triage. No PR and no branch for issue pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work #10432 exists.
    • Lane assignment: direct (lane row returned direct; this session does the work).
    • Next: create laptop worktree, implement strict argument parsing (exit 2 usage error before any side effects), add regression test, open PR.
    • Links: task 17352 · issue pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work #10432
  3. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 15, 2026
  4. dezren39
    added a commit that references this issue on Nov 15, 2026

    fix(pm-stack): orchestration-writer rejects unaccounted CLI arguments (…

    7a777ff
  5. dezren39
    closed this as completedin #10447on Nov 15, 2026
  6. dezren39 commented on Nov 15, 2026

    @dezren39
    dezren39
    on Nov 15, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: repo queue worker, lane code-b (repo-worker-code)
    • Task: task 17352 for issue pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work #10432 — fixed_merged.
    • Outcome: PR fix(pm-stack): orchestration-writer rejects unaccounted CLI arguments #10447 MERGED (squash, merge sha 7a777ff); issue pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work #10432 CLOSED by the merge. orchestration-writer.py now parses its command line strictly with argparse (one optional positional path, allow_abbrev=False) at module top, BEFORE the module-level secret fetches: any unaccounted argument exits 2 with a usage error before any subprocess, secret fetch, network request, or file read. Header now states the Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 argument contract. Valid behavior unchanged (no args = default path; one arg = that path).
    • Tests: new pm-stack/shared-schema/test_orchestration_writer_args.py — python3 -m unittest: 3/3 OK (extra positional exit 2 naming the arg + no secret-fetch attempt; unknown flag exit 2; single-positional control accepted, never exit 2, never reaches SQL). Manual repro of the issue case also exits 2 immediately. Oracle: the Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 contract.
    • Codex: review could not run — Codex usage limits reached (both the open trigger and a re-review request returned the limit message); no findings exist to disposition.
    • Links: task 17352 · issue pm-stack(shared-schema/orchestration-writer): reject unaccounted CLI arguments before doing any work #10432 · PR fix(pm-stack): orchestration-writer rejects unaccounted CLI arguments #10447
  7. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 15, 2026
  8. developing-today
    added
    status:done
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.