Skip to content

aggregator(record-claude-launch): unknown/misspelled/joined/duplicate flags silently ignored — a typo'd --task drops the session↔task linkage, a typo'd --file writes the record to the default registry, exit 0 #7332

Closed

Description

@dezren39

Problem

pm-stack/aggregator/scripts/record-claude-launch.ts — the script a Muse session (or its launcher) uses to register itself in the identity registry, the record that makes the dashboard's task ↔ session linkage work for Muse sessions — silently ignores unknown, misspelled, joined, and duplicate arguments. Every flag is probed with indexOf only:

  • arg() at record-claude-launch.ts:47-50 — process.argv.indexOf('--' + name), first match wins, no scan of the remaining tokens.
  • taskRefs at record-claude-launch.ts:65 — a flatMap over exact --task tokens only.

The flag values were hardened in #3415 (a flag token refused as a value) and #6895 (empty values refused). The unknown-token half was left, exactly as it was for the sibling scripts fixed in #6961/#6967/#7097/#7254/#7289/#7302.

Verified this run (laptop, main @ 36e5b3e, real script run verbatim with bun run, probe ~/git/fleet/probe-claude-launch-unknown-args, script md5 41403504aadfa51193d0de228c9c829d)

Control (documented separated flags) exits 0 and records exactly what it names:

--label Control --model sonnet --status done --id claude-ctrl
-> {"id":"claude-ctrl","label":"Control","parentId":null,"status":"done","model":"sonnet"}

Every one of these exits 0 and appends a record, with the named intent silently dropped or redirected:

Invocation (plus --label X --id <id>) Record actually appended
--modle sonnet (typo) no model field
--stats done (typo) "status":"launched" (the default)
--model=sonnet (joined) no model field
--parnt sess-123 (typo) "parentId":null
--bogus 1 stray (unknown + positional) record appended, tokens ignored
--label First --label Second, --id a --id b (duplicates) first value wins, second silently ignored
--tas developing-today/code#123 (typo) no taskRefs — the session↔task linkage the script exists to create is gone
--task=developing-today/code#123 (joined) no taskRefs
--fil <intended.jsonl> (typo, fake HOME) record written to the default registry file under the fake home, not the intended file — in production the record pollutes the default registry and the collector reading the intended file never sees the session

Why it matters

This script's only job is faithful registration. A typo does not fail the launch — it registers a wrong session: unlinked to its task (--task typo), unparented, with the wrong status/model, or in the wrong file, all with exit 0 and a success line naming the id. The registry merge then folds/dashboards that corrupted record as truth, and there is no signal anywhere that the operator's flag was dropped.

Acceptance criteria

Prior art

Same fix shape as the merged sibling fixes: rejectUnknownArgs() as the first statement of the main flow, exit 2 before any I/O (post-alert #7289/PR #7295, produce-charge-candidates #7302/PR #7304, generate-digest #7097, collect-github-billing #7254).

Activity

  1. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  4. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    source/creatorFiled by the new-issue-creator job
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    priority/normalOrdinary priority (the default)
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 8, 2026
  5. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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

    app/aggregatorPackage/app: aggregator (pm-stack in this repo)effort/xsTrivial: expected under 30 minutes 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 jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions