Skip to content
Draft
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
86 changes: 84 additions & 2 deletions .github/workflows/sdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ on:
- "sdk/python/**"
- "mcp/**"
- "conformance/**"
- "README.md"
- "docs/START_HERE.md"
- "docs/GUARANTEES.md"
- "docs/IDENTITY_AND_EFFECT.md"
- "docs/UNKNOWN_PLAYBOOK.md"
- "docs/PRODUCTION_OPERATION.md"
- "docs/published-versions.json"
- "scripts/check-current-onboarding.mjs"
- "scripts/test-current-onboarding.mjs"
- "scripts/test-openai-plugin-line-endings.mjs"
- ".github/workflows/sdk-ci.yml"
push:
branches:
Expand All @@ -18,12 +28,84 @@ on:
- "sdk/python/**"
- "mcp/**"
- "conformance/**"
- "README.md"
- "docs/START_HERE.md"
- "docs/GUARANTEES.md"
- "docs/IDENTITY_AND_EFFECT.md"
- "docs/UNKNOWN_PLAYBOOK.md"
- "docs/PRODUCTION_OPERATION.md"
- "docs/published-versions.json"
- "scripts/check-current-onboarding.mjs"
- "scripts/test-current-onboarding.mjs"
- "scripts/test-openai-plugin-line-endings.mjs"
- ".github/workflows/sdk-ci.yml"

permissions:
contents: read

jobs:
legacy-runtime-boundary:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18', '20']
defaults:
run:
working-directory: sdk/typescript
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: sdk/typescript/package-lock.json
- run: npm ci
- run: npm run build
- name: Hosted compatibility and unsupported local admission
run: node --test ./test/connect/*.test.mjs ./test/unsupported-runtime.test.mjs

onboarding-portability:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: ['24.15.0']
include:
- os: ubuntu-latest
node: '24.x'
runs-on: ${{ matrix.os }}
timeout-minutes: 10
defaults:
run:
working-directory: sdk/typescript
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: sdk/typescript/package-lock.json
- run: npm ci
- run: npm run build
- name: Local and connected execution contracts
run: node --test ./test/local.test.mjs ./test/local-session.test.mjs ./test/connect/*.test.mjs ./test/first-action.test.mjs
- name: Isolated packed first-action proof
run: npm run test:first-action-package
- name: Retained authority and explicit loss boundary
run: npm run test:authority-continuity
- name: Exact authority state and independent provider forensic evidence
run: npm run test:authority-forensics
- name: Current onboarding release references
run: node ../../scripts/check-site-surface.mjs
- name: Onboarding drift regressions
run: node ../../scripts/test-current-onboarding.mjs
- name: Plugin frontmatter portability
run: node ../../scripts/test-openai-plugin-line-endings.mjs

test-release:
runs-on: ubuntu-latest
timeout-minutes: 20
Expand Down Expand Up @@ -99,8 +181,8 @@ jobs:
- name: Run materialized reviewed companion execution proof
run: node ./scripts/materialized-companion-proof-regression.mjs

- name: Run persistent local state regressions
run: node --test ./test/local-session.test.mjs
- name: Run packed first-action proof
run: npm run test:first-action-package

- name: Run MCP boundary mutation regressions
run: node --test ./test/connect/mcp-execution-boundary-mutation.test.mjs
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.1.23 — release candidate, NOT PUBLISHED

- Put the existing credential-free synthetic proof first in documentation and CLI help.
- Add one package-included simulated example covering identity, effect conflict,
UNKNOWN, exact-evidence recovery and fresh-process replay.
- Clarify identity ownership, UNKNOWN operations and local/hosted guarantee boundaries.
- Fix Windows session fixture cleanup and verify open-file locking explicitly.
- Align current public SDK references with independently verified 0.1.22; retain historical pins.
- Add cross-platform local CI and current-surface release checks.
- Update the MCP source dependency to SDK 0.1.22, subject to integration regressions.

These are review-branch changes. No release, merge or deployment is implied.

- Add a disposable cross-process authority-continuity regression and document
measured redispatch after complete state loss or stale backup restoration.
- Prepare SDK package metadata for 0.1.23. Current public registry remains 0.1.22.
- Scope SQLite tests to Node 24.15+ and add a pre-dispatch rejection regression
for unsupported local runtimes; add Node 18/20 compatibility CI.

All notable changes to the Once SDK are documented here.

## 0.1.12 - 2026-09-25
Expand Down
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# @once-agent/sdk

> **Automatic Connect:** `@once-agent/sdk@0.1.18` publishes the tested
## Start with one protected action

Current public TypeScript SDK: **@once-agent/sdk@0.1.22**.
For a credential-free controlled proof on Node.js 24.15+:

```sh
npm install @once-agent/sdk@0.1.22
npx once prove
```

This simulates a lost acknowledgement, blocked retry, recovery and replay.
It does not protect your project's tools merely by being run.
Your application owns persisted intent and complete effect binding.

[Start here](https://github.com/stringsofthemind-oss/once/blob/main/docs/START_HERE.md)
· [Identity and effect](https://github.com/stringsofthemind-oss/once/blob/main/docs/IDENTITY_AND_EFFECT.md)
· [UNKNOWN playbook](https://github.com/stringsofthemind-oss/once/blob/main/docs/UNKNOWN_PLAYBOOK.md)
· [Guarantees](https://github.com/stringsofthemind-oss/once/blob/main/docs/GUARANTEES.md)


> **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
Expand All @@ -23,7 +43,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`
Expand Down Expand Up @@ -212,7 +232,7 @@ ONCE_API_KEY=your_api_key

Do not commit API keys to source control.

## 60-second quick start
## Hosted quick start (provider setup required)

First configure a provider with `once setup .`, or use a provider alias already registered with your Once account.

Expand Down
65 changes: 65 additions & 0 deletions docs/AUTHORITY_CONTINUITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Authority continuity: measured local boundary

The TypeScript local path requires retained durable authority. It cannot
distinguish a new installation from total loss of an old database after restart.
A missing row does not establish provider absence.

## Controlled experiment, 2026-10-01

Run `node sdk/typescript/scripts/authority-continuity-regression.mjs` after
building. Set `ONCE_PRIOR_IMPLEMENTATION` to the absolute public 0.1.22
`dist/index.js` to include upgrade/rollback evidence. The harness owns fresh
temporary directories and deletes only those fixtures. Provider effects live
in a separate file ledger: **simulated, not external provider evidence**.
Each invocation is a fresh process.

| Scenario | Expected contract | Observed on Windows, Node 24.19 | Effects |
|---|---|---|---|
| Normal restart | Replay retained receipt | Original receipt | 1 |
| SQLite current snapshot restore | Replay retained receipt | Original receipt | 1 |
| Public 0.1.22 to review candidate | Retained schema/effect stays replayable | Original receipt | 1 |
| Candidate rollback to 0.1.22, retained state | Same unchanged authority | Original receipt | 1 |
| Closed-process complete state loss | No cross-restart loss detection promised | New database, redispatch | **2** |
| Pre-effect snapshot restored after commit | Stale authority cannot remember missing effect | Redispatch | **2** |
| Process death after provider commit | Reconcile abandoned claim after lease | Original receipt, no write | 1 |
| Recovery interrupted | Read-only recovery can resume | UNKNOWN while unavailable, then receipt | 1 |
| Provider truth unavailable | Block | UNKNOWN | 1 |
| ABSENT assertion after known commit | No local redispatch | UNKNOWN | 1 |

These are demonstrated limitations of the retained-authority contract, not a
new bug introduced by the optimization. They disprove a broader claim that
local restart protection survives arbitrary state loss or stale restore.
Live-session file checks do not close the cross-restart gap. This harness does
not certify multi-host coordination, arbitrary-version migrations, positive
contradictory receipts or an untrusted reconcile callback.

## Operational gate

Stop provider writes after suspected authority loss or stale restore. Retain
business intents independently, identify the affected interval and verify
provider truth before resuming. Do not point the wrapper at an empty file to
escape STATE_UNAVAILABLE or UNKNOWN. Current backup used SQLite `VACUUM INTO`
after calls completed; this is not a hot-backup load test.

A cross-restart authority-loss guarantee requires an independently retained
admission/authority contract and a reviewed migration/bootstrap flow. A sentinel
beside the database can disappear with it and cannot prove freshness after
rollback. Adding one without resolving this boundary gives false confidence.
No such kernel change is included in this candidate.

## Forensic confirmation

`npm run test:authority-forensics` records exact inputs, SQLite rows/schema,
fingerprints, receipt envelopes, independent provider contents, child process
IDs and UTC snapshot/restore boundaries. A stale but valid snapshot retains an
older confirmed B while omitting later committed A; retry A produces its second
effect. Complete authority-directory loss does likewise. A current snapshot
replays A. In all these cases the supplied reconcile callback is never invoked:
missing rows take first-admission, while confirmed rows replay directly.

The harness also models an atomic provider-native identity/effect deduplication
contract surviving local loss. Once dispatches again, but that simulated
provider returns its existing receipt without another effect. This is a
mechanism illustration, not a real-provider or unlimited-retention guarantee.
The provider store is independent of Once loss, and must remain so for that
stronger boundary. No production execution code or storage schema changes.
79 changes: 79 additions & 0 deletions docs/FOUNDING_PRODUCTION_PACKAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Founding production package — proposal for validation

**Internal commercial experiment; not an available production service or an
approved price list.** Repository hosted-readiness gates remain in force. No
live billing, release or deployment is authorized by this document.

## Smallest product worth paying for

One supported consequential workflow with managed durable coordination, a
maintained provider recovery adapter and an owner for unresolved outcomes.
Do not select the first workflow because an adapter already exists.
Stripe refunds are an integration candidate, but native idempotency is a
strong substitute. Qualify for recurring recovery/operational work, not merely
a missing idempotency header. Research agent-created orders, bookings and
account mutations where native protections or recovery are inadequate.
GitHub issue creation is a safe research effect, not a validated paid wedge.
No initial commercial workflow has yet been selected by cold-user evidence.

Hypothesis: **£200/month excluding VAT**, one production project plus staging,
one agreed workflow, two users, inspectable operation history, UNKNOWN alerts,
bounded recovery assistance and onboarding. These contents are acceptance
requirements to validate; not all are implemented or live. Choose operation
allowance, retention and support limits from measured costs before selling.

The local SDK remains useful and free. Charge for operating safety, not for
the ability to block an unsafe retry. Meter unique admitted logical operations;
do not bill each replay, reconciliation or retry. Existing recovery must remain
accessible when new-effect admission is blocked by quotas or subscriptions.
Resolve orphaned meter reservations in the billing policy before live charging.

## Three design partners first

Target small B2B teams deploying support/commerce agents within 60 days, with
consequential writes, retrying workers and a named engineering owner. Trigger:
production launch, a real retry incident or repeated manual recovery work.
Start through one framework/tool integration and a provider sandbox proof.

Pilot acceptance:

1. Trusted code persists intent before dispatch and binds the actual effect.
2. Actual runtime/tool invocation goes through Once; no equivalent raw tool is exposed.
3. First execution/replay/conflict and lost-ack recovery pass in the provider sandbox.
4. Provider effects are independently counted; unresolved truth remains blocked.
5. State continuity, deployed service version and adapter assumptions are reviewed.
6. Operator ownership, support scope and recurring payment acceptance are agreed.

Production delivery still requires explicit owner approval of the actual
deployment/live-provider change. A local fixture or sandbox checkout is not MRR.

## Measurable acquisition funnel

Track organizations, qualified conversations, pilots started, independently
verified protected actions, paid recurring accounts and 30/60/90-day retention.
Measure UNKNOWN age/resolution, onboarding time and support hours. No opt-in
telemetry is introduced by this document.

Working target: approach 20 relevant organizations/week, hold about three
qualified conversations, and start at most one pilot/week while keeping at most
two new integrations active. Founder outreach is an activity plan, not an
assumed conversion rate. No messages are sent by this implementation.

Revenue alternatives:

| Model | Accounts for £2,000 MRR | Early tradeoff |
|---|---:|---|
| £200/month | 10 | Requires real operated value; support must be bounded |
| £100/month | 20 | More acquisition and support; useful if teams self-onboard |
| £50/month | 40 | High account burden before onboarding is repeatable |

Use £200 as the first paid-pilot hypothesis. Seek three recurring commitments
before adding tiers. If at least 15 qualified conversations and five completed
pilots produce fewer than two paying customers, revise the workflow/segment
before adding integrations or discounting. Conversion, retention and time to
£2,000 MRR remain unknown; calculate a forecast only after collecting cohorts.

Retention reason: production execution and uncertain-outcome recovery are
operationally useful every month. Expansion follows additional proven workflows
or volume, not extra agents. If Stripe alone is enough for the cohort, choose
one repeated non-native provider need rather than claiming broader safety.
50 changes: 50 additions & 0 deletions docs/GUARANTEES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Execution-safety boundaries

Current public TypeScript SDK: **0.1.22**. This matrix describes the inspected
implementation, not certification of every deployment or provider. Once does
not claim universal exactly-once execution or atomicity with arbitrary external
systems. Approval, correctness of the business action and access control are
separate responsibilities.

| Behavior | Supported? | Guarantee on the local path | Requires / boundary |
|---|---|---|---|
| Confirmed replay | Yes | Returns the stored replayable receipt without another wrapper dispatch | Same ID, effect and retained SQLite file |
| Changed effect | Yes | CONFLICT prevents a second wrapper dispatch | Complete explicit effect binding |
| Same payload, new intent | Yes | Separate intended action may execute | Application-owned distinct identity |
| Uncertain outcome | Yes | UNKNOWN blocks blind redispatch | Every call stays behind wrapper |
| Provider recovery | Conditional | Valid CONFIRMED evidence can persist original receipt | Authoritative read-only lookup and safe receipt |
| Absence after ambiguity | No local redispatch | Even ABSENT evidence does not authorize another local write | Provider-native guarantee needed for other recovery models |
| Restart replay | Yes, bounded | Retained confirmed state replays; abandoned claim blocks/reconciles | Same persistent authority; early retry can be IN_FLIGHT |
| Same-process concurrency | Yes, bounded | One cooperating claimant dispatches | Shared file and supported filesystem |
| Multiple processes | Yes, bounded | SQLite coordinates cooperating callers sharing one file | One machine, SQLite WAL/locking support |
| Multiple hosts | Not via local SQLite | Separate files do not coordinate | Review a supported shared hosted/backend contract |
| Unreplayable receipt | Blocks | No blind retry after an effect may have occurred | Reconcile to JSON-safe result |
| Provider-internal retries | Not generically | Wrapper controls its dispatch, not every provider SDK attempt | Adapter review/native idempotency |
| Ledger loss/old backup | Not covered; measured redispatch | Complete loss and stale restore each produced two controlled effects | Stop writes; [continuity evidence](AUTHORITY_CONTINUITY.md) |
| Wrong identity / omitted effect | Not automatically repairable | Declared semantics are trusted | Application review against actual request |

## Deployment distinctions

- **TypeScript local:** Node.js 24.15+, persistent same-machine SQLite. No API key
or provider registration needed to wrap an existing function.
- **Python reference core:** a separate capability-aware reference backend.
Its provider-idempotency/fencing recovery contract is not identical to
TypeScript `protectLocal`; see `sdk/python/src/once_agent/core.py`.
- **Existing hosted client/runtime:** requires authentication and supported
provider setup. A public endpoint does not prove the new gateway gates are on.
- **New hosted gateway:** repository contracts record isolated Stripe-sandbox
staging evidence. The production-readiness document explicitly says the new
path is not deployed or wired to production. Verify active version and flags
before claiming otherwise.
- **MCP discovery/setup:** helps integrate protection. It does not intercept
every external action simply because it is installed. A reviewed runtime
proxy/connected tool boundary is a separate path.

Runtime tests using the local SQLite harness do not model Cloudflare output
gates or scheduling. Framework fixtures and real-provider experiments support
their tested failure models; neither establishes universal behavior.

See [hosted contract](GATEWAY_HOSTED_TRANSPORT_V1.md),
[readiness](GATEWAY_HOSTED_PRODUCTION_READINESS_V1.md),
[local details](../examples/local-function/README.md) and
[production operation](PRODUCTION_OPERATION.md).
Loading
Loading