docs(6209): calibration stamp, after-write hook, usage seam, work log, duplicates, skill structure, tuning and rulebook routes, kind surface, prompt filter, moments, strict args, auth, lesson write path
Fourteen more test files: docstrings state the failure each guard defends as a present-tense shape instead of the incident that found it, and issue, milestone and rule numbers leave comments and assertion messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -108,16 +108,15 @@ def test_every_registered_tool_is_classified_exactly_once():
|
||||
"""Every tool must be declared a read, a write, or a read-shaped write.
|
||||
|
||||
`_READ_ONLY_TOOLS` is hand-maintained, and default-deny means a read
|
||||
omitted from it fails CLOSED — safe, but silent. That is how a read key
|
||||
ended up able to `get_note` and not `get_snippet` (#2496), and how
|
||||
`rules_due_for_verification` and `rule_history` sat denied (#3191).
|
||||
omitted from it fails CLOSED — safe, but silent: a read key able to
|
||||
`get_note` and not `get_snippet`.
|
||||
|
||||
The fix keeps the DECISION explicit and derives the CANDIDATES. Deriving
|
||||
So the DECISION stays explicit and the CANDIDATES are derived. Deriving
|
||||
the decision would make a security boundary follow a naming convention, so
|
||||
any future `get_*` grants itself access. This test used to derive
|
||||
candidates from names too — tools starting `get_`, `list_`, `search`… — and
|
||||
that narrowing is exactly what let the two #3191 reads through: neither
|
||||
name looked like a read. So the candidates are now EVERY registered tool.
|
||||
any future `get_*` grants itself access. Deriving the candidates from names
|
||||
— tools starting `get_`, `list_`, `search`… — misses reads whose names do
|
||||
not look like reads (`rules_due_for_verification`, `rule_history`). So the
|
||||
candidates are EVERY registered tool.
|
||||
"""
|
||||
from scribe.mcp.server import (
|
||||
_DELIBERATELY_WRITE_SCOPED, _READ_ONLY_TOOLS, _WRITE_TOOLS,
|
||||
@@ -156,7 +155,7 @@ def test_every_registered_tool_is_classified_exactly_once():
|
||||
|
||||
def test_the_completeness_check_can_fail():
|
||||
"""A guard that cannot fail is indistinguishable from one that is broken
|
||||
(rule 167). Drop a real tool from its set and the check must notice."""
|
||||
Drop a real tool from its set and the check must notice."""
|
||||
from scribe.mcp.server import _READ_ONLY_TOOLS, _WRITE_TOOLS
|
||||
|
||||
registered = _registered_tool_names()
|
||||
|
||||
Reference in New Issue
Block a user