Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/adoption-measurement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Measuring adoption without overstating evidence

Installation, download counts, scanner candidates, route-proof receipts and
controlled fixtures measure different things. None establishes independent
customer usage or production-provider safety.

## Opt-in onboarding records

Keep records locally by default. A participant may voluntarily share a redacted
record; no SDK telemetry endpoint or customer identifier is required. Freeze the
package versions, runtime, instructions and fixture before starting each cohort.

Record one row per attempted path, including failures:

| Field | Meaning |
| --- | --- |
| run_id | Random study-local identifier; no user/account identifier |
| evidence_tier | controlled-fixture, provider-sandbox, or voluntary-independent-reproduction |
| versions/runtime/platform | Exact installed packages and execution environment |
| path | TypeScript, Python, MCP, Claude Code, Codex, Agents SDK or ADK |
| start/installation/first-protected/recovery timestamps | Measure each phase separately; leave unobserved phases null |
| outcome | success, install-failure, adapter-required, unsupported, recovery-blocked or abandoned |
| interventions | Number of manual corrections or maintainer interventions |
| effect_counts | Separately observed initial, replay, changed-input and recovery effects |
| receipt | Redacted link to journal/test evidence, with its authority and limitations |

Never share secrets, payloads, account IDs, raw operation IDs or filesystem paths.
Publishing aggregate results is opt-in; report the sample size and all failures.
Calculate fresh-install success as successful attempts / all attempted installs,
and report adapter-required and unsupported outcomes separately. Time to first
protected action starts at the participant's first view of the frozen instructions,
not at CLI launch. Separate installation time, execution time and human integration
time. Recovery success requires independently observed provider truth and effect
counts, not only a returned success object.

## Existing local CLI metrics

`once` prints heuristic candidate/applicability counts and a current route-proof
receipt. Its elapsed time is CLI processing time. These diagnostics send no
telemetry; their labels do not establish a complete application/provider proof or
human onboarding duration. Do not combine these rates with actual installations,
independent reproductions, repeat usage or customer totals.

The FIRST 10 proof is a reproducible controlled loopback fixture. Keep its
provider journal and negative control alongside results. Its runtime can track
fixture regressions, but does not measure real-world user adoption. Hosted Python
execution, live model selection and installed Claude/Codex routing need separate
account/configuration and observed checks.
19 changes: 10 additions & 9 deletions examples/connected-openai-agents/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# OpenAI Agents calls Once automatically at the tool boundary

> [!NOTE]
> ## Published baseline and next-release candidate
> ## Historical published baseline
>
> This directory is intentionally pinned to the **currently published**
> This directory is intentionally pinned to the **historically published**
> `@once-agent/sdk@0.1.11` package so it remains a reproducible baseline.
>
> Repository `main` now also contains the higher-level automatic Connect stack,
> including whole-toolset routing, automatic identity/effect binding, and direct
> OpenAI Agents FunctionTool wrapping. That release candidate has passed the
> source, packed-package, ESM/CommonJS, and Node.js 24.15 protected-execution
> gates, but it is not in npm until the next SDK version is explicitly published.
> The current published SDK is **0.1.25**. Its Connect stack includes whole-toolset
> routing and direct OpenAI Agents FunctionTool wrapping. Developers still own
> stable logical operation identity and complete effect-bearing fields; tool-call
> IDs and payload hashes do not establish user intent. Installation does not
> automatically protect sibling tools or direct provider calls.
>
> See [`docs/CONNECT_AUTO.md`](../../docs/CONNECT_AUTO.md) for the automatic
> Connect API and tested release boundary. The release PR will update this
> example's SDK dependency only after the new npm version exists.
> Connect API and tested release boundary. To start with the current package,
> use [`examples/first10`](../first10/README.md), then review your application's
> execution boundary. This older fixture remains pinned for reproducibility.

This is a runnable example using the **published** `@once-agent/sdk@0.1.11`,
OpenAI Agents SDK and a fake booking provider. It uses the Agents SDK's
Expand Down
12 changes: 10 additions & 2 deletions mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# MCP 0.2.1 candidate
# Unreleased

- Update the declared MCP client dependency from 2.0.0 to 2.3.1, removing the
affected OAuth client version in GHSA-6qxp-vccf-f47h. Once's inspected runtime
is a server/stdio boundary, which the advisory excludes; no HTTP OAuth
credential path was identified. Tool schemas and execution behavior are unchanged.
- This is source preparation for a future MCP patch; npm/Registry remains 0.2.1.

# MCP 0.2.1

- Correct once_verify_connection: retain local diagnostics, explicitly report
Cloud configuration/verification, request actual read-only Cloud checks when
configured, and propagate failed checks. Tool names/input remain compatible.
- Add one compatibility/continuity matrix; correct stale release and timeout
statements and distinguish default helper, opt-in action and reviewed proxy.
- No execution state-machine, ledger schema, plugin pin or private adapter change.
- Not published: current npm/Registry remains 0.2.0 until independently verified.
- npm and the MCP Registry were independently verified at 0.2.1 on 10 October 2026.

# MCP 0.2.0

Expand Down
26 changes: 19 additions & 7 deletions mcp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"node": ">=20"
},
"dependencies": {
"@modelcontextprotocol/client": "2.0.0",
"@modelcontextprotocol/client": "2.3.1",
"@modelcontextprotocol/server": "2.0.0",
"@once-agent/sdk": "0.1.25",
"zod": "4.6.5"
Expand Down
34 changes: 30 additions & 4 deletions mcp/scripts/phase13b-stdio-e2e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,38 @@ try {
assert.equal(count(), 0);
unlinkSync(driftPath);

// MCP client v2.0.0 auto-aggregation can silently truncate a catalog when a
// server legally repeats an opaque cursor. Once walks raw pages separately,
// primes the SDK cache, and refuses to proceed if the two inventories differ.
// The patched client preserves the complete inventory when a server repeats
// an opaque cursor. Verify that third page independently, then require Once
// to reject its unreviewed tool before any provider dispatch.
writeFileSync(driftPath, "repeated-cursor");
const paginated = new Client({ name: "once-pagination-control", version: "0.0.1" });
try {
await paginated.connect(new StdioClientTransport({
command: config.command, args: config.args,
}));
assert.deepEqual((await paginated.listTools()).tools.map(tool => tool.name),
["create_order", "read_count", "third_read"]);
} finally {
await paginated.close();
}
await assert.rejects(connectStdioProxy(config),
/INVALID_TOOL_CATALOG: SDK aggregate differs from raw catalog/);
/^Error: TOOL_SCHEMA_CHANGED: upstream catalog differs from reviewed configuration$/);
assert.equal(count(), 0);

// Retain a negative control for the older client's truncated aggregation:
// even when an SDK inventory omits page three, the raw walk detects the
// mismatch. This changes only the test client's convenience API, not truth.
const originalListTools = Client.prototype.listTools;
Client.prototype.listTools = async function (...args) {
const result = await originalListTools.apply(this, args);
return { ...result, tools: result.tools.filter(tool => tool.name !== "third_read") };
};
try {
await assert.rejects(connectStdioProxy(config),
/^Error: INVALID_TOOL_CATALOG: SDK aggregate differs from raw catalog$/);
} finally {
Client.prototype.listTools = originalListTools;
}
assert.equal(count(), 0);
unlinkSync(driftPath);

Expand Down
16 changes: 15 additions & 1 deletion sdk/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,29 @@ Published package: https://pypi.org/project/once-agent-sdk/

## Quick start

This hosted-client example needs an `ONCE_API_KEY` and a reviewed provider
registered under `my-provider`; the alias below is a placeholder. Installation
alone does not register a payment provider or protect other tool calls. Set the
key before constructing `Once`. Do not run this against real money for a smoke test.

```python
from once_agent import Once

once = Once()

order_id = "order_123"
operation_id = Once.id("refund", order_id)
refund_intent_id = "refund_request_456" # Persist once for this intentional refund.
operation_id = Once.id("merchant_7", "refund", refund_intent_id)

result = once.execute(
operation_id=operation_id,
provider="my-provider",
action={
"type": "refund",
"order_id": order_id,
"amount_cents": 5000,
"currency": "GBP",
"merchant_id": "merchant_7",
},
)
```
Expand All @@ -48,6 +57,11 @@ If an external action succeeds but its response is lost, retrying the action wit

`Once.id(...)` generates a deterministic operation ID, so retries of the same logical operation can retain the same identity.

Use a persisted intent ID and account/tenant authority. Separate intentional
partial refunds on one order need different intent IDs, even if their amounts
match. Bind every effect-bearing field in the reviewed action schema. Do not
mint a new ID to bypass an unresolved original action.

```python
a = Once.id("refund", "order_123")
b = Once.id("refund", "order_123")
Expand Down
10 changes: 5 additions & 5 deletions sdk/typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"node": ">=18"
},
"devDependencies": {
"@modelcontextprotocol/sdk": "1.27.1",
"@modelcontextprotocol/sdk": "1.32.1",
"@types/node": "^26.6.1"
},
"bin": {
Expand Down
2 changes: 2 additions & 0 deletions sdk/typescript/scripts/zero-friction-cli-regression.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ try {
assert.match(bare.stdout, /Verified Protection Rate: \d+(?:\.\d+)?%/);
assert.match(bare.stdout, /Time-to-Protected: not yet achieved/);
assert.match(bare.stdout, /no telemetry is sent/i);
assert.match(bare.stdout, /Candidates and applicability are heuristic/);
assert.match(bare.stdout, /not an observed provider effect/);
assert.equal(
await readFile(sourcePath, "utf8"),
source,
Expand Down
5 changes: 4 additions & 1 deletion sdk/typescript/src/adoption-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,7 @@ export function printAdoptionMetrics(
console.log(
"Metrics are computed locally from the protection plan and current route-proof receipt; no telemetry is sent."
);
}
console.log(
"Candidates and applicability are heuristic. A route-proof receipt is not an observed provider effect, successful recovery, customer adoption, or end-to-end onboarding time."
);
}
Loading