Private
Public Access
feat(directives): add 15 engagement-specific directives + tags.toml entries
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# scripts_namespace_isolated
|
||||
|
||||
## v1
|
||||
|
||||
**Why this iteration:** New rule, no prior source. Encodes the existing project practice (scripts do not cross-import) as an explicit directive.
|
||||
**Source:** new rule (pattern inferred from existing `scripts/` structure)
|
||||
|
||||
---
|
||||
**Lifted:** 2026-07-05
|
||||
@@ -0,0 +1,23 @@
|
||||
# Scripts are namespace-isolated by directory — no `from scripts.foo import bar` across script dirs
|
||||
|
||||
## What it says
|
||||
|
||||
Script directories (`scripts/`, `scripts/tier2/`, `scripts/audit/`, `scripts/tier2/artifacts/`) are namespace-isolated. A script in one directory MUST NOT import from a script in another directory. Scripts are not a package; they are standalone tools.
|
||||
|
||||
## Why
|
||||
|
||||
Scripts are throw-away or single-purpose tools. If `scripts/audit_weak_types.py` imports from `scripts/tier2/failcount.py`, then `audit_weak_types.py` depends on the tier2 sandbox's internal state. The dependency makes the audit script fragile (it breaks if tier2 moves) and the tier2 scripts less isolated (they are now part of a graph, not standalone).
|
||||
|
||||
## The pattern
|
||||
|
||||
```python
|
||||
# WRONG: cross-directory import
|
||||
from scripts.tier2.failcount import should_give_up
|
||||
|
||||
# RIGHT: copy the needed function into the script, or factor it into src/
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- `conductor/directives/file_naming_convention` — the file naming rules
|
||||
- `conductor/directives/large_files_are_fine` — large files are fine; do not split for modularity
|
||||
Reference in New Issue
Block a user