Commit 8969eb7
fix(check_dataset_allowlist): import env_config in both invocation contexts
`autohands check_dataset_allowlist`, newly registered as a CLI verb in #254,
crashed with ModuleNotFoundError when run from a workspace root. The two merges
combined to expose it: #253 added `from autohands.env_config import ...` to this
module, and #254 made it reachable from the dispatcher.
`bin/autohands` (`_python_in_autohands`) runs these tools as scripts with
`autohands/` ITSELF on PYTHONPATH, so siblings are top-level modules — the flat
`from env_config import ...` idiom the other guards here already use. As a
library import (pytest, or anything importing
`autohands.check_dataset_allowlist`) the package's PARENT is on the path and the
flat name does not resolve. Supporting only one form breaks the other, so
`_env_config()` tries flat first and falls back to package-qualified.
Also fixes a quieter instance of the same bug. `_releasing_tokens` wrapped its
import in `except Exception` and returned the hardcoded `{full_datasets,
real_output}` fallback, so under the CLI it swallowed the ImportError and never
consulted ENV_DECLARATION_TOKENS at all — a silent degradation that still
produced a green run, and would have stopped honouring any future releasing
token without failing. The fallback is now a genuine last resort.
Verified in both contexts: the CLI verb runs clean from a workspace root and
still reports the originating defect (exact file, line, resolved path) when that
workspace is reverted to its pre-fix state. Suite 375 passed; firewall gate OK.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F11sMzmaVWfU6NCz1PKVVb1 parent ce51277 commit 8969eb7
2 files changed
Lines changed: 67 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
77 | 100 | | |
78 | 101 | | |
79 | 102 | | |
| |||
82 | 105 | | |
83 | 106 | | |
84 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
85 | 113 | | |
86 | 114 | | |
87 | | - | |
| 115 | + | |
88 | 116 | | |
89 | 117 | | |
90 | 118 | | |
91 | 119 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 120 | + | |
95 | 121 | | |
96 | 122 | | |
97 | 123 | | |
| |||
243 | 269 | | |
244 | 270 | | |
245 | 271 | | |
246 | | - | |
| 272 | + | |
247 | 273 | | |
248 | 274 | | |
249 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
0 commit comments