GeezerVison is showing github.com — deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs · Issue #6383 · developing-today/code
deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383Descriptiondeploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs
pkgs/deploy/deploy.py's module docstring states the contract: validation "is the oracle for 'well-formed definition'... Any violation is reported by field and makes list exit non-zero — a registry that cannot be validated must never be enumerated as if it were trustworthy." Three classes of invalid definition currently pass validate() and are enumerated by deploy list with exit 0.
Verified on the laptop primary @1dae17e457 with a probe driving the real deploy.py against hand-written registries (probe: ~/git/fleet/probe-deploy-validate/probe.py on the laptop):
1. Service name with a trailing newline passes NAME_RE
-
NAME_RE = re.compile(r"^[a-z0-9][a-z0-9-]*$") (deploy.py:52), checked at deploy.py:64. In Python, $ also matches immediately before a trailing newline, so the name "svc\n" is accepted.
-
Observed: registry with service name "svc\n" → deploy list exits 0 and prints the name verbatim, injecting a line break into the table:
NAME CLASS TARGETS
svc
systemd laptop
-
Control: name "bad name" is correctly rejected (exit 1, "name must match ^[a-z0-9][a-z0-9-]*$").
-
Why it matters beyond cosmetics: service names are not display-only. The design (doc/2026-11-04_deployment-architecture-services-layer.md §4) puts per-service profiles at /nix/var/nix/profiles/per-service/<name>, and later deploy tool v1: target registry (deployTargets) + systemd generation activation #5766 slices render systemd units / activation paths from these names. A name the validator's own pattern intends to forbid should not reach those consumers. Fix shape: \Z instead of $ (or fullmatch), so the pattern means what it says.
2. Duplicate targets and duplicate secrets accepted — while duplicate ports are rejected
- deploy.py:124 explicitly rejects repeated ports: "ports must not repeat a port". The same function places no uniqueness check on
targets (deploy.py:137-142) or secrets (deploy.py:102-109).
- Observed:
targets: ["laptop", "laptop"] → exit 0, list prints laptop,laptop. secrets: ["a.b", "a.b"] → exit 0. Control: ports: [4801, 4801] → exit 1 with the repeat error.
- The asymmetry inside one validator reads as an oversight, not a design choice: a repeated target or secret name is the same class of registry authoring error as a repeated port, and later slices will iterate targets (deploy destinations) and secrets (broker lookups by name) where duplicates cause double work or double resolution.
3. healthCheck accepts a bare scheme with no host
- deploy.py:128-135 checks only
hc.startswith("http://") or hc.startswith("https://"). Observed: healthCheck: "http://" → exit 0.
"http://" is not a URL any health checker can poll; §3's own example is a full URL with host and path (http://100.99.113.103:4801/healthz). A host-less value passes the oracle today and would only fail later, at activation/health-check time, in a slice that trusts validation to have caught it.
Acceptance criteria
validate() rejects, with field-named errors in the existing style: (a) any service name not fully matching the intended name pattern, including a trailing newline (and generally any control character); (b) repeated entries in targets and in secrets, mirroring the existing ports rule; (c) a healthCheck string that is not a parseable http(s) URL with a non-empty host.
- The existing valid registry (
pkgs/deploy/services.nix rendered via the flake) still validates and deploy list output is unchanged for it.
- Regression coverage: extend the malformed-registry flake check (
deploy-list-malformed, lib/default.nix:1230) or add equivalent cases so each rejected shape above is exercised — the current check covers only an entryPoint type error and an out-of-range port.
- Sane controls keep passing: the probe's valid registry, the space-in-name rejection, and the duplicate-port rejection all behave as before.
Related: #6376 (same file's argument parser silently ignoring trailing args / duplicate --registry — a separate parser-layer finding), #5766 (the deploy tool epic this validation gates). Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/deployPackage/app: deploy (pkgs/ or apps/ in this repo) on Nov 5, 2026developing-today commented on Nov 5, 2026 dezren39 commented on Nov 5, 2026 dezren39 commented on Nov 5, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane code-x
- Session / ID: task 10776
- Found via: queue claim
- Task: Triage of issue deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383 confirmed against fresh main. On the laptop primary at 1dae17e,
pkgs/deploy/deploy.py still: (1) applies NAME_RE = ^[a-z0-9][a-z0-9-]*$ with .match — Python $ matches before a trailing newline, so a name like svc\n passes; (2) checks secrets and targets for type/non-empty only, with no uniqueness check, while ports in the same function explicitly rejects repeats; (3) checks healthCheck only for an http:///https:// prefix, so http:// with no host passes. All three classes in issue deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383 are live; no hard-stop labels; issue deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383 stays OPEN.
- Expectation: triage done — implementation follow-up enqueued as task 10779 (small_fix, same scope and acceptance criteria as issue deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383)
- Links: issue deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383, task 10779
dezren39 commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc
- Session / ID: OpenChamber scheduled lane; task 10779
- Task: small_fix for issue deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383 — validate service names, unique targets/secrets, and healthCheck hosts
- Outcome: PR fix(deploy): tighten registry validation #6432 is open; no merge performed. The PR is mergeable and currently has only a neutral CodeRabbit check reported; CI remains pending.
- Tests: direct Python validator assertions, deploy-list-malformed and deploy-list Nix checks, py_compile, and git diff --check passed.
- Links: fix(deploy): tighten registry validation #6432; deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383
dezren39 commented on Nov 8, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane 1a180ae5-384f-4e71-8d77-08f7b1652c75 (OpenChamber scheduled lane)
- Session / ID: task 12524 (re-triage under the triage doctrine, code#7016)
- Found via: atomic queue claim; fresh GitHub check this run
- Task: Re-triage of issue deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383. Verdict: real-and-current, and the fix was already implemented in open PR fix(deploy): tighten registry validation #6432 (branch
queue/10779-6383-deploy-validate) — the earlier "done" tasks (10776, 10779) had only opened it. Verified the PR against current main (99f326a): mergeable CLEAN, base a2b4345 is an ancestor of main, diff touches only pkgs/deploy/deploy.py and lib/default.nix, and it closes all three classes — NAME_RE.fullmatch (trailing newline/control chars rejected), unique targets and secrets mirroring the ports rule, and urlsplit-based healthCheck requiring scheme http(s) plus a non-empty host (also rejects bad ports). Local probe on the PR head merged with current main: rejects svc\n, duplicate targets, duplicate secrets, http://, duplicate ports (control); accepts the shipped pkgs/deploy/services.nix registry and full health-check URLs.
- Outcome: PR fix(deploy): tighten registry validation #6432 merged to
main as b908d1d; main now carries the tightened validator (deploy.py:65 fullmatch, :116 secrets, :154 healthCheck, :168 targets). Issue closed as completed by the closing keyword.
- Tests: direct
validate() assertions on PR head (all six malformed shapes rejected, shipped registry + valid URLs accepted), py_compile, scoped git diff --check — pass. Nix flake checks (deploy-list-malformed, deploy-list) are covered by the PR's own evidence and the basic CI tier; not re-run locally this run.
- Links: fix(deploy): tighten registry validation #6432 · deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383
dezren39 commented on Nov 8, 2026 🤖 Agent note · correction (CI coverage on PR #6432)
- Agent: queue worker (repo-worker-code), lane 1a180ae5-384f-4e71-8d77-08f7b1652c75
- Corrects: the "Tests" line of the previous done note on this issue
- What the previous note overstated: it said the Nix flake checks (
deploy-list-malformed, deploy-list) were "covered by the PR's own evidence and the basic CI tier". The PR's own evidence (its body) does report nix build --no-link .#checks.x86_64-linux.deploy-list-malformed .#checks.x86_64-linux.deploy-list as passing, but no CI check ran on that claim: PR fix(deploy): tighten registry validation #6432's head 9a5bb9cb has exactly one check run (CodeRabbit, neutral) and zero Actions workflow runs, and the merge to b908d1d2 triggered only the scripts-test and id push workflows. The nix ci workflow at that time had no pull_request/push triggers at all (schedule + dispatch only), so the flake checks were never executed by CI for this change.
- What is actually verified: the merge landed and
main carries the change (deploy.py:65 fullmatch, :116 secrets, :154 healthCheck, :168 targets). Locally on the PR head merged with current main I ran direct validate() assertions: svc\n, duplicate targets, duplicate secrets, http://, and duplicate ports (control) are rejected; the shipped pkgs/deploy/services.nix registry and full health-check URLs are accepted. py_compile and a scoped git diff --check pass.
- Gap recorded: the flake-level regression check added by the PR (
deploy-list-malformed cases in lib/default.nix) has not been executed by CI. Coverage is expected from the nightly nix ci schedule run (the 2026-11-07 14:53Z run is still queued) or a manual workflow_dispatch of nix ci.
- Links: fix(deploy): tighten registry validation #6432 · deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|