Skip to content

feat: system-aware tiered parallel pytest with cross-platform hardening#2877

Open
LahkLeKey wants to merge 12 commits into
github:mainfrom
LahkLeKey:feat/upstream-parallel-pytest-ready
Open

feat: system-aware tiered parallel pytest with cross-platform hardening#2877
LahkLeKey wants to merge 12 commits into
github:mainfrom
LahkLeKey:feat/upstream-parallel-pytest-ready

Conversation

@LahkLeKey
Copy link
Copy Markdown
Contributor

@LahkLeKey LahkLeKey commented Jun 6, 2026

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex).

Continuation for LahkLeKey#2

Summary

This PR introduces system-aware optional parallel test execution for Spec Kit's pytest suite and hardens associated cross-platform tests and review-process hygiene.

What changed

  • Added bounded parallel test mode via pytest flags:

    • --parallel

    • --parallel-tier (low|medium|high)

    • --parallel-max-workers

  • Implemented worker sizing based on system constraints:

    • effective CPU count

    • available/total memory

    • cgroup v2 CPU quota (/sys/fs/cgroup/cpu.max)

    • cgroup v1 CPU quota (cpu, cpu,cpuacct, cpuacct,cpu layouts)

    • platform caps by tier

  • Wired xdist integration safely in tests/conftest.py:

    • respects explicit -n/--numprocesses (including -n auto)

    • skips injection/reinvoke when xdist is disabled (-p no:xdist / -pno:xdist)

    • handles -- sentinel correctly by injecting xdist args before positional boundary

    • reports effective worker selection in pytest header

  • Added/updated regression coverage for:

    • cgroup quota parsing behavior

    • zero-memory boundaries

    • xdist disable and -- sentinel edge cases

    • cross-platform path handling in bash-based tests

    • CWD-safe relative installer path tests (monkeypatch.chdir)

Validation

Fresh full-suite verification on this branch:

  • uv run pytest -q --parallel --parallel-tier high -rs

  • Result: 3669 passed

Review quality controls / loop prevention evidence

Source hardening was completed first in fork PR LahkLeKey/spec-kit#2 and then squashed for upstream submission.

Evidence used before opening this upstream PR:

  • All active review findings in the fork PR were answered with on-behalf inline follow-ups including explicit Resolved by <sha> references.

  • A persistent "Review Fix Ledger" was backfilled into the fork PR description to track additive review fixes across rounds and reduce recurrence loops.

  • The final outstanding unresolved thread in the fork PR has an explicit Resolved by reply from the PR owner and no pending unaddressed action item.

Scope

  • Test/workflow changes only; no production runtime behavior changes outside test harness/support scripts.

Review Fix Ledger (On Behalf Of @LahkLeKey)

This section tracks additive review-driven fixes to avoid recurring feedback loops across rounds.

Commit Trigger / Review focus Code changes Validation
127ac67 Initial upstream hardening sweep after fork-review carryover Consolidated cross-platform path assertions, tightened Windows test behavior, and aligned integration assertions Focused touched-suite run (green)
a227754 Upstream comment batch: self-upgrade Windows semantics, xdist arg routing, path-helper permissiveness, interpreter fallback docs Added Windows os.access patching in self-upgrade tests, shared conftest helpers for argument parsing/injection, tightened path helper behavior, interpreter-generic resolver comments Focused suite run before regression and follow-up triage
42571cc Regression closure from prior tightening + open-thread closure pass Fixed malformed duplicated-drive Windows path strings in shared helper, preserved explicit --dist intent while defaulting to worksteal only when unset uv run pytest tests/test_self_upgrade_execution.py tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_timestamp_branches.py tests/test_setup_plan_no_overwrite.py tests/integrations/test_cli.py -q (239 passed)
b12061f Latest upstream comment batch: POSIX page-size portability, Windows PATH delimiter, parallel-hook complexity, and timestamp long-path behavior Added SC_PAGESIZE fallback for sysconf page-size detection, used os.pathsep in Windows PATH shim setup, removed subprocess pytest reinvocation pathway from conftest, replaced silent Windows early-return with explicit pytest.xfail for long-path limitation uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_timestamp_branches.py -q (133 passed, 1 xfailed)
b87e7c6 Follow-up upstream comment batch: autoload+explicit xdist, Bash PATH semantics, chmod assertion brittleness, runtime-exception realism, UNC slash handling Enabled --parallel injection under plugin autoload disable when xdist is explicitly enabled, restored Bash PATH separator usage in Bash subprocess test, loosened Windows chmod assertion to stable safety guarantees, skipped unreachable InvalidMetadataError simulation on runtimes lacking that class, preserved UNC leading // in path normalization and added path-utils unit tests uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/integrations/test_cli.py tests/test_self_upgrade_detection.py tests/test_path_utils.py -q (176 passed, 1 skipped)
8bb0ca4 Current upstream comment batch: UNC over-prefix edge, xdist plugin-name precision, and stale interpreter fallback wording Fixed UNC normalization for over-prefixed slash forms (////server/...), replaced substring-based xdist enable detection with exact plugin-name matching (xdist / xdist.*), and updated bash resolver fallback comment to reflect generic python interpreter availability uv run pytest tests/test_parallel_workers.py tests/test_path_utils.py tests/test_setup_tasks.py -q (55 passed)
55819c7 Latest upstream comment batch: Bash PATH portability nuance and non-POSIX installer executability semantics Clarified Windows/Git Bash PATH handling in setup-tasks shim test by preserving inherited PATH bytes while prepending shim; removed chmod-dependent assumptions from non-executable installer tests where executability is already controlled via mocked os.access uv run pytest tests/test_setup_tasks.py tests/test_self_upgrade_execution.py -q (46 passed) plus targeted checks (2 passed)
4c2a128 Latest upstream comment batch: POSIX-leading-slash normalization, empty-PATH separator safety, and chmod kwargs robustness Restricted UNC preservation to native Windows UNC input forms (avoids POSIX ///... mis-normalization), avoided trailing : when inherited PATH is empty in Git Bash shim setup, and made Windows chmod assertion resilient to positional/keyword mode invocation uv run pytest tests/test_path_utils.py tests/test_setup_tasks.py tests/integrations/test_cli.py -q (105 passed)
1ce7a90 Latest upstream comment batch: slash-normalized UNC handling, sentinel-safe --parallel, and chmod target precision Preserved slash-normalized UNC inputs while still collapsing POSIX triple-leading slashes, limited --parallel detection to args before --, and tightened Windows chmod assertions to match the plan-template target (final or expected temp-write form) uv run pytest tests/test_path_utils.py tests/test_parallel_workers.py tests/integrations/test_cli.py tests/test_setup_tasks.py -q (135 passed)
1c95074 Latest upstream comment batch: unknown-platform worker caps, setup-tasks path assertion duplication, path-from-bash trimming robustness, and Windows template-write verification Defaulted unknown platform OS caps to the most permissive known cap, added path_from_bash_output trimming for quotes/whitespace/CRLF, extracted shared TASKS_TEMPLATE assertion helper in setup-tasks tests, and strengthened Windows integration assertion with explicit output-file existence check uv run pytest tests/test_parallel_workers.py tests/test_path_utils.py tests/test_setup_tasks.py tests/integrations/test_cli.py -q (137 passed)
ba72907 Latest upstream comment batch: non-Windows path equivalence robustness, resolver fallback branch coverage, and early-hook mutation coverage Updated setup-tasks path helper to compare resolved equivalent paths on non-Windows, added bash-backed tests for python interpreter fallback/CRLF preset-id trimming/deterministic parse-failure scan, and added focused tests for pytest_load_initial_conftests sentinel-safe injection behavior uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_path_utils.py tests/integrations/test_cli.py -q (142 passed)

Open Review Thread Status

  • All currently open upstream review threads have explicit inline replies: Resolved by 42571cc.
  • Latest comment batch also has explicit inline replies: Resolved by b12061f.
  • Current comment batch also has explicit inline replies: Resolved by b87e7c6.
  • Latest comment batch also has explicit inline replies: Resolved by 8bb0ca4.
  • Latest comment batch also has explicit inline replies: Resolved by 55819c7.
  • Latest comment batch also has explicit inline replies: Resolved by 4c2a128.
  • Latest comment batch also has explicit inline replies: Resolved by 1ce7a90.
  • Latest comment batch also has explicit inline replies: Resolved by 1c95074.
  • Latest comment batch also has explicit inline replies: Resolved by ba72907.
  • Remaining unresolved state is reviewer-owned conversation resolution status, not missing engineering action.

POSIX vs Git Bash Guard

  • When tests run Bash subprocesses on Windows, preserve inherited PATH bytes and only prepend required shim paths; do not normalize delimiters globally.
  • Treat UNC normalization as a Windows-specific input behavior (native \\server\share forms), not a generic rule for any leading // POSIX path.
  • Prefer assertions against behavioral guarantees (mode, directory, error contract) over implementation-detail assumptions that vary across POSIX vs Git Bash runtimes.

Scope Creep Guard (Copilot Review Guidance)

  • Primary objective: deliver this feature to completion with high-confidence correctness and full test coverage for the touched parallel-workflow/path-normalization surface.
  • In scope: defects that directly affect --parallel behavior, worker sizing, xdist argument flow, cross-platform path correctness, and failing/fragile tests in touched files.
  • Out of scope for this PR: unrelated refactors, style-only churn, speculative architecture changes, and broad feature additions not required by failing tests or stated requirements.
  • Review acceptance rule: each requested change must map to one of: a reproducible failure, a cross-platform correctness bug, a regression risk, or explicit feature requirement.
  • Copilot anti-nitpick rule: do not request or apply style/readability-only tweaks unless they are directly required to fix a failing test, prevent a concrete regression, or satisfy an explicit acceptance criterion for this feature.
  • Evidence rule: every non-trivial review request should include a failing command/test case, a concrete platform incompatibility, or a precise behavioral risk statement.
  • POSIX/Git Bash tie-breaker: when a suggestion is primarily stylistic but risks destabilizing Windows Git Bash path/process behavior, defer it unless there is failing evidence.
  • Duplicate-feedback suppression: if a concern is already covered by the Review Fix Ledger or Scope/Guard rules, do not reopen it unless new failing evidence is provided.
  • Deferral rule: useful but non-blocking improvements should be logged as follow-up issues to avoid rabbit-hole expansion in this PR.

2026-06-06 Add-on (commit 42571cc)

  • Fixed Windows malformed shell path handling in tests/_path_utils.py by trimming nested drive-root prefixes and removing permissive tail-only fallback to keep path assertions strict.
  • Ensured pytest parallel mode only overrides dist strategy when --dist was not explicitly provided, preserving user intent while keeping worksteal defaulting behavior.
  • Stabilized Windows self-upgrade execution tests by patching os.access in relative/absolute installer path scenarios under mocked execute bits.
  • Updated scripts/bash/common.sh resolver comments to stay interpreter-generic now that python3/python fallback is supported.
  • Validation: uv run pytest tests/test_self_upgrade_execution.py tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_timestamp_branches.py tests/test_setup_plan_no_overwrite.py tests/integrations/test_cli.py -q (239 passed).

2026-06-06 Add-on (commit b12061f)

  • Addressed sysconf portability in tests/_parallel.py by trying both SC_PAGE_SIZE and SC_PAGESIZE before computing total memory.
  • Updated Windows PATH handling in tests/test_setup_tasks.py to prepend shim paths using os.pathsep instead of hardcoded :.
  • Reduced parallel-mode complexity in tests/conftest.py by removing subprocess-based pytest reinvocation and relying on existing injection/configure hooks.
  • Converted Windows long-path early return to explicit expected-failure signaling (pytest.xfail) in tests/test_timestamp_branches.py.
  • Validation: uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_timestamp_branches.py -q (133 passed, 1 xfailed).

2026-06-06 Add-on (commit b87e7c6)

  • Addressed explicit xdist enablement under PYTEST_DISABLE_PLUGIN_AUTOLOAD in tests/conftest.py so --parallel still injects workers when xdist is intentionally loaded via -p xdist.
  • Restored Bash PATH separator semantics (:) for the shim-based Bash subprocess test in tests/test_setup_tasks.py.
  • Relaxed brittle Windows chmod assertion in tests/integrations/test_cli.py to assert safe mode and target directory without coupling to temp filename implementation details.
  • Updated editable-metadata test realism in tests/test_self_upgrade_detection.py by skipping on runtimes without InvalidMetadataError instead of fabricating an exception class.
  • Preserved UNC leading double-slash semantics in tests/_path_utils.py and added direct helper coverage in tests/test_path_utils.py.
  • Validation: uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/integrations/test_cli.py tests/test_self_upgrade_detection.py tests/test_path_utils.py -q (176 passed, 1 skipped).

2026-06-06 Add-on (commit 8bb0ca4)

  • Fixed UNC normalization in tests/_path_utils.py for over-prefixed slash inputs so replacement output stays canonical (//server/share/...), not triple-slash.
  • Tightened explicit xdist enable detection in tests/conftest.py to exact plugin names (xdist, xdist.*) and avoid substring false positives.
  • Added regression coverage for xdist matching precision in tests/test_parallel_workers.py and UNC over-prefix normalization in tests/test_path_utils.py.
  • Updated fallback wording in scripts/bash/common.sh to reflect missing generic python interpreter availability, not just python3.
  • Validation: uv run pytest tests/test_parallel_workers.py tests/test_path_utils.py tests/test_setup_tasks.py -q (55 passed).

2026-06-06 Add-on (commit 55819c7)

  • Updated tests/test_setup_tasks.py Windows shim PATH handling to preserve inherited PATH bytes while prepending the shim path for Bash subprocess execution, with an explicit comment documenting the drive-letter delimiter caveat.
  • Removed chmod-dependent setup from path-specific non-executable installer tests in tests/test_self_upgrade_execution.py, relying on mocked os.access(..., X_OK) as the cross-platform executability control.
  • Validation: uv run pytest tests/test_setup_tasks.py tests/test_self_upgrade_execution.py -q (46 passed) and targeted regression checks (2 passed).

2026-06-06 Add-on (commit 4c2a128)

  • Refined tests/_path_utils.py so UNC-preserving behavior applies only to native Windows UNC-style inputs, preventing POSIX leading-slash paths (for example ///usr/bin) from being pinned to a double-slash prefix.
  • Updated tests/test_setup_tasks.py to avoid appending a trailing PATH separator when inherited PATH is empty.
  • Hardened tests/integrations/test_cli.py Windows chmod assertion to accept positional or keyword mode invocation.
  • Added/updated path normalization regression coverage in tests/test_path_utils.py.
  • Validation: uv run pytest tests/test_path_utils.py tests/test_setup_tasks.py tests/integrations/test_cli.py -q (105 passed).

2026-06-06 Add-on (commit 1ce7a90)

  • Updated tests/_path_utils.py to preserve slash-normalized UNC inputs (//server/share/...) while continuing to normalize POSIX triple-leading-slash paths correctly.
  • Updated tests/conftest.py so pytest_load_initial_conftests only honors --parallel before the -- sentinel.
  • Tightened Windows chmod assertion targeting in tests/integrations/test_cli.py to require the expected plan-template target path shape.
  • Added regression coverage in tests/test_parallel_workers.py and tests/test_path_utils.py.
  • Validation: uv run pytest tests/test_path_utils.py tests/test_parallel_workers.py tests/integrations/test_cli.py tests/test_setup_tasks.py -q (135 passed).

2026-06-06 Add-on (commit 1c95074)

  • Updated tests/_parallel.py to use the most permissive known OS cap when platform_name is unrecognized, avoiding unnecessary throttling on non-Windows unknown platforms.
  • Updated tests/_path_utils.py so path_from_bash_output trims shell artifacts (quotes, whitespace, CRLF) before path conversion.
  • Extracted _assert_tasks_template_matches(...) in tests/test_setup_tasks.py to centralize repeated POSIX-vs-Windows shell path assertions.
  • Added explicit written.is_file() verification in tests/integrations/test_cli.py for Windows template-write safety checks.
  • Added regression coverage in tests/test_parallel_workers.py and tests/test_path_utils.py.
  • Validation: uv run pytest tests/test_parallel_workers.py tests/test_path_utils.py tests/test_setup_tasks.py tests/integrations/test_cli.py -q (137 passed).

2026-06-06 Add-on (commit ba72907)

  • Updated _assert_tasks_template_matches(...) in tests/test_setup_tasks.py to compare resolved-equivalent paths on non-Windows, preventing false negatives when shell output contains equivalent non-canonical segments.
  • Added bash-backed resolver coverage in tests/test_setup_tasks.py for: python fallback when python3 is unavailable, CRLF trimming for preset IDs, and deterministic alphabetical directory fallback when registry parsing fails.
  • Added focused mutation tests in tests/test_parallel_workers.py that exercise pytest_load_initial_conftests around -- sentinel boundaries and injection placement.
  • Validation: uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_path_utils.py tests/integrations/test_cli.py -q (142 passed).

…and on-behalf review standards (#2)

* feat: add system-aware parallel pytest tiers

* fix: honor cgroup v1 cpu quota for parallel worker sizing

* docs: add on-behalf AI review disclosure standard

* fix: support cpuacct,cpu cgroup v1 quota mount layout

* test: make --parallel activate xdist workers

* test: harden bash path assertions on Windows

* test: handle zero available memory in parallel sizing

* test: make symlink skip capability-based on Windows

* test: replace platform skips with capability checks

* test: address open review findings for path and xdist checks

* test: restore strict setup task assertions

* test: honor explicit -n auto and clean InvalidMetadata fallback

* test: floor cgroup quota workers and remove dead helper

* test: mock os.access for relative installer path case

* test: tighten path checks and report effective workers

* test: skip parallel xdist hooks when plugin is disabled

* test: simplify bash path normalization helper

* test: harden parallel args and cwd-safe upgrade tests
Copilot AI review requested due to automatic review settings June 6, 2026 06:07
@LahkLeKey LahkLeKey requested a review from mnriem as a code owner June 6, 2026 06:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves cross-platform test robustness (especially on Windows/Git Bash path translation) and adds an opt-in pytest --parallel mode that chooses a conservative worker count based on CPU/memory/OS caps (via pytest-xdist).

Changes:

  • Added system-aware parallel worker sizing utilities and --parallel/tier/max-workers pytest options, plus new unit tests.
  • Relaxed or normalized several path-based assertions to handle Windows/Git Bash path formats and filesystem limits.
  • Updated contributor docs and PR template to mention the new parallel test option and AI attribution guidance.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_timestamp_branches.py Adds Windows-tolerant path assertion helper + relaxes long-path failure expectation on Windows.
tests/test_setup_tasks.py Adjusts TASKS_TEMPLATE assertions to be Windows/Git Bash tolerant.
tests/test_setup_plan_no_overwrite.py Normalizes bash-emitted paths to Windows paths for assertions.
tests/test_self_upgrade_execution.py Makes self-upgrade tests less POSIX-only via mocking/path changes.
tests/test_self_upgrade_detection.py Makes InvalidMetadataError test runnable on more Python versions by patching conditionally.
tests/test_parallel_workers.py New tests covering worker sizing, cgroup parsing, and CLI arg parsing helpers.
tests/test_authentication.py Makes permission-warning test runnable on Windows via patching.
tests/integrations/test_integration_subcommand.py Adds a capability check for Windows directory symlink creation and skips accordingly.
tests/integrations/test_cli.py Makes chmod-mode assertion Windows-tolerant by spying on chmod calls.
tests/conftest.py Adds --parallel pytest option + early xdist arg injection, configuration, and report header.
tests/_parallel.py New module implementing CPU/memory detection and recommended worker computation.
pyproject.toml Adds pytest-xdist to test extras.
CONTRIBUTING.md Documents pytest --parallel usage and tuning options.
.github/PULL_REQUEST_TEMPLATE.md Updates checklist to mention parallel tests + AI comment attribution checkbox.
Comments suppressed due to low confidence (1)

tests/test_self_upgrade_execution.py:1

  • These tests no longer appear gated to POSIX, but they still rely on POSIX executable-bit semantics (chmod(0o644) and (likely) os.access(..., X_OK)). On Windows, os.access(..., X_OK) can behave like an existence check, so this test can fail (or become meaningless) when run under --parallel/xdist on Windows. Suggested fix: reintroduce a POSIX-only marker for this specific test, or explicitly patch specify_cli._version.os.access to return False for the installer path in this test so the behavior is deterministic cross-platform.
"""Installer execution, verification, and error-path tests for `specify self upgrade`."""

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_setup_tasks.py Outdated
Comment thread tests/test_setup_tasks.py Outdated
Comment thread tests/conftest.py
Comment thread tests/test_timestamp_branches.py Outdated
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Review round update for 127ac67: addressed all currently open review comments and posted inline 'Resolved by 127ac67' replies on each thread. Also refreshed the PR description Review Fix Ledger to track additive fixes and reduce feedback-loop churn. Validation: uv run pytest tests/test_setup_tasks.py tests/test_timestamp_branches.py tests/test_setup_plan_no_overwrite.py tests/test_self_upgrade_execution.py tests/test_parallel_workers.py -q (160 passed).

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 06:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Comment thread tests/conftest.py Outdated
Comment thread tests/conftest.py Outdated
Comment thread tests/test_setup_tasks.py Outdated
Comment thread tests/test_setup_tasks.py Outdated
Comment thread tests/test_timestamp_branches.py Outdated
Comment thread tests/integrations/test_cli.py
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Review round update for a227754: addressed all currently open review comments and posted inline 'Resolved by a227754' replies on each thread. Refreshed the PR description Review Fix Ledger so additive follow-up fixes remain tracked and feedback-loop churn is reduced. Validation: uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_timestamp_branches.py tests/test_setup_plan_no_overwrite.py tests/test_self_upgrade_execution.py tests/integrations/test_cli.py -q (239 passed).

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 06:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Comment thread tests/test_self_upgrade_execution.py
Comment thread tests/conftest.py
Comment thread tests/_path_utils.py Outdated
Comment thread scripts/bash/common.sh
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

LahkLeKey commented Jun 6, 2026

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.4 mini). Addressed the latest review round in commit 42571cc (Windows self-upgrade test stability, xdist dist-default handling, tightened Windows shell-path matching, and interpreter-generic comments in common.sh). Focused validation: uv run pytest tests/test_self_upgrade_execution.py tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_timestamp_branches.py tests/test_setup_plan_no_overwrite.py tests/integrations/test_cli.py -q (239 passed).

@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.4 mini). Backfilled the PR review ledger with commit-level drilled-down details (trigger, code-surface, validation), added a scope-creep guard section to keep review changes bounded to this feature and coverage outcomes, and re-verified open threads. Current open-thread count is reviewer-owned conversation state; all open threads contain explicit inline Resolved by 42571cc. notes.

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 06:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Comment thread tests/_parallel.py Outdated
Comment thread tests/test_setup_tasks.py Outdated
Comment thread tests/conftest.py Outdated
Comment thread tests/test_timestamp_branches.py Outdated
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Addressed the latest four review comments in commit b12061f: sysconf page-size fallback portability, Windows PATH separator handling in shim-based setup-tasks test, simplification of parallel pytest flow by removing subprocess reinvocation, and explicit xfail for Windows long-path truncation edge case. Validation: uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_timestamp_branches.py -q (133 passed, 1 xfailed). PR description was backfilled with drilled-down add-on ledger details and updated open-thread status notes to reduce feedback-loop churn.

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 06:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Comment thread tests/conftest.py
Comment thread tests/test_setup_tasks.py Outdated
Comment thread tests/integrations/test_cli.py
Comment thread tests/test_self_upgrade_detection.py Outdated
Comment thread tests/_path_utils.py
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Addressed the latest five review comments in commit b87e7c6: explicit xdist enablement when plugin autoload is disabled, Bash PATH separator handling for Bash subprocess shims, less brittle Windows chmod assertion semantics, realistic InvalidMetadataError coverage behavior, and UNC-preserving slash normalization with direct helper tests. Validation: uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/integrations/test_cli.py tests/test_self_upgrade_detection.py tests/test_path_utils.py -q (176 passed, 1 skipped). PR description was backfilled with this add-on in the review ledger and open-thread status notes were updated.

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 06:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Comment thread tests/_path_utils.py
Comment thread tests/conftest.py
Comment thread scripts/bash/common.sh
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Addressed the latest three review comments in commit 8bb0ca4: UNC over-prefix normalization in shared path helpers, precise explicit-xdist plugin matching to avoid substring false positives, and interpreter-fallback wording alignment in bash resolver comments. Validation: uv run pytest tests/test_parallel_workers.py tests/test_path_utils.py tests/test_setup_tasks.py -q (55 passed). PR description review ledger has been backfilled with this add-on and open-thread resolved-by status updated.

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 07:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Comment thread tests/test_setup_tasks.py
Comment thread tests/test_self_upgrade_execution.py
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Addressed the latest two review comments in commit 55819c7: clarified Windows/Git Bash PATH handling in setup-tasks shim tests while preserving inherited PATH bytes, and removed chmod-dependent setup from non-executable installer tests where executability is already controlled via mocked os.access. Validation: uv run pytest tests/test_setup_tasks.py tests/test_self_upgrade_execution.py -q (46 passed), plus targeted checks (2 passed). PR description review ledger was backfilled with this add-on and open-thread status notes updated.

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 07:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Comment thread tests/_path_utils.py
Comment thread tests/test_setup_tasks.py Outdated
Comment thread tests/integrations/test_cli.py
@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 07:12
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Addressed the latest three review comments in commit 4c2a128: refined UNC normalization to avoid POSIX leading-slash mis-normalization, removed empty-PATH trailing-separator risk in Git Bash shim PATH construction, and hardened Windows chmod assertion matching for positional/keyword mode usage. Validation: uv run pytest tests/test_path_utils.py tests/test_setup_tasks.py tests/integrations/test_cli.py -q (105 passed). PR description ledger was backfilled with this add-on and includes an explicit POSIX-vs-Git-Bash guard section to reduce repeat cross-platform feedback loops.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Comment thread tests/_path_utils.py
Comment thread tests/conftest.py
Comment thread tests/integrations/test_cli.py
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Addressed the latest three review comments in commit 1ce7a90: slash-normalized UNC preservation without regressing POSIX triple-leading-slash normalization, sentinel-safe handling in , and tighter Windows chmod target matching for plan-template writes. Validation: uv run pytest tests/test_path_utils.py tests/test_parallel_workers.py tests/integrations/test_cli.py tests/test_setup_tasks.py -q (135 passed). PR description review ledger was backfilled with this add-on and Copilot scope guidance now includes explicit anti-nitpick/evidence rules to reduce review churn.

@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Corrected summary for commit 1ce7a90: addressed slash-normalized UNC preservation without regressing POSIX triple-leading-slash normalization, sentinel-safe parallel flag handling in pytest initial conftest processing, and tighter Windows chmod target matching for plan-template writes. Validation: uv run pytest tests/test_path_utils.py tests/test_parallel_workers.py tests/integrations/test_cli.py tests/test_setup_tasks.py -q (135 passed). PR description review ledger was backfilled with this add-on and Copilot scope guidance now includes explicit anti-nitpick and evidence rules to reduce review churn.

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 07:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Comment thread tests/_parallel.py Outdated
Comment on lines +272 to +274
os_cap = cfg.os_cap_by_platform.get(platform_name, cfg.os_cap_by_platform["win32"])

workers = min(cpu_cap, memory_cap, os_cap)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by 1c95074.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by ba72907.

Comment thread tests/integrations/test_cli.py
Comment thread tests/test_setup_tasks.py Outdated
Comment thread tests/_path_utils.py
@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Addressed the latest four review comments in commit 1c95074: unknown-platform worker-cap fallback behavior, robust path_from_bash_output trimming for shell artifacts, setup-tasks path assertion helper extraction to reduce repeated POSIX vs Git Bash logic, and stronger Windows template-write verification in integration tests. Validation: uv run pytest tests/test_parallel_workers.py tests/test_path_utils.py tests/test_setup_tasks.py tests/integrations/test_cli.py -q (137 passed). PR description review ledger was backfilled with this add-on and Copilot scope guidance now includes a POSIX/Git Bash anti-nitpick tie-breaker rule.

@LahkLeKey
Copy link
Copy Markdown
Contributor Author

ReactionMemeStanTwtGIF

@LahkLeKey LahkLeKey requested a review from Copilot June 6, 2026 07:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Comment thread tests/test_setup_tasks.py Outdated
Comment on lines +103 to +113
def _assert_tasks_template_matches(tasks_tmpl_raw: str, expected_path: Path) -> None:
assert _is_shell_absolute(tasks_tmpl_raw), "TASKS_TEMPLATE must be an absolute path"
expected = expected_path.resolve()
if os.name == "nt":
tasks_tmpl = path_from_bash_output(tasks_tmpl_raw)
assert tasks_tmpl.is_file(), "TASKS_TEMPLATE must point to an existing file"
assert_normalized_path_equal(tasks_tmpl_raw, expected)
return
tasks_tmpl = Path(tasks_tmpl_raw)
assert tasks_tmpl.is_file(), "TASKS_TEMPLATE must point to an existing file"
assert tasks_tmpl == expected, f"Expected {expected} but got: {tasks_tmpl}"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by ba72907.

Comment thread scripts/bash/common.sh
Comment on lines +436 to +445
if [ -f "$registry_file" ] && (command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1); then
# Read preset IDs sorted by priority (lower number = higher precedence).
# The python3 call is wrapped in an if-condition so that set -e does not
# abort the function when python3 exits non-zero (e.g. invalid JSON).
# The python call is wrapped in an if-condition so that set -e does not
# abort the function when the interpreter exits non-zero (e.g. invalid JSON).
local sorted_presets=""
if sorted_presets=$(SPECKIT_REGISTRY="$registry_file" python3 -c "
local python_cmd="python3"
if ! command -v "$python_cmd" >/dev/null 2>&1; then
python_cmd="python"
fi
if sorted_presets=$(SPECKIT_REGISTRY="$registry_file" "$python_cmd" -c "
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by ba72907.

Comment thread scripts/bash/common.sh
Comment on lines +458 to 463
# Python interpreter succeeded and returned preset IDs — search in priority order
while IFS= read -r preset_id; do
preset_id="${preset_id%$'\r'}"
local candidate="$presets_dir/$preset_id/templates/${template_name}.md"
[ -f "$candidate" ] && echo "$candidate" && return 0
done <<< "$sorted_presets"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by ba72907.

Comment thread scripts/bash/common.sh
Comment on lines +467 to +472
# Interpreter invocation failed (missing, or registry parse error) — fall back to deterministic directory scan
while IFS= read -r preset; do
[ -d "$preset" ] || continue
local candidate="$preset/templates/${template_name}.md"
[ -f "$candidate" ] && echo "$candidate" && return 0
done
done < <(find "$presets_dir" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | LC_ALL=C sort)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by ba72907.

Comment thread tests/conftest.py
Comment on lines +151 to +170
def pytest_load_initial_conftests(early_config, parser, args):
"""Inject xdist flags early so --parallel actually runs with workers."""
if "--parallel" not in _args_before_double_dash(args):
return
if not _has_xdist_installed():
return
if _is_plugin_autoload_disabled() and not _is_xdist_explicitly_enabled(args):
return
if _is_xdist_disabled(args):
return
if _has_numprocesses_arg(args):
return

settings = _compute_parallel_settings_from_args(args)
injected_args = _build_parallel_injected_args(args, settings.workers)
if "--" in args:
idx = args.index("--")
args[idx:idx] = injected_args
else:
args.extend(injected_args)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by ba72907.

@LahkLeKey
Copy link
Copy Markdown
Contributor Author

Posted on behalf of @LahkLeKey by GitHub Copilot (model: GPT-5.3-Codex). Addressed the latest six review comments in commit ba72907: improved non-Windows path-equivalence assertions, added bash-backed resolver branch coverage (python fallback, CRLF preset-id trimming, deterministic fallback ordering), and added focused sentinel-safe pytest initial hook mutation tests. Validation: uv run pytest tests/test_parallel_workers.py tests/test_setup_tasks.py tests/test_path_utils.py tests/integrations/test_cli.py -q (142 passed). PR description review ledger was backfilled with this add-on and Copilot guidance now includes duplicate-feedback suppression to reduce nit-pick churn.

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.

2 participants