A voice assistant's script passed the DisciplinedPython checker yet held
every power in one 300-line main of nested functions and threads. Dan's
review, refactoring it: no bespoke wrappers or fallible calls in
_script_io; main only wires; a class, not a function returning
functions; powers in __ attributes; designation bound to authority once;
asyncio, not threads; top-level imports bring data, not powers.
Generated-by: Claude Opus 5.5
From reworking toybox's tests: a port or a path, joined to a fetch or fs
the code holds anyway, reaches more than the one resource, so hand out
the object bound to it (a toybox's sockets; a tree rooted at a
directory, as openat reaches it). Swiss numbers belong at the boundary
that can't carry references. A test's I/O is set up once, as a promise
each test awaits, and each helper gets only the powers it uses.
Generated-by: Claude Opus 5.5
Logging is an operational side effect, not output, so tests check
stdout and return values, never log records. This follows from the
style guide's choice to call logging directly rather than inject it.
Moved here from py-doctest, where it was orthogonal.
The checker flags sqlite3.connect(':memory:'), which isn't I/O. Note
it beside "treat each finding as a bug" until the checker learns the
exemption.
Generated-by: Claude Opus 5.5
Python can't enforce a capability boundary, so attenuation that lives
mostly in names is par for the course in a script; robustness against
adversaries means leaving Python.
Generated-by: Claude Opus 5.5
Trigger on any Python script work, and link the awesome-ocap style guide,
attenuation notes, and disciplined_python_check.py, so conventions such as
logging.info for status come from the guide rather than being invented.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Name the skill for what triggers it. Cite Wikipedia on capability-based
security and ambient authority, and point newcomers to awesome-ocap.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>