types: resolve the environment of pre_start hooks #938
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.33) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 139 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.296
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #938"
general
weight: 0.35
glours
What this PR does, in one sentence
pre_starthooks now get theirenv_fileentries loaded into their environment, the same way services do.Context
A hook inherits the service's container specification at load time,
env_fileandenvironmentincluded, merged with whatever the hook declares itself. But only the service's ownenv_fileentries were ever read: the hook kept them as raw, unused file references. A service usingenv_file: .envtherefore ran itspre_starthook without any of those variables (docker/compose#14287), whiledocker compose configshowed anenv_fileon the hook and noenvironment.What the PR brings
WithServicesEnvironmentResolvedresolves each hook exactly like a service:env_fileentries are loaded, then overridden by the hook's mergedenvironment. The hook therefore ends up with the service's variables plus its own declarations, its own winning on conflicts.Hooks that declare and inherit no environment are left untouched, so the model of existing projects does not change.
🤖 Generated with Claude Code