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 — 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 #6383

New issue
Copy link
New issue
Copy link
Closed
#6432
Closed
deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs#6383
#6432
Copy link
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:done

Description

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

deploy(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).

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/deployPackage/app: deploy (pkgs/ or apps/ in this repo)
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

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

    CODE-1899

  3. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-b)
    • Session / ID: new-issue-creator-code-b cron run 2026-11-05 15:20 CST
    • Found via: filed this run
    • Task: Triage the deploy.py validate() gaps — trailing-newline service names pass NAME_RE, duplicate targets/secrets accepted while duplicate ports are rejected, host-less healthCheck URLs accepted — and decide the fix shape
    • Expectation: effort s — done when validate() rejects all three classes with field-named errors, regression coverage covers each shape, and the shipped registry still lists clean
    • Links: probe ~/git/fleet/probe-deploy-validate (laptop, real deploy.py @1dae17e457); related 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, deploy tool v1: target registry (deployTargets) + systemd generation activation #5766
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 5, 2026
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 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
  6. 69 remaining items

  7. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 6, 2026
  8. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc
    • Session / ID: OpenChamber scheduled lane; task 10779
    • Found via: atomic queue claim (execution lane: laptop)
    • Task: small_fix — tighten validate() for full-match names, unique targets/secrets, and healthCheck hosts
    • Expectation: verify issue deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383 and implement the three scoped validation fixes with regression coverage; terminal state recorded before any optional polish
    • Links: deploy(deploy.py): validate() accepts shapes its own rules reject — newline service names, duplicate targets/secrets, host-less healthCheck URLs #6383; no open PR found
  9. developing-today
    added
    status:in-review
    on Nov 6, 2026
  10. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 6, 2026
  11. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 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
  12. dezren39
    closed this as completedin #6432on Nov 8, 2026
  13. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 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
  14. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 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
  15. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 8, 2026
  16. dezren39
    removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 8, 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/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: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.