Skip to content

A native Windows path: setup-project.py, a windows-latest job, and the README route (#49) - #53

Merged
brettheap merged 6 commits into
mainfrom
feat/native-windows
Sep 5, 2026
Merged

brettheap merged 6 commits into
mainfrom
feat/native-windows

Conversation

@brettheap

@brettheap brettheap commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Lane: xfactory-2 (xFactory-2)
Claim: #49 (claim in the issue body)

Closes #49.

What this changes

A native Windows path. Brett Heap, 2026-09-05, in session: "what do we do for users that use windows? how do they use this?" → "file the native windows issue and pick it up". Both entry points were bash, so #46 could only send Windows users through WSL2. Everything behind the entry point was already Python 3 standard library shelling out to git and gh only.

  • setup-project.py — setup.sh's twin, at the repo root, phase for phase: self-bootstrap into a temporary clone when not run from inside a checkout (from a downloaded file OR from stdin), preflight on the RUNNING interpreter (never a binary called python3; make never required), the three names via --explain, the dry-run plan, ONE typed yes, scaffold, clone where you stand, bootstrap via scripts/bootstrap.py, hand-over. Same flags, same wording, same exit codes. Pure ASCII in source and output, asserted by a test, because Windows PowerShell 5.1 re-encodes anything it pipes. Absolutises paths with os.path.abspath, never Path.resolve(), so 8.3 temp paths do not break output comparisons. Deletes its temp clone with a read-only-aware rmtree. On Windows it clones with core.autocrlf=false and sets it in the clone, and warns (does not refuse) when the user's global setting is true.
  • setup.sh is byte-for-byte unchanged. A text-level parity test asserts both usage blocks accept the same flags (one allowlisted difference: the positional <Project>). Consolidating the bash into a shim is One definition for the two entry points: setup.sh becomes a shim over setup-project.py (follow-up of #49) #50, its own PR, so a bisect points at the delegation and not at Windows support.
  • Cross-platform correctness in the shipped code: every write_text in scripts/shape_materialize.py and adopt-project.py now passes newline="\n", so the bytes a project pins by sha256 are identical on every platform — before this, a Windows scaffold would have digested CRLF and update-shape.py check would never agree with upstream again. Remediation strings name the platform-conventional interpreter (python3 on POSIX, python on Windows) instead of hard-coding python3 (three of those files are digest-pinned templates: downstream update-shape check will report them as upstream-changed, which is the expected drift update-shape.py: check reports upstream-added; apply --add <path> takes a file the standard gained since the pin #29 built the machinery for).
  • windows-latest CI job in tests.yml, running the FULL suite with PYTHONUTF8=1, per-invocation core.autocrlf=false and core.longpaths=true, and --basetemp=D:\t. Bash-only suites and shebang-shim fixtures skip with an explicit os.name == "nt" marker that names why. Green on Windows is what "native Windows works" means here; there is no Windows machine on this side.
  • README quick start: a "Windows, natively" paragraph (Python from python.org with the py launcher, git, gh via winget, gh auth login, the one core.autocrlf setting, and a PowerShell TWO-liner: Invoke-WebRequest … -OutFile setup-project.py then py setup-project.py <Project> --org <org>, because 5.1 re-encodes pipes and a script arriving on stdin cannot ask). WSL2 stays as the way to run the bash entry points. AGENTS.md § 2 gains the same invocation for an assistant on Windows. No Windows twin of the openRepoShape command: the two-liner is the Windows way in.

Adversarial Opus review before opening found two defects in the front door, both fixed: a machine without git produced a traceback instead of the preflight message (the first-run state on Windows), and source_path() used Path.resolve(), which for a symlinked entry point followed the link into the shape checkout and skipped the --into injection (#39 resurrected); plus sixteen smaller items (three more write_text sites converted to write_lf, the checkout: regex, exit-code mapping for signal-killed children, the autocrlf probe reading the GLOBAL scope with --type=bool, a distinct [??] warning prefix, the PowerShell 5.1 encoding mechanism stated correctly — ASCII for pipes, UTF-16 for > — and the python setup-project.py alternative for a Store-installed Python with no py launcher).

Known and deliberately left: a .gitattributes in the two root templates, so a colleague's later clone with autocrlf=true passes the project's own gate — #51. Cosmetic: a project scaffolded on Windows records 100644 for the copied scripts where Linux records 100755; nothing digests the root's own tree. Two X_OK assertions in the suite pass vacuously on Windows. The python3 literals in the two template READMEs and in templates/family-root/AGENTS-shape.md are untouched: the last is digest-pinned in every family holder, and moving it for a comment is drift for nothing. The autocrlf warning branch is never exercised by CI because the job pins core.autocrlf=false job-wide; it is verified by inspection.

Evidence

Linux: python3 -m pytest tests -q — 570 passed (496 on main, +74: the entry-point suite, hygiene, the review's tests, tests/test_windows_paths.py, and the EOF regression tests). Windows: the tests-windows job on this PR — run 1 (head 93c04d4) failed 42 tests, run 2 (24dbe9e) failed 1, run 3 (0bc71a7) is the green one. SonarCloud went red on the first head and is green with zero issues from acd460b. Adversarial Opus review folded in before opening.

What the Windows runs found (and fixed here)

  • The scaffold WROTE backslash rows into contracts/shape-pin.yaml on Windows. shape_materialize.place() keyed every row with str(path.relative_to(root)); update-shape.py then reported every file except the three at the root as unmapped. root_key() returns the POSIX form; a Windows user of the shape was broken before this PR without anyone knowing.
  • A YAML unescape bug on every platform. repo_shape._scalar unescaped double-quoted scalars with chained str.replace, so \t inside D:\\a\\_temp\\t became a TAB. One left-to-right _unescape() now. repo_shape.py is a copied, digest-pinned file, so every project gets it on its next update-shape.py apply.
  • SAFE_ARG_RE refused D:\.... SAFE_PATH_RE admits a drive prefix, backslashes and a space for the two directory flags; leading -, control characters and host:path are still refused. adopt-project.py refuses a drive-letter --source as source-unresolvable rather than reading D: as a gh owner.
  • shutil.which("bash") on the runner finds the WSL launcher stub, not a bash; the bash -n hygiene test skips on Windows and says why.
  • An inherited console handle reports isatty() True under CI on Windows. update-shape.py and adopt-project.py now treat EOF on their confirmation prompt as their own no-terminal refusal (exit 2); the test harness closes the child's stdin by default so "nobody can be asked" means the same thing on every platform.
  • Expected downstream drift: scripts/repo_shape.py, both templates/*/scripts/bootstrap.py, templates/family-root/scripts/validate-family.py, and the two validators whose finding text now prints POSIX paths are digest-pinned copies; every existing project's next update-shape.py check reports them as upstream-changed. That is the mechanism update-shape.py: check reports upstream-added; apply --add <path> takes a file the standard gained since the pin #29 built.

Merge word: Brett Heap, 2026-09-05, "merge #49 on green too" — green including the Windows job.

🤖 Generated with Claude Code

brettheap and others added 2 commits September 5, 2026 15:21
…e README route (#49)

Brett Heap, 2026-09-05: "what do we do for users that use windows? how do they
use this?" then "file the native windows issue and pick it up". Both entry
points were bash, so #46 could only send Windows users through WSL2; everything
behind them was already Python 3 stdlib shelling out to git and gh only.

setup-project.py is setup.sh's twin, phase for phase: self-bootstrap into a
temporary clone when not inside a checkout (from a file or from stdin),
preflight on the RUNNING interpreter (never a binary called python3; make
never required), the three names via --explain, the dry-run plan, one typed
yes, scaffold, clone where you stand, bootstrap, hand-over. Pure ASCII in
source and output because PowerShell 5.1 re-encodes piped text. abspath, never
resolve(), so 8.3 temp paths compare. A read-only-aware rmtree for the temp
clone. On Windows it clones with core.autocrlf=false, sets it in the clone,
and warns when the global setting is true.

setup.sh is byte-for-byte unchanged; a flag-parity test stands in for one
definition until #50 folds the bash into a shim. write_lf() gives every
write_text in shape_materialize and adopt LF bytes on every platform, so the
sha256 a project pins means the same number everywhere. Remediation strings
derive the interpreter name from sys.executable (digest-pinned templates
change: expected upstream drift). tests.yml gains a windows-latest job on the
full suite (PYTHONUTF8=1, per-invocation core.autocrlf=false and
core.longpaths=true, --basetemp=D:\t); bash-only suites and shebang shims skip
with an os.name == "nt" marker that names why. README: a "Windows, natively"
paragraph with the Invoke-WebRequest + py two-liner; WSL2 stays for the bash
entry points; AGENTS.md gets the same invocation. .gitattributes for the
templates is #51.

534 tests (+38). Green on windows-latest is the acceptance.

Lane: xfactory-2 (xFactory-2)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Adversarial review before opening: a machine with no git reaches the preflight message instead of a traceback (run() maps OSError to 127 and _main refuses first); source_path() uses abspath, never resolve(), so a symlinked entry point still injects --into (the #39 property); bump-leg, adopt and family writers go through write_lf; the checkout: regex tolerates spaces; signal-killed children map to shell status; the autocrlf probe reads the GLOBAL scope as bool and warns with [??], distinct from [!!]; empty-string and both-orders two-name refusals; Ctrl-C prints once; PYTHON names the platform-conventional command; --basetemp uses runner.temp; README names python as the py alternative and states the PowerShell 5.1 encoding mechanism correctly (ASCII for pipes, UTF-16 for >). 539 tests.

Lane: xfactory-2 (xFactory-2)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 5, 2026 19:57
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 days and 6 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sourcery-ai

sourcery-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR adds a tested, native Windows setup path via setup-project.py, makes generated bytes and remediation commands platform-safe, validates the behavior on windows-latest, and documents the new PowerShell workflow while preserving setup.sh and WSL2 behavior.

Sequence diagram for native Windows project setup

sequenceDiagram
    participant User
    participant Setup as setup-project.py
    participant Git as git
    participant GH as gh
    participant Scaffold as scaffold-project.py
    participant Project as NewProject
    participant Bootstrap as scripts/bootstrap.py

    User->>Setup: Run py setup-project.py <Project> --org <org>
    Setup->>Git: Check git and clone openRepoShape when outside checkout
    Setup->>GH: Check authentication and resolve project identity
    Setup->>Scaffold: validate-repository-naming.py --explain
    Setup->>Scaffold: --dry-run
    Setup->>User: Request one typed yes
    User->>Setup: Confirm yes
    Setup->>Scaffold: Create the three repositories
    Setup->>Git: Clone assembly root with core.autocrlf=false
    Setup->>Bootstrap: Run with the current Python interpreter
    Bootstrap->>Project: Materialize and bootstrap the project
    Setup->>User: Hand over project location
Loading

Flow diagram for Windows PowerShell quick start

flowchart TD
    Install[Install Python, git, and gh] --> Auth[Run gh auth login]
    Auth --> Config[Set git config --global core.autocrlf false]
    Config --> Download[Invoke-WebRequest setup-project.py -OutFile setup-project.py]
    Download --> Run[Run py setup-project.py <Project> --org <org>]
    Run --> Prompt{Interactive terminal?}
    Prompt -->|yes| Confirm[Type yes once]
    Prompt -->|no| Refuse[Refuse unless --yes is supplied]
    Confirm --> Scaffold[Scaffold, clone, and bootstrap project]
Loading

File-Level Changes

Change Details Files
Add a native Python entry point for Windows that mirrors the existing setup workflow.
  • Implement self-bootstrap from a downloaded file or stdin, prerequisite checks, naming validation, dry-run confirmation, scaffolding, cloning, and direct Python bootstrap.
  • Use the running interpreter for child processes, preserve exit-code behavior, support Windows-safe cleanup and paths, and handle Git line endings.
  • Keep output/source ASCII-safe and add extensive parity and end-to-end coverage against setup.sh.
setup-project.py
tests/test_setup_project_py.py
tests/test_repo_hygiene.py
Make generated and modified repository content byte-stable across operating systems.
  • Centralize LF-only text writes for materialized files, manifests, extracted path lists, and pin updates.
  • Use platform-conventional Python command names in remediation and next-step messages.
  • Configure Windows-created clones with core.autocrlf=false and warn when the global setting may cause digest drift.
scripts/shape_materialize.py
adopt-project.py
scripts/bump-leg.py
scripts/family.py
scripts/repo_shape.py
update-shape.py
templates/family-root/scripts/validate-family.py
templates/assembly-root/scripts/bootstrap.py
templates/family-root/scripts/bootstrap.py
Add full Windows CI coverage while isolating tests that require POSIX shell behavior.
  • Run the complete pytest suite on windows-latest with UTF-8 mode, long paths, LF Git configuration, and a short pytest temp path.
  • Skip bash and shebang-fixture tests explicitly on Windows and add read-only-aware test cleanup.
.github/workflows/tests.yml
tests/conftest.py
tests/test_setup_sh.py
tests/test_openreposhape_command.py
tests/test_free_plan_hint.py
tests/test_neutral_pin_validator.py
tests/test_reuse_visibility.py
tests/test_scaffold_e2e.py
tests/test_scaffold_pin_and_reuse.py
tests/test_family.py
Document the native Windows installation and invocation path.
  • Describe Python, Git, GitHub CLI, authentication, autocrlf configuration, the PowerShell two-command download/run flow, and the Store-Python fallback.
  • Clarify that WSL2 remains the path for bash entry points and mirror the invocation in assistant guidance.
README.md
AGENTS.md

Assessment against linked issues

Issue Objective Addressed Explanation
#49 Provide a native Windows Python entry point with parity to setup.sh, including self-bootstrap, prerequisite checks, naming validation, dry-run confirmation, scaffolding, cloning, bootstrapping, and next steps. ✅
#49 Ensure cross-platform Windows support is accepted by CI and that generated files and remediation messages do not depend on POSIX line endings or a literal python3 command. ✅
#49 Document the native Windows installation and invocation path while retaining WSL2 as the alternative for bash entry points, without requiring a Windows version of the openRepoShape command. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It introduces a new cross-platform entry point plus Windows CI/behavioral changes that should be validated by a human reviewer end-to-end despite the added tests.

Pull request overview

This PR adds a native Windows entry point (setup-project.py) that mirrors setup.sh’s end-to-end setup flow, and validates Windows support in CI. It also hardens cross-platform determinism by ensuring generated/materialized text files are written with LF line endings and by using platform-appropriate Python command wording in user-facing messages.

Changes:

  • Introduce setup-project.py (Python-only “front door”) with self-bootstrap, preflight, naming policy, plan/confirm, scaffold, clone, and bootstrap steps.
  • Add a windows-latest GitHub Actions job running the full test suite with Windows-safe Git/Python settings, plus targeted Windows skips where tests depend on POSIX shebang execution or bash.
  • Normalize line-ending behavior in materialized/generated outputs and update remediation/next-step strings to use a platform-appropriate Python command.
File summaries
File Description
update-shape.py Uses platform-appropriate Python command in NEXT guidance.
setup-project.py New native Windows-capable setup entry point mirroring setup.sh.
scripts/repo_shape.py Introduces PYTHON string for remediation messages (python vs python3).
scripts/shape_materialize.py Adds write_lf() and routes materialization writes through LF-only output.
scripts/family.py Uses PYTHON in printed next-steps; writes family.yaml via LF-only helper.
scripts/bump-leg.py Writes updated pinned files with LF-only output to preserve digest consistency.
adopt-project.py Writes plan and filter-repo path list with LF-only output (Windows safety).
templates/family-root/scripts/validate-family.py Updates remediation strings to use platform-appropriate Python command.
templates/family-root/scripts/bootstrap.py Adjusts comment to clarify Windows uses python (comment-only).
templates/assembly-root/scripts/bootstrap.py Adjusts comment to clarify Windows uses python (comment-only).
README.md Documents native Windows quick start (PowerShell two-liner + prerequisites).
AGENTS.md Adds Windows-native invocation guidance for assistants.
.github/workflows/tests.yml Adds tests-windows job running pytest on windows-latest.
tests/conftest.py Adds WINDOWS_SKIP and rmtree() helper for read-only git object stores on Windows.
tests/test_repo_hygiene.py Extends hygiene checks for the new entry point and Windows docs assertions.
tests/test_setup_project_py.py New comprehensive tests for setup-project.py and flag-parity with setup.sh.
tests/test_setup_sh.py Applies Windows skip to avoid false positives on Windows runners with bash.exe.
tests/test_openreposhape_command.py Applies Windows skip (bash + python3 dependency) and documents rationale.
tests/test_scaffold_e2e.py Skips a bash-executed workflow-step test on Windows.
tests/test_scaffold_pin_and_reuse.py Skips a shebang-based gh stub test on Windows.
tests/test_reuse_visibility.py Skips entire file on Windows due to shebang-based gh stub.
tests/test_neutral_pin_validator.py Skips a shebang-based gh stub test on Windows.
tests/test_free_plan_hint.py Skips shebang-based gh stub tests on Windows; clarifies why in docstring.
tests/test_family.py Uses Windows-safe rmtree() for removing read-only git object-store paths.
Review details
  • Files reviewed: 24/24 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread setup-project.py
Comment on lines +40 to +47
PURE ASCII, IN THE SOURCE AND IN THE OUTPUT. Windows PowerShell 5.1 - still
the default shell on a stock Windows install - renders a console in the
machine's ANSI code page, re-encodes piped text as ASCII (its default
`$OutputEncoding`), and writes UTF-16 when `>` redirects to a file. No byte
above 0x7F survives all three, so a tick, an arrow or an em dash arrives as
mojibake, as a question mark, or raises an encoding error on the way out.
`[ok]` and `[!!]` cost a reader nothing and cannot be re-encoded wrongly.
`tests/test_repo_hygiene.py::test_setup_project_py_is_pure_ascii` holds it.
Comment thread setup-project.py
Comment on lines +99 to +100
--into <dir> PARENT directory for the clone (default: ..), so the
clone lands at <dir>/<Project>
Copilot AI review requested due to automatic review settings September 5, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

setup-project.py currently forwards env/flag values into git commands without the repo’s usual leading-- refusal/option-terminator hardening, leaving a real argument-injection footgun.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 24/24 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread setup-project.py Outdated
Comment on lines +327 to +330
elif arg == "--shape-ref":
opts.shape_ref = value("--shape-ref")
elif arg == "--keep-shape-checkout":
opts.keep_shape_checkout = True
Comment thread setup-project.py
Comment on lines +414 to +428
shape_repo = os.environ.get("OPENREPOSHAPE_REPO") or DEFAULT_SHAPE_REPO

say("openRepoShape setup")
say("")
say("(0) self-bootstrap")
checkout = tempfile.mkdtemp(prefix="openreposhape-shape-")
try:
clone_cmd = ["git", "clone", "--quiet"]
# `--depth 1` only means something over a real transport; git warns
# and ignores it for a bare local path (what the tests use via
# $OPENREPOSHAPE_REPO), so skip it there rather than clone shallow
# noise.
if "://" in shape_repo and not opts.shape_ref:
clone_cmd += ["--depth", "1"]
clone_cmd += [shape_repo, checkout]
brettheap and others added 2 commits September 5, 2026 16:28
…wer the complexity Sonar flagged (#49)

SonarCloud gate on PR #53: S8705 (values from argv reached subprocess unvalidated) - a local checked_value in the house pattern of scripts/repo_shape.py refuses empty, option-looking (leading -), control-character and out-of-shape values at parse time, with checked_ref for --shape-ref and checked_path for the two directory flags; S6466 - program_version is slice-only; S3776 - parse_args, resolve_org and preflight split into table-driven and per-prerequisite helpers (27/22/19 -> 9/0/1 by a local approximation of the rule); S1192 - file-name literals become constants. Every printed string is byte-identical; 8 new tests.

Lane: xfactory-2 (xFactory-2)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ers, and a YAML unescape bug (#49)

The first windows-latest run on PR #53 (42 failures, all in the shipped tools): (A) shape_materialize.place() built every contracts/shape-pin.yaml row with str(relative_to()), so on Windows the scaffold WROTE backslash rows and update-shape reported every file but the three at the root as unmapped - root_key() returns the POSIX form, and bump-leg stages and reports workflow paths the same way; (B) SAFE_ARG_RE had no drive colon and no backslash, so --local-remote-dir D:\... was refused - SAFE_PATH_RE admits a drive prefix, backslashes and a space, colon only as a drive letter; the adopt failures were a different bug entirely: repo_shape._scalar unescaped double-quoted YAML with chained str.replace, turning the \\t in D:\\a\\_temp\\t into a TAB on every platform - one left-to-right _unescape() now, and it ships into every project; adopt refuses a drive-letter --source as source-unresolvable instead of reading D: as a gh owner; (C) the bash -n hygiene test skips on Windows, where shutil.which finds the WSL launcher stub, not a bash; (D) family.py prints git paths in POSIX form. 19 Linux-runnable regression tests in tests/test_windows_paths.py, including root_key fed a PureWindowsPath.

Lane: xfactory-2 (xFactory-2)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 5, 2026 20:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It introduces a new cross-platform entry point and broad Windows/line-ending correctness changes that warrant final human verification despite strong test coverage.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread setup-project.py
Comment on lines +99 to +101
#: basename is the word they typed to get here, and it is on their PATH
#: because they just used it. argv keeps `PYTHON`; prose gets this.
PYTHON_CMD = Path(sys.executable).name or PYTHON
Comment thread setup-project.py
Comment on lines +1161 to +1163
if shutil.which("git") is None:
bad("git is not installed. Install it: https://git-scm.com/downloads")
die("one or more prerequisites are missing (see above).")
Windows CI run 2, the one failure left: tests/conftest.py run_script never redirected the child stdin, the runner inherited console handle reports isatty() True on Windows, update-shape.py confirm() called input() and died on EOFError with exit 1. update-shape.py and adopt-project.py now treat EOF on the prompt as their own no-terminal refusal (update-unconfirmed / adopt-unconfirmed, exit 2), and run_script passes stdin=DEVNULL unless a caller supplies input= or stdin=, so what a tool does when nobody can be asked is the same on every platform. Two regression tests. 570 tests.

Lane: xfactory-2 (xFactory-2)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 5, 2026 21:05
@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

SAFE_PATH_RE is still too restrictive for real Windows filesystem paths (e.g., it rejects common parentheses in C:\Program Files (x86)\...), which can cause legitimate runs to be refused.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/repo_shape.py:102

  • SAFE_PATH_RE is intended to accept operator-supplied filesystem paths (including Windows paths), but the current character allowlist rejects common valid Windows directory names that include parentheses (e.g., C:\Program Files (x86)\...). That can cause checked_value(..., SAFE_PATH_RE) call sites (e.g., bump-leg.py --local-remote-dir) to refuse legitimate paths on Windows.
  • Files reviewed: 28/28 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap
brettheap merged commit 3541dfa into main Sep 5, 2026
5 checks passed
@brettheap
brettheap deleted the feat/native-windows branch September 5, 2026 21:13
brettheap added a commit that referenced this pull request Sep 5, 2026
The docstring now promises ASCII for the SOURCE and the fixed markers this file writes, not for echoed values or child output; --help says what --into defaults to in self-bootstrap mode; OPENREPOSHAPE_REPO is checked (empty, leading -, control characters refused, the variable named) and the shape clone carries -- before the repository argument; PYTHON_CMD is the platform-conventional command, matching repo_shape.PYTHON, so a remediation names something the reader can type; _main() uses the GIT_MISSING and PREREQ_MISSING constants. Three tests. 573 tests.

Lane: xfactory-2 (xFactory-2)

Co-authored-by: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 5, 2026
…scribes (#51) (#58)

Git for Windows installs core.autocrlf=true by default; a colleague who did nothing but clone a scaffolded project got CRLF in the worktree and every pinned row went red for them alone. #53 covered the clone setup-project.py makes; this covers the next person. `* text=auto eol=lf` in both root templates, PINNED like every other copy (a file that says what the bytes are is worth nothing if it can be edited without the pin noticing); it joins COPIED_VERBATIM and FAMILY_COPIED_VERBATIM and nothing else in the materializer needed to change. Proof, as tests: a `git -c core.autocrlf=true clone` of a scaffolded project shows w/lf for every pinned file and its own validate-pins.py exits 0; the same clone with the file removed shows w/crlf and FINDING shape-copy-drift on every copy. Existing projects report `upstream-added: .gitattributes` on their next update-shape check and take it with `apply --add` (#29 machinery, tested). 583 tests.

Lane: xfactory-2 (xFactory-2)

Co-authored-by: Claude Fable 5.1 <[email protected]>
brettheap pushed a commit that referenced this pull request Oct 13, 2026
…5 cites the 34 pull requests merged since #343, section 6 drops the 13 known-limit issues that closed and adds the 63 checklist lines the five parents gained, section 7 lists the 12 open milestone issues, and the preflight sentence offers only what the preflight offers (#472)

Refresh round 1 of the draft, against main d41cc29 (#402, merged
2026-10-13T21:17:39Z). GitHub was read between 21:23 and 21:43 UTC: the
merged pull requests, the v1.0.0 milestone open and closed, every open
issue, and the five tracking parents with their sub-issues, bodies and
comments. Every merge commit of the 217 merged pull requests is on main.

Section 5 places each of the 34 pull requests merged after #343
(2026-10-12T22:31:20Z) in its area, from its own body, one clause each;
all 217 merged pull requests are now cited, with #16, #53 and #57 still in
two areas. Three earlier sentences are made true of main: `check` has
more verdicts than the four it named, and #465's docs and #505's accuracy
pass show that `validate-pins.py` may ask `gh api` and that
`openRepoShape --preflight` offers only `gh`, its login and its credential
helper (`setup-project.py --preflight` also offers `git`).

Section 6 lists the 47 open, unmilestoned sub-issues (it listed 60). It
drops #189, #293, #303, #328, #386, #286, #259, #275, #322, #324, #338,
#339 and #359, which closed. #389 is reworded now that #305's refusal has
landed. #420 and the `a=b` line are narrowed to a hand-edited
`adopt_branch:`, because an offline probe on d41cc29 shows #493's
`plan-tracking-branch-missing` now stops a bad `tracking_branch:` at
`check`, with no leg made, while `adopt_branch: "a..b"` still passes
`check` and fails after both legs exist. The family annotated-tag line
says `bump --to` now refuses one (#466). The 63 new lines are the
parents' checklist lines posted or added since the first build, each
checked against the code at d41cc29. Left out, and said so in the
refresh record: docstring, comment and wording nits (as L2-7 was), lines
that describe a branch not on main (#504's, #507's, #511's, #515's and
#517's), lines filed into the milestone (#485, #514, #516), and three with
no effect a person meets.

Section 7 lists the 12 open milestone issues; 24 of the 30 it listed have
closed. Lane 4's #510, #511, #512 and #513 have not landed, so #471,
#499, #500, #501 and #502 stay open here and the Windows qualifier stays.

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No native Windows path: setup.sh and the openRepoShape command are bash; a Python entry point, Windows CI, and the README path

2 participants