logicsrc/packages/sdk/README.md
Anthony Ettinger ef35139f04
OpenABTest 0.2-draft: goal conversions (#239)
* OpenABTest 0.2-draft: goal conversions

0.1 conversions are purchases with a price, so button, onboarding and
landing-page experiments had nothing conformant to report. 0.2 adds a goal
conversion: metrics.conversion "unique-participants-with-goal" with
metrics.goal, metrics.profit "none", and conversion events carrying exactly
one of price or goal (optional observed value). Backward compatible: every
0.1 document stays valid; goal forms require "0.2-draft". The reference
implementation is w3bs.org/ab-testing.

@logicsrc/schemas and @logicsrc/validators 0.5.0, @logicsrc/sdk 0.4.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* contract: accept any 0.x draft status (OpenABTest is 0.2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:58:40 -07:00

1.6 KiB

@logicsrc/sdk

LogicSRC contract types and constructors for tasks, AgentSwarm sessions and OpenRental descriptors. These helpers construct documents; they do not start agents, resolve remote identities or initiate payments.

npm install @logicsrc/sdk @logicsrc/validators
import { createOpenRental } from "@logicsrc/sdk";
import { validate } from "@logicsrc/validators";

const listing = createOpenRental({
  id: "https://example.com/listings/research",
  name: "Research",
  owner_did: "operator.coinpay",
  members: [{
    kind: "openagent",
    id: "analyst.coinpay",
    url: "https://example.com/agents/analyst.json"
  }]
});

const result = validate("openrental", listing);
if (!result.ok) throw new Error(JSON.stringify(result.errors));

Use @logicsrc/validators 0.2.0 or newer for OpenRental validation. See the OpenRental specification for member bindings, exact decimal rental rates and CoinPay settlement metadata.

MIT © Profullstack, Inc.

OpenABTest draft

Version 0.3.0 adds OpenABTestManifest, OpenABTestEvent, createOpenABTestManifest and createOpenABTestEvent. The constructors set openabtest: "0.1-draft", or "0.2-draft" when the document uses a goal conversion; validate their result with @logicsrc/validators using openabtest-manifest or openabtest-event before storing it. They do not assign participants, authenticate events or initiate payments. See the OpenABTest specification and its complete Chovy fixture for every referred purchase.