Agent edits
The model changes watched implementation files in its normal terminal.
diff --git a/site/index.html b/site/index.html index 561566d..0c48c4d 100644 --- a/site/index.html +++ b/site/index.html @@ -3,51 +3,136 @@
-
- Static site published from site/ via GitHub Actions.
-
OPEN-SOURCE ALPHA · v0.1.0
++ Melampus runs beside an AI coding session. When generated code drifts, it turns + fresh local evidence into an immediate gate: repair can continue; unrelated work waits. +
+ +One recorded local run; timing is illustrative, not a performance claim.
+THE CONTROL LOOP
+Melampus owns a companion process and a synchronous gate inside the coding session.
+The model changes watched implementation files in its normal terminal.
A separate local process reruns approved scenarios and records fresh evidence.
Healthy work proceeds. Drift or missing evidence returns the session to repair.
melampus session \
+ --config examples/agent-session/melampus.ymlclaude
+# Codex or another agent can use the same gateWATCH THE PROTOCOL
+See drift and repair first, then see exactly where unit tests and Melampus overlap.
+22 SECONDS
A generated pricing change breaks reviewed bounds. The gate blocks progression until fresh execution passes.
COMPARISON
Good tests still catch behavior defects. Melampus adds change-triggered execution, evidence freshness, and an agent gate.
WHAT CHANGES
+Keep pytest and CI. Melampus packages them into a local protocol the coding agent cannot silently step around.
+| Capability | Unit tests / CI | Melampus session |
|---|---|---|
| Assert expected behavior | Yes | Yes — reuses executable checks |
| Run immediately after watched edits | Only with a watcher or agent discipline | Built into the supervisor |
| Prove evidence belongs to this revision | Usually a CI commit or test invocation | Revision-bound session evidence |
| Distinguish failed from missing evidence | Requires custom orchestration | Healthy, drift, and incomplete states |
| Block the agent's next unrelated action | Usually after push or on request | Synchronous coding-agent gate |
- Add a link here for every HTML file you drop into site/ so
- visitors can reach it from the index. The list below is also filled in
- automatically at load time for any *.html in this folder
- that is not linked manually — but an explicit, curated list is clearer,
- so prefer adding links by hand.
-
TRY THE ALPHA
+The package is available as a verified wheel on the v0.1.0 GitHub release. Production PyPI publishing is still being configured.
+git clone https://github.com/melampus-org/melampus-python.git
+cd melampus-python
+uv sync --all-extras
+uv run python examples/agent-session/compare_with_unit_tests.py
+
+ 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.