Henry Kobutra
← All notes
Companion material

decision review

Decision and review examples

These are synthetic examples for two draft Notes. They require Python 3 and use only the standard library. They do not connect to a service, open a browser, send messages, or alter business records.

Automation estimate

From the repository root:

python3 collection/examples/decision-review/estimate.py

Every input is a hypothetical estimate in minutes, not a measured result. The script prints the arithmetic for the worked example. It is a calculator, not an automation implementation. null for the main break-even value means the weekly saving is nonpositive.

Review demonstration

Run these commands separately from the repository root:

cd collection/examples/decision-review
python3 test_review.py before
python3 test_review.py local_patch
python3 test_review.py shared_fix

before.py intentionally misses escaping in the shared heading renderer. local_patch.py escapes only the page's label. shared_fix.py escapes in the renderer and leaves both callers passing raw text.

Each invocation runs the same four tests. The original fails two, the caller-only patch fails one, and the shared fix passes all four. The first two invocations intentionally return exit code 1. Do not chain these commands with &&, which would stop at the first expected failure.

The two behavior checks are an ampersand/angle-bracket label and an ordinary label, each through the page and digest. These tests prove those cases only. They do not constitute an HTML security audit. The renderer expects raw plain-text strings and inserts them into HTML text content, not attributes, URLs, or script blocks.

Python may create its usual local __pycache__ directory when importing these modules. Set PYTHONDONTWRITEBYTECODE=1 if you want to suppress that cache.

A conversation starts somewhere

What are you
working on?

If something here connects with what you're working on, email me.

henry@kobutra.com