Skip to content

update-shape.py apply --accept-local scripts/repo_shape.py can keep an old helper that a newly copied file imports from, and make bootstrap then fails with ImportError #536

Closed

Description

@brettheap

update-shape.py does not check the names a copied file imports against a helper the user kept.

From the v1.1.0 triage of the v1.0.0 known limits on #458. One pull request covers the lines below.

Lines

  • apply --accept-local scripts/repo_shape.py can keep an old helper that a copied file then imports from. Where: update-shape.py cmd_apply; templates/assembly-root/scripts/bootstrap.py:66-69. Effort M; all. On main 3121945: bootstrap.py on main still imports spelled and escape_unencodable_stdout from repo_shape, and update-shape.py has no check of imported names against a kept copy (no ImportError/import scan anywhere). (source)

Note: The duplicate line that reproduced this with bootstrap.py (#458, comment 6132943782) is closed into this issue; its text is quoted below.

Each line above is marked → this issue on its tracking issue. Tick it there too when this closes.

The lines as written on the tracking issues

update-shape.py apply --accept-local scripts/repo_shape.py can keep an older shared helper that a file it copies in the same run needs.

— #458, comment

#456 moves spelled() and escape_unencodable_stdout() into scripts/repo_shape.py, and both roots' bootstrap.py import them. A project that keeps a locally edited scripts/repo_shape.py (check reads it both) with apply --accept-local scripts/repo_shape.py, while taking the new bootstrap.py, gets an ImportError from scripts/bootstrap.py, --help and make bootstrap. Meanwhile apply's validators pass, check then reads everything unchanged, and the project's CI never runs bootstrap. Reproduced with a real scaffolded project. Following check's merge-by-hand avoids it. Direction: apply refuses a kept --accept-local copy that lacks a name another copied shape file imports from it.
— #458, comment

Activity

  1. added this to the v1.1.0 milestone on Oct 14, 2026
  2. brettheap commented on Oct 14, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-10-14T16:47:36Z, for #536

    Logged in lanes/log/openRepoShape-4.md at 0bbd376f1e0c8fe93e1eaa9668a0c6bc3d06e36e.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#536:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#536"`, kept where the row or its body names `#536`:
       none
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `536` as a whole token:
       none
    
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions