Repository navigation
Releases
v1.0.0: Final results of error-style-v1
Second Audience is A/B testing for the interfaces AI agents use. This release closes its first experiment: error styles on an MCP server, with agents as the subjects and Flagsmith Experimentation as the engine.
Result: keep the informative error
Experiment error-style-v1 (Flagsmith experiment 680, Production) met its pre-registered stopping rule, at least 75 exposed sessions per arm, on 2026-11-28. It ended with rollout control.
| Arm | Exposed | Mean tool calls | Completed correctly | Wrong bookings |
|---|---|---|---|---|
| Informative (control) | 95 | 4.358 | 95 of 95 | 0 |
| Prescriptive | 80 | 3.737 | 74 of 80 | 0 |
- Primary: tool calls per session. Prescriptive used 14.2% fewer (95% credible interval -21.7% to -6.8%), with a win probability of 1.000.
- Guardrail: task completed correctly. Prescriptive did worse by 7.5% (interval -13.3% to -1.7%). The whole interval lies below zero, so the pre-registered rule keeps control.
- Guardrail: wrong booking. No events in either arm, including on the trap scenarios.
Errors that suggest a fix made agents faster but less reliable. The ledger matched Flagsmith on every count. Full write-up: docs/RESULTS.md. Decision record: reports/error-style-v1/decision.md.
Lab population
Lab sessions came from two Gemini Flash-Lite models on free quota. After both reached their daily limit, claude-haiku-5-5 joined through the headless Claude Code CLI. That change is HYPOTHESIS.md amendment A1, and it was decided from enrolment counts only. Field traffic from the public endpoint is reported separately.
Since v0.2.0
- SA-12 to SA-14c: operator
statusandreport,proposefrom failure logs,shipwith approval, ship hardening and a Development ship rehearsal. - SA-15: side-by-side transcript replay for the demo.
- SA-16: README, results write-up and documentation.
- SA-18: public middleware API (
SecondAudience) and a second example server. - SA-20: operational controls as Flagsmith flags.
- SA-21: per-model rollout with a Flagsmith segment.
- SA-22: Slack, GitHub and audit-log integrations.
- SA-23: Flagsmith Agent Skill.
- SA-19: Claude Code lab driver.
- SA-17a and SA-17: release review fixes, then final results.
Public endpoint: https://second-audience.onrender.com
v0.3.0: Operator ship hardening
Checkpoint after SA-14b: sa ship hardening and review follow-ups before the release.
v0.2.0: Public field endpoint
Public field endpoint: anyone can connect an MCP client to the booking server and take part in experiment error-style-v1 as a field session.
Public endpoint
| MCP endpoint | https://second-audience.onrender.com/mcp (streamable HTTP, no authentication) |
| Landing page | https://second-audience.onrender.com/ |
| Health | https://second-audience.onrender.com/healthz |
| Host | Render free web service, Docker, region Oregon, one instance, deployed from main after CI passes (render.yaml) |
| Ledger | Shared Supabase Postgres (ap-northeast-1), the same one lab runs write to |
| Flagsmith | Production environment, server-side key only; no model key and no admin credential on the host |
Connect with Claude Code:
claude mcp add --transport http second-audience https://second-audience.onrender.com/mcp
Then tell the agent: "Use the second-audience tools. Call begin_task, complete the task it gives you, then call finish_task."
Verification (2026-11-26)
/healthzreturnedstatus: okwith the deployed commit, and the database and Flagsmith checks were bothtrue.- An external Claude Code 2.1.325 client completed scenario
s08over the public URL. The ledger session hassource=field,variant=prescriptive,in_experiment=true,outcome=correct.
What changed since v0.1.0
- SA-10: field hardening (per-IP session limit, concurrent-session cap, kill switch, salted IP hashes, landing page and
/healthz). - SA-11:
Dockerfile(non-root, one process), Render Blueprint, a CI job that builds the image and checks/healthz, a keep-alive ping every 10 minutes, anddocs/deployment.md.
Known limitations
- Free-tier cold start: after 15 idle minutes the service sleeps and takes about a minute to wake. The keep-alive ping keeps it awake in practice.
- The per-IP limit reads the leftmost
X-Forwarded-Forentry, which a client can spoof. The global session cap still bounds load. - Sessions live in memory: a Render restart drops open sessions, which then stay unfinished in the ledger.
v0.1.0: Checkpoint B, experiment live
Checkpoint B: experiment error-style-v1 is live on Flagsmith Production, with lab sessions flowing.
Experiment
| Flagsmith experiment | 680, environment Production, flag error_style (feature 305704, variant prescriptive 37324) |
| Started | 2026-11-26 15:29:45 UTC, through sa start after typed confirmation; approved by Ishaan2053 |
| Pre-registration | HYPOTHESIS.md and experiments/error-style-v1.yaml, committed on main at 15:26:54 UTC, before the start |
| Primary metric | Tool calls per session (mean of task_finished, expected decrease), metric 665 |
| Guardrails | Task completed correctly (task_completed, not decrease), metric 666; Wrong booking (task_wrong_booking, not increase), metric 667 |
| Split | 100% of exposed sessions, control 50 / prescriptive 50 |
| Stopping rule | read at 75 exposed sessions per arm or at 2026-11-29 12:00 IST; ship only at win probability >= 0.95 with neither guardrail credibly worse |
Freeze
Everything below is frozen at commit 3679478b0c24014f42981cac37d94084e6edf3d2 until the experiment ends.
| Item | Where | Git blob |
|---|---|---|
| Scenarios (12: 7 aligned, 5 trap) | src/second_audience/booking/scenarios.py |
fb416392f3c8 |
| Suggestion heuristic | src/second_audience/booking/suggestions.py |
f43e29a8197c |
| Error rendering | src/second_audience/booking/errors.py |
c20ddde7a958 |
| System prompt and model client | src/second_audience/lab/models.py |
62aec6219d50 |
| Spec | experiments/error-style-v1.yaml |
796001157bfd |
| Hypothesis | HYPOTHESIS.md |
5804d28c6b48 |
- Scenarios: s01, s03, s08 (conflict, aligned); s05, s11 (conflict, trap); s06, s10 (capacity, aligned); s02, s09 (capacity, trap); s04, s12 (opening hours, aligned); s07 (opening hours, trap).
- Heuristic: conflict, then the same room's nearest free slot of the same length (ties later), else the smallest other room free then; capacity, then the smallest big-enough room free then, else that room's nearest slot; opening hours, then the nearest in-hours slot in the same room.
- System prompt: "You are an assistant with access to room-booking tools. Complete the user's request using the tools. Follow the user's requirements exactly. Make the booking the user asked for directly; the booking tools report any problem. When you have finished, call finish_task with a one-sentence summary."
- Models:
gemini-3.1-flash-lite,gemini-3.5-flash-lite(Gemini free tier). Lab plan: 14 replicates per model and scenario (336 runs), seed 1142685313, concurrency 2.
Early reconciliation
After the first 20 finished lab sessions (11 exposed), Flagsmith's results (as of 2026-11-26 15:41:29 UTC) matched the ledger exactly:
| Metric | Control (n, sum) | Prescriptive (n, sum) |
|---|---|---|
| Tool calls per session | 6, 26 | 5, 20 |
| Task completed correctly | 6, 6 | 5, 5 |
| Wrong booking | 6, 0 | 5, 0 |
No exposed session fell back to the control style outside the experiment. These are early counts, not a result: the stopping rule has not been reached.
In this release
The operator CLI (sa doctor, sa start), the experiment spec, identity traits and the task_finished metric event (#19), on top of the booking server, ledger, experiment client and lab runner (#2 to #17).