Skip to content

fix(pm-stack): apply-config.sh treats DRY_RUN=0/false as dry-run — ready-for-agent config silently never applies #5421

Closed

Description

@dezren39

Finding

pm-stack/ready-for-agent/apply-config.sh (added by PR #3311, for #1203) decides dry-run mode with Python truthiness on the raw environment string:

  • apply-config.sh:28 — export DRY_RUN="${DRY_RUN:-}"
  • apply-config.sh:38 — dry_run = bool(os.environ.get("DRY_RUN"))

bool("0") and bool("false") are True in Python, so DRY_RUN=0 ./apply-config.sh — or an ambient DRY_RUN=false in the caller's environment — runs as a dry run: every mutation becomes a DRY-RUN would ... print, the script exits 0, and the final line reads ready-for-agent config applied (dry run). Nothing is registered, configured, or unpaused, and nothing fails.

This matters because the same PR wired ./apply-config.sh into pm-stack/ready-for-agent/install.sh to run on every install run after the harness is verified serving. An operator or unit environment that carries a conventional false-y DRY_RUN=0 therefore silently defeats the declarative config (#1203) forever: the harness settings (including the fleet's mergePolicy: OFF human-merge posture) never converge, with a success exit and no error anywhere.

Verified live on current main (991bb49, 2026-11-04): lines 28 and 38 above are unchanged from the PR. The PR's own test, pm-stack/ready-for-agent/test-apply-config.sh, covers DRY_RUN=1 (mutates nothing) and unset (applies) only — no false-y value is pinned.

Evidence

Acceptance criteria

  • Only an explicit truthy value (1, and if supported true) enables dry-run; 0, false, no, empty, and unset all apply for real (case-insensitive where applicable).
  • test-apply-config.sh gains a case proving a false-y DRY_RUN value (e.g. DRY_RUN=0) actually sends mutations to the stub harness.
  • The script header documents the accepted dry-run values.
  • Existing test cases (dry-run mutates nothing; first apply registers/configures/unpauses; second apply is a no-op) still pass.

Found by the pr-diff-review job reviewing PR #3311; triage first against current main before fixing.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 4, 2026
  2. developing-today commented on Nov 4, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: pr-diff-review job
    • Session / ID: cron job pr-diff-review, run 2026-11-04T05:24:07-06:00
    • Found via: filed this run
    • Task: Filed this issue from reviewing PR feat(pm-stack): declarative ready-for-agent config + aggregator dispatch source (#1203) #3311 (merged 8ee2e1c) — apply-config.sh:38 decides dry-run via bool(os.environ.get("DRY_RUN")), so DRY_RUN=0/false previews instead of applying, exits 0, and install.sh's every-run apply silently never converges the harness config. Verified unchanged on current main 991bb49 this run; the PR's test covers DRY_RUN=1 and unset only.
    • Expectation: effort s — triage verifies against current main, then the fix pins the accepted dry-run values (1/true only) plus a false-y-value test case in test-apply-config.sh. Done when DRY_RUN=0 actually mutates the stub harness in tests and the header documents the values.
    • Links: triage packet enqueued to queue repo-health-code-pilot this run; evidence in the issue body.
  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 4, 2026
  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged

  6. 6 remaining items

  7. added a commit that references this issue on Nov 4, 2026
  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  9. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done — already_done (duplicate dispatch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions