Skip to content

adopt-project.py and scaffold-project.py accept values the new project's own validate-manifest.py refuses (a blank --elected-by or --reference, --elected-on 2026-W41-6 or 20261011 on Python 3.11+, --org test+org, a plan's visibility: secret), so adoption verified or a scaffold exit 0 is followed by a failed first bootstrap; and plan admits a 251-255-character --project that check refuses #261

Closed

Description

@brettheap

(lane openRepoShape-1, 2026-10-11T21:41:44Z)

Found by this lane's re-verification of the #181 branch (fix/adopt-plan-quote-yaml-keywords at a0ff15b), out of that branch's scope. These are not YAML misreads: each value reads back exactly as written. Pre-existing on main 39ac59c.

What is wrong. adopt-project.py and scaffold-project.py accept values that the new project's own scripts/validate-manifest.py refuses. adopt-project.py check passes them, execute says adoption verified (the scaffold exits 0), and the project's first bootstrap fails:

value what the tools check what the validator requires
--elected-by ' ' not empty (args.elected_by or ...) not blank after strip()
--reference ' ' nothing not blank
--elected-on 2026-W41-6, 20261011 datetime.date.fromisoformat, which since Python 3.11 also reads ISO week dates and the basic format ^\d{4}-\d{2}-\d{2}$ (and 20261011, written bare, reads back as a number)
--org test+org checked_value's alphabet, which admits +, @ and ~ QUALIFIED_RE for each leg's <org>/<Name>
a plan's visibility: edited to secret nothing, in check or execute one of private, public, internal
a plan's elected_by: edited to null nothing: execute writes elected_by: "" not blank

The --org row is the --local-remote-dir path's. Against GitHub, the first gh repo create would meet an organisation name GitHub does not allow, and would fail before anything is created (read from code; not run here).

plan also admits a --project of 251 to 255 characters, because it holds --project to SAFE_ARG_RE's 255-character limit but not the names it derives from it (<project>-spec, five more). check then refuses that plan as unsafe-value: legs.spec. Nothing has been created by then, but the plan must be written again.

Under --local-remote-dir, a --project that passes both (247 to 250 characters) dies in execute with a traceback, OSError: [Errno 36] File name too long. It is raised where _create_leg_remotes asks whether <project>-spec.git exists (adopt-project.py:2110), before any leg exists. The scaffold dies the same way from 247 characters, before it creates any repository.

SHAPE=<openRepoShape checkout>   # GNU sed for `sed -i`
export GIT_AUTHOR_NAME=T [email protected] GIT_COMMITTER_NAME=T [email protected]
source_repo() {   # a three-file source in $TMP/Thing
  TMP=$(mktemp -d)
  git init -q -b main "$TMP/Thing" && (cd "$TMP/Thing" && mkdir src docs &&
    printf 'print(1)\n' > src/app.py && printf '# Spec\n' > docs/spec.md &&
    printf '# Thing\n' > README.md && git add -A && git commit -qm init)
}
adopt() {         # plan [flags], then check, execute, a recursive clone and its bootstrap
  python3 "$SHAPE/adopt-project.py" plan --source "$TMP/Thing" --project Northwind --org testorg \
      --elected-by 'T H' --elected-on 2026-09-02 --out "$TMP/plan.yaml" "$@" >/dev/null || return
  [ -n "$EDIT" ] && sed -i "$EDIT" "$TMP/plan.yaml"
  python3 "$SHAPE/adopt-project.py" check --plan "$TMP/plan.yaml" > "$TMP/check" 2>&1
  printf 'check %s, ' "$(tail -1 "$TMP/check")"
  python3 "$SHAPE/adopt-project.py" execute --plan "$TMP/plan.yaml" --yes \
      --local-remote-dir "$TMP/remotes" --work-dir "$TMP/work" > "$TMP/exec" 2>&1
  printf 'execute exit %s, %s\n' $? "$(grep -c '^adoption verified' "$TMP/exec") x 'adoption verified'"
  git -c protocol.file.allow=always clone -q --recurse-submodules -b adopt/three-repo-shape \
      "$TMP/Thing" "$TMP/clone" && cd "$TMP/clone" || return
  python3 scripts/bootstrap.py > "$TMP/boot" 2>&1; echo "  bootstrap exit $?: $(grep -m1 FINDING "$TMP/boot")"
}
for flag in "--elected-by= " "--reference= " "--elected-on=2026-W41-6" "--elected-on=20261011" "--org=test+org"; do
  echo "== adopt-project.py plan '$flag'"; source_repo; EDIT= adopt "$flag"
done
echo "== adopt-project.py plan, then the plan's visibility: edited to secret"
source_repo; EDIT='s/^visibility: private$/visibility: secret/' adopt
for flag in "--elected-by= " "--reference= " "--elected-on=2026-W41-6"; do
  TMP=$(mktemp -d)
  python3 "$SHAPE/scaffold-project.py" --org testorg --project Atlas --elected-by 'T H' --elected-on 2026-09-02 \
      --local-remote-dir "$TMP/remotes" --work-dir "$TMP/work" "$flag" > /dev/null 2>&1
  printf '== scaffold-project.py %s: exit %s, ' "'$flag'" $?
  git -c protocol.file.allow=always clone -q --recurse-submodules "$TMP/remotes/Atlas.git" "$TMP/Atlas"
  (cd "$TMP/Atlas" && python3 scripts/bootstrap.py > "$TMP/boot" 2>&1; echo "bootstrap exit $?: $(grep -m1 FINDING "$TMP/boot")")
done
for n in 250 251 255 256; do
  source_repo; P=$(python3 -c "print('N' * $n)")
  python3 "$SHAPE/adopt-project.py" plan --source "$TMP/Thing" --project "$P" --org testorg \
      --elected-by 'T H' --elected-on 2026-09-02 --out "$TMP/plan.yaml" > "$TMP/plan" 2>&1
  rc=$?; printf '== --project of %s characters: plan exit %s' $n $rc
  if [ $rc = 0 ]; then
    python3 "$SHAPE/adopt-project.py" check --plan "$TMP/plan.yaml" > "$TMP/check" 2>&1
    printf ', check exit %s %s' $? "$(grep -o -m1 '^REFUSED [a-z-]*: legs.spec' "$TMP/check")"
  fi
  echo
done

Observed on main 39ac59c (git 2.43.0, Python 3.12.3):

== adopt-project.py plan '--elected-by= '
check plan ok, execute exit 0, 1 x 'adoption verified'
  bootstrap exit 1: FINDING manifest-elected-by: elected_by is empty. Electing the shape is a human's act and the manifest records whose.
== adopt-project.py plan '--reference= '
check plan ok, execute exit 0, 1 x 'adoption verified'
  bootstrap exit 1: FINDING manifest-reference: reference is ' '; drop the key or name the document the election followed
== adopt-project.py plan '--elected-on=2026-W41-6'
check plan ok, execute exit 0, 1 x 'adoption verified'
  bootstrap exit 1: FINDING manifest-elected-on: elected_on is '2026-W41-6', expected an ISO date YYYY-MM-DD
== adopt-project.py plan '--elected-on=20261011'
check plan ok, execute exit 0, 1 x 'adoption verified'
  bootstrap exit 1: FINDING manifest-elected-on: elected_on is 20261011, expected an ISO date YYYY-MM-DD
== adopt-project.py plan '--org=test+org'
check plan ok, execute exit 0, 1 x 'adoption verified'
  bootstrap exit 1: FINDING manifest-leg-repository: leg 'assembly': repository is 'test+org/Northwind', expected `<org>/<Name>`
== adopt-project.py plan, then the plan's visibility: edited to secret
check plan ok, execute exit 0, 1 x 'adoption verified'
  bootstrap exit 1: FINDING manifest-visibility: visibility is 'secret', expected one of ['internal', 'private', 'public'] or no field at all
== scaffold-project.py '--elected-by= ': exit 0, bootstrap exit 1: FINDING manifest-elected-by: elected_by is empty. Electing the shape is a human's act and the manifest records whose.
== scaffold-project.py '--reference= ': exit 0, bootstrap exit 1: FINDING manifest-reference: reference is ' '; drop the key or name the document the election followed
== scaffold-project.py '--elected-on=2026-W41-6': exit 0, bootstrap exit 1: FINDING manifest-elected-on: elected_on is '2026-W41-6', expected an ISO date YYYY-MM-DD
== --project of 250 characters: plan exit 0, check exit 0
== --project of 251 characters: plan exit 0, check exit 2 REFUSED unsafe-value: legs.spec
== --project of 255 characters: plan exit 0, check exit 2 REFUSED unsafe-value: legs.spec
== --project of 256 characters: plan exit 2

On Python 3.10 and earlier, election_date refuses 2026-W41-6 and 20261011 up front. That row depends on the interpreter that runs plan.

Why it matters.

  • Each row ends adoption verified, or a scaffold that exits 0, over a project whose own gate is red at its first bootstrap. Both leg repositories exist and are pushed by then; against GitHub, two or three real repositories.
  • The way back is an edit to project.yaml, which AGENTS.md:211-212 tells an agent never to make to turn a row green.
  • Every one of these values could have been refused before anything was created, by the rule the project's validator already applies.

Where (main 39ac59c):

  • adopt-project.py:1190-1241, _checked_plan_inputs: --elected-by at :1237 (args.elected_by or _elector()), --elected-on at :1235, --project at :1200. --reference gets no check.
  • scaffold-project.py:485-493, _elector: refuses only an empty value.
  • scripts/shape_materialize.py:130-147, election_date: date.fromisoformat at :137.
  • adopt-project.py:2413-2429, _checked_plan_values: what execute checks in the plan, which is neither visibility nor elected_by. visibility is written into the manifest at :2859. On the GitHub path it is also passed to gh repo create as --<visibility> (:2103-2106, read from code; not run here).
  • adopt-project.py:1492-1500, Plan.names(): where check holds the derived leg names to checked_value.
  • templates/assembly-root/scripts/validate-manifest.py: DATE_RE :71, QUALIFIED_RE :72, _elected_by_finding :387, _elected_on_finding :401, _reference_finding :431, _visibility_finding :445, the leg repository check :604.

What would fix it.

Related. #181: the YAML misread of the same fields; its review found these. #196: the same class, check admitting what execute refuses. #225.

Not claimed.

🤖 Generated with Claude Code

Activity

  1. brettheap commented on Oct 11, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-5, session e62c2fd7-176d-429d-89fb-0653dd08ad5f@Eagle, 2026-10-11T23:23:31Z, for #261

    Logged in lanes/log/openRepoShape-5.md at 24fd3126d25485dd9b62d0c38b250ecb608d914c.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#261:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#261"`, kept where the row or its body names `#261`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `261` as a whole token:
       none
    
  2. added 17 commits that reference this issue on Oct 12, 2026
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