Skip to content

deploy(deploy.py): targets entries have no shape rule — newline/ANSI/space targets pass validate() and are printed verbatim by list, injecting fake table rows #6510

Closed

Description

@dezren39

deploy(deploy.py): targets entries have no shape rule — newline/ANSI/space targets pass validate() and are printed verbatim by list, injecting fake table rows

pkgs/deploy/deploy.py's module docstring states the contract: validation "is the oracle for 'well-formed definition'… a registry that cannot be validated must never be enumerated as if it were trustworthy." Service names get a shape pattern (NAME_RE, deploy.py:52), but targets entries — described by the validator's own error text as "host/class names" — get no shape check at all, and list prints them verbatim.

Evidence (verified this run)

At origin/main 85c435ec6c:

  • deploy.py:138-144 — the entire targets rule is: a non-empty list of non-empty strings. No character, shape, or control-character restriction.
  • deploy.py:182 — cmd_list prints ','.join(defn['targets']) raw into the table.

Probe on the laptop (~/git/fleet/probe-deploy-target-newline/probe.py, driving the real deploy.py from origin/main against hand-written registries; all other fields valid):

  • X1 — newline target: targets: ["laptop\nFAKE systemd evil"] → exit 0, and the output contains an injected fake row:
    NAME  CLASS       TARGETS
    svc  systemd     laptop
    FAKE  systemd     evil
    
  • X2 — ANSI target: targets: ["lap\x1b[31mtop"] → exit 0, the raw escape sequence is emitted into the terminal output unchanged.
  • C2 — space target: targets: ["bad name"] → exit 0 (a "host/class name" with a space is not a host or class name in any downstream consumer).
  • C1 — valid control: the ordinary registry (targets: ["laptop"]) → exit 0, normal table. Correct.

Why it matters

Acceptance criteria

Related: #6383 (same validator, service-name newline class — names only), #5766 (the deploy tool epic this validation gates).

Activity

  1. developing-today commented on Nov 6, 2026

    @developing-today
    Contributor
  2. added
    kind/bug
    task/triage
    source/creator
    status/needs-triage
    priority/normal
    app/deploy
    queue/queued
    on Nov 6, 2026
  3. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. added
    work/assigned
    queue/claimed
    status/in-progress
    and removed
    status/needs-triage
    queue/queued
    on Nov 6, 2026
  5. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. 55 remaining items

  7. added
    status/in-progress
    work/assigned
    and removed
    queue/queued
    on Nov 8, 2026
  8. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage verdict: confirmed, already triaged and tracked elsewhere.

    • Lane code-o triaged issue deploy(deploy.py): targets entries have no shape rule — newline/ANSI/space targets pass validate() and are printed verbatim by list, injecting fake table rows #6510 on 2026-11-06 (task 11027): verdict CONFIRMED, fix path scoped (a NAME_RE-class shape rule for targets entries in pkgs/deploy/deploy.py validate(); regression home is the deploy-list-malformed flake check), and the implementation was routed to follow-up task 11028, which has been cycling through opencode handoffs since.
    • Re-verified fresh this shift at current main: the gap is unchanged — validate()'s entire targets rule is still "non-empty list of non-empty strings" and cmd_list still prints ','.join(defn['targets']) verbatim, so a newline/ANSI/space target still passes and reaches the output unsanitized.
    • Blockers/ordering: none recorded by task 11027 and none found now. The remaining work is task 11028 executing (claimant binding is its bottleneck, as with the other opencode-routed tasks), not another triage.
  9. removed
    queue/claimed
    work/assigned
    status/in-progress
    on Nov 8, 2026
  10. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    Agent note — task 13322 resumed (lane code-d): PR #6586 shepherded under Drew's #7297 per-item ruling

    The recorded blocker was the authorship hard stop, overturned by Drew's 2026-11-11 #7297 ruling (dezren39 = fleet identity; authorship is not a hold; merge what should be merged). Task 13322 was in the batch unblock list; lane assignment returned direct.

    Fresh verification on head 49d2ed3: the Codex P1 (cover target identifier invariants with property tests) was fixed in this head — pkgs/deploy/test_target_shape_property.py with an independent is_valid_target oracle — and its reply was posted 2026-11-08; the thread was still UI-unresolved, now resolved by this lane. Local runs on the head: test_deploy_slice2.py 22 tests OK; test_target_shape_property.py property holds over 500 cases. The scripts-test failures on the PR are stale 2026-11-09 stall runs (21h50m duration); the deploy suites those checks exercise pass locally on this head. Proceeding to merge per the per-item rule.

  11. added a commit that references this issue on Nov 11, 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

    app/deploykind/bugpriority/normalsource/creatorstatus:donetask/triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions