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
{{ message }}
Repository navigation
[audit] 17 core/ modules import os or pathlib (core must be zero-I/O) #560
17 modules under mcp_server/core/ import os or pathlib. The layer rule forbids it: core is zero-I/O business logic and bans os/pathlib even though they are stdlib (docs/module-inventory.md:77-86, docs/agent-guidance.md § Code Style).
All 17 are grandfathered as layer-violation entries in .craftsmanship-baseline.json, so CI passes, but the debt is real:
Most are environment-variable reads (feature flags, ablation switches, tuning constants) evaluated inside core; the wiki modules touch the filesystem.
Evidence required to close
python scripts/check_craftsmanship.py passes with the 17 os/pathlib layer-violation entries pruned from .craftsmanship-baseline.json, and the full test suite plus benchmarks/reproduce.sh --no-regression show no change in behavior.
Suggested remedy
Read the environment and the filesystem at the boundary (handlers or infrastructure, e.g. infrastructure/memory_config.py) and pass the resolved values into core as arguments or a frozen settings object. Moving the os.environ reads into shared/ would satisfy the import whitelist while keeping I/O on core's call path, so it is not an acceptable fix. Can land in several PRs (retrieval flags, ablation, wiki filesystem), each pruning its own baseline entries.
Reopened: the squash commit of #569 (872855f) carried a closing keyword from one of its commits. Two of the three PRs are merged, #564 (2 modules) and #569 (6 modules). The remaining 9 modules (ablation.py and the retrieval env-flag modules) are in #568, which closes this issue when it merges. Its no-regression benchmark is running now.
Activity
fix(core): remove os/pathlib from ablation.py and 8 retrieval env-fla…
fix(ci): wire the reranker filesystem seam before CI's bare preload c…
fix(core): remove pathlib from abstention_gate and codebase_graph (#560)
fix(core): wiki_axis_registry get_registry raises on an unwired seam
fix(core): remove pathlib from abstention_gate and codebase_graph (#560…
wip(core): remove os/pathlib from wiki_groomer/file_doc_skeleton/drif…
fix(core): remove os/pathlib from wiki_coverage.py, last of #560's 17…
fix(core): wiki_axis_registry get_registry raises on an unwired seam
fix(core): one composition root wires every #560 seam at every entry …
cdeust commentedon Sep 15, 2026
Reopened: the squash commit of #569 (872855f) carried a closing keyword from one of its commits. Two of the three PRs are merged, #564 (2 modules) and #569 (6 modules). The remaining 9 modules (ablation.py and the retrieval env-flag modules) are in #568, which closes this issue when it merges. Its no-regression benchmark is running now.
fix(core): remove os/pathlib from ablation.py and 8 retrieval env-fla…
test(ablation): the runner wiring test needs psycopg, like the runner (…
release: 4.22.0 (#570)
fix(core): remove os/pathlib from wiki_coverage cluster (cdeust#560, …
fix(core): remove os/pathlib from ablation.py and 8 retrieval env-fla…
test(scope): align the suite with project-scoped team decisions
fix: keep team decisions scoped to their project (#613)
fix(devcontainer): wire the composition root before the FlashRank pre…
fixup! fix(tests): reranker cache-path tests compare paths, not strin…
fix(tests): reranker cache-path tests compare paths, not strings (#692)…