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
113 changes: 113 additions & 0 deletions .github/workflows/offline-verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Phase 0 and Wallet Kernel offline verification

on:
pull_request:
paths:
- 'phase0/**'
- 'prototype/**'
- 'spikes/pi-wielder/**'
- '.claude/skills/optimizing-claude-code-prompts/**'
- '.github/workflows/offline-verification.yml'
push:
branches: [main]
paths:
- 'phase0/**'
- 'prototype/**'
- 'spikes/pi-wielder/**'
- '.claude/skills/optimizing-claude-code-prompts/**'
- '.github/workflows/offline-verification.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
phase0:
name: Phase 0 provenance CLI
runs-on: ubuntu-24.04
timeout-minutes: 20
defaults:
run:
working-directory: phase0
steps:
- name: Check out reviewed source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false

- name: Install Node 22
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22.22.0
cache: npm
cache-dependency-path: phase0/package-lock.json

- name: Install locked dependencies
run: npm ci

- name: Run Phase 0 tests
run: npm test

- name: Typecheck Phase 0
run: npm run typecheck

- name: Verify the Phase 0 checkout stayed clean
working-directory: .
shell: bash
run: |
set -euo pipefail
git diff --check
test -z "$(git status --porcelain)"

wallet-kernel:
name: Wallet Kernel deterministic evidence
runs-on: ubuntu-24.04
timeout-minutes: 30
defaults:
run:
working-directory: spikes/pi-wielder
steps:
- name: Check out reviewed source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false

- name: Install exact Wallet Kernel Node runtime
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24.18.1
cache: npm
cache-dependency-path: spikes/pi-wielder/package-lock.json

- name: Install locked dependencies
run: npm ci

- name: Run the complete offline spend-control story
run: npm run verify:spend-control

- name: Build and independently verify deterministic evidence
shell: bash
run: |
set -euo pipefail
evidence_parent="$(mktemp -d "${RUNNER_TEMP}/pi-wielder-evidence.XXXXXX")"
npm run evidence:offline -- \
--output "${evidence_parent}/bundle" \
--anchor-output "${evidence_parent}/manifest.sha256"
manifest_sha256="$(tr -d '\n' < "${evidence_parent}/manifest.sha256")"
npm run evidence:verify -- "${evidence_parent}/bundle" \
--expect-manifest-sha256 "${manifest_sha256}"

- name: Reject tracked secrets
run: npm run verify:no-secrets

- name: Run shared economics regressions
working-directory: prototype
run: npm test

- name: Verify the checkout stayed clean
working-directory: .
shell: bash
run: |
set -euo pipefail
git diff --check
test -z "$(git status --porcelain)"
52 changes: 52 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Site verification

on:
pull_request:
paths:
- 'README.md'
- 'site/**'
- '.github/workflows/site.yml'
push:
branches: [main]
paths:
- 'README.md'
- 'site/**'
- '.github/workflows/site.yml'

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-24.04
timeout-minutes: 20
defaults:
run:
working-directory: site
env:
NEXT_TELEMETRY_DISABLED: '1'
steps:
- name: Check out reviewed source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Install exact Node runtime
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22.23.2
cache: npm
cache-dependency-path: site/package-lock.json

- name: Install locked dependencies
run: npm ci

- name: Run dependency-free behavior tests
run: npm test

- name: Lint site source
run: npm run lint

- name: Build production site
run: npm run build

- name: Reject high and critical dependency advisories
run: npm audit --audit-level=high
169 changes: 107 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,127 @@
![NEVER HANDED OVER — Skill Asset Protocol](assets/github-banner.png)

# Skill Asset Protocol

A compensation, attribution, and metering layer for authored AI **Skills** — "Carta for AI
work artifacts." Creators keep a durable economic claim each time others use their Skill,
instead of handing the value over once under work-for-hire.
## Agent Spend Control Plane

This is a **research/spike repository**: design documents plus executable evidence, not a
product. Every claim below is labeled measured, modeled, or hypothesis.
Give AI agents a wallet without giving them the keys.

**The manifesto is live — and it is a working protocol endpoint:
[neverhandedover.com](https://neverhandedover.com)** (also at
[skillassetprotocol.com](https://skillassetprotocol.com); source in [`site/`](site/)).
The approved commercial direction is a customer-hosted **Agent Spend Control
Plane**. Its central module, the **Wallet Kernel**, turns an Agent's ordinary
HTTP request into a bounded Spend Intent, evaluates customer policy, obtains
exact human approval when required, signs only an authorized x402 payment through
a customer-owned wallet, and records a signed receipt for every outcome.

## The demo result
This remains a **design-and-spike repository**, not a production product. The
current Wallet Kernel evidence is offline and deterministic. The networked mode
is constrained by design to test USDC on Base Sepolia but has **not been run**;
mainnet and real funds are unsupported. See the
[approved design](docs/superpowers/specs/2026-07-31-agent-spend-control-plane-design.md)
for the complete product, security, and acceptance boundaries.

On 2026-07-12, one wallet paid per model call **and** per hosted-skill invocation over x402
(Base Sepolia, real facilitator, real USDC), landing both asset classes in one attributed
session ledger:
The commercial v1 is spending policy, auditability, and reconciliation:

```
claude/plan $0.041 · skill $0.25 → creator $0.24375 / treasury $0.00625
- customer-hosted policy enforcement and authoritative records;
- a customer-owned wallet, with CDP as the first adapter;
- default-deny budgets, allow-listed sellers, and exact one-time approvals;
- x402 v2 `exact` payments only;
- durable recovery and signed receipts for settled, failed, refunded, and
unresolved outcomes.

It is not wallet custody, token trading, an inference reseller, or a
marketplace. Skill attribution and Creator compensation are deferred expansion
modules: they may later consume Wallet Kernel receipts, but they do not define
the v1 operator experience.

## Pre-release website candidate

The source in [`site/`](site/) is an offline, deterministic candidate preview of
the wallet-control product. It demonstrates policy loading, automatic allow,
deny, exact approval, deliberate retry, and an unsigned session projection. It
does not connect a wallet, sign a receipt, or broadcast a transaction.

The approved design's release gate remains binding: this candidate must not
replace the public homepage until the required implementation and fresh,
recomputable evidence qualify. The separate `/proof` route is a static archive
with one narrowly supported historical Base Sepolia receipt; the website no
longer exposes a wallet or paid invocation endpoint.

### Run the website locally

Use Node 22, then run from the repository root:

```bash
cd site
npm ci
npm run dev
```

On-chain balances reconciled to the cent (Wielder 20 → 19.668 USDC; sellers received exactly
0.332). Measured x402 payment overhead across 48 settled calls (2026-07-15, two model providers):
**p50 731 ms / p95 1206 ms per paid call** — facilitator verify/settle is nearly all of it
(p50 729 ms); the 402 roundtrip + EIP-3009 signature add ~2 ms.
Details and txHashes: [`spikes/pi-wielder/README.md`](spikes/pi-wielder/README.md).
Open <http://localhost:3000>. The homepage needs no environment file, account,
wallet, API key, network request, or payment.

## Try it offline — zero keys, zero funds
## First commercial offer

All four proofs run with no API keys, no network payments, and no wallet. Where a
`package-lock.json` exists, `npm ci` is the reproducible choice.
The first paid offer is a customer-hosted design-partner pilot for one Pi
workflow, one customer-owned CDP testnet wallet, and one or more allow-listed
Base Sepolia x402 resource servers. The pilot adds customer-defined automatic
and approval-required policy, durable budgets and restart recovery, a local
operator console, signed receipt and reconciliation export, and a final control
review.

| Where | Commands | Proves |
This pilot is intended to test whether an AI platform or gateway team will pay
for governed autonomous spending. That demand has not yet been validated.

## Evidence status

One public historical claim is supported by the retained evidence manifest:
on 2026-07-12, a successful Base Sepolia transaction transferred `250000`
atomic units (`0.25`) of test USDC, and the repository's historical run log
labels it as the Skill-leg settlement. See the
[receipt manifest](spikes/pi-wielder/evidence/2026-07-12-skill-settlement/manifest.json).

That receipt does **not** prove current endpoint behavior, latency,
Royalty claim split correctness, Skill execution output, independent demand, or
production readiness. A later aggregate timing summary is quarantined and is
not used in product claims because its normalized samples were not retained;
see its
[non-publishable manifest](spikes/pi-wielder/evidence/2026-07-15-overhead/manifest.json).

All current product-preview states and receipts are deterministic simulations.
A future testnet product claim requires a fresh, immutable, recomputable
evidence bundle as specified in the approved design.

## Try the existing proofs offline

The repository also retains earlier attribution, settlement, provenance, and
clone-economics research. These are inputs to the Wallet Kernel work or deferred
research; they are not proof that the commercial v1 is complete.

| Where | Command | Scope |
|---|---|---|
| `spikes/pi-wielder` | `npm install && npm run e2e` | 20 checks: 402-first on every leg, no skill-content leak, replay rejection, exact split match |
| `spikes/clone-economics` | `npm run e2e` (no install) | 97 checks: deterministic clone-distillation harness, byte-identical reruns |
| `prototype` | `node spike-fork-economics.mjs` (no install) | 64 invariants: fork/royalty economics on the settlement engine |
| `phase0` | `npm install && npm test` | 18 tests: Story provenance registration against injected fakes |
| `site` | `npm test` | Deterministic wallet-control preview and public-claim guards |
| `spikes/pi-wielder` | `npm ci && npm test && npm run e2e` | Offline wallet policy, x402, journal, receipt, and failure-path spike |
| `spikes/clone-economics` | `npm run e2e` | Deterministic clone-distillation research |
| `prototype` | `npm test` | Settlement and attribution accounting invariants |
| `phase0` | `npm ci && npm test` | Story provenance behavior against injected fakes |

These automated paths require no funded wallet or network payment. Follow each
directory's README for its exact environment and safety boundary.

## What's here

- **`CONTEXT.md`** — the ubiquitous language: Skill, Creator, Wielder, Beneficiary, Collar,
Invocation, Derivative, Royalty claim.
- **`docs/adr/`** — 8 decision records, including 0007 (the closed-mode compensation layer is
the terminal product) and 0008 (the Wielder is a wallet, not a harness).
- **`spikes/`** — pi-wielder (one wallet, two asset classes, unified ledger) and
clone-economics (how cheaply can N paid outputs be distilled into a clone?).
- **`prototype/`** — the settlement engine (pure logic) plus fork-economics and CMA-latency
- **`docs/superpowers/specs/2026-07-31-agent-spend-control-plane-design.md`**
— the approved Wallet Kernel and commercial-pilot design.
- **`site/`** — the pre-release offline wallet-control candidate and a separate
static historical proof archive.
- **`spikes/pi-wielder/`** — the hardened wallet, policy, x402, journal,
receipt, refund, and reconciliation evidence that the Wallet Kernel will
evolve from.
- **`CONTEXT.md` and `docs/adr/`** — the canonical protocol language and prior
decisions. The compensation and attribution model remains longer-term
research rather than the v1 product interface.
- **`prototype/`** — settlement and attribution accounting logic plus economic
spikes.
- **`phase0/`** — Story Protocol provenance: register a Skill as an IP Asset and declare
Derivatives (Aeneid testnet only).
- **`.claude/skills/` and `.agents/skills/`** — the bundled example skill
(`optimizing-claude-code-prompts`) is **intentionally public**. The protocol's claim is that
a Wielder never receives the skill at runtime — output only — not that the skill is secret.
The spikes host and meter this exact skill behind the Collar.

## Evidence status

The repo's discipline is to label every number:

- **Measured (real network, n=48 settled calls + a live pi session):** the runs above — real
402 → sign → settle, real USDC per call, splits credited by the settlement engine, wallet
reconciled on-chain to the cent; two failure modes documented (pay-then-fail, settled-but-rejected).
- **Measured (n=3, one model):** hosted-agent cold start — first answer token p50 ~2.5 s;
pay-then-run-async reads as usable on top of the ~0.8 s testnet payment gate.
- **Measured (N=6, small fixtures):** the clone attack **failed on fidelity** — all 6 held-out
cases failed critical gates — but modeled break-even is **8 invocations** if a clone ever
passes. Cost is no defense; fidelity was. High-N behavior is **unknown**.
- **Modeled (deterministic arithmetic, not observed behavior):** education-mode flow-through
is dominated by free re-authoring — every school-paying royalty rate loses at parity, so
Education mode is deferred.
- **Validated arithmetically:** settlement splits, multi-level derivative flow-through, and
payment gating ("no credential, no run") via the engine's invariants.

Unvalidated: that employers will buy this. Design-partner interviews remain the open step.
- **`phase0/`** — Story Protocol provenance experiments on Aeneid testnet only.
- **`.claude/skills/` and `.agents/skills/`** — the intentionally public example
Skill used by earlier spikes.

## License

Expand Down
28 changes: 28 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Documentation

## Current v1 product design

- [Agent Spend Control Plane — approved design](superpowers/specs/2026-07-31-agent-spend-control-plane-design.md)
— the current wallet-native direction: a customer-hosted **Wallet Kernel**
for x402 spending policy, exact approvals, signed receipts, and reconciliation.

## Deferred expansion research

- [Employer onboarding, retention, and monetization recommendations](product-onboarding-retention-and-monetization.md)
— superseded for v1 and retained as research for a possible future Skill
attribution and Creator-compensation module.

## Security

- [Dependency security audit](dependency-security-audit.md)

## Architecture decisions

- [ADR-0001 — Hosted invocation-rights](adr/0001-skills-as-hosted-invocation-rights.md)
- [ADR-0002 — Story programmable IP](adr/0002-tokenize-skills-as-programmable-ip-on-story.md)
- [ADR-0003 — Payment-gated execution](adr/0003-payment-gated-execution.md)
- [ADR-0004 — Economic and network moats](adr/0004-compete-on-moats-not-secrecy.md)
- [ADR-0005 — Two-leg settlement](adr/0005-two-leg-cross-chain-settlement.md)
- [ADR-0006 — Closed modes first](adr/0006-phased-rollout-closed-modes-first.md)
- [ADR-0007 — Closed-mode compensation as the terminal product](adr/0007-closed-mode-compensation-layer-as-terminal-product.md)
- [ADR-0008 — The Wielder is a wallet](adr/0008-the-wielder-is-a-wallet.md)
Loading
Loading