Repository navigation
docs: the published scoring formula stopped being the one the code uses - #28
Conversation
`README.md` and `ARCHITECTURE.md` both showed
score = (frequency × 0.4) + (recency × 0.4) + (context × 0.2)
which survived two releases past the point of being true: through the fix
that normalised frequency (that formula's central defect) and through the
feature that added prefix and picks. Anyone reading it to understand why a
result ranked where it did was reading a description of code that no longer
exists.
Also corrected: `vars.json` is described as the variable store, when it now
only records which variables exist and the values are in the Keychain; and
ARCHITECTURE's decision index stopped at ADR-004 while eleven exist.
Nothing detects prose going stale, so the parts that can be mechanical now
are:
- every ADR must be linked from the decision index;
- no link to `docs/decisions/` may be broken;
- the published formula must name every `W_*` weight in `mem.ranking`,
derived from the module rather than a hard-coded list, so a sixth feature
fails this test until it is written down.
The last one needed a second attempt. Bounding the check to a fixed
400-character window reached past the formula into the bullet list beneath
it, so deleting a term from the formula still passed — the term was named in
the surrounding prose. It is now bounded at the first blank line, and
verified by deleting a term and watching it fail.
The privacy list promises plain-text storage; variable values are now deliberately not plain text. Both are true and the exception is the point — "readable with cat" is the wrong property for a password — but a reader hitting the two claims in sequence has no way to know that without being told.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6e5fa7176
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| formula = self._formula_in(REPO_ROOT / name) | ||
| unmentioned = [f for f in features if f not in formula] |
There was a problem hiding this comment.
Verify formula coefficients, not only feature names
When a later ranking change alters a weight without renaming its W_* constant, this check still passes as long as the feature name remains in the formula; for example, changing W_PICKS from 0.40 to 0.30 would leave both documents publishing the obsolete coefficient. Since this test is intended to prevent the published formula from diverging from the code, it also needs to compare the documented numeric weights with the constants.
Useful? React with 👍 / 👎.
| path.name | ||
| for path in sorted((REPO_ROOT / "docs" / "decisions").glob("*.md")) | ||
| if path.name not in index |
There was a problem hiding this comment.
Restrict the ADR check to decision-index links
Checking whether the filename occurs anywhere in ARCHITECTURE.md does not prove that it is linked from the decision index. This already produces a false negative for ADR-010: its filename also appears in the variable-store section, so removing its new index entry would still leave this test green. Parse the decision-index links, or at least require the filename in that section's Markdown link targets.
Useful? React with 👍 / 👎.
README.mdandARCHITECTURE.mdboth publishedwhich survived two releases past the point of being true — through the fix that normalised frequency (that formula's central defect:
frequencywas a raw count against terms bounded by 1) and through the feature that added prefix and picks.Anyone reading it to understand why a result ranked where it did was reading a description of code that no longer exists. That is worse than no documentation.
Also corrected:
vars.jsonwas described as the variable store; it now only records which variables exist, with the values in the Keychain.Making the mechanical parts mechanical
Nothing detects prose going stale. Three checks that can be automated now are:
docs/decisions/is broken;W_*weight inmem.ranking— derived from the module rather than a hard-coded list, so adding a sixth feature fails this test until someone writes it down.The check needed a second attempt
Bounding it to a fixed 400-character window reached past the formula into the bullet list beneath it, so deleting a term from the formula still passed — the term was still named in the surrounding prose. A test that cannot fail is worse than no test, and this one was verified the only way that means anything: by deleting a term and watching it go red.
It is now bounded at the first blank line after
score =.1358 passed.