Explain a filename hygiene score without calling it release approval
Also published in our Blogger archive.
Direct answer
A filename hygiene score is only a compact count of named observations. Define every signal and weight in the code, then print the score together with the fact that it has not evaluated approval. Here, a root README, a license filename, and a test_ basename each contribute one point. A caller can see exactly why the value is three instead of treating it as a predictive release label.
The useful edge case is a project with a high score but no runtime evidence. A directory can contain all three names while tests fail, dependencies are unresolved, or deployment credentials are absent. The second assertion checks the configured weights, not product quality. Keeping those meanings separate makes a later policy review possible.
This example uses a synthetic set rather than walking a real repository. It does not discover nested files, validate license text, execute tests, or decide a threshold. If a team wants a gate, keep that decision in a separate policy that consumes these transparent signals.
Complete example
from pathlib import Path
signals = {"README.md", "LICENSE", "tests/test_api.py"}
weights = {"README.md": 1, "LICENSE": 1, "test-name": 1}
score = int("README.md" in signals) + int("LICENSE" in signals)
score += int(any(Path(name).name.startswith("test_") for name in signals))
assert score == 3
assert score == sum(weights.values())
print("score=3 approval=not-determined")
Expected stdout:
score=3 approval=not-determined
Sources
Prepared with AI assistance. The example uses synthetic data; its stated limits apply.