Skip to content

update-shape.py apply rewrites the manifest's shape: block with fixed two- and four-space indents, so a project.yaml indented four spaces, which the project's own reader and both validators accept, is rewritten into YAML that reader rejects, and the rolled-back refusal relays the validators' lockstep remedy #208

Closed

Description

@brettheap

Lane: openreposhape-4 (openRepoShape-4)

Found by this lane's probe of main e4decfb on 2026-10-11, re-verified on main e4decfb today. Not claimed.

What is wrong. rewrite_manifest in update-shape.py FINDS the commit: and tree_sha256: lines inside shape: by their stripped text, so it recognises a block at any indentation, but it WRITES them back at fixed indents, ' commit: ...' and ' tree_sha256: ...'. A project.yaml whose shape: block is indented four spaces (tree_sha256 at six), which load_yaml and both shipped validators accept, is rewritten into YAML that the same load_yaml rejects. The validators then refuse, apply rolls back (correctly), and the refusal it relays blames the project: each yaml-unparsable line carries the validators' lockstep remedy ("If the PIN itself is stale, advance the gitlink ..."), and update-validators-red says "A tool that left a project red would have moved the cost ...". check keeps offering the same apply, so this project can never take a shape update without re-indenting by hand, and nothing it prints says so.

# Atlas scaffolded from $U (a local clone of openRepoShape), cloned --recurse-submodules to $C; one upstream commit $BS
# re-indent ONLY project.yaml's `shape:` block from 2 to 4 spaces (`tree_sha256:` from 4 to 6), and commit it
(cd $C && python3 scripts/validate-manifest.py; python3 scripts/validate-pins.py)   # exit 0, exit 0
python3 $U/update-shape.py check --root $C --upstream $U --at $BS
#   exit 1   upstream-changed 1  unchanged 10   NEXT  python3 update-shape.py apply ... --at <BS> --yes --branch ...
python3 $U/update-shape.py apply --root $C --upstream $U --at $BS --yes
#   exit 2   REFUSED yaml-unparsable: .../project.yaml: line 77: unexpected indentation        (twice, one per validator)
#            Remediation: run `git submodule update --init --recursive`, then `python3 scripts/validate-pins.py`.
#            If the PIN itself is stale, advance the gitlink, `contracts/<leg>-pin.yaml` and every workflow `@<sha>` ...
#            REFUSED update-validators-red: ... Every byte this command wrote has been rolled back ...
#            Remediation: read the finding above. A tool that left a project red would have moved the cost ...
git -C $C status --short                   # (empty: the rollback held)

What the docs promise. rewrite_manifest's own refusal: "fix the block by hand this once; this tool will not guess at a manifest it does not recognise." Here it recognises the block and then guesses its indentation. AGENTS.md, "Updating a project's shape", item 6: "apply runs the project's own validate-pins.py and validate-manifest.py and rolls every byte back if either goes red"; it does, but the finding it points the reader at is about the tool's own write, not the project.

What would fix it. In rewrite_manifest, keep each replaced line's own leading whitespace rather than writing ' commit:' and ' tree_sha256:', and re-read the result with load_yaml before writing, refusing update-manifest-unrecognised if it does not parse back to the target commit and tree. Same root cause, louder outcome: rewrite_shape_pin (and bump-leg.py's rewrite_pin) match startswith(" tree_sha256:") with exactly two spaces, so a four-space pin is refused there as hand-edited.

Activity

  1. brettheap commented on Oct 11, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session 566fec94-6fde-4579-947f-ec4fda5ce14f@Eagle, 2026-10-11T16:21:58Z, for #208

    Logged in lanes/log/openRepoShape-3.md at e7c0305e086fffe086fcb134fae48bf64c016166.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#208:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#208"`, kept where the row or its body names `#208`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `208` 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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions