You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: TASK-005 review F-A — attribute config provenance to env-file vs shell env
Review of `doctor config` found values set in the workspace env file
(.teaagent/env) were mislabeled `env:VAR`, indistinguishable from a real shell
var — defeating the feature's purpose (accurate provenance) for exactly the
"hidden config source" case it exists to surface.
Fix: resolve_config_provenance now snapshots the shell env before loading the
env file and parses the file's exports, so it can attribute each env-layer value
to `env:VAR` (shell) or `env-file:.teaagent/env` (file). A var set in both is
attributed to the shell, which wins (the file never overwrites the shell).
Refactored _load_env_file to share a pure _parse_env_file_exports helper.
- teaagent/ergonomics/workspace_defaults.py: _parse_env_file_exports +
env-file/shell attribution in resolve_config_provenance.
- doctor_config: precedence list + note mention env-file.
- Test: env-file value -> env-file source; same key in shell -> shell wins.
- docs/cli.md + spec updated.
Residuals documented, not fixed (review F-C/F-D): automation_webhook_url is not
redacted (could embed a token; consistent with existing redaction policy); a
malformed numeric env var raises in resolve_config_provenance and
load_workspace_defaults (pre-existing, unchanged).
Constraint: provenance labeling only; load_workspace_defaults output unchanged (same values, same precedence); _load_env_file behavior unchanged (now via shared parser).
Tested: tests/test_workspace_defaults_toml.py 23 passed (incl. new env-file attribution test); mypy clean; doctor config smoke shows env-file vs env: correctly.
Not-tested: full suite not run on 3.12 (hypothesis missing in 3.14 sandbox).
Confidence: high
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments