Skip to content

adopt-project.py: plan-wrong-kind, plan-unsupported-mode, plan-bad-leg and plan-bad-id name a plan value of any type with !r, so a number reads 7, a boolean True and a list its Python spelling, where _read_as gives the number 7, the boolean true and a list of 2 item(s) (follow-up of #1114, found by reading) #1199

Closed

Description

@brettheap

(lane openRepoShape-4, 2026-10-23T08:23:00Z)

Found by: FIN1114 and W1114, while working on #1114 (PR #1198, which put the pin rows' non-text values into _read_as's words). These are places #1114 left, as outside its scope. They were found by reading the code. No probe of mine ran any of them, so each "reads as" below is what the code says it would print, to be measured by whoever takes this. Line numbers are on main 961640c68 (adopt-project.py sha256 0c1c1f3d), and #1198 adds 8 lines above the first of them.

What happens

adopt-project.py has four refusals that name a plan value of any type with !r, where _read_as (about :8371) says what the plan's reader read: "the number 7", "the boolean true", "null", "a list of 2 item(s)", "a mapping of 1 key(s)". repr spells a number as 7, a boolean as True, a null as None, and a list or a mapping as Python does. The rest of the plan's refusals use _read_as or _not_text, and #1114 made the pin rows do too.

  • plan-wrong-kind, Plan.__init__, :6467 and :6468. {path}: kind is {data.get('kind')!r}, expected {PLAN_KIND!r}. A plan with kind: 7 reads "kind is 7", kind: true reads "kind is True", a plan with no kind: reads "kind is None", and a list or a mapping reads as Python spells it.
  • plan-unsupported-mode, Plan.__init__, :6488. {path}: mode is {data.get('mode')!r}; v0.2 implements `in-place` only. The same, for mode:.
  • plan-bad-leg, the entries loop of _leg_findings, :6960. FINDING plan-bad-leg: {path} declares leg {leg!r}. An entry's leg: can be a number or a boolean (str(leg) is what is tested against LEG_VALUES, :1119, so leg: 7 reaches the refusal), and it prints as 7 or True. A list or a mapping prints as Python spells it.
  • plan-bad-id, Plan.project_id, :6794. {self.path}: `id:` is {project_id!r} and must match {pattern}. A number or a boolean id: is caught before it, by _a_number_or_boolean and _not_text (:6786), so it does not reach this line. A list or a mapping id: does: project_id = str(set_id) makes it text, and the refusal shows Python's str of it as a quoted text, "['a', 'b']", with no word that the plan holds a list. I did not probe this one.

The line at :6783 (the id derived from the assembly's name, plan-bad-id too) is text by then, so it is not a gap.

Where the rest are not gaps

Each of these is a text by the time it is spelled: the later branches of _pin_row_problem (:527 to :543), the line at :616 (an entry that is a name), :629 (the product, held by isinstance(product, str)), :4198 and :4233 (a leg's path text), :5150 and :5162 (--id and the derived id), :15561 (every _plan_values field is str(...)) and :16605 to :16612 (names). The --source spec (:2036 to :2191), --pin-source (:5599), the confirmation answer (:12904), the --local-remote-dir URL (:15616), :4517 and :4567 are not plan values, or are already _read_as's spelling. The pin row's non-dict entry, :625, is #1020's, in #1125.

Expected

A value that is not text is said as _read_as says what the plan's reader read, at each of the four sites, with the same code and the same remediation. A text value, and a plan with no kind: where _read_as would say "null", are for whoever takes this to decide, with the rule #1114 kept: a text value's spelling stays byte for byte (kind is 'placement-plan', a leg 'x'), so no row that pins one changes.

Notes for whoever takes it

Done when

Each new row fails on main and passes on the change, each text control passes on both, and each mutant that puts !r back at one site is killed, with the file restored and its sha256 checked after each one.

See #1114, #1198, #1020 and #1177.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. added this to the v1.2.1 milestone on Oct 23, 2026
  2. brettheap commented on Nov 9, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-11-09T13:56:35Z, for #1199

    Logged in lanes/log/openRepoShape-3.md at 78b8747661f2e67a587fcb9d1b0780f8174df660.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1199:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1199"`, kept where the row or its body names `#1199`:
    1198	adopt-project.py: `_pin_row_problem` says a pin field whose value is not text as `_read_as` says what the plan's reader read, "records `commit:` as the number 7", where it spelled it as Python does, `commit: 7` and `True`, so `check` and `execute` name it in the words the plan's other refusals use under the same `plan-pin-malformed` (#1114)	fix/1114-pin-row-value-read-as	OPEN
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1199` 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