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 @@ - melampus-python + + Melampus 0.1.0 — keep coding agents aligned - + -
-
-

melampus-python

-

- Static site published from site/ via GitHub Actions. -

-
-
+
+
+
+

OPEN-SOURCE ALPHA · v0.1.0

+

Keep the coding agent
inside the reviewed intent.

+

+ 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. +

+ +
+
15
contract evaluations in the demo
+
0.84s
observed drift detection
+
1
agent edit to restore the contract
+
+

One recorded local run; timing is illustrative, not a performance claim.

+
+
+ +
+
+

THE CONTROL LOOP

+

Evidence reaches the agent while the code is still being written.

+

Melampus owns a companion process and a synchronous gate inside the coding session.

+
+
+
01

Agent edits

The model changes watched implementation files in its normal terminal.

+ +
02

Melampus executes

A separate local process reruns approved scenarios and records fresh evidence.

+ +
03

Gate decides

Healthy work proceeds. Drift or missing evidence returns the session to repair.

+
+
+
TERMINAL A · SUPERVISOR
melampus session \
+  --config examples/agent-session/melampus.yml
+
TERMINAL B · CODING AGENT
claude
+# Codex or another agent can use the same gate
+
+
+ +
+
+

WATCH THE PROTOCOL

+

Two short demonstrations. One honest boundary.

+

See drift and repair first, then see exactly where unit tests and Melampus overlap.

+
+
+
+ +

22 SECONDS

Drift → block → repair

A generated pricing change breaks reviewed bounds. The gate blocks progression until fresh execution passes.

+
+
+ +

COMPARISON

Unit tests and session evidence

Good tests still catch behavior defects. Melampus adds change-triggered execution, evidence freshness, and an agent gate.

+
+
+
+ +
+
+

WHAT CHANGES

+

The oracle is familiar. The control point is different.

+

Keep pytest and CI. Melampus packages them into a local protocol the coding agent cannot silently step around.

+
+
+ + + + + + + + + +
CapabilityUnit tests / CIMelampus session
Assert expected behaviorYesYes — reuses executable checks
Run immediately after watched editsOnly with a watcher or agent disciplineBuilt into the supervisor
Prove evidence belongs to this revisionUsually a CI commit or test invocationRevision-bound session evidence
Distinguish failed from missing evidenceRequires custom orchestrationHealthy, drift, and incomplete states
Block the agent's next unrelated actionUsually after push or on requestSynchronous coding-agent gate
+
+ +
-
-

Pages

-

- 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

+

Run the recorded example on your machine.

+

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
+ +
diff --git a/site/media/agent-session-demo.jpg b/site/media/agent-session-demo.jpg new file mode 100644 index 0000000..eb8c111 Binary files /dev/null and b/site/media/agent-session-demo.jpg differ diff --git a/site/media/agent-session-demo.mp4 b/site/media/agent-session-demo.mp4 new file mode 100644 index 0000000..d3b5652 Binary files /dev/null and b/site/media/agent-session-demo.mp4 differ diff --git a/site/media/unit-test-comparison.jpg b/site/media/unit-test-comparison.jpg new file mode 100644 index 0000000..aaf6b30 Binary files /dev/null and b/site/media/unit-test-comparison.jpg differ diff --git a/site/media/unit-test-comparison.mp4 b/site/media/unit-test-comparison.mp4 new file mode 100644 index 0000000..2b59119 Binary files /dev/null and b/site/media/unit-test-comparison.mp4 differ diff --git a/site/site-hub.css b/site/site-hub.css index ef4cfc6..287ced4 100644 --- a/site/site-hub.css +++ b/site/site-hub.css @@ -1,125 +1,85 @@ -/* Hub layout for site/index.html — pairs with brand.css (OPSWAT tokens). */ - -.site-header { - border-bottom: 1px solid var(--line); - background: rgba(248, 249, 249, 0.92); -} - -.site-header__inner, -.hero__inner, -.guide, -.site-footer__inner { - max-width: 48rem; - margin: 0 auto; - padding-left: 1.5rem; - padding-right: 1.5rem; -} - -.site-header__inner { - display: flex; - align-items: center; - gap: 1rem; - padding-top: 0.75rem; - padding-bottom: 0.75rem; -} - -.site-mark { - width: 0.625rem; - height: 0.625rem; - background: var(--action); - border-radius: 1px; - flex-shrink: 0; -} - -.site-title { - font-size: 0.9375rem; - font-weight: 600; -} - -.site-kicker { - font-size: 0.8125rem; - color: var(--mid); -} - -.hero { - border-bottom: 1px solid var(--line); -} - -.hero__inner { - padding-top: 3rem; - padding-bottom: 2.5rem; -} - -.hero h1 { - margin: 0; - font-size: clamp(1.75rem, 4vw, 2.5rem); - line-height: 1.08; - letter-spacing: -0.02em; - font-weight: 700; -} - -.hero__lede { - margin: 1rem 0 0; - font-size: 1.05rem; - line-height: 1.55; - color: rgba(12, 18, 29, 0.8); -} - -.guide { - padding-top: 2.5rem; - padding-bottom: 3rem; -} - -.guide h2 { - margin: 2rem 0 0.75rem; - font-size: 1.25rem; - font-weight: 600; - letter-spacing: -0.01em; -} - -.guide h2:first-child { - margin-top: 0; -} - -.guide p, -.guide li { - color: rgba(12, 18, 29, 0.82); - font-size: 0.95rem; -} - -.guide ul { - margin: 0 0 1rem; - padding-left: 1.25rem; -} - -.guide li { - margin-bottom: 0.35rem; -} - -.guide a { - color: var(--action); - text-decoration: none; -} - -.guide a:hover { - text-decoration: underline; -} - -.guide code { - font-family: var(--font-mono); - font-size: 0.875em; - background: rgba(12, 18, 29, 0.06); - padding: 0.1rem 0.35rem; - border-radius: 3px; -} - -.site-footer { - border-top: 1px solid var(--line); - padding: 1.5rem 0 2.5rem; -} - -.site-footer__inner { - font-family: var(--font-mono); - font-size: 0.75rem; - color: var(--mid); -} +:root { --max: 74rem; } +html { scroll-behavior: smooth; } +body { background: #f8f9f9; } + +.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: rgba(248, 249, 249, 0.94); backdrop-filter: blur(12px); } +.site-header__inner, .hero__inner, .section, .site-footer__inner { width: min(var(--max), calc(100% - 3rem)); margin: 0 auto; } +.site-header__inner { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; } +.wordmark { display: flex; align-items: center; gap: .7rem; font-weight: 700; text-decoration: none; letter-spacing: -.02em; } +.site-mark { width: .65rem; height: .65rem; background: var(--action); border-radius: 1px; } +nav { display: flex; gap: 1.4rem; font-size: .85rem; } +nav a { color: var(--neutral-700); text-decoration: none; } +nav a:hover { color: var(--action); } + +.hero { border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f8f9f9 65%, #e8f0ff); } +.hero__inner { padding: clamp(5rem, 10vw, 8rem) 0 3rem; } +.eyebrow { margin: 0 0 1rem; color: var(--action); font: 500 .72rem/1.2 var(--font-mono); letter-spacing: .12em; } +.hero h1 { max-width: 62rem; margin: 0; font-size: clamp(3rem, 7.2vw, 6.3rem); line-height: .96; letter-spacing: -.055em; font-weight: 700; color: var(--neutral-1200); } +.hero__lede { max-width: 49rem; margin: 2rem 0 0; font-size: clamp(1.1rem, 2vw, 1.42rem); line-height: 1.55; color: var(--neutral-700); } +.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; } +.button { display: inline-flex; align-items: center; min-height: 2.8rem; padding: .65rem 1rem; border: 1px solid var(--neutral-400); background: #fff; color: var(--neutral-1200); text-decoration: none; font-size: .9rem; font-weight: 500; } +.button:hover { border-color: var(--action); color: var(--action); } +.button--primary { border-color: var(--action); background: var(--action); color: #fff; } +.button--primary:hover { background: var(--action-strong); color: #fff; } +.hero__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 48rem; margin: 4.5rem 0 0; border-top: 1px solid var(--line); } +.hero__facts div { padding: 1.25rem 1rem 0 0; } +.hero__facts dt { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; } +.hero__facts dd { margin: .15rem 0 0; color: var(--neutral-600); font-size: .8rem; } +.disclaimer { margin: 1rem 0 0; color: var(--neutral-600); font-size: .75rem; } + +.section { padding-top: clamp(4.5rem, 8vw, 7rem); padding-bottom: clamp(4.5rem, 8vw, 7rem); } +.section-head { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem 4rem; margin-bottom: 3rem; } +.section-head .eyebrow { grid-row: 1 / span 2; } +.section h2 { max-width: 49rem; margin: 0; font-size: clamp(2rem, 4.6vw, 4rem); line-height: 1.03; letter-spacing: -.045em; } +.section-head > p:last-child { max-width: 46rem; margin: 0; color: var(--neutral-600); font-size: 1.05rem; } + +.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 1rem; align-items: stretch; } +.flow article { min-height: 14rem; padding: 1.5rem; border: 1px solid var(--line); background: #fff; } +.flow article > span { color: var(--action); font: 500 .72rem var(--font-mono); } +.flow h3 { margin: 3.4rem 0 .5rem; font-size: 1.15rem; } +.flow p { margin: 0; color: var(--neutral-600); font-size: .9rem; } +.flow__arrow { align-self: center; color: var(--neutral-500); } +.terminal-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; } +.terminal-pair > div { padding: 1.25rem; background: var(--neutral-1200); color: #fff; } +.terminal-pair span { color: #9fbef8; font: 500 .68rem var(--font-mono); letter-spacing: .08em; } +pre { margin: 1rem 0 0; padding: 1.15rem; overflow: auto; background: var(--neutral-1200); color: #e8edf5; font: .82rem/1.65 var(--font-mono); } +.terminal-pair pre { padding: 0; } + +.section--ink { width: 100%; max-width: none; padding-left: max(1.5rem, calc((100% - var(--max)) / 2)); padding-right: max(1.5rem, calc((100% - var(--max)) / 2)); background: var(--neutral-1200); color: #fff; } +.section--ink .section-head > p:last-child { color: var(--neutral-400); } +.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; } +.video-card { overflow: hidden; border: 1px solid var(--neutral-800); background: var(--neutral-1100); } +.video-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; object-fit: cover; } +.video-card > div { padding: 1.4rem; } +.video-card h3 { margin: 0 0 .4rem; font-size: 1.2rem; } +.video-card p:last-child { margin: 0; color: var(--neutral-400); font-size: .9rem; } + +.table-wrap { overflow-x: auto; border-top: 2px solid var(--neutral-1200); } +table { width: 100%; border-collapse: collapse; background: #fff; } +th, td { padding: 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .88rem; } +thead th { color: var(--neutral-600); font: 500 .72rem var(--font-mono); letter-spacing: .06em; } +tbody th { width: 34%; font-weight: 500; } +td { color: var(--neutral-700); } +.yes { color: var(--green-text); font-weight: 500; } +.truth-note { margin-top: 1rem; padding: 1.1rem 1.25rem; border-left: 3px solid var(--orange); background: var(--orange-100); color: var(--neutral-800); font-size: .9rem; } + +.section--cta { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 4rem; border-top: 1px solid var(--line); } +.section--cta h2 { font-size: clamp(2rem, 4vw, 3.4rem); } +.section--cta p:not(.eyebrow) { color: var(--neutral-600); } +.section--cta pre { margin: 0; align-self: start; } +.section--cta .hero__actions { grid-column: 1 / -1; margin: 0; } +.site-footer { border-top: 1px solid var(--line); } +.site-footer__inner { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; padding-bottom: 2.5rem; color: var(--neutral-600); font: .74rem var(--font-mono); } +.site-footer a { color: var(--action); text-decoration: none; } + +@media (max-width: 760px) { + nav a:not(:last-child) { display: none; } + .hero__inner { padding-top: 4rem; } + .hero__facts, .section-head, .terminal-pair, .video-grid, .section--cta { grid-template-columns: 1fr; } + .section-head .eyebrow { grid-row: auto; } + .flow { grid-template-columns: 1fr; } + .flow__arrow { transform: rotate(90deg); justify-self: center; } + .section--cta .hero__actions { grid-column: auto; } + .site-footer__inner { flex-direction: column; } +} +@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } } diff --git a/site/walkthrough/index.html b/site/walkthrough/index.html new file mode 100644 index 0000000..f95252e --- /dev/null +++ b/site/walkthrough/index.html @@ -0,0 +1,116 @@ + + + + +Melampus — a recorded Claude coding session + + + + + +
melampus.
+
+
+

Claude stopped.
The contract held.

+

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 ↓
+
+
+
01 / INTENT

A price must stay within its approved bounds.

+

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.

+
IntegerOutput uses whole cents
≥ 0No negative price
≤ 10,000Approved ceiling, in cents
+
+ +A local feedback loop around the coding agentClaude edits the implementation. Melampus executes five inputs and three checks in a separate local process. Hooks use fresh evidence to allow progression or return the agent to repair. + +CODING TERMINALClaude edits pricing.pyImplementation remains repairable + +DEDICATED LOCAL PROCESSMelampus runs the code5 inputs × 3 reviewed checks + +AGENT HOOKSEvidence gates progressAllow next action or require repair +Failed checks return to the agent + +
Runs during generation, before unit tests or CI need to be invoked. No backend or telemetry collector is required for this local loop.
+
+
Input · centsOriginalSeeded defectClaude’s repair
-10-1 · fails0
0000
1,2001,2001,2001,200
10,00010,00010,00010,000
12,00010,00012,000 · fails10,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.

+
+
+
02 / RECORDING

Watch the next action change.

+
  1. T+1.6s
    healthy

    Baseline accepted

    Five inputs exercise three approved rules: 15 evaluations pass.

  2. T+2.4s
    drift

    The harness removes both clamps

    The supervisor detects two failed evaluations before any gate query.

  3. T+9.1s
    blocked

    Claude’s shell action is denied

    The real hook sends nonnegative and capped failures back to Claude.

  4. T+17.0s
    healthy

    Claude repairs pricing.py

    One Edit restores the bounds. Fresh execution passes all 15 evaluations.

  5. T+29.5s
    healthy

    Completion is accepted

    The Stop hook accepts the result. Five reviewed files remain unchanged.

+
THE FAILURE REACHED THE AGENT
“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.

+
+
+
03 / REPAIR

One implementation edit.
The same reviewed checks.

+

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.

+
Green means the checked claims passed.Claude also introduced 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.
+
Inspect the approved contract · intent.py

Source available in Evidence below.

+
Inspect the executed scenario · exercise.py

Source available in Evidence below.

+
+
+
04 / FAIL CLOSED

Missing evidence also stops progression.

+

After the live repair, the harness ran two additional controls. These were scripted checks, not actions taken by Claude.

+
INCOMPLETE · EXIT 2

Remove the decorator

The function can still return bounded prices, but its required checks no longer produce evidence. Melampus reports the missing checks.

INCOMPLETE · EXIT 2

Stop the supervisor

The gate reports that the local supervisor is unavailable. A previous healthy result does not authorize a new success claim.

+
+
+
05 / UNIT TESTS

The oracle is familiar.
The control point is different.

+

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 editSmoke unitFull boundary testsMelampusNext agent action
Return input unchangedPassFailDriftBlocked
Remove instrumentationPassPassIncompleteBlocked
+
SAME FOUNDATION

Good tests catch the same bad value

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.

ADDED SESSION PROTOCOL

Evidence must stay attached and current

The supervisor reruns after watched edits, treats missing instrumentation as incomplete, and gives the synchronous agent hook a decision for the current revision.

+
Could hooks around pytest achieve similar control?Yes. A controller that runs the right tests after every relevant edit, detects missing or stale execution, preserves repair access, and blocks the agent on failure can provide similar protection. Melampus packages that loop around contracts attached to generated units; it complements the broader regression suite.
+
+
+
06 / TRY IT

Run the same example yourself.

+

Python 3.11+ and uv on macOS or Linux. The recorder creates a disposable copy; it does not change the repository’s example.

+
    +
  1. Get the demo implementation

    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
  2. +
  3. Try the protocol without a model request

    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
  4. +
  5. Compare unit tests and the agent gate

    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
  6. +
  7. Record a real Claude Code repair

    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.

  8. +
  9. Keep Melampus beside your own coding session

    Open two terminals at the repository root. Review the sample’s contract, scenario, configuration and Claude hooks before enabling them.

    TERMINAL A · SUPERVISOR
    source .venv/bin/activate
    +cd examples/agent-session
    +melampus session
    TERMINAL B · YOUR AGENT
    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.

  10. +
+
+
+
07 / VALUE

Keep human review focused on intent.

+

The loop handles repeated feedback

  • Re-executes the configured scenario when watched code changes.
  • Returns specific failed claims to the coding agent.
  • Blocks unrelated progression while allowing scoped repair.
  • Keeps reviewed assertions separate from implementation edits.

The team still owns the specification

  • Choose valuable predicates and representative scenarios.
  • Check coverage of the paths that matter.
  • Review meaningful behavior changes, including repair choices.
  • Keep unit tests, CI, security checks and code review.
+

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.

+
+
+
08 / EVIDENCE

Inspect the run. Reproduce the result.

+

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.

+
+
+ + + + + diff --git a/site/walkthrough/recording.png b/site/walkthrough/recording.png new file mode 100644 index 0000000..758193d Binary files /dev/null and b/site/walkthrough/recording.png differ