From 0904f714a37f355ddf87de9b75f5d15da438afd2 Mon Sep 17 00:00:00 2001 From: Once Date: Thu, 1 Oct 2026 23:54:45 +0100 Subject: [PATCH] Build an ungated, evidence-led Once acquisition and onboarding funnel --- .github/workflows/workers-ci.yml | 13 +- CHANGELOG.md | 4 +- README.md | 9 +- docs/agent.md | 6 + docs/ai-agent-retry-safety/index.html | 2 +- docs/ambiguous-timeout/index.html | 2 +- docs/claude-code-mcp-safe-retries/index.html | 2 +- docs/crewai-safe-retries/index.html | 2 +- docs/cursor-mcp-safe-retries/index.html | 2 +- docs/demo/index.html | 115 + docs/duplicate-booking-retry/index.html | 2 +- docs/duplicate-refund-timeout/index.html | 2 +- docs/evidence/index.html | 135 + docs/funnel.css | 626 +++ docs/funnel.js | 42 + docs/index.html | 3431 +++-------------- .../index.html | 2 +- docs/llms.txt | 5 + docs/mcp-idempotency/index.html | 2 +- docs/mcp-retry-safety/index.html | 2 +- .../index.html | 2 +- docs/openai-agents-safe-retries/index.html | 2 +- docs/page-analytics.js | 405 +- docs/providers/index.html | 2 +- docs/published-versions.json | 2 +- docs/quickstart/first-action.mjs | 68 + docs/quickstart/index.html | 364 ++ docs/retry-demo.js | 115 + docs/retry-exposure/index.html | 94 + docs/sitemap.xml | 6 +- docs/vercel-ai-sdk-safe-retries/index.html | 2 +- examples/local-function/README.md | 4 + .../protect-consequential-writes/SKILL.md | 10 +- scripts/check-site-surface.mjs | 106 +- scripts/generate-site-surface.mjs | 52 + scripts/website-browser-check.mjs | 123 + scripts/website-funnel.test.mjs | 56 + workers/playground/src/index.js | 23 +- workers/playground/src/retry-demo-page.js | 2 + 39 files changed, 2360 insertions(+), 3484 deletions(-) create mode 100644 docs/demo/index.html create mode 100644 docs/evidence/index.html create mode 100644 docs/funnel.css create mode 100644 docs/funnel.js create mode 100644 docs/quickstart/first-action.mjs create mode 100644 docs/quickstart/index.html create mode 100644 docs/retry-demo.js create mode 100644 docs/retry-exposure/index.html create mode 100644 scripts/generate-site-surface.mjs create mode 100644 scripts/website-browser-check.mjs create mode 100644 scripts/website-funnel.test.mjs create mode 100644 workers/playground/src/retry-demo-page.js diff --git a/.github/workflows/workers-ci.yml b/.github/workflows/workers-ci.yml index 39c172d5..ac4fc244 100644 --- a/.github/workflows/workers-ci.yml +++ b/.github/workflows/workers-ci.yml @@ -13,7 +13,7 @@ on: - "workers/playground/**" - "workers/demo-provider/**" - "workers/evaluation/**" - - "docs/index.html" + - "docs/**" - "docs/app.js" - "docs/page-analytics.js" - "docs/styles.css" @@ -21,6 +21,8 @@ on: - "sdk/python/pyproject.toml" - "mcp/package.json" - "scripts/check-site-surface.mjs" + - "scripts/generate-site-surface.mjs" + - "scripts/website-funnel.test.mjs" - "scripts/deploy-worker.cjs" - ".github/workflows/workers-ci.yml" @@ -48,8 +50,13 @@ jobs: - name: Validate homepage helper syntax run: node --check docs/page-analytics.js - - name: Validate public site versions, counter route and heartbeat - run: node scripts/check-site-surface.mjs + - name: Validate public versions and funnel safety boundaries + run: | + node scripts/generate-site-surface.mjs --check + node scripts/check-site-surface.mjs + node --check docs/funnel.js + node --check docs/retry-demo.js + node --test scripts/website-funnel.test.mjs worker-dry-run: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index e7ce6d91..d1987b44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog -All notable changes to the Once SDK are documented here. +Historical SDK change notes are recorded here. For current published versions and +changes after the entries below, see the [public release history](https://github.com/stringsofthemind-oss/once/releases). +Website-only changes do not alter SDK execution semantics. ## 0.1.12 - 2026-09-25 diff --git a/README.md b/README.md index bcf1add5..65ad52b5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # @once-agent/sdk -> **Automatic Connect:** `@once-agent/sdk@0.1.18` publishes the tested +> **Automatic Connect:** `@once-agent/sdk@0.1.22` publishes the tested > `@once-agent/sdk/connect` path for classifying supported agent tools as > `BYPASS`, `PROTECT`, or fail-closed `UNKNOWN`, then wiring whole local tool > registries with trusted logical identity and effect binding. It also includes @@ -13,6 +13,11 @@ > [local function guide](./examples/local-function/README.md) for its exact > safety boundary and a first effect-count check. +> **Start here:** [Run the ungated retry simulation](https://onceexec.com/demo/) or +> [verify your first protected action locally](https://onceexec.com/quickstart/). +> The simulation does not execute the SDK; the local guide uses the installed SDK +> and a controlled fake provider, including fresh-process and UNKNOWN checks. + ## Once — AI Agent Execution Safety **MCP idempotency and safe retries for consequential AI agent writes.** @@ -23,7 +28,7 @@ Once helps protect supported refunds, bookings, payments and other externally vi - Automatic Connect guide: [`docs/CONNECT_AUTO.md`](./docs/CONNECT_AUTO.md) - MCP idempotency guide: https://onceexec.com/mcp-idempotency/ - AI agent retry safety: https://onceexec.com/ai-agent-retry-safety/ -- TypeScript SDK: [`@once-agent/sdk@0.1.18`](https://www.npmjs.com/package/@once-agent/sdk) +- TypeScript SDK: [`@once-agent/sdk@0.1.22`](https://www.npmjs.com/package/@once-agent/sdk) - Python SDK: [`once-agent-sdk==0.1.1`](https://pypi.org/project/once-agent-sdk/) - MCP package: `@once-agent/mcp@0.1.5` - MCP Registry: `io.github.stringsofthemind-oss/once` diff --git a/docs/agent.md b/docs/agent.md index 92e4d2aa..e9cfdeb1 100644 --- a/docs/agent.md +++ b/docs/agent.md @@ -296,3 +296,9 @@ The tester does not make network requests equal to the selected traffic volume. ## Discovery terms MCP idempotency; automatic agent tool protection; automatic tool classification; AI agent execution safety; OpenAI Agents tool safety; AI agent retry safety; safe retries; unsafe retries; duplicate execution prevention; duplicate side-effect protection; ambiguous timeout; unknown outcome; durable replay; provider reconciliation; stable operation identity; consequential writes; side-effecting AI agent tools; Python AI agent SDK; PyPI agent execution safety. + +## First-value verification +Use https://onceexec.com/quickstart/ for a current-package, no-key local check. +Its fake provider is not external-provider proof. Installing MCP alone is not +protection; all effects must traverse the protected boundary. Local mode will +not redispatch an ambiguous operation on an ABSENT observation. diff --git a/docs/ai-agent-retry-safety/index.html b/docs/ai-agent-retry-safety/index.html index 8fd2830a..51c8d2b4 100644 --- a/docs/ai-agent-retry-safety/index.html +++ b/docs/ai-agent-retry-safety/index.html @@ -221,7 +221,7 @@

Primary references

See the failure mode instead of just reading about it

Use the Once tester to model retries, duplicate exposure and the execution-safety boundary, then follow the integration path that matches your stack.

-

Open the Once tester · View source · MCP package

+

Open the Once tester · View source · MCP package

diff --git a/docs/ambiguous-timeout/index.html b/docs/ambiguous-timeout/index.html index 3cd6c592..724e997a 100644 --- a/docs/ambiguous-timeout/index.html +++ b/docs/ambiguous-timeout/index.html @@ -22,5 +22,5 @@

Why timeout handling matters

Transport failure tells you the caller did not receive a usable response. It does not tell you whether the provider committed the external effect.

Safer recovery

Keep the original logical-operation identity, inspect durable operation state and reconcile provider truth where supported. If safety cannot be established, preserve uncertainty instead of guessing.

Claim boundary: Once does not claim universal exactly-once execution. Safety depends on stable operation identity, durable Once state, the provider integration and sufficiently authoritative provider truth. When the outcome cannot be established safely, Once can preserve uncertainty rather than assume another external execution is safe.
-

Use Once for this failure mode

Once is the execution-safety layer between autonomous software and supported consequential real-world side effects.

npx -y @once-agent/mcp

Official MCP Registry identity: io.github.stringsofthemind-oss/once

Try the Once tester · MCP package · Source

+

Use Once for this failure mode

Once is the execution-safety layer between autonomous software and supported consequential real-world side effects.

npx -y @once-agent/mcp

Official MCP Registry identity: io.github.stringsofthemind-oss/once

Run the retry simulation · MCP package · Source

\ No newline at end of file diff --git a/docs/claude-code-mcp-safe-retries/index.html b/docs/claude-code-mcp-safe-retries/index.html index 4415bb2a..22975e81 100644 --- a/docs/claude-code-mcp-safe-retries/index.html +++ b/docs/claude-code-mcp-safe-retries/index.html @@ -55,7 +55,7 @@

What the Once MCP server exposes

Install Once for Claude Code

claude plugin marketplace add stringsofthemind-oss/once
 claude plugin install once@once-agent
-

Try the Once tester · Plugin source · MCP package

+

Run the retry simulation · Plugin source · MCP package

diff --git a/docs/crewai-safe-retries/index.html b/docs/crewai-safe-retries/index.html index e742c272..22d61256 100644 --- a/docs/crewai-safe-retries/index.html +++ b/docs/crewai-safe-retries/index.html @@ -55,7 +55,7 @@

CrewAI example

Add execution safety to CrewAI tools

pip install once-agent-sdk
-

Try the Once tester · Python SDK · CrewAI example

+

Run the retry simulation · Python SDK · CrewAI example

diff --git a/docs/cursor-mcp-safe-retries/index.html b/docs/cursor-mcp-safe-retries/index.html index cc5c675c..3e9f796e 100644 --- a/docs/cursor-mcp-safe-retries/index.html +++ b/docs/cursor-mcp-safe-retries/index.html @@ -58,7 +58,7 @@

What the Once MCP server exposes

Add Once to Cursor

npx -y @once-agent/mcp
-

Try the Once tester · MCP package · Cursor configuration

+

Run the retry simulation · MCP package · Cursor configuration

diff --git a/docs/demo/index.html b/docs/demo/index.html new file mode 100644 index 00000000..4ece8ab4 --- /dev/null +++ b/docs/demo/index.html @@ -0,0 +1,115 @@ + + + + + + + Once retry demo — interactive simulation + + + + + + + + + + + + + + + + +
+ +
+
+

Ungated demonstration

+

See what a retry should decide.

+

Interactive simulation of Once’s documented state decisions. No account or checkout required.

+
+
+
+ INTERACTIVE SIMULATION +

Ready

+
+

No account. No checkout. No external writes.

+
+
+
+

Without protection · blind retry

+
    +
  1. The action commits; acknowledgement is lost.
  2. +
  3. A blind retry can create a second ticket.
  4. +
+ —Simulated effects for this intent +
+
+

With Once · protected boundary

+
    +
  1. Known success can be replayed.
  2. +
  3. Unknown outcome blocks another dispatch.
  4. +
+ —Simulated effects for this intent +
+
+
+ NOT STARTED +

Use the controls to explore confirmed replay, changed-input conflict and uncertain outcomes.

+
+ + + +

+ This browser simulation illustrates Once’s documented behavior. It does not run the SDK, persist execution state or prove + external-provider durability. Inspect reproducible evidence or + verify the installed SDK. +

+
+ +
+ +

+ + diff --git a/docs/duplicate-booking-retry/index.html b/docs/duplicate-booking-retry/index.html index 7e894cb7..1dda2539 100644 --- a/docs/duplicate-booking-retry/index.html +++ b/docs/duplicate-booking-retry/index.html @@ -22,5 +22,5 @@

The booking failure mode

The provider accepts the reservation, but the response times out. The agent retries and can create another reservation for the same traveller, slot, room or resource.

Provider truth matters

Where the booking system exposes authoritative lookup or reconciliation, use it to determine whether the original reservation exists before permitting another creation call.

Claim boundary: Once does not claim universal exactly-once execution. Safety depends on stable operation identity, durable Once state, the provider integration and sufficiently authoritative provider truth. When the outcome cannot be established safely, Once can preserve uncertainty rather than assume another external execution is safe.
-

Use Once for this failure mode

Once is the execution-safety layer between autonomous software and supported consequential real-world side effects.

npx -y @once-agent/mcp

Official MCP Registry identity: io.github.stringsofthemind-oss/once

Try the Once tester · MCP package · Source

+

Use Once for this failure mode

Once is the execution-safety layer between autonomous software and supported consequential real-world side effects.

npx -y @once-agent/mcp

Official MCP Registry identity: io.github.stringsofthemind-oss/once

Run the retry simulation · MCP package · Source

\ No newline at end of file diff --git a/docs/duplicate-refund-timeout/index.html b/docs/duplicate-refund-timeout/index.html index c1e08979..549feccd 100644 --- a/docs/duplicate-refund-timeout/index.html +++ b/docs/duplicate-refund-timeout/index.html @@ -22,5 +22,5 @@

The duplicate-refund failure mode

The provider may commit the refund before the response reaches the agent. The caller sees a timeout and retries. Without stable logical identity or reconciliation, the second attempt can look like a brand-new refund.

Recovery sequence

  1. Reuse the same logical operation identity.
  2. Read durable operation state.
  3. Reconcile authoritative provider truth where supported.
  4. Replay stored results when already confirmed.
  5. Block another external execution if the outcome remains unsafe to determine.
Claim boundary: Once does not claim universal exactly-once execution. Safety depends on stable operation identity, durable Once state, the provider integration and sufficiently authoritative provider truth. When the outcome cannot be established safely, Once can preserve uncertainty rather than assume another external execution is safe.
-

Use Once for this failure mode

Once is the execution-safety layer between autonomous software and supported consequential real-world side effects.

npx -y @once-agent/mcp

Official MCP Registry identity: io.github.stringsofthemind-oss/once

Try the Once tester · MCP package · Source

+

Use Once for this failure mode

Once is the execution-safety layer between autonomous software and supported consequential real-world side effects.

npx -y @once-agent/mcp

Official MCP Registry identity: io.github.stringsofthemind-oss/once

Run the retry simulation · MCP package · Source

\ No newline at end of file diff --git a/docs/evidence/index.html b/docs/evidence/index.html new file mode 100644 index 00000000..8e6d6fbd --- /dev/null +++ b/docs/evidence/index.html @@ -0,0 +1,135 @@ + + + + + + + Once evidence — reproducible retry and failure tests + + + + + + + + + + + + + + + +
+ +
+
+

Inspect, reproduce, evaluate

+

Proof with a stated boundary.

+

+ Different evidence answers different questions. No browser simulation establishes production durability, throughput or universal + exactly-once execution. +

+
+
+

Browser simulation

+

Illustrates the decisions. No SDK, provider writes or persistent state.

+ Explore decisions +
+
+

Installed SDK

+

Local fake provider and separate journal. Verify first effect, replay, conflict, fresh process and UNKNOWN blocking.

+ Run current quickstart +
+
+

Real provider example

+

GitHub issue recovery with bounded authoritative lookup and explicit correlation assumptions.

+ Inspect integration +
+
+

Framework crash/retry labs

+

+ LangGraph and CrewAI examples use controlled simulated provider ledgers and the SQLite reference backend. They test hard process + termination and fresh-process resume/redispatch. Inspect each lab’s methodology before generalising its result. +

+ +

Routing conformance

+

+ Published fixed-suite results describe the evaluated model sessions and cases, not universal model reliability or production routing + correctness. +

+

Routing methodology and integrity trail

+

Hosted and historical evidence

+

+ Hosted playground evidence and its scope. + Stripe staging proof is a specifically scoped + staging experiment, not a blanket live payment/refund adapter guarantee. +

+

+ Historical reproducibility fixture — v0.1.9. Frozen versions remain pinned intentionally. For a current-package consumer, use the maintained quickstart. +

+

Review the source and safety tests

+ +
+ Local safety depends on one stable logical intent, complete effect binding, durable same-machine state and every consequential call + traversing the protected boundary. Authoritative confirmation may resolve UNKNOWN; local absence does not cause automatic ambiguous + redispatch. +
+ Verify your first action +
+ +

+ + diff --git a/docs/funnel.css b/docs/funnel.css new file mode 100644 index 00000000..8577770c --- /dev/null +++ b/docs/funnel.css @@ -0,0 +1,626 @@ +:root { + color-scheme: dark; + --bg: #090e14; + --panel: #111b24; + --line: #2a3b49; + --text: #f1f6fa; + --muted: #b5c3ce; + --accent: #58efb0; + --warm: #ffd287; + --red: #ffa8af; + font-family: + Inter, + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + sans-serif; + font-synthesis: none; +} +* { + box-sizing: border-box; +} +html { + scroll-behavior: smooth; + scroll-padding-top: 100px; +} +body { + margin: 0; + background: var(--bg); + color: var(--text); + line-height: 1.65; +} +a { + color: var(--accent); + text-underline-offset: 4px; +} +a:hover { + text-decoration-thickness: 2px; +} +button, +select, +input { + font: inherit; +} +button, +a.btn { + touch-action: manipulation; +} +button { + cursor: pointer; +} +button:disabled { + cursor: default; + opacity: 0.55; +} +a, +button, +summary, +input, +select { + outline-offset: 5px; +} +:focus-visible { + outline: 3px solid var(--warm); +} +[hidden] { + display: none !important; +} +.wrap { + width: min(1120px, calc(100% - 48px)); + margin: auto; +} +.skip { + position: absolute; + top: -80px; + left: 20px; + background: var(--accent); + color: var(--bg); + padding: 12px; + z-index: 10; +} +.skip:focus { + top: 12px; +} +.top { + border-bottom: 1px solid var(--line); + background: var(--bg); +} +.nav { + display: flex; + justify-content: space-between; + align-items: center; + gap: 22px; + min-height: 80px; +} +.brand { + display: flex; + gap: 10px; + align-items: center; + color: var(--text); + font-weight: 800; + font-size: 22px; + text-decoration: none; +} +.mark { + padding: 2px 8px; + background: #18372e; + color: var(--accent); + border-radius: 8px; + font-family: monospace; +} +.links { + display: flex; + align-items: center; + gap: 24px; +} +.links a { + font-size: 14px; + color: var(--muted); + text-decoration: none; +} +.links .btn { + color: var(--bg); +} +.hero { + display: grid; + grid-template-columns: 1.1fr 1fr; + gap: 64px; + align-items: center; + padding: 80px 0 68px; +} +.eyebrow { + font: + 700 12px/1.5 ui-monospace, + monospace; + letter-spacing: 0.09em; + text-transform: uppercase; + color: var(--accent); + margin: 0 0 18px; +} +h1 { + font-size: clamp(38px, 4.6vw, 64px); + line-height: 1.07; + letter-spacing: -0.055em; + margin: 0 0 24px; + max-width: 13ch; +} +h1 em { + font-style: normal; + color: var(--accent); +} +h2 { + font-size: clamp(28px, 3vw, 40px); + line-height: 1.2; + letter-spacing: -0.035em; + margin: 0 0 18px; +} +h3 { + font-size: 20px; + line-height: 1.35; + margin: 0 0 12px; +} +p { + margin: 0 0 18px; + color: var(--muted); +} +strong { + color: var(--text); +} +.lead { + font-size: 18px; + max-width: 60ch; +} +.actions { + display: flex; + flex-wrap: wrap; + gap: 12px; + align-items: center; + margin: 25px 0 16px; +} +.btn, +button { + display: inline-flex; + justify-content: center; + align-items: center; + gap: 8px; + min-height: 46px; + padding: 10px 18px; + border: 1px solid var(--line); + border-radius: 8px; + background: var(--panel); + color: var(--text); + text-decoration: none; + font-weight: 700; + font-size: 14px; +} +.primary { + background: var(--accent); + color: #082117; + border-color: var(--accent); +} +.small { + font-size: 13px; + color: var(--muted); +} +.scenario { + padding: 26px; + border: 1px solid var(--line); + border-radius: 16px; + background: linear-gradient(150deg, #14251f, var(--panel) 60%); +} +.scenario ol { + padding-left: 26px; + margin: 0; +} +.scenario li { + padding: 10px 0; + color: var(--muted); +} +.scenario li::marker { + color: var(--accent); + font-family: monospace; +} +.scenario strong { + display: block; +} +.receipt { + border-top: 1px solid var(--line); + padding-top: 16px; + margin-top: 16px; + color: var(--accent); + font-weight: 700; +} +.section { + padding: 64px 0; + border-top: 1px solid var(--line); +} +.intro { + max-width: 740px; + margin-bottom: 28px; +} +.grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 18px; +} +.card { + min-width: 0; + padding: 24px; + border: 1px solid var(--line); + border-radius: 12px; + background: var(--panel); +} +.card p:last-child { + margin-bottom: 0; +} +.tag { + font: + 700 12px ui-monospace, + monospace; + color: var(--accent); + margin-bottom: 16px; + display: block; +} +.demo { + border: 1px solid var(--line); + border-radius: 16px; + background: var(--panel); + padding: 28px; +} +.demo-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 18px; + margin-bottom: 20px; +} +.demo-header p { + margin: 0; +} +.demo-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 18px; +} +.demo-side { + background: var(--bg); + border: 1px solid var(--line); + border-radius: 10px; + padding: 20px; +} +.demo-side h3 { + font-size: 16px; +} +.demo-side ol { + padding-left: 20px; + min-height: 90px; + color: var(--muted); + font-size: 14px; + margin: 14px 0; +} +.metric { + font-size: 30px; + line-height: 1.2; + display: block; + margin: 12px 0 4px; +} +.bad { + color: var(--red); +} +.good { + color: var(--accent); +} +.state { + color: var(--warm); + font: + 700 12px ui-monospace, + monospace; +} +.demo-message { + padding: 18px 0 0; + min-height: 80px; +} +.demo-message p { + margin: 0; +} +.demo-controls { + display: flex; + flex-wrap: wrap; + gap: 10px; +} +.demo-result { + padding-top: 20px; + margin-top: 20px; + border-top: 1px solid var(--line); +} +.checklist { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 14px; + list-style: none; + padding: 0; +} +.checklist li { + padding: 16px 18px; + border: 1px solid var(--line); + border-radius: 8px; + background: var(--panel); +} +.checklist li span { + color: var(--accent); + margin-right: 10px; +} +.modes { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 18px; +} +.mode { + color: var(--text); + text-decoration: none; + display: block; +} +.mode:hover { + border-color: var(--accent); +} +.mode p { + font-size: 15px; +} +.mode .route { + color: var(--accent); + font-weight: 700; +} +.note { + padding: 20px; + border-left: 3px solid var(--accent); + background: var(--panel); + margin: 22px 0; + color: var(--muted); +} +.faq details { + border-bottom: 1px solid var(--line); + padding: 18px 0; +} +.faq summary { + cursor: pointer; + font-weight: 700; + padding-right: 20px; +} +.faq details p { + padding: 16px 0 0; + margin: 0; + max-width: 80ch; +} +.footer { + padding: 36px 0; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + gap: 20px; + border-top: 1px solid var(--line); + font-size: 13px; + color: var(--muted); +} +.footer nav { + display: flex; + flex-wrap: wrap; + gap: 18px; +} +.prose { + max-width: 860px; + padding: 60px 0; +} +.prose h1 { + max-width: 20ch; + font-size: clamp(36px, 5vw, 56px); +} +.prose h2 { + font-size: 28px; + margin: 42px 0 16px; +} +.prose h3 { + margin-top: 28px; +} +.prose li { + color: var(--muted); + margin: 8px 0; +} +.codebox { + position: relative; + margin: 18px 0; +} +.codebox button { + min-height: 38px; + padding: 6px 12px; + margin: 0 0 6px; +} +.codebox pre { + margin: 0; +} +pre { + white-space: pre-wrap; + overflow-wrap: anywhere; + background: #05090e; + border: 1px solid var(--line); + border-radius: 8px; + padding: 20px; + font: + 13px/1.7 ui-monospace, + SFMono-Regular, + Consolas, + monospace; + max-width: 100%; + color: #d4e7f3; +} +code { + font-family: ui-monospace, SFMono-Regular, Consolas, monospace; + font-size: 0.9em; +} +pre code { + font-size: inherit; +} +.steps { + padding-left: 22px; +} +.table-scroll { + overflow-x: auto; +} +table { + border-collapse: collapse; + width: 100%; + font-size: 14px; +} +th, +td { + border: 1px solid var(--line); + padding: 12px; + text-align: left; + vertical-align: top; +} +th { + color: var(--accent); +} +.form-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16px; +} +label { + display: block; + color: var(--muted); + font-size: 14px; +} +input, +select { + width: 100%; + margin-top: 7px; + background: var(--bg); + color: var(--text); + border: 1px solid var(--line); + border-radius: 6px; + padding: 10px; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} +.updates { + padding-top: 30px; + margin-top: 30px; + border-top: 1px solid var(--line); +} +@media (max-width: 900px) { + .hero { + gap: 30px; + padding: 50px 0; + } + .links { + gap: 15px; + } + .links a { + font-size: 13px; + } + .grid { + grid-template-columns: 1fr; + } + .nav { + flex-wrap: wrap; + padding: 15px 0; + gap: 12px; + } + .links { + flex-wrap: wrap; + } + .hero h1 { + font-size: 46px; + } +} +@media (max-width: 620px) { + .wrap { + width: calc(100% - 32px); + } + .nav { + align-items: flex-start; + } + .links { + gap: 8px 16px; + width: 100%; + } + .links a { + padding: 6px 0; + } + .links .btn { + min-height: 40px; + padding: 8px 12px; + } + .hero { + grid-template-columns: 1fr; + padding: 38px 0; + gap: 28px; + } + .hero h1 { + font-size: 44px; + } + .lead { + font-size: 17px; + } + .section { + padding: 42px 0; + } + .scenario, + .demo, + .card { + padding: 20px; + } + .demo-header { + align-items: flex-start; + flex-direction: column; + } + .demo-grid, + .checklist, + .modes, + .form-grid { + grid-template-columns: 1fr; + } + .demo-side ol { + min-height: 0; + } + .demo-message { + min-height: 0; + padding-bottom: 18px; + } + .demo-controls button { + width: 100%; + } + .prose { + padding: 38px 0; + } + .actions .btn { + flex-grow: 1; + } + .footer { + flex-direction: column; + } + .metric { + font-size: 26px; + } +} +@media (prefers-reduced-motion: reduce) { + html { + scroll-behavior: auto; + } + *, + *::before, + *::after { + animation: none !important; + transition: none !important; + } +} diff --git a/docs/funnel.js b/docs/funnel.js new file mode 100644 index 00000000..f10d86dd --- /dev/null +++ b/docs/funnel.js @@ -0,0 +1,42 @@ +(() => { + 'use strict'; + const status = document.querySelector('[data-copy-status]'); + document.querySelectorAll('[data-copy-target]').forEach((button) => { + button.addEventListener('click', async () => { + const source = document.getElementById(button.dataset.copyTarget); + if (!source) return; + try { + await navigator.clipboard.writeText(source.textContent); + button.textContent = 'Copied'; + if (status) status.textContent = 'Copied to clipboard.'; + window.onceTrack?.(button.dataset.copyEvent || 'install_copied'); + setTimeout(() => { + button.textContent = button.dataset.copyLabel || 'Copy'; + }, 1600); + } catch { + button.textContent = 'Select and copy below'; + if (status) status.textContent = 'Clipboard unavailable. Select the text below and copy it manually.'; + source.tabIndex = 0; + source.focus(); + const selection = window.getSelection(); + const range = document.createRange(); + range.selectNodeContents(source); + selection?.removeAllRanges(); + selection?.addRange(range); + } + }); + }); + const form = document.querySelector('[data-exposure-form]'); + if (form) { + form.addEventListener('submit', (event) => { + event.preventDefault(); + if (!form.reportValidity()) return; + const calls = Number(form.elements.calls.value); + const rate = Number(form.elements.rate.value) / 100; + const value = Number(form.elements.value.value); + const retries = calls * rate; + document.querySelector('[data-exposure-result]').textContent = + `${retries.toLocaleString()} estimated retry events per month; £${(retries * value).toLocaleString(undefined, { maximumFractionDigits: 2 })} of action value passes through these events. This is exposure context, not duplicate count, savings, or measured throughput.`; + }); + } +})(); diff --git a/docs/index.html b/docs/index.html index be4d87ab..9324caa5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,2997 +1,440 @@ - - - - - - - - - - - - - - - - - - - - - -Once — MCP Idempotency & AI Agent Retry Safety - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - -
- - - - - - - -
- -
- -
- - - - AI AGENT EXECUTION SAFETY / MCP IDEMPOTENCY - -
- - -

- - THE SAME ACTION - -
- - SHOULD HAPPEN - -
- - ONCE. - -

- - -

- - Once is AI agent execution-safety infrastructure for MCP tools - and applications that need safe retries after ambiguous outcomes. - - - Stable identity. Durable state. Provider reconciliation. - - - Protect supported refunds, bookings, payments and other consequential - writes from unsafe duplicate execution after timeouts, lost responses - and retries. - -

- - - - - -
- -
- - - MCP / AGENT INSTALL - - - - npx -y @once-agent/mcp - - -
- - - -
- -
- - -
- -
- - -
- - - ONCE / EXECUTION CORE - - - - LIVE - - -
- - -
- -
- - - OPERATION - - - - op_8F21 - - -
- - -
- - - ATTEMPTS - - - - 02 - - -
- - -
- - - SIDE EFFECTS - - - - 01 - - -
- - -
- - - LEDGER STATE - - - - CONFIRMED - - -
- -
- -
-
- - LIVE ONCE NETWORK -
- -
- — -
- -
- protected operations -
- -
- CONNECTING TO PRODUCTION -
-
- -
- -
- - - - -
- -
- - - REPRODUCIBLE EVIDENCE - - -
-

- Different framework. Different retry machinery. -
- Same recovery protocol. -

- -

- The same frozen Once V4 recovery core has been exercised under hard process termination - across independent execution models. The control duplicates the external effect; the protected - paths reconcile or fail closed instead of blindly executing again. -

-
- -
- -
- -
-
- CONTROL / NAIVE RETRY - DUPLICATED -
- 2 external effects - Fresh-process replay without an execution-safety boundary. -
- - -
- LANGGRAPH LAB - CONFIRMED -
- 1 external effect - Real StateGraph + SqliteSaver crash/resume path with reconciliation. -
- - -
- CREWAI LAB - CONFIRMED -
- 1 external effect - Native BaseTool boundary + explicit fresh-process redispatch. -
- -
-
- UNKNOWN OUTCOME - BLOCKED → CONFIRMED -
- 1 effect, zero blind replay - Provider truth unavailable → fail closed → reconcile when truth returns. -
- -
- -
-
- Audit the architecture yourself. -

Install Once in a project or inspect the hard-crash labs line by line.

-
- - -
- -

- Scope: reproducible framework-level evidence using simulated provider ledgers and the SQLite - reference backend. This is not a claim of universal exactly-once execution. -

- -
- - - - -
- -
- - - AGENT ROUTING EVIDENCE - - -
-

- 171 decisions. -
- 171 correct. -

- -

- Gemini, Claude and Grok were evaluated across six blind runs using two - fixed Once routing-conformance suites, including a 40-case adversarial - suite designed to test harder execution-safety boundaries. -

-
- -
- -
- -
-
- MODEL FAMILIES - 3 -
- Gemini / Claude / Grok - Three model families, each tested in separate fresh sessions. -
- -
-
- BLIND RUNS - 6 / 6 PASS -
- Two fixed suites - 17-case baseline plus 40-case adversarial routing conformance. -
- -
-
- ROUTING DECISIONS - 171 / 171 -
- 100% on the fixed suites - All evaluated scenario decisions matched the hidden expected routes and actions. -
- -
-
- OBSERVED ERRORS - 0 -
- No recorded routing errors - Zero over-routes, under-routes, action mismatches or runtime-state mismatches. -
- -
- -
- -
- Inspect the evidence trail. -

Read the methodology, integrity hashes and aggregate results behind the six blind runs.

-
- - - -
- -

- Scope: these results demonstrate conformance on the two fixed test suites in these six - blind runs. They do not establish universal model correctness, guarantee routing for - every real-world operation, or claim universal exactly-once execution. -

- -
- - - -
- -
- - -
- -
- - - 01 · FAILURE - - -
- -

- The provider succeeded. -
- The agent doesn't know. -

- -

- - The dangerous case is not an obvious failure. - - The external action happens, but the response disappears. - - From the agent's point of view, - success and failure can now look identical. - -

- -
- -
- - -
- - -
- - - 01 - - - - AGENT - - - - Send action - - -
- - - - - -
- - - 02 - - - - PROVIDER - - - - Effect executed - - -
- - - - - -
- - - 03 - - - - RESPONSE - - - - Lost / timeout - - -
- - - - - -
- - - 04 - - - - RETRY - - - - Duplicate risk - - -
- - -
- - -
- - - FAILURE MODE - - - - A timeout does not prove the action failed. - - -
- -
- -
- - - - - -
- -
- - -
- -
- - - 02 · IDENTITY - - -
- -

- Attempts change. -
- The operation does not. -

- -

- - Once identifies the real-world operation, - not the individual request. - - Every retry of the same logical action carries - the same stable operation ID. - -

- -
- -
- - -
- - -
- -
- ATTEMPT 01 -
- -
- ATTEMPT 02 -
- -
- ATTEMPT 03 -
- -
- - -
- - - - - -
- - -
- - - STABLE OPERATION - - - - refund:order_123 - - - - op_8F21 - - -
- - -
- → -
- - -
- - - EXTERNAL EFFECT - - - - 01 - - - - NOT 03 - - -
- - -
- -
- -
- - - - - - - -
- -
-
- -
- -
- - - - EXTERNAL EVIDENCE / 01 - -
- - -
- -
- - - IETF / RFC 9110 / §9.2.2 - - -

- RETRY - ≠ - SAFE -

- -
- - -
- -

- HTTP distinguishes idempotent operations because a - communication failure can leave the client needing - to retry without knowing whether the first request - already took effect. -

- -

- RFC 9110 says a client should not automatically - retry a non-idempotent request unless it can know - the retry is safe or determine that the original - request was never applied. -

- - - READ THE STANDARD - ↗ - - -
- -
- -
- -
- -
- -
- - -
- -
- - - 03 · ONCE - - -
- -

- The retry gets a decision. -
- Not another blind execution. -

- -

- - Once places durable execution state between - the retrying agent and the provider performing - the consequential operation. - -

- -
- -
- - -
- - -
- - - 01 - - -
- ID -
- -

- Stable identity -

- -

- One deterministic identity for the logical operation. -

- -
- - - - → - - - -
- - - 02 - - -
- DB -
- -

- Durable state -

- -

- Execution history survives requests, processes and retries. -

- -
- - - - → - - - -
- - - 03 - - -
- ? -
- -

- Provider truth -

- -

- Reconcile what can actually be established. -

- -
- - - - → - - - -
- - - 04 - - -
- 1× -
- -

- Safe decision -

- -

- Suppress the duplicate or fail closed. -

- -
- - -
- -
- -
- - - - - -
- -
- - - THE ONCE DECISION MODEL - - -
-

- The retry gets a decision. -
- Not another blind execution. -

- -

- Once does not treat a missing response as proof that nothing happened. - It carries the same logical operation identity across retries, checks - durable state and provider truth on supported paths, then chooses one - of three outcomes. -

-
- -
- -
- -
-
- CONFIRMED - REPLAY / SUPPRESS -
- Reality already changed. - Return the durable result or suppress the duplicate instead of executing the consequential action again. -
- -
-
- ABSENT - EXECUTE -
- No prior effect is established. - When durable state and supported reconciliation establish absence, the operation may proceed. -
- -
-
- UNKNOWN - BLOCK + RECONCILE -
- Truth cannot be established yet. - Fail closed rather than guess. Reconcile provider truth before another consequential execution is allowed. -
- -
-
- CORE RULE - SAME OPERATION ID -
- A timeout is not a result. - Retries reuse one stable logical identity so Once can reason about the operation rather than treating every attempt as new work. -
- -
- -

- Scope: Once does not infer provider truth from a lost response. Safe recovery on supported - paths depends on durable operation identity, durable state and authoritative reconciliation - or equivalent downstream guarantees. -

- -
- - - - -
- -
- - - WHERE ONCE SITS - - -
-

- MCP helps the agent choose the protection. -
- The runtime enforces the decision. -

- -

- Once separates agent-facing discovery and setup from the execution-safety boundary. - The MCP server helps an agent assess a project, plan protection, apply supported setup - and verify the connection. The runtime is what executes, replays or blocks a protected - consequential operation. -

-
- -
- -
- -
-
- MCP / AGENT LAYER - ASSESS + CONFIGURE -
- Discovery, planning and verification. - Agents can inspect the project, explain retry risk, plan setup, apply supported protection and verify Once is connected. -
- -
-
- RUNTIME LAYER - EXECUTE + REPLAY + BLOCK -
- The execution-safety boundary. - Protected operations use stable identity, durable state and supported reconciliation to decide whether to execute, replay or fail closed. -
- -
-
- DATA PATH - APPLICATION -> ONCE -> PROVIDER -
- Protection sits on the consequential path. - The runtime must be on the path of the side effect being protected. Installing the MCP server alone does not automatically guard every tool call. -
- -
-
- BOUNDARY - NO MAGIC INTERCEPTION -
- Explicit integration, explicit guarantees. - Once protects supported operations that are wired through its execution boundary; it does not claim to intercept arbitrary external actions automatically. -
- -
- -

- In short: MCP makes Once legible and usable to agents. The runtime is the safety boundary that protects the consequential operation. -

- -
- - - - -
- -
- - - CURRENT TRUST BOUNDARY - - -
-

- Know what Once sees. -
- Know how failure behaves. -

- -

- The current hosted SDK path is intentionally explicit about its boundary. - Protected execution is authenticated to the Once service, operation data crosses - that boundary, and the SDK fails with an error rather than silently bypassing - Once when the service cannot be reached. -

-
- -
- -
- -
-
- HOSTED EXECUTION PATH - AUTHENTICATED -
- The SDK talks to the Once service. - On the hosted execute path, the operation ID, provider alias and action payload are sent to the configured Once API using the Once API key. -
- -
-
- PROVIDER REGISTRATION - EXPLICIT SETUP -
- Provider access is configured, not inferred. - For the current hosted HTTP provider setup, the provider base URL and provider token are registered with Once so the runtime can execute and reconcile supported protected operations. -
- -
-
- ONCE UNREACHABLE - ERROR / NO SILENT BYPASS -
- Protection does not disappear quietly. - The SDK performs bounded network retries. If Once still cannot be reached, it raises a timeout or network error instead of silently sending the protected action directly to the provider. -
- -
-
- REFERENCE EVIDENCE - LOCAL SQLITE LABS -
- The crash labs are reference implementations. - LangGraph and CrewAI evidence uses the SQLite reference backend and simulated provider ledgers. That proof is deliberately scoped separately from the hosted Once service. -
- -
- -

- Scope: this describes the current hosted SDK execution path and the published reference labs. - It is not a claim about undocumented storage location, retention, encryption, compliance or - deployment guarantees. Those should be documented separately before they are promised. -

- -
- - - - -
- -
- - - WHY ONCE - - -
-

- Keep provider idempotency. -
- Add recovery when the caller no longer knows. -

- -

- Once is not a replacement for provider-native idempotency, database constraints or durable workflows. - Those controls remain valuable. Once focuses on the retry boundary around a consequential external - operation: one stable logical identity, durable execution state and a safe decision after an ambiguous outcome. -

-
- -
- -
- -
-
- PROVIDER IDEMPOTENCY - KEEP IT -
- Deduplicate at the provider boundary. - When a provider supports an idempotency key or equivalent control, use it. Once complements that downstream protection rather than asking you to remove it. -
- -
-
- ONCE - IDENTITY + STATE + RECONCILIATION -
- Reason about the logical operation across attempts. - Once carries stable operation identity across retries, records durable state and uses supported reconciliation to choose execute, replay or block instead of treating a lost response as a fresh action. -
- -
-
- DATABASE / OUTBOX - DIFFERENT BOUNDARY -
- Protect local state and message handoff. - Unique constraints, transactions and outbox patterns can protect application or messaging boundaries. They do not by themselves establish whether an external provider already performed an operation after the response was lost. -
- -
-
- DURABLE WORKFLOW - STILL NEEDS SAFE EFFECTS -
- Durable orchestration and safe side effects solve different layers. - A workflow engine can persist and retry a step. The external side effect still needs stable identity, downstream idempotency or reconciliation when execution crosses a failure boundary. -
- -
- -

- Rule of thumb: keep every useful downstream guarantee. Add Once when the same consequential operation may be retried, - the first outcome can be ambiguous, and blindly executing it again would be unsafe or costly. -

- -
- - - - -
- -
- - - CURRENT SUPPORT - - -
-

- Know what is proven today. -
- Know what still requires manual integration. -

- -

- Once deliberately separates detection from protection. The scanner can identify a wider set - of consequential operations than the current Runtime HTTP execution contract protects automatically. - Unsupported shapes fail closed or require an adapter instead of being presented as covered. -

-
- -
- -
- -
-
- RUNTIME HTTP V0.1 - PROVEN PROTECTED SHAPE -
- POST + application/json + stable identity. - The current proven Runtime HTTP path protects an explicitly configured target, requires a non-empty valid JSON body and supports stable identity through an idempotency key or an application resolver. -
- -
-
- HTTP RESPONSE REPLAY - REQUIRED ON RUNTIME SETUP -
- Confirmed retries return durable application-visible results. - Runtime HTTP setup pins the exact target URL and requires durable sanitized response replay for the registered provider version before the protected operation can use the confirmed replay path. -
- -
-
- OTHER WRITE SHAPES - ADAPTER / MANUAL REVIEW -
- Classification is broader than automatic execution support. - PUT, PATCH and DELETE may be recognized as consequential, but Runtime HTTP v0.1 does not claim a proven protected execution contract for those methods. Unsupported request shapes are rejected rather than silently treated as protected. -
- -
-
- SCAN + AUTO-APPLY - CONSERVATIVE -
- Finding a candidate is not the same as protecting it. - The scanner runs locally and can surface likely side effects. Automatic application is intentionally narrow: only a fully revalidated eligible callsite is patched; ambiguous or unsupported cases stay manual. -
- -
- -

- Current boundary: Once does not claim that every provider, HTTP method, request shape or detected side effect is automatically protected. - Provider-specific guarantees and automatic transformation support should be evaluated separately from detection. -

- -
- - - - - - -
- -
-
- -
- -
- - EXTERNAL EVIDENCE / 02 - - - -
- - -
- -
- - - STRIPE / IDEMPOTENT REQUESTS - - -
- - - 24+ - - - - HOURS - - -
- -
- - -
- -

- Stripe supports idempotency so a request can be - safely repeated after a connection error without - accidentally performing the same operation twice. -

- -

- Stripe also documents that idempotency keys may - be removed automatically once they are at least - 24 hours old. -

- - - STRIPE API REFERENCE - ↗ - - -
- -
- -
- -
- -
- -
- - -
- -
- - - 04 · PROOF - - -
- -

- Two attempts. -
- One external effect. -

- -

- - A Customer Zero regression sends the same supported - consequential operation twice using one stable operation ID, - then checks authenticated provider truth. - -

- -
- -
- - -
- -
- - - CUSTOMER ZERO / PROVIDER TRUTH - - - - VERIFIED - - -
- - -
- - - attempts - - - - 2 - - -
- - -
- - - ledger_state - - - - CONFIRMED - - -
- - -
- - - side_effects - - - - 1 - - -
- - -
- - - provider_executed - - - - true - - -
- -
- - -
- - - 02 - ATTEMPTS - - -
- - - 01 - EXTERNAL EFFECT - - -
- -
- -
- - - - - - - -
- -
-
- -
- -
- - - - EXTERNAL EVIDENCE / 03 - -
- - -
- -
- - - AWS CLI V2 / STANDARD RETRY MODE - - -

- 3 TOTAL -
- ATTEMPTS -

- -
- - -
- -
- 01 - INITIAL REQUEST -
- - ↓ - -
- 02 - RETRY -
- - ↓ - -
- 03 - RETRY -
- -
- - -
- -

- AWS CLI v2 Standard retry mode has a default - maximum of two retry attempts. -

- -

- Including the original call, that produces - three total call attempts by default. -

- - - AWS DOCUMENTATION - ↗ - - -
- -
- -
- -
- -
- -
- -
- -
- -
-
- 05 · TESTER / SCALE COMPARISON -

- Put your own traffic through the model.
- See the retry problem at your scale. -

-

- Feed the same consequential traffic into both sides. The left models blind retry execution. - The right models Once on the confirmed replay path. Use your own call volume — from one action to ten billion. -

-
- -
- THE POINT - Once doesn't stop your agents retrying. It makes retries safe. -
-
- -
- -
-
- ONCE / CUSTOMER SCALE TESTER - Without Once vs With Once -
- IMPACT MODEL / NOT PROOF -
- -
- - - - - - - - - - - -
- -
- TRAFFIC PRESETS - - - - - - - -
- -
- RETRY RATE - - - - - -
- -
-

- This is a client-side impact model, not proof. Enter 10B and the browser performs arithmetic — it does not send 10B requests. - The live proof environment is linked below. -

- -
- -
- -
-
-
- WITHOUT ONCE - Blind retry -
- RE-EXECUTE -
- -
-
- INCOMING ATTEMPTS / MONTH - 10,010,000 - original calls + retries -
- -
- PROVIDER EXECUTIONS / MONTH - 10,010,000 - modeled · if every retry is executed again -
- -
- RETRY EXECUTION OPPORTUNITIES - 10,000 - same logical work arrives again -
- -
- VALUE THROUGH RETRY AMBIGUITY - £750,000 - not a savings claim -
-
- -
- DECISION - Retry the call and hope the first attempt did not already take effect. -
-
- -
-
-
- WITH ONCE - Safe retry path -
- REPLAY / BLOCK -
- -
-
- INCOMING ATTEMPTS / MONTH - 10,010,000 - same traffic, same retry pressure -
- -
- PROVIDER EXECUTIONS / MONTH - 10,000,000 - modeled · confirmed replay path -
- -
- RETRIES INTERCEPTED - 10,000 - replay instead of execute again -
- -
- BLIND RE-EXECUTIONS - 0 - on confirmed replay path -
-
- -
- DECISION - CONFIRMED → replay. ABSENT → execute. UNKNOWN → block rather than guess. -
-
- -
- -
-
- AT YOUR SCALE - 10,000 modeled retries handled without blind re-execution on the confirmed replay path. - - £750,000 of payment value passes through those retry events. This is exposure context, not a claim that every retry becomes a duplicate charge. - - - Annualized exposure context: 120,000 retry events; £9,000,000 of payment value passes through retry-exposed operations. - -
- - - OPEN LIVE PROOF ↗ - -
- -
- -
-
- What the left side means: it deliberately models the dangerous baseline where a retry is blindly sent to a non-idempotent provider and executes again. Real providers may have their own protections. -
-
- What the right side means: the execution count reflects Once's confirmed/replay path. Once does not claim generic exactly-once execution; uncertain outcomes are designed to fail closed rather than be blindly retried. -
-
- -
- -
- -
- - - - - - -
- -
-
- -
- -
- - EXTERNAL EVIDENCE / 04 - - - -
- - -
- -
- - - GOOGLE CLOUD / PUB/SUB - - -

- AT-LEAST- -
- ONCE -

- -
- - -
- -
- MESSAGE - 8472 - - DELIVERED -
- -
- MESSAGE - 8472 - - DELIVERED AGAIN -
- -
- - -
- -

- Pub/Sub provides at-least-once delivery by - default. -

- -

- Google documents that this means a message - can be delivered multiple times, including - some cases where it was already acknowledged. -

- - - GOOGLE CLOUD DOCUMENTATION - ↗ - - -
- -
- -
- -
- -
- -
- -
- -
- - - 06 · PLAYGROUND - - -
- -

- Don't take the claim on faith. -
- Break it yourself. -

- -

- The live Once Playground deliberately creates the ambiguous - retry path: the provider performs the action, the response - becomes uncertain, and the same stable operation is retried. -

- -
- -
- - -
- -
- -
- - - LIVE ONCE PLAYGROUND - - - - Verified retry environment - - -
- - - LIVE - - -
- - -
- -
- - - ONCE STATE - - - - CONFIRMED - - -
- - -
- - - EXECUTION ATTEMPTS - - - - 2 - - -
- - -
- - - ACTUAL SIDE EFFECTS - - - - 1 - - -
- - -
- - - FAILURE MODEL - - - - AMBIGUOUS RETRY - - -
- -
- - -
- - - Open Live Playground - - - - Stripe test mode · no real charge - - -
- -
- -
- -
- - - - - -
- -
- - -
- -
- - - 07 · DEVELOPERS - - -
- -

- Go from project -
- to protected operation. -

- -

- - Using Once through an MCP client or AI agent? - Use the MCP install below. - - Embedding Once directly in an application? - Choose the TypeScript or Python SDK below. - The terminal workflow beneath is the TypeScript / CLI path for inspecting consequential operations locally, - reviewing proposed protection, then applying supported transformations. Install the TypeScript SDK above before using the shorter CLI commands after Doctor. - -

- -
- -
- - - MCP / AGENT INSTALL - - - - npx -y @once-agent/mcp - - -
- - - -
- -
- -
- - -
- -
- - - APPLICATION SDK / TYPESCRIPT - - - - npm install @once-agent/sdk - - -
- - - -
- - -
- -
- - - APPLICATION SDK / PYTHON - - - - pip install once-agent-sdk - - -
- - - -
- - -
- - -
- - - TypeScript / CLI - - - - @once-agent/sdk 0.1.10 - - -
- - -
- -
- $ - npx --yes --package=@once-agent/sdk once doctor . -
- -
- $ - npx --yes --package=@once-agent/sdk once doctor . --protect -
- -
- $ - npx --yes --package=@once-agent/sdk once protect . -
- -
- $ - npx --yes --package=@once-agent/sdk once setup . --plan -
- -
- $ - npx --yes --package=@once-agent/sdk once protect . --apply -
- -
- -
- -
- -
- - - - - - -
- -
- -
- - - ONCE / UPDATES - - -

- Stay ahead with - Once. -

- -

- Product updates, new integrations, research and occasional offers — - straight from the team building safer AI execution. -

- -
- DOUBLE OPT-IN · UNSUBSCRIBE ANYTIME -
- -
- - -
- -
- - - -
- -
-
- - Almost there — check your inbox and confirm your email to join Once updates. - -
-
- -
- -
- -
- - - -
- -
- -
- - - -
- -
- - - -
- - - - - -

- By joining, you agree to receive Once product updates, - integration news, research and occasional offers. - Double opt-in. Unsubscribe anytime. -

- - - - - - -
- -
- -
- -
- -
- -
- - -
- -
- - - ONCE / 1× - - -

- Your agents will retry. -
- Their side effects don't have to. -

- -

- Execution safety for consequential AI-agent operations. -

- - -
- - - - - Install SDK - - - - View GitHub - - - - AI / Agent Guide - - -
- -
- -
- - -
- - - - - - - - - - - - - - - - - - - - - - - + + + + + Once — safe retry decisions for agent and application actions + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+

Retry safety for agent tools and applications

+

The same action should only happen once.

+

+ A payment, booking or ticket can succeed even when the response is lost. Once helps supported integrations reuse confirmed + results and block uncertain retries instead of blindly repeating the action. +

+ +

Try the simulation without an account or checkout.
Then verify the SDK locally without a Once API key.

+ Inspect the code and failure tests → +
+ +
+
+
+

What Once changes

+

Your caller can retry.
The write needs a safe decision.

+

+ A retry library schedules another attempt. Once controls whether a protected consequential action is dispatched, replayed or + blocked. +

+
+
+
+ CONFIRMED +

Reuse the original result.

+

The same logical identity and input can return a durably confirmed result without another protected dispatch.

+
+
+ CONFLICT +

Stop changed input.

+

A changed amount, recipient or title under the same identity is rejected instead of silently becoming a different action.

+
+
+ UNKNOWN +

Keep uncertainty safe.

+

+ If the outcome cannot be established, another dispatch stays blocked. Provider-specific truth can confirm the original result. +

+
+
+
+
+
+

See the decisions

+

Retry it. Change it. Lose the response.

+

+ Explore the confirmed path first, then the harder case: a provider commits the action but its acknowledgement never arrives. +

+
+
+
+
+ INTERACTIVE SIMULATION +

Ready

+
+

No account. No checkout. No external writes.

+
+
+
+

Without protection · blind retry

+
    +
  1. The action commits; acknowledgement is lost.
  2. +
  3. A blind retry can create a second ticket.
  4. +
+ —Simulated effects for this intent +
+
+

With Once · protected boundary

+
    +
  1. Known success can be replayed.
  2. +
  3. Unknown outcome blocks another dispatch.
  4. +
+ —Simulated effects for this intent +
+
+
+ NOT STARTED +

Use the controls to explore confirmed replay, changed-input conflict and uncertain outcomes.

+
+ + + +

+ This browser simulation illustrates Once’s documented behavior. It does not run the SDK, persist execution state or prove + external-provider durability. Inspect reproducible evidence or + verify the installed SDK. +

+
+
+
+
+

Does Once fit this action?

+

Start where doing it twice would matter.

+

Evaluate Once when all four conditions apply. Search, reads and generation-only work generally do not need this protection.

+
+
    +
  • 01It changes external state.
  • +
  • 02The same intentional action may be retried.
  • +
  • 03Its acknowledgement can be lost or uncertain.
  • +
  • 04An unintended duplicate would matter.
  • +
+

+ Payments, bookings, messages and tickets are use cases, not a promise that every provider is automatically supported. + Check provider boundaries. +

+
+
+ +
+

Choose your integration

+

What do you want to protect?

+

Start with one action. Choose the route that matches your application and deployment.

+
+ +
+
+
+

First value, locally

+

Install is the beginning.
Verification is the goal.

+

+ The local quickstart uses the actual SDK with a controlled fake ticket provider. Verify one effect, replay, changed-input + conflict, a fresh-process restart and lost-acknowledgement blocking. +

+
+
+ +
npm install @once-agent/sdk@0.1.22
+
+

Node.js 24.15+ · Durable state on one machine · No Once API key

+ +
+
+
+

Trust through evidence

+

Inspect the boundary. Reproduce the result.

+

+ Open source under MIT. Evidence is scoped to its provider, state backend and failure model. A simulated lab is not a production + adoption claim. +

+
+
+
+

Installed SDK verification

+

Run the quickstart and inspect a separate effect journal, including across fresh processes.

+ Run it yourself → +
+
+

Crash and retry labs

+

Framework-level reproductions use controlled provider ledgers and the SQLite reference backend.

+ Inspect failure tests → +
+
+

Published source

+

Current TypeScript SDK: 0.1.22. Historical evidence stays labelled and pinned.

+ View releases → +
+
+
+
+
+

Safety boundaries

+

Simple to use. Explicit about what is protected.

+
+
+
+

Identity is your intent.

+

+ Keep one identity across retries. Use a different identity for a genuinely new action and bind every effect-bearing field. +

+
+
+

Durability has a scope.

+

+ Local protection needs a persistent shared SQLite file on one machine. Separate hosts, ephemeral storage and network + filesystems are outside that boundary. +

+
+
+

Unknown can block progress.

+

+ Local mode does not redispatch an ambiguous write even after an absence observation. Recovery needs a supported provider + contract; confirmed truth can be reconciled. +

+
+
+
+ Keep provider-native idempotency. Route every consequential call through the protected boundary. Installing MCP or finding a + candidate does not activate protection. Once does not promise universal exactly-once execution. +
+ Understand hosted data and credential handling → +
+
+

Questions before you integrate?

+
+ Why not just use an idempotency key? +

+ Keep provider-native idempotency wherever available. Once adds a caller-side logical action boundary, durable result handling + and explicit uncertainty decisions. Recovery still depends on the integration and downstream guarantees. +

+
+
+ Why not store the result in my database? +

+ A stored result helps replay known success. The hard case is the gap between the external effect committing and the result + reaching your database. A local database transaction cannot atomically cover an arbitrary external provider. Once preserves that + uncertainty instead of guessing. +

+
+
+ What happens after a process restart or a Once crash? +

+ Local protection recognises confirmed actions if every cooperating caller uses the same durable SQLite file on one machine. An + interrupted claim can report IN_FLIGHT until its lease expires, then UNKNOWN; it is not blindly redispatched. Separate hosts and + network filesystems are outside this local boundary. +

+
+
+ What if the provider succeeded but the response was lost? +

+ Once can leave the action UNKNOWN and block another dispatch. An authoritative, read-only provider lookup can confirm the + original result where supported. If truth is unavailable, progress can stay blocked. In conservative local mode, reporting + absence does not automatically permit redispatch after ambiguity. +

+
+
+ What if the amount, recipient or other input changes? +

+ Bind every effect-bearing field to the logical identity. Reusing that identity with a different supported payload raises + CONFLICT rather than silently replaying an old result or sending a changed write. +

+
+
+ Can Once suppress a genuinely new action? +

+ Yes, if your identity collapses two different intentions into one. Use a stable ID for the same intentional action across + retries, and a distinct ID for each genuinely new action. Scope it by tenant and action type. Do not mint a new ID merely to + bypass UNKNOWN. +

+
+
+ Where is state stored, and is an API key required? +

+ Local TypeScript protection uses a durable same-machine SQLite file and needs no Once API key. Hosted execution sends the + operation ID, provider alias and action payload to the Once service and requires authentication and provider setup. Choose the + path explicitly. +

+
+
+ Does Once add latency? +

+ Local paths add state access; reconciliation adds a provider lookup when needed. Hosted paths also add network work. There is no + universal latency promise. Measure the actual deployed integration; documented lab measurements are not production SLAs. +

+
+
+ Can it automatically protect any function? +

+ Automatic discovery and classification have explicit boundaries. Stable business identity and complete effect semantics still + need trustworthy bindings. Unsupported call shapes fail closed or need reviewed integration. +

+
+
+ What does ADAPTER_REQUIRED mean? +

+ The detected operation needs provider-specific integration beyond the automatic transformer. Use the documented local-function + or connected-tool route when suitable, or implement and validate an authoritative provider adapter. Detection alone is not + protection. +

+
+
+ Does installing MCP protect all my tools? +

+ No. The MCP/plugin helps assess and configure a project. The runtime must be wired into the consequential call path. Exposing + the original unprotected tool alongside its wrapper bypasses that boundary. +

+
+
+ What happens if the hosted Once service is unreachable? +

+ The SDK uses bounded retries, then raises a network or timeout error instead of silently dispatching the protected write + directly. Do not handle that error by bypassing Once. +

+
+
+
+

From understanding to a protected action

+

Protect one action.
Prove it survives a retry.

+ +
+

+ Want updates after you try it? + Follow the public release notes. +

+
+
+
+ +

+ diff --git a/docs/langchain-langgraph-safe-retries/index.html b/docs/langchain-langgraph-safe-retries/index.html index 79b7ef9e..99e6f9f8 100644 --- a/docs/langchain-langgraph-safe-retries/index.html +++ b/docs/langchain-langgraph-safe-retries/index.html @@ -55,7 +55,7 @@

LangChain / LangGraph example

Add execution safety to agent tools

npm install @once-agent/sdk
-

Try the Once tester · SDK package · LangChain / LangGraph example

+

Run the retry simulation · SDK package · LangChain / LangGraph example

diff --git a/docs/llms.txt b/docs/llms.txt index ebd8e87b..60ce860d 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -155,3 +155,8 @@ The MCP layer is for agent-assisted discovery, integration, and verification. Pr DISCOVERY TERMS MCP idempotency; MCP retry safety; MCP safe retries; MCP duplicate tool calls; state-changing MCP tools; MCP idempotency key; idempotentHint; automatic AI agent tool protection; automatic tool classification; OpenAI Agents retry safety; AI agent retry safety; AI agent safe retries; AI agent idempotency; safe retries; unsafe retries; duplicate execution prevention; duplicate side-effect protection; ambiguous timeout; ambiguous tool outcome; unknown outcome; durable replay; provider reconciliation; stable operation identity; consequential writes; side-effecting AI agent tools. + +## Start and verify +- [Interactive simulation](https://onceexec.com/demo/): no account or checkout; not an SDK execution proof. +- [Local quickstart](https://onceexec.com/quickstart/): actual SDK with controlled fake provider, restart and UNKNOWN checks; Node 24.15+, same-machine durability. +- [Evidence](https://onceexec.com/evidence/): scoped reproductions and current release history. diff --git a/docs/mcp-idempotency/index.html b/docs/mcp-idempotency/index.html index 2a8c81ce..4564d905 100644 --- a/docs/mcp-idempotency/index.html +++ b/docs/mcp-idempotency/index.html @@ -203,7 +203,7 @@

Add execution safety to consequential MCP writes

Once is designed for tool boundaries where retries can otherwise become duplicate external side effects.

npx -y @once-agent/mcp

Official MCP Registry identity: io.github.stringsofthemind-oss/once

-

Try the Once tester · MCP retry safety · AI agent retry safety · Claude Code · Cursor · MCP package · Source

+

Run the retry simulation · MCP retry safety · AI agent retry safety · Claude Code · Cursor · MCP package · Source

diff --git a/docs/mcp-retry-safety/index.html b/docs/mcp-retry-safety/index.html index 1f7f1f92..22f5fa62 100644 --- a/docs/mcp-retry-safety/index.html +++ b/docs/mcp-retry-safety/index.html @@ -193,7 +193,7 @@

Protect consequential MCP writes

Use Once when a state-changing tool can be retried after an outcome becomes ambiguous.

npx -y @once-agent/mcp

Official MCP Registry identity: io.github.stringsofthemind-oss/once

-

Try the Once tester · MCP idempotency guide · AI agent retry safety · Claude Code · Cursor · MCP package · Source

+

Run the retry simulation · MCP idempotency guide · AI agent retry safety · Claude Code · Cursor · MCP package · Source

diff --git a/docs/microsoft-agent-framework-safe-retries/index.html b/docs/microsoft-agent-framework-safe-retries/index.html index 1ca58901..db684387 100644 --- a/docs/microsoft-agent-framework-safe-retries/index.html +++ b/docs/microsoft-agent-framework-safe-retries/index.html @@ -55,7 +55,7 @@

Microsoft Agent Framework example

Add execution safety to Agent Framework tools

pip install once-agent-sdk
-

Try the Once tester · Python SDK · Microsoft Agent Framework example

+

Run the retry simulation · Python SDK · Microsoft Agent Framework example

diff --git a/docs/openai-agents-safe-retries/index.html b/docs/openai-agents-safe-retries/index.html index debe2351..f3041f46 100644 --- a/docs/openai-agents-safe-retries/index.html +++ b/docs/openai-agents-safe-retries/index.html @@ -55,7 +55,7 @@

OpenAI Agents example

Add execution safety to agent writes

npm install @once-agent/sdk
-

Try the Once tester · SDK package · OpenAI Agents example

+

Run the retry simulation · SDK package · OpenAI Agents example

diff --git a/docs/page-analytics.js b/docs/page-analytics.js index 1f042c6b..c8b74ada 100644 --- a/docs/page-analytics.js +++ b/docs/page-analytics.js @@ -1,363 +1,44 @@ (() => { - "use strict"; - - // Kept in lockstep with package metadata by - // scripts/check-site-surface.mjs. - const SITE_VERSIONS = Object.freeze({ - ts: "0.1.18", - python: "0.1.1", - mcp: "0.1.5" - }); - - const releaseLine = - `TS SDK ${SITE_VERSIONS.ts} · PY SDK ${SITE_VERSIONS.python} · MCP ${SITE_VERSIONS.mcp}`; - - const status = document.querySelector(".status"); - - if (status) { - const dot = status.querySelector("i"); - - status.replaceChildren(); - - if (dot) { - status.append(dot); - } - - status.append( - document.createTextNode(` ${releaseLine}`) - ); - } - - const footerVersion = - document.querySelector("footer > span:last-child"); - - if (footerVersion) { - footerVersion.textContent = releaseLine; - } - - const schema = - document.querySelector( - 'script[type="application/ld+json"]' - ); - - if (schema) { - try { - const data = JSON.parse( - schema.textContent || "{}" - ); - - if ( - data && - data["@type"] === "SoftwareApplication" - ) { - data.softwareVersion = SITE_VERSIONS.ts; - schema.textContent = JSON.stringify(data, null, 2); - } - } catch { - // Metadata repair is non-critical to page rendering. - } - } - - // -------------------------------------------------------- - // ONCE PULSE - // -------------------------------------------------------- - // Keep the one-second heartbeat cadence, but show only the - // compact pulse mark behind the live counter. The long ECG - // baseline is intentionally removed. A real protected-operation - // increase still uses the contrasting cyan event ripple. - - const heartbeatStyle = document.createElement("style"); - heartbeatStyle.dataset.onceHeartbeat = "pulse-only-v5"; - heartbeatStyle.textContent = ` -.once-network::before{ - width:176px; - height:112px; - background: - radial-gradient( - ellipse, - rgba(255,35,52,.46) 0%, - rgba(255,35,52,.20) 35%, - rgba(255,35,52,.06) 58%, - rgba(255,35,52,0) 74% - ) !important; - box-shadow: - 0 0 22px rgba(255,35,52,.26), - 0 0 40px rgba(255,35,52,.12); - filter:none; -} - -.once-network-value-wrap{ - position:relative; - isolation:isolate; -} - -.once-heartbeat-monitor{ - position:absolute; - z-index:0; - left:50%; - top:54%; - width:min(112px,42%); - height:72px; - transform:translate(-50%,-50%); - overflow:visible; - pointer-events:none; -} - -.once-heartbeat-monitor .trace{ - fill:none; - stroke:#ff3040; - stroke-width:2.6; - stroke-linecap:round; - stroke-linejoin:round; - vector-effect:non-scaling-stroke; - transform-origin:center; - filter: - drop-shadow(0 0 3px rgba(255,48,64,.95)) - drop-shadow(0 0 8px rgba(255,48,64,.46)); - animation: - once-heartbeat-pulse - 1s - ease-in-out - infinite; -} - -.once-network.operation-confirmed::after{ - border:2px solid #43d7ff !important; - background: - radial-gradient( - circle, - rgba(67,215,255,.24) 0%, - rgba(67,215,255,.10) 42%, - rgba(67,215,255,0) 72% - ); - box-shadow: - 0 0 12px rgba(67,215,255,.96), - 0 0 30px rgba(67,215,255,.58), - 0 0 54px rgba(67,215,255,.28); -} - -.once-network-value{ - position:relative; - z-index:2; - text-shadow: - 0 0 18px rgba(255,48,64,.22); -} - -@keyframes once-network-heartbeat{ - 0%,100%{ - opacity:.40; - transform: - translate(-50%,-50%) - scale(.92); - } - - 50%{ - opacity:.78; - transform: - translate(-50%,-50%) - scale(1.02); - } -} - -@keyframes once-heartbeat-pulse{ - 0%,100%{ - opacity:.52; - transform:scale(.96); - } - 45%{ - opacity:1; - transform:scale(1.04); - } -} - -@media(prefers-reduced-motion:reduce){ - .once-heartbeat-monitor .trace{ - animation:none; - } -} -`; - document.head.append(heartbeatStyle); - - const heartbeatHost = - document.querySelector(".once-network-value-wrap"); - - if ( - heartbeatHost && - !heartbeatHost.querySelector(".once-heartbeat-monitor") - ) { - const svg = document.createElementNS( - "http://www.w3.org/2000/svg", - "svg" - ); - - svg.setAttribute("class", "once-heartbeat-monitor"); - svg.setAttribute("viewBox", "0 0 112 72"); - svg.setAttribute("aria-hidden", "true"); - svg.setAttribute("focusable", "false"); - - const trace = document.createElementNS( - "http://www.w3.org/2000/svg", - "path" - ); - - trace.setAttribute("class", "trace"); - trace.setAttribute( - "d", - "M20 38 L32 29 L43 51 L55 8 L67 61 L80 24 L92 38" - ); - - svg.append(trace); - heartbeatHost.prepend(svg); - } - - // -------------------------------------------------------- - // LIVE COUNTER LAST-KNOWN FALLBACK - // -------------------------------------------------------- - - const COUNTER_STORAGE_KEY = - "onceLastKnownProtectedOperations"; - - const networkValue = - document.getElementById("once-network-value"); - - const networkLabel = - document.getElementById("once-network-label"); - - const networkStatus = - document.getElementById("once-network-status"); - - function readStoredCount() { - try { - const raw = localStorage.getItem( - COUNTER_STORAGE_KEY - ); - - if (raw === null) { - return null; - } - - const count = Number(raw); - - return Number.isSafeInteger(count) && count >= 0 - ? count - : null; - } catch { - return null; - } - } - - function storeCount(count) { - try { - localStorage.setItem( - COUNTER_STORAGE_KEY, - String(count) - ); - } catch { - // Storage is optional. - } - } - - function renderLastKnown(statusText) { - if (!networkValue || !networkLabel || !networkStatus) { - return; - } - - const stored = readStoredCount(); - - if (stored === null) { - return; - } - - networkValue.textContent = - stored.toLocaleString(); - - networkLabel.textContent = - stored === 1 - ? "protected operation" - : "protected operations"; - - networkStatus.textContent = statusText; - } - - if (networkValue && networkStatus) { - if ( - networkValue.textContent?.trim() === "—" - ) { - renderLastKnown( - "LAST KNOWN • CONNECTING LIVE" - ); - } - - const observeCounter = () => { - const statusText = - networkStatus.textContent?.trim() || ""; - - const rawValue = - (networkValue.textContent || "") - .replaceAll(",", "") - .trim(); - - const count = Number(rawValue); - - if ( - statusText === "LIVE • PRODUCTION COUNTER" && - Number.isSafeInteger(count) && - count >= 0 - ) { - storeCount(count); - return; - } - - if ( - statusText === "LIVE TELEMETRY UNAVAILABLE" - ) { - renderLastKnown( - "LAST KNOWN • RETRYING LIVE" - ); - } - }; - - const counterObserver = - new MutationObserver(observeCounter); - - counterObserver.observe( - networkValue, - { - childList: true, - characterData: true, - subtree: true - } - ); - - counterObserver.observe( - networkStatus, - { - childList: true, - characterData: true, - subtree: true - } - ); - - observeCounter(); - } - - const ENDPOINT = - "https://playground.onceexec.com/analytics/event"; - - fetch( - ENDPOINT, - { - method: "POST", - headers: { - "content-type": "application/json" - }, - body: JSON.stringify({ - event: "page_view", - source: "website" - }), - keepalive: true - } - ).catch(() => { - // Analytics must never interfere with the page. - }); -})(); \ No newline at end of file + 'use strict'; + // Website interaction counts only. No cookies, persistent IDs, payloads, + // source code, URLs, form values or SDK activation telemetry. + const allowed = new Set([ + 'homepage_view', + 'hero_demo_click', + 'demo_started', + 'demo_completed', + 'unknown_state_viewed', + 'protect_first_action_click', + 'mode_selected', + 'quickstart_started', + 'install_copied', + 'first_action_step_reached', + 'github_click', + 'docs_click', + 'hosted_sandbox_click', + ]); + const sent = new Set(); + window.onceTrack = (event) => { + if (!allowed.has(event) || sent.has(event)) return; + if ( + navigator.doNotTrack === '1' || + navigator.globalPrivacyControl || + !['onceexec.com', 'onceexec.pages.dev', 'stringsofthemind-oss.github.io'].includes(location.hostname) + ) + return; + sent.add(event); + fetch('https://playground.onceexec.com/analytics/event', { + method: 'POST', + credentials: 'omit', + referrerPolicy: 'no-referrer', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify({ event, source: 'website' }), + keepalive: true, + }).catch(() => {}); + }; + document.querySelectorAll('[data-event]').forEach((element) => { + element.addEventListener('click', () => window.onceTrack(element.dataset.event)); + }); + if (location.pathname === '/') window.onceTrack('homepage_view'); + if (location.pathname.startsWith('/quickstart')) window.onceTrack('quickstart_started'); +})(); diff --git a/docs/providers/index.html b/docs/providers/index.html index 828d3e4b..0e31ff1d 100644 --- a/docs/providers/index.html +++ b/docs/providers/index.html @@ -1,2 +1,2 @@ -Once Provider Reconciliation Matrix
Current capability boundary

Provider reconciliation matrix

Provider reconciliation is the part of Once that asks an external system what actually happened after an ambiguous outcome. This page makes the current evidence boundary explicit instead of implying support for providers that have not been publicly demonstrated.

Important: Once does not claim that every payment, booking, messaging, or SaaS provider has a production-ready reconciliation adapter today. Provider-native idempotency and authoritative read-back should be used wherever available.
Provider / environmentExecution pathAuthoritative reconciliationPublic evidenceStatus
Reference / simulated provider ledgerUsed by hostile-retry labsYes, by the test provider contractLangGraph and CrewAI hostile-retry labsReproducible reference evidence
Agno hostile-retry test providerReleased SDK receives repeated invocationsBound to the lab's controlled provider/effect modelControl can produce 3 effects; Once path commits 1Reproducible framework evidence
Hosted / synthetic Once runtime testCloud-hosted runtime test pathDemonstrated against the synthetic provider contractTwo attempts, one provider execution / external effect, durable replayDemonstrated hosted evidence
Stripe live production APINot claimed hereNo public production reconciliation adapter is claimed on this pageStripe sandbox may be used for product/billing demos, but that is not the same as a proven refund/payment reconciliation adapterDo not infer support
Booking / reservation providersNot provider-specific by defaultRequires an integration that can establish provider truth or an equivalent downstream guaranteeNo named production provider adapter claimed hereAdapter / integration required
Email / messaging providersNot provider-specific by defaultRequires authoritative status semantics suitable for the operationNo named production provider adapter claimed hereAdapter / integration required
Arbitrary third-party APIsNo universal automatic guaranteeDepends on provider truth, provider-native idempotency, or another trustworthy downstream primitiveNo universal exactly-once claimEvaluate individually

What counts as authoritative truth?

An empty local ledger, a timeout, a missing acknowledgement, or a non-authoritative 404 is not enough by itself to establish ABSENT. Once is strongest where the external system can answer whether the specific logical operation already committed, using a stable identifier or an equivalent authoritative lookup.

Decision model

CONFIRMED — replay or suppress. ABSENT — execution may proceed when absence is authoritatively established. UNKNOWN — fail closed rather than guess, then reconcile later when truth becomes available.

Integration principle

Once is intended to complement provider-native idempotency, database constraints, durable workflow engines, and other downstream safety primitives. It should not replace a stronger guarantee already offered by the provider.

Support matrix · Project identity · Research · GitHub

\ No newline at end of file +Once Provider Reconciliation Matrix
Current capability boundary

Provider reconciliation matrix

Provider reconciliation is the part of Once that asks an external system what actually happened after an ambiguous outcome. This page makes the current evidence boundary explicit instead of implying support for providers that have not been publicly demonstrated.

Important: Once does not claim that every payment, booking, messaging, or SaaS provider has a production-ready reconciliation adapter today. Provider-native idempotency and authoritative read-back should be used wherever available.
Provider / environmentExecution pathAuthoritative reconciliationPublic evidenceStatus
Reference / simulated provider ledgerUsed by hostile-retry labsYes, by the test provider contractLangGraph and CrewAI hostile-retry labsReproducible reference evidence
Agno hostile-retry test providerReleased SDK receives repeated invocationsBound to the lab's controlled provider/effect modelControl can produce 3 effects; Once path commits 1Reproducible framework evidence
Hosted / synthetic Once runtime testCloud-hosted runtime test pathDemonstrated against the synthetic provider contractTwo attempts, one provider execution / external effect, durable replayDemonstrated hosted evidence
Stripe live production APINot claimed hereNo public production reconciliation adapter is claimed on this pageStripe sandbox may be used for product/billing demos, but that is not the same as a proven refund/payment reconciliation adapterDo not infer support
Booking / reservation providersNot provider-specific by defaultRequires an integration that can establish provider truth or an equivalent downstream guaranteeNo named production provider adapter claimed hereAdapter / integration required
Email / messaging providersNot provider-specific by defaultRequires authoritative status semantics suitable for the operationNo named production provider adapter claimed hereAdapter / integration required
Arbitrary third-party APIsNo universal automatic guaranteeDepends on provider truth, provider-native idempotency, or another trustworthy downstream primitiveNo universal exactly-once claimEvaluate individually

What counts as authoritative truth?

An empty local ledger, a timeout, a missing acknowledgement, or a non-authoritative 404 is not enough by itself to establish ABSENT. Once is strongest where the external system can answer whether the specific logical operation already committed, using a stable identifier or an equivalent authoritative lookup.

Decision model

CONFIRMED — replay or suppress. ABSENT — recovery depends on the specific integration. Conservative local protection does not redispatch an ambiguous write after an absence observation. UNKNOWN — fail closed rather than guess, then reconcile later when truth becomes available.

Integration principle

Once is intended to complement provider-native idempotency, database constraints, durable workflow engines, and other downstream safety primitives. It should not replace a stronger guarantee already offered by the provider.

Support matrix · Project identity · Research · GitHub

\ No newline at end of file diff --git a/docs/published-versions.json b/docs/published-versions.json index cdb857d7..484bf553 100644 --- a/docs/published-versions.json +++ b/docs/published-versions.json @@ -1,4 +1,4 @@ { - "ts": "0.1.18", + "ts": "0.1.22", "mcp": "0.1.5" } diff --git a/docs/quickstart/first-action.mjs b/docs/quickstart/first-action.mjs new file mode 100644 index 00000000..3cbbc09a --- /dev/null +++ b/docs/quickstart/first-action.mjs @@ -0,0 +1,68 @@ +import assert from "node:assert/strict"; +import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs"; +import path from "node:path"; +import { protectLocal } from "@once-agent/sdk"; + +// Controlled fake provider: its effect journal is separate from Once state. +// This verifies the installed SDK, not a real payment or ticket integration. +const directory = path.resolve(".once-first-action"); +mkdirSync(directory, { recursive: true }); +const statePath = path.join(directory, "operations.sqlite"); +const mode = process.argv[2] || "verify"; +assert.ok(["verify", "restart", "unknown", "reconcile"].includes(mode)); +const journal = name => path.join(directory, `${name}.jsonl`); +const rows = name => existsSync(journal(name)) + ? readFileSync(journal(name), "utf8").trim().split("\n").filter(Boolean).map(JSON.parse) + : []; + +// In your integration use a durable intentional action ID, scoped by tenant +// and action type, and bind EVERY input that can change the external effect. +const identity = input => `demo-tenant:create-ticket:${input.intentId}`; +const payload = input => ({ intentId: input.intentId, title: input.title }); +const createTicket = protectLocal(async input => { + const result = { number: "TICKET-1", title: input.title }; + appendFileSync(journal("confirmed"), JSON.stringify(result) + "\n"); + return result; +}, { id: identity, payload, statePath }); + +const original = { intentId: "ticket-001", title: "Investigate timeout" }; +if (mode === "verify") { + const result = await createTicket(original); + assert.deepEqual(await createTicket(original), result); + await assert.rejects(createTicket({ ...original, title: "Changed title" }), { code: "CONFLICT" }); + assert.equal(rows("confirmed").length, 1); + console.log("CONFIRMED: TICKET-1\nREPLAY: original result\nCONFLICT: no write dispatched\nProvider effects: 1"); +} else if (mode === "restart") { + assert.equal(rows("confirmed").length, 1, "Run verify first; keep the state directory."); + assert.deepEqual(await createTicket(original), rows("confirmed")[0]); + assert.equal(rows("confirmed").length, 1); + console.log("RESTART REPLAY: TICKET-1\nProvider effects: 1"); +} else { + // The fake provider commits, THEN its acknowledgement is lost. + const lostInput = { intentId: "ticket-lost-ack", title: "Lost acknowledgement" }; + const lost = protectLocal(async input => { + const result = { number: "TICKET-LOST", title: input.title }; + appendFileSync(journal("ambiguous"), JSON.stringify(result) + "\n"); + throw new Error("Simulated acknowledgement loss after commit"); + }, { + id: identity, payload, statePath, + ...(mode === "reconcile" ? { + // Authoritative ONLY for this controlled fake provider. A real provider + // needs its own trustworthy, read-only lookup and concurrency contract. + reconcile: () => rows("ambiguous").length === 1 + ? { state: "CONFIRMED", result: rows("ambiguous")[0] } + : { state: "UNKNOWN" }, + } : {}), + }); + if (mode === "unknown") { + await assert.rejects(lost(lostInput)); + await assert.rejects(lost(lostInput), { code: "UNKNOWN" }); + assert.equal(rows("ambiguous").length, 1); + console.log("UNKNOWN: retry blocked\nAmbiguous provider effects: 1"); + } else { + assert.equal(rows("ambiguous").length, 1, "Run unknown first."); + assert.equal((await lost(lostInput)).number, "TICKET-LOST"); + assert.equal(rows("ambiguous").length, 1); + console.log("RECONCILED: TICKET-LOST\nAmbiguous provider effects: 1"); + } +} diff --git a/docs/quickstart/index.html b/docs/quickstart/index.html new file mode 100644 index 00000000..436be525 --- /dev/null +++ b/docs/quickstart/index.html @@ -0,0 +1,364 @@ + + + + + + + Once quickstart — protect and verify your first action + + + + + + + + + + + + + + + +
+ +
+
+

Local first-action quickstart

+

One action. Retry it. Verify one effect.

+

+ Use the actual Once SDK without a Once API key. This controlled example writes a fake ticket provider’s receipt to a separate local + journal. +

+
+ This is an SDK verification, not an external-provider proof. Node.js 24.15+ is required. Keep the same working + directory and durable SQLite file for every run. No network provider, payment or hosted subscription is used. +
+

1. Check Node and install

+

Use a fresh disposable directory. These commands work in a terminal or PowerShell.

+
+ +
node --version
+mkdir once-first-action
+cd once-first-action
+npm init -y
+npm install @once-agent/sdk@0.1.22
+
+

+ If Node is older than 24.15, update it before running local protection. The general hosted SDK has a different requirement; this + guide uses local SQLite. +

+

2. Save the complete example

+

+ Download first-action.mjs into that directory, or copy the full code below into a file named + first-action.mjs. +

+
+ Complete copyable example +
+ +
import assert from "node:assert/strict";
+import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
+import path from "node:path";
+import { protectLocal } from "@once-agent/sdk";
+
+// Controlled fake provider: its effect journal is separate from Once state.
+// This verifies the installed SDK, not a real payment or ticket integration.
+const directory = path.resolve(".once-first-action");
+mkdirSync(directory, { recursive: true });
+const statePath = path.join(directory, "operations.sqlite");
+const mode = process.argv[2] || "verify";
+assert.ok(["verify", "restart", "unknown", "reconcile"].includes(mode));
+const journal = name => path.join(directory, `${name}.jsonl`);
+const rows = name => existsSync(journal(name))
+  ? readFileSync(journal(name), "utf8").trim().split("\n").filter(Boolean).map(JSON.parse)
+  : [];
+
+// In your integration use a durable intentional action ID, scoped by tenant
+// and action type, and bind EVERY input that can change the external effect.
+const identity = input => `demo-tenant:create-ticket:${input.intentId}`;
+const payload = input => ({ intentId: input.intentId, title: input.title });
+const createTicket = protectLocal(async input => {
+  const result = { number: "TICKET-1", title: input.title };
+  appendFileSync(journal("confirmed"), JSON.stringify(result) + "\n");
+  return result;
+}, { id: identity, payload, statePath });
+
+const original = { intentId: "ticket-001", title: "Investigate timeout" };
+if (mode === "verify") {
+  const result = await createTicket(original);
+  assert.deepEqual(await createTicket(original), result);
+  await assert.rejects(createTicket({ ...original, title: "Changed title" }), { code: "CONFLICT" });
+  assert.equal(rows("confirmed").length, 1);
+  console.log("CONFIRMED: TICKET-1\nREPLAY: original result\nCONFLICT: no write dispatched\nProvider effects: 1");
+} else if (mode === "restart") {
+  assert.equal(rows("confirmed").length, 1, "Run verify first; keep the state directory.");
+  assert.deepEqual(await createTicket(original), rows("confirmed")[0]);
+  assert.equal(rows("confirmed").length, 1);
+  console.log("RESTART REPLAY: TICKET-1\nProvider effects: 1");
+} else {
+  // The fake provider commits, THEN its acknowledgement is lost.
+  const lostInput = { intentId: "ticket-lost-ack", title: "Lost acknowledgement" };
+  const lost = protectLocal(async input => {
+    const result = { number: "TICKET-LOST", title: input.title };
+    appendFileSync(journal("ambiguous"), JSON.stringify(result) + "\n");
+    throw new Error("Simulated acknowledgement loss after commit");
+  }, {
+    id: identity, payload, statePath,
+    ...(mode === "reconcile" ? {
+      // Authoritative ONLY for this controlled fake provider. A real provider
+      // needs its own trustworthy, read-only lookup and concurrency contract.
+      reconcile: () => rows("ambiguous").length === 1
+        ? { state: "CONFIRMED", result: rows("ambiguous")[0] }
+        : { state: "UNKNOWN" },
+    } : {}),
+  });
+  if (mode === "unknown") {
+    await assert.rejects(lost(lostInput));
+    await assert.rejects(lost(lostInput), { code: "UNKNOWN" });
+    assert.equal(rows("ambiguous").length, 1);
+    console.log("UNKNOWN: retry blocked\nAmbiguous provider effects: 1");
+  } else {
+    assert.equal(rows("ambiguous").length, 1, "Run unknown first.");
+    assert.equal((await lost(lostInput)).number, "TICKET-LOST");
+    assert.equal(rows("ambiguous").length, 1);
+    console.log("RECONCILED: TICKET-LOST\nAmbiguous provider effects: 1");
+  }
+}
+
+
+
+

+ The id binds a stable intentional action, scoped by tenant and action type. The payload binds both intent + and title. The wrapped caller is the only route to the fake provider. A successful receipt is plain, replayable data. +

+

3. Verify confirmed replay and conflict

+
+ +
node first-action.mjs
+
+

Expected output:

+
+CONFIRMED: TICKET-1
+REPLAY: original result
+CONFLICT: no write dispatched
+Provider effects: 1
+

+ Inspect .once-first-action/confirmed.jsonl: there is one provider receipt. This journal is separate from + operations.sqlite, the Once state file. +

+

4. Restart the process

+
+ +
node first-action.mjs restart
+
+
+RESTART REPLAY: TICKET-1
+Provider effects: 1
+

+ This second command runs in a fresh process. Do not delete state or change its path. A persisted confirmed receipt is returned + without a second provider dispatch. +

+

5. Commit, lose the acknowledgement, then retry

+
+ +
node first-action.mjs unknown
+
+
+UNKNOWN: retry blocked
+Ambiguous provider effects: 1
+

+ This separate fake-provider action commits before throwing. The next attempt must remain blocked. Keep the same identity; do not + call the provider directly or create a fresh identity to evade the block. +

+

6. Confirm provider truth

+
+ +
node first-action.mjs reconcile
+
+
+RECONCILED: TICKET-LOST
+Ambiguous provider effects: 1
+

+ A read-only lookup of this controlled provider’s journal authoritatively confirms its receipt. This assumption belongs to the fake + provider, not arbitrary APIs. Without confirmation, the action stays UNKNOWN. Local mode does not automatically redispatch an + ambiguous write on ABSENT. +

+

7. Protect a real action

+
    +
  1. + Replace the fake provider with one existing consequential provider operation that returns a confirmed, JSON-safe receipt. Keep its + native idempotency safeguards. +
  2. +
  3. + Choose a durable ID for one intentional action, scoped by tenant and operation. A separate legitimate intent must have a different + ID; retries must keep the same ID. +
  4. +
  5. + Bind every input that changes the effect, including recipient, amount, resource and account where applicable. Do not infer + identity from a per-attempt tool-call ID. +
  6. +
  7. + Use an explicit persistent statePath, shared by cooperating callers on one machine. Network filesystems and separate + host state are unsupported. +
  8. +
  9. + Route all callers through the wrapper. Remove the original unprotected tool from the agent’s exposed capabilities. Internal + provider retries and multiple effects inside one wrapper need their own safety analysis. +
  10. +
  11. + Supply authoritative read-only reconciliation when available. A timeout, stale lookup or unsupported 404 does not prove absence. + Unknown outcomes must not silently bypass protection. +
  12. +
  13. + In the provider’s disposable sandbox, verify first action, same-intent retry, changed-input conflict and fresh-process replay + using provider evidence. Test acknowledgement loss only when safe. +
  14. +
+
+ Success means your actual caller reaches the protected boundary and provider evidence confirms the expected effects. Installing the + SDK, finding a candidate or generating a companion file does not prove active protection. +
+

+ Full local-function contract + · + GitHub recovery example +

+

Protect an agent’s existing tools

+

+ The local Connect path requires Node.js 24.15+, durable same-machine SQLite and trusted identity/effect metadata. It classifies + supported tools as BYPASS, PROTECT or UNKNOWN. Unresolved toolsets fail closed rather than returning a partially protected registry. + No Once API key is needed for this local route. +

+

+ Use only the returned connected tools in the agent. Automatic classification does not invent business identity or prove + authoritative provider truth. +

+ Open the complete Connect guide +

Set up Codex, Claude Code or Cursor

+

+ The plugin/MCP layer assesses and plans supported integration. Local assessment needs no key; hosted setup needs a Once API key. The + server’s presence does not automatically protect other tools or replace the execution boundary. +

+

Codex

+
+ +
codex plugin marketplace add stringsofthemind-oss/once --ref main
+codex plugin add once@once-agent
+
+

Claude Code

+
+ +
claude plugin marketplace add stringsofthemind-oss/once
+claude plugin install once@once-agent
+
+

+ Claude setup details · + Cursor project MCP configuration · + Codex plugin instructions +

+

+ After setup, ask for a read-only project assessment, review identity/effect semantics, wire supported operations, then verify a real + protected action. The selected local or hosted runtime determines where state lives. +

+

Evaluate a supported hosted operation

+

+ Hosted execution requires a Once API key and explicit supported provider setup. The SDK sends operation identity, provider alias and + action payload to the configured Once API. Current hosted HTTP provider registration includes its base URL and provider token. +

+

+ The hosted service manages execution state; the homepage does not promise a storage jurisdiction, retention period, encryption + design, audit or SLA. Evaluate those requirements before sending sensitive production data. If the service cannot be reached after + bounded retries, the SDK raises an error; it does not silently dispatch directly. +

+

+ Recovery and any permission to execute after an absence observation depend on the specific downstream contract. Do not apply a + generic ABSENT → EXECUTE rule to local protection. +

+ +

+ Hosted activation is a separate Stripe test checkout flow. It is optional for learning and local verification. Use test details + only; do not enter real card data. +

+

Assess your codebase first

+
+ +
npx --yes --package=@once-agent/sdk once doctor .
+
+

+ Default Doctor assessment is local, requires no Once API key, does not upload source and does not modify application source. It + reports likely consequential candidates and supported next steps. Discovery is not protection. Follow the candidate-specific guide; + unsupported shapes may require reviewed local integration or an adapter. +

+

Keep protection active

+

+ Preserve the state path, logical IDs and complete effect payload across deploys. Monitor unresolved UNKNOWN outcomes and conflicts. + Verify provider truth before recovery; never treat any error as permission to bypass the wrapper. +

+

+ Inspect evidence and limitations · + Report an integration problem +

+
+ +

+ + diff --git a/docs/retry-demo.js b/docs/retry-demo.js new file mode 100644 index 00000000..15fce60e --- /dev/null +++ b/docs/retry-demo.js @@ -0,0 +1,115 @@ +// Educational simulation only. No SDK execution, provider calls or persistence. +(() => { + 'use strict'; + const host = document.querySelector('[data-retry-demo]'); + if (!host) return; + const stages = [ + { + title: 'Ready', + naive: [], + safe: [], + effects: [0, 0], + state: 'NOT STARTED', + message: 'Start with one intentional ticket creation. Both paths receive the same request.', + next: '1. Run first action', + }, + { + title: 'Action confirmed', + naive: ['Ticket #101 created; result received.'], + safe: ['Ticket #101 created; confirmed result recorded.'], + effects: [1, 1], + state: 'CONFIRMED', + message: 'Both paths created one ticket. The protected path now has a confirmed result for this logical intent.', + next: '2. Retry same action', + }, + { + title: 'Same intent retried', + naive: ['Ticket #101 created.', 'Blind retry creates ticket #102.'], + safe: ['Ticket #101 created.', 'Same identity + same input: original #101 returned.'], + effects: [2, 1], + state: 'CONFIRMED / REPLAY', + message: 'Once reuses the confirmed result without a second protected dispatch. The naive control blindly creates another ticket.', + next: '3. Change the title', + }, + { + title: 'Changed input stopped', + naive: ['Blind retry already created #102.', 'Changed title could become another write.'], + safe: ['Same identity, different title: CONFLICT.', 'No write dispatched; original receipt is not replayed.'], + effects: [2, 1], + state: 'CONFLICT', + message: + 'An existing identity cannot silently acquire a different effect. A genuinely new intentional action needs a distinct identity.', + next: '4. Lose an acknowledgement', + }, + { + title: 'A separate action has an unknown outcome', + naive: ['New intent: ticket #201 commits.', 'Response lost; blind retry creates #202.'], + safe: ['New intent: ticket #201 commits; response lost.', 'Outcome UNKNOWN. Retry blocked; no second dispatch.'], + effects: [2, 1], + state: 'UNKNOWN / BLOCKED', + message: + 'This is a separate lost-ack scenario; counts now refer only to this new intent. The provider committed the ticket, but Once cannot yet establish that. Unknown does not mean failed.', + next: '5. Reconcile provider truth', + }, + { + title: 'Original external result confirmed', + naive: ['Tickets #201 and #202 exist.'], + safe: ['Authoritative read-only lookup confirms #201.', 'Original result recorded and returned; no new write.'], + effects: [2, 1], + state: 'CONFIRMED / RECONCILED', + message: + 'This simulated provider has authoritative confirmation. In a real integration, that requires provider-specific reconciliation. The local path does not automatically redispatch after ambiguous absence.', + next: null, + }, + ]; + let step = 0; + let unavailable = false; + const next = host.querySelector('[data-demo-next]'); + const truth = host.querySelector('[data-demo-unavailable]'); + const report = (event) => window.onceTrack?.(event); + function render() { + const data = stages[step]; + host.querySelector('[data-demo-title]').textContent = unavailable ? 'Provider truth unavailable' : data.title; + host.querySelector('[data-demo-state]').textContent = data.state; + host.querySelector('[data-demo-message]').textContent = unavailable + ? 'Authoritative confirmation is unavailable. Outcome stays UNKNOWN and another dispatch remains blocked. Restore provider truth when ready; never bypass the protection.' + : data.message; + for (const [index, side] of ['naive', 'safe'].entries()) { + host.querySelector(`[data-effects-${side}]`).textContent = String(data.effects[index]); + const list = host.querySelector(`[data-events-${side}]`); + list.replaceChildren( + ...data[side].map((text) => { + const li = document.createElement('li'); + li.textContent = text; + return li; + }), + ); + } + next.hidden = !data.next; + if (data.next) next.textContent = unavailable ? 'Restore truth and reconcile' : data.next; + truth.hidden = step !== 4 || unavailable; + host.querySelector('[data-demo-result]').hidden = step !== 5; + } + next.addEventListener('click', () => { + step = Math.min(step + 1, stages.length - 1); + unavailable = false; + if (step === 1) report('demo_started'); + if (step === 4) report('unknown_state_viewed'); + if (step === 5) report('demo_completed'); + render(); + if (next.hidden) host.querySelector('[data-demo-reset]').focus(); + }); + truth.addEventListener('click', () => { + unavailable = true; + render(); + next.focus(); + }); + host.querySelector('[data-demo-reset]').addEventListener('click', () => { + step = 0; + unavailable = false; + render(); + next.focus(); + }); + host.querySelector('[data-demo-controls]').hidden = false; + render(); +})(); diff --git a/docs/retry-exposure/index.html b/docs/retry-exposure/index.html new file mode 100644 index 00000000..653f6026 --- /dev/null +++ b/docs/retry-exposure/index.html @@ -0,0 +1,94 @@ + + + + + + + Once — estimate retry exposure + + + + + + + + + + + + + + + +
+ +
+
+

Optional analysis

+

Estimate retry exposure.

+

+ This calculator performs browser arithmetic. It does not send requests or measure Once throughput. A retry is not automatically a + duplicate. +

+
+
+ +
+
+
+

Enter conservative assumptions and estimate. No traffic is generated.

+ +

+ Formula: calls × retry rate / 100 = estimated retry events. Events × average action value = exposure context. This is neither + expected loss nor prevented loss. Provider-native idempotency may already protect some retries. +

+ +
+ +

+ + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 797076d4..e3de2459 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,6 +1,6 @@ - https://onceexec.com/2026-09-25weekly1.0 + https://onceexec.com/2026-10-01weekly1.0 https://onceexec.com/research/2026-09-26monthly0.95 https://onceexec.com/project-identity/2026-09-26monthly0.95 https://onceexec.com/support/2026-09-26weekly0.95 @@ -19,4 +19,8 @@ https://onceexec.com/microsoft-agent-framework-safe-retries/2026-09-20weekly0.9 https://onceexec.com/claude-code-mcp-safe-retries/2026-09-20weekly0.9 https://onceexec.com/cursor-mcp-safe-retries/2026-09-20weekly0.9 +https://onceexec.com/demo/2026-10-01weekly0.9 +https://onceexec.com/quickstart/2026-10-01weekly0.9 +https://onceexec.com/evidence/2026-10-01weekly0.9 +https://onceexec.com/retry-exposure/2026-10-01weekly0.9 diff --git a/docs/vercel-ai-sdk-safe-retries/index.html b/docs/vercel-ai-sdk-safe-retries/index.html index 5e4a41bf..a4360c07 100644 --- a/docs/vercel-ai-sdk-safe-retries/index.html +++ b/docs/vercel-ai-sdk-safe-retries/index.html @@ -55,7 +55,7 @@

Vercel AI SDK example

Add execution safety to AI SDK tools

npm install @once-agent/sdk
-

Try the Once tester · SDK package · Vercel AI SDK example

+

Run the retry simulation · SDK package · Vercel AI SDK example

diff --git a/examples/local-function/README.md b/examples/local-function/README.md index 2ac87961..57103259 100644 --- a/examples/local-function/README.md +++ b/examples/local-function/README.md @@ -1,5 +1,9 @@ # Protect an existing async function on one machine +For the maintained current-package first-action guide, including fresh-process +replay and UNKNOWN checks, see [the website quickstart](https://onceexec.com/quickstart/). +The v0.1.9 fixture below remains historical reproducibility evidence. + `protectLocal` was introduced in the published `@once-agent/sdk` 0.1.7 package and remains part of the current SDK. This guide covers its durable same-machine SQLite safety boundary. diff --git a/plugins/openai/once/skills/protect-consequential-writes/SKILL.md b/plugins/openai/once/skills/protect-consequential-writes/SKILL.md index 20dc103e..4513a3d0 100644 --- a/plugins/openai/once/skills/protect-consequential-writes/SKILL.md +++ b/plugins/openai/once/skills/protect-consequential-writes/SKILL.md @@ -42,15 +42,15 @@ Never make an operation ID unique by adding a timestamp, random retry token, age 1. **Assess after the gate passes** — once a qualifying external-write candidate has already been identified, call `once_assess_project` with the absolute project path. If MCP is unavailable, run the pinned CLI fallback: - `npx --yes --package=@once-agent/sdk@0.1.18 once scan ` + `npx --yes --package=@once-agent/sdk@0.1.22 once scan ` 2. **Explain applicability** — for each high-signal candidate, verify the four routing conditions. Use `once_explain_risk` when helpful. Do not equate every POST, write, retry loop, or MCP action with a Once requirement. 3. **Plan before mutation** — call `once_plan_setup` and/or `once_plan_protection`. If using the CLI, prefer read-only planning commands such as: - - `npx --yes --package=@once-agent/sdk@0.1.18 once setup --plan` - - `npx --yes --package=@once-agent/sdk@0.1.18 once protect ` - - `npx --yes --package=@once-agent/sdk@0.1.18 once protect --all --patch` + - `npx --yes --package=@once-agent/sdk@0.1.22 once setup --plan` + - `npx --yes --package=@once-agent/sdk@0.1.22 once protect ` + - `npx --yes --package=@once-agent/sdk@0.1.22 once protect --all --patch` 4. **Show the plan** — identify the exact operation, why it qualifies, the stable identity inputs, the provider/reconciliation assumption, and the files or callsites that would change. @@ -60,7 +60,7 @@ Never make an operation ID unique by adding a timestamp, random retry token, age 7. **Verify** — run `once_verify_connection` when Cloud verification is relevant, or use: - `npx --yes --package=@once-agent/sdk@0.1.18 once doctor` + `npx --yes --package=@once-agent/sdk@0.1.22 once doctor` Do not expose `ONCE_API_KEY` in output, source code, patches, logs, or committed configuration. diff --git a/scripts/check-site-surface.mjs b/scripts/check-site-surface.mjs index 6c099ca5..a0fb0026 100644 --- a/scripts/check-site-surface.mjs +++ b/scripts/check-site-surface.mjs @@ -10,6 +10,7 @@ const mcpPackage = JSON.parse(read("mcp/package.json")); const published = JSON.parse(read("docs/published-versions.json")); const pythonProject = read("sdk/python/pyproject.toml"); const pageAnalytics = read("docs/page-analytics.js"); +const homepage = read("docs/index.html"); const app = read("docs/app.js"); const styles = read("docs/styles.css"); const wrangler = read("workers/runtime/wrangler.jsonc"); @@ -25,9 +26,9 @@ const claudeReadme = read("plugins/claude-code/once/README.md"); const pythonVersion = pythonProject.match(/^version\s*=\s*"([^"]+)"/m)?.[1]; assert.ok(pythonVersion, "could not read Python SDK version"); -const siteTs = pageAnalytics.match(/ts:\s*"([^"]+)"/)?.[1]; -const sitePython = pageAnalytics.match(/python:\s*"([^"]+)"/)?.[1]; -const siteMcp = pageAnalytics.match(/mcp:\s*"([^"]+)"/)?.[1]; +const siteTs = homepage.match(/data-version="ts">([^<]+)/)?.[1]; +const sitePython = homepage.match(/data-version="python">([^<]+)/)?.[1]; +const siteMcp = homepage.match(/data-version="mcp">([^<]+)/)?.[1]; function patchVersion(value) { assert.match(value, /^\d+\.\d+\.\d+$/, "expected a stable published version"); @@ -79,29 +80,14 @@ assert.ok( "Claude Code plugin README must match the current published MCP version", ); -assert.match( - pageAnalytics, - /document\.querySelector\("\.status"\)/, - "homepage version badge updater is missing", -); - -assert.match( - pageAnalytics, - /footer > span:last-child/, - "homepage footer version updater is missing", -); - -assert.match( - pageAnalytics, - /data\.softwareVersion\s*=\s*SITE_VERSIONS\.ts/, - "homepage JSON-LD version updater is missing", -); - -assert.ok( - app.includes("https://once-q18-cloud.pennywatch.workers.dev/v1/public/stats"), - "homepage counter must target the public runtime stats route", -); - +assert.match(homepage, /Run the retry demo/, "homepage must lead to the ungated demo"); +assert.doesNotMatch(homepage, /once-network|Open live proof|Test Once at your scale/, "obsolete proof/funnel claims must stay removed"); +const schema = JSON.parse(homepage.match(/`, ''); +} +demo = demo.replace(/href="\/(?!\/)([^"#]*)"/g, (_, suffix) => `href="https://onceexec.com/${suffix}"`); +demo = demo.replace('', ``); +outputs.set( + 'workers/playground/src/retry-demo-page.js', + `// Generated by scripts/generate-site-surface.mjs; do not hand-edit.\nexport default ${JSON.stringify(demo)};\n`, +); +let changed = false; +for (const [file, value] of outputs) { + let current = ''; + try { + current = read(file); + } catch {} + if (current !== value) { + changed = true; + if (!process.argv.includes('--check')) writeFileSync(resolve(root, file), value); + else console.error(`Out-of-date generated surface: ${file}`); + } +} +if (process.argv.includes('--check') && changed) process.exitCode = 1; +else console.log(`Site versions and shared demo checked: ${JSON.stringify(versions)}`); diff --git a/scripts/website-browser-check.mjs b/scripts/website-browser-check.mjs new file mode 100644 index 00000000..59eff281 --- /dev/null +++ b/scripts/website-browser-check.mjs @@ -0,0 +1,123 @@ +// Automated acceptance checks against a disposable local HTTP server. +// npm install --no-save playwright, then npx playwright install chromium. +// Optional environment paths let an existing browser/runtime be reused. +import assert from 'node:assert/strict'; +import { createServer } from 'node:http'; +import { readFileSync, existsSync, statSync, mkdirSync } from 'node:fs'; +import { resolve, extname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +const root = fileURLToPath(new URL('../', import.meta.url)); +const docs = resolve(root, 'docs'); +const artifacts = process.env.ONCE_WEBSITE_ARTIFACTS || resolve(root, '.website-check'); +mkdirSync(artifacts, { recursive: true }); +const { chromium } = await import(process.env.ONCE_PLAYWRIGHT_MODULE || 'playwright'); +const server = createServer((req, res) => { + let file = resolve(docs, '.' + new URL(req.url, 'http://localhost').pathname); + if (!file.startsWith(docs + '/') && file !== docs) { + res.writeHead(403).end(); + return; + } + if (existsSync(file) && statSync(file).isDirectory()) file = resolve(file, 'index.html'); + if (!existsSync(file)) { + res.writeHead(404).end(); + return; + } + const types = { + '.html': 'text/html', + '.js': 'text/javascript', + '.css': 'text/css', + '.mjs': 'text/javascript', + '.json': 'application/json', + }; + res.setHeader('content-type', types[extname(file)] || 'text/plain'); + res.end(readFileSync(file)); +}); +await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); +const base = `http://127.0.0.1:${server.address().port}`; +const browser = await chromium.launch({ + headless: true, + ...(process.env.ONCE_CHROMIUM_PATH + ? { executablePath: process.env.ONCE_CHROMIUM_PATH, args: ['--no-sandbox', '--disable-dev-shm-usage'] } + : {}), +}); +const errors = []; +try { + const page = await browser.newPage(); + page.on('pageerror', (e) => errors.push(e.message)); + for (const width of [360, 390, 768, 1440]) { + await page.setViewportSize({ width, height: 1000 }); + await page.goto(base); + assert.equal(await page.locator('h1').count(), 1); + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), `overflow at ${width}`); + const hero = page.locator('.hero').getByRole('link', { name: 'Run the retry demo' }); + const bounds = await hero.boundingBox(); + assert.ok(bounds.y + bounds.height < 1000, `primary CTA too late at ${width}`); + await page.screenshot({ path: resolve(artifacts, `home-${width}.png`) }); + await hero.click(); + const next = page.locator('[data-demo-next]'); + await next.click(); + await next.click(); + assert.equal(await page.locator('[data-effects-safe]').innerText(), '1'); + assert.equal(await page.locator('[data-effects-naive]').innerText(), '2'); + await next.click(); + assert.match(await page.locator('[data-demo-state]').innerText(), /CONFLICT/); + await next.click(); + assert.match(await page.locator('[data-demo-state]').innerText(), /UNKNOWN/); + await page.getByRole('button', { name: 'Provider truth unavailable', exact: true }).click(); + assert.match(await page.locator('[data-demo-message]').innerText(), /stays UNKNOWN/); + assert.equal(await page.locator('[data-effects-safe]').innerText(), '1'); + await next.click(); + assert.match(await page.locator('[data-demo-state]').innerText(), /RECONCILED/); + assert.ok(await page.locator('[data-demo-result]').isVisible()); + await page.screenshot({ path: resolve(artifacts, `demo-${width}.png`) }); + for (const route of ['/quickstart/', '/evidence/', '/demo/', '/retry-exposure/']) { + await page.goto(base + route); + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), `${route} overflow at ${width}`); + } + } + await page.goto(base + '/quickstart/'); + // Stub clipboard only in this test to verify the handler's actual text/feedback. + await page.evaluate(() => { + window.testCopied = ''; + Object.defineProperty(navigator, 'clipboard', { + value: { + writeText: async (t) => { + window.testCopied = t; + }, + }, + configurable: true, + }); + }); + await page.getByRole('button', { name: 'Copy setup commands', exact: true }).click(); + assert.match(await page.evaluate(() => window.testCopied), /npm install @once-agent\/sdk@0.1.22/); + assert.equal(await page.locator('[data-copy-status]').innerText(), 'Copied to clipboard.'); + await page.locator('summary').first().click(); + const sample = await page.locator('#example').innerText(); + assert.equal(sample, readFileSync(resolve(docs, 'quickstart/first-action.mjs'), 'utf8')); + await page.screenshot({ path: resolve(artifacts, 'quickstart.png') }); + await page.goto(base + '/retry-exposure/'); + await page.getByRole('button', { name: 'Estimate exposure' }).click(); + assert.match(await page.locator('[data-exposure-result]').innerText(), /10 estimated retry events/); + await page.goto(base); + await page.keyboard.press('Tab'); + assert.equal(await page.evaluate(() => document.activeElement.textContent), 'Skip to content'); + await page.keyboard.press('Enter'); + assert.equal(await page.evaluate(() => document.activeElement.id), 'main'); + await page.emulateMedia({ reducedMotion: 'reduce' }); + assert.equal(await page.evaluate(() => getComputedStyle(document.documentElement).scrollBehavior), 'auto'); + await page.setViewportSize({ width: 720, height: 500 }); // 1440 viewport at 200% effective CSS width + await page.goto(base); + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), '200% reflow'); + await page.screenshot({ path: resolve(artifacts, 'zoom-reflow.png') }); + const noJs = await browser.newPage({ javaScriptEnabled: false }); + await noJs.goto(base + '/demo/'); + assert.ok(await noJs.locator('noscript p').isVisible()); + assert.equal(await noJs.locator('[data-demo-controls]').isVisible(), false); + assert.deepEqual(errors, []); + console.log( + 'PASS browser acceptance: 360/390/768/1440, all funnel pages, replay/conflict/UNKNOWN/unavailable truth/reconciliation, clipboard, code parity, calculator, keyboard skip, reduced motion, 200% reflow, no-JS and no console exceptions', + ); +} finally { + await browser.close(); + await new Promise((resolve) => server.close(resolve)); +} diff --git a/scripts/website-funnel.test.mjs b/scripts/website-funnel.test.mjs new file mode 100644 index 00000000..575d1d2b --- /dev/null +++ b/scripts/website-funnel.test.mjs @@ -0,0 +1,56 @@ +import assert from 'node:assert/strict'; +import { readFileSync, existsSync } from 'node:fs'; +import { resolve, dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import test from 'node:test'; +import playground from '../workers/playground/src/index.js'; +const root = fileURLToPath(new URL('../', import.meta.url)); +const docs = resolve(root, 'docs'); +const pages = ['index.html', 'demo/index.html', 'quickstart/index.html', 'evidence/index.html', 'retry-exposure/index.html']; + +test('new funnel local links and fragment destinations resolve', () => { + for (const file of pages) { + const source = readFileSync(resolve(docs, file), 'utf8'); + assert.equal((source.match(/]/g) || []).length, 1, `${file}: one main heading`); + assert.match(source, /]*\bid="main"/); + for (const [, target] of source.matchAll(/href="([^"]+)"/g)) { + if (/^(https?:|mailto:)/.test(target)) continue; + const [path, fragment] = target.split('#'); + let absolute = path.startsWith('/') + ? resolve(docs, '.' + path) + : resolve(dirname(resolve(docs, file)), path || file.split('/').at(-1)); + if (path.endsWith('/')) absolute = resolve(absolute, 'index.html'); + assert.ok(existsSync(absolute), `${file}: missing ${target}`); + if (fragment) assert.ok(readFileSync(absolute, 'utf8').includes(`id="${fragment}"`), `${file}: missing fragment ${target}`); + } + } +}); +test('playground root is ungated and does not need a billing environment', async () => { + const response = await playground.fetch(new Request('https://playground.onceexec.com/'), {}); + assert.equal(response.status, 200); + const body = await response.text(); + assert.match(body, /INTERACTIVE SIMULATION/); + assert.doesNotMatch(body, /Start Pro Sandbox|\/api\/checkout|STRIPE|cs_test/); + assert.match(body, /Outcome stays UNKNOWN/); +}); +test('hosted activation remains a separate explicitly named route', async () => { + const response = await playground.fetch(new Request('https://playground.onceexec.com/hosted'), {}); + const body = await response.text(); + assert.match(body, /Start Pro Sandbox/); + assert.match(body, /Optional hosted activation uses Stripe test checkout/); + assert.match(body, /Run the ungated simulation first/); +}); +test('website funnel events use bounded allowlist and no SDK activation claim', async () => { + const writes = []; + const env = { ONCE_ANALYTICS: { writeDataPoint: (value) => writes.push(value) } }; + const request = (event) => + new Request('https://playground.onceexec.com/analytics/event', { + method: 'POST', + headers: { origin: 'https://onceexec.com', 'content-type': 'application/json' }, + body: JSON.stringify({ event, source: 'website' }), + }); + assert.equal((await playground.fetch(request('demo_completed'), env)).status, 204); + assert.deepEqual(writes[0].blobs, ['demo_completed', 'website']); + assert.equal((await playground.fetch(request('sdk_activated'), env)).status, 400); + assert.equal(writes.length, 1); +}); diff --git a/workers/playground/src/index.js b/workers/playground/src/index.js index 7e5aa5f8..7bdad533 100644 --- a/workers/playground/src/index.js +++ b/workers/playground/src/index.js @@ -1,3 +1,4 @@ +import RETRY_DEMO_PAGE from "./retry-demo-page.js"; var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); @@ -1938,16 +1939,15 @@ footer{

- BREAK THE NETWORK. + ACTIVATE A HOSTED
- NOT THE - TRANSACTION. + SANDBOX.

- Run the failure mode that makes consequential AI-agent actions - dangerous. Let the provider execute, lose the response, retry the - same operation \u2014 then inspect what actually happened. + Optional hosted activation uses Stripe test checkout. This is separate + from learning the retry decisions. + Run the ungated simulation first. Do not enter real card data.

@@ -6407,7 +6407,11 @@ var index_default = { "npm_clicked", "mcp_npm_clicked", "github_clicked", - "agent_guide_clicked" + "agent_guide_clicked", + "homepage_view", "hero_demo_click", "demo_started", "demo_completed", + "unknown_state_viewed", "protect_first_action_click", "mode_selected", + "quickstart_started", "install_copied", "first_action_step_reached", + "github_click", "docs_click", "hosted_sandbox_click" ]); const allowedSources = /* @__PURE__ */ new Set([ "website", @@ -7255,9 +7259,12 @@ var index_default = { SUCCESS_PAGE ); } - if (request.method === "GET" && url.pathname === "/") { + if (request.method === "GET" && url.pathname === "/hosted") { return html(PAGE); } + if (request.method === "GET" && url.pathname === "/") { + return html(RETRY_DEMO_PAGE); + } return json3( { error: "not_found" diff --git a/workers/playground/src/retry-demo-page.js b/workers/playground/src/retry-demo-page.js new file mode 100644 index 00000000..9f57a8bc --- /dev/null +++ b/workers/playground/src/retry-demo-page.js @@ -0,0 +1,2 @@ +// Generated by scripts/generate-site-surface.mjs; do not hand-edit. +export default "\n\n\t\n\t\t\n\t\t\n\t\t\n\t\tOnce retry demo — interactive simulation\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\n\t\tSkip to content\n\t\t
\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t

Ungated demonstration

\n\t\t\t

See what a retry should decide.

\n\t\t\t

Interactive simulation of Once’s documented state decisions. No account or checkout required.

\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tINTERACTIVE SIMULATION\n\t\t\t\t\t\t

Ready

\n\t\t\t\t\t
\n\t\t\t\t\t

No account. No checkout. No external writes.

\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Without protection · blind retry

\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  1. The action commits; acknowledgement is lost.
  2. \n\t\t\t\t\t\t\t
  3. A blind retry can create a second ticket.
  4. \n\t\t\t\t\t\t
\n\t\t\t\t\t\t—Simulated effects for this intent\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

With Once · protected boundary

\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  1. Known success can be replayed.
  2. \n\t\t\t\t\t\t\t
  3. Unknown outcome blocks another dispatch.
  4. \n\t\t\t\t\t\t
\n\t\t\t\t\t\t—Simulated effects for this intent\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\tNOT STARTED\n\t\t\t\t\t

Use the controls to explore confirmed replay, changed-input conflict and uncertain outcomes.

\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t

\n\t\t\t\t\t\tInteractive controls need JavaScript. The explanation above remains available.\n\t\t\t\t\t\tRun the actual SDK locally.\n\t\t\t\t\t

\n\t\t\t\t\n\t\t\t\t

\n\t\t\t\t\tThis browser simulation illustrates Once’s documented behavior. It does not run the SDK, persist execution state or prove\n\t\t\t\t\texternal-provider durability. Inspect reproducible evidence or\n\t\t\t\t\tverify the installed SDK.\n\t\t\t\t

\n\t\t\t
\n\t\t\t
\n\t\t\t\tProtect your first action\n\t\t\t
\n\t\t
\n\t\t\n\t\t

\n\t\n\n";