Skip to content

Fix conda-create cascade-restore gap (Active Backlog Item 23) - #413

Merged
mixmansoundude merged 3 commits into
mainfrom
claude/bootstrapper-execution-branches-ox2izi
Aug 4, 2026
Merged

Fix conda-create cascade-restore gap (Active Backlog Item 23)#413
mixmansoundude merged 3 commits into
mainfrom
claude/bootstrapper-execution-branches-ox2izi

Conversation

@mixmansoundude

Copy link
Copy Markdown
Owner

Summary

A genuine conda-create failure reached during a REQ-009 cascade re-entry (uv fails, cascades to conda, conda-create then also fails for real) fell through :die into :conda_create_done's own success-path continuation instead of routing through :after_cascade_decision like every other cascade-target failure (:cascade_conda_unavailable and its 3 siblings) -- so the bootstrap couldn't gracefully keep the previously-working uv build, carrying a broken HP_PY forward instead.

This was CLAUDE.md Active Backlog Item 23, found via a CodeRabbit review finding on a previous PR (#412) and deliberately deferred to its own scoped pass rather than rushed alongside that PR's other fixes.

  • Fix: inserted if defined HP_CASCADE_SAVED_PY goto :cascade_conda_create_failed immediately before both call :die fall-through sites (:conda_create_failed's own line and the companion python.exe-missing check inside :conda_create_done), and added a new :cascade_conda_create_failed label mirroring the existing sibling template exactly -- logs a [WARN] ... keeping current build. line and routes to :after_cascade_decision, deliberately never calling :die (whose HP_BOOTSTRAP_STATE=error would defeat the "keeping current build" restore). HP_CASCADE_SAVED_PY-definedness reliably distinguishes a genuine first attempt (never defined) from a cascade re-entry (always defined by :provider_cascade before dispatching to :cascade_from_uv, the only cascade source that reaches :try_conda_create).
  • New regression test: tests/selfapps_cascade_conda_create_fail.ps1 (uv lane, non-gating) forces a GENUINE failure through the real create/retry code path via a new hook, HP_TEST_FORCE_CONDA_CREATE_BOTH_FAIL=1 -- unlike the existing HP_TEST_FORCE_CONDA_CREATE_NETWORK_FAIL (fails the first attempt only, then clears itself so the retry can genuinely succeed), this persists through the retry too. Combined with HP_TEST_FORCE_EMBED_FAIL/HP_TEST_FORCE_VENV_FAIL/HP_TEST_SYSCON_ANSWER=N to exhaust :handle_conda_failure's own fallback chain deterministically, so the fix's new check is actually exercised (not short-circuited by an unrelated fallback tier succeeding). Wired into batch-check.yml immediately after selfapps_cascade.ps1's own step so Miniconda is already cached from that step.
  • Docs: moved the now-resolved Item 23 from CLAUDE.md's Active Backlog to docs/agent-closed-backlog.md, keeping its original number per this repo's own numbering convention. Registered the new NDJSON row (self.cascade.conda_create_fail) in docs/agent-ndjson.md.

Test plan

  • python tools/check_delimiters.py run_setup.bat -- clean
  • python tools/check_delimiters.py tests/selfapps_cascade_conda_create_fail.ps1 -- clean
  • Full sanity sweep (tools/run_sanity_sweep.sh) -- compileall, pyflakes, delimiter check, markdownlint, yamllint, actionlint, ASCII sweep, PowerShell AST parse sweep (426 passed, 48 skipped), all clean
  • actionlint on the modified batch-check.yml -- clean
  • Real CI: the new self.cascade.conda_create_fail test needs to run once on the uv lane to confirm it passes for real (non-gating, continue-on-error)

🤖 Generated with Claude Code


Generated by Claude Code

A genuine conda-create failure reached during a REQ-009 cascade re-entry
(uv fails, cascades to conda, conda-create then also fails for real) fell
through :die into :conda_create_done's own success-path continuation
instead of routing through :after_cascade_decision like every other
cascade-target failure (:cascade_conda_unavailable and its 3 siblings) --
so the bootstrap couldn't gracefully keep the previously-working uv build,
carrying a broken HP_PY forward instead.

Fixed by inserting "if defined HP_CASCADE_SAVED_PY goto
:cascade_conda_create_failed" immediately before both :die fall-through
sites, and adding a new :cascade_conda_create_failed label that mirrors the
existing sibling template exactly -- logs a WARN and routes to
:after_cascade_decision, deliberately never calling :die (whose
HP_BOOTSTRAP_STATE=error would defeat the "keeping current build" restore).
HP_CASCADE_SAVED_PY-definedness reliably distinguishes a genuine first
attempt (never defined) from a cascade re-entry (always defined by
:provider_cascade before dispatching to :cascade_from_uv, the only cascade
source that reaches :try_conda_create).

New test tests/selfapps_cascade_conda_create_fail.ps1 (uv lane, non-gating)
forces a GENUINE failure through the real create/retry code path via a new
hook, HP_TEST_FORCE_CONDA_CREATE_BOTH_FAIL=1 -- unlike the existing
HP_TEST_FORCE_CONDA_CREATE_NETWORK_FAIL (fails the first attempt only, then
clears itself so the retry can genuinely succeed), this persists through
the retry too. Combined with HP_TEST_FORCE_EMBED_FAIL/HP_TEST_FORCE_VENV_FAIL/
HP_TEST_SYSCON_ANSWER=N to exhaust :handle_conda_failure's own fallback
chain deterministically, so the fix's new check is actually exercised.
Wired into batch-check.yml immediately after selfapps_cascade.ps1's own
step so Miniconda is already cached from that step.

Moved the now-resolved Item 23 from CLAUDE.md's Active Backlog to
docs/agent-closed-backlog.md, keeping its original number per this repo's
own numbering convention. Registered the new NDJSON row in
docs/agent-ndjson.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A4iE1BRSkUETwz237XeuTW
@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.

@mixmansoundude
mixmansoundude enabled auto-merge (squash) August 4, 2026 08:02
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ee5620b1-ab80-4f08-b597-b848106c3225

📥 Commits

Reviewing files that changed from the base of the PR and between 4539674 and c44e4be.

📒 Files selected for processing (7)
  • .github/workflows/batch-check.yml
  • docs/agent-closed-backlog.md
  • docs/agent-ndjson.md
  • docs/open-questions.md
  • docs/prd-conda-native-dll-bundling.md
  • run_setup.bat
  • tests/selfapps_cascade_conda_create_fail.ps1
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (17)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

The single-bootstrapper directive requires run_setup.bat to work when dropped next to the application without committed helper files; test-only helpers may live under tests/ but cannot be required by the real flow.

Files:

  • run_setup.bat
  • docs/prd-conda-native-dll-bundling.md
  • docs/open-questions.md
  • tests/selfapps_cascade_conda_create_fail.ps1
  • docs/agent-ndjson.md
  • docs/agent-closed-backlog.md
run_setup.bat

📄 CodeRabbit inference engine (AGENTS.md)

run_setup.bat: Every branch added to run_setup.bat or related helpers must have a CI test, including feature flags, fallback and recovery paths, and fast versus full paths; add an NDJSON assertion and a dedicated lane or HP_* flag when necessary.
All embedded helpers must remain base64 payloads under :define_helper_payloads; changing a payload requires updating the matching HP_* line from its canonical tools/ source.
Do not remove tilde prefixes from runtime artifact files such as ~bootstrap.status.json, ~setup.log, ~environment.lock.txt, and ~env.state.json.
Treat unknown ~env.state.json schemas as stale and trigger a full rebuild rather than reporting an error.
Update [VERSION_METADATA] after CI verifies a newer Windows, PowerShell, or Python environment, including the verification date and current versions.

run_setup.bat: Keep run_setup.bat self-contained: do not commit helper files; embed helpers as base64 payloads under :define_helper_payloads, and refresh them with python tools/sync_payload.py rather than hand-editing encoded content.
Run python tools/check_delimiters.py run_setup.bat after every edit.
Preserve all three run_setup.bat execution paths: cache, real, and conda-full; significant changes must be tested across all three CI lanes.
Every bootstrap run must write ~bootstrap.status.json with state ok, no_python_files, or error, plus exitCode and pyFiles fields.
During bootstrap, never depend on console scripts or PATH/activation state; anchor every tool invocation to an explicit interpreter such as %HP_PY% or %CONDA_PREFIX%\python.exe.
Invoke pipreqs as python -m pipreqs.pipreqs, not the pipreqs console script, and retain a comment explaining the PATH/activation rationale.

Files:

  • run_setup.bat
**/*.{bat,cmd}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{bat,cmd}: For batch assignments use set "VAR=value", never set VAR="value"; quote %VAR% at every filesystem call site, except NSIS /D= parameters, which must remain /D=%VAR%.
Before system-wide installation, silently check elevation with fsutil dirty query %systemdrive% >nul 2>&1; on failure, skip the system-wide path and fall back to per-user installation.
Avoid EnableDelayedExpansion unless it is strictly scoped, and disable it afterward; use careful quoting and escaping rather than silencing errors.
Use tools/sync_payload.py as the only sanctioned method for re-encoding embedded HP_* payload lines after editing canonical helper sources; run delimiter checks after payload changes.

Files:

  • run_setup.bat
**/*.{bat,cmd,ps1,py,yml,yaml,json}

📄 CodeRabbit inference engine (AGENTS.md)

Run delimiter and repository-specific syntax regression checks using tools/check_delimiters.py, respecting comments, escapes, and here-strings as applicable.

Files:

  • run_setup.bat
  • tests/selfapps_cascade_conda_create_fail.ps1
**/*.{py,ps1,psm1,psd1,yml,yaml,json,bat,cmd}

📄 CodeRabbit inference engine (AGENTS.md)

Keep source text ASCII plain text and avoid non-ASCII punctuation.

Files:

  • run_setup.bat
  • tests/selfapps_cascade_conda_create_fail.ps1
**/*.{bat,ps1}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{bat,ps1}: Use ASCII-only text in batch and PowerShell files; avoid emojis, curly quotes, em-dashes, and other non-ASCII characters.
Keep .bat and .ps1 files in CRLF format; other files use LF, as controlled by .gitattributes.
Avoid EnableDelayedExpansion; when necessary, scope it tightly to prevent collisions with parent shells using /V:ON.
Quote or escape batch special characters (&, %, ^, !, ~); double % inside for loops.

Files:

  • run_setup.bat
  • tests/selfapps_cascade_conda_create_fail.ps1
**/*.{bat,ps1,yml,yaml}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{bat,ps1,yml,yaml}: Do not download from PSGallery in CI; use syntax-only PowerShell validation instead.
All conda installs must use --override-channels -c conda-forge to prevent defaults-channel contamination.

Files:

  • run_setup.bat
  • tests/selfapps_cascade_conda_create_fail.ps1
**/*.bat

📄 CodeRabbit inference engine (CLAUDE.md)

Invoke conda through call "%CONDA_BAT%" ... so the parent batch process continues running.

Files:

  • run_setup.bat
**/*.{bat,ps1,py,md}

📄 CodeRabbit inference engine (CLAUDE.md)

Use tilde-prefixed temporary files such as ~setup.log and ~bootstrap.status.json; do not remove the tilde prefix.

Files:

  • run_setup.bat
  • docs/prd-conda-native-dll-bundling.md
  • docs/open-questions.md
  • tests/selfapps_cascade_conda_create_fail.ps1
  • docs/agent-ndjson.md
  • docs/agent-closed-backlog.md
**/*.{bat,ps1,py}

📄 CodeRabbit inference engine (CLAUDE.md)

Tag non-obvious constraints with comments in the form # derived requirement: <why> to prevent regressions.

Files:

  • run_setup.bat
  • tests/selfapps_cascade_conda_create_fail.ps1
**/*.{md,bat,ps1,py,yml,yaml}

📄 CodeRabbit inference engine (CLAUDE.md)

When a change teaches or invalidates a lesson, update the relevant knowledge document in the same commit; edit existing entries rather than only appending.

Files:

  • run_setup.bat
  • docs/prd-conda-native-dll-bundling.md
  • docs/open-questions.md
  • tests/selfapps_cascade_conda_create_fail.ps1
  • docs/agent-ndjson.md
  • docs/agent-closed-backlog.md
**/*.{md,py,bat,ps1,yml,yaml}

📄 CodeRabbit inference engine (CLAUDE.md)

For each iteration loop, freeze scope, fix CI before tests and product code, verify no false positives, implement exactly one feature slice, and add exactly one missing test.

Files:

  • run_setup.bat
  • docs/prd-conda-native-dll-bundling.md
  • docs/open-questions.md
  • tests/selfapps_cascade_conda_create_fail.ps1
  • docs/agent-ndjson.md
  • docs/agent-closed-backlog.md
**/*.{md,txt}

📄 CodeRabbit inference engine (AGENTS.md)

When documenting run_setup.bat, cite labels or subroutine names rather than exact line numbers unless a line number provides immediate value for the introducing commit.

Files:

  • docs/prd-conda-native-dll-bundling.md
  • docs/open-questions.md
  • docs/agent-ndjson.md
  • docs/agent-closed-backlog.md
**/.github/workflows/*.{yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

**/.github/workflows/*.{yml,yaml}: Use GitHub Actions CI results, especially Job Summary, grouped log tails, and workflow PR failure comments, as the source of truth; local runs are advisory.
Isolate slow, flaky, or environment-dependent diagnostics in separate non-gating lanes using continue-on-error rather than weakening deterministic gating lanes.
Keep CI parser checks synchronized with exact bootstrapper messages and preserve the single parser-facing iterate signal * Iterate logs: {found|missing}.
The iterate job must upload one artifact named iterate-logs-${run_id}-${run_attempt} containing iterate/_temp/ and the job summary; do not alter the intentional pre-flight gate failure for missing NDJSON inputs.

Files:

  • .github/workflows/batch-check.yml
**/*.{ps1,psm1,psd1}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ps1,psm1,psd1}: Prepend TLS 1.2 configuration to every PowerShell 5.1 Invoke-WebRequest call and retain -UseBasicParsing.
Validate touched PowerShell files with PowerShell AST parsing; do not skip validation on Linux, and run modified scripts directly with realistic environment variables when practical.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
tests/selfapps_*.ps1

📄 CodeRabbit inference engine (CLAUDE.md)

PowerShell scenario tests belong in tests/selfapps_<scenario>.ps1; wire new scenarios into tests/harness.ps1 and the CI workflow.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
**/*.ps1

📄 CodeRabbit inference engine (CLAUDE.md)

Parse-check PowerShell scripts with PowerShell's parser; do not use PSGallery downloads for validation.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
🧠 Learnings (1)
📚 Learning: 2026-08-01T02:27:53.952Z
Learnt from: mixmansoundude
Repo: mixmansoundude/Python_vs_Windows PR: 408
File: docs/agent-closed-backlog.md:0-0
Timestamp: 2026-08-01T02:27:53.952Z
Learning: In the documentation files describing the removed UNC warning check in `run_setup.bat`, state only verified behavior: the check emitted `[WARN] UNC paths not supported` for an ordinary local path and was removed because the separate UNC-prefix guard already handles UNC detection. Do not assert the exact `findstr` or cmd.exe backslash-parsing mechanism, since it was not independently verified.

Applied to files:

  • docs/agent-closed-backlog.md
🔇 Additional comments (9)
docs/prd-conda-native-dll-bundling.md (1)

6-7: LGTM!

docs/open-questions.md (1)

14-15: LGTM!

run_setup.bat (1)

898-905: LGTM!

Also applies to: 933-955, 961-972, 1935-1943

docs/agent-closed-backlog.md (1)

1163-1231: LGTM!

tests/selfapps_cascade_conda_create_fail.ps1 (3)

1-66: LGTM!


67-258: LGTM!


1-259: 📐 Maintainability & Code Quality

No tests/harness.ps1 change is required. The harness consumes NDJSON rows; it does not invoke individual selfapps_*.ps1 files. Both create_fails and missing_python are invoked by separate CI steps, and this file emits self.cascade.conda_create_fail.

			> Likely an incorrect or invalid review comment.
docs/agent-ndjson.md (1)

480-550: LGTM!

.github/workflows/batch-check.yml (1)

784-796: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved setup recovery when Conda environment creation fails.
    • Preserves the last working build instead of leaving setup with a broken interpreter.
    • Handles environments created without a usable Python executable.
  • Tests

    • Added regression coverage for repeated Conda failures and missing interpreters.
    • Added non-blocking CI validation for these recovery scenarios.
  • Documentation

    • Added planning and decision documentation for resolving Conda native-DLL bundling issues in packaged applications.

Walkthrough

The setup script preserves the prior working interpreter when Conda creation fails during cascade re-entry. A Windows regression test covers failed creation and missing python.exe scenarios, records NDJSON evidence, and runs in non-gating uv workflow steps. Documentation also defines a deferred Conda native-DLL repair loop.

Changes

Conda cascade recovery

Layer / File(s) Summary
Preserve the working build after Conda failure
run_setup.bat, docs/agent-closed-backlog.md, CLAUDE.md
Cascade re-entry routes exhausted Conda failures and missing-interpreter results to recovery without replacing the prior working build. The completed backlog item is archived.
Validate and register cascade failure recovery
tests/selfapps_cascade_conda_create_fail.ps1, docs/agent-ndjson.md, .github/workflows/batch-check.yml
The regression test covers both scenarios, validates routing, restoration, status, exit codes, and failure signatures, writes NDJSON evidence, and runs in two non-gating uv steps.

Conda native-DLL packaging planning

Layer / File(s) Summary
Define the native-DLL repair proposal
docs/prd-conda-native-dll-bundling.md
The draft PRD describes pygrib/eccodes packaging failures, hook verification, a bounded Conda DLL repair loop, scope, requirements, and unresolved implementation choices.
Record native-DLL backlog decisions
docs/agent-cold-storage.md, docs/open-questions.md
The documentation records the deferred repair-loop backlog item and the decision between narrow eccodes.dll handling and generic unresolved-DLL matching.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SelfTest
  participant run_setup_bat
  participant Conda
  participant BootstrapState
  SelfTest->>run_setup_bat: start cascade failure scenario
  run_setup_bat->>Conda: create environment
  Conda-->>run_setup_bat: fail creation or omit python.exe
  run_setup_bat->>BootstrapState: restore prior uv build
  BootstrapState-->>SelfTest: state=ok and recovery evidence
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the conda-create cascade-restore fix and references the resolved backlog item.
Description check ✅ Passed The description accurately explains the cascade failure, implementation, regression tests, documentation updates, and pending CI validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/bootstrapper-execution-branches-ox2izi

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
run_setup.bat (1)

960-967: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add coverage for the cascade missing-interpreter branch.

tests/selfapps_cascade_conda_create_fail.ps1 forces conda creation to fail before :conda_create_done; it does not exercise the successful-create path with a missing python.exe. Add a post-create test hook and assert the cascade recovery result in NDJSON.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@run_setup.bat` around lines 960 - 967, Add a post-create test hook that
simulates a successful conda creation while leaving python.exe missing, then
exercise the missing-interpreter branch in the cascade flow around
HP_CASCADE_SAVED_PY and :cascade_conda_create_failed. Extend
tests/selfapps_cascade_conda_create_fail.ps1 to assert the expected cascade
recovery result in NDJSON.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@run_setup.bat`:
- Around line 960-967: Add a post-create test hook that simulates a successful
conda creation while leaving python.exe missing, then exercise the
missing-interpreter branch in the cascade flow around HP_CASCADE_SAVED_PY and
:cascade_conda_create_failed. Extend
tests/selfapps_cascade_conda_create_fail.ps1 to assert the expected cascade
recovery result in NDJSON.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 52af74c2-7a8b-4b51-b564-497950b0ca3e

📥 Commits

Reviewing files that changed from the base of the PR and between c92e426 and 5ea53f9.

📒 Files selected for processing (6)
  • .github/workflows/batch-check.yml
  • CLAUDE.md
  • docs/agent-closed-backlog.md
  • docs/agent-ndjson.md
  • run_setup.bat
  • tests/selfapps_cascade_conda_create_fail.ps1
💤 Files with no reviewable changes (1)
  • CLAUDE.md
📜 Review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: auto_merge
  • GitHub Check: Batch syntax/run check (contract-uv-fail)
  • GitHub Check: Batch syntax/run check (uv)
  • GitHub Check: Batch syntax/run check (cache)
  • GitHub Check: Batch syntax/run check (justme-test)
  • GitHub Check: Batch syntax/run check (real)
  • GitHub Check: Batch syntax/run check (contract-uv)
  • GitHub Check: Batch syntax/run check (uv-dl-fallback)
  • GitHub Check: Batch syntax/run check (conda-full)
🧰 Additional context used
📓 Path-based instructions (11)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

The single-bootstrapper directive requires run_setup.bat to work when dropped next to the application without committed helper files; test-only helpers may live under tests/ but cannot be required by the real flow.

When a change teaches or invalidates a lesson, update the relevant knowledge document in the same commit; update existing entries rather than only appending.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
  • docs/agent-ndjson.md
  • run_setup.bat
  • docs/agent-closed-backlog.md
**/*.{ps1,psm1,psd1}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ps1,psm1,psd1}: Prepend TLS 1.2 configuration to every PowerShell 5.1 Invoke-WebRequest call and retain -UseBasicParsing.
Validate touched PowerShell files with PowerShell AST parsing; do not skip validation on Linux, and run modified scripts directly with realistic environment variables when practical.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
**/*.{bat,cmd,ps1,py,yml,yaml,json}

📄 CodeRabbit inference engine (AGENTS.md)

Run delimiter and repository-specific syntax regression checks using tools/check_delimiters.py, respecting comments, escapes, and here-strings as applicable.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
  • run_setup.bat
**/*.{py,ps1,psm1,psd1,yml,yaml,json,bat,cmd}

📄 CodeRabbit inference engine (AGENTS.md)

Keep source text ASCII plain text and avoid non-ASCII punctuation.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
  • run_setup.bat
**/*.{bat,ps1}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{bat,ps1}: Use CRLF line endings for .bat and .ps1 files; use LF for other files, as controlled by .gitattributes.
Use ASCII-only content in Windows batch and PowerShell scripts; avoid emojis, curly quotes, em-dashes, and other non-ASCII characters.
Escape or quote Windows batch special characters correctly; in particular, double % as %% inside for loops.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
  • run_setup.bat
**/*.{py,ps1}

📄 CodeRabbit inference engine (CLAUDE.md)

Place non-trivial standalone helper logic in tools/ rather than embedding it inline in YAML, batch, or PowerShell files.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
tests/selfapps_*.ps1

📄 CodeRabbit inference engine (CLAUDE.md)

Add PowerShell scenario tests as tests/selfapps_<scenario>.ps1 and wire new scenarios into tests/harness.ps1 and the CI workflow.

Files:

  • tests/selfapps_cascade_conda_create_fail.ps1
**/*.{md,txt}

📄 CodeRabbit inference engine (AGENTS.md)

When documenting run_setup.bat, cite labels or subroutine names rather than exact line numbers unless a line number provides immediate value for the introducing commit.

Files:

  • docs/agent-ndjson.md
  • docs/agent-closed-backlog.md
run_setup.bat

📄 CodeRabbit inference engine (AGENTS.md)

run_setup.bat: Every branch added to run_setup.bat or related helpers must have a CI test, including feature flags, fallback and recovery paths, and fast versus full paths; add an NDJSON assertion and a dedicated lane or HP_* flag when necessary.
All embedded helpers must remain base64 payloads under :define_helper_payloads; changing a payload requires updating the matching HP_* line from its canonical tools/ source.
Do not remove tilde prefixes from runtime artifact files such as ~bootstrap.status.json, ~setup.log, ~environment.lock.txt, and ~env.state.json.
Treat unknown ~env.state.json schemas as stale and trigger a full rebuild rather than reporting an error.
Update [VERSION_METADATA] after CI verifies a newer Windows, PowerShell, or Python environment, including the verification date and current versions.

run_setup.bat: Keep run_setup.bat self-contained: do not add committed helper files; embed helper payloads under :define_helper_payloads, and refresh them with python tools/sync_payload.py rather than hand-encoding them.
Run python tools/check_delimiters.py run_setup.bat after every edit to run_setup.bat.
Every bootstrap run must write ~bootstrap.status.json with state ok, no_python_files, or error, plus exitCode and pyFiles fields.
Include --override-channels -c conda-forge on every conda installation command.
Invoke every conda command as call "%CONDA_BAT%" ... so the parent batch process continues correctly.
Avoid EnableDelayedExpansion; if it is necessary, scope it as tightly as possible.
Use tilde-prefixed temporary files such as ~setup.log and ~bootstrap.status.json.
Do not depend on console scripts during bootstrap; anchor tool execution to an explicit interpreter such as %HP_PY% or %CONDA_PREFIX%\python.exe.
Invoke pipreqs as python -m pipreqs.pipreqs, not through the pipreqs console script, and preserve a comment explaining the deterministic execution rationale.
Do not upgrade the pipr...

Files:

  • run_setup.bat
**/*.{bat,cmd}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{bat,cmd}: For batch assignments use set "VAR=value", never set VAR="value"; quote %VAR% at every filesystem call site, except NSIS /D= parameters, which must remain /D=%VAR%.
Before system-wide installation, silently check elevation with fsutil dirty query %systemdrive% >nul 2>&1; on failure, skip the system-wide path and fall back to per-user installation.
Avoid EnableDelayedExpansion unless it is strictly scoped, and disable it afterward; use careful quoting and escaping rather than silencing errors.
Use tools/sync_payload.py as the only sanctioned method for re-encoding embedded HP_* payload lines after editing canonical helper sources; run delimiter checks after payload changes.

Files:

  • run_setup.bat
**/.github/workflows/*.{yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

**/.github/workflows/*.{yml,yaml}: Use GitHub Actions CI results, especially Job Summary, grouped log tails, and workflow PR failure comments, as the source of truth; local runs are advisory.
Isolate slow, flaky, or environment-dependent diagnostics in separate non-gating lanes using continue-on-error rather than weakening deterministic gating lanes.
Keep CI parser checks synchronized with exact bootstrapper messages and preserve the single parser-facing iterate signal * Iterate logs: {found|missing}.
The iterate job must upload one artifact named iterate-logs-${run_id}-${run_attempt} containing iterate/_temp/ and the job summary; do not alter the intentional pre-flight gate failure for missing NDJSON inputs.

Files:

  • .github/workflows/batch-check.yml
🧠 Learnings (1)
📚 Learning: 2026-08-01T02:27:53.952Z
Learnt from: mixmansoundude
Repo: mixmansoundude/Python_vs_Windows PR: 408
File: docs/agent-closed-backlog.md:0-0
Timestamp: 2026-08-01T02:27:53.952Z
Learning: In the documentation files describing the removed UNC warning check in `run_setup.bat`, state only verified behavior: the check emitted `[WARN] UNC paths not supported` for an ordinary local path and was removed because the separate UNC-prefix guard already handles UNC detection. Do not assert the exact `findstr` or cmd.exe backslash-parsing mechanism, since it was not independently verified.

Applied to files:

  • docs/agent-closed-backlog.md
🪛 Blinter (1.0.113)
run_setup.bat

[error] 933-933: Automatic restart without failure limits. Explanation: Unlimited restart attempts can mask security issues or resource exhaustion. Recommendation: Implement maximum restart attempts (3-5) with exponential backoff. Context: Restart logic should have failure attempt limits

(SEC016)

🪛 PSScriptAnalyzer (1.25.0)
tests/selfapps_cascade_conda_create_fail.ps1

[warning] 173-173: Empty catch block is used. Please use Write-Error or throw statements in catch blocks.

(PSAvoidUsingEmptyCatchBlock)

🔇 Additional comments (5)
run_setup.bat (1)

898-905: LGTM!

Also applies to: 933-955, 1928-1936

docs/agent-closed-backlog.md (1)

1163-1215: LGTM!

tests/selfapps_cascade_conda_create_fail.ps1 (1)

1-210: LGTM!

docs/agent-ndjson.md (1)

51-51: LGTM!

Also applies to: 480-527

.github/workflows/batch-check.yml (1)

771-783: LGTM!

Drafts docs/prd-conda-native-dll-bundling.md for the eccodes.dll/pygrib
gap (the one remaining self.layered_e2e.chain blocker): researches
--collect-binaries vs explicit --add-binary, finds pyinstaller-hooks-contrib
already ships a gribapi hook of uncertain applicability, and proposes
reusing :hidden_import_recover's reactive/bounded-loop shape gated to the
conda provider. Cold-storages it pending the owner explicitly bringing it
forward, and files the narrow-vs-general repair-loop scope question in
docs/open-questions.md for a maintainer call.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A4iE1BRSkUETwz237XeuTW

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/prd-conda-native-dll-bundling.md`:
- Around line 3-7: Replace “cold-storaged” with “stored in cold storage” in the
status description of docs/prd-conda-native-dll-bundling.md (lines 3-7) and the
open-question context in docs/open-questions.md (lines 14-16); make no other
changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f4fadfb1-c874-48ba-a6c4-58d03a99a104

📥 Commits

Reviewing files that changed from the base of the PR and between 5ea53f9 and 4539674.

📒 Files selected for processing (3)
  • docs/agent-cold-storage.md
  • docs/open-questions.md
  • docs/prd-conda-native-dll-bundling.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

The single-bootstrapper directive requires run_setup.bat to work when dropped next to the application without committed helper files; test-only helpers may live under tests/ but cannot be required by the real flow.

Files:

  • docs/agent-cold-storage.md
  • docs/open-questions.md
  • docs/prd-conda-native-dll-bundling.md
**/*.{md,txt}

📄 CodeRabbit inference engine (AGENTS.md)

When documenting run_setup.bat, cite labels or subroutine names rather than exact line numbers unless a line number provides immediate value for the introducing commit.

Files:

  • docs/agent-cold-storage.md
  • docs/open-questions.md
  • docs/prd-conda-native-dll-bundling.md
docs/agent-*.md

📄 CodeRabbit inference engine (CLAUDE.md)

When a change teaches or invalidates a lesson, update the relevant knowledge document in the same commit; edit existing entries rather than only appending. Move fully resolved Active Backlog items to docs/agent-closed-backlog.md.

Files:

  • docs/agent-cold-storage.md
**/*.{bat,ps1,py,yml,json,md}

📄 CodeRabbit inference engine (CLAUDE.md)

Use ASCII-only content; avoid emojis, curly quotes, em-dashes, and other non-ASCII characters because batch/CMD parsing can break.

Files:

  • docs/agent-cold-storage.md
  • docs/open-questions.md
  • docs/prd-conda-native-dll-bundling.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: mixmansoundude/Python_vs_Windows

Timestamp: 2026-08-04T08:14:12.350Z
Learning: Do not duplicate content from README.md, AGENTS.md, or CONTRIBUTING.md; reference those authoritative sources instead.
Learnt from: CR
Repo: mixmansoundude/Python_vs_Windows

Timestamp: 2026-08-04T08:14:12.350Z
Learning: For each iteration loop, freeze scope, fix CI before test failures and product code, verify no false positives, implement exactly one missing feature slice, and add exactly one missing test.
🪛 LanguageTool
docs/open-questions.md

[style] ~24-~24: Consider an alternative for the overused word “exactly”.
Context: ... out of the warning text -- but this is exactly the kind of proportionality judgment `d...

(EXACTLY_PRECISELY)

docs/prd-conda-native-dll-bundling.md

[grammar] ~6-~6: Ensure spelling is correct
Context: ...the discovery trail). Deliberately cold-storaged after this draft, not scheduled -- see ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~214-~214: Consider an alternative for the overused word “exactly”.
Context: ...er building it narrow" -- but this is exactly the kind of proportionality judgment ...

(EXACTLY_PRECISELY)

🔇 Additional comments (3)
docs/prd-conda-native-dll-bundling.md (1)

1-2: LGTM!

Also applies to: 8-11, 13-44, 46-58, 60-71, 73-113, 115-158, 160-181, 182-200, 202-227

docs/agent-cold-storage.md (1)

117-139: LGTM!

docs/open-questions.md (1)

12-13: LGTM!

Also applies to: 17-29

Comment thread docs/prd-conda-native-dll-bundling.md
Extends tests/selfapps_cascade_conda_create_fail.ps1 with a missing_python
scenario (CASCADE_CCF_SCENARIO env var) exercising the fix's other call
site: a genuine conda-create success followed by a genuinely missing
python.exe, via new hook HP_TEST_FORCE_CONDA_MISSING_PYTHON. Closes a
CodeRabbit review finding on PR #413 that the original test only covered
:conda_create_failed's own call site. Wires a second CI step and updates
docs/agent-ndjson.md and docs/agent-closed-backlog.md's Item 23 entry
accordingly.

Also applies a CodeRabbit wording nit ("cold-storaged" -> "stored in cold
storage") in the Item 24 PRD and open-questions.md from the prior commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A4iE1BRSkUETwz237XeuTW

Copy link
Copy Markdown
Owner Author

Follow-up on the two review annotations not addressed by the latest commit's missing_python scenario:

Blinter SEC016 at run_setup.bat:933 ("Automatic restart without failure limits"): false positive. That line is inside the REQ-022 retry-once idiom (docs/agent-lessons-learned.md's "REQ-013 connectivity check needed the REQ-022 retry idiom too" entry documents the same bounded pattern elsewhere) -- exactly one retry after a 15s wait, no loop back to the initial attempt. Confirmed by re-reading the surrounding block: there's no goto anywhere in :conda_create_check_transient/:conda_create_retry_forced_fail/:conda_create_failed that returns to the first attempt. Not changing.

PSScriptAnalyzer PSAvoidUsingEmptyCatchBlock at tests/selfapps_cascade_conda_create_fail.ps1:173: matches an established, repeated convention in this test suite -- the identical } catch { } (silently treating an unparseable ~bootstrap.status.json as $null state/exitCode, which the pass predicate already handles via exact-match comparisons) appears in selfapps_cascade.ps1 (the direct template this test was modeled on) and 4 other selfapps_*.ps1/selftest.ps1 files. Fixing only this file would be inconsistent with the rest of the suite rather than a real improvement. Not changing.

Also just pushed a missing_python scenario closing the earlier "add coverage for the cascade missing-interpreter branch" finding, and applied the cold-storaged -> stored in cold storage wording fix on the docs-only commit.


Generated by Claude Code

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