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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Historical SDK change notes are recorded here. For current published versions an
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.26 - Unreleased candidate

- Update the development MCP TypeScript SDK dependency to patched 1.32.1 for GHSA-6qxp-vccf-f47h. The development dependency is not shipped as an SDK runtime dependency.
- Clarify diagnostic evidence wording and current onboarding guidance; diagnosis and scanner findings do not establish protection or independent adoption.
- Include the already advertised `http-response-json` CommonJS entrypoint in the package and verify both module formats across the packed boundary.
- No execution kernel, public export, ledger schema, identity/effect binding or reconciliation behavior change. See [candidate release notes](docs/RELEASE_0_1_26.md).

## 0.1.25 - 2026-10-04

- Add `once prove`: account-free local HTTP refund fixture with separate provider journal, acknowledgement loss, fresh processes, replay, CONFLICT and authoritative recovery. It never invokes arbitrary application code.
Expand Down
15 changes: 15 additions & 0 deletions docs/RELEASE_0_1_26.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SDK 0.1.26 candidate — development dependency and evidence wording

This is an unpublished release candidate. It incorporates the reviewed adoption-guidance changes from PR308 and pins the development MCP TypeScript SDK dependency to 1.32.1, outside the affected range for [GHSA-6qxp-vccf-f47h](https://github.com/advisories/GHSA-6qxp-vccf-f47h).

Diagnostic output distinguishes configured, discoverable and tested behavior. Read-only candidates and successful local fixtures do not establish real-provider qualification, independent adoption or production readiness.

The candidate also repairs an existing packaging defect: the advertised CommonJS `@once-agent/sdk/http-response-json` export lacked its compiled file. The existing helper is now included in the CommonJS build, with packed ESM/CommonJS import regression coverage; its implementation and public signature are unchanged.

No execution kernel, public export, identity/fingerprint algorithm, durable ledger schema, provider authority or redispatch rule changes. UNKNOWN remains blocked until authoritative reconciliation; changed effects conflict and confirmed results replay. Local SQLite still requires Node24.15+ and a retained same-machine authority. No ledger migration is required.

The patched MCP dependency is development-only; shipped SDK runtime dependencies remain unchanged. Compatibility is checked with serial release regressions, packed ESM/CommonJS/TypeScript consumers, and package content/API comparison. Windows results must be complemented by Linux validation of the exact candidate head before publication.

Publication must use the exact tested tarball and verify registry integrity and clean installed consumers afterward. `docs/published-versions.json` and public installation pins remain at 0.1.25 until 0.1.26 is independently verified in the registry. MCP and Python versions remain separate.

Rollback: applications can pin the previous published `@once-agent/sdk@0.1.25` while retaining the original operation identities and durable state. This patch does not change ledger formats or require destructive recovery. If publication verification fails, do not update current-version pins or fabricate release completion.
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
14 changes: 7 additions & 7 deletions sdk/typescript/package-lock.json

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

4 changes: 2 additions & 2 deletions sdk/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@once-agent/sdk",
"version": "0.1.25",
"version": "0.1.26",
"description": "Block duplicate consequential writes after lost acknowledgements; replay confirmed results and reconcile uncertain outcomes.",
"type": "module",
"main": "./dist/index.js",
Expand Down 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
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ try {
import assert from "node:assert/strict";
import { Buffer } from "node:buffer";
import { executeHttpWriteResponse } from "@once-agent/sdk/http-response";
import { executeHttpWriteJsonResponse } from "@once-agent/sdk/http-response-json";
assert.equal(typeof executeHttpWriteJsonResponse, "function");

const targetBody = JSON.stringify({ created: true, id: "external-1" });
const targetBytes = Buffer.from(targetBody, "utf8");
Expand Down Expand Up @@ -330,6 +332,8 @@ console.log("PACKED NATIVE RESPONSE PASS");
"-e",
[
'const m = require("@once-agent/sdk/http-response");',
'const json = require("@once-agent/sdk/http-response-json");',
'if (typeof json.executeHttpWriteJsonResponse !== "function") process.exit(3);',
'if (typeof m.executeHttpWriteResponse !== "function") process.exit(2);',
'console.log("CJS NATIVE RESPONSE PASS");'
].join("\n")
Expand All @@ -350,6 +354,7 @@ console.log("PACKED NATIVE RESPONSE PASS");

console.log("PASS - fresh publishable SDK tarball created");
console.log("PASS - packed SDK exposes @once-agent/sdk/http-response for ESM and CJS");
console.log("PASS - packed SDK exposes @once-agent/sdk/http-response-json for ESM and CJS");
console.log("PASS - packed helper reconstructs a real native Response with replay-v2 metadata");
console.log("PASS - clone/bodyUsed/text/json/header immutability survive the package boundary");
console.log("PASS - legacy v1 and malformed v2 receipts fail closed");
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."
);
}
3 changes: 2 additions & 1 deletion sdk/typescript/tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"src/discovery/index.ts",
"src/gateway/index.ts",
"src/reconciliation/index.ts",
"src/http-response.ts"
"src/http-response.ts",
"src/http-response-json.ts"
],
"exclude": [
"src/**/*.before-*.ts"
Expand Down
Loading