Repository navigation
Closed
Labels
app/deployPackage/app: deploy (pkgs/ or apps/ in this repo)kind/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/triageQueue packet kind: verify, reproduce, and route this item
Description
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
targetsrule is: a non-empty list of non-empty strings. No character, shape, or control-character restriction. - deploy.py:182 —
cmd_listprints','.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
listoutput is operator-facing and script-consumable; a registry value that can forge table rows (or smuggle terminal escapes) breaks the "enumerated as trustworthy" contract exactly as the service-name newline did in deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383 — through a different field that issue does not cover (deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383 scopes its fix to service names, duplicate targets/secrets, and healthCheck hosts).- Targets are not display-only: later deploy tool v1: target registry (deployTargets) + systemd generation activation #5766 slices iterate targets as deploy destinations. A target that is not a plausible host/class name should fail at the oracle, not at activation time on a real host.
Acceptance criteria
validate()rejects, with a field-named error in the existing style, anytargetsentry that is not a plausible host/class name: at minimum no whitespace, no control or format characters, no ANSI escapes — e.g. reuse the name-pattern discipline used for service names, or an explicitly documented target pattern.- The existing valid registry (
pkgs/deploy/services.nixrendered via the flake) still validates anddeploy listoutput is unchanged for it. - Regression coverage: extend the malformed-registry flake check (
deploy-list-malformed) or add equivalent cases exercising a newline target and a space target. - Controls keep behaving: valid registry exits 0; the deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383/deploy(deploy.py): duplicate JSON keys in the registry are silently discarded at load — an invalid first definition is never validated #6384/deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error #6388 shapes keep their current verdicts.
Related: #6383 (same validator, service-name newline class — names only), #5766 (the deploy tool epic this validation gates).
Metadata
Metadata
Assignees
Labels
app/deployPackage/app: deploy (pkgs/ or apps/ in this repo)kind/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/triageQueue packet kind: verify, reproduce, and route this item
Activity
developing-today commentedon Nov 6, 2026
CODE-1969
dezren39 commentedon Nov 6, 2026
🤖 Agent note · filed
listrow at exit 0, an ANSI-bearing target is emitted raw, and a space-bearing target is accepted —targetsentries have no shape rule (deploy.py:138-144) whilelistprints them verbatim (deploy.py:182). Deduped against deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383 (service-name newline / duplicate targets / healthCheck host — names and duplicates only, not target content shape), deploy(deploy.py): duplicate JSON keys in the registry are silently discarded at load — an invalid first definition is never validated #6384, deploy(deploy.py): validate() crashes with a TypeError traceback on unhashable restart/class values instead of reporting a validation error #6388, deploy(deploy.py): arguments after list are silently ignored and a duplicate --registry silently overrides the first — the typo-flag class, in the parser the activation slices will build on #6376.dezren39 commentedon Nov 6, 2026
🤖 Agent note · picked up
55 remaining items
dezren39 commentedon Nov 8, 2026
🤖 Agent note · done
Triage verdict: confirmed, already triaged and tracked elsewhere.
targetsentries inpkgs/deploy/deploy.pyvalidate(); regression home is thedeploy-list-malformedflake check), and the implementation was routed to follow-up task 11028, which has been cycling through opencode handoffs since.cmd_liststill prints','.join(defn['targets'])verbatim, so a newline/ANSI/space target still passes and reaches the output unsanitized.fix(deploy): validate target identifier shape (#6510)
fix(deploy): validate target identifier shape (#6510)
test(deploy): cover target identifier shape with property tests (#6510)
dezren39 commentedon Nov 11, 2026
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.
Merge pull request #6586 from developing-today/queue/11028-6510-deplo…