Remove BDD process-global state (#492) - #580
Conversation
Keep BDD manifest, IR and configuration scenarios in process without mutating the harness environment or working directory. Resolve test manifest paths absolutely and use the CLI directory for explicit relative configuration paths, retaining the existing assertions and configuration precedence coverage.
|
Warning Your free Security trial is over. An organization admin can activate billing to continue. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
💤 Files with no reviewable changes (1)
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. Summary
WalkthroughResolve relative configuration paths against the CLI directory. Remove process-global working-directory mutation and related guards from BDD fixtures and steps. Add coverage for relative configuration discovery. ChangesConfiguration discovery and BDD state handling
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 16 | ❌ 4❌ Failed checks (4 warnings)
✅ Passed checks (16 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideRemoves the remaining process-global environment and CWD guarding from BDD test infrastructure by relying on explicit paths and the CLI Flow diagram for explicit configuration discovery with -Cflowchart TD
A[CLI with directory and config path] --> B{path.is_relative}
B -->|yes and directory set| C[directory.join path]
B -->|no or directory unset| D[path.to_path_buf]
C --> E[load_layers_from_path_with_warning]
D --> E
E --> F[Explicit FileLayerTrace with effective path]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7125e89296
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let effective_path = cli | ||
| .directory | ||
| .as_deref() | ||
| .filter(|_| path.is_relative()) | ||
| .map_or_else(|| path.to_path_buf(), |directory| directory.join(path)); |
There was a problem hiding this comment.
Keep explicit config paths anchored to the process CWD
When -C/--directory is combined with a relative --config (or relative NETSUKE_CONFIG), this now resolves the selector beneath the project directory rather than the invoking shell's working directory. That contradicts the public contract in docs/users-guide.md:896-897 and the design invariant in docs/netsuke-design.md:3117-3120, and can silently load a same-named project config instead of the explicitly selected file; keep the resolved selector path unchanged while continuing to use cli.directory only for automatic project discovery.
Useful? React with 👍 / 👎.
Keep relative --config and NETSUKE_CONFIG selectors anchored to the invoking process working directory when -C is present. BDD scenarios now pass their temporary config paths as completed argument tokens instead of relying on the removed process CWD mutation.
Record the Route A child-process and Route B injected-environment boundaries, and remove obsolete TestWorld CWD-lock documentation. Add fixed and generated child-process regression coverage proving that relative --config and NETSUKE_CONFIG selectors remain anchored to the invoking working directory when -C is supplied.
Summary
This branch removes the last process-global environment and working-directory
coordination from
rstest-bddscenarios. It retains in-process assertions viainjected seams, preserves process-CWD semantics for explicit relative
configuration selectors, and removes BDD scenario serialization.
Closes #492.
Routing inventory
netsukecommand scenariosassert_cmdbuilds a child withenv_clear()and forwards only scenario-tracked variables.Cli,Manifest,BuildGraphor render assertions require the injected environment boundary.-Cor absolute manifest paths remove the need for a process CWD change.Review walkthrough
chdir.--configandNETSUKE_CONFIGremain process-CWD-relative under-C.Validation
make markdownlint: passed.make check-fmt: passed.make lint: passed, including Rustdoc, Clippy and Whitaker.make test: passed — 2,317 tests, 3 skipped, plus doctests.coderabbit review --agent: completed with zero comments after each milestone.References