Skip to content

chore: scripts/gate03-sweep.sh helper functions declare no local variables (WR-03, carried from Phase 3) #181

Closed

Description

@hermanngeorge15

Carried since the Phase 3 code review (WR-03) and re-confirmed at the Phase 5 close-out: scripts/gate03-sweep.sh's helpers (sweep_one, build_summary, do_compare, ...) assign out_dir, dir and similar names as globals; there is no local declaration in any function body (grep -n 'local ' scripts/gate03-sweep.sh matches only two comment lines).

It has not bitten, because the script is run once per invocation and the helpers do not call each other with colliding names. It is a latent hazard for anyone who edits the script, so it is tracked here instead of living only in a Phase 3 and Phase 4 planning note (04-CONTEXT.md). Not a Phase 5 concern and not fixed in Phase 5.


Filed at the close-out of Phase 5 (CAT-03, #35), plan 05-07 Task 2, from .planning/phases/05-persistence-lifecycle-hijack-cat-03-35/deferred-items.md. Nothing here is fixed in v0.2.0.

Activity

  1. added this to the v0.3.0 milestone on Oct 9, 2026
  2. added
    bugSomething isn't working
    P2Normal priority
    ciBuild and release pipeline
    on Oct 9, 2026
  3. BasilZafar11 commented on Oct 15, 2026

    @BasilZafar11
    Contributor

    Implemented in PR #192: #192

    Added local declarations for working variables in sweep_one, build_summary, and main. do_compare’s variables already belong to its Python subprocess.

    Added a regression check for caller-variable isolation, scanner exit codes 0/1/2, missing directories, and manifest/summary/comparison outputs, and wired it into CI.

    The check fails against upstream and passes with the fix. Both scripts also pass bash -n.

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

    P2Normal prioritybugSomething isn't workingciBuild and release pipeline

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions