mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-12-01 09:24:46 +00:00
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>
This commit is contained in:
parent
0d0a2583b1
commit
ef35139f04
16 changed files with 257 additions and 33 deletions
16
packages/schemas/fixtures/openabtest/goal-conversion.json
Normal file
16
packages/schemas/fixtures/openabtest/goal-conversion.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"openabtest": "0.2-draft",
|
||||
"producerId": "chovy-server",
|
||||
"manifestId": "signup-cta-v1",
|
||||
"manifestRevision": 1,
|
||||
"participantId": "participant-opaque-7d12",
|
||||
"at": "2026-09-15T12:00:00Z",
|
||||
"id": "event-goal-42",
|
||||
"kind": "conversion",
|
||||
"payload": {
|
||||
"assignmentId": "assignment-42",
|
||||
"variantId": "free",
|
||||
"conversionId": "signup-42",
|
||||
"goal": "signup-completed"
|
||||
}
|
||||
}
|
||||
55
packages/schemas/fixtures/openabtest/goal-manifest.json
Normal file
55
packages/schemas/fixtures/openabtest/goal-manifest.json
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"openabtest": "0.2-draft",
|
||||
"id": "signup-cta-v1",
|
||||
"revision": 1,
|
||||
"name": "Sign-up button copy",
|
||||
"state": "draft",
|
||||
"cohort": {
|
||||
"id": "landing-visitors",
|
||||
"eligibilityRule": "Signed-out visitors who load the landing page; staff and bots excluded.",
|
||||
"purchaseScope": "custom"
|
||||
},
|
||||
"assignment": {
|
||||
"unit": "device",
|
||||
"authority": "server",
|
||||
"keyVersion": "1",
|
||||
"algorithm": "hmac-sha256-persisted-v1",
|
||||
"persistence": "sticky"
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"id": "control",
|
||||
"weight": 1,
|
||||
"parameters": {
|
||||
"cta": "Sign up"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "free",
|
||||
"weight": 1,
|
||||
"parameters": {
|
||||
"cta": "Start free"
|
||||
}
|
||||
}
|
||||
],
|
||||
"window": {
|
||||
"startsAt": "2026-09-14T00:00:00Z",
|
||||
"endsAt": "2026-10-14T00:00:00Z"
|
||||
},
|
||||
"metrics": {
|
||||
"primary": "conversion-rate",
|
||||
"denominator": "unique-eligible-participants",
|
||||
"conversion": "unique-participants-with-goal",
|
||||
"profit": "none",
|
||||
"minimumEligiblePerVariant": 100,
|
||||
"minimumObservationSeconds": 604800,
|
||||
"winnerPolicy": "manual-review",
|
||||
"goal": "signup-completed"
|
||||
},
|
||||
"guardrails": {
|
||||
"preserveAcceptedOffers": true,
|
||||
"preserveAccruedCommissions": true,
|
||||
"requireReconciledCostsForPayout": true,
|
||||
"onBreach": "pause-new-assignments"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@logicsrc/schemas",
|
||||
"version": "0.4.0",
|
||||
"version": "0.5.0",
|
||||
"description": "LogicSRC JSON schemas for tasks, agents, runs, events, plugins, the AgentAd ad standard, the OpenOntology knowledge contracts, the OpenContext context plane, the OpenCreds credential vault, OpenRental membership and rental offers, and the OpenWall messaging proposal. Includes the OpenABTest draft experiment and event contracts.",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@
|
|||
],
|
||||
"properties": {
|
||||
"openabtest": {
|
||||
"const": "0.1-draft"
|
||||
"enum": [
|
||||
"0.1-draft",
|
||||
"0.2-draft"
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
|
|
@ -182,8 +185,7 @@
|
|||
"required": [
|
||||
"assignmentId",
|
||||
"variantId",
|
||||
"conversionId",
|
||||
"price"
|
||||
"conversionId"
|
||||
],
|
||||
"properties": {
|
||||
"assignmentId": {
|
||||
|
|
@ -254,8 +256,49 @@
|
|||
"maximum": 9007199254740991
|
||||
}
|
||||
}
|
||||
},
|
||||
"goal": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
|
||||
},
|
||||
"value": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"currency",
|
||||
"amountMinor"
|
||||
],
|
||||
"properties": {
|
||||
"currency": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Z]{3}$"
|
||||
},
|
||||
"amountMinor": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 9007199254740991
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"required": [
|
||||
"price"
|
||||
],
|
||||
"properties": {
|
||||
"price": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"goal"
|
||||
],
|
||||
"properties": {
|
||||
"goal": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@
|
|||
],
|
||||
"properties": {
|
||||
"openabtest": {
|
||||
"const": "0.1-draft"
|
||||
"enum": [
|
||||
"0.1-draft",
|
||||
"0.2-draft"
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
|
|
@ -198,10 +201,16 @@
|
|||
"const": "unique-eligible-participants"
|
||||
},
|
||||
"conversion": {
|
||||
"const": "unique-participants-with-confirmed-purchase"
|
||||
"enum": [
|
||||
"unique-participants-with-confirmed-purchase",
|
||||
"unique-participants-with-goal"
|
||||
]
|
||||
},
|
||||
"profit": {
|
||||
"const": "reconciled-net-retained-profit"
|
||||
"enum": [
|
||||
"reconciled-net-retained-profit",
|
||||
"none"
|
||||
]
|
||||
},
|
||||
"minimumEligiblePerVariant": {
|
||||
"type": "integer",
|
||||
|
|
@ -215,6 +224,10 @@
|
|||
},
|
||||
"winnerPolicy": {
|
||||
"const": "manual-review"
|
||||
},
|
||||
"goal": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue