Skip to content

WIP: Improve path resolution#168

Draft
NejcS wants to merge 10 commits intomainfrom
impr/path-resolution
Draft

WIP: Improve path resolution#168
NejcS wants to merge 10 commits intomainfrom
impr/path-resolution

Conversation

@NejcS
Copy link
Copy Markdown
Contributor

@NejcS NejcS commented Apr 22, 2026

No description provided.

NejcS and others added 10 commits April 21, 2026 11:09
Introduces resolve_path(value, source, cwd, config_dir, spec_dir) and
unit tests. The helper encodes the rule that a relative path's
resolution base is determined by where the value was written (shell,
config file, or built-in default), not by which option key it sets.
Not wired into argument parsing yet.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Records where each argument value came from in args.argument_sources,
so downstream path resolution can anchor relative paths against the
right base (CWD for CLI values, config file's directory for config
values, spec file's directory for defaults). Replaces the previous
default-equality heuristic with a precise set built from a SUPPRESS
defaults pass of the parser. No path-resolution behavior change yet.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
--unittests-script, --conformance-tests-script, and --prepare-environment-script
now resolve CLI-supplied values against CWD and config.yaml values against the
config file's directory. Absolute paths are preserved. The previous
renderer-directory fallback -- a third anchor invisible to users -- is removed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
--base-folder, --build-folder, --conformance-tests-folder, --build-dest,
--conformance-tests-dest, and --template-dir now resolve CLI values
against CWD, config.yaml values against the config file's directory,
and defaults against the spec file's directory. The "output lives next
to the spec" rule means an invocation from a different CWD (typical in
CI) no longer scatters output into the CWD.

Resolution runs before the build-folder/build-dest equality check so
two relative paths that resolve to the same absolute path are caught.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CLI values anchor on CWD, config.yaml values on the config file's
directory, and the default ('logging_config.yaml') now resolves next
to the spec file rather than against CWD.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Removes the always-spec-dir-relative special case for --log-file-name.
CLI values now resolve against CWD, config.yaml values against the
config file's directory, and the default ('codeplain.log') continues
to land next to the spec file.

The --no-log-to-file compatibility check switches from a string
comparison against the default to a provenance check, so a
config-supplied log-file-name is also flagged as inconsistent.

get_log_file_path() is removed -- args.log_file_name is now an
absolute path by the time callers see it, so setup_logging and
dump_crash_logs use it directly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Describe the rule in the parser description and regenerate the CLI
reference. Also drop the now-incorrect "always resolved relative to
the plain file directory" note from --log-file-name.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Splatting a plain dict made mypy infer dict[str, str] and reject it
against ArgumentParser's varied kwarg types.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant