Remove the decorator
The function can still return bounded prices, but its required checks no longer produce evidence. Melampus reports the missing checks.
A pricing refactor breaks two approved rules. Melampus blocks the next action, Claude repairs the code, and fresh evidence lets the session continue.
Follow the recorded session ↓The owner reviews intent.py and the five scenario inputs. The agent edits pricing.py. A dedicated Melampus process watches that code and executes the scenario again when it changes.
| Input · cents | Original | Seeded defect | Claude’s repair |
|---|---|---|---|
| -1 | 0 | -1 · fails | 0 |
| 0 | 0 | 0 | 0 |
| 1,200 | 1,200 | 1,200 | 1,200 |
| 10,000 | 10,000 | 10,000 | 10,000 |
| 12,000 | 10,000 | 12,000 · fails | 10,000 |
Outputs come from a post-run replay of saved source snapshots on these public fixtures. The SDK evidence records check results, not raw argument or result values.
Five inputs exercise three approved rules: 15 evaluations pass.
The supervisor detects two failed evaluations before any gate query.
The real hook sends nonnegative and capped failures back to Claude.
One Edit restores the bounds. Fresh execution passes all 15 evaluations.
The Stop hook accepts the result. Five reviewed files remain unchanged.
“The hook blocked it as expected; not retrying.”
Claude’s recorded response after its harmless printf request was denied. The request was deliberately prompted to make the gate observable.
Actual pricing.py before and after Claude’s Edit. The instrumentation remains in place so the fresh implementation is checked again.
Loading source comparison. If offline, download drift.py and after.py from Evidence below.
int(cents). These five integer inputs do not establish whether truncating floats or rejecting other types is acceptable. A passing report still needs a good contract and a review of semantic choices.Source available in Evidence below.
Source available in Evidence below.
After the live repair, the harness ran two additional controls. These were scripted checks, not actions taken by Claude.
The function can still return bounded prices, but its required checks no longer produce evidence. Melampus reports the missing checks.
The gate reports that the local supervisor is unavailable. A previous healthy result does not authorize a new success claim.
The runnable example makes two temporary edits and executes real pytest and Melampus processes. It distinguishes a test-coverage gap from the session behavior Melampus adds.
| Temporary edit | Smoke unit | Full boundary tests | Melampus | Next agent action |
|---|---|---|---|---|
| Return input unchanged | Pass | Fail | Drift | Blocked |
| Remove instrumentation | Pass | Pass | Incomplete | Blocked |
When the complete boundary suite runs, it catches the unclamped return. Melampus has no secret source of intent; both approaches depend on reviewed executable claims and representative inputs.
The supervisor reruns after watched edits, treats missing instrumentation as incomplete, and gives the synchronous agent hook a decision for the current revision.
Python 3.11+ and uv on macOS or Linux. The recorder creates a disposable copy; it does not change the repository’s example.
This recording uses the first-release branch in the v0.1.0 release. Publication on PyPI is not required.
git clone https://github.com/melampus-org/melampus-python.git cd melampus-python uv sync --locked --all-extras
This version seeds and repairs the defect with a script. It exercises the real supervisor and gate, but is not an AI repair demonstration.
uv run --locked python scripts/record_agent_demo.py --output demo-recordings/protocol
This makes two temporary edits, runs the smoke and boundary tests, queries a live Melampus session, then restores the source.
uv run --locked python examples/agent-session/compare_with_unit_tests.py
Install and sign in to Claude Code first. This makes a request with your own account and configured model. Use a new output directory for each run.
uv run --locked python scripts/record_agent_demo.py --live-claude --output demo-recordings/live
Review run.json, the sanitized agent transcript, hook decisions, and source snapshots. Model behavior and timing can differ from this recording.
Open two terminals at the repository root. Review the sample’s contract, scenario, configuration and Claude hooks before enabling them.
source .venv/bin/activate cd examples/agent-session melampus session
source .venv/bin/activate cd examples/agent-session melampus gate claude
Ask Claude to modify pricing:price while preserving PRICE.instrument and the reviewed intent. If intent needs to change, have the owner review it and restart the session. See the agent-session guide for configuration and adapters.
Tests with the same inputs and assertions can catch this same bug. Melampus adds the continuously running session loop, evidence freshness and agent action gating. It does not infer all business intent from prose or guarantee that generated code is correct.
These downloads are embedded in this HTML. Sharing this file shares the recording, not the author’s AI session. Readers run their own copy with their own Claude account.
Recorded 2026-09-29 with Melampus 0.1.0 and 2.1.284 (Claude Code). Temporary paths were replaced with <demo-project>. Published messages omit authentication metadata and hidden reasoning. Fonts and the syntax viewer use public CDNs; narrative, tables and evidence downloads remain available offline.