loader: make the working directory transparent, and say what each directory is for #1005
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 311 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.344
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1005"
general
weight: 0.35
ndeloof
What this PR does, in one sentence
It makes explicit, in the loader and in the
ResourceLoadercontract, which directory a file is read from and which directory the paths of its model are resolved against, so that a relative working directory behaves like an absolute one by construction.Context
The loader has used the name "working directory" for two different directories. For the main project they are the same. For an included or extended file they are not: the directory the paths of the model are resolved against is relative to the project including the file, so that the paths are rebased level by level and stay relative when the project is loaded with a relative working directory. Nothing said which one was meant where, nor what a
ResourceLoaderis expected to return fromLoadand to be given inDir, andlocalResourceLoader.abswas only absolute when its directory was. #1004 fixed the case that surfaced (nested includes with a relative working directory, docker/buildx#3099) by makingLoadreturn an absolute path; the underlying confusion was still there.What the PR brings
LoadandDircan be given whatLoadreturned without applying the directory again.includeasksDirfor the reference the loader was given, asextendsalready did, instead of the local fileLoadreturned.ResourceLoadernow documents whatLoadreturns and whatDirtakes and returns.loadYamlFile, the includer,extends,ApplyInclude);absbecomesresolve, and the includer's project directory is that of the local loader instead of a guess from the working directory.Guardrails: no behavior change and no exported signature change — the paths of the model are the same as before for any working directory.
TestWorkingDirectoryIsTransparentpins it: nested includes,project_directory, extends across files and env files, loaded with an empty, a relative and an absolute working directory, must refer to the same files. Docker Compose's own remote loaders (git, OCI) do not follow the documentedDircontract (they return the cache directory, not the directory of the resource); the includer keeps not relying on their answer, as before.🤖 Generated with Claude Code