@appgrowstack/app-contract 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,146 @@
1
+ /* このファイルは schema/ から作った。手で直さない。
2
+ * 作り直し: cd packages/contract && bun run gen
3
+ * ずれは test/generated.test.ts が落とす */
4
+ export const schemaDocuments = {
5
+ "access/approval.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/approval.schema.json", "title": "AccessApproval", "description": "承認の依頼(docs/design/access.md の 5節)。外に出る操作と設定の操作を、本人の確認の無い主体(エージェント)が呼ぶと、core は実行せずにこれを作る。承認の段階が policy の操作は、core の決まりの確かめが通ればその場で実行し、外れた物だけを tier が reviewer の依頼にする。reviewer の依頼は点検役のエージェントが決め、human の依頼(AI の権限を広げる操作)だけを本人が決める。点検役が却下した依頼は rejected で終わり、本人には回らない。承認するのは依頼に入れた要求そのもので、承認されたら残した本文で実行する。24時間で切れる。実行のときに前提が変わっていれば failed。端末の機能を持つマニフェストがまだ無いことだけで断られたら awaiting にして、届いたら送り直す。承認の画面は console(https://console.appgrowstack.com/<org>/approvals/<id>)だけに置く。表は access_approval", "type": "object", "additionalProperties": false, "required": ["id", "org", "project", "action", "tier", "requested_by", "on_behalf_of", "via", "request", "summary", "checks", "status", "approval_url", "created_at", "expires_at", "failure", "awaiting", "decided_by", "decided_at", "note", "self_approved", "result"], "properties": { "id": { "$ref": "#/$defs/approvalId" }, "org": { "$ref": "org.schema.json#/$defs/orgId" }, "project": { "description": "プロジェクトにつかない操作(トークン・所属)は null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "action": { "$ref": "permission.schema.json" }, "tier": { "$ref": "#/$defs/approvalTier" }, "requested_by": { "$ref": "principal.schema.json#/$defs/principalId" }, "on_behalf_of": { "description": "依頼した主体がエージェントのときはオーナーの人", "anyOf": [{ "$ref": "principal.schema.json#/$defs/userId" }, { "type": "null" }] }, "via": { "$ref": "principal.schema.json#/$defs/via" }, "request": { "$ref": "#/$defs/approvalRequest" }, "summary": { "$ref": "#/$defs/approvalSummary" }, "checks": { "description": "依頼を作った時の決まりの確かめの結果。承認の段階が policy の操作で外れた物だけが入る。ほかは空", "type": "array", "items": { "$ref": "#/$defs/approvalCheck" }, "maxItems": 100 }, "status": { "$ref": "#/$defs/approvalStatus" }, "approval_url": { "$ref": "#/$defs/approvalUrl" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "expires_at": { "description": "created_at の24時間後", "$ref": "../common.schema.json#/$defs/epochMs" }, "failure": { "description": "実行が失敗した印と理由。点検役の却下の理由と同じく、失敗はまず依頼した主体に返る(依頼した主体は requested_by=me&status=failed で読み、理由を見て作り直す)。同じ操作が失敗の後24時間のうちに通らなかった物だけを本人に回す(unresolved=true)。failed でない依頼は null", "anyOf": [{ "$ref": "#/$defs/approvalFailureMark" }, { "type": "null" }] }, "awaiting": { "description": "status が awaiting の時だけ。何の機能を待っているか。ほかは null", "anyOf": [{ "$ref": "#/$defs/approvalAwaiting" }, { "type": "null" }] }, "decided_by": { "description": "承認か却下をした主体。tier が human の依頼は本人の確認つきの人だけ。reviewer の依頼は点検役のエージェント(agt_)か人。点検役が却下した理由は note に入り、依頼したエージェントが読む", "anyOf": [{ "$ref": "principal.schema.json#/$defs/memberId" }, { "type": "null" }] }, "decided_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "note": { "description": "決めた人の短い理由。人の本文を入れない", "anyOf": [{ "type": "string", "maxLength": 200 }, { "type": "null" }] }, "self_approved": { "description": "依頼した人と承認した人が同じ(人が1人だけの組織の例外)", "type": "boolean" }, "result": { "anyOf": [{ "$ref": "#/$defs/approvalResult" }, { "type": "null" }] } }, "$defs": { "approvalTier": { "title": "AccessApprovalTier", "description": "依頼を決める者(ADR 0053)。reviewer は点検役のエージェント(作った主体と別)、human は本人(鍵とトークンを出す・人とエージェントと役割・サービストークンを結ぶ・承認の決まり)。承認の段階が policy の操作は、決まりの確かめから外れた時だけ reviewer の依頼になる(policy の依頼は作らない)", "enum": ["reviewer", "human"] }, "approvalCheck": { "title": "AccessApprovalCheck", "description": "決まりの確かめの1つの結果。rule は決まりの名前(campaign_rules・new_offering・product_outside_ladder・holdout_min・push_per_day)、message は外れた理由の1文", "type": "object", "additionalProperties": false, "required": ["rule", "message"], "properties": { "rule": { "type": "string", "minLength": 1, "maxLength": 100 }, "message": { "type": "string", "minLength": 1, "maxLength": 1000 } } }, "approvalReview": { "title": "AccessApprovalReview", "description": "GET /v1/access/approvals/:id/review の答え(access.approval.read)。点検役に渡す依頼の中身。作った時の文脈(誰が・なぜ作ったか・会話)は入れず、差・送る本文・決まりの確かめの結果・関わる文書のパスだけで判断させる", "type": "object", "additionalProperties": false, "required": ["id", "project", "action", "tier", "status", "request", "body", "summary", "checks", "docs", "expires_at"], "properties": { "id": { "$ref": "#/$defs/approvalId" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "action": { "$ref": "permission.schema.json" }, "tier": { "$ref": "#/$defs/approvalTier" }, "status": { "$ref": "#/$defs/approvalStatus" }, "request": { "$ref": "#/$defs/approvalRequest" }, "body": { "description": "依頼に残した本文(JSON)。本文の無い要求は null", "type": ["object", "array", "null"] }, "summary": { "$ref": "#/$defs/approvalSummary" }, "checks": { "type": "array", "items": { "$ref": "#/$defs/approvalCheck" }, "maxItems": 100 }, "docs": { "description": "決める時に読む文書の repo の中のパス(docs/design/…・docs/decisions/…)", "type": "array", "items": { "type": "string", "pattern": "^docs/[^\\s]+\\.md(#[^\\s]+)?$" }, "minItems": 1 }, "expires_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "approvalId": { "title": "AccessApprovalId", "description": "承認の依頼の id(apr_ +16文字)", "type": "string", "pattern": "^apr_[A-Za-z0-9]{16}$" }, "approvalStatus": { "title": "AccessApprovalStatus", "description": "pending 待ち・approved 承認した(実行の前)・awaiting 承認したが、端末の機能(requires)を全部持つマニフェストがまだ無いので実行を待っている。マニフェストが届いたら core が送り直す・rejected 却下・expired 24時間を過ぎた(awaiting は30日)・failed 実行のときに断られた(前提が変わった 409 など)・executed 実行した", "enum": ["pending", "approved", "awaiting", "rejected", "expired", "failed", "executed"] }, "approvalUrl": { "title": "AccessApprovalUrl", "description": "承認の画面の URL。https://console.appgrowstack.com/<org の slug>/approvals/<id>(access.ts の approvalUrl)。staging は host だけが違う", "type": "string", "pattern": "^https://[a-z0-9.-]+/[a-z][a-z0-9-]{1,39}/approvals/apr_[A-Za-z0-9]{16}$" }, "approvalRequest": { "title": "AccessApprovalHttpRequest", "description": "依頼に残した要求。本文そのものは core の表にだけ置き、答えには sha256 だけを出す", "type": "object", "additionalProperties": false, "required": ["method", "path", "body_sha256"], "properties": { "method": { "enum": ["POST", "PUT", "PATCH", "DELETE"] }, "path": { "type": "string", "pattern": "^/v1/[^\\s]*$", "maxLength": 512 }, "body_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" } } }, "approvalSummary": { "title": "AccessApprovalSummary", "description": "承認の画面と CLI が承認の前に出す差(docs/design/access.md 5.6節)。title は利用者に何が変わるかの1文で、製品の登録した名前で書き、repo の名前・key・組・バージョン 0 を出さない。changes は変わる物ごとの人の読む名前と大事な欄の前と後、impact は誰に届くかと戻せるか。lines は送る中身そのもの(JSON の差・返事の全文など)で、changes がある依頼では console が「詳しい中身」に畳む", "type": "object", "additionalProperties": false, "required": ["title", "lines"], "properties": { "title": { "description": "利用者に何が変わるかの1文", "type": "string", "minLength": 1, "maxLength": 200 }, "changes": { "description": "変わる物(設定・件・画面の名前)ごとの差。差の形を持たない操作(キーを作るなど)は書かない", "type": "array", "items": { "$ref": "#/$defs/approvalChange" }, "maxItems": 200 }, "impact": { "$ref": "#/$defs/approvalImpact" }, "lines": { "description": "送る中身そのもの。changes がある依頼では、確かめたい人のための元の値", "type": "array", "items": { "type": "string", "maxLength": 1000 }, "maxItems": 200 }, "reach": { "title": "AccessApprovalReach", "description": "届く人数の試算。件の push は simulate の数、通知は施策の直近7日の配信の数。数えられない操作は書かない", "type": "object", "additionalProperties": false, "properties": { "treatment": { "type": "integer", "minimum": 0 }, "holdout": { "type": "integer", "minimum": 0 }, "total": { "type": "integer", "minimum": 0 }, "large": { "description": "承認の決まりの large_reach を超える", "type": "boolean" } } } } }, "approvalChange": { "title": "AccessApprovalChange", "description": "変わる物1つ。label は人の読む名前(ペイウォールなら出す場所・件なら件の題・画面の名前の組なら何の名前か)。fields は大事な欄の前と後で、値は人の読む文にしてある(JSON のままにしない)。無い側は null", "type": "object", "additionalProperties": false, "required": ["label", "kind", "fields"], "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 200 }, "kind": { "description": "add 新しく足す・change 変える・remove やめる", "enum": ["add", "change", "remove"] }, "note": { "description": "補いの1文(条件つきの値・実験があることなど)", "type": "string", "maxLength": 500 }, "fields": { "type": "array", "maxItems": 30, "items": { "title": "AccessApprovalField", "type": "object", "additionalProperties": false, "required": ["label", "before", "after"], "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 100 }, "before": { "anyOf": [{ "type": "string", "maxLength": 1000 }, { "type": "null" }] }, "after": { "anyOf": [{ "type": "string", "maxLength": 1000 }, { "type": "null" }] } } } } } }, "approvalImpact": { "title": "AccessApprovalImpact", "description": "影響。audience は誰に届くか(アプリの版と OS)。reversible は承認の後で元に戻せるか、undo はその戻し方か戻せない理由", "type": "object", "additionalProperties": false, "required": ["audience", "reversible", "undo"], "properties": { "audience": { "type": "string", "minLength": 1, "maxLength": 500 }, "reversible": { "type": "boolean" }, "undo": { "type": "string", "minLength": 1, "maxLength": 500 } } }, "approvalNoChange": { "title": "AccessApprovalNoChange", "description": "承認の依頼になる道が 200 で返す本文。送る中身が今の物と同じ(件が0件で今も0件・差の無い設定)なので、依頼を作らず何も実行しなかった。CLI は「変更なし」と出して 0 で終わる", "type": "object", "additionalProperties": false, "required": ["no_change"], "properties": { "no_change": { "type": "object", "additionalProperties": false, "required": ["action", "message"], "properties": { "action": { "$ref": "permission.schema.json" }, "message": { "const": "変更なし" } } } } }, "approvalResult": { "title": "AccessApprovalResult", "description": "実行の答え。status は残した要求を実行したときの HTTP の状態。body は、承認した呼び手の答えではその答えの本文そのもの(トークンの secret を含む)。1件の読みでは id・*_id・version・誤りの code と理由だけを残した物(本文・段階3の中身・秘密の値は残さない)。一覧では body を返さない", "type": "object", "additionalProperties": false, "required": ["status"], "properties": { "status": { "type": "integer", "minimum": 100, "maximum": 599 }, "body": {} } }, "pendingApproval": { "title": "PendingApproval", "description": "外に出る操作と設定の操作の道が 202 で返す本文。core は実行せずに依頼を作った。同じ操作・同じ道・同じ本文(sha256)の待ちの依頼があれば、新しく作らずにその依頼を返す。CLI は id と approval_url を出し、--wait なら GET /v1/access/approvals/:id で結果まで待つ", "type": "object", "additionalProperties": false, "required": ["approval"], "properties": { "approval": { "type": "object", "additionalProperties": false, "required": ["id", "action", "tier", "summary", "checks", "approval_url", "expires_at"], "properties": { "id": { "$ref": "#/$defs/approvalId" }, "action": { "$ref": "permission.schema.json" }, "tier": { "$ref": "#/$defs/approvalTier" }, "summary": { "$ref": "#/$defs/approvalSummary" }, "checks": { "type": "array", "items": { "$ref": "#/$defs/approvalCheck" }, "maxItems": 100 }, "approval_url": { "$ref": "#/$defs/approvalUrl" }, "expires_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } } } }, "decideApprovalRequest": { "title": "DecideApprovalRequest", "description": "POST /v1/access/approvals/:id/approve と …/reject の本文(access.approval.decide)。tier が human の依頼は本人の確認つきの人だけ。tier が reviewer の依頼は点検役のエージェントも決められる。点検役の reject はその場で rejected にし、note を依頼したエージェントに返す。依頼の操作の権限が要る", "type": "object", "additionalProperties": false, "properties": { "note": { "type": "string", "maxLength": 200 } } }, "approvalAwaiting": { "title": "AccessApprovalAwaiting", "description": "機能の待ち(docs/design/access.md 5.7節)。承認した依頼の実行が capability_missing(409)だけで断られた時に入る。since は待ちに入った時刻、until は since の30日後で、過ぎたら expired。needs は待っている機能の組。マニフェストが届くか毎時の確かめで、needs が全部そろった依頼を、承認した時の本文と承認した主体のまま送り直す。待ちの間に同じ操作(同じプロジェクトの同じ action)が通ったら、送り直さずに failed(code は superseded)にする", "type": "object", "additionalProperties": false, "required": ["since", "until", "needs"], "properties": { "since": { "$ref": "../common.schema.json#/$defs/epochMs" }, "until": { "$ref": "../common.schema.json#/$defs/epochMs" }, "needs": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/capabilityNeed" }, "maxItems": 50 } } }, "approvalFailureMark": { "title": "AccessApprovalFailureMark", "description": "実行が失敗した印。at は失敗した時刻、status は HTTP の状態、code と message は誤りの code と理由(200字まで)", "type": "object", "additionalProperties": false, "required": ["at", "status", "code", "message"], "properties": { "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "status": { "type": "integer", "minimum": 100, "maximum": 599 }, "code": { "anyOf": [{ "type": "string", "maxLength": 100 }, { "type": "null" }] }, "message": { "anyOf": [{ "type": "string", "maxLength": 200 }, { "type": "null" }] } } }, "approvalList": { "title": "AccessApprovalList", "description": "GET /v1/access/approvals?status=&project=&decider=&requested_by=&unresolved=&cursor=&limit= の答え(access.approval.read)。新しい順。next_cursor が null なら終わり。requested_by は主体の id か me(呼んだ主体)。unresolved=true は失敗の後24時間が過ぎても同じ操作(同じプロジェクトの同じ action)が通っていない failed の物だけ(直近30日)。decider=human は本人が決める物(tier が human)だけ、decider=reviewer は点検役が決める物(tier が reviewer)だけ", "type": "object", "additionalProperties": false, "required": ["approvals", "next_cursor"], "properties": { "approvals": { "type": "array", "items": { "$ref": "#" } }, "next_cursor": { "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 200 }, { "type": "null" }] } } } } },
6
+ "access/audit-event.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/audit-event.schema.json", "title": "AuditEvent", "description": "監査の1行(docs/access-control.md の 7.1節)。管理の道の書く操作の全部・断った要求・承認の依頼と決定・段階2と段階3を読んだ要求・トークンを出した・回した・取り消した・中の処理が自分で出した物を残す。端末の API とアプリの Worker の RPC は残さない(利用者の操作の forget だけ1行)。表は audit_event で、書き足すだけ(UPDATE と DELETE は D1 のトリガーで止める)", "type": "object", "additionalProperties": false, "required": ["id", "at", "org", "project", "principal_kind", "principal_id", "on_behalf_of", "via", "token_id", "action", "target", "result", "approval_id", "approved_by", "self_approved", "request_sha256", "data_level", "request_id", "note"], "properties": { "id": { "$ref": "#/$defs/auditEventId" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "org": { "$ref": "org.schema.json#/$defs/orgId" }, "project": { "description": "プロジェクトにつかない操作は null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "principal_kind": { "$ref": "principal.schema.json#/$defs/principalKind" }, "principal_id": { "description": "主体の id(PrincipalId の形)。via が legacy の行だけは、古い表の文字列(service:<common_name> や email)がそのまま入るので、形を決めない", "type": "string", "minLength": 1, "maxLength": 200 }, "on_behalf_of": { "description": "エージェントのオーナーの人(エージェントのときだけ)", "anyOf": [{ "$ref": "principal.schema.json#/$defs/userId" }, { "type": "null" }] }, "via": { "description": "どの証で来たか(AccessVia)に legacy を足した物。legacy は古い inapp_audit_log から1回だけ移した行だけ(principal_kind は user・token_id は null)", "enum": ["access_email", "user_token", "agent_token", "server_key", "binding", "system", "legacy"] }, "token_id": { "description": "使ったトークン(tok_…)かサーバーキー(key_…)。Access の email・binding・中の処理は null", "anyOf": [{ "$ref": "token.schema.json#/$defs/tokenId" }, { "$ref": "../registry/key.schema.json#/$defs/keyId" }, { "type": "null" }] }, "action": { "description": "操作の名前。断ったときもその名前", "$ref": "permission.schema.json" }, "target": { "description": "操作の相手(件の id・version・案の id・問い合わせの id・キーの id)。人の本文を入れない。利用者の操作の forget は人の id を sha256(project:person_id) にする", "anyOf": [{ "type": "object", "maxProperties": 20 }, { "type": "null" }] }, "result": { "$ref": "#/$defs/auditResult" }, "approval_id": { "description": "承認を通った操作だけ", "anyOf": [{ "$ref": "approval.schema.json#/$defs/approvalId" }, { "type": "null" }] }, "approved_by": { "description": "依頼を承認した主体。承認の段階が human の依頼は人、reviewer の依頼は点検役のエージェント(agt_)か人", "anyOf": [{ "$ref": "principal.schema.json#/$defs/memberId" }, { "type": "null" }] }, "self_approved": { "anyOf": [{ "type": "boolean" }, { "type": "null" }] }, "request_sha256": { "description": "本文の sha256(本文は残さない)", "anyOf": [{ "type": "string", "pattern": "^[a-f0-9]{64}$" }, { "type": "null" }] }, "data_level": { "description": "読んだ人のデータの段階。読む操作で人のデータに触れたときだけ", "anyOf": [{ "enum": [2, 3] }, { "type": "null" }] }, "request_id": { "description": "cf-ray", "anyOf": [{ "type": "string", "maxLength": 64 }, { "type": "null" }] }, "note": { "description": "短い理由(stop の note など)。人の本文を入れない", "anyOf": [{ "type": "string", "maxLength": 200 }, { "type": "null" }] } }, "$defs": { "auditEventId": { "title": "AuditEventId", "description": "監査の行の id(aud_ +16文字)", "type": "string", "pattern": "^aud_[A-Za-z0-9]{16}$" }, "auditResult": { "title": "AuditResult", "description": "ok 通った・denied 断った・pending_approval 承認の依頼を作った・failed 通ったが実行で断られた", "enum": ["ok", "denied", "pending_approval", "failed"] }, "auditEventList": { "title": "AuditEventList", "description": "GET /v1/access/audit?project=&principal=&action=&since=&until=&cursor=&limit= の答え(audit.read)。新しい順。next_cursor が null なら終わり", "type": "object", "additionalProperties": false, "required": ["events", "next_cursor"], "properties": { "events": { "type": "array", "items": { "$ref": "#" } }, "next_cursor": { "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 200 }, { "type": "null" }] } } }, "auditArchiveCheck": { "title": "AuditArchiveCheck", "description": "GET /v1/access/audit/archive?day=YYYY-MM-DD の答え(audit.read)。その UTC の日の R2 の書き出し(docs/security.md SC5)と D1 の audit_event の行の数を、呼んだ人の組織の分だけ比べる。app-growth audit verify", "type": "object", "additionalProperties": false, "required": ["day", "key", "archived", "archived_count", "d1_count", "sha256", "match"], "properties": { "day": { "description": "UTC の日", "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "key": { "description": "R2 のキー(audit/YYYY/MM/DD.jsonl)", "type": "string", "minLength": 1, "maxLength": 200 }, "archived": { "description": "書き出した本文が R2 に在るか", "type": "boolean" }, "archived_count": { "description": "書き出した物の中の、呼んだ人の組織の行の数。書き出していない・manifest が読めない日は null", "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }, "d1_count": { "description": "今の D1 の、その日の呼んだ人の組織の行の数", "type": "integer", "minimum": 0 }, "sha256": { "description": "書き出した本文(全部の組織)の sha256。書き出していなければ null", "anyOf": [{ "type": "string", "pattern": "^[0-9a-f]{64}$" }, { "type": "null" }] }, "match": { "description": "archived_count と d1_count が同じ。書き出していない日は false", "type": "boolean" } } } } },
7
+ "access/case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/case.schema.json", "title": "AccessCase", "description": "schema/cases/access/*.json の1つの権限の表(docs/access-control.md の AC-10)。呼び手(証・主体・所属の役割・トークンの scope とプロジェクトの絞り・本人の確認)と操作から、core が許す・断る・依頼にする・本人の確認を求める、のどれかを決める。core の中間の層と CLI が同じ表を通す。組織は1つで、承認の決まりは今の値(outward が approval)として読む。auto_small の範囲・staging の「承認なし」・billing.manage(売った後)は表に入れない。確かめの順: 1 証(Access のサービストークンだけは 401 token_required・sk_ と binding は管理の道を通さず 403 forbidden)→ 2 エージェントの上限(ai の列。no・queue(持ち物の待ち行列の approve の道)・managed の local_only・自分のトークンでない own_only と request_own は 403 forbidden。点検役(agent_kind が reviewer)は、読む操作・承認の段階が reviewer の持ち物の待ち行列の approve の道・その却下(notify.variant.reject・support.draft.reject)・access.approval.decide のほかは 403 forbidden)→ 3 役割(組織の所属 ∪ そのプロジェクトの所属。エージェントは owner・admin・billing を外す。無ければ 403 scope_missing)→ 4 トークンの scope とプロジェクトの絞り(scope が null のトークンは絞らず、ここまでの役割とエージェントの上限に従う。ただし段階3の操作は scopes の一覧か level3_scopes に書いていなければ 403 scope_missing。一覧があってその操作が無いか、プロジェクトの絞りに当たらないか、絞りのあるトークンでプロジェクトの無い段階2・3の読みか監査の一覧なら 403 scope_missing)→ 5 承認(エージェントは 202 で、tier は access.ts の承認の段階。policy は core が決まりの確かめをして、通ればその場で実行し、外れたら reviewer の依頼にする。本人の確認の無い人は 403 step_up_required・本人の確認つきの人は人が1人の組織なら self_approved で実行し、2人以上なら 202。点検役が持ち物の待ち行列の approve の道を呼ぶと実行する。access.approval.decide は、tier が human の依頼は本人の確認つきの人だけ。tier が reviewer の依頼は点検役も決められるが、依頼した主体と、依頼した主体と同じ人の下の同じ種類のエージェントは 403 forbidden)", "type": "object", "additionalProperties": false, "required": ["description", "org_humans", "caller", "operation", "expect"], "properties": { "description": { "type": "string", "minLength": 1 }, "org_humans": { "description": "組織の人(usr_)の数。1なら依頼と承認を同じ人が1回でしてよい(self_approved)", "type": "integer", "minimum": 1 }, "caller": { "$ref": "#/$defs/caller" }, "operation": { "title": "AccessCaseOperation", "type": "object", "additionalProperties": false, "required": ["permission", "project"], "properties": { "permission": { "$ref": "permission.schema.json" }, "project": { "description": "操作のプロジェクト。null はプロジェクトにつかない操作(所属・エージェント・トークン・組織の一覧)", "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "own_token": { "description": "access.token.issue・access.token.revoke の相手が呼び手自身のトークンか。書かなければ false", "type": "boolean" } } }, "approval": { "title": "AccessCaseApproval", "description": "access.approval.decide のときだけ書く。決める依頼の操作と依頼した主体。operation.project は依頼のプロジェクトと同じにする", "type": "object", "additionalProperties": false, "required": ["action", "requested_by", "tier"], "properties": { "action": { "$ref": "permission.schema.json" }, "requested_by": { "$ref": "principal.schema.json#/$defs/principalId" }, "tier": { "$ref": "approval.schema.json#/$defs/approvalTier" }, "requested_by_owner": { "description": "依頼した主体がエージェントのときのオーナーの人。書かなければ null", "anyOf": [{ "$ref": "principal.schema.json#/$defs/userId" }, { "type": "null" }] }, "requested_by_agent_kind": { "description": "依頼した主体がエージェントのときの種類。書かなければ null", "anyOf": [{ "$ref": "principal.schema.json#/$defs/agentKind" }, { "type": "null" }] } } }, "expect": { "$ref": "#/$defs/expect" } }, "$defs": { "caller": { "title": "AccessCaseCaller", "type": "object", "additionalProperties": false, "required": ["credential", "step_up", "memberships"], "properties": { "credential": { "description": "core に届いた証。access_service_only は Access のサービストークンだけで core のトークンが無い", "enum": ["access_email", "user_token", "agent_token", "server_key", "binding", "access_service_only"] }, "principal_id": { "description": "access_service_only のときは書かない", "$ref": "principal.schema.json#/$defs/principalId" }, "agent_location": { "description": "agent_token のときだけ書く", "$ref": "principal.schema.json#/$defs/agentLocation" }, "agent_kind": { "description": "agent_token のときだけ書く。書かなければ maker", "$ref": "principal.schema.json#/$defs/agentKind" }, "owner_user": { "description": "agent_token のときだけ書く。エージェントのオーナーの人。approval.requested_by_owner と比べる。書かなければ null", "$ref": "principal.schema.json#/$defs/userId" }, "step_up": { "description": "本人の確認つきか。ut_ はいつも true。Access の email はログインから12時間以内なら true。ほかはいつも false", "type": "boolean" }, "memberships": { "type": "array", "items": { "title": "AccessCaseMembership", "type": "object", "additionalProperties": false, "required": ["role", "project"], "properties": { "role": { "$ref": "role.schema.json" }, "project": { "description": "null は組織の所属", "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] } } } }, "token": { "title": "AccessCaseToken", "description": "user_token・agent_token のときだけ書く。scopes が null は操作を絞らない(主体の今の役割に従う。出すときに何も選ばなければこれ)。ただし段階3(level が 3)の操作は役割からは付かず、scopes の一覧か level3_scopes に書いた時だけ使える(書かなければ null)。projects が null は絞りなし。絞りのあるトークンでプロジェクトにつかない操作(project が null)ができるのは、読むグループのうち段階1と段階の無い物(答えは絞りのプロジェクトに切る。監査の一覧 audit.read は除く)と、エージェントの自分のトークンの取り消し・回しの依頼(own_only・request_own)だけ。段階2・3の読みと監査の一覧は project を付けて呼ぶ", "type": "object", "additionalProperties": false, "required": ["scopes", "projects"], "properties": { "scopes": { "anyOf": [{ "type": "array", "items": { "$ref": "permission.schema.json" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] }, "level3_scopes": { "description": "scopes が null のトークンに足す段階3の操作。書かなければ null", "anyOf": [{ "type": "array", "items": { "$ref": "permission.schema.json#/$defs/level3Permission" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] }, "projects": { "anyOf": [{ "type": "array", "items": { "$ref": "../common.schema.json#/$defs/projectId" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] } } } }, "allOf": [{ "if": { "properties": { "credential": { "const": "access_service_only" } } }, "then": { "not": { "anyOf": [{ "required": ["principal_id"] }, { "required": ["token"] }, { "required": ["agent_location"] }] }, "properties": { "step_up": { "const": false } } }, "else": { "required": ["principal_id"] } }, { "if": { "properties": { "credential": { "const": "agent_token" } } }, "then": { "required": ["agent_location", "token"], "properties": { "step_up": { "const": false }, "principal_id": { "type": "string", "pattern": "^agt_" } } }, "else": { "not": { "anyOf": [{ "required": ["agent_location"] }, { "required": ["agent_kind"] }, { "required": ["owner_user"] }] } } }, { "if": { "properties": { "credential": { "const": "user_token" } } }, "then": { "required": ["token"], "properties": { "step_up": { "const": true }, "principal_id": { "type": "string", "pattern": "^usr_" } } } }, { "if": { "properties": { "credential": { "const": "access_email" } } }, "then": { "not": { "required": ["token"] }, "properties": { "principal_id": { "type": "string", "pattern": "^usr_" } } } }, { "if": { "properties": { "credential": { "enum": ["server_key", "binding"] } } }, "then": { "not": { "required": ["token"] }, "properties": { "step_up": { "const": false }, "principal_id": { "type": "string", "pattern": "^(key_|bind:)" } } } }] }, "expect": { "title": "AccessCaseExpect", "oneOf": [{ "description": "実行する。self_approved は承認の要る操作を、人が1人の組織の人が本人の確認つきで自分でしたとき true", "type": "object", "additionalProperties": false, "required": ["result", "status", "self_approved"], "properties": { "result": { "const": "allow" }, "status": { "const": 200 }, "self_approved": { "type": "boolean" } } }, { "description": "実行せずに承認の依頼を作り、202 PendingApproval を返す。tier は access.ts の承認の段階。policy は core の決まりの確かめが通ればその場で実行し、外れたら reviewer の依頼にする", "type": "object", "additionalProperties": false, "required": ["result", "status", "tier"], "properties": { "result": { "const": "pending_approval" }, "status": { "const": 202 }, "tier": { "enum": ["policy", "reviewer", "human"] } } }, { "description": "403 step_up_required。本人の確認をしてからもう一度呼ぶ", "type": "object", "additionalProperties": false, "required": ["result", "status", "code"], "properties": { "result": { "const": "step_up_required" }, "status": { "const": 403 }, "code": { "const": "step_up_required" } } }, { "description": "断る。token_required は 401。scope_missing は役割かトークンが操作を持たない(付ければ通る)。forbidden はその主体の種類には付けられない(sk_・binding の管理の道・エージェントの上限・依頼した人が自分で承認する)", "type": "object", "additionalProperties": false, "required": ["result", "status", "code"], "properties": { "result": { "const": "deny" }, "status": { "enum": [401, 403] }, "code": { "enum": ["token_required", "scope_missing", "forbidden"] } }, "if": { "properties": { "code": { "const": "token_required" } } }, "then": { "properties": { "status": { "const": 401 } } }, "else": { "properties": { "status": { "const": 403 } } } }] } } },
8
+ "access/membership.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/membership.schema.json", "title": "Membership", "description": "所属(docs/access-control.md の 4.1節)。主体 × 役割。project が null は組織の全部のプロジェクト(組織の所属がプロジェクトをまたぐ)、書いたらそのプロジェクトだけに足す。同じ主体に役割を2つ付けてよい(手元の Claude Code は組織の editor と support)。行の鍵は組織・主体・役割・プロジェクト。エージェントに owner・admin・billing を付けても、確かめのときに外す。表は access_membership", "type": "object", "additionalProperties": false, "required": ["org", "principal_id", "role", "project", "created_at", "created_by"], "properties": { "org": { "$ref": "org.schema.json#/$defs/orgId" }, "principal_id": { "$ref": "principal.schema.json#/$defs/memberId" }, "role": { "$ref": "role.schema.json" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "$ref": "principal.schema.json#/$defs/principalId" } }, "$defs": { "memberList": { "title": "MemberList", "description": "GET /v1/access/orgs/:org/members の答え(access.member.read)", "type": "object", "additionalProperties": false, "required": ["members"], "properties": { "members": { "type": "array", "items": { "$ref": "#" } } } }, "putMemberRequest": { "title": "PutMemberRequest", "description": "PUT /v1/access/orgs/:org/members の本文(access.member.write・本人の確認)。同じ鍵の行があれば何もしない。消すのは DELETE /v1/access/orgs/:org/members に同じ3つを道の問い(principal_id・role・project)で渡す。エージェントに owner・admin・billing を付ける本文は 400 invalid", "type": "object", "additionalProperties": false, "required": ["principal_id", "role", "project"], "properties": { "principal_id": { "$ref": "principal.schema.json#/$defs/memberId" }, "role": { "$ref": "role.schema.json" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] } } } } },
9
+ "access/org.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/org.schema.json", "title": "AccessOrg", "description": "組織(docs/access-control.md の 4.1節)。プロジェクトは1つの組織だけに属する。今は本人の組織(id org_self000000000000・slug taniguchi-kyoichi・名前 谷口恭一)の1つだけで、マイグレーションで1回だけ入れる。記録は id を持ち、道と console の URL は slug を使う。表は access_org", "type": "object", "additionalProperties": false, "required": ["id", "slug", "name", "created_at"], "properties": { "id": { "$ref": "#/$defs/orgId" }, "slug": { "$ref": "#/$defs/orgSlug" }, "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "orgId": { "title": "AccessOrgId", "description": "組織の id(org_ +16文字)", "type": "string", "pattern": "^org_[A-Za-z0-9]{16}$" }, "orgSlug": { "title": "AccessOrgSlug", "description": "組織の短い名前。道(/v1/access/orgs/:org)と console の URL(/:org)に使う。本人の組織は self", "type": "string", "pattern": "^[a-z][a-z0-9-]{1,39}$" } } },
10
+ "access/permission.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/permission.schema.json", "title": "Permission", "description": "操作の名前(docs/access-control.md の 4.3節)。core の管理の道は全部、どれか1つに当たる。並びと中身は packages/contract/src/access.ts の permissions の表と同じ(test/access.test.ts が確かめる)。グループ・役割ごとの可否・AI の上限・承認・人のデータの段階は access.ts に書く", "enum": ["registry.read", "campaigns.read", "notify.read", "links.read", "people.aggregate.read", "people.person.read", "support.aggregate.read", "support.ticket.list", "support.ticket.read", "support.attachment.read", "support.review.read", "support.feedback.read", "audit.read", "access.approval.read", "access.member.read", "access.agent.read", "sessions.aggregate.read", "sessions.person.read", "sessions.replay.read", "sessions.live.watch", "config.read", "releases.read", "creatives.read", "insights.read", "insights.sql", "acq.read", "ledger.read", "notify.plan.check", "legal.check", "links.create", "registry.device.write", "registry.project.icon", "support.redraft", "sessions.summarize", "sessions.keep", "sessions.review", "releases.sync", "registry.run.write", "releases.manifest.push", "releases.week.write", "releases.change.write", "creatives.capture.write", "creatives.brand.write", "creatives.page.write", "creatives.text.write", "creatives.variant.generate", "creatives.keyword.sync", "creatives.step.complete", "creatives.run", "creatives.reference.write", "campaigns.bundle.write", "insights.collect", "insights.kpi.write", "acq.channel.write", "acq.post.write", "ledger.write", "campaigns.stop", "notify.campaign.stop", "notify.variant.reject", "notify.variant.retire", "support.resolve", "support.draft.reject", "config.stop", "creatives.variant.write", "creatives.test.stop", "campaigns.push", "campaigns.resume", "campaigns.rollback", "notify.variant.approve", "notify.campaign.resume", "support.reply", "support.review.reply", "help.push", "legal.push", "sessions.policy.push", "pricing.push", "segments.push", "notices.read", "notices.check", "notices.image.write", "notices.push", "notices.stop", "config.push", "notify.plan.push", "creatives.text.approve", "creatives.variant.approve", "creatives.test.write", "creatives.submit", "insights.finding.decide", "registry.project.create", "registry.project.update", "registry.app.write", "registry.budget.write", "registry.cost.write", "registry.policy.write", "registry.org.write", "registry.account.write", "keys.create", "keys.revoke", "people.forget", "access.member.write", "access.agent.write", "access.token.issue", "access.token.revoke", "access.approval.decide", "access.policy.write", "billing.manage"], "$defs": { "level3Permission": { "title": "Level3Permission", "description": "人のデータの段階3(本文・録画・データレイクの SQL)の操作。トークンの scopes が null(役割に従う)でも役割からは付かず、トークンの scopes の一覧か level3_scopes に書いた時だけ使える(docs/design/access.md 4.1節)。並びと中身は access.ts の level が 3 の操作と同じ(test/access.test.ts)", "enum": ["support.ticket.read", "support.attachment.read", "support.feedback.read", "sessions.replay.read", "sessions.live.watch", "insights.sql"] }, "permissionGroup": { "title": "PermissionGroup", "description": "操作のグループ。read 読む・create 作る・stop 止める・outward 外に出る・settings 設定", "enum": ["read", "create", "stop", "outward", "settings"] } } },
11
+ "access/policy.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/policy.schema.json", "title": "AccessPolicy", "description": "承認の決まり(docs/access-control.md の 6.3節)。プロジェクトごと。行が無いプロジェクトは今の値(approval・0・[]・500)。notify のアプリごとの review はこれに置き替えて消す。notify は core の D1 のこの表を読むだけで、書かない。表は access_policy", "type": "object", "additionalProperties": false, "required": ["project", "outward", "auto_max_reach", "auto_channels", "large_reach", "updated_at", "updated_by"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "outward": { "$ref": "#/$defs/outwardRule" }, "auto_max_reach": { "description": "auto_small のとき、承認なしで出せる上限の人数。件の push は simulate の treatment の人数、通知の文面は施策の直近7日の配信の人数", "type": "integer", "minimum": 0 }, "auto_channels": { "description": "auto_small のとき、承認なしで出せる channel(testflight だけ、など)", "type": "array", "items": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "uniqueItems": true }, "large_reach": { "description": "大きい割合の配信の人数。treatment の人数がこれを超えるか、直近7日に開いた人の50%を超える件・施策は、auto_small でも必ず承認", "type": "integer", "minimum": 0 }, "updated_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "updated_by": { "anyOf": [{ "$ref": "principal.schema.json#/$defs/principalId" }, { "type": "null" }] } }, "$defs": { "outwardRule": { "title": "AccessOutwardRule", "description": "approval は外に出る操作を全部承認。auto_small は auto_max_reach と auto_channels の小さい範囲だけ AI が承認なしで出せる(出た後に本人へ知らせる)", "enum": ["approval", "auto_small"] }, "putAccessPolicyRequest": { "title": "PutAccessPolicyRequest", "description": "PUT /v1/access/projects/:project/policy の本文(access.policy.write・本人の確認)。全部の項目を書く。読むのは GET の同じ道(registry.read)", "type": "object", "additionalProperties": false, "required": ["outward", "auto_max_reach", "auto_channels", "large_reach"], "properties": { "outward": { "$ref": "#/$defs/outwardRule" }, "auto_max_reach": { "type": "integer", "minimum": 0 }, "auto_channels": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "uniqueItems": true }, "large_reach": { "type": "integer", "minimum": 0 } } } } },
12
+ "access/principal.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/principal.schema.json", "title": "Principal", "description": "所属と役割を持てる主体(docs/access-control.md の 3節)。人(usr_)とエージェント(agt_)の2つ。アプリの Worker(key_…・bind:<project>)と中の処理(sys:<名前>)は表に持たず、監査の principal_id にだけ出る。端末は主体にしない。表は access_principal", "oneOf": [{ "$ref": "#/$defs/userPrincipal" }, { "$ref": "#/$defs/agentPrincipal" }], "$defs": { "userPrincipal": { "title": "UserPrincipal", "description": "人。今は本人だけ。承認の段階が human の依頼を決められるのは人だけ(reviewer の段階は点検役のエージェントも決める)", "type": "object", "additionalProperties": false, "required": ["kind", "id", "email", "status", "created_at"], "properties": { "kind": { "const": "user" }, "id": { "$ref": "#/$defs/userId" }, "email": { "type": "string", "pattern": "^[^@\\s]+@[a-z0-9.-]+\\.[a-z]{2,}$", "maxLength": 254 }, "status": { "$ref": "#/$defs/principalStatus" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "agentPrincipal": { "title": "AgentPrincipal", "description": "AI のエージェント。必ず1人の人に属する(owner_user)。オーナーの人が外れたら、このエージェントのトークンも止まる。同じ AI でも動く場所ごとに別のエージェントにする", "type": "object", "additionalProperties": false, "required": ["kind", "id", "org", "name", "location", "agent_kind", "owner_user", "status", "created_at"], "properties": { "kind": { "const": "agent" }, "id": { "$ref": "#/$defs/agentId" }, "org": { "$ref": "org.schema.json#/$defs/orgId" }, "name": { "$ref": "#/$defs/agentName" }, "location": { "$ref": "#/$defs/agentLocation" }, "agent_kind": { "$ref": "#/$defs/agentKind" }, "owner_user": { "$ref": "#/$defs/userId" }, "status": { "$ref": "#/$defs/principalStatus" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "userId": { "title": "UserId", "description": "人の id(usr_ +16文字)", "type": "string", "pattern": "^usr_[A-Za-z0-9]{16}$" }, "agentId": { "title": "AgentId", "description": "エージェントの id(agt_ +16文字)", "type": "string", "pattern": "^agt_[A-Za-z0-9]{16}$" }, "memberId": { "title": "MemberPrincipalId", "description": "所属とトークンを持てる主体の id(人かエージェント)", "anyOf": [{ "$ref": "#/$defs/userId" }, { "$ref": "#/$defs/agentId" }] }, "principalId": { "title": "PrincipalId", "description": "監査と承認に残す主体の id。人 usr_…・エージェント agt_…・サーバーキー key_…(sk_ のキーの id)・Service Binding bind:<project>・中の処理 sys:<名前>(sys:support-drafter・sys:notify-weekly・sys:core-cron・sys:session-summarizer・sys:releases・sys:creatives・sys:creatives-weekly・sys:insights-daily)", "type": "string", "pattern": "^(usr_[A-Za-z0-9]{16}|agt_[A-Za-z0-9]{16}|key_[A-Za-z0-9]{16}|bind:[a-z][a-z0-9-]{1,63}|sys:[a-z][a-z0-9-]{1,39})$" }, "principalKind": { "title": "PrincipalKind", "description": "主体の種類。user 人・agent エージェント・service アプリの Worker(sk_ か binding)・system 中の処理。端末は入れない。access.ts の PRINCIPAL_KINDS と同じ", "enum": ["user", "agent", "service", "system"] }, "principalStatus": { "title": "PrincipalStatus", "description": "disabled にすると次の要求から、その主体のトークンが全部止まる", "enum": ["active", "disabled"] }, "agentName": { "title": "AgentName", "description": "エージェントの名前。組織の中で1つ(claude-code・playbook-analyst・playbook-worker)", "type": "string", "pattern": "^[a-z][a-z0-9-]{1,39}$" }, "agentLocation": { "title": "AgentLocation", "description": "エージェントの動く場所。local は手元の Claude Code。managed はクラウドの Managed Agents と app-playbook の Worker。cloud はクラウドの Claude(MCP のサーバー mcp.appgrowstack.com を Access のアプリの内側で通った人の下のエージェント・docs/design/mcp.md)。access.ts の ai の列の local_only(段階2と段階3の読み)は local だけに付く", "enum": ["local", "managed", "cloud"] }, "agentKind": { "title": "AgentKind", "description": "エージェントの種類(ADR 0050)。maker は作る役で、件・設定・下書きを作り、外に出る物は依頼にする。reviewer は点検役で、依頼を作る操作は全部 403。決められるのは承認の段階が reviewer の依頼と、持ち物の待ち行列のうち段階が reviewer の物だけ。作った主体と、作った主体と同じ人の下の同じ種類のエージェントは、その依頼を決められない。access.ts の AGENT_KINDS と同じ", "enum": ["maker", "reviewer"] }, "via": { "title": "AccessVia", "description": "どの証で来たか。access_email(Access の email のログイン)・user_token(ut_)・agent_token(エージェントの証。at_・mcp の Access のアプリの JWT・エージェントに結んだ Access のサービストークン)・server_key(sk_)・binding(Service Binding)・system(Worker の中の処理)。access.ts の AUDIT_VIA と同じ", "enum": ["access_email", "user_token", "agent_token", "server_key", "binding", "system"] }, "whoAmI": { "title": "WhoAmI", "description": "GET /v1/access/whoami の答え。呼んだ主体・証・本人の確認・所属・プロジェクトごとの実際の権限。console は組織とプロジェクトの切り替えとボタンの出し分けにこれを読む(出し分けは確かめの代わりにしない)", "type": "object", "additionalProperties": false, "required": ["principal", "via", "token", "on_behalf_of", "step_up", "memberships", "permissions"], "properties": { "principal": { "$ref": "#" }, "via": { "enum": ["access_email", "user_token", "agent_token"] }, "token": { "description": "使ったトークン。Access の email のログインは null", "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["id", "scopes", "level3_scopes", "projects", "expires_at"], "properties": { "id": { "$ref": "token.schema.json#/$defs/tokenId" }, "scopes": { "description": "トークンの操作の絞り。null は主体の今の役割に従う", "anyOf": [{ "type": "array", "items": { "$ref": "permission.schema.json" }, "uniqueItems": true }, { "type": "null" }] }, "level3_scopes": { "description": "役割に従うトークンに足した段階3の操作(token.schema.json の level3_scopes)。null は段階3を使わない", "anyOf": [{ "type": "array", "items": { "$ref": "permission.schema.json#/$defs/level3Permission" }, "uniqueItems": true }, { "type": "null" }] }, "projects": { "anyOf": [{ "type": "array", "items": { "$ref": "../common.schema.json#/$defs/projectId" }, "uniqueItems": true }, { "type": "null" }] }, "expires_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, { "type": "null" }] }, "on_behalf_of": { "description": "エージェントのときはオーナーの人。人のときは null", "anyOf": [{ "$ref": "#/$defs/userId" }, { "type": "null" }] }, "step_up": { "title": "WhoAmIStepUp", "description": "本人の確認。ut_ はトークンそのものが証なので verified が true で verified_at は null。Access の email のログインは、ログインから12時間以内なら true で verified_at はログインの時刻。エージェントはいつも false", "type": "object", "additionalProperties": false, "required": ["verified", "verified_at"], "properties": { "verified": { "type": "boolean" }, "verified_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "memberships": { "type": "array", "items": { "title": "WhoAmIMembership", "type": "object", "additionalProperties": false, "required": ["org", "role", "project"], "properties": { "org": { "type": "object", "additionalProperties": false, "required": ["id", "slug", "name"], "properties": { "id": { "$ref": "org.schema.json#/$defs/orgId" }, "slug": { "$ref": "org.schema.json#/$defs/orgSlug" }, "name": { "type": "string" } } }, "role": { "$ref": "role.schema.json" }, "project": { "description": "null は組織の全部のプロジェクト", "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] } } } }, "permissions": { "description": "プロジェクトごとの実際の権限(組織の所属の役割 ∪ そのプロジェクトの所属の役割 ∩ トークンの scope ∩ トークンのプロジェクトの絞り。エージェントは ai の列の上限も引く)。依頼まで(202 になる)の操作も入る", "type": "array", "items": { "title": "WhoAmIProjectPermissions", "type": "object", "additionalProperties": false, "required": ["org", "project", "permissions"], "properties": { "org": { "$ref": "org.schema.json#/$defs/orgId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "permissions": { "type": "array", "items": { "$ref": "permission.schema.json" }, "uniqueItems": true } } } } } }, "agentList": { "title": "AgentList", "description": "GET /v1/access/orgs/:org/agents の答え(access.agent.read)", "type": "object", "additionalProperties": false, "required": ["agents"], "properties": { "agents": { "type": "array", "items": { "$ref": "#/$defs/agentPrincipal" } } } }, "createAgentRequest": { "title": "CreateAgentRequest", "description": "POST /v1/access/orgs/:org/agents の本文(access.agent.write)。エージェントが呼ぶと本人が決める依頼になり、承認の画面に本文が全部出る。owner_user を書かなければ呼んだ人(エージェントならそのオーナーの人)。agent_kind を書かなければ maker(作る役)。memberships と service_token を書くと、作ると同時に役割を付けてサービストークンを結び、点検役を1つの依頼で用意できる。トークン(at_)は access.token.issue で別に出す", "type": "object", "additionalProperties": false, "required": ["name", "location"], "properties": { "name": { "$ref": "#/$defs/agentName" }, "location": { "$ref": "#/$defs/agentLocation" }, "agent_kind": { "$ref": "#/$defs/agentKind" }, "owner_user": { "$ref": "#/$defs/userId" }, "memberships": { "description": "作ると同時に付ける役割。エージェントに付けられる editor・support・viewer だけ。project が null なら組織の全部", "type": "array", "maxItems": 10, "items": { "type": "object", "additionalProperties": false, "required": ["role", "project"], "properties": { "role": { "enum": ["editor", "support", "viewer"] }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] } } } }, "service_token": { "description": "作ると同時に結ぶ Access のサービストークンの common_name。ほかの組織に結ばれていれば 409 で何も作らない", "$ref": "#/$defs/serviceTokenCommonName" } } }, "serviceTokenCommonName": { "title": "ServiceTokenCommonName", "description": "Access のサービストークンの common_name(Client ID)", "type": "string", "pattern": "^[A-Za-z0-9._-]{1,128}$" }, "serviceTokenAgent": { "title": "ServiceTokenAgent", "description": "Access のサービストークンとエージェントの結び(1つのトークンに1つのエージェント)。サービストークンだけで来た要求(クラウドの CLI・点検役)は、ここに結んだエージェントとして動く。結んでいないトークンは 401 token_required", "type": "object", "additionalProperties": false, "required": ["common_name", "agent_id", "created_at", "created_by"], "properties": { "common_name": { "$ref": "#/$defs/serviceTokenCommonName" }, "agent_id": { "$ref": "#/$defs/agentId" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "$ref": "#/$defs/userId" } } }, "serviceTokenAgentList": { "title": "ServiceTokenAgentList", "description": "GET /v1/access/service-tokens の答え(access.agent.read)", "type": "object", "additionalProperties": false, "required": ["service_tokens"], "properties": { "service_tokens": { "type": "array", "items": { "$ref": "#/$defs/serviceTokenAgent" } } } }, "putServiceTokenAgentRequest": { "title": "PutServiceTokenAgentRequest", "description": "PUT /v1/access/service-tokens/:common_name の本文(access.agent.write・本人の確認)。結ぶ先は組織の生きているエージェント", "type": "object", "additionalProperties": false, "required": ["agent_id"], "properties": { "agent_id": { "$ref": "#/$defs/agentId" } } }, "cloudAgentsStatusResponse": { "title": "CloudAgentsStatusResponse", "description": "POST /v1/access/cloud/revoke・/v1/access/cloud/start の答え(access.agent.write)。呼んだ人の下のクラウドのエージェント(location cloud)の状態を変えた数。止めると次の要求から mcp は 403", "type": "object", "additionalProperties": false, "required": ["changed"], "properties": { "changed": { "type": "integer", "minimum": 0 } } } } },
13
+ "access/role.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/role.schema.json", "title": "Role", "description": "役割(docs/access-control.md の 4.2節)。決まった6つだけで、自分で役割を作る仕組みは作らない。エージェントには owner・admin・billing を付けられない(付けても確かめのときに外す)。並びは access.ts の ROLES と同じ", "enum": ["owner", "admin", "editor", "support", "viewer", "billing"] },
14
+ "access/token.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/access/token.schema.json", "title": "AccessToken", "description": "core が出すトークン(docs/access-control.md の 5節)の一覧の1件。人の ut_ とエージェントの at_。core は値の sha256 と末尾4文字(hint)だけを持ち、値は作った答えで1回だけ返す。要求のたびに期限・取り消し・主体とオーナーの人が生きているかを見る。last_used_at は1時間に1回まで書く。表は access_token", "type": "object", "additionalProperties": false, "required": ["id", "principal_id", "kind", "scopes", "level3_scopes", "projects", "hint", "created_at", "created_by", "expires_at", "last_used_at", "revoked_at"], "properties": { "id": { "$ref": "#/$defs/tokenId" }, "principal_id": { "$ref": "principal.schema.json#/$defs/memberId" }, "kind": { "$ref": "#/$defs/tokenKind" }, "scopes": { "description": "このトークンで使える操作の絞り。null は絞らず、主体の今の役割の権限に従う(エージェントは ai の列の上限も効く)。操作を足しても出し直さなくてよい。一覧は絞ったトークンだけで、主体の役割の権限との重なりだけが効く。段階3の操作は null からは付かない(level3_scopes)", "anyOf": [{ "type": "array", "items": { "$ref": "permission.schema.json" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] }, "level3_scopes": { "description": "scopes が null(役割に従う)のトークンに明示で足す段階3の操作。段階3(本文・録画・データレイクの SQL)は役割からは付かず、scopes の一覧かここに書いた物だけが使える。役割にその操作が無ければ効かない。scopes が一覧のトークンは null(段階3も一覧に書く)。null は段階3を使わない", "anyOf": [{ "type": "array", "items": { "$ref": "permission.schema.json#/$defs/level3Permission" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] }, "projects": { "description": "使えるプロジェクトの絞り。null は主体の所属の全部", "anyOf": [{ "type": "array", "items": { "$ref": "../common.schema.json#/$defs/projectId" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] }, "hint": { "description": "種類と末尾4文字(at_…a1B2)", "type": "string", "pattern": "^(ut|at)_…[A-Za-z0-9]{4}$" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "description": "出した主体。承認の依頼から出たときは承認した人", "$ref": "principal.schema.json#/$defs/principalId" }, "expires_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "last_used_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "revoked_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } }, "$defs": { "tokenId": { "title": "AccessTokenId", "description": "トークンの id(tok_ +16文字)。値ではない", "type": "string", "pattern": "^tok_[A-Za-z0-9]{16}$" }, "tokenKind": { "title": "AccessTokenKind", "description": "user は人の ut_(本人の確認つきとして扱う)・agent はエージェントの at_", "enum": ["user", "agent"] }, "userTokenValue": { "title": "UserTokenValue", "description": "本人のトークンの値(ut_ +40文字)。本人の確認(手元では Touch ID)を通してしか取り出せない保存先にだけ置く", "type": "string", "pattern": "^ut_[A-Za-z0-9]{40}$" }, "agentTokenValue": { "title": "AgentTokenValue", "description": "エージェントのトークンの値(at_ +40文字)。置き場所は CLI の --sink で選ぶ(基盤は保存先の仕組みを知らない・ADR 0050)", "type": "string", "pattern": "^at_[A-Za-z0-9]{40}$" }, "issueTokenRequest": { "title": "IssueTokenRequest", "description": "POST /v1/access/tokens の本文(access.token.issue)。owner が本人の確認つきで呼べば出す。エージェントが自分のトークンの回しで呼べば 202 PendingApproval になる。値を保存先に書く(--sink)のは CLI の中だけで、本文に入れない", "type": "object", "additionalProperties": false, "required": ["principal_id", "days"], "properties": { "principal_id": { "$ref": "principal.schema.json#/$defs/memberId" }, "scopes": { "description": "絞るときだけ書く。書かないか null なら、主体の今の役割に従う(表の scopes_json は NULL)。段階3の操作は役割からは付かないので、絞るなら一覧に、絞らないなら level3_scopes に書く", "anyOf": [{ "type": "array", "items": { "$ref": "permission.schema.json" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] }, "level3_scopes": { "description": "scopes を書かない(役割に従う)トークンに足す段階3の操作。scopes を書くときは書かない(core が invalid で断る)", "anyOf": [{ "type": "array", "items": { "$ref": "permission.schema.json#/$defs/level3Permission" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] }, "projects": { "description": "書かなければ null(主体の所属の全部)", "anyOf": [{ "type": "array", "items": { "$ref": "../common.schema.json#/$defs/projectId" }, "minItems": 1, "uniqueItems": true }, { "type": "null" }] }, "days": { "description": "期限の日数(90日まで)", "type": "integer", "minimum": 1, "maximum": 90 }, "replaces": { "description": "回すときの古いトークン。新しい値を入れた後に呼び手が自分で revoke する", "$ref": "#/$defs/tokenId" } } }, "issueTokenResponse": { "title": "IssueTokenResponse", "description": "201。secret は今だけ見せる(表には sha256 だけ)。承認の依頼から出たときは、承認した CLI の答え(AccessApproval の result)の中だけで返す", "type": "object", "additionalProperties": false, "required": ["token", "secret"], "properties": { "token": { "$ref": "#" }, "secret": { "anyOf": [{ "$ref": "#/$defs/userTokenValue" }, { "$ref": "#/$defs/agentTokenValue" }] } } }, "tokenList": { "title": "AccessTokenList", "description": "GET /v1/access/tokens の答え。owner は組織の全部、それ以外は自分のトークンだけ。取り消しは POST /v1/access/tokens/:id/revoke(access.token.revoke)", "type": "object", "additionalProperties": false, "required": ["tokens"], "properties": { "tokens": { "type": "array", "items": { "$ref": "#" } } } } } },
15
+ "acquisition/attribution.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/acquisition/attribution.schema.json", "title": "AcquisitionAttribution", "description": "人の紐付けの1行(core の acq_attribution・docs/design/acquisition.md 4.1節)。1インストールに1行で、変えない。入れた後の最初の起動で端末が送る AttributionRequest(links/attribution.schema.json)から、手がかりの順で最初に当たった物を使う。決まらなければ channel は unknown・matched_by は none。キーの無い階層は空の文字", "type": "object", "additionalProperties": false, "required": ["channel", "kind", "campaign", "group", "term", "creative", "matched_by", "code", "conversion_type", "claim_type", "supply_placement", "tapped_at", "country"], "properties": { "channel": { "description": "チャネルの id。決まらなければ unknown。登録の無いチャネルの名前(utm_source)で来た人も unknown", "type": "string", "pattern": "^[a-z][a-z0-9-]{0,29}$" }, "kind": { "$ref": "channel.schema.json#/$defs/rowKind" }, "campaign": { "$ref": "#/$defs/key" }, "group": { "$ref": "#/$defs/key" }, "term": { "$ref": "#/$defs/key" }, "creative": { "description": "素材(横の軸)。Apple Ads は広告の id、短いリンクは無し", "$ref": "#/$defs/key" }, "matched_by": { "$ref": "#/$defs/matchedBy" }, "code": { "description": "手がかりになった短いリンクの code。無ければ null", "anyOf": [{ "$ref": "../links/link.schema.json#/$defs/code" }, { "type": "null" }] }, "conversion_type": { "description": "AdServices の conversionType(download・redownload)。apple_ads でなければ null", "enum": ["download", "redownload", null] }, "claim_type": { "description": "AdServices の claimType(click・impression)。表示だけで入れた人を分けて数える。apple_ads でなければ null", "enum": ["click", "impression", null] }, "supply_placement": { "description": "AdServices の supplyPlacement(search_results・search_tab・today_tab・product_page などを小文字の snake_case に)。無ければ null", "type": ["string", "null"], "pattern": "^[a-z_]{1,40}$" }, "tapped_at": { "description": "広告をタップした時刻(AdServices の clickDate)。無ければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "country": { "description": "国(AdServices の countryOrRegion)。無ければ null", "type": ["string", "null"], "pattern": "^[A-Z]{2}$" } }, "$defs": { "key": { "title": "AcquisitionNodeKey", "description": "4つの階層と素材のキー。外の id はそのまま文字にし、自分で付けた名前は小文字の kebab-case。無い階層は空の文字", "type": "string", "maxLength": 200 }, "matchedBy": { "title": "AcquisitionMatchedBy", "description": "どの手がかりで付いたか。play_referrer は Play Install Referrer の code か utm・invite は招待のリンク・cross_promo はほかのアプリの紹介・opened_url は最初の起動を開いた URL・apple_ads は AdServices・web_purchase は Web で買った人のサインイン・none は手がかりが無い", "enum": ["play_referrer", "invite", "cross_promo", "opened_url", "apple_ads", "web_purchase", "none"] } } },
16
+ "acquisition/channel.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/acquisition/channel.schema.json", "title": "AcquisitionChannel", "description": "獲得のチャネルの登録(core の acq_channel の1行・docs/design/acquisition.md 3.3節)。1つのアプリが持つ1つの手法。登録したチャネルだけが取り込みと画面に出る。決まらない人のチャネル unknown はどのアプリにも自動であり、登録しない。書くのは app-growth acq channel add・set・pause だけで、監査に残す", "type": "object", "additionalProperties": false, "required": ["project", "id", "kind", "name", "account", "status", "created_at", "updated_at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "id": { "$ref": "#/$defs/channelId" }, "kind": { "$ref": "#/$defs/kind" }, "name": { "description": "画面に出す名前(例: gohobishukan.com の記事)", "type": "string", "minLength": 1, "maxLength": 60 }, "account": { "$ref": "#/$defs/account" }, "status": { "$ref": "#/$defs/status" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "channelId": { "title": "AcquisitionChannelId", "description": "アプリの中のチャネルの名前(小文字の kebab-case)。短いリンクの名前(/go/<チャネル>-<区分>)と、Play の utm_source の値に使う。unknown は決まらない人の行で、登録できない", "type": "string", "pattern": "^(?!unknown$)[a-z][a-z0-9-]{0,29}$" }, "kind": { "title": "AcquisitionChannelKind", "description": "チャネルの種類(コードが知る固定の一覧・設計 3.1節)。取り込み元と、人の紐付けの手がかりの読み方を決める。apple_ads は Apple Ads・paid_ads はほかの払う広告・store_search はストアの検索・store_browse はストアのおすすめと特集と直の訪問・web_search は自社サイトの自然検索・web は自社サイトへの検索以外の訪問・video は YouTube・social は SNS の自分の投稿・email はニュースレター・referral は招待とほかのアプリの紹介と掲載", "enum": ["apple_ads", "paid_ads", "store_search", "store_browse", "web_search", "web", "video", "social", "email", "referral"] }, "rowKind": { "title": "AcquisitionRowKind", "description": "表の行のチャネルの種類。登録の種類に、決まらない人の unknown を足した物", "enum": ["apple_ads", "paid_ads", "store_search", "store_browse", "web_search", "web", "video", "social", "email", "referral", "unknown"] }, "status": { "title": "AcquisitionChannelStatus", "description": "active は取り込みを回す。paused は取り込みを止め、表には過去の行だけを出す", "enum": ["active", "paused"] }, "account": { "title": "AcquisitionChannelAccount", "description": "外のアカウントの id。種類ごとに使う項目が決まる。apple_ads は ad_account(Apple Ads の X-AP-Context の adAccountId)と、あれば campaign_ids(このアプリのキャンペーンの id。無ければ取り込みが製品の App Store の id で探す)。web_search は site(Search Console のサイト。sc-domain:gohobishukan.com)と url(サイトの頭の URL)と、あれば sections(キャンペーンの区分。パスの頭 → 区分の名前)。web は url と、あれば feed(Zenn・note など外の場所に書いた記事の RSS。取り込み元 web-feed が記事の一覧に足す)。video は youtube_channel(取り込み元 youtube が動画の数を読む)。ほかの種類は空のオブジェクト", "type": "object", "additionalProperties": false, "properties": { "ad_account": { "type": "string", "pattern": "^[0-9]{1,20}$" }, "campaign_ids": { "type": "array", "maxItems": 50, "uniqueItems": true, "items": { "type": "string", "pattern": "^[0-9]{1,20}$" } }, "site": { "type": "string", "pattern": "^(sc-domain:[a-z0-9.-]+|https://[^\\s]+)$", "maxLength": 200 }, "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" }, "sections": { "type": "object", "maxProperties": 20, "propertyNames": { "pattern": "^/[a-z0-9/_-]{0,60}$" }, "additionalProperties": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,39}$" } }, "youtube_channel": { "type": "string", "pattern": "^UC[A-Za-z0-9_-]{22}$" }, "feed": { "$ref": "../common.schema.json#/$defs/httpsUrl" } } }, "addInput": { "title": "AddAcquisitionChannelInput", "description": "POST /v1/acq/projects/:project/channels(app-growth acq channel add)。同じ id が既にあれば 409。種類に合わない account の項目は 400", "type": "object", "additionalProperties": false, "required": ["id", "kind", "name"], "properties": { "id": { "$ref": "#/$defs/channelId" }, "kind": { "$ref": "#/$defs/kind" }, "name": { "type": "string", "minLength": 1, "maxLength": 60 }, "account": { "$ref": "#/$defs/account" } } }, "updateInput": { "title": "UpdateAcquisitionChannelInput", "description": "PATCH /v1/acq/projects/:project/channels/:channel(app-growth acq channel set・pause)。書いた項目だけ変える。種類は変えられない(消して足し直す)", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 60 }, "account": { "$ref": "#/$defs/account" }, "status": { "$ref": "#/$defs/status" } } }, "list": { "title": "AcquisitionChannelList", "description": "GET /v1/acq/projects/:project/channels。登録した順", "type": "object", "additionalProperties": false, "required": ["channels"], "properties": { "channels": { "type": "array", "maxItems": 100, "items": { "$ref": "#" } } } } } },
17
+ "acquisition/page.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/acquisition/page.schema.json", "title": "WebPage", "description": "記事の1ページ(insights の insights_web_page の1行・docs/design/acquisition.md 7.1節)。自社サイトの sitemap.xml のページと、獲得のチャネルの account.feed(Zenn・note の RSS)の記事を同じ形で持つ", "type": "object", "additionalProperties": false, "required": ["page", "origin", "title", "published_on", "first_seen", "last_seen", "verdict", "coverage_state"], "properties": { "page": { "description": "ページの URL", "type": "string", "maxLength": 2048 }, "origin": { "description": "どこで見つけたか。sitemap は自社サイトの sitemap.xml、ほかは RSS を持つ獲得のチャネルの id", "type": "string", "pattern": "^[a-z][a-z0-9-]{0,29}$" }, "title": { "description": "RSS の題。sitemap のページは null", "type": ["string", "null"], "maxLength": 300 }, "published_on": { "description": "RSS の公開の日か sitemap の lastmod", "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] }, "first_seen": { "$ref": "../common.schema.json#/$defs/day" }, "last_seen": { "$ref": "../common.schema.json#/$defs/day" }, "verdict": { "description": "URL Inspection の最後の verdict。調べていなければ null(RSS の記事は調べない)", "type": ["string", "null"], "maxLength": 40 }, "coverage_state": { "type": ["string", "null"], "maxLength": 200 } }, "$defs": { "list": { "title": "WebPageList", "description": "GET /v1/acq/projects/:project/pages(app-growth acq pages)。公開の日の新しい順。?origin=<sitemap かチャネルの id> で絞る。最後に見た日が一番新しい取り込みより古いページ(sitemap と RSS から消えたページ)は出さない", "type": "object", "additionalProperties": false, "required": ["pages"], "properties": { "pages": { "type": "array", "maxItems": 2000, "items": { "$ref": "#" } } } } } },
18
+ "acquisition/post.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/acquisition/post.schema.json", "title": "AcquisitionPost", "description": "投稿の1本(core の acq_post の1行・docs/design/acquisition.md 3.5節)。獲得のチャネル(kind video・social)の1つのアカウントに出す動画か投稿。キーは project・channel・id。元は channel の repo の予約表(episodes/schedule.json)と social/<組>/posts.json で、channel が予約・投稿のたびに app-growth acq posts put で送る。インストールと売上には結びつけない", "type": "object", "additionalProperties": false, "required": ["project", "channel", "id", "format", "title", "state", "scheduled_at", "posted_at", "url", "link_code", "external_id", "updated_at", "updated_by"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "channel": { "$ref": "channel.schema.json#/$defs/channelId" }, "id": { "$ref": "#/$defs/postId" }, "format": { "$ref": "#/$defs/format" }, "title": { "type": "string", "maxLength": 200 }, "state": { "$ref": "#/$defs/state" }, "scheduled_at": { "description": "予約の時刻。予約の無い在庫と出した後の投稿でも、最後に付いていた予約を残す", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "posted_at": { "description": "出した時刻。まだ出していなければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "url": { "description": "出した投稿の URL。まだ無ければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/httpsUrl" }, { "type": "null" }] }, "link_code": { "description": "投稿に貼った短いリンクの code(R6 の links_link)。貼っていなければ null", "anyOf": [{ "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{1,39}$" }, { "type": "null" }] }, "external_id": { "description": "外のサービスの id(YouTube の動画の id など)。獲得の表の組のキーと同じ値", "anyOf": [{ "type": "string", "maxLength": 80 }, { "type": "null" }] }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_by": { "description": "書いた主体の id", "type": "string", "maxLength": 80 } }, "$defs": { "postId": { "title": "AcquisitionPostId", "description": "channel の repo の中の投稿の名前(予約表の id・posts.json のキー)", "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$" }, "format": { "title": "AcquisitionPostFormat", "description": "投稿の型(short・long・short-zunda・social-phone など)。channel の repo が決める名前で、在庫を型ごとに分けて見るのに使う", "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,39}$" }, "state": { "title": "AcquisitionPostState", "description": "stock は作って上げたがまだ予約の無い在庫・scheduled は予約が付いている・posted は出した・dropped は出さないと決めた", "enum": ["stock", "scheduled", "posted", "dropped"] }, "putItem": { "title": "AcquisitionPostInput", "description": "送る1本。書かない項目は null として置き換える", "type": "object", "additionalProperties": false, "required": ["id", "format", "title", "state"], "properties": { "id": { "$ref": "#/$defs/postId" }, "format": { "$ref": "#/$defs/format" }, "title": { "type": "string", "maxLength": 200 }, "state": { "$ref": "#/$defs/state" }, "scheduled_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "posted_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "url": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/httpsUrl" }, { "type": "null" }] }, "link_code": { "anyOf": [{ "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{1,39}$" }, { "type": "null" }] }, "external_id": { "anyOf": [{ "type": "string", "maxLength": 80 }, { "type": "null" }] } } }, "putInput": { "title": "PutAcquisitionPostsInput", "description": "PUT /v1/acq/projects/:project/channels/:channel/posts(app-growth acq posts put)。書いた投稿を作るか置き換える。書かなかった投稿は変えない。何度送っても同じ結果になる。チャネルは kind video か social の登録が要る(無ければ 404・ほかの種類は 400)。送った後に、まだ出していない予約が決まり content.posts_per_account_day を超える日があれば 409 policy_denied で、何も書かない", "type": "object", "additionalProperties": false, "required": ["posts"], "properties": { "posts": { "type": "array", "minItems": 1, "maxItems": 500, "items": { "$ref": "#/$defs/putItem" } } } }, "list": { "title": "AcquisitionPostList", "description": "GET /v1/acq/projects/:project/posts(app-growth acq posts list)。?channel=<id>・?state=<状態>で絞る。予約か出した時刻の新しい順に500本まで", "type": "object", "additionalProperties": false, "required": ["posts"], "properties": { "posts": { "type": "array", "maxItems": 500, "items": { "$ref": "#" } } } }, "stockAccount": { "title": "ContentStockAccount", "description": "1つのアカウント(獲得のチャネル)の在庫と予約。stock_days は(在庫+まだ出していない予約)÷ 1日の上限。上限が無ければ null", "type": "object", "additionalProperties": false, "required": ["channel", "name", "kind", "stock", "scheduled", "stock_days", "next_scheduled_at", "last_posted_at", "today", "room_today", "over_limit_days"], "properties": { "channel": { "$ref": "channel.schema.json#/$defs/channelId" }, "name": { "type": "string", "maxLength": 60 }, "kind": { "enum": ["video", "social"] }, "stock": { "description": "予約の無い在庫の本数", "type": "integer", "minimum": 0 }, "scheduled": { "description": "予約が付いていて、まだ出していない本数", "type": "integer", "minimum": 0 }, "stock_days": { "type": ["number", "null"], "minimum": 0 }, "next_scheduled_at": { "description": "次の予約の時刻", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "last_posted_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "today": { "description": "今日(プロジェクトの時刻の帯)に出した本数と、今日に予約がある本数の合計", "type": "integer", "minimum": 0 }, "room_today": { "description": "今日あと何本出せるか(上限 − today)。負は上限を超えた本数。上限が無ければ null", "type": ["integer", "null"] }, "over_limit_days": { "description": "前の7日と先の14日のうち、出した本数と予約の本数の合計が上限を超えた日", "type": "array", "maxItems": 21, "items": { "type": "object", "additionalProperties": false, "required": ["day", "posts"], "properties": { "day": { "$ref": "../common.schema.json#/$defs/day" }, "posts": { "type": "integer", "minimum": 0 } } } } } }, "stock": { "title": "ContentStock", "description": "GET /v1/acq/projects/:project/content(app-growth acq content・MCP の state・console の獲得)。kind video と social の登録したチャネルごとの在庫と予約と、決まり content.posts_per_account_day との差", "type": "object", "additionalProperties": false, "required": ["project", "generated_at", "limit_per_day", "accounts"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "limit_per_day": { "description": "決まり content.posts_per_account_day の値。無ければ null", "type": ["integer", "null"], "minimum": 1 }, "accounts": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/stockAccount" } } } } } },
19
+ "acquisition/report.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/acquisition/report.schema.json", "title": "AcquisitionReport", "description": "GET /v1/acq/projects/:project/report(getAcquisition・app-growth acq report・console の獲得の画面)。登録したチャネルごとの行と、決まらない人の行、週ごとの推移。insights の D1(insights_acq_day・insights_acq_outcome)だけを読み、データレイクを読まない。期間は固まった日で終わる(docs/design/acquisition.md 5.6節)。数の定義は設計 6.1節", "type": "object", "additionalProperties": false, "required": ["project", "project_name", "from", "to", "settled_through", "computed_at", "targets", "channels", "weeks", "unknown_breakdown", "store_campaigns", "robot_clicks", "unmeasured_countries", "empty_reasons"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "project_name": { "description": "製品の画面の名前(R1 の registry_project.name)。読む人に見せるのはこちらで、project の id は見せない", "type": "string", "minLength": 1, "maxLength": 100 }, "from": { "$ref": "../common.schema.json#/$defs/day" }, "to": { "$ref": "../common.schema.json#/$defs/day" }, "settled_through": { "description": "外の数が固まっている最後の日。to より後の日は数えない。外の数が1日も無ければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] }, "computed_at": { "description": "成果(insights_acq_outcome)を最後に出し直した時刻。1回も無ければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "targets": { "$ref": "#/$defs/targets" }, "channels": { "description": "登録したチャネルの行(active と、期間に数がある paused)と、最後に決まらない人の行(unknown)。登録していないチャネルは入れない", "type": "array", "maxItems": 101, "items": { "$ref": "#/$defs/channelRow" } }, "weeks": { "description": "週(月曜から)ごとの紐付いたインストールのチャネルごとの数と費用。古い順", "type": "array", "maxItems": 60, "items": { "title": "AcquisitionWeek", "type": "object", "additionalProperties": false, "required": ["week", "installs", "spend_jpy"], "properties": { "week": { "$ref": "../common.schema.json#/$defs/day" }, "installs": { "description": "チャネルの id → 紐付いたインストール", "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } }, "spend_jpy": { "type": "number", "minimum": 0 } } } }, "unknown_breakdown": { "description": "決まらない人の行の下に出す、ストアの数で見た流入元の内訳(ASC の初回のダウンロードの割合)。人の数でなく合計の割合。ASC の数が無ければ空", "type": "array", "maxItems": 30, "items": { "title": "AcquisitionUnknownShare", "type": "object", "additionalProperties": false, "required": ["source_type", "downloads", "share"], "properties": { "source_type": { "description": "ASC の流入元の種類(app_store_search・app_store_browse・web_referrer・app_referrer・institutional・unavailable)", "type": "string", "pattern": "^[a-z_]{1,40}$" }, "downloads": { "type": "integer", "minimum": 0 }, "share": { "type": "number", "minimum": 0, "maximum": 1 } } } }, "store_campaigns": { "description": "App Store のキャンペーン(URL の ct)ごとの表示・製品ページの閲覧・初回のダウンロード(ASC の Detailed の表の Campaign 列・数の紐付け)と、ct を短いリンクの code として引いたチャネルと iOS のクリック。iOS の短いリンクのクリックとダウンロードを並べて読む(docs/design/acquisition.md 4.2節)。Apple は5未満の行を落とすので、数の無い指標は null(0 と言い切れない)。期間に数のある ct だけで、初回のダウンロードの多い順に90件まで", "type": "array", "maxItems": 90, "items": { "title": "AcquisitionStoreCampaign", "type": "object", "additionalProperties": false, "required": ["code", "channel", "impressions", "page_views", "first_downloads", "ios_clicks"], "properties": { "code": { "description": "ct の値。短いリンクから来た物はリンクの code", "type": "string", "minLength": 1, "maxLength": 64 }, "channel": { "description": "ct と同じ code の短いリンクのチャネル(core の links_link)。短いリンクでない ct は null", "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" }] }, "impressions": { "description": "App Store での表示(Event=Impression)", "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }, "page_views": { "description": "製品ページの閲覧(Event=Page view)", "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }, "first_downloads": { "description": "初回のダウンロード(Download Type=First-time download)", "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }, "ios_clicks": { "description": "同じ期間の、その短いリンクの iOS の人のクリック(links_click の bot の無い行)。短いリンクでない ct は 0", "type": "integer", "minimum": 0 } } } }, "robot_clicks": { "description": "期間に人でないと判じて数から外した短いリンクのクリック(links_click の bot のある行・docs/design/links.md 1.1節)。チャネルの clicks と store_campaigns の ios_clicks は人のクリックだけ", "type": "integer", "minimum": 0 }, "unmeasured_countries": { "description": "計測できない国(設計 4.6節)。その国は人の数の分母から外し、ASC の数だけを出す。判定を作るまで空", "type": "array", "maxItems": 50, "items": { "title": "AcquisitionUnmeasuredCountry", "type": "object", "additionalProperties": false, "required": ["country", "store_downloads", "first_opens"], "properties": { "country": { "type": "string", "pattern": "^[A-Z]{2}$" }, "store_downloads": { "type": "integer", "minimum": 0 }, "first_opens": { "type": "integer", "minimum": 0 } } } }, "empty_reasons": { "description": "表が空か、数が欠けている理由。画面と CLI がそのまま出す。無ければ空", "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/emptyReason" } } }, "$defs": { "emptyReason": { "title": "AcquisitionEmptyReason", "type": "object", "additionalProperties": false, "required": ["code", "channel"], "properties": { "code": { "description": "no_channels はチャネルを1つも登録していない・no_attributions は期間に人の紐付けが1行も無い(端末の紐付けを送るビルドが出ていない)・no_outcome は成果をまだ出していない・no_spend は払うチャネルの費用がまだ取り込まれていない・no_external は外の数がまだ取り込まれていない・few_people は課金した人が少なく課金までの費用が決められない・no_paid はチャネルに課金した人がいない", "enum": ["no_channels", "no_attributions", "no_outcome", "no_spend", "no_external", "few_people", "no_paid"] }, "channel": { "description": "チャネルの id。アプリ全体の理由なら null", "type": ["string", "null"] } } }, "targetValue": { "title": "AcquisitionTargetValue", "type": "object", "additionalProperties": false, "required": ["value", "source"], "properties": { "value": { "description": "円。決められなければ null", "type": ["number", "null"], "minimum": 0 }, "source": { "description": "owner は本人が決めた値(R1 の targets。1日の広告費の上限は決まり acq.daily_budget_cap_jpy)・formula は設計 6.1節の式で出した値・none は数が足りず出せない", "enum": ["owner", "formula", "none"] } } }, "targets": { "title": "AcquisitionTargets", "description": "判断の物差しの値(R1 の targets の acq.*・設計 6.1節)。1日の広告費の上限は事業の決まり acq.daily_budget_cap_jpy で、全アプリの合計で、超えない線(目標ではない)。広告は既定で使わず、検証の人数が足りない時だけブーストに使う", "type": "object", "additionalProperties": false, "required": ["daily_budget_cap_jpy", "max_cac_jpy", "max_activation_cost_jpy", "activation_event"], "properties": { "daily_budget_cap_jpy": { "$ref": "#/$defs/targetValue" }, "max_cac_jpy": { "$ref": "#/$defs/targetValue" }, "max_activation_cost_jpy": { "$ref": "#/$defs/targetValue" }, "activation_event": { "description": "活性化と数える出来事(R1 の acq.activation_event)。無ければ null で、活性化の列は空", "type": ["string", "null"], "pattern": "^[a-z][a-z0-9_]{0,39}$" } } }, "metrics": { "title": "AcquisitionMetrics", "description": "チャネル・キャンペーン・組・語・素材のどの階層でも同じ式の物差し(設計 6.1節)。人の数は利用者(real)だけ。無料のチャネルは費用と費用あたりの数が null。外の数の無いチャネルは外の数の列が null", "type": "object", "additionalProperties": false, "required": ["spend_jpy", "impressions", "clicks", "reported_installs", "attributed_installs", "attribution_rate", "cpi_jpy", "activated", "activation_cost_jpy", "paid", "cac_jpy", "matured_7d", "retained_7d", "revenue_30d_jpy", "roas_30d", "below_floor"], "properties": { "spend_jpy": { "type": ["number", "null"], "minimum": 0 }, "impressions": { "type": ["integer", "null"], "minimum": 0 }, "clicks": { "description": "広告のタップ・Search Console のクリック・短いリンクの人のクリック(links_click の bot の無い行)", "type": ["integer", "null"], "minimum": 0 }, "reported_installs": { "description": "外のサービスが数えたインストール(Apple Ads の tapInstalls・ASC の初回のダウンロード)", "type": ["integer", "null"], "minimum": 0 }, "attributed_installs": { "description": "人の紐付けがここに付いた、期間に初めて開いた人", "type": "integer", "minimum": 0 }, "attribution_rate": { "description": "紐付いたインストール ÷ 報告のインストール(1を上限)", "type": ["number", "null"], "minimum": 0, "maximum": 1 }, "cpi_jpy": { "type": ["number", "null"], "minimum": 0 }, "activated": { "description": "紐付いた人のうち、初めて開いてから7日以内に活性化の出来事があった人。活性化の出来事が無ければ null", "type": ["integer", "null"], "minimum": 0 }, "activation_cost_jpy": { "type": ["number", "null"], "minimum": 0 }, "paid": { "description": "紐付いた人のうち、初めて開いてから30日以内に課金した人(お試しは数えない)", "type": "integer", "minimum": 0 }, "cac_jpy": { "description": "課金までの費用。費用 ÷(課金した人 ÷ 紐付きの率)。率が0.5より低い時は割り戻さない。課金した人が0なら null", "type": ["number", "null"], "minimum": 0 }, "matured_7d": { "description": "7日の窓が閉じた紐付いた人", "type": "integer", "minimum": 0 }, "retained_7d": { "description": "matured_7d のうち7日後に開いた人", "type": "integer", "minimum": 0 }, "revenue_30d_jpy": { "description": "紐付いた人が初めて開いてから30日の手取りの合計(円)", "type": "number", "minimum": 0 }, "roas_30d": { "description": "30日の手取り ÷(費用 × 紐付きの率)。費用が無ければ null", "type": ["number", "null"], "minimum": 0 }, "below_floor": { "description": "判断に使う下限(設計 6.2節)に届かない。画面は色を付けず人数を横に出す", "type": "boolean" } } }, "channelRow": { "title": "AcquisitionChannelRow", "type": "object", "additionalProperties": false, "required": ["channel", "kind", "name", "status", "paid_channel", "metrics"], "properties": { "channel": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,29}$" }, "kind": { "$ref": "channel.schema.json#/$defs/rowKind" }, "name": { "type": "string", "maxLength": 60 }, "status": { "enum": ["active", "paused", "auto"] }, "paid_channel": { "description": "お金を払うチャネル(apple_ads・paid_ads)", "type": "boolean" }, "metrics": { "$ref": "#/$defs/metrics" } } }, "nodeLevel": { "title": "AcquisitionNodeLevel", "description": "ノードの階層。campaign・group・term は4つの階層、creative は素材、query は打たれた語(Apple Ads の検索語・Search Console の語)", "enum": ["campaign", "group", "term", "creative", "query"] }, "nodeList": { "title": "AcquisitionNodeList", "description": "GET /v1/acq/projects/:project/nodes?channel=&level=&from=&to=(listAcquisitionNodes・console の獲得の画面のタブ)。1つのチャネルの1つの階層の行。費用か紐付いたインストールの多い順に200行まで", "type": "object", "additionalProperties": false, "required": ["project", "channel", "level", "from", "to", "settled_through", "rows"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "channel": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,29}$" }, "level": { "$ref": "#/$defs/nodeLevel" }, "from": { "$ref": "../common.schema.json#/$defs/day" }, "to": { "$ref": "../common.schema.json#/$defs/day" }, "settled_through": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] }, "rows": { "type": "array", "maxItems": 200, "items": { "title": "AcquisitionNodeRow", "type": "object", "additionalProperties": false, "required": ["key", "parent", "name", "metrics"], "properties": { "key": { "$ref": "attribution.schema.json#/$defs/key" }, "parent": { "description": "上の階層のキー(組ならキャンペーン、語なら組)。無ければ空の文字", "$ref": "attribution.schema.json#/$defs/key" }, "name": { "description": "ノードの名前(insights_acq_node)。名前を知らなければキー", "type": "string", "maxLength": 300 }, "metrics": { "$ref": "#/$defs/metrics" } } } } } } } },
20
+ "common.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/common.schema.json", "title": "Common", "description": "文脈をまたいで使う値の形。ほかの schema は ../common.schema.json#/$defs/<名前> で指す。title は TypeScript の型の名前になる", "$defs": { "projectId": { "title": "ProjectId", "description": "プロジェクトの id。製品の repo の名前と同じ kebab-case(gamification-app・reading-memory)", "type": "string", "pattern": "^[a-z][a-z0-9-]{1,63}$" }, "reservedProjectId": { "title": "ReservedProjectId", "description": "プロジェクトの id にできない名前。console(console.appgrowstack.com)の組織の画面のパス(/:org/approvals など)とプロジェクトの id(/:org/:project)が同じ階層に並ぶので、ぶつかる名前を予約する(docs/design/console.md 3.1節)。プロジェクトを作るときに断る", "enum": ["approvals", "search", "audit", "settings", "login", "logout", "static", "new", "api", "portfolio", "findings", "hypotheses", "templates", "references", "experiments"] }, "platform": { "title": "Platform", "enum": ["ios", "android"] }, "buildChannel": { "title": "BuildChannel", "description": "ビルドの出どころ。封筒の channel と同じ", "enum": ["appstore", "play", "debug", "testflight", "play_test"] }, "audience": { "title": "Audience", "description": "人の見分け(docs/design/people.md 6節)。real は利用者、owner は本人の端末・アカウント(registry の本人のマーク)、test は debug・testflight・play_test のビルドとテスターのマーク、review は Apple のネットワーク(審査の端末)、robot は Google のネットワーク(Play の公開前テスト・Test Lab)。強さは owner > robot・review > test > real。一度 real でなくなった人は real に戻らない(本人のマークを外したときだけ自動の見分けに戻る)。数は何も指定しなければ real だけを数える", "enum": ["real", "owner", "test", "review", "robot"] }, "audienceCounts": { "title": "AudienceCounts", "description": "見分けごとの人数。数の既定は real だけなので、外した人がどれだけいるかをここで見せる", "type": "object", "additionalProperties": false, "required": ["real", "owner", "test", "review", "robot"], "properties": { "real": { "type": "integer", "minimum": 0 }, "owner": { "type": "integer", "minimum": 0 }, "test": { "type": "integer", "minimum": 0 }, "review": { "type": "integer", "minimum": 0 }, "robot": { "type": "integer", "minimum": 0 } } }, "deviceHash": { "title": "DeviceHash", "description": "端末の id を sha256(公開キー + \":\" + 端末の id) にした小文字の16進64文字。端末の id は iOS がキーチェーン(kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly・同期しない)に置く値で、アプリを消しても・アカウントを作り直しても変わらない。Android は Settings.Secure.ANDROID_ID(同じ署名のキーなら入れ直しても変わらない)。SDK が頭 AppGrowStack-Device で送る", "type": "string", "pattern": "^[0-9a-f]{64}$" }, "propensity": { "title": "Propensity", "description": "R10 の判断の記録。その案(holdout を含む)を選んだ確率。0〜1(docs/design/personalization.md 4.1節)", "type": "number", "minimum": 0, "maximum": 1 }, "policyVersion": { "title": "PolicyVersion", "description": "R10 の判断の記録。選んだ時の配分のバージョン。R4・R9 は組の version(R4 の案のある件は、その配分を作った組の version)、通知は配分を作り直した時刻(ミリ秒・配分がまだ無ければ 0)", "type": "integer", "minimum": 0 }, "epochMs": { "title": "EpochMs", "description": "1970年からのミリ秒", "type": "integer", "minimum": 0 }, "isoTime": { "title": "IsoTime", "description": "時差付きの ISO 8601", "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$" }, "day": { "title": "LocalDay", "description": "その人の時間帯の日付", "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "timeZone": { "title": "TimeZoneId", "description": "IANA の時間帯(Asia/Tokyo)", "type": "string", "minLength": 1, "maxLength": 64 }, "langTag": { "title": "LangTag", "description": "言語の札。封筒の lang と同じ(ja・en・zh-Hans・zh-Hant)", "type": "string", "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$" }, "appVersion": { "title": "AppVersion", "description": "アプリのバージョン。足りない所は0として比べる(3.10 は 3.10.0)", "type": "string", "pattern": "^\\d+\\.\\d+(\\.\\d+)?$" }, "name": { "title": "Name", "description": "値・プレースメント・動き・相手の値・きっかけの名前", "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "accessGrant": { "title": "AccessGrant", "description": "アプリの付与の理由(docs/design/people.md 7節)。アプリがストアの課金でなく自分で渡している有料の機能(3.0.0 より前から使っている人に Premium をずっと無料で渡すなど)を、アプリが決めた短い語で表す(legacy など)。app-growth は語の意味を知らない。課金の状態(SubscriptionState)とは別の軸", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$" }, "eventName": { "title": "EventName", "description": "出来事の名前。<文脈>_<過去形> の snake_case", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" }, "campaignId": { "title": "CampaignId", "description": "画面の中のキャンペーンの件の id。ASCII だけ(holdout の式が文字の符号で数えるため)", "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "installId": { "title": "InstallId", "description": "端末の SDK が最初の起動で作る id(UUID の小文字)。入れ直すと変わる。core は受け入れ(RPC・api から渡った物)で小文字にしてから確かめ・保存する。端末とアプリの Worker は大文字のまま渡してもよいが、比べるのはいつも小文字", "type": "string", "pattern": "^[a-z0-9-]{8,64}$" }, "uid": { "title": "Uid", "description": "アプリのアカウントの id(Firebase の uid・Worker のセッションの uid)", "type": "string", "pattern": "^[A-Za-z0-9._-]{1,128}$" }, "sessionId": { "title": "SessionId", "description": "R8 のセッションの id。端末が起動か、30分を超えて裏にいた後に前へ戻った時に作る(ses_ +20文字)", "type": "string", "pattern": "^ses_[A-Za-z0-9]{20}$" }, "screenName": { "title": "ScreenName", "description": "画面の名前。swift-analytics の screen_viewed の screen の値。名前の無い間は unknown", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,47}$" }, "fraction10k": { "title": "Fraction10k", "description": "0〜1 の割合を 0〜10000 の整数にした物(座標・スクロールの深さ)", "type": "integer", "minimum": 0, "maximum": 10000 }, "personId": { "title": "PersonId", "description": "人の id。最初に見た install_id。install より先に uid だけが届いた人と、同じ install で2つ目のアカウントだけは uid:<uid>(docs/contracts.md の人の id)", "type": "string", "pattern": "^(uid:[A-Za-z0-9._-]{1,128}|[a-z0-9-]{8,64})$" }, "actor": { "title": "Actor", "description": "誰の出来事か。端末から来た物は install_id を必ず持つ。サーバーだけで起きた物(RevenueCat)は uid だけでよい", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "install_id": { "$ref": "#/$defs/installId" }, "uid": { "$ref": "#/$defs/uid" } } }, "typedValue": { "title": "TypedValue", "description": "出来事の中身・相手の値・動きの引数の1つの値。型を落とさずに渡す(数を文字列にしない)。整数の形(小数点も指数も無い)は int、それ以外の数は double。比べるときは int と double を同じ数として比べる", "type": ["string", "integer", "number", "boolean"], "maxLength": 200 }, "typedProps": { "title": "TypedProps", "description": "出来事の中身。値が無い物は書かない(null を使わない)", "type": "object", "propertyNames": { "$ref": "#/$defs/name" }, "maxProperties": 40, "additionalProperties": { "$ref": "#/$defs/typedValue" } }, "publicKey": { "title": "PublicKey", "description": "公開キー。アプリに入る(秘密でない)", "type": "string", "pattern": "^pk_[A-Za-z0-9]{24}$" }, "serverKey": { "title": "ServerKey", "description": "サーバーキー。作ったときに1回だけ見せ、表には sha256 だけを置く", "type": "string", "pattern": "^sk_[A-Za-z0-9]{40}$" }, "setKeyId": { "title": "SetKeyId", "description": "組に署名したキーの id。端末はアプリに入れた公開キー(2つまで)からこの id の物で確かめる", "type": "string", "pattern": "^[a-z0-9-]{1,40}$" }, "setSignature": { "title": "SetSignature", "description": "組の Ed25519 の署名(標準の base64・88文字)。署名するのは、組から最上位の signature と key_id を除き、キーを UTF-16 の順に並べ、空白なしにした JSON(文字は JSON.stringify と同じ書き方・数は JavaScript の書き方)の UTF-8(docs/design/remote-screens.md 10.2節・例は schema/cases/signing/)", "type": "string", "pattern": "^[A-Za-z0-9+/]{86}==$" }, "httpsUrl": { "title": "HttpsUrl", "type": "string", "pattern": "^https://[^\\s]+$", "maxLength": 2048 }, "problem": { "title": "Problem", "type": "object", "additionalProperties": false, "required": ["path", "message"], "properties": { "path": { "description": "JSON Pointer", "type": "string" }, "message": { "type": "string" }, "campaign": { "type": "string" } } }, "capabilityNeed": { "title": "CapabilityNeed", "description": "まだどのマニフェストも全部は持っていない requires の組と、出す OS。platforms のどれかで requires を全部持つマニフェストが届けばそろう(docs/design/access.md 5.7節)", "type": "object", "additionalProperties": false, "required": ["requires", "platforms"], "properties": { "requires": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 80 }, "maxItems": 50, "uniqueItems": true }, "platforms": { "type": "array", "items": { "$ref": "#/$defs/platform" }, "uniqueItems": true } } }, "errorBody": { "title": "ErrorBody", "description": "HTTP の API が 4xx・5xx で返す本文。code は機械が読む(unknown_key・invalid・not_found・conflict・rate_limited・unauthorized・forbidden・internal)。管理の道(core)の主体と権限(docs/access-control.md): token_required(401・core のトークンが無い。Access のサービストークンだけ)・token_expired(401)・scope_missing(403・役割かトークンの scope に操作が無い)・step_up_required(403・本人の確認が要る)・approval_expired(409・承認の依頼が24時間を過ぎた・前提が変わった)。R11 リリース(docs/design/releases.md): not_released(409・公開していないバージョンの報告)・manifest_locked(409・固定したマニフェストと違う本文)・unknown_app_version(400・core の知らないバージョン)・hypothesis_required(400・効き目を問う種類の変更に仮説も問わない理由も無い)。R12 ストアの素材(docs/design/creatives.md): capture_mismatch(409・撮影の組のファイルが R2 の物と合わない)・budget_stop(409・AI の予算で生成を止めている)・test_running(409・同じアプリの PPO が動いている)・underpowered(409・PPO で見分けられる差が足りない)・waiting_version(409・準備中のバージョンが無い)・fetch_failed(422・参考の素材の URL を読めない。ログインが要るページを含む)・reference_mismatch(409・参考の素材のファイルが sha256 と合わない・R2 に無い)・browser_unavailable(501・Web のページを撮る Browser Run のキーが無い)。R13 分析(docs/design/insights.md 9節): sql_refused(400・SQL が1つの SELECT でない・day の条件が無い・400日を超える・person_key を返す)・scan_limit(429・1回か1日のスキャンの上限を超えた。次の日まで断る)。R11 の requires を使う送信(お知らせ・件・R9 の組): capability_missing(409・requires を全部持つマニフェストがまだ無いことだけが理由で送れない。needs に待つ機能。承認した依頼の実行がこれで断られると、依頼は failed でなく awaiting になる)", "type": "object", "additionalProperties": false, "required": ["error"], "properties": { "error": { "type": "object", "additionalProperties": false, "required": ["code", "message"], "properties": { "code": { "enum": ["unknown_key", "invalid", "not_found", "conflict", "rate_limited", "unauthorized", "forbidden", "internal", "token_required", "token_expired", "scope_missing", "step_up_required", "approval_expired", "not_released", "manifest_locked", "unknown_app_version", "capture_mismatch", "budget_stop", "test_running", "underpowered", "waiting_version", "fetch_failed", "reference_mismatch", "browser_unavailable", "sql_refused", "scan_limit", "not_release_day", "policy_denied", "hypothesis_required", "capability_missing"] }, "message": { "type": "string" }, "problems": { "type": "array", "items": { "$ref": "#/$defs/problem" }, "maxItems": 20 }, "needs": { "description": "code が capability_missing の時だけ。まだどのマニフェストも持っていない機能の組", "type": "array", "items": { "$ref": "#/$defs/capabilityNeed" }, "maxItems": 50 } } } } } } },
21
+ "config/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/config/admin.schema.json", "title": "ConfigPushRequest", "description": "POST /v1/config/projects/:project/sets の本文。全部のパラメーターと実験を新しいバージョンの組として送る(送らなかったキーと実験は組から消える。docs/design/experimentation.md 8節)", "type": "object", "additionalProperties": false, "required": ["flags", "experiments", "manifest", "published_by"], "properties": { "flags": { "type": "object", "maxProperties": 200, "propertyNames": { "$ref": "../experiment/experiment.schema.json#/$defs/paramKey" }, "additionalProperties": { "$ref": "set.schema.json#/$defs/flag" } }, "experiments": { "description": "アプリの repo の experiments/<id>.json", "type": "array", "maxItems": 50, "items": { "$ref": "../experiment/experiment.schema.json" } }, "manifest": { "description": "アプリの config/manifest.json。必ず付ける。core はこれで知らない key・型の違い・ペイウォールとオンボーディングの型・文言と色の確かめ・実験とレイヤーの決まりを落とす(付けないと確かめを全部抜けられた。docs/security.md 4.15節)", "$ref": "manifest.schema.json" }, "published_by": { "description": "送った物(commit の sha か、人が読む印)", "type": "string", "minLength": 1, "maxLength": 200 } }, "$defs": { "pushResponse": { "title": "ConfigPushResponse", "type": "object", "additionalProperties": false, "required": ["version", "sha256", "published_at"], "properties": { "version": { "type": "integer", "minimum": 0 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "published_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "setHistory": { "title": "ConfigSetHistory", "type": "object", "additionalProperties": false, "required": ["sets"], "properties": { "sets": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["version", "sha256", "published_at", "published_by", "flags", "experiments"], "properties": { "version": { "type": "integer", "minimum": 1 }, "sha256": { "type": "string" }, "published_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "published_by": { "type": "string" }, "flags": { "description": "組の key", "type": "array", "items": { "type": "string" } }, "experiments": { "description": "組の実験の id", "type": "array", "items": { "type": "string" } } } } } } } } },
22
+ "config/case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/config/case.schema.json", "title": "ConfigCase", "description": "schema/cases/config/*.json の1つ。1回の起動で組を読み、reads の順に値を読んだときの答え。TypeScript(packages/campaign-rules の ConfigSession)・Swift・Kotlin が同じ答えを返す", "type": "object", "additionalProperties": false, "required": ["description", "facts", "person_id", "assignment", "internal", "now", "reads", "expect"], "properties": { "description": { "type": "string" }, "set": { "description": "取れた組。set_raw と片方だけ", "type": "object" }, "set_raw": { "description": "JSON として読めない組の文字列", "type": "string" }, "stored_set": { "description": "set が使えないときに使う、手元に保存した組(無ければ全部がアプリの既定)", "$ref": "set.schema.json" }, "facts": { "description": "端末の値(SDK の値とアプリが渡す値)", "$ref": "../common.schema.json#/$defs/typedProps" }, "person_id": { "type": "string", "minLength": 1, "description": "R2 の person_id。製品全体の holdout に使う" }, "assignment": { "$ref": "../experiment/variant.schema.json#/$defs/assignment" }, "segments": { "description": "端末が保存した自分の群れの id。無ければどの群れにも入っていない", "type": "array", "items": { "$ref": "../segments/segment.schema.json#/$defs/segmentId" } }, "internal": { "description": "本人の端末", "type": "boolean" }, "now": { "$ref": "../common.schema.json#/$defs/isoTime" }, "reads": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["key", "type", "fallback"], "properties": { "key": { "type": "string" }, "type": { "$ref": "set.schema.json#/$defs/flagType" }, "fallback": { "description": "アプリの既定の値", "$ref": "set.schema.json#/$defs/value" }, "expose": { "description": "読んだ後に expose(key) を呼ぶ(その値を見せた)", "type": "boolean" } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["values", "records"], "properties": { "values": { "description": "reads と同じ順の答え", "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["key", "value", "source", "variant"], "properties": { "key": { "type": "string" }, "value": { "$ref": "set.schema.json#/$defs/value" }, "source": { "$ref": "#/$defs/source" }, "variant": { "description": "source が experiment のときの案の名前。ほかは null", "type": ["string", "null"] } } } }, "records": { "description": "アプリの計測に渡した出来事(順は問わない)", "type": "array", "items": { "$ref": "events.schema.json" } } } } }, "$defs": { "source": { "title": "ConfigValueSource", "description": "値をどこから取ったか(docs/design/experimentation.md 2.1節の順)。global_holdout は組の global_holdout が true で製品全体の holdout の人の、実験の最初の案の値。fallback_lang は text の値にその言語が無く、アプリの既定の値を使った", "enum": ["fallback", "fallback_lang", "rule", "experiment", "global_holdout", "default"] } } },
23
+ "config/check-case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/config/check-case.schema.json", "title": "ConfigCheckCase", "description": "schema/cases/check/config/*.json の1つ。マニフェストとパラメーターと実験を渡したときに app-growth config check と core の push が出す誤りと警告(check の id)。packages/campaign-rules の paramProblems が同じ表を通す(docs/design/experimentation.md 6節)", "type": "object", "additionalProperties": false, "required": ["description", "manifest", "flags", "expect"], "properties": { "description": { "type": "string", "minLength": 1 }, "manifest": { "$ref": "manifest.schema.json" }, "flags": { "type": "object", "additionalProperties": { "$ref": "set.schema.json#/$defs/flag" }, "propertyNames": { "$ref": "../experiment/experiment.schema.json#/$defs/paramKey" } }, "experiments": { "description": "repo の experiments/ の実験(形の合わない物も確かめるので形は見ない)。書かなければ無い", "type": "array", "items": { "type": "object" } }, "expect": { "type": "object", "additionalProperties": false, "required": ["errors"], "properties": { "errors": { "description": "出る誤りの check の id(順は問わない・重なりは1つ)", "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^(paywall|onboarding|template|release|param|text|color|experiment|layer)\\.[a-z_]+$" } }, "warnings": { "description": "出る警告の check の id(書かなければ見ない)", "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^(paywall|onboarding|template|release|param|text|color|experiment|layer)\\.[a-z_]+$" } } } } } },
24
+ "config/events.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/config/events.schema.json", "title": "ConfigEvent", "description": "R9 と中核の SDK が作ってアプリの計測に渡す出来事(共通のカタログに入れる)。SDK は送らない(送るのはアプリの計測)", "oneOf": [{ "$ref": "#/$defs/exposed" }, { "$ref": "#/$defs/rejected" }], "$defs": { "exposed": { "title": "ExperimentExposedEvent", "description": "実験で変わる物を利用者に見せた(docs/design/experimentation.md 4節)。起動ごと・実験ごとに最初の1回。読むだけでは送らない。製品全体の holdout の人・規則に当たった人・言語の無い人(fallback_lang)は送らない。案ごとの数はこの人たちで数える", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "experiment_exposed" }, "params": { "type": "object", "additionalProperties": false, "required": ["experiment", "variant", "layer", "key", "set_version", "propensity", "policy_version", "assignment_source", "surface"], "properties": { "experiment": { "$ref": "../experiment/experiment.schema.json#/$defs/id" }, "variant": { "$ref": "../common.schema.json#/$defs/name" }, "layer": { "$ref": "../experiment/experiment.schema.json#/$defs/layer" }, "key": { "description": "見せたパラメーターのキー(同じ実験の中で最初に見せた物)", "$ref": "../experiment/experiment.schema.json#/$defs/paramKey" }, "set_version": { "type": "integer", "minimum": 0 }, "propensity": { "$ref": "../common.schema.json#/$defs/propensity" }, "policy_version": { "$ref": "../common.schema.json#/$defs/policyVersion" }, "assignment_source": { "$ref": "../experiment/variant.schema.json#/$defs/assignmentSource" }, "surface": { "$ref": "#/$defs/surface" } } } } }, "rejectReason": { "title": "ConfigRejectReason", "description": "config_rejected の理由。parse_error と schema_too_new は組(_set)だけ。invalid はフラグの形か値の型が schema に合わない", "enum": ["parse_error", "schema_too_new", "invalid", "type_mismatch"] }, "rejected": { "title": "ConfigRejectedEvent", "description": "組か key を使えなかった。key・理由・組のバージョンごとに1回", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "config_rejected" }, "params": { "type": "object", "additionalProperties": false, "required": ["key", "reason", "set_version"], "properties": { "key": { "description": "組全体は _set", "type": "string" }, "reason": { "$ref": "#/$defs/rejectReason" }, "set_version": { "description": "読めない組は 0", "type": "integer", "minimum": 0 } } } } }, "surface": { "title": "ExposureSurface", "description": "どこで見せたか。param はネイティブの文言・色・型のパラメーター(expose)、screen はリモート画面、price は値段の段階を出したペイウォール", "enum": ["param", "screen", "price"] } } },
25
+ "config/manifest.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/config/manifest.schema.json", "title": "ConfigManifest", "description": "アプリの repo の config/manifest.json。アプリが知っている key と型、規則に使う端末の値、リモート画面のプレースメントとバンドルが呼べる物。app-growth config check・campaigns check と core の push がこれを読む", "type": "object", "additionalProperties": false, "required": ["project", "flags", "facts"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "flags": { "type": "object", "propertyNames": { "$ref": "../experiment/experiment.schema.json#/$defs/paramKey" }, "additionalProperties": { "$ref": "#/$defs/flag" }, "description": "アプリが知っているパラメーター(キーと型)。text と color は文言と色の確かめ(docs/design/experimentation.md 6節)の値も書く" }, "facts": { "description": "アプリが端末の値として渡す物。規則の条件と、リモート画面の context() の facts に使う。SDK の値(platform・app_version・build・channel・lang・region・days_since_first_seen)は書かない", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/fact" } }, "paywall": { "title": "ConfigManifestPaywall", "description": "型 paywall のフラグと、リモート画面の <Feature>・<PlanList> が使う物。アプリが持つ RevenueCat の Offering と商品、コードで有料にしている機能", "type": "object", "additionalProperties": false, "required": ["offerings", "features"], "properties": { "offerings": { "type": "object", "minProperties": 1, "additionalProperties": { "type": "object", "additionalProperties": false, "required": ["products"], "properties": { "products": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 100 } }, "packages": { "description": "RevenueCat の Offering の中の package の id($rc_annual など)。リモート画面の <PlanList order> とブリッジの purchase(packageId) はこの物だけ", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 100 } } } } }, "features": { "type": "array", "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } } } }, "onboarding": { "title": "ConfigManifestOnboarding", "description": "型 onboarding のフラグが使う物。アプリが登録した枚の名前", "type": "object", "additionalProperties": false, "required": ["pages"], "properties": { "pages": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } } } }, "placements": { "description": "リモート画面のプレースメント(アプリが「ここで出せる」と register で撃つ合図。docs/design/remote-screens.md 3.1節)。名前 → 出せる画面の kind と渡す本人の値", "type": "object", "maxProperties": 50, "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/placement" } }, "actions": { "description": "リモート画面がブリッジの action(name, args) で呼べる、アプリが登録した動き", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/action" } }, "url_hosts": { "description": "リモート画面がブリッジの openURL で開けるホスト", "type": "array", "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z0-9.-]{1,253}$" } }, "reviews": { "description": "リモート画面の <Review id> が指せるレビュー。本当にあった物だけ。文はアプリが持つ", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/review" } } }, "$defs": { "flag": { "title": "ConfigManifestFlag", "type": "object", "additionalProperties": false, "required": ["type", "description"], "properties": { "type": { "$ref": "set.schema.json#/$defs/flagType" }, "description": { "description": "何に使う値か(人が読む)", "type": "string", "minLength": 1, "maxLength": 200 }, "since": { "$ref": "../inapp/manifest.schema.json#/$defs/since" }, "template": { "description": "型(paywall・onboarding)。書けば値の形と型の check を当てる", "$ref": "template.schema.json#/$defs/templateName" }, "max_length": { "description": "text の各言語の文字数(書記素の数)の上限。書かなければ40", "type": "integer", "minimum": 1, "maximum": 2000 }, "langs": { "description": "text でアプリが出している言語(BCP 47)。実験の案に無い言語は警告", "type": "array", "uniqueItems": true, "maxItems": 40, "items": { "type": "string", "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$" } }, "placeholders": { "description": "text の文にアプリが値を入れる所の名前({price} の price)。既定の値と全部の案の全部の言語が、この名前を1回ずつ持つ。値を入れるのはアプリ", "type": "array", "uniqueItems": true, "maxItems": 5, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "allows": { "description": "text で、審査で問題になりやすい語のうち、このキーだけ許す語の組(schema/config/review-words.json の id)。お試しのある商品を出すペイウォールのキーの free など", "type": "array", "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "role": { "description": "color の使い方。text は文字の色(背景とのコントラスト比4.5以上)、fill は塗り(3以上)", "enum": ["text", "fill"] }, "on": { "description": "color を重ねる背景。#RRGGBB か、color のパラメーターのキー。role と組で書く", "type": "string", "minLength": 1, "maxLength": 200 } }, "dependentRequired": { "role": ["on"], "on": ["role"] } }, "fact": { "title": "ConfigManifestFact", "type": "object", "additionalProperties": false, "required": ["type"], "properties": { "type": { "enum": ["string", "int", "double", "bool"] }, "kind": { "description": "deadline は本当の終わりの時刻(type は string・時差付きの ISO 8601)。リモート画面で時刻と共に変わる文字はこの値からだけ作れる", "enum": ["deadline"] } } }, "placement": { "title": "ConfigManifestPlacement", "type": "object", "additionalProperties": false, "required": ["kinds", "facts"], "properties": { "kinds": { "description": "出せる画面の kind", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "../screens/screen.schema.json#/$defs/kind" } }, "facts": { "description": "アプリが register で渡す本人の値(facts の名前)", "type": "array", "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "inline": { "description": "カードと帯(画面の中に置く RemoteScreenSlot)。書かなければ false", "type": "boolean" }, "height": { "description": "inline の高さの範囲(pt・dp)。バンドルが ready で返した高さをこの範囲に収める。inline の時は必ず書く", "type": "object", "additionalProperties": false, "required": ["min", "max"], "properties": { "min": { "type": "integer", "minimum": 0, "maximum": 2000 }, "max": { "type": "integer", "minimum": 1, "maximum": 2000 } } }, "description": { "description": "どこにあるプレースメントか(人が読む)", "type": "string", "minLength": 1, "maxLength": 200 } }, "if": { "type": "object", "required": ["inline"], "properties": { "inline": { "const": true } } }, "then": { "required": ["height"] } }, "action": { "title": "ConfigManifestAction", "type": "object", "additionalProperties": false, "required": ["description", "args"], "properties": { "description": { "description": "何をする動きか", "type": "string", "minLength": 1, "maxLength": 200 }, "args": { "$ref": "../inapp/manifest.schema.json#/$defs/actionArgs" } } }, "review": { "title": "ConfigManifestReview", "type": "object", "additionalProperties": false, "required": ["store", "date"], "properties": { "store": { "enum": ["app_store", "google_play"] }, "date": { "$ref": "../common.schema.json#/$defs/day" } } } } },
26
+ "config/review-words.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/config/review-words.schema.json", "title": "ReviewWords", "description": "審査で問題になりやすい語(中身は config/review-words.json)。config check と core の push が、text のパラメーターの全部の言語の文に当て、当たれば誤り(docs/design/experimentation.md 6節)。マニフェストの allows に id を書いたキーだけ許す。英字は大文字と小文字を区別しない", "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "title": "ReviewWordRule", "type": "object", "additionalProperties": false, "required": ["id", "label", "ref", "words", "patterns"], "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9_]{1,40}$" }, "label": { "description": "誤りの文に出す名前", "type": "string", "minLength": 1 }, "ref": { "description": "決まりの元", "type": "string", "minLength": 1 }, "words": { "description": "文に含まれたら誤りの語(そのままの部分一致)", "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }, "patterns": { "description": "語で書けない物の正規表現(ECMAScript・フラグ i で当てる)", "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } } } } } } },
27
+ "config/set.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/config/set.schema.json", "title": "ConfigSet", "description": "R9 の組。端末が GET /v1/config/sets/:key で読む JSON。プロジェクトの全員に同じで、規則の当たり外れと実験の割り当ては端末が決める(docs/design/experimentation.md)。version は0から(まだ何も送っていないプロジェクトは version 0 の空の組)", "type": "object", "additionalProperties": false, "required": ["schema_version", "project", "version", "published_at", "flags"], "properties": { "schema_version": { "type": "integer", "const": 1 }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "version": { "type": "integer", "minimum": 0 }, "published_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "global_holdout": { "description": "R10 の製品全体の holdout(experiment/holdout.schema.json の global。レイヤー global の [0, 50))を当てる。当たった人は実験に入れず最初の案の値にし、experiment_exposed を送らない。書かなければ false(docs/design/experimentation.md 3.3節)", "type": "boolean", "default": false }, "flags": { "type": "object", "maxProperties": 200, "propertyNames": { "$ref": "../experiment/experiment.schema.json#/$defs/paramKey" }, "additionalProperties": { "$ref": "#/$defs/flag" } }, "experiments": { "description": "実験(docs/design/experimentation.md 3節)。組の並びで見て、キーを変える実験のうち最初に当たった物の案の値を使う", "type": "array", "maxItems": 50, "items": { "$ref": "../experiment/experiment.schema.json#/$defs/served" } }, "key_id": { "description": "署名したキーの id。core に署名のキーが無い時(手元・staging の試し)は無い", "$ref": "../common.schema.json#/$defs/setKeyId" }, "signature": { "description": "core が付ける。本文の最後の項目", "$ref": "../common.schema.json#/$defs/setSignature" } }, "$defs": { "flagType": { "title": "ConfigFlagType", "description": "パラメーターの型。int は整数の形(小数点も指数も無い)だけ、double はそれ以外の数も。json はオブジェクトか配列。text は言語ごとの文(BCP 47 の言語 → 文)。color は #RRGGBB・#RRGGBBAA か、明るい時と暗い時の組", "enum": ["bool", "int", "double", "string", "json", "text", "color"] }, "value": { "title": "ConfigValue", "description": "パラメーターの値。型はパラメーターの type に合わせる(schema の oneOf が確かめる)", "type": ["boolean", "number", "string", "object", "array"] }, "rule": { "title": "ConfigRule", "description": "端末の値の条件と、当たったときの値。上から最初に当たった規則の値を使う。条件は R4 の端末の値の条件と同じ形と演算子(使える値は SDK の値とマニフェストの facts。app_version は書けない)。when か requires の片方は書く。requires か exclude_app_versions を書いた規則は、core が解決した app_version の範囲のバージョンにだけ当たる(docs/design/releases.md 6節)", "type": "object", "additionalProperties": false, "required": ["value"], "anyOf": [{ "required": ["when"] }, { "required": ["requires"] }], "properties": { "when": { "$ref": "../inapp/campaign.schema.json#/$defs/factCondition" }, "requires": { "description": "中身の条件。flag:<このフラグの key> は core が足す", "$ref": "../releases/manifest.schema.json#/$defs/requires" }, "exclude_app_versions": { "$ref": "../releases/manifest.schema.json#/$defs/excludeAppVersions" }, "app_version": { "description": "core が requires と exclude_app_versions から解決して書く。送る本文には書かない。書いていない OS には当たらない", "$ref": "../releases/manifest.schema.json#/$defs/resolvedAppVersion" }, "value": { "$ref": "#/$defs/value" } } }, "boolFlag": { "title": "ConfigBoolFlag", "type": "object", "additionalProperties": false, "required": ["type", "default"], "properties": { "type": { "const": "bool" }, "default": { "type": "boolean" }, "rules": { "type": "array", "maxItems": 30, "items": { "allOf": [{ "$ref": "#/$defs/rule" }, { "type": "object", "properties": { "value": { "type": "boolean" } } }] } } } }, "intFlag": { "title": "ConfigIntFlag", "type": "object", "additionalProperties": false, "required": ["type", "default"], "properties": { "type": { "const": "int" }, "default": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "rules": { "type": "array", "maxItems": 30, "items": { "allOf": [{ "$ref": "#/$defs/rule" }, { "type": "object", "properties": { "value": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } } }] } } } }, "doubleFlag": { "title": "ConfigDoubleFlag", "type": "object", "additionalProperties": false, "required": ["type", "default"], "properties": { "type": { "const": "double" }, "default": { "type": "number" }, "rules": { "type": "array", "maxItems": 30, "items": { "allOf": [{ "$ref": "#/$defs/rule" }, { "type": "object", "properties": { "value": { "type": "number" } } }] } } } }, "stringFlag": { "title": "ConfigStringFlag", "type": "object", "additionalProperties": false, "required": ["type", "default"], "properties": { "type": { "const": "string" }, "default": { "type": "string", "maxLength": 2000 }, "rules": { "type": "array", "maxItems": 30, "items": { "allOf": [{ "$ref": "#/$defs/rule" }, { "type": "object", "properties": { "value": { "type": "string", "maxLength": 2000 } } }] } } } }, "jsonFlag": { "title": "ConfigJsonFlag", "type": "object", "additionalProperties": false, "required": ["type", "default"], "properties": { "type": { "const": "json" }, "default": { "type": ["object", "array"] }, "rules": { "type": "array", "maxItems": 30, "items": { "allOf": [{ "$ref": "#/$defs/rule" }, { "type": "object", "properties": { "value": { "type": ["object", "array"] } } }] } } } }, "textValue": { "title": "ConfigTextValue", "description": "言語ごとの文。言語は BCP 47(ja・en・zh-Hant)。端末の lang と同じ言語 → lang の頭の部分の順に選び、無ければアプリの既定の文", "type": "object", "minProperties": 1, "maxProperties": 40, "propertyNames": { "type": "string", "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$" }, "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 2000 } }, "colorValue": { "title": "ConfigColorValue", "description": "色。#RRGGBB か #RRGGBBAA、または明るい時と暗い時の組", "anyOf": [{ "$ref": "#/$defs/hex" }, { "type": "object", "additionalProperties": false, "required": ["light", "dark"], "properties": { "light": { "$ref": "#/$defs/hex" }, "dark": { "$ref": "#/$defs/hex" } } }] }, "hex": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$" }, "textFlag": { "title": "ConfigTextFlag", "type": "object", "additionalProperties": false, "required": ["type", "default"], "properties": { "type": { "const": "text" }, "default": { "$ref": "#/$defs/textValue" }, "rules": { "type": "array", "maxItems": 30, "items": { "allOf": [{ "$ref": "#/$defs/rule" }, { "type": "object", "properties": { "value": { "$ref": "#/$defs/textValue" } } }] } } } }, "colorFlag": { "title": "ConfigColorFlag", "type": "object", "additionalProperties": false, "required": ["type", "default"], "properties": { "type": { "const": "color" }, "default": { "$ref": "#/$defs/colorValue" }, "rules": { "type": "array", "maxItems": 30, "items": { "allOf": [{ "$ref": "#/$defs/rule" }, { "type": "object", "properties": { "value": { "$ref": "#/$defs/colorValue" } } }] } } } }, "flag": { "title": "ConfigFlag", "description": "パラメーター(型の付いた1つの値)。アプリはキーと型と既定の値を渡して読む", "oneOf": [{ "$ref": "#/$defs/boolFlag" }, { "$ref": "#/$defs/intFlag" }, { "$ref": "#/$defs/doubleFlag" }, { "$ref": "#/$defs/stringFlag" }, { "$ref": "#/$defs/jsonFlag" }, { "$ref": "#/$defs/textFlag" }, { "$ref": "#/$defs/colorFlag" }] } } },
28
+ "config/template.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/config/template.schema.json", "title": "ConfigTemplate", "description": "R9 の型(paywall・onboarding)のテンプレート。値の形・型ごとの check・例のフラグを持つ。型はマニフェストの flags.<key>.template に書き、型のフラグは json。見た目(書体・請求額の行・規約のリンク)はアプリの画面が持ち、値は文と並びだけ", "type": "object", "additionalProperties": false, "required": ["template", "title", "purpose", "checks", "example"], "properties": { "template": { "$ref": "#/$defs/templateName" }, "title": { "type": "string", "minLength": 1 }, "purpose": { "type": "string", "minLength": 1 }, "checks": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "level", "rule", "why"], "properties": { "id": { "type": "string", "pattern": "^(paywall|onboarding|template)\\.[a-z_]+$" }, "level": { "enum": ["error", "warning"] }, "rule": { "type": "string" }, "why": { "type": "string" } } } }, "example": { "description": "そのまま schema を通る例のフラグ(型は json)", "$ref": "set.schema.json#/$defs/flag" } }, "$defs": { "templateName": { "title": "ConfigTemplateName", "enum": ["paywall", "onboarding"] }, "text": { "title": "ConfigLocalizedText", "description": "言語ごとの文。言語の札 → 文。選び方は R4 の文と同じ(端末の言語そのまま → 言語の頭 → アプリの表)", "type": "object", "minProperties": 1, "propertyNames": { "$ref": "../common.schema.json#/$defs/langTag" }, "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 120 } }, "paywallValue": { "title": "ConfigPaywallValue", "description": "型 paywall の値。アプリのペイウォールの画面が読む文と並びだけ。購入は RevenueCat と StoreKit のまま", "type": "object", "additionalProperties": false, "required": ["offering", "plans_order", "default_plan", "headline", "bullets", "show_at", "hard"], "properties": { "offering": { "description": "RevenueCat の Offering の id。マニフェストの paywall.offerings に書いた物だけ", "type": "string", "minLength": 1, "maxLength": 100 }, "plans_order": { "description": "出すプランの並び(商品の id)。その Offering の商品だけ", "type": "array", "minItems": 1, "maxItems": 4, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 100 } }, "default_plan": { "description": "最初に選んである商品。plans_order の中の物", "type": "string", "minLength": 1, "maxLength": 100 }, "headline": { "$ref": "#/$defs/text" }, "subhead": { "$ref": "#/$defs/text" }, "bullets": { "description": "得られる物の並び。マニフェストの paywall.features(コードで有料にしている機能)の名前だけ。文はアプリの表", "type": "array", "maxItems": 4, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "show_at": { "description": "どこで出すペイウォールの値か", "enum": ["onboarding_end", "locked_feature", "settings"] }, "hard": { "description": "閉じる×を出さない。onboarding_end だけ", "type": "boolean" } } }, "onboardingValue": { "title": "ConfigOnboardingValue", "description": "型 onboarding の値。枚の順・飛ばせる枚・最後にペイウォールを出すか", "type": "object", "additionalProperties": false, "required": ["pages", "skippable", "paywall_at_end"], "properties": { "pages": { "description": "枚の並び。マニフェストの onboarding.pages(アプリが登録した枚)の名前だけ", "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "skippable": { "description": "飛ばせる枚。pages の中の物", "type": "array", "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "paywall_at_end": { "type": "boolean" } } } } },
29
+ "creative/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/admin.schema.json", "title": "CaptureSetList", "description": "GET /v1/creatives/projects/:project/captures(listCaptureSets)の答え。新しい順。?platform=&version=", "type": "object", "additionalProperties": false, "required": ["project", "sets"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "sets": { "type": "array", "maxItems": 100, "items": { "$ref": "capture.schema.json" } } }, "$defs": { "assetUploadRequest": { "title": "CreateCreativeAssetUploadRequest", "description": "POST /v1/creatives/projects/:project/assets(createAssetUpload)の本文。フォント・端末の枠・イラスト・画面の動画の素材。video/mp4 は art の screen_video だけ", "type": "object", "additionalProperties": false, "required": ["kind", "name", "sha256", "content_type"], "properties": { "kind": { "enum": ["font", "frame", "art"] }, "name": { "description": "R2 のキーの最後の部分(ファイルの名前)", "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$" }, "sha256": { "$ref": "capture.schema.json#/$defs/sha256" }, "content_type": { "enum": ["font/woff2", "image/png", "image/jpeg", "image/webp", "video/mp4"] }, "meta": { "description": "kind が font なら fontAssetMeta、frame なら frameAssetMeta の形。art は role がある時 artAssetMeta の形(role の無い art は自由)", "type": "object", "additionalProperties": {} } } }, "fontAssetMeta": { "title": "CreativeFontAssetMeta", "description": "フォントの素材の meta。R2 のキーは fonts/<family の小文字とハイフン>/<name>", "type": "object", "additionalProperties": false, "required": ["family", "weight"], "properties": { "family": { "description": "デザイントークンの fonts の値と同じ名前(Noto Sans JP など)", "type": "string", "minLength": 1, "maxLength": 80 }, "weight": { "description": "@font-face の font-weight。可変フォントは「100 900」", "type": "string", "pattern": "^[1-9]00( [1-9]00)?$" }, "style": { "enum": ["normal", "italic"] } } }, "frameAssetMeta": { "title": "CreativeFrameAssetMeta", "description": "端末の枠の素材の meta。R2 のキーは frames/<device>/<color>.png。screen は枠の PNG の中の画面の穴(px)で、CLI が透明の所を測って入れる", "type": "object", "additionalProperties": false, "required": ["device", "color", "screen"], "properties": { "device": { "$ref": "capture.schema.json#/$defs/deviceId" }, "color": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$" }, "screen": { "type": "object", "additionalProperties": false, "required": ["x", "y", "width", "height", "radius"], "properties": { "x": { "type": "integer", "minimum": 0, "maximum": 8192 }, "y": { "type": "integer", "minimum": 0, "maximum": 8192 }, "width": { "type": "integer", "minimum": 1, "maximum": 8192 }, "height": { "type": "integer", "minimum": 1, "maximum": 8192 }, "radius": { "type": "integer", "minimum": 0, "maximum": 2000 } } } } }, "artAssetMeta": { "title": "CreativeArtAssetMeta", "description": "生成したイラストと画面の動画の素材の meta。R2 のキーは art/<project>/<name>。width・height・transparent は CLI が PNG と JPEG から、width・height・duration_ms は mp4 から測る。role が screen_video の時だけ video/mp4 で、poster と duration_ms が要る", "type": "object", "additionalProperties": false, "required": ["role"], "properties": { "role": { "$ref": "#/$defs/artRole" }, "uses": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/artUse" } }, "reference": { "description": "真似る元(Duolingo のペイウォールの上の帯 など)", "type": "string", "minLength": 1, "maxLength": 200 }, "method": { "description": "作り方(gemini-app など)", "type": "string", "minLength": 1, "maxLength": 80 }, "prompt": { "description": "送った指示文", "type": "string", "minLength": 1, "maxLength": 4000 }, "style": { "description": "スタイルの決まりの文書の場所", "type": "string", "minLength": 1, "maxLength": 200 }, "poster": { "description": "動画の最初のコマの画像。同じ製品の画像の art の id", "type": "string", "pattern": "^ca_[A-Za-z0-9]{16}$" }, "duration_ms": { "description": "動画の長さ(ミリ秒)", "type": "integer", "minimum": 1 }, "transparent": { "type": "boolean" }, "width": { "type": "integer", "minimum": 1, "maximum": 16384 }, "height": { "type": "integer", "minimum": 1, "maximum": 16384 }, "tags": { "type": "array", "maxItems": 30, "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$" } } } }, "artRole": { "title": "CreativeArtRole", "description": "イラストの種類。screen_art はマーケの画面のイラスト、reward_item はごほうびの品、store_background はストアのスクショの背景と飾り、social_frame は SNS の短い動画の1コマ目、celebration は達成の演出のイラスト、screen_video は画面の型の動画(mp4・H.264・音なし・ループ)", "enum": ["screen_art", "character", "reward_item", "background", "icon", "store_background", "social_frame", "celebration", "screen_video"] }, "artUse": { "title": "CreativeArtUse", "description": "イラストの用途。notification は通知とお知らせの画像", "enum": ["paywall", "onboarding", "offer", "celebration", "store_screenshot", "store_header", "social", "in_app", "notification"] }, "assetItem": { "title": "CreativeAssetItem", "description": "listAssets の1行。R2 のキーごとに新しい行だけ(R2 のキーは新しい中身だけを持つ)", "type": "object", "additionalProperties": false, "required": ["id", "kind", "name", "content_type", "sha256", "meta", "created_at", "created_by"], "properties": { "id": { "$ref": "brand.schema.json#/$defs/assetId" }, "kind": { "enum": ["font", "frame", "art"] }, "name": { "type": "string", "maxLength": 100 }, "content_type": { "enum": ["font/woff2", "image/png", "image/jpeg", "image/webp", "video/mp4"] }, "sha256": { "$ref": "capture.schema.json#/$defs/sha256" }, "meta": { "description": "kind が font なら fontAssetMeta、frame なら frameAssetMeta の形。art は role がある時 artAssetMeta の形(role の無い art は自由)", "type": "object", "additionalProperties": {} }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "type": ["string", "null"], "maxLength": 80 } } }, "assetList": { "title": "CreativeAssetList", "description": "GET /v1/creatives/projects/:project/assets(listAssets)の答え。種類 → 名前の順", "type": "object", "additionalProperties": false, "required": ["project", "assets"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "assets": { "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/assetItem" } } } }, "assetUploadResult": { "title": "CreativeAssetUpload", "description": "createAssetUpload の答え(201)。同じ sha256 の素材が既にあれば upload は null", "type": "object", "additionalProperties": false, "required": ["asset", "upload"], "properties": { "asset": { "$ref": "brand.schema.json#/$defs/assetId" }, "upload": { "anyOf": [{ "$ref": "capture.schema.json#/$defs/fileTransfer" }, { "type": "null" }] } } }, "pageList": { "title": "CreativePageList", "description": "GET /v1/creatives/projects/:project/pages(listPages)の答え", "type": "object", "additionalProperties": false, "required": ["project", "pages"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "pages": { "type": "array", "maxItems": 200, "items": { "$ref": "page.schema.json" } } } }, "textList": { "title": "StoreTextList", "description": "GET …/texts(listStoreTexts・?platform=&page=&locale=&field=&status=)と GET …/texts/:platform/:page/:locale/:field(getStoreTextHistory・新しい順)の答え", "type": "object", "additionalProperties": false, "required": ["project", "texts"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "texts": { "type": "array", "maxItems": 2000, "items": { "$ref": "text.schema.json" } } } }, "variantList": { "title": "CreativeVariantList", "description": "GET /v1/creatives/projects/:project/variants(listVariants)の答え。?platform=&page=&surface=&status=。変える所の一覧(changes)も入れる", "type": "object", "additionalProperties": false, "required": ["project", "variants"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "variants": { "type": "array", "maxItems": 500, "items": { "$ref": "variant.schema.json" } } } }, "submitRequest": { "title": "SubmitCreativesRequest", "description": "POST /v1/creatives/projects/:project/submissions(submitCreatives)の本文。CPP・イベント・素材・PPO の treatment を1つの reviewSubmission にまとめて審査に出す。バージョンは app-release ship submit が出す", "type": "object", "additionalProperties": false, "required": ["platform", "items"], "properties": { "platform": { "const": "ios" }, "items": { "type": "array", "minItems": 1, "maxItems": 50, "items": { "type": "object", "additionalProperties": false, "required": ["kind", "id"], "properties": { "kind": { "enum": ["cpp", "app_event", "asset", "ppo_treatment"] }, "id": { "description": "cpp と ppo_treatment はページのキー、app_event はイベントの id、asset は素材の id", "type": "string", "minLength": 1, "maxLength": 120 } } } } } }, "submitResult": { "title": "SubmitCreativesResult", "description": "submitCreatives の答え", "type": "object", "additionalProperties": false, "required": ["submission_id", "submitted_at", "items"], "properties": { "submission_id": { "description": "App Store Connect の reviewSubmissions の id", "type": "string", "maxLength": 120 }, "submitted_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "items": { "type": "array", "maxItems": 50, "items": { "type": "object", "additionalProperties": false, "required": ["kind", "id", "status"], "properties": { "kind": { "enum": ["cpp", "app_event", "asset", "ppo_treatment"] }, "id": { "type": "string", "maxLength": 120 }, "status": { "enum": ["submitted", "skipped", "failed"] }, "error": { "type": ["string", "null"], "maxLength": 2000 } } } } } }, "testList": { "title": "CreativeTestList", "description": "GET /v1/creatives/projects/:project/tests(listTests)の答え。?status=", "type": "object", "additionalProperties": false, "required": ["project", "tests"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "tests": { "type": "array", "maxItems": 200, "items": { "$ref": "test.schema.json" } } } }, "metricList": { "title": "CreativeMetricList", "description": "GET /v1/creatives/projects/:project/metrics(listCreativeMetrics)の答え。?page=&variant=&since=&country=&source=。insights が読む", "type": "object", "additionalProperties": false, "required": ["project", "days"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "days": { "type": "array", "maxItems": 20000, "items": { "$ref": "metrics.schema.json" } } } }, "keywordList": { "title": "CreativeKeywordList", "description": "GET /v1/creatives/projects/:project/keywords(listKeywords)の答え。?country=&week=", "type": "object", "additionalProperties": false, "required": ["project", "keywords"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "keywords": { "type": "array", "maxItems": 5000, "items": { "$ref": "metrics.schema.json#/$defs/keyword" } } } }, "keywordSyncResult": { "title": "CreativeKeywordSyncResult", "description": "POST /v1/creatives/projects/:project/keywords/sync(syncKeywords)の答え。週に1回の取り込みをすぐ回す", "type": "object", "additionalProperties": false, "required": ["project", "week", "terms"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "week": { "$ref": "../common.schema.json#/$defs/day" }, "terms": { "description": "読んだ語の数", "type": "integer", "minimum": 0 } } }, "stepList": { "title": "CreativeStepList", "description": "GET /v1/creatives/projects/:project/steps(listSteps)の答え。?status=waiting。手元の Claude Code が app-growth creatives steps list で読む", "type": "object", "additionalProperties": false, "required": ["project", "steps"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "steps": { "type": "array", "maxItems": 200, "items": { "$ref": "metrics.schema.json#/$defs/step" } } } }, "runList": { "title": "CreativeRunList", "description": "GET /v1/creatives/runs(listCreativeRuns)の答え。?limit=1(1〜20)。新しい順", "type": "object", "additionalProperties": false, "required": ["runs"], "properties": { "runs": { "type": "array", "maxItems": 20, "items": { "$ref": "metrics.schema.json#/$defs/run" } } } } } },
30
+ "creative/archive.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/archive.schema.json", "title": "CreativeArchive", "description": "素材のアーカイブ(creative_archive と creative_archive_file の行)。アプリの repo から外した画像・動画を、元のパスのまま R2 に置いた物。書き換えない。GET …/archives/:archive(getArchive)と completeArchive の答え", "type": "object", "additionalProperties": false, "required": ["id", "project", "name", "note", "status", "file_count", "bytes", "created_at", "created_by", "files"], "properties": { "id": { "$ref": "#/$defs/archiveId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "name": { "$ref": "#/$defs/archiveName" }, "note": { "type": ["string", "null"], "maxLength": 1000 }, "status": { "$ref": "#/$defs/archiveStatus" }, "file_count": { "type": "integer", "minimum": 1 }, "bytes": { "description": "ファイルの大きさの合計。同じ中身が R2 に1回だけでも、ファイルごとに数える", "type": "integer", "minimum": 0 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "type": "string", "maxLength": 80 }, "files": { "type": "array", "minItems": 1, "maxItems": 3000, "items": { "$ref": "#/$defs/archiveFile" } } }, "$defs": { "archiveId": { "title": "CreativeArchiveId", "type": "string", "pattern": "^ar_[A-Za-z0-9]{16}$" }, "archiveName": { "description": "アーカイブの名前(gamification-app の git から外した物 など)。同じ名前を2回使ってよい", "type": "string", "minLength": 1, "maxLength": 120 }, "archiveStatus": { "title": "CreativeArchiveStatus", "description": "uploading はファイルを上げている間。ready は全部の中身が R2 にある", "enum": ["uploading", "ready"] }, "archivePath": { "description": "アーカイブの中の相対パス(元の repo のパス)。/ で始めない。.. を含まない", "type": "string", "minLength": 1, "maxLength": 300, "pattern": "^[^/\\u0000][^\\u0000]*$" }, "archiveFile": { "title": "CreativeArchiveFile", "type": "object", "additionalProperties": false, "required": ["path", "sha256", "bytes", "content_type"], "properties": { "path": { "$ref": "#/$defs/archivePath" }, "sha256": { "$ref": "capture.schema.json#/$defs/sha256" }, "bytes": { "type": "integer", "minimum": 0, "maximum": 94371840 }, "content_type": { "description": "拡張子から決めた形式。分からなければ application/octet-stream", "type": "string", "pattern": "^[a-z]+/[a-z0-9.+-]+$", "maxLength": 100 } } }, "createArchiveRequest": { "title": "CreateCreativeArchiveRequest", "description": "POST /v1/creatives/projects/:project/archives(createArchive)の本文。app-growth creatives archives push が送る", "type": "object", "additionalProperties": false, "required": ["name", "files"], "properties": { "name": { "$ref": "#/$defs/archiveName" }, "note": { "type": "string", "minLength": 1, "maxLength": 1000 }, "files": { "type": "array", "minItems": 1, "maxItems": 3000, "items": { "$ref": "#/$defs/archiveFile" } } } }, "createArchiveResult": { "title": "CreateCreativeArchiveResult", "description": "createArchive の答え(201)。uploads は R2 にまだ無い中身だけ(同じ sha256 は1つ)。CLI は1つずつ PUT(putArchiveFile)し、最後に completeArchive を呼ぶ。reused は前の組かアーカイブと同じ中身で上げずに済んだファイルの数", "type": "object", "additionalProperties": false, "required": ["archive", "uploads", "reused"], "properties": { "archive": { "$ref": "#/$defs/archiveId" }, "uploads": { "type": "array", "maxItems": 3000, "items": { "type": "object", "additionalProperties": false, "required": ["sha256", "upload"], "properties": { "sha256": { "$ref": "capture.schema.json#/$defs/sha256" }, "upload": { "$ref": "capture.schema.json#/$defs/fileTransfer" } } } }, "reused": { "type": "integer", "minimum": 0 } } }, "archiveSummary": { "title": "CreativeArchiveSummary", "description": "一覧の1件。files を持たない", "type": "object", "additionalProperties": false, "required": ["id", "project", "name", "note", "status", "file_count", "bytes", "created_at", "created_by"], "properties": { "id": { "$ref": "#/$defs/archiveId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "name": { "$ref": "#/$defs/archiveName" }, "note": { "type": ["string", "null"], "maxLength": 1000 }, "status": { "$ref": "#/$defs/archiveStatus" }, "file_count": { "type": "integer", "minimum": 1 }, "bytes": { "type": "integer", "minimum": 0 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "type": "string", "maxLength": 80 } } }, "archiveList": { "title": "CreativeArchiveList", "description": "GET /v1/creatives/projects/:project/archives(listArchives)の答え。新しい順に100件", "type": "object", "additionalProperties": false, "required": ["project", "archives"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "archives": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/archiveSummary" } } } } } },
31
+ "creative/brand.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/brand.schema.json", "title": "CreativeBrand", "description": "製品ごとのデザイントークンと声の決まり(creative_brand の1行)。本人が書き、app-growth creatives brand push で送る。AI は変えない。GET・PUT /v1/creatives/projects/:project/brand の答え", "type": "object", "additionalProperties": false, "required": ["project", "rev", "body", "sha256", "pushed_at", "pushed_by"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "rev": { "description": "送るたびに1つ上がる", "type": "integer", "minimum": 1 }, "body": { "$ref": "#/$defs/brandBody" }, "sha256": { "$ref": "capture.schema.json#/$defs/sha256" }, "pushed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "pushed_by": { "type": "string", "maxLength": 80 } }, "$defs": { "color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$" }, "brandColors": { "title": "CreativeBrandColors", "description": "地・字・強調・弱い字の色", "type": "object", "additionalProperties": false, "required": ["background", "foreground", "accent"], "properties": { "background": { "$ref": "#/$defs/color" }, "foreground": { "$ref": "#/$defs/color" }, "accent": { "$ref": "#/$defs/color" }, "muted": { "$ref": "#/$defs/color" } } }, "assetId": { "title": "CreativeAssetId", "description": "creative_asset の id(フォント・端末の枠・背景)", "type": "string", "pattern": "^ca_[A-Za-z0-9]{16}$" }, "benefitKey": { "title": "CreativeBenefitKey", "description": "見出しが訴えてよい利点のキー(reward・quit_habit など)", "type": "string", "pattern": "^[a-z][a-z0-9_]{1,39}$" }, "brandTokens": { "title": "CreativeBrandTokens", "description": "見た目。テンプレートは CSS の変数でこの値を受ける。colors はタグの visual.background が light の案、dark_colors は dark の案に使う(無ければ dark の案は作れない)", "type": "object", "additionalProperties": false, "required": ["colors", "fonts", "type_scale", "spacing", "radius", "device_frame", "background_asset"], "properties": { "colors": { "$ref": "#/$defs/brandColors" }, "dark_colors": { "$ref": "#/$defs/brandColors" }, "fonts": { "description": "言語の札 → フォントの family。無い言語は design の 5.3節の既定", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/langTag" }, "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 80 }, "maxProperties": 60 }, "type_scale": { "description": "見出しと小見出しの文字の大きさの上限と下限(px・描画の寸法の上で)", "type": "object", "additionalProperties": false, "required": ["headline_max", "headline_min", "sub_max", "sub_min"], "properties": { "headline_max": { "type": "integer", "minimum": 8, "maximum": 400 }, "headline_min": { "type": "integer", "minimum": 8, "maximum": 400 }, "sub_max": { "type": "integer", "minimum": 8, "maximum": 400 }, "sub_min": { "type": "integer", "minimum": 8, "maximum": 400 } } }, "spacing": { "description": "余白の単位(px)", "type": "integer", "minimum": 0, "maximum": 400 }, "radius": { "description": "角丸(px)", "type": "integer", "minimum": 0, "maximum": 400 }, "device_frame": { "description": "端末の枠を使うか", "type": "boolean" }, "frame_color": { "description": "端末の枠の色。R2 の frames/<device>/<色>.png を使う。無ければ black", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$" }, "background_asset": { "anyOf": [{ "$ref": "#/$defs/assetId" }, { "type": "null" }] } } }, "brandVoice": { "title": "CreativeBrandVoice", "description": "声の決まり", "type": "object", "additionalProperties": false, "required": ["tone", "banned_words", "glossary"], "properties": { "tone": { "description": "調子", "type": "string", "maxLength": 1000 }, "banned_words": { "description": "言語の札 → 使わない語", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/langTag" }, "additionalProperties": { "type": "array", "maxItems": 200, "items": { "type": "string", "minLength": 1, "maxLength": 80 } } }, "glossary": { "description": "アプリの中の語と、その日常の言い方", "type": "array", "maxItems": 200, "items": { "type": "object", "additionalProperties": false, "required": ["term", "everyday"], "properties": { "term": { "type": "string", "minLength": 1, "maxLength": 80 }, "everyday": { "type": "string", "minLength": 1, "maxLength": 200 } } } } } }, "brandFact": { "title": "CreativeBrandFact", "description": "言ってよい事実。数字を含む主張はここにある物だけを使える。無い数字は確認の claim で落とす", "type": "object", "additionalProperties": false, "required": ["id", "text"], "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9_]{1,39}$" }, "text": { "type": "string", "minLength": 1, "maxLength": 500 } } }, "brandBenefit": { "title": "CreativeBrandBenefit", "type": "object", "additionalProperties": false, "required": ["key", "description"], "properties": { "key": { "$ref": "#/$defs/benefitKey" }, "description": { "type": "string", "minLength": 1, "maxLength": 500 } } }, "keywordPolicy": { "title": "CreativeKeywordPolicy", "description": "キーワードの方針", "type": "object", "additionalProperties": false, "required": ["intents", "excluded", "competitors"], "properties": { "intents": { "description": "狙う意図", "type": "array", "maxItems": 50, "items": { "type": "string", "minLength": 1, "maxLength": 200 } }, "excluded": { "description": "入れない語", "type": "array", "maxItems": 200, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }, "competitors": { "description": "競合の名前", "type": "array", "maxItems": 100, "items": { "type": "string", "minLength": 1, "maxLength": 80 } } } }, "brandBody": { "title": "CreativeBrandBody", "description": "PUT /v1/creatives/projects/:project/brand(putBrand)の本文。送るたびに rev が上がる", "type": "object", "additionalProperties": false, "required": ["tokens", "voice", "facts", "benefits", "outcome_event", "keyword_policy"], "properties": { "tokens": { "$ref": "#/$defs/brandTokens" }, "voice": { "$ref": "#/$defs/brandVoice" }, "facts": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/brandFact" } }, "benefits": { "type": "array", "minItems": 1, "maxItems": 50, "items": { "$ref": "#/$defs/brandBenefit" } }, "outcome_event": { "description": "その製品で使い始めたとみなす出来事(ごほうび習慣は habit_achieved など)", "$ref": "../common.schema.json#/$defs/eventName" }, "keyword_policy": { "$ref": "#/$defs/keywordPolicy" } } } } },
32
+ "creative/capture.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/capture.schema.json", "title": "CaptureSet", "description": "撮影の組(creative_capture_set と creative_capture の行)。purpose が capture は撮った画面と録画、store は手元で作ってストアに出した画像(source_set の撮影の組から作った)。書き換えない。同じバージョンを撮り直したら新しい組にする。POST …/captures/:set/complete(completeCaptureSet)と一覧の答え", "type": "object", "additionalProperties": false, "required": ["id", "project", "platform", "version", "build", "commit_sha", "captured_at", "purpose", "source_set", "note", "status", "items", "created_at", "created_by"], "properties": { "id": { "$ref": "#/$defs/captureSetId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "$ref": "#/$defs/buildNumber" }, "commit_sha": { "$ref": "#/$defs/commitSha" }, "captured_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "purpose": { "$ref": "#/$defs/capturePurpose" }, "source_set": { "description": "store の組が元にした撮影の組。capture の組は null", "anyOf": [{ "$ref": "#/$defs/captureSetId" }, { "type": "null" }] }, "note": { "description": "組のメモ(何に使ったか。例: 3.3.0 の審査に出した既定のページ)", "type": ["string", "null"], "maxLength": 500 }, "status": { "$ref": "#/$defs/captureSetStatus" }, "items": { "type": "array", "minItems": 1, "maxItems": 2000, "items": { "$ref": "#/$defs/captureItem" } }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "description": "組を作った主体の id", "type": "string", "maxLength": 80 } }, "$defs": { "captureSetId": { "title": "CaptureSetId", "type": "string", "pattern": "^cs_[A-Za-z0-9]{16}$" }, "buildNumber": { "description": "ストアのビルド番号。Google Play は versionCode", "type": "string", "pattern": "^[0-9][0-9.]{0,19}$" }, "commitSha": { "type": "string", "pattern": "^[0-9a-f]{7,40}$" }, "sha256": { "title": "Sha256Hex", "type": "string", "pattern": "^[0-9a-f]{64}$" }, "screenId": { "title": "CreativeScreenId", "description": "画面の id。アプリの repo の store/screens.json か画面カタログの場面の名前。製品の中で意味を変えない。store の組は枚の名前(iphone-01 など)", "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,47}$" }, "screenState": { "description": "画面の状態の id(light・dark・empty・filled など)。store の組はストアのページの key(default・cpp-futari など)", "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,47}$" }, "deviceId": { "title": "CreativeDevice", "description": "撮った端末と描画する端末の id。寸法は packages/contract の creativeSurfaces", "enum": ["iphone_69", "iphone_67", "iphone_63", "ipad_13", "android_phone", "android_tablet_7", "android_tablet_10", "android_tv"] }, "captureKind": { "title": "CaptureKind", "description": "image は撮った画面、video は録画の場面", "enum": ["image", "video"] }, "capturePurpose": { "title": "CapturePurpose", "description": "capture は撮った画面と録画(画面カタログ・app-release shots)。store は手元で作ってストアに出した画像", "enum": ["capture", "store"] }, "captureSetStatus": { "title": "CaptureSetStatus", "description": "uploading はファイルを上げている間。ready は sha256 と寸法が R2 の物と合った。failed は合わないファイルがあった", "enum": ["uploading", "ready", "failed"] }, "captureFile": { "title": "CaptureFile", "description": "組の中の1つのファイルを指す物", "type": "object", "additionalProperties": false, "required": ["locale", "device", "screen", "kind"], "properties": { "locale": { "$ref": "../common.schema.json#/$defs/langTag" }, "device": { "$ref": "#/$defs/deviceId" }, "screen": { "$ref": "#/$defs/screenId" }, "kind": { "$ref": "#/$defs/captureKind" } } }, "captureItem": { "title": "CaptureItem", "description": "creative_capture の1行。duration_ms は video だけ。同じ sha256 の中身は R2 に1回だけ置く", "type": "object", "additionalProperties": false, "required": ["locale", "device", "screen", "kind", "state", "width", "height", "duration_ms", "sha256", "source"], "properties": { "locale": { "$ref": "../common.schema.json#/$defs/langTag" }, "device": { "$ref": "#/$defs/deviceId" }, "screen": { "$ref": "#/$defs/screenId" }, "kind": { "$ref": "#/$defs/captureKind" }, "state": { "$ref": "#/$defs/screenState" }, "width": { "type": "integer", "minimum": 1, "maximum": 8192 }, "height": { "type": "integer", "minimum": 1, "maximum": 8192 }, "duration_ms": { "type": ["integer", "null"], "minimum": 0, "maximum": 600000 }, "sha256": { "$ref": "#/$defs/sha256" }, "source": { "description": "store の組の枚が元にした画面の id(source_set の組の screen)。capture の組と分からない時は null", "anyOf": [{ "$ref": "#/$defs/screenId" }, { "type": "null" }] } } }, "createCaptureSetRequest": { "title": "CreateCaptureSetRequest", "description": "POST /v1/creatives/projects/:project/captures(createCaptureSet)の本文。app-growth creatives captures push が送る", "type": "object", "additionalProperties": false, "required": ["platform", "version", "build", "commit_sha", "captured_at", "items"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "$ref": "#/$defs/buildNumber" }, "commit_sha": { "$ref": "#/$defs/commitSha" }, "captured_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "purpose": { "$ref": "#/$defs/capturePurpose" }, "source_set": { "$ref": "#/$defs/captureSetId" }, "note": { "type": "string", "minLength": 1, "maxLength": 500 }, "items": { "type": "array", "minItems": 1, "maxItems": 2000, "items": { "$ref": "#/$defs/captureItem" } } } }, "fileTransfer": { "title": "CreativeFileTransfer", "description": "core を通してファイルを送る・受けるパス。署名付きの URL は使わない。core が Service Binding で creative に渡し、creative が R2 の binding で読み書きする(ADR 0028)", "type": "object", "additionalProperties": false, "required": ["method", "path"], "properties": { "method": { "enum": ["PUT", "GET"] }, "path": { "description": "core のパス(/v1/creatives/ の下)。呼ぶときは core の URL を頭に付け、管理の API と同じ認証を付ける", "type": "string", "pattern": "^/v1/creatives/[A-Za-z0-9/_.:-]+$", "maxLength": 300 } } }, "captureManifest": { "title": "CaptureManifest", "description": "撮影の出力のフォルダの capture.json。app-release shots が撮り終えた時に書き、app-growth creatives captures push <project> <dir> が読む。purpose を省くと capture。store の組は source_set と枚ごとの source を書く。file はこのファイルのあるフォルダからの相対パス(.. を含まない)。寸法・長さ・sha256 は書かない。CLI がファイルから読む", "type": "object", "additionalProperties": false, "required": ["project", "platform", "version", "build", "commit_sha", "captured_at", "items"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "$ref": "#/$defs/buildNumber" }, "commit_sha": { "$ref": "#/$defs/commitSha" }, "captured_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "purpose": { "$ref": "#/$defs/capturePurpose" }, "source_set": { "$ref": "#/$defs/captureSetId" }, "note": { "type": "string", "minLength": 1, "maxLength": 500 }, "items": { "type": "array", "minItems": 1, "maxItems": 2000, "items": { "type": "object", "additionalProperties": false, "required": ["file", "locale", "device", "screen", "kind", "state"], "properties": { "file": { "description": "image は .png、video は .mp4", "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}\\.(png|mp4)$" }, "locale": { "$ref": "../common.schema.json#/$defs/langTag" }, "device": { "$ref": "#/$defs/deviceId" }, "screen": { "$ref": "#/$defs/screenId" }, "kind": { "$ref": "#/$defs/captureKind" }, "state": { "$ref": "#/$defs/screenState" }, "source": { "$ref": "#/$defs/screenId" } } } } } }, "createCaptureSetResult": { "title": "CreateCaptureSetResult", "description": "createCaptureSet の答え(201)。uploads は R2 にまだ無い中身だけ(同じ sha256 は1つ)。CLI は1つずつ PUT(putCaptureFile)し、最後に completeCaptureSet を呼ぶ。reused は前の組と同じ中身で上げずに済んだファイルの数", "type": "object", "additionalProperties": false, "required": ["set", "uploads", "reused"], "properties": { "set": { "$ref": "#/$defs/captureSetId" }, "uploads": { "type": "array", "maxItems": 2000, "items": { "type": "object", "additionalProperties": false, "required": ["file", "upload"], "properties": { "file": { "$ref": "#/$defs/captureFile" }, "upload": { "$ref": "#/$defs/fileTransfer" } } } }, "reused": { "type": "integer", "minimum": 0 } } } } },
33
+ "creative/changes.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/changes.schema.json", "title": "CreativeChangeList", "description": "変える所の一覧。1つの案の中身で、今の掲載(own_store の参考の素材)から、何枚目の何を・なぜ・どの仮説で変えるかを文で書く。画像は持たない。作り込みとアップロードは手元で行う(docs/design/creatives.md 6節・ADR 0035)", "type": "object", "additionalProperties": false, "required": ["surface", "page", "hypothesis", "baseline", "summary", "changes", "keep"], "properties": { "surface": { "$ref": "#/$defs/surface" }, "page": { "$ref": "page.schema.json#/$defs/pageKey" }, "hypothesis": { "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, "baseline": { "description": "基準にした今の掲載。国ごとに1件。プログラムが入れる", "type": "array", "minItems": 1, "maxItems": 40, "items": { "$ref": "#/$defs/baseline" } }, "summary": { "description": "この案で何を確かめるか。訴求・仮説・検証の目的に沿って2〜3文", "type": "string", "minLength": 1, "maxLength": 1000 }, "changes": { "type": "array", "minItems": 1, "maxItems": 40, "items": { "$ref": "#/$defs/change" } }, "keep": { "description": "変えない所と、残す工夫(1枚目の作り・国ごとの言い方・避けると決めた物)。無ければ null", "type": ["string", "null"], "maxLength": 2000 } }, "$defs": { "surface": { "title": "CreativeSurface", "description": "面。寸法・枚数・形式は packages/contract の creativeSurfaces", "enum": ["screenshots", "app_preview", "header", "search", "event_card", "event_detail", "play_phone", "feature_graphic"] }, "part": { "title": "CreativeChangePart", "description": "変える物。headline 見出し・sub 小見出し・screen 置く画面・visual 絵や飾り・layout 置き方・order 並び・other ほか", "enum": ["headline", "sub", "screen", "visual", "layout", "order", "other"] }, "baseline": { "title": "CreativeChangeBaseline", "type": "object", "additionalProperties": false, "required": ["reference", "country", "captured_on"], "properties": { "reference": { "$ref": "reference.schema.json#/$defs/referenceId" }, "country": { "anyOf": [{ "$ref": "metrics.schema.json#/$defs/country" }, { "type": "null" }] }, "captured_on": { "$ref": "../common.schema.json#/$defs/day" } } }, "change": { "title": "CreativeChange", "description": "変える所の1つ", "type": "object", "additionalProperties": false, "required": ["countries", "slot", "part", "before", "after", "why"], "properties": { "countries": { "description": "変える国。空なら基準の全部の国", "type": "array", "maxItems": 40, "uniqueItems": true, "items": { "$ref": "metrics.schema.json#/$defs/country" } }, "slot": { "description": "何枚目か(1〜10)", "type": "integer", "minimum": 1, "maximum": 10 }, "part": { "$ref": "#/$defs/part" }, "before": { "description": "今の掲載の中身。足すだけの時は空", "type": "string", "maxLength": 500 }, "after": { "description": "変えた後の中身", "type": "string", "minLength": 1, "maxLength": 500 }, "why": { "description": "なぜ変えるか。仮説のどの見込みを、この変更でどう確かめるか", "type": "string", "minLength": 1, "maxLength": 1000 } } }, "draft": { "title": "CreativeChangeDraft", "description": "人か手元の Claude Code が書いた一覧(generateVariant の本文の changes)。基準と仮説はプログラムが入れる", "type": "object", "additionalProperties": false, "required": ["summary", "changes"], "properties": { "summary": { "$ref": "#/properties/summary" }, "changes": { "$ref": "#/properties/changes" }, "keep": { "$ref": "#/properties/keep" } } } } },
34
+ "creative/metrics.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/metrics.schema.json", "title": "CreativeMetricDay", "description": "creative_metric_day の1行。ページ × 案 × 国 × 流入元 × 日 × 取り込みの元の数。元に無い数は null(0 でなく分からない物。モデルに入れない)", "type": "object", "additionalProperties": false, "required": ["project", "platform", "page", "variant", "country", "source", "day", "origin", "impressions", "page_views", "taps", "installs", "redownloads", "activations", "trials", "purchases"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "page": { "$ref": "page.schema.json#/$defs/pageKey" }, "variant": { "description": "その日にそのページで配信していた案。分からなければ null", "anyOf": [{ "$ref": "variant.schema.json#/$defs/variantId" }, { "type": "null" }] }, "country": { "$ref": "#/$defs/country" }, "source": { "description": "流入元(search・browse・apple_ads・web_referrer・app_referrer など。ストアの区分そのまま)", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$" }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "origin": { "$ref": "#/$defs/origin" }, "impressions": { "$ref": "#/$defs/count" }, "page_views": { "$ref": "#/$defs/count" }, "taps": { "$ref": "#/$defs/count" }, "installs": { "$ref": "#/$defs/count" }, "redownloads": { "$ref": "#/$defs/count" }, "activations": { "description": "製品の成果の出来事", "$ref": "#/$defs/count" }, "trials": { "$ref": "#/$defs/count" }, "purchases": { "$ref": "#/$defs/count" } }, "$defs": { "count": { "type": ["integer", "null"], "minimum": 0 }, "country": { "title": "CountryCode", "description": "ISO 3166-1 alpha-2", "type": "string", "pattern": "^[A-Z]{2}$" }, "origin": { "title": "CreativeMetricOrigin", "description": "apple_ads は Apple Ads Platform API の広告ごとの報告・asc_analytics は App Store Connect の分析の報告・play_csv は Google Play の store_performance・appgrowstack は core の流入元", "enum": ["apple_ads", "asc_analytics", "play_csv", "appgrowstack"] }, "tagEffect": { "title": "CreativeTagEffect", "description": "creative_effect の1行。scope は all(全部の製品)・project・country", "type": "object", "additionalProperties": false, "required": ["tag", "value", "scope", "scope_key", "mean", "sd", "n"], "properties": { "tag": { "type": "string", "pattern": "^[a-z][a-z0-9_.]{0,39}$" }, "value": { "type": "string", "maxLength": 48 }, "scope": { "enum": ["all", "project", "country"] }, "scope_key": { "type": ["string", "null"], "maxLength": 64 }, "mean": { "type": "number" }, "sd": { "type": "number", "minimum": 0 }, "n": { "type": "integer", "minimum": 0 } } }, "snapshot": { "title": "TagEffectSnapshot", "description": "GET /v1/creatives/effects(getTagEffects)の答え。週に1回 fitTagEffects が解いた1つのスナップショット", "type": "object", "additionalProperties": false, "required": ["id", "computed_at", "model_version", "summary", "effects"], "properties": { "id": { "$ref": "#/$defs/snapshotId" }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "model_version": { "type": "string", "maxLength": 40 }, "summary": { "type": "object", "additionalProperties": {} }, "effects": { "type": "array", "maxItems": 5000, "items": { "$ref": "#/$defs/tagEffect" } } } }, "snapshotId": { "type": "string", "pattern": "^ce_[A-Za-z0-9]{16}$" }, "keyword": { "title": "CreativeKeyword", "description": "creative_keyword の1行。国とジャンルごとに週に1回読む", "type": "object", "additionalProperties": false, "required": ["project", "country", "term", "week", "popularity", "rank", "source"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "country": { "$ref": "#/$defs/country" }, "term": { "type": "string", "minLength": 1, "maxLength": 100 }, "week": { "description": "週の始まりの月曜(UTC)", "$ref": "../common.schema.json#/$defs/day" }, "popularity": { "type": ["integer", "null"], "minimum": 0, "maximum": 100 }, "rank": { "type": ["integer", "null"], "minimum": 1 }, "source": { "enum": ["apple_ads", "apptweak"] } } }, "stepKind": { "title": "CreativeStepKind", "description": "API の無い操作(docs/design/creatives.md 10.3節)", "enum": ["play_listing_experiment", "play_listing_experiment_result", "play_custom_listing", "play_promo", "youtube_video", "ppo_result"] }, "step": { "title": "CreativeStep", "description": "creative_step の1行。手で行う手順。body は開くページの URL・入れる値・使うファイルの core のパス・最後のボタンの名前", "type": "object", "additionalProperties": false, "required": ["id", "project", "kind", "body", "status", "result", "created_at", "done_at", "done_by"], "properties": { "id": { "$ref": "#/$defs/stepId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "kind": { "$ref": "#/$defs/stepKind" }, "body": { "type": "object", "additionalProperties": false, "required": ["url", "values", "files", "final_button"], "properties": { "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" }, "values": { "type": "object", "additionalProperties": { "type": "string", "maxLength": 4000 } }, "files": { "type": "array", "maxItems": 50, "items": { "$ref": "capture.schema.json#/$defs/fileTransfer" } }, "final_button": { "type": "string", "maxLength": 80 } } }, "status": { "enum": ["waiting", "done", "canceled"] }, "result": { "anyOf": [{ "type": "object", "additionalProperties": {} }, { "type": "null" }] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "done_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "done_by": { "type": ["string", "null"], "maxLength": 80 } } }, "stepId": { "type": "string", "pattern": "^cst_[A-Za-z0-9]{16}$" }, "completeStepRequest": { "title": "CompleteCreativeStepRequest", "description": "POST /v1/creatives/projects/:project/steps/:step/complete(completeStep)の本文。PPO と Play のテストの結果は、画面の数をそのまま入れる", "type": "object", "additionalProperties": false, "required": ["status", "result"], "properties": { "status": { "enum": ["done", "canceled"] }, "result": { "type": "object", "additionalProperties": {} } } }, "run": { "title": "CreativeRun", "description": "creative_run の1行。週の流れ・手で依頼した生成・取り込みの1回", "type": "object", "additionalProperties": false, "required": ["id", "kind", "project", "workflow_id", "status", "cost_usd", "summary", "started_at", "finished_at"], "properties": { "id": { "type": "string", "pattern": "^cr_[A-Za-z0-9]{16}$" }, "kind": { "enum": ["weekly", "manual", "ingest"] }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "workflow_id": { "type": ["string", "null"], "maxLength": 100 }, "status": { "enum": ["running", "done", "failed"] }, "cost_usd": { "type": "number", "minimum": 0 }, "summary": { "anyOf": [{ "type": "object", "additionalProperties": {} }, { "type": "null" }] }, "started_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "finished_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "runWeeklyRequest": { "title": "RunCreativeWeeklyRequest", "description": "POST /v1/creatives/runs(runCreativeWeekly)の本文。project が無ければ全部の製品", "type": "object", "additionalProperties": false, "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" } } } } },
35
+ "creative/page.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/page.schema.json", "title": "CreativePage", "description": "ストアのページ(creative_page の1行)。既定のページ・CPP・Play のカスタムの掲載・PPO の treatment。PUT /v1/creatives/projects/:project/pages/:platform/:page(putPage)の答え", "type": "object", "additionalProperties": false, "required": ["project", "platform", "key", "kind", "store_id", "store_name", "state", "deep_link", "hypotheses", "created_at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "key": { "$ref": "#/$defs/pageKey" }, "kind": { "$ref": "#/$defs/pageKind" }, "store_id": { "description": "ストアの id(CPP の id・PPO の treatment の id・Play のカスタムの掲載の名前)。既定のページと、まだストアに作っていないページは null", "type": ["string", "null"], "maxLength": 120 }, "store_name": { "$ref": "#/$defs/storeName" }, "state": { "$ref": "#/$defs/pageState" }, "deep_link": { "description": "CPP から開くアプリの中のリンク", "anyOf": [{ "type": "string", "maxLength": 2048 }, { "type": "null" }] }, "hypotheses": { "description": "このページにつないだ仮説の記録の仮説(hyp_…)。つないだ古い順。仮説の記録の ledger_link の page(<platform>/<key>)を引いた物", "type": "array", "maxItems": 50, "items": { "type": "string", "pattern": "^hyp_[A-Za-z0-9]{16}$" } }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "pageKey": { "title": "CreativePageKey", "description": "ページのキー。既定のページは default。R6 のリンクの行き先の page もこの値", "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,39}$" }, "storeName": { "title": "CreativePageStoreName", "description": "ストアでのページの名前(App Store の CPP の名前)。App Store Connect の分析の報告は CPP を id でなくこの名前(Page Title)で出すので、ページごとの数をこの値で照らす。既定のページとまだストアに作っていないページは null", "type": ["string", "null"], "minLength": 1, "maxLength": 120 }, "pageKind": { "title": "CreativePageKind", "enum": ["default", "cpp", "csl", "ppo_treatment"] }, "pageState": { "title": "CreativePageState", "description": "draft はストアにまだ無い。in_review は審査中。live は見える。rejected は審査で断られた。retired は下ろした", "enum": ["draft", "in_review", "live", "rejected", "retired"] }, "putPageRequest": { "title": "PutCreativePageRequest", "description": "putPage の本文。作るか置き換える(created_at と、つないだ仮説は残す)。state が無ければ、既定のページと store_id のあるページは live、無いページは draft。ストアにもう作ってあるページは、ストアの状態(審査に出していない CPP は draft)を書く", "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "$ref": "#/$defs/pageKind" }, "store_id": { "type": ["string", "null"], "maxLength": 120 }, "store_name": { "$ref": "#/$defs/storeName" }, "state": { "$ref": "#/$defs/pageState" }, "deep_link": { "anyOf": [{ "type": "string", "maxLength": 2048 }, { "type": "null" }] }, "hypothesis": { "description": "このページにつなぐ仮説の記録の仮説(hyp_…)。仮説の記録の ledger_link に page(<platform>/<key>)として足す。前につないだ仮説は外さない", "type": "string", "pattern": "^hyp_[A-Za-z0-9]{16}$" } } } } },
36
+ "creative/reference.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/reference.schema.json", "title": "CreativeReference", "description": "参考の素材(creative_reference の1行と、そのファイル)。調べて集めた競合の画像・広告の素材・Web のページ・自分の過去のストアの物。社内の調べ物にだけ使い、外に出さない(docs/design/creatives.md 15節)", "type": "object", "additionalProperties": false, "required": ["id", "source", "source_url", "subject", "store", "store_app_id", "country", "captured_on", "note", "tags", "project", "origin", "meta", "status", "files", "hypotheses", "created_at", "created_by"], "properties": { "id": { "$ref": "#/$defs/referenceId" }, "source": { "$ref": "#/$defs/source" }, "source_url": { "description": "元の URL。手元のファイルだけの時は null", "type": ["string", "null"], "maxLength": 2000 }, "subject": { "description": "アプリか競合の名前。自由な文字", "type": ["string", "null"], "maxLength": 120 }, "store": { "anyOf": [{ "$ref": "#/$defs/store" }, { "type": "null" }] }, "store_app_id": { "type": ["string", "null"], "maxLength": 200 }, "country": { "anyOf": [{ "$ref": "metrics.schema.json#/$defs/country" }, { "type": "null" }] }, "captured_on": { "description": "元にその素材が出ていた日。分からなければ保存した日", "$ref": "../common.schema.json#/$defs/day" }, "note": { "description": "自由なメモ。同じファイルをもう一度足すと後ろに足す", "type": "string", "maxLength": 8000 }, "tags": { "$ref": "#/$defs/tags" }, "project": { "description": "自分の製品につなぐ時だけ", "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "origin": { "$ref": "#/$defs/origin" }, "meta": { "description": "自由な JSON。App Store のページは名前・作った会社・バージョン・説明・アイコンと枚の URL、Web のページは題と本文の初めの2,000字", "type": "object", "additionalProperties": {} }, "status": { "$ref": "#/$defs/status" }, "files": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/file" } }, "hypotheses": { "description": "つないだ仮説の記録の仮説の id(ledger_link の reference の行)", "type": "array", "maxItems": 200, "items": { "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" } }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "type": "string", "maxLength": 80 } }, "$defs": { "tags": { "title": "CreativeReferenceTags", "description": "自由な文字の一覧。決まった一覧は無い", "type": "array", "maxItems": 20, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 40 } }, "referenceId": { "title": "CreativeReferenceId", "type": "string", "pattern": "^ref_[A-Za-z0-9]{16}$" }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "source": { "title": "CreativeReferenceSource", "description": "出どころ。決まった値はこれだけで、ほかは自由に書く。own_screen は app-growth screens build が確かめを通した自分のリモート画面の3つの大きさの画像", "enum": ["app_store", "play", "meta_ads", "apple_ads", "tiktok", "x", "web", "own_store", "own_screen", "other"] }, "store": { "title": "CreativeReferenceStore", "enum": ["app_store", "play"] }, "origin": { "title": "CreativeReferenceOrigin", "description": "manual は CLI で手で足した物、watch はストアの記録(CLI の creatives watch)が変わった時に足した物", "enum": ["manual", "watch"] }, "status": { "title": "CreativeReferenceStatus", "description": "uploading はファイルを上げている途中。completeReference で ready", "enum": ["uploading", "ready"] }, "contentType": { "title": "CreativeReferenceContentType", "description": "保存できるファイルの形式", "enum": ["image/png", "image/jpeg", "image/webp", "image/gif", "image/heic", "video/mp4", "video/quicktime", "video/webm", "application/pdf", "text/plain", "text/markdown", "text/html"] }, "fileInput": { "title": "CreativeReferenceFileInput", "description": "CLI が手元のファイルから出した値。寸法と長さは読めた時だけ", "type": "object", "additionalProperties": false, "required": ["sha256", "content_type", "bytes"], "properties": { "sha256": { "$ref": "#/$defs/sha256" }, "content_type": { "$ref": "#/$defs/contentType" }, "bytes": { "type": "integer", "minimum": 1, "maximum": 94371840 }, "width": { "type": ["integer", "null"], "minimum": 1 }, "height": { "type": ["integer", "null"], "minimum": 1 }, "duration_ms": { "type": ["integer", "null"], "minimum": 0 } } }, "file": { "title": "CreativeReferenceFile", "description": "creative_reference_file の1行。同じ sha256 のファイルは R2 に1回だけ置く(refs/<sha256>)", "type": "object", "additionalProperties": false, "required": ["position", "sha256", "content_type", "bytes", "width", "height", "duration_ms", "path"], "properties": { "position": { "type": "integer", "minimum": 0 }, "sha256": { "$ref": "#/$defs/sha256" }, "content_type": { "$ref": "#/$defs/contentType" }, "bytes": { "type": "integer", "minimum": 1 }, "width": { "type": ["integer", "null"], "minimum": 1 }, "height": { "type": ["integer", "null"], "minimum": 1 }, "duration_ms": { "type": ["integer", "null"], "minimum": 0 }, "path": { "description": "読む core のパス(getReferenceFile)", "type": "string", "maxLength": 200 } } }, "createReferenceRequest": { "title": "CreateReferenceRequest", "description": "POST /v1/creatives/references(createReference)の本文。files(手元のファイル)か url(creative が読む)のどちらか1つ。両方か、どちらも無いと 400 invalid", "type": "object", "additionalProperties": false, "properties": { "files": { "type": "array", "minItems": 1, "maxItems": 50, "items": { "$ref": "#/$defs/fileInput" } }, "url": { "description": "画像・動画の URL か Web のページ。App Store のアプリのページは Apple が Worker からの読みを断るので受けない(400)。CLI が手元で読んでファイルで足す", "type": "string", "pattern": "^https?://", "maxLength": 2000 }, "source": { "description": "無ければ URL から決める。手元のファイルは other", "$ref": "#/$defs/source" }, "source_url": { "description": "手元のファイルの元の URL", "type": ["string", "null"], "maxLength": 2000 }, "subject": { "type": ["string", "null"], "maxLength": 120 }, "country": { "anyOf": [{ "$ref": "metrics.schema.json#/$defs/country" }, { "type": "null" }] }, "captured_on": { "$ref": "../common.schema.json#/$defs/day" }, "note": { "type": "string", "maxLength": 8000 }, "tags": { "$ref": "#/$defs/tags" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "hypothesis": { "description": "つなぐ仮説", "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, "store": { "description": "files の時だけ。手元でストアのページを読んだ時のストア", "anyOf": [{ "$ref": "#/$defs/store" }, { "type": "null" }] }, "store_app_id": { "description": "files の時だけ。ストアのアプリの id", "type": ["string", "null"], "maxLength": 200 }, "meta": { "description": "files の時だけ。手元で読んだストアのページの名前・会社・バージョン・説明・枚の URL・言語・変わったかを見る値(fingerprint)", "type": "object", "maxProperties": 30, "additionalProperties": {} }, "origin": { "description": "files の時だけ。競合のストアの記録(CLI の creatives watch)が足す時は watch。無ければ manual", "$ref": "#/$defs/origin" } } }, "fileUpload": { "title": "CreativeReferenceFileUpload", "type": "object", "additionalProperties": false, "required": ["sha256", "upload"], "properties": { "sha256": { "$ref": "#/$defs/sha256" }, "upload": { "$ref": "capture.schema.json#/$defs/fileTransfer" } } }, "createReferenceResult": { "title": "CreateReferenceResult", "description": "createReference の答え。created が false は、同じ sha256 のファイル1つの件があったので前の件を返した(200)。uploads はまだ R2 に無いファイルだけ。URL から作った件は ready で、uploads は空", "type": "object", "additionalProperties": false, "required": ["reference", "created", "uploads"], "properties": { "reference": { "$ref": "#" }, "created": { "type": "boolean" }, "uploads": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/fileUpload" } } } }, "updateReferenceRequest": { "title": "UpdateReferenceRequest", "description": "PATCH /v1/creatives/references/:reference(updateReference)の本文。書いた欄だけ変える。hypotheses はつなぐ仮説を足す", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "note": { "type": "string", "maxLength": 8000 }, "tags": { "$ref": "#/$defs/tags" }, "subject": { "type": ["string", "null"], "maxLength": 120 }, "country": { "anyOf": [{ "$ref": "metrics.schema.json#/$defs/country" }, { "type": "null" }] }, "captured_on": { "$ref": "../common.schema.json#/$defs/day" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "hypotheses": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" } }, "meta": { "description": "今の meta に足す(同じキーは置き換える)。CLI の creatives watch が、変わっていないページに読んだ値(fingerprint・version・lang)を書く", "type": "object", "maxProperties": 30, "additionalProperties": {} } } }, "referenceList": { "title": "CreativeReferenceList", "description": "GET /v1/creatives/references(listReferences)の答え。新しい順に50件。next_cursor を ?cursor= に渡すと続き", "type": "object", "additionalProperties": false, "required": ["references", "next_cursor"], "properties": { "references": { "type": "array", "maxItems": 50, "items": { "$ref": "#" } }, "next_cursor": { "type": ["string", "null"], "maxLength": 80 } } } } },
37
+ "creative/screens.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/screens.schema.json", "title": "StoreScreens", "description": "アプリの repo の store/screens.json。撮影の画面の id と1行の説明と、撮れる OS を並べる。app-release shots は撮った場面(scene)をこの id に直して capture.json に書く。creative の仕様の step は説明を読んで、どの画面をどの枚に置くかを決める。画面の id は製品の中で意味を変えない。画面を消したら id も消す", "type": "object", "additionalProperties": false, "required": ["screens"], "properties": { "$schema": { "type": "string" }, "screens": { "type": "array", "minItems": 1, "maxItems": 200, "items": { "$ref": "#/$defs/screen" } } }, "$defs": { "screen": { "title": "StoreScreen", "type": "object", "additionalProperties": false, "required": ["id", "description", "platforms"], "properties": { "id": { "$ref": "capture.schema.json#/$defs/screenId" }, "description": { "description": "1行の説明。何が写っているか。LLM が読む", "type": "string", "minLength": 1, "maxLength": 200 }, "platforms": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/platform" } }, "scene": { "description": "撮影のテストの場面の名前(ship.toml の [shots] の scenes・extra_scenes)。無ければ id と同じ", "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,47}$" }, "state": { "description": "画面の状態の id。無ければ default", "$ref": "capture.schema.json#/$defs/screenState" }, "kind": { "description": "無ければ image", "$ref": "capture.schema.json#/$defs/captureKind" } } } } },
38
+ "creative/tags.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/tags.schema.json", "title": "CreativeTags", "description": "案のタグ。全部の案が持ち、値は決まった一覧から選ぶ。学ぶ単位はタグの効果(docs/design/creatives.md 13.1節)", "type": "object", "additionalProperties": false, "required": ["claim", "benefit", "wording", "visual", "layout", "first_screen", "video"], "properties": { "claim": { "$ref": "#/$defs/claim" }, "benefit": { "$ref": "brand.schema.json#/$defs/benefitKey" }, "wording": { "$ref": "#/$defs/wording" }, "visual": { "$ref": "#/$defs/visual" }, "layout": { "$ref": "#/$defs/layout" }, "first_screen": { "$ref": "capture.schema.json#/$defs/screenId" }, "video": { "description": "動画の有無", "type": "boolean" } }, "$defs": { "claim": { "title": "CreativeClaim", "description": "見出しが何を訴えるか", "enum": ["feature", "outcome", "emotion", "social_proof", "free"] }, "wording": { "title": "CreativeWording", "description": "見出しの書き方", "type": "object", "additionalProperties": false, "required": ["length", "number", "question", "second_person"], "properties": { "length": { "enum": ["short", "long"] }, "number": { "description": "数字を含むか", "type": "boolean" }, "question": { "description": "問いかけか", "type": "boolean" }, "second_person": { "description": "二人称か", "type": "boolean" } } }, "visual": { "title": "CreativeVisual", "description": "見た目の種類と背景の明るさ。描画の後に VLM が照らし、違えば確認で落とす", "type": "object", "additionalProperties": false, "required": ["kind", "background"], "properties": { "kind": { "enum": ["ui_only", "illustration", "person", "photo"] }, "background": { "enum": ["light", "dark"] } } }, "layout": { "title": "CreativeLayout", "description": "テンプレートの layout。workers/creative/templates/<layout>/", "enum": ["caption_top", "caption_bottom", "hero_full_ui", "panorama", "play_phone", "feature_graphic", "header", "search", "event_card", "event_detail", "caption_overlay"] } } },
39
+ "creative/test.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/test.schema.json", "title": "CreativeTest", "description": "素材の実験(creative_test の1行)。主な成果と止める規則は始める前に決めて固定する(docs/design/creatives.md 13.3節)", "type": "object", "additionalProperties": false, "required": ["id", "project", "hypothesis", "kind", "arms", "primary_metric", "metric_order", "max_days", "checkpoints", "loss_threshold", "ad_group_id", "store_id", "status", "started_at", "ended_at", "winner", "uplift_mean", "uplift_sd", "registered_by", "registered_at"], "properties": { "id": { "$ref": "#/$defs/testId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "hypothesis": { "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, "kind": { "$ref": "#/$defs/kind" }, "arms": { "type": "array", "minItems": 2, "maxItems": 3, "items": { "$ref": "#/$defs/arm" } }, "primary_metric": { "$ref": "#/$defs/metric" }, "metric_order": { "description": "成果の候補の順。上から、期間の中で1つの案あたり30件以上が見込める物を primary_metric にした", "type": "array", "minItems": 1, "maxItems": 4, "items": { "$ref": "#/$defs/metric" } }, "max_days": { "type": "integer", "minimum": 7, "maximum": 90 }, "checkpoints": { "description": "判定する日(始めてからの日数)。ppo は 28・56・84", "type": "array", "maxItems": 10, "items": { "type": "integer", "minimum": 1, "maximum": 90 } }, "loss_threshold": { "description": "期待損失がこれより小さければ止める", "type": "number", "minimum": 0, "maximum": 1 }, "ad_group_id": { "description": "ads_cpp の Apple Ads の広告グループ", "type": ["string", "null"], "maxLength": 40 }, "store_id": { "description": "ppo の appStoreVersionExperiments の id・play_experiment の名前", "type": ["string", "null"], "maxLength": 120 }, "status": { "$ref": "#/$defs/status" }, "started_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "ended_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "winner": { "type": ["string", "null"], "pattern": "^[a-z][a-z0-9_]{0,15}$" }, "uplift_mean": { "description": "勝った案の上げ幅。生の差でなくモデルの事後分布の平均", "type": ["number", "null"] }, "uplift_sd": { "type": ["number", "null"], "minimum": 0 }, "registered_by": { "type": "string", "maxLength": 80 }, "registered_at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "testId": { "title": "CreativeTestId", "type": "string", "pattern": "^[a-z][a-z0-9_-]{2,63}$" }, "kind": { "title": "CreativeTestKind", "enum": ["ads_cpp", "ppo", "play_experiment"] }, "status": { "title": "CreativeTestStatus", "enum": ["registered", "running", "stopped", "decided"] }, "metric": { "title": "CreativeMetric", "description": "purchase 購入・trial お試しの開始・outcome 製品の成果の出来事(CreativeBrandBody.outcome_event)・install インストール", "enum": ["purchase", "trial", "outcome", "install"] }, "arm": { "title": "CreativeTestArm", "description": "実験の1つの案。ads_cpp は CPP のページと広告、ppo は元か treatment のページ", "type": "object", "additionalProperties": false, "required": ["arm", "page", "variant"], "properties": { "arm": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,15}$" }, "page": { "$ref": "page.schema.json#/$defs/pageKey" }, "variant": { "anyOf": [{ "$ref": "variant.schema.json#/$defs/variantId" }, { "type": "null" }] }, "ad_id": { "type": ["string", "null"], "maxLength": 40 } } }, "allocation": { "title": "CreativeAllocation", "description": "creative_allocation の1行。ads_cpp で、その日に有効にした案と、top-two Thompson sampling で選んだ確率", "type": "object", "additionalProperties": false, "required": ["test", "day", "arm", "propensity", "policy_version"], "properties": { "test": { "$ref": "#/$defs/testId" }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "arm": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,15}$" }, "propensity": { "$ref": "../common.schema.json#/$defs/propensity" }, "policy_version": { "$ref": "../common.schema.json#/$defs/policyVersion" } } }, "registerTestRequest": { "title": "RegisterCreativeTestRequest", "description": "PUT /v1/creatives/projects/:project/tests/:test(registerTest)の本文。同じアプリの PPO が動いている時は 409 test_running。見分けられる差が足りない PPO は 409 underpowered", "type": "object", "additionalProperties": false, "required": ["hypothesis", "kind", "arms", "max_days", "loss_threshold"], "properties": { "hypothesis": { "description": "実験で確かめる仮説。仮説の記録(R13)の id で、creative が INSIGHTS.ledgerGet で引く。無い・仮説の記録に無い・ほかの製品の仮説は 400 invalid", "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, "kind": { "$ref": "#/$defs/kind" }, "arms": { "type": "array", "minItems": 2, "maxItems": 3, "items": { "$ref": "#/$defs/arm" } }, "primary_metric": { "description": "無ければ metric_order の順で creative が選ぶ", "$ref": "#/$defs/metric" }, "max_days": { "type": "integer", "minimum": 7, "maximum": 90 }, "checkpoints": { "type": "array", "maxItems": 10, "items": { "type": "integer", "minimum": 1, "maximum": 90 } }, "loss_threshold": { "type": "number", "minimum": 0, "maximum": 1 }, "ad_group_id": { "type": "string", "maxLength": 40 } } }, "testDetail": { "title": "CreativeTestDetail", "description": "GET /v1/creatives/projects/:project/tests/:test(getTest)の答え。日ごとの配分つき", "type": "object", "additionalProperties": false, "required": ["test", "allocations"], "properties": { "test": { "$ref": "#" }, "allocations": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/allocation" } } } } } },
40
+ "creative/text.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/text.schema.json", "title": "StoreText", "description": "ストアの文字の1行(creative_text)。製品 × OS × ページ × 言語 × 欄の1つの値。値を変える時は新しい行を足し、前の行を残す。上限と数え方は packages/contract の creativeFields", "type": "object", "additionalProperties": false, "required": ["id", "project", "platform", "page", "locale", "field", "value", "status", "source", "hypothesis", "graphemes", "bytes", "created_at", "created_by", "approved_at", "approved_by", "live_from", "live_until"], "properties": { "id": { "$ref": "#/$defs/revisionId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "page": { "$ref": "page.schema.json#/$defs/pageKey" }, "locale": { "$ref": "../common.schema.json#/$defs/langTag" }, "field": { "$ref": "#/$defs/field" }, "value": { "type": "string", "maxLength": 4000 }, "status": { "$ref": "#/$defs/status" }, "source": { "$ref": "#/$defs/source" }, "hypothesis": { "anyOf": [{ "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, { "type": "null" }] }, "graphemes": { "description": "Intl.Segmenter で数えた書記素の数", "type": "integer", "minimum": 0 }, "bytes": { "description": "UTF-8 のバイトの数", "type": "integer", "minimum": 0 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "type": "string", "maxLength": 80 }, "approved_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "approved_by": { "type": ["string", "null"], "maxLength": 80 }, "live_from": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "live_until": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } }, "$defs": { "revisionId": { "title": "StoreTextRevisionId", "type": "string", "pattern": "^ct_[A-Za-z0-9]{16}$" }, "field": { "title": "StoreTextField", "description": "欄の名前。どのストアの欄かと上限は creativeFields", "enum": ["name", "subtitle", "keywords", "promotional_text", "description", "whats_new", "short_description", "event_name", "event_short", "event_long"] }, "status": { "title": "StoreTextStatus", "description": "proposed → approved → live → retired。rejected は本人が落とした案", "enum": ["proposed", "approved", "live", "retired", "rejected"] }, "source": { "title": "StoreTextSource", "description": "ai は AI の案・human は人が書いた・store はストアの画面で直された値を取り込んだ・imported は製品の repo のファイルから1回だけ移した", "enum": ["ai", "human", "store", "imported"] }, "proposeStoreTextRequest": { "title": "ProposeStoreTextRequest", "description": "POST /v1/creatives/projects/:project/texts/:platform/:page/:locale/:field(proposeStoreText)の本文。proposed で入る。長さが上限を超えれば 400 invalid", "type": "object", "additionalProperties": false, "required": ["value"], "properties": { "value": { "type": "string", "maxLength": 4000 }, "hypothesis": { "anyOf": [{ "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, { "type": "null" }] } } } } },
41
+ "creative/variant.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/creative/variant.schema.json", "title": "CreativeVariant", "description": "素材の案(creative_variant の1行)。中身は変える所の一覧で、画像は持たない。採る・断る・取り下げるの答え(docs/design/creatives.md 6節・9節)", "type": "object", "additionalProperties": false, "required": ["id", "project", "platform", "page", "surface", "hypothesis", "status", "changes", "model", "cost_usd", "created_at", "created_by", "decided_at", "decided_by", "decision_note"], "properties": { "id": { "$ref": "#/$defs/variantId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "page": { "$ref": "page.schema.json#/$defs/pageKey" }, "surface": { "$ref": "changes.schema.json#/$defs/surface" }, "hypothesis": { "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, "status": { "$ref": "#/$defs/status" }, "changes": { "anyOf": [{ "$ref": "changes.schema.json" }, { "type": "null" }], "description": "generating と failed の間は null" }, "model": { "description": "一覧を書いたモデル。人か手元の Claude Code が書いた一覧は null", "type": ["string", "null"], "maxLength": 80 }, "cost_usd": { "description": "この案の AI の費用", "type": "number", "minimum": 0 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "created_by": { "type": "string", "maxLength": 80 }, "decided_at": { "description": "採った・断った・取り下げた時刻", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "decided_by": { "type": ["string", "null"], "maxLength": 80 }, "decision_note": { "description": "断った・取り下げた理由。作れなかった時は誤りの文", "type": ["string", "null"], "maxLength": 1000 } }, "$defs": { "variantId": { "title": "CreativeVariantId", "type": "string", "pattern": "^cv_[A-Za-z0-9]{16}$" }, "status": { "title": "CreativeVariantStatus", "description": "generating は作っている間。proposed は本人が決めるのを待つ。accepted は本人が採った(手元で作り込んで出す)。rejected は本人が断った。withdrawn は AI か作った人が取り下げた。failed は作れなかった", "enum": ["generating", "proposed", "accepted", "rejected", "withdrawn", "failed"] }, "decideRequest": { "title": "DecideCreativeVariantRequest", "description": "POST …/variants/:variant/reject・withdraw の本文", "type": "object", "additionalProperties": false, "properties": { "reason": { "description": "断る・取り下げる理由。取り下げる時は要る", "type": "string", "minLength": 1, "maxLength": 1000 } } }, "generateVariantRequest": { "title": "GenerateCreativeVariantRequest", "description": "POST /v1/creatives/projects/:project/variants(generateVariant)の本文。答えは 200 の CreativeRun。changes があれば LLM を通さずにその一覧で案を作り、回は done で返る。無ければ LLM が今の掲載から変える所を書く(running)。今の掲載が無い製品は 409 conflict。予算で止めている時は 409 budget_stop", "type": "object", "additionalProperties": false, "required": ["platform", "page", "surface", "hypothesis"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "page": { "$ref": "page.schema.json#/$defs/pageKey" }, "surface": { "$ref": "changes.schema.json#/$defs/surface" }, "hypothesis": { "description": "案を作る元の仮説。仮説の記録(R13)の id で、creative が INSIGHTS.ledgerGet で引く。無い・仮説の記録に無い・ほかの製品の仮説は 400 invalid", "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, "countries": { "description": "基準にする今の掲載の国。無ければ日本 → 米国 → ほかの順に4か国まで", "type": "array", "minItems": 1, "maxItems": 40, "uniqueItems": true, "items": { "$ref": "metrics.schema.json#/$defs/country" } }, "changes": { "$ref": "changes.schema.json#/$defs/draft" } } } } },
42
+ "experiment/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/admin.schema.json", "title": "ExperimentList", "description": "GET /v1/experiments/projects/:project の答え。実験の一覧(experiment_registry)の、動いている実験と決めた実験。案ごとの露出の人数・決める指標・良い確率・ガードレール・決める日・今の decide の答え。決める日を過ぎた物と decide が revert の物を先頭に、ほかは決める日の近い順(docs/design/experimentation.md 8・9節)", "type": "object", "additionalProperties": false, "required": ["project", "generated_at", "experiments"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "experiments": { "type": "array", "items": { "$ref": "#/$defs/status" } } }, "$defs": { "status": { "title": "ExperimentStatus", "description": "1つの実験の今の数と答え。数えるのは exposure にある人(本人・テスター・ロボット・2つの案を記録した人を除く)で、始まりは最初の露出の時刻", "type": "object", "additionalProperties": false, "required": ["experiment", "layer", "keys", "hypothesis", "rule", "state", "winner", "reason", "started_at", "decide_on", "extensions", "overdue", "arms", "metric", "guardrails", "decide"], "properties": { "experiment": { "$ref": "experiment.schema.json#/$defs/id" }, "layer": { "$ref": "experiment.schema.json#/$defs/layer" }, "keys": { "description": "変えるパラメーターのキー", "type": "array", "items": { "$ref": "experiment.schema.json#/$defs/paramKey" } }, "hypothesis": { "$ref": "rule.schema.json#/$defs/hypothesis" }, "rule": { "$ref": "rule.schema.json" }, "state": { "$ref": "experiment.schema.json#/$defs/state" }, "winner": { "description": "kept・reverted の時の案。動いている間は null", "type": ["string", "null"] }, "reason": { "description": "kept・reverted の時の理由。人が決めた時は manual、止めた時は stopped", "anyOf": [{ "$ref": "decide.schema.json#/$defs/reason" }, { "enum": ["manual", "stopped"] }, { "type": "null" }] }, "started_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "decide_on": { "description": "決める日(Asia/Tokyo)。延ばした後の日", "$ref": "rule.schema.json#/$defs/date" }, "extensions": { "description": "延ばした回数", "type": "integer", "minimum": 0 }, "overdue": { "description": "動いていて、決める日(Asia/Tokyo)を過ぎた", "type": "boolean" }, "arms": { "description": "案ごとの重みと露出の人数", "type": "array", "items": { "title": "ExperimentArmExposure", "type": "object", "additionalProperties": false, "required": ["variant", "weight", "exposed"], "properties": { "variant": { "type": "string" }, "weight": { "type": "integer", "minimum": 1 }, "exposed": { "description": "露出を記録した人", "type": "integer", "minimum": 0 } } } }, "metric": { "$ref": "#/$defs/metric" }, "guardrails": { "type": "array", "items": { "$ref": "#/$defs/guardrail" } }, "decide": { "description": "今の数で decide を呼んだ答え。決める日の前は見るためだけ(当てるのは決める日の Cron と、ガードレールの revert だけ)", "$ref": "decide.schema.json#/$defs/result" } } }, "metric": { "title": "ExperimentMetric", "type": "object", "additionalProperties": false, "required": ["metric", "label", "direction", "arms"], "properties": { "metric": { "type": "string" }, "label": { "description": "metrics.json の名前。知らない指標は id", "type": "string" }, "direction": { "$ref": "rule.schema.json#/$defs/direction" }, "arms": { "type": "array", "items": { "title": "ExperimentMetricArm", "type": "object", "additionalProperties": false, "required": ["variant", "n", "reached", "rate", "prob_better", "expected_loss"], "properties": { "variant": { "type": "string" }, "n": { "description": "窓の閉じた人", "type": "integer", "minimum": 0 }, "reached": { "description": "窓の中に出来事のあった人", "type": "integer", "minimum": 0 }, "rate": { "type": ["number", "null"] }, "prob_better": { "description": "最初の案より良い確率。最初の案は null", "type": ["number", "null"] }, "expected_loss": { "type": ["number", "null"] } } } } } }, "guardrail": { "title": "ExperimentGuardrailStatus", "type": "object", "additionalProperties": false, "required": ["metric", "label", "direction", "margin", "arms"], "properties": { "metric": { "type": "string" }, "label": { "type": "string" }, "direction": { "$ref": "rule.schema.json#/$defs/direction" }, "margin": { "type": "number" }, "arms": { "type": "array", "items": { "title": "ExperimentGuardrailArm", "type": "object", "additionalProperties": false, "required": ["variant", "n", "reached", "rate", "prob_not_worse"], "properties": { "variant": { "type": "string" }, "n": { "type": "integer", "minimum": 0 }, "reached": { "type": "integer", "minimum": 0 }, "rate": { "type": ["number", "null"] }, "prob_not_worse": { "description": "最初の案より margin を超えて悪くない確率。最初の案は null", "type": ["number", "null"] } } } } } }, "detail": { "title": "ExperimentDetail", "description": "GET /v1/experiments/projects/:project/:experiment の答え。一覧の行に、案ごとの値・SRM・日ごとの露出・監査の行を足す", "type": "object", "additionalProperties": false, "required": ["project", "generated_at", "status", "variants", "srm", "daily", "history"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "status": { "$ref": "#/$defs/status" }, "variants": { "description": "案ごとのパラメーターの値", "$ref": "experiment.schema.json#/$defs/variants" }, "srm": { "description": "露出の人数と重みのずれ(packages/experiment の srmArms)", "$ref": "../registry/admin.schema.json#/$defs/healthCampaign/properties/srm" }, "daily": { "description": "日ごと(Asia/Tokyo)の、最初の露出の人数", "type": "array", "items": { "title": "ExperimentDailyExposure", "type": "object", "additionalProperties": false, "required": ["day", "variant", "exposed"], "properties": { "day": { "$ref": "rule.schema.json#/$defs/date" }, "variant": { "type": "string" }, "exposed": { "type": "integer", "minimum": 0 } } } }, "history": { "description": "この実験を変えた組の監査の行(新しい順・50まで)", "type": "array", "items": { "title": "ExperimentHistoryEntry", "type": "object", "additionalProperties": false, "required": ["at", "principal", "action", "note"], "properties": { "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "principal": { "type": "string" }, "action": { "type": "string" }, "note": { "type": ["string", "null"] } } } } } }, "decideRequest": { "title": "ExperimentDecideRequest", "description": "POST …/decide の本文。人が先に決める。勝った案の values を各パラメーターの組の default にし、実験を外した組を足す。最初の案なら revert。決めた id はもう送れない", "type": "object", "additionalProperties": false, "required": ["winner"], "properties": { "winner": { "type": "string", "minLength": 1, "maxLength": 40 }, "note": { "description": "決めた理由(監査に残す)", "type": "string", "maxLength": 500 } } }, "stopRequest": { "title": "ExperimentStopRequest", "description": "POST …/stop の本文。実験を外した組を足す(revert と同じ組)。パラメーターは組の default に戻る", "type": "object", "additionalProperties": false, "properties": { "note": { "description": "止めた理由(監査に残す)", "type": "string", "maxLength": 500 } } }, "planRequest": { "title": "ExperimentPlanRequest", "description": "POST /v1/experiments/plan の本文。今の割合と1週に入る人数から、見分けたい差に要る1案の人数と週(両側5%・検出力80%)", "type": "object", "additionalProperties": false, "required": ["baseline", "weekly"], "properties": { "baseline": { "description": "今の割合", "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "weekly": { "description": "1週に実験に入る人数(全部の案の和)", "type": "number", "minimum": 0 }, "lift": { "description": "見分けたい相対の差。既定0.3", "type": "number", "exclusiveMinimum": 0 }, "arms": { "description": "案の数。既定2", "type": "integer", "minimum": 2, "maximum": 4 }, "weeks": { "description": "続けられる週。既定4", "type": "number", "exclusiveMinimum": 0 } } }, "planResult": { "title": "ExperimentPlanResult", "type": "object", "additionalProperties": false, "required": ["baseline", "target", "lift", "arms", "weeks", "weekly", "per_arm_needed", "weeks_needed", "per_arm_in_weeks", "detectable_lift", "decision"], "properties": { "baseline": { "type": "number" }, "target": { "type": "number" }, "lift": { "type": "number" }, "arms": { "type": "integer" }, "weeks": { "type": "number" }, "weekly": { "type": "number" }, "per_arm_needed": { "description": "rule.needed_per_arm に書く数", "type": "integer" }, "weeks_needed": { "type": ["number", "null"] }, "per_arm_in_weeks": { "type": "integer" }, "detectable_lift": { "type": ["number", "null"] }, "decision": { "description": "ab は A/B にする。before_after は人数が足りないので、良さそうな方を全員に出して前後を比べる", "enum": ["ab", "before_after"] } } } } },
43
+ "experiment/compare-arms.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/compare-arms.schema.json", "title": "CompareArmsInput", "description": "R3 の案ごとの差。2つめからの案ごとに、最初の案を holdout・その案を treatment として compare を当てる(R9 の実験)", "type": "object", "additionalProperties": false, "required": ["arms", "min_per_arm"], "properties": { "arms": { "type": "array", "minItems": 2, "maxItems": 4, "items": { "$ref": "compare.schema.json#/$defs/arm" } }, "min_per_arm": { "type": "integer", "minimum": 1, "default": 30 } }, "$defs": { "result": { "title": "CompareArmsResult", "description": "arms の2つめからと同じ順", "type": "array", "items": { "$ref": "compare.schema.json#/$defs/result" } } } },
44
+ "experiment/compare.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/compare.schema.json", "title": "CompareInput", "description": "R3 の差と95%の幅。比べる単位は人(counted の人だけ)。rate = reached / eligible。diff = treatment − holdout。幅は正規近似 diff ± 1.96 × sqrt(p_t(1−p_t)/n_t + p_h(1−p_h)/n_h)。どちらかの側が min_per_arm に届かなければ too_few で差を出さない。数は小数6桁で丸めて比べる", "type": "object", "additionalProperties": false, "required": ["treatment", "holdout", "min_per_arm"], "properties": { "treatment": { "$ref": "#/$defs/arm" }, "holdout": { "$ref": "#/$defs/arm" }, "min_per_arm": { "type": "integer", "minimum": 1, "default": 30 } }, "$defs": { "arm": { "title": "ExperimentArm", "type": "object", "additionalProperties": false, "required": ["eligible", "reached"], "properties": { "eligible": { "type": "integer", "minimum": 0 }, "reached": { "type": "integer", "minimum": 0 } } }, "result": { "title": "CompareResult", "type": "object", "additionalProperties": false, "required": ["status", "treatment_rate", "holdout_rate", "diff", "low", "high"], "properties": { "status": { "enum": ["too_few", "compared"] }, "treatment_rate": { "description": "eligible が0なら null", "type": ["number", "null"] }, "holdout_rate": { "type": ["number", "null"] }, "diff": { "description": "too_few なら null", "type": ["number", "null"] }, "low": { "type": ["number", "null"] }, "high": { "type": ["number", "null"] } } } } },
45
+ "experiment/decide.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/decide.schema.json", "title": "DecideInput", "description": "中核の判定(docs/design/experimentation.md 5.3節)。arms の最初が比べる元。ガードレールで悪い案を外し、良い確率が keep_probability 以上の案を keep、全部が悪ければ revert、延ばせれば extend、延ばし切ったら期待損失の小さい案に決める。学びの回り方の前後の比べも、status_quo を仮説の側にして同じ関数で決める", "type": "object", "additionalProperties": false, "required": ["arms", "keep_probability", "extensions", "max_extensions", "status_quo"], "properties": { "arms": { "type": "array", "minItems": 2, "maxItems": 4, "items": { "$ref": "#/$defs/arm" } }, "keep_probability": { "type": "number", "minimum": 0.5, "maximum": 0.99 }, "extensions": { "description": "これまでに延ばした回数", "type": "integer", "minimum": 0 }, "max_extensions": { "type": "integer", "minimum": 0, "maximum": 3 }, "status_quo": { "description": "今の形の案の名前。実験では最初の案", "type": "string", "minLength": 1, "maxLength": 40 } }, "$defs": { "arm": { "title": "DecideArm", "type": "object", "additionalProperties": false, "required": ["name", "probability_better", "expected_loss", "guardrails"], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 40 }, "probability_better": { "description": "最初の案より良い確率。最初の案と数の無い案は null", "type": ["number", "null"], "minimum": 0, "maximum": 1 }, "expected_loss": { "description": "期待損失。無ければ null", "type": ["number", "null"], "minimum": 0 }, "guardrails": { "type": "array", "maxItems": 5, "items": { "type": "object", "additionalProperties": false, "required": ["metric", "prob_not_worse"], "properties": { "metric": { "type": "string" }, "prob_not_worse": { "type": ["number", "null"], "minimum": 0, "maximum": 1 } } } } } }, "decision": { "title": "Decision", "description": "keep は勝った案を既定の値にして実験を外す。revert は最初の案に戻して外す。extend は決める日を延ばす", "enum": ["keep", "revert", "extend"] }, "reason": { "title": "DecisionReason", "description": "better 良い確率が届いた・worse 全部の案が悪い・guardrail ガードレールで外れた・unsure 決まらないので延ばす・lowest_loss 延ばし切って期待損失の小さい案・no_data 数が無い", "enum": ["better", "worse", "guardrail", "unsure", "lowest_loss", "no_data"] }, "result": { "title": "DecideResult", "type": "object", "additionalProperties": false, "required": ["decision", "winner", "reason"], "properties": { "decision": { "$ref": "#/$defs/decision" }, "winner": { "description": "keep の案・revert の時は最初の案・extend の時は status_quo", "type": "string" }, "reason": { "$ref": "#/$defs/reason" } } } } },
46
+ "experiment/experiment.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/experiment.schema.json", "title": "Experiment", "description": "中核の実験(docs/design/experimentation.md 3節)。アプリの repo の experiments/<id>.json。レイヤーの中の範囲(buckets)に入った人を案に分け、案ごとにパラメーター(組の flags)の値を変える。最初の案を比べる元にする。送ったことのある id の layer・buckets・案(名前・重み・値)・starts_at・rule.metric は変えない(変えるときは id を替える)。core は hypothesis・rule・requires・exclude_app_versions を外し、app_version を解いた形(served)を組の experiments に入れる", "type": "object", "additionalProperties": false, "required": ["id", "layer", "variants", "starts_at", "ends_at", "hypothesis", "rule"], "properties": { "id": { "$ref": "#/$defs/id" }, "layer": { "$ref": "#/$defs/layer" }, "buckets": { "$ref": "#/$defs/buckets" }, "when": { "description": "端末の値の条件。規則と同じ形", "$ref": "../inapp/campaign.schema.json#/$defs/factCondition" }, "requires": { "description": "中身の条件。書いた実験は、core が解決した app_version の範囲のバージョンの人だけを案に割り当てる", "$ref": "../releases/manifest.schema.json#/$defs/requires" }, "exclude_app_versions": { "$ref": "../releases/manifest.schema.json#/$defs/excludeAppVersions" }, "variants": { "$ref": "#/$defs/variants" }, "starts_at": { "$ref": "../common.schema.json#/$defs/isoTime" }, "ends_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] }, "price_test": { "$ref": "#/$defs/priceTest" }, "hypothesis": { "description": "実験が確かめる仮説(仮説の記録の id)。core が push の時に仮説の記録にあるかを確かめる", "$ref": "rule.schema.json#/$defs/hypothesis" }, "rule": { "$ref": "rule.schema.json" } }, "$defs": { "id": { "title": "ExperimentId", "description": "実験の id。プロジェクトの中で1つ。ASCII だけ(割り当ての式が文字の符号で数えるため)", "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "layer": { "title": "LayerName", "description": "レイヤーの名前。同じパラメーターを変える実験を排他にする箱。画面か面ごとに1つ(paywall・onboarding・home・pricing・theme)。1つのパラメーターを変えられるのは1つのレイヤーだけ。画面の中の件の holdout も、件の layer の中の範囲(ふつうは件の id)。global は製品全体の holdout が使う", "type": "string", "pattern": "^[a-z0-9_-]{1,40}$" }, "buckets": { "title": "ExperimentBuckets", "description": "レイヤーの中の範囲 [from, to)(0〜1000の整数)。書かなければ [0, 1000]。同じレイヤーで期間の重なる実験は範囲を重ねられない", "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0, "maximum": 1000 } }, "priceTest": { "description": "案ごとに値段が違う。true の実験は、割り当ての材料が install_id の端末を最初の案に固定する(入れ直して安い値段を引き直せないように)", "type": "boolean" }, "variants": { "description": "案は2〜4つ。最初の案を比べる元にする(今の値を置く)。案ごとに同じキーの組を書く", "type": "array", "minItems": 2, "maxItems": 4, "items": { "$ref": "#/$defs/variant" } }, "variant": { "title": "ExperimentVariant", "type": "object", "additionalProperties": false, "required": ["name", "weight", "values"], "properties": { "name": { "description": "案の名前。実験の中で一意", "$ref": "../common.schema.json#/$defs/name" }, "weight": { "description": "重み(整数)。割合は重み ÷ 重みの和", "type": "integer", "minimum": 1, "maximum": 1000 }, "values": { "description": "パラメーターのキー → この案の値。キーはマニフェストにあるパラメーター。値の型はパラメーターの型に合わせる", "type": "object", "minProperties": 1, "maxProperties": 20, "propertyNames": { "$ref": "#/$defs/paramKey" }, "additionalProperties": { "$ref": "../config/set.schema.json#/$defs/value" } } } }, "paramKey": { "title": "ParamKey", "description": "パラメーター(組の flags)のキー。. で4段まで区切れる(paywall.cta・onboarding.final.title・theme.accent)", "type": "string", "pattern": "^[a-z0-9_]{1,40}(\\.[a-z0-9_]{1,40}){0,3}$" }, "paramRef": { "title": "ParamRef", "description": "リモート画面とキャンペーンの値の欄に書く、パラメーターの参照。SDK が出す時に中核で値を決め、画面を出した時に experiment_exposed(surface screen)を送る", "type": "object", "additionalProperties": false, "required": ["param"], "properties": { "param": { "$ref": "#/$defs/paramKey" } } }, "served": { "title": "ServedExperiment", "description": "組の experiments の1つ(端末が読む形)。repo の実験から hypothesis・rule・requires・exclude_app_versions を外し、core が app_version を解いて書く。SDK は知らない項目のある実験を使わない", "type": "object", "additionalProperties": false, "required": ["id", "layer", "variants", "starts_at", "ends_at"], "properties": { "id": { "$ref": "#/$defs/id" }, "layer": { "$ref": "#/$defs/layer" }, "buckets": { "$ref": "#/$defs/buckets" }, "when": { "$ref": "../inapp/campaign.schema.json#/$defs/factCondition" }, "app_version": { "description": "core が requires と exclude_app_versions から解決して書く。書いていない OS の人は案に割り当てない", "$ref": "../releases/manifest.schema.json#/$defs/resolvedAppVersion" }, "variants": { "$ref": "#/$defs/variants" }, "starts_at": { "$ref": "../common.schema.json#/$defs/isoTime" }, "ends_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] }, "price_test": { "$ref": "#/$defs/priceTest" } } }, "state": { "title": "ExperimentState", "description": "実験の一覧(experiment_registry)の状態。running 動いている・stopped 止めた・kept 勝った案を既定の値にした・reverted 最初の案に戻した", "enum": ["running", "stopped", "kept", "reverted"] } } },
47
+ "experiment/holdout.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/holdout.schema.json", "title": "HoldoutSideInput", "description": "holdout の側の割り当て。holdout はレイヤーの中の「何も出さない」範囲。bucket = floor(hash32(\"<project>:<assignment_id>:<layer>:layer\") × 1000 / 2^32)(experiment.schema.json の実験と同じレイヤーの位置)。bucket が holdout の範囲 [from, to) に入れば holdout(出さない側)。holdout が null なら全員 treatment。internal は treatment に固定。画面の中の件は割り当ての材料の id と件の layer、通知の施策は人の id と施策の id をレイヤーにする(docs/design/experimentation.md 3.4節)", "type": "object", "additionalProperties": false, "required": ["project", "assignment_id", "layer", "holdout", "internal"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "assignment_id": { "description": "レイヤーの位置を決める id。画面の中の件は割り当ての材料の id(実験と同じ)、通知の施策と製品全体の holdout は人の id", "type": "string", "minLength": 1, "maxLength": 140 }, "layer": { "$ref": "experiment.schema.json#/$defs/layer" }, "holdout": { "anyOf": [{ "$ref": "#/$defs/range" }, { "type": "null" }] }, "internal": { "description": "本人・テスターの端末(R1 の internal_device か、端末の internal_device)", "type": "boolean" } }, "$defs": { "range": { "title": "HoldoutBuckets", "description": "レイヤーの中の出さない範囲 [from, to)(0〜1000の整数)。幅(to − from)は500まで。割合は幅 ÷ 1000", "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0, "maximum": 1000 } }, "result": { "title": "HoldoutSideResult", "type": "object", "additionalProperties": false, "required": ["bucket", "side"], "properties": { "bucket": { "type": "integer", "minimum": 0, "maximum": 999 }, "side": { "$ref": "#/$defs/side" } } }, "side": { "title": "ExperimentSide", "enum": ["treatment", "holdout"] }, "global": { "title": "GlobalHoldoutSideInput", "description": "R10 の製品全体の holdout。人の id をレイヤー global に置き、範囲 [0, 50)(5%)に入れば、自動で選ぶ物(通知の施策・画面の中の件・R9 の実験)を全部出さない側に固定する。サーバーは人の id しか知らないので、どこも人の id で数える。internal(本人とテスターの端末)は出す側(docs/design/personalization.md 4.2節)", "type": "object", "additionalProperties": false, "required": ["project", "person_id", "internal"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "description": "R2 の人の id。uid が後から付いても変えない", "type": "string", "minLength": 1, "maxLength": 140 }, "internal": { "description": "本人・テスターの端末。出す側に固定する", "type": "boolean" } } } } },
48
+ "experiment/measure.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/measure.schema.json", "title": "MeasureInput", "description": "中核の指標の読み(ベータ・二項)。各案の割合を事前分布 Beta(1 + 率 × 重さ, 1 + (1 − 率) × 重さ)(重さは50人分まで)と数から Beta の事後にし、最初の案より良い確率と期待損失を出す。direction が lower の指標は、成果の無かった人を成果として数え直して同じ式にする。積分は [0, 1] を1000に分けた区間の真ん中の点で数える。確率と期待損失は小数4桁で丸める。keep・revert・extend は decide.schema.json(docs/design/experimentation.md 5.2節)", "type": "object", "additionalProperties": false, "required": ["arms", "direction"], "properties": { "arms": { "description": "最初の案を比べる元にする", "type": "array", "minItems": 2, "maxItems": 4, "items": { "$ref": "#/$defs/arm" } }, "direction": { "$ref": "rule.schema.json#/$defs/direction" }, "prior": { "anyOf": [{ "$ref": "#/$defs/prior" }, { "type": "null" }] }, "guardrails": { "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/guardrail" } } }, "$defs": { "arm": { "title": "MeasureArm", "type": "object", "additionalProperties": false, "required": ["name", "n", "reached"], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 40 }, "n": { "description": "窓の閉じた人", "type": "integer", "minimum": 0 }, "reached": { "description": "窓の中に成果のあった人", "type": "integer", "minimum": 0 } } }, "prior": { "title": "MeasurePrior", "description": "事前分布の平均(率)と重さ(何人分か)。重さは50で止める", "type": "object", "additionalProperties": false, "required": ["rate", "weight"], "properties": { "rate": { "type": "number", "minimum": 0, "maximum": 1 }, "weight": { "type": "number", "minimum": 0 } } }, "guardrail": { "title": "MeasureGuardrail", "description": "悪くしてはいけない指標。案ごとに「最初の案より margin を超えて悪くない確率」を出す", "type": "object", "additionalProperties": false, "required": ["metric", "direction", "arms"], "properties": { "metric": { "type": "string" }, "direction": { "$ref": "rule.schema.json#/$defs/direction" }, "margin": { "description": "非劣性の幅(割合の差)。1000分の1の倍数。既定0.05", "type": "number", "minimum": 0, "maximum": 0.5, "default": 0.05 }, "prior": { "anyOf": [{ "$ref": "#/$defs/prior" }, { "type": "null" }] }, "arms": { "type": "array", "minItems": 2, "maxItems": 4, "items": { "$ref": "#/$defs/arm" } } } }, "result": { "title": "MeasureResult", "type": "object", "additionalProperties": false, "required": ["arms", "guardrails"], "properties": { "arms": { "type": "array", "items": { "title": "MeasureArmResult", "type": "object", "additionalProperties": false, "required": ["name", "rate", "prob_better", "expected_loss"], "properties": { "name": { "type": "string" }, "rate": { "description": "reached ÷ n。n が0なら null", "type": ["number", "null"] }, "prob_better": { "description": "最初の案より良い確率。最初の案は null", "type": ["number", "null"] }, "expected_loss": { "description": "この案を選んで、実は一番良い案でなかった時に失う割合の期待値", "type": "number" } } } }, "guardrails": { "type": "array", "items": { "title": "MeasureGuardrailResult", "type": "object", "additionalProperties": false, "required": ["metric", "arm", "prob_not_worse"], "properties": { "metric": { "type": "string" }, "arm": { "description": "2つめからの案", "type": "string" }, "prob_not_worse": { "description": "最初の案より margin を超えて悪くない確率", "type": "number" } } } } } } } },
49
+ "experiment/reach.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/reach.schema.json", "title": "ReachInput", "description": "R3 の成果の窓。1人について、最初に条件を通った時刻(campaign_eligible の最初・通知は送った/送っていたはずの時刻)から within_hours の間に成果の出来事があったか。窓は始まりを含み終わりを含まない。窓がまだ閉じていない人は数えない(counted=false)", "type": "object", "additionalProperties": false, "required": ["first_eligible_at", "within_hours", "goal_at", "now"], "properties": { "first_eligible_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "within_hours": { "type": "number", "exclusiveMinimum": 0 }, "goal_at": { "description": "成果の出来事の時刻(順は問わない)", "type": "array", "items": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "now": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "result": { "title": "ReachResult", "type": "object", "additionalProperties": false, "required": ["counted", "reached"], "properties": { "counted": { "description": "now が窓の終わり以上", "type": "boolean" }, "reached": { "description": "窓の中に成果がある(counted が false でも中にあれば true)", "type": "boolean" } } } } },
50
+ "experiment/rule.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/rule.schema.json", "title": "ExperimentRule", "description": "実験を始める前に決める規則(docs/design/experimentation.md 5.1節)。決める日に core の毎日の Cron が decide で keep・revert・extend を当てる。項目は学びの回り方の LedgerDecisionRule にそろえる", "type": "object", "additionalProperties": false, "required": ["metric", "direction", "keep_probability", "guardrails", "needed_per_arm", "decide_on", "max_extensions", "extend_days"], "properties": { "metric": { "description": "schema/experiment/metrics.json の手前の指標の id(kind が rate の物だけ)", "$ref": "#/$defs/metricId" }, "direction": { "$ref": "#/$defs/direction" }, "keep_probability": { "description": "最初の案より良い確率がこれ以上で keep、悪い確率がこれ以上で revert。ガードレールの悪くなっていない確率もこの値で見る", "type": "number", "minimum": 0.5, "maximum": 0.99, "default": 0.8 }, "guardrails": { "description": "悪くしてはいけない手前の指標。metric と同じ物は書かない", "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/guardrail" } }, "needed_per_arm": { "description": "1案に要る人数(experiments plan の答え)。push が今の数で計算し直して違えば警告", "type": "integer", "minimum": 1 }, "decide_on": { "description": "決める日(Asia/Tokyo の日付)。この日の9:00に core が decide を当てる", "$ref": "#/$defs/date" }, "max_extensions": { "description": "extend できる回数。超えたら期待損失の小さい案に決める", "type": "integer", "minimum": 0, "maximum": 3, "default": 1 }, "extend_days": { "description": "extend で決める日を延ばす日数", "type": "integer", "minimum": 7, "maximum": 90, "default": 28 } }, "$defs": { "direction": { "title": "MetricDirection", "description": "higher は多いほど良い・lower は少ないほど良い", "enum": ["higher", "lower"] }, "metricId": { "title": "LeadingMetricId", "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "date": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" }, "hypothesis": { "title": "HypothesisRef", "description": "仮説の記録の仮説の id(hyp_ と16文字)。同じ製品か、製品を決めていない仮説だけ。core が push の時に仮説の記録にあるかを確かめる", "type": "string", "pattern": "^hyp_[A-Za-z0-9]{16}$" }, "metrics": { "title": "LeadingMetrics", "description": "schema/experiment/metrics.json の形。実験の判断に使う手前の指標", "type": "object", "additionalProperties": false, "required": ["description", "metrics"], "properties": { "description": { "type": "string" }, "metrics": { "type": "array", "minItems": 1, "items": { "title": "LeadingMetric", "type": "object", "additionalProperties": false, "required": ["id", "label", "kind", "event", "filter", "from_hours", "to_hours", "direction", "prior"], "properties": { "id": { "$ref": "#/$defs/metricId" }, "label": { "description": "人が読む名前", "type": "string" }, "kind": { "description": "rate は人の割合(ベータ・二項で良い確率を出す)。amount は1人あたりの払った額の平均(USD。良い確率は出さず、ガードレールに使えない)", "enum": ["rate", "amount"] }, "event": { "description": "数える出来事", "type": "string" }, "filter": { "description": "出来事の中身の絞り込み。closed_within_3s は seconds < 3、paid は払った subscription_changed(お試しの始まりは数えない)", "enum": ["none", "closed_within_3s", "paid"] }, "from_hours": { "description": "窓の始まり(最初に案に入った時刻から)", "type": "number", "minimum": 0 }, "to_hours": { "description": "窓の終わり(含まない)", "type": "number", "exclusiveMinimum": 0, "maximum": 840 }, "direction": { "$ref": "#/$defs/direction" }, "prior": { "description": "ほかの数が無い時の事前分布(公開のベンチマーク)。重さは50人分まで。amount は null", "anyOf": [{ "$ref": "measure.schema.json#/$defs/prior" }, { "type": "null" }] } } } } } }, "guardrail": { "title": "ExperimentGuardrail", "type": "object", "additionalProperties": false, "required": ["metric", "margin"], "properties": { "metric": { "$ref": "#/$defs/metricId" }, "margin": { "description": "非劣性の幅(割合の差)。1000分の1の倍数", "type": "number", "minimum": 0, "maximum": 0.5 } } } } },
51
+ "experiment/srm-arms.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/srm-arms.schema.json", "title": "SrmArmsInput", "description": "案の数に広げた割り当てのずれ(SRM)。案が2つなら srm と同じ(最初の案を holdout とし、期待の割合は最初の重み ÷ 重みの和)。3つ以上は30人からカイ二乗(自由度は案の数 − 1)", "type": "object", "additionalProperties": false, "required": ["counts", "weights"], "properties": { "counts": { "description": "案ごとの人(組の variants の順)", "type": "array", "minItems": 2, "maxItems": 4, "items": { "type": "integer", "minimum": 0 } }, "weights": { "type": "array", "minItems": 2, "maxItems": 4, "items": { "type": "integer", "minimum": 1 } } } },
52
+ "experiment/variant.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/variant.schema.json", "title": "VariantInput", "description": "R3 の案の割り当て(R9 の実験)。h = hash32(\"<project>:<assignment_id>:<experiment>:variant\")、W = 重みの和、cum_i = i 番目までの重みの和。h × W < cum_i × 2^32 になる最初の案 i。浮動小数を使わずに整数で比べる(h × W は 2^53 より小さい)。internal は最初の案に固定。R4 の件の案も同じ式(実験の id の所に件の id)", "type": "object", "additionalProperties": false, "required": ["project", "assignment_id", "experiment", "weights", "internal"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "assignment_id": { "description": "割り当ての材料(docs/design/remote-screens.md 5節)。SDK が決める。iOS は AppTransaction の appTransactionID、Android は ANDROID_ID、どちらも取れなければ install_id。再インストールで変わらない値を使い、案を選び直せないようにする", "type": "string", "minLength": 1, "maxLength": 140 }, "experiment": { "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "weights": { "description": "案の重み(組の variants の順)", "type": "array", "minItems": 2, "maxItems": 4, "items": { "type": "integer", "minimum": 1, "maximum": 1000 } }, "internal": { "type": "boolean" } }, "$defs": { "result": { "title": "VariantResult", "type": "object", "additionalProperties": false, "required": ["unit", "index"], "properties": { "unit": { "description": "h ÷ 2^32(見るためだけ。割り当ては整数で比べる)", "type": "number", "minimum": 0, "exclusiveMaximum": 1 }, "index": { "description": "割り当てた案の番号(0から)", "type": "integer", "minimum": 0, "maximum": 3 } } }, "assignmentSource": { "title": "AssignmentSource", "description": "assignment_id をどこから取ったか。app_transaction: iOS の AppTransaction.appTransactionID(Keychain に保存)。android_id: Settings.Secure.ANDROID_ID。install_id: どちらも取れなかった。値段の違う Offering を案に持つ実験(price_test)は install_id の端末を最初の案に固定する", "enum": ["app_transaction", "android_id", "install_id"] }, "assignment": { "title": "Assignment", "description": "案の割り当ての材料(判定の表の入力)。id を hash32(\"<project>:<id>:<実験か件>:variant\") に入れる", "type": "object", "additionalProperties": false, "required": ["id", "source"], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 140 }, "source": { "$ref": "#/$defs/assignmentSource" } } } } },
53
+ "experiment/vectors.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/experiment/vectors.schema.json", "title": "ExperimentVectors", "description": "schema/cases/experiment/*.json の確かめ用の値。TypeScript・Swift・Kotlin の実験のライブラリが同じ値を通す", "$defs": { "hash32": { "title": "Hash32Vectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["input", "hash32"], "properties": { "input": { "type": "string" }, "hash32": { "type": "integer", "minimum": 0, "maximum": 4294967295 } } } } } }, "globalHoldout": { "title": "GlobalHoldoutVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "key", "hash32", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "holdout.schema.json#/$defs/global" }, "key": { "type": "string" }, "hash32": { "type": "integer", "minimum": 0 }, "expect": { "$ref": "holdout.schema.json#/$defs/result" } } } } } }, "holdout": { "title": "HoldoutVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "key", "hash32", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "holdout.schema.json" }, "key": { "type": "string" }, "hash32": { "type": "integer", "minimum": 0 }, "expect": { "$ref": "holdout.schema.json#/$defs/result" } } } } } }, "reach": { "title": "ReachVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "reach.schema.json" }, "expect": { "$ref": "reach.schema.json#/$defs/result" } } } } } }, "compare": { "title": "CompareVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "compare.schema.json" }, "expect": { "$ref": "compare.schema.json#/$defs/result" } } } } } }, "variant": { "title": "VariantVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "key", "hash32", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "variant.schema.json" }, "key": { "type": "string" }, "hash32": { "type": "integer", "minimum": 0 }, "expect": { "$ref": "variant.schema.json#/$defs/result" } } } } } }, "compareArms": { "title": "CompareArmsVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "compare-arms.schema.json" }, "expect": { "$ref": "compare-arms.schema.json#/$defs/result" } } } } } }, "srmArms": { "title": "SrmArmsVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "srm-arms.schema.json" }, "expect": { "$ref": "../registry/admin.schema.json#/$defs/healthCampaign/properties/srm" } } } } } }, "measure": { "title": "MeasureVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "measure.schema.json" }, "expect": { "$ref": "measure.schema.json#/$defs/result" } } } } } }, "decide": { "title": "DecideVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "expect"], "properties": { "description": { "type": "string" }, "input": { "$ref": "decide.schema.json" }, "expect": { "$ref": "decide.schema.json#/$defs/result" } } } } } }, "layer": { "title": "LayerVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "key", "hash32", "bucket"], "properties": { "description": { "type": "string" }, "input": { "type": "object", "additionalProperties": false, "required": ["project", "assignment_id", "layer"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "assignment_id": { "type": "string", "minLength": 1 }, "layer": { "$ref": "experiment.schema.json#/$defs/layer" } } }, "key": { "type": "string" }, "hash32": { "type": "integer", "minimum": 0 }, "bucket": { "type": "integer", "minimum": 0, "maximum": 999 } } } } } }, "assign": { "title": "AssignVectors", "type": "object", "additionalProperties": false, "required": ["description", "vectors"], "properties": { "description": { "type": "string" }, "vectors": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["description", "input", "expect"], "properties": { "description": { "type": "string" }, "input": { "type": "object", "additionalProperties": false, "required": ["project", "assignment", "experiment", "internal"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "assignment": { "$ref": "variant.schema.json#/$defs/assignment" }, "experiment": { "type": "object", "additionalProperties": false, "required": ["id", "layer", "weights"], "properties": { "id": { "$ref": "experiment.schema.json#/$defs/id" }, "layer": { "$ref": "experiment.schema.json#/$defs/layer" }, "buckets": { "$ref": "experiment.schema.json#/$defs/buckets" }, "weights": { "type": "array", "minItems": 2, "maxItems": 4, "items": { "type": "integer", "minimum": 1, "maximum": 1000 } }, "price_test": { "type": "boolean" } } }, "internal": { "type": "boolean" } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["in", "bucket"], "properties": { "in": { "type": "boolean" }, "bucket": { "type": "integer", "minimum": 0, "maximum": 999 }, "index": { "type": "integer", "minimum": 0, "maximum": 3 }, "propensity": { "type": "number", "minimum": 0, "maximum": 1 }, "pinned": { "type": "boolean" } } } } } } } } } },
54
+ "inapp/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/admin.schema.json", "title": "PushSetRequest", "description": "POST /v1/campaigns/projects/:project/sets(admin.appgrowstack.com)の本文。app-growth campaigns push が、アプリの repo の campaigns/ の active な件を送る。core は schema と送ったことのある id の layer・holdout・triggers・audience の変更を確かめ、cross_promo の target を R1 から組の targets に写して、新しいバージョンを足す", "type": "object", "additionalProperties": false, "required": ["policy", "manifest", "campaigns", "published_by"], "properties": { "policy": { "$ref": "policy.schema.json" }, "manifest": { "description": "アプリのマニフェスト(campaigns/manifest.json)。core は組と一緒に残し、explain が登録と相手の値のコピー(facts.<名前>.mirror)を読む。端末には配らない", "$ref": "manifest.schema.json" }, "campaigns": { "type": "array", "maxItems": 200, "items": { "$ref": "campaign.schema.json" } }, "screen_campaigns": { "description": "型 screen のキャンペーン(docs/design/remote-screens.md 1節)。書かなければ空", "type": "array", "maxItems": 100, "items": { "$ref": "screen-campaign.schema.json" } }, "screens": { "description": "案が指す画面(id → バンドル)。バンドルは先に putScreenBundle で上げておく(R2 に無ければ 400)", "type": "object", "maxProperties": 100, "propertyNames": { "$ref": "../screens/screen.schema.json#/$defs/screenId" }, "additionalProperties": { "$ref": "../screens/screen.schema.json#/$defs/bundle" } }, "pricing": { "description": "値段の段階 → Offering。書かなければ前の組の物を引き継ぐ", "$ref": "set.schema.json#/properties/pricing" }, "screen_patterns": { "description": "screens の画面ごとに組んだ型の id(screen.json の pattern)。screens の全部の画面に要る。core が inapp_screen_pattern_use に残し、型の結果をつなぐ(docs/design/screen-patterns.md 4節)。端末には配らない", "type": "object", "maxProperties": 100, "propertyNames": { "$ref": "../screens/screen.schema.json#/$defs/screenId" }, "additionalProperties": { "$ref": "../screens/pattern.schema.json#/$defs/patternId" } }, "screen_theme": { "description": "アプリの screens/theme.json。console のプレビューが型をこのテーマで描く。端末には配らない(バンドルの中に入っている)", "$ref": "../screens/theme.schema.json" }, "config_manifest": { "description": "アプリの config/manifest.json。screen_campaigns があれば必ず付ける。core がプレースメントと出し方を確かめる", "$ref": "../config/manifest.schema.json" }, "published_by": { "description": "送った元(アプリの repo の commit)。stop・resume・rollback は core が印を書く", "type": "string", "minLength": 1, "maxLength": 200 } }, "$defs": { "setCampaignType": { "title": "SetCampaignType", "description": "組の件の型。campaigns の件の型(CampaignType)に、screen_campaigns の件の screen を足した物", "enum": ["trial_offer", "review_ask", "cross_promo", "survey", "custom", "screen"] }, "pushResponse": { "title": "PushSetResponse", "description": "201。sha256 は端末に配る組の本文の sha256(push の後に GET で同じかを確かめる)", "type": "object", "additionalProperties": false, "required": ["version", "sha256", "published_at"], "properties": { "version": { "type": "integer", "minimum": 1 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "published_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "stopRequest": { "title": "StopRequest", "description": "POST /v1/campaigns/projects/:project/stop。campaign を書けばその件を外した新しいバージョンを足す。書かなければ組を空にする(inapp_state.paused)", "type": "object", "additionalProperties": false, "properties": { "campaign": { "$ref": "../common.schema.json#/$defs/campaignId" } } }, "rollbackRequest": { "title": "RollbackRequest", "description": "POST /v1/campaigns/projects/:project/rollback。to の body を新しいバージョンとして足す。応答は PushSetResponse に、戻る前との差(足される件・外れる件)を足した物。同じ本文で /rollback/preview に送ると差だけを返して足さない(読みの権限 campaigns.read)", "type": "object", "additionalProperties": false, "required": ["to"], "properties": { "to": { "type": "integer", "minimum": 1 } } }, "rollbackResponse": { "title": "RollbackResponse", "type": "object", "additionalProperties": false, "required": ["version", "added", "removed", "applied"], "properties": { "version": { "description": "preview なら今のバージョン", "type": "integer", "minimum": 0 }, "added": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/campaignId" } }, "removed": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/campaignId" } }, "applied": { "type": "boolean" } } }, "setHistory": { "title": "SetHistory", "description": "GET /v1/campaigns/projects/:project/sets?limit=20", "type": "object", "additionalProperties": false, "required": ["sets"], "properties": { "sets": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["version", "sha256", "published_at", "published_by", "campaigns", "titles", "types", "app_versions"], "properties": { "version": { "type": "integer", "minimum": 1 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "published_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "published_by": { "type": "string" }, "campaigns": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/campaignId" } }, "titles": { "description": "組の件ごとの title(件のファイルに書いた日本語の名前)。console が id の代わりに出す", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/campaignId" }, "additionalProperties": { "type": "string" } }, "types": { "description": "組の件ごとの型(trial_offer・review_ask など。画面を差し込む件は screen)。console が件の前に型のアイコンを出す", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/campaignId" }, "additionalProperties": { "$ref": "#/$defs/setCampaignType" } }, "app_versions": { "description": "組の件ごとの、core が requires と exclude_app_versions から解決した OS ごとの範囲(組の件の app_version を写した物)。console がバージョンごとに出る件を出す(docs/design/releases.md 8.2節)", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/campaignId" }, "additionalProperties": { "$ref": "../releases/manifest.schema.json#/$defs/resolvedAppVersion" } } } } } } }, "simulateRequest": { "title": "SimulateRequest", "description": "POST /v1/campaigns/projects/:project/simulate(K2-7)。repo の件(draft を含む)で作った組を、過去 since〜until の人ごとの出来事と値に流す。人のデータを CLI に返さず、数と例の person_id だけを返す", "type": "object", "additionalProperties": false, "required": ["manifest", "campaigns", "since"], "properties": { "policy": { "$ref": "policy.schema.json" }, "manifest": { "description": "アプリのマニフェスト。判定の登録と相手の値のコピー(facts.<名前>.mirror)を読む", "$ref": "manifest.schema.json" }, "campaigns": { "type": "array", "maxItems": 50, "items": { "$ref": "campaign.schema.json" } }, "since": { "$ref": "../common.schema.json#/$defs/epochMs" }, "until": { "$ref": "../common.schema.json#/$defs/epochMs" }, "cursor": { "description": "前の答えの next(人が多くて1回に収まらないとき)", "type": "string", "maxLength": 200 } } }, "simulateReport": { "title": "SimulateReport", "description": "simulate の答え。端末の中だけにある値は session_seconds 0・busy 無しとして数え、assumptions にそう書く", "type": "object", "additionalProperties": false, "required": ["project", "since", "until", "generated_at", "people", "assumptions", "campaigns", "next"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "since": { "$ref": "../common.schema.json#/$defs/epochMs" }, "until": { "$ref": "../common.schema.json#/$defs/epochMs" }, "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "people": { "description": "流した人の数", "type": "integer", "minimum": 0 }, "assumptions": { "type": "array", "items": { "type": "string", "maxLength": 200 } }, "campaigns": { "type": "array", "items": { "$ref": "#/$defs/simulateCampaign" } }, "next": { "description": "続きがあればカーソル。無ければ null", "type": ["string", "null"] } } }, "simulateCampaign": { "title": "SimulateCampaign", "type": "object", "additionalProperties": false, "required": ["campaign", "triggers", "steps", "sides", "unknown", "lower_priority", "day_capped"], "properties": { "campaign": { "$ref": "../common.schema.json#/$defs/campaignId" }, "triggers": { "description": "きっかけごとに当たった人", "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["trigger", "people"], "properties": { "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "people": { "type": "integer", "minimum": 0 } } } }, "steps": { "description": "3 active → 4 きっかけ → 5 回数 → 6 端末の値 → 7 サーバーの値 → 8 holdout の順に、残った人と落ちた理由の上位", "type": "array", "items": { "$ref": "#/$defs/simulateStep" } }, "sides": { "type": "object", "additionalProperties": false, "required": ["treatment", "holdout", "expected_holdout"], "properties": { "treatment": { "type": "integer", "minimum": 0 }, "holdout": { "type": "integer", "minimum": 0 }, "expected_holdout": { "type": "number", "minimum": 0, "maximum": 1 } } }, "unknown": { "description": "件の条件が使う相手の値が core に無い人(マニフェストの mirror が無い値)。当たる・当たらないのどちらにも数えない", "type": "integer", "minimum": 0 }, "lower_priority": { "type": "integer", "minimum": 0 }, "day_capped": { "type": "integer", "minimum": 0 } } }, "simulateStep": { "title": "SimulateStep", "type": "object", "additionalProperties": false, "required": ["step", "name", "remaining", "dropped", "examples"], "properties": { "step": { "type": "number" }, "name": { "$ref": "trace.schema.json#/$defs/stepName" }, "remaining": { "type": "integer", "minimum": 0 }, "dropped": { "type": "array", "maxItems": 5, "items": { "type": "object", "additionalProperties": false, "required": ["reason", "people"], "properties": { "reason": { "$ref": "case.schema.json#/$defs/outcome" }, "people": { "type": "integer", "minimum": 0 } } } }, "examples": { "description": "このステップで落ちた人を3人まで(explain にそのまま渡せる)", "type": "array", "maxItems": 3, "items": { "$ref": "../common.schema.json#/$defs/personId" } } } }, "explainReport": { "title": "ExplainReport", "description": "GET /v1/campaigns/projects/:project/people/:person/explain?event=&at=(K2-7)。その人の値・at までの出来事・作り直した回数の記録・最後に読んだ組で、件ごとの跡を出す。1人を指すので段階2(people.person.read・監査に残す)", "type": "object", "additionalProperties": false, "required": ["project", "person_id", "at", "set_version", "inputs", "decisions"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "set_version": { "description": "その人の最後の campaigns_loaded の version。無ければ D1 の最新", "type": "integer", "minimum": 0 }, "inputs": { "type": "object", "additionalProperties": false, "required": ["context", "facts", "device_only", "history"], "properties": { "context": { "type": "object" }, "facts": { "description": "core にある相手の値。文字列は決まった選択肢だけをそのまま、ほかは \"<文字列 12文字>\"", "type": "object", "additionalProperties": { "$ref": "../common.schema.json#/$defs/typedValue" } }, "device_only": { "description": "件が使うが core に無い相手の値(端末だけの値)。CLI の --fact で入れて回せる", "type": "array", "items": { "$ref": "../common.schema.json#/$defs/name" } }, "history": { "$ref": "case.schema.json#/$defs/history" } } }, "decisions": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["event", "traces"], "properties": { "event": { "type": "object", "additionalProperties": false, "required": ["name", "at"], "properties": { "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "traces": { "type": "array", "items": { "$ref": "trace.schema.json" } } } } } } }, "campaignReport": { "title": "CampaignReport", "description": "GET /v1/campaigns/projects/:project/campaigns/:campaign/report(KD-2・getCampaignReport)。件ごとの結果。数は core が数えた物(差と幅は packages/experiment の compare)。console が読む。CLI は app-growth campaigns report", "type": "object", "additionalProperties": false, "required": ["project", "campaign", "since", "until", "computed_at", "goals", "sides", "srm", "skipped", "simulate"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "campaign": { "$ref": "../common.schema.json#/$defs/campaignId" }, "since": { "$ref": "../common.schema.json#/$defs/epochMs" }, "until": { "$ref": "../common.schema.json#/$defs/epochMs" }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "sides": { "type": "object", "additionalProperties": false, "required": ["treatment", "holdout"], "properties": { "treatment": { "type": "object", "additionalProperties": false, "required": ["eligible", "shown"], "properties": { "eligible": { "type": "integer", "minimum": 0 }, "shown": { "type": "integer", "minimum": 0 } } }, "holdout": { "type": "object", "additionalProperties": false, "required": ["eligible"], "properties": { "eligible": { "type": "integer", "minimum": 0 } } } } }, "goals": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["event", "within_hours", "treatment_reached", "holdout_reached", "compare"], "properties": { "event": { "$ref": "../common.schema.json#/$defs/eventName" }, "within_hours": { "type": "integer", "minimum": 1 }, "treatment_reached": { "type": "integer", "minimum": 0 }, "holdout_reached": { "type": "integer", "minimum": 0 }, "compare": { "$ref": "../experiment/compare.schema.json#/$defs/result" } } } }, "srm": { "$ref": "../registry/admin.schema.json#/$defs/healthCampaign/properties/srm" }, "skipped": { "$ref": "../registry/admin.schema.json#/$defs/healthCampaign/properties/skipped" }, "simulate": { "$ref": "../registry/admin.schema.json#/$defs/healthCampaign/properties/simulate" } } } } },
55
+ "inapp/banned-words.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/banned-words.schema.json", "title": "DefaultBannedWords", "description": "製品によらず件の文に書かない言い方(約束の既定の禁止語・全部のプロジェクトに当たる)。中身は inapp/banned-words.json。app-growth campaigns check と core の push が、件の values の text の全部の言語の文に当て、当たれば誤り banned_word(マニフェストの voice.banned_words と同じ規則名)。英字は大文字と小文字を区別しない。前の app-playbook の check(FORBIDDEN_PHRASES)を移した物", "type": "object", "additionalProperties": false, "required": ["rules"], "properties": { "rules": { "type": "array", "minItems": 1, "items": { "title": "DefaultBannedWordRule", "type": "object", "additionalProperties": false, "required": ["id", "label", "ref", "words", "patterns"], "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9_]{1,40}$" }, "label": { "description": "誤りの文に出す名前", "type": "string", "minLength": 1 }, "ref": { "description": "決まりの元(app-playbook の knowledge の行)", "type": "string", "minLength": 1 }, "words": { "description": "文に含まれたら誤りの語(そのままの部分一致)", "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }, "patterns": { "description": "語で書けない物の正規表現(ECMAScript・フラグ i で当てる)", "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } } } } } } },
56
+ "inapp/campaign.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/campaign.schema.json", "title": "Campaign", "description": "R4 の画面の中のキャンペーンの1件。1件 = 1ファイル(アプリの repo の campaigns/<id>.json)。プロジェクトの中で id が一意。schema_version は 1", "type": "object", "additionalProperties": false, "required": ["schema_version", "id", "type", "status", "title", "purpose", "priority", "platforms", "starts_at", "ends_at", "triggers", "audience", "limits", "layer", "holdout", "show", "on_tap", "goals"], "properties": { "schema_version": { "type": "integer", "const": 1 }, "id": { "$ref": "../common.schema.json#/$defs/campaignId" }, "type": { "$ref": "#/$defs/campaignType" }, "status": { "description": "paused と draft は組に入れない", "enum": ["active", "paused", "draft"] }, "title": { "type": "string", "minLength": 1 }, "purpose": { "type": "string", "minLength": 1 }, "priority": { "type": "integer", "minimum": 0, "maximum": 1000 }, "platforms": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/platform" }, "minItems": 1, "uniqueItems": true }, "requires": { "description": "中身の条件(docs/design/releases.md 6節)。書くのは機能のキー(feature:<key>)だけで足りる。show のプレースメント・triggers と goals の出来事・audience の相手の値(SDK の値を除く)・on_tap の動きは core が足す。core はこれを全部持つビルドのバージョンに絞り、解決した範囲を app_version に書く", "$ref": "../releases/manifest.schema.json#/$defs/requires" }, "exclude_app_versions": { "description": "不具合のあるバージョンを外すときだけ書く。core の知らないバージョンは誤り unknown_app_version", "$ref": "../releases/manifest.schema.json#/$defs/excludeAppVersions" }, "app_version": { "description": "core が組を作るときに requires と exclude_app_versions から解決して書く OS ごとの範囲。件のファイルには書かない(campaigns check と core の push が落とす)。組の件には必ずあり、端末はこの範囲で判定する。書いていない OS には出さない", "$ref": "../releases/manifest.schema.json#/$defs/resolvedAppVersion" }, "channels": { "description": "書かなければ appstore・play だけ", "type": "array", "items": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "minItems": 1, "uniqueItems": true }, "starts_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] }, "ends_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] }, "triggers": { "type": "array", "items": { "$ref": "#/$defs/trigger" }, "minItems": 1 }, "audience": { "anyOf": [{ "$ref": "#/$defs/factCondition" }, { "type": "null" }] }, "limits": { "$ref": "#/$defs/limits" }, "layer": { "description": "holdout の範囲を置くレイヤー。ふつうは件の id。同じレイヤーの実験・件とは位置を共有する。global は製品全体の holdout が使うので書かない", "$ref": "../experiment/experiment.schema.json#/$defs/layer" }, "holdout": { "description": "レイヤーの中の出さない範囲 [from, to)。幅は500まで。割合は幅 ÷ 1000。出さない人を作らない件は null。位置は割り当ての材料の id(実験と同じ)で数える(experiment/holdout.schema.json)", "anyOf": [{ "$ref": "../experiment/holdout.schema.json#/$defs/range" }, { "type": "null" }] }, "show": { "$ref": "#/$defs/show" }, "review": { "description": "件の見直し。全部の件が必ず書く(campaigns check は status が active の件で誤り・ほかは警告)", "$ref": "#/$defs/review" }, "on_tap": { "$ref": "#/$defs/onTap" }, "goals": { "type": "array", "items": { "$ref": "#/$defs/goal" }, "minItems": 1 } }, "$defs": { "scalar": { "title": "Scalar", "type": ["string", "number", "boolean"] }, "list": { "title": "ScalarList", "description": "同じ型の値を1〜50個", "anyOf": [{ "type": "array", "items": { "type": "string" }, "minItems": 1, "maxItems": 50 }, { "type": "array", "items": { "type": "number" }, "minItems": 1, "maxItems": 50 }, { "type": "array", "items": { "type": "boolean" }, "minItems": 1, "maxItems": 50 }] }, "propLeaf": { "title": "PropLeaf", "description": "出来事の中身(props)の値と演算子1つ。値は型付き(common の TypedValue)で届く", "type": "object", "required": ["prop"], "minProperties": 2, "maxProperties": 2, "additionalProperties": false, "properties": { "prop": { "$ref": "../common.schema.json#/$defs/name" }, "eq": { "$ref": "#/$defs/scalar" }, "ne": { "$ref": "#/$defs/scalar" }, "in": { "$ref": "#/$defs/list" }, "not_in": { "$ref": "#/$defs/list" }, "gte": { "type": "number" }, "lte": { "type": "number" }, "exists": { "type": "boolean" } } }, "factLeaf": { "title": "FactLeaf", "description": "相手の状態の値と演算子1つ", "type": "object", "required": ["fact"], "minProperties": 2, "maxProperties": 2, "additionalProperties": false, "properties": { "fact": { "$ref": "../common.schema.json#/$defs/name" }, "eq": { "$ref": "#/$defs/scalar" }, "ne": { "$ref": "#/$defs/scalar" }, "in": { "$ref": "#/$defs/list" }, "not_in": { "$ref": "#/$defs/list" }, "gte": { "type": "number" }, "lte": { "type": "number" }, "exists": { "type": "boolean" } } }, "segmentLeaf": { "title": "SegmentLeaf", "description": "群れの所属(docs/design/remote-screens.md 4節)。端末が保存した自分の群れの id の一覧にあれば当たる。not: true なら、無ければ当たる。知らない群れの id は「入っていない」", "type": "object", "required": ["segment"], "additionalProperties": false, "properties": { "segment": { "$ref": "../segments/segment.schema.json#/$defs/segmentId" }, "not": { "const": true } } }, "propGroup1": { "title": "PropGroup1", "description": "all(and)か any(or)のどちらか1つ。1階層目", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["all"], "properties": { "all": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/propLeaf" }, { "$ref": "#/$defs/propGroup2" }] } } } }, { "type": "object", "additionalProperties": false, "required": ["any"], "properties": { "any": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/propLeaf" }, { "$ref": "#/$defs/propGroup2" }] } } } }] }, "propGroup2": { "title": "PropGroup2", "description": "all(and)か any(or)のどちらか1つ。2階層目", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["all"], "properties": { "all": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/propLeaf" }, { "$ref": "#/$defs/propGroup3" }] } } } }, { "type": "object", "additionalProperties": false, "required": ["any"], "properties": { "any": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/propLeaf" }, { "$ref": "#/$defs/propGroup3" }] } } } }] }, "propGroup3": { "title": "PropGroup3", "description": "all(and)か any(or)のどちらか1つ。3階層目(中は値の条件だけ)", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["all"], "properties": { "all": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/propLeaf" }] } } } }, { "type": "object", "additionalProperties": false, "required": ["any"], "properties": { "any": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/propLeaf" }] } } } }] }, "factGroup1": { "title": "FactGroup1", "description": "all(and)か any(or)のどちらか1つ。1階層目", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["all"], "properties": { "all": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/factLeaf" }, { "$ref": "#/$defs/segmentLeaf" }, { "$ref": "#/$defs/factGroup2" }] } } } }, { "type": "object", "additionalProperties": false, "required": ["any"], "properties": { "any": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/factLeaf" }, { "$ref": "#/$defs/segmentLeaf" }, { "$ref": "#/$defs/factGroup2" }] } } } }] }, "factGroup2": { "title": "FactGroup2", "description": "all(and)か any(or)のどちらか1つ。2階層目", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["all"], "properties": { "all": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/factLeaf" }, { "$ref": "#/$defs/segmentLeaf" }, { "$ref": "#/$defs/factGroup3" }] } } } }, { "type": "object", "additionalProperties": false, "required": ["any"], "properties": { "any": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/factLeaf" }, { "$ref": "#/$defs/segmentLeaf" }, { "$ref": "#/$defs/factGroup3" }] } } } }] }, "factGroup3": { "title": "FactGroup3", "description": "all(and)か any(or)のどちらか1つ。3階層目(中は値の条件だけ)", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["all"], "properties": { "all": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/factLeaf" }, { "$ref": "#/$defs/segmentLeaf" }] } } } }, { "type": "object", "additionalProperties": false, "required": ["any"], "properties": { "any": { "type": "array", "minItems": 1, "items": { "anyOf": [{ "$ref": "#/$defs/factLeaf" }, { "$ref": "#/$defs/segmentLeaf" }] } } } }] }, "propCondition": { "title": "PropCondition", "anyOf": [{ "$ref": "#/$defs/propLeaf" }, { "$ref": "#/$defs/propGroup1" }] }, "factCondition": { "title": "FactCondition", "anyOf": [{ "$ref": "#/$defs/factLeaf" }, { "$ref": "#/$defs/segmentLeaf" }, { "$ref": "#/$defs/factGroup1" }] }, "trigger": { "title": "Trigger", "type": "object", "additionalProperties": false, "required": ["id", "event", "where", "wait_seconds"], "properties": { "id": { "$ref": "../common.schema.json#/$defs/name" }, "event": { "$ref": "../common.schema.json#/$defs/eventName" }, "where": { "anyOf": [{ "$ref": "#/$defs/propCondition" }, { "type": "null" }] }, "wait_seconds": { "description": "アプリが busy(ほかの全画面を出している)の間に待つ上限の秒。出来事から遅らせる長さではない。busy でなければ出来事の直後に出し、busy が解けたらその時に出す。超えたら出さない(busy)。待った後は判定の3〜5(組にあるか・期間・回数)をもう一度通す(C4)", "type": "integer", "minimum": 0, "maximum": 600 } } }, "launchEvent": { "title": "LaunchEvent", "description": "同じ起動の中で前に聞いた出来事の形。where はきっかけと同じ形で、出来事の引数を見る", "type": "object", "additionalProperties": false, "required": ["event", "where"], "properties": { "event": { "$ref": "../common.schema.json#/$defs/eventName" }, "where": { "anyOf": [{ "$ref": "#/$defs/propCondition" }, { "type": "null" }] } } }, "limits": { "title": "CampaignLimits", "type": "object", "additionalProperties": false, "required": ["max_shown", "min_hours_between", "after_dismiss_days", "after_action_days"], "properties": { "max_shown": { "type": "integer", "minimum": 1, "maximum": 20 }, "max_per_app_version": { "description": "同じアプリのバージョンで出す回数の上限。書かなければ決めない(review_ask は 1)", "type": "integer", "minimum": 1, "maximum": 20 }, "min_hours_between": { "type": "number", "minimum": 0 }, "after_dismiss_days": { "type": "number", "minimum": 0 }, "after_action_days": { "anyOf": [{ "type": "number", "minimum": 0 }, { "type": "null" }] }, "not_after_in_launch": { "description": "同じ起動の中で、この出来事を聞いた後は出さない(limited:not_after_in_launch)。書かなければ決めない。review_ask は問い合わせ・エラー・ペイウォールを閉じた、survey はペイウォールを閉じた(paywall_closed)を入れる", "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/launchEvent" } } } }, "text": { "title": "LocalizedText", "description": "言語ごとの文", "type": "object", "minProperties": 1, "propertyNames": { "$ref": "../common.schema.json#/$defs/langTag" }, "additionalProperties": { "type": "string", "minLength": 1 } }, "image": { "title": "CampaignImage", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["asset"], "properties": { "asset": { "$ref": "../common.schema.json#/$defs/name" } } }, { "type": "object", "additionalProperties": false, "required": ["url", "width", "height"], "properties": { "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" }, "width": { "type": "integer", "minimum": 1 }, "height": { "type": "integer", "minimum": 1 } } }] }, "value": { "title": "PlacementValue", "description": "型(text・image・int・bool・string)はマニフェストのプレースメントの fields が決める。文字列の欄には { \"param\": \"<key>\" } でパラメーターの参照を書ける(docs/design/experimentation.md 7.3節)", "anyOf": [{ "$ref": "#/$defs/text" }, { "$ref": "#/$defs/image" }, { "type": "integer" }, { "type": "boolean" }, { "type": "string" }, { "$ref": "../experiment/experiment.schema.json#/$defs/paramRef" }] }, "show": { "title": "CampaignShow", "type": "object", "additionalProperties": false, "required": ["placement", "values"], "properties": { "placement": { "$ref": "../common.schema.json#/$defs/name" }, "values": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/value" } }, "text_key": { "description": "アプリの文字の表のキーの頭。text の値は、言語そのまま → 言語の頭 → アプリの表の <text_key>.<値の名前> の順に選ぶ。text_key があれば、必須の text の値を values に書かなくてよい(読んだときに捨てず、選ぶときに表に無ければ missing_locale)。text でない値は text_key があっても必須(C5)", "type": "string", "pattern": "^[A-Za-z0-9_.-]{1,80}$" } } }, "onTap": { "title": "CampaignOnTap", "description": "主のボタンの動き。プレースメントの kind が system なら、出した時にすぐ動かす(タップは無い)", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["action", "args"], "properties": { "action": { "$ref": "../common.schema.json#/$defs/name" }, "args": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "../common.schema.json#/$defs/typedValue" } } } }, { "type": "object", "additionalProperties": false, "required": ["link"], "properties": { "link": { "$ref": "../common.schema.json#/$defs/httpsUrl" } } }] }, "goal": { "title": "CampaignGoal", "type": "object", "additionalProperties": false, "required": ["event", "within_hours"], "properties": { "event": { "$ref": "../common.schema.json#/$defs/eventName" }, "where": { "anyOf": [{ "$ref": "#/$defs/propCondition" }, { "type": "null" }] }, "within_hours": { "type": "number", "exclusiveMinimum": 0 } } }, "campaignType": { "title": "CampaignType", "description": "型。custom 以外は schema/inapp/templates/<型>.json に既定のプレースメント・動き・確かめがある", "enum": ["trial_offer", "review_ask", "cross_promo", "survey", "custom"] }, "review": { "title": "CampaignReview", "description": "件の見直し。review_by を過ぎた・14日誰にも出ていない・stop_if に当たった件を、core の日に1回の Cron が console のアラートに出す(docs/design/campaigns.md 11節)", "type": "object", "additionalProperties": false, "required": ["review_by", "stop_if"], "properties": { "review_by": { "description": "見直す日(Asia/Tokyo の日付)", "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" }, "stop_if": { "$ref": "#/$defs/stopIf" } } }, "stopIf": { "title": "CampaignStopIf", "description": "止める条件。件を初めて送ってからの出した数(campaign_shown)が shown_gte 以上で、タップ(campaign_tapped)が taps_lte 以下なら当たり。数は直近90日の時間ごとの数(inapp_event_hour)", "type": "object", "additionalProperties": false, "required": ["shown_gte", "taps_lte"], "properties": { "shown_gte": { "type": "integer", "minimum": 1 }, "taps_lte": { "type": "integer", "minimum": 0 } } } } },
57
+ "inapp/case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/case.schema.json", "title": "InappCase", "description": "schema/cases/inapp/*.json の1つの判定の表。SDK(Swift・Kotlin)と CLI の check が同じ表を読む。読み方は schema/README.md と docs/contracts.md", "type": "object", "additionalProperties": false, "required": ["description", "manifest", "context", "person", "fetched_at", "now", "history", "facts", "texts", "images_ready", "event", "expect"], "oneOf": [{ "required": ["set"] }, { "required": ["set_raw"] }], "properties": { "description": { "type": "string", "minLength": 1 }, "manifest": { "description": "cases/inapp/manifests/<名前>.json", "type": "string", "pattern": "^[a-z0-9-]+$" }, "set": { "description": "組。わざと壊した物もあるので形はここで決めない(expect.set_schema_valid が答え)", "type": "object" }, "set_raw": { "description": "文字列のまま読む組(壊れた JSON を試す)", "type": "string" }, "context": { "title": "CaseContext", "type": "object", "additionalProperties": false, "required": ["platform", "app_version", "build", "channel", "lang", "region", "time_zone", "internal_device", "days_since_first_seen"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "type": "string" }, "channel": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "region": { "type": "string" }, "time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "internal_device": { "type": "boolean" }, "days_since_first_seen": { "type": "integer", "minimum": 0 }, "session_seconds": { "type": "integer", "minimum": 0 } } }, "person": { "description": "製品全体の holdout に使う人の id(R2 の person_id)。assignment が無ければ、件の holdout の位置もこの id で数える", "type": "string", "minLength": 1 }, "assignment": { "description": "案の割り当ての材料。書かなければ person を install_id として使う", "$ref": "../experiment/variant.schema.json#/$defs/assignment" }, "segments": { "description": "端末が保存した自分の群れの id。書かなければどの群れにも入っていない", "type": "array", "items": { "$ref": "../segments/segment.schema.json#/$defs/segmentId" } }, "fetched_at": { "$ref": "../common.schema.json#/$defs/isoTime" }, "now": { "$ref": "../common.schema.json#/$defs/isoTime" }, "history": { "$ref": "#/$defs/history" }, "facts": { "description": "相手の値。無い名前は取れなかった", "type": "object", "additionalProperties": { "$ref": "../common.schema.json#/$defs/typedValue" } }, "texts": { "description": "アプリの文字の表(<text_key>.<値の名前> → 端末の言語の文)", "type": "object", "additionalProperties": { "type": "string" } }, "params": { "description": "SDK が中核(config の ConfigSession)で決めたパラメーターの値。件の値の { \"param\": \"<key>\" } をこれで置き換える。text は端末の言語で選んだ文。無いキーは値が無い物として扱う(docs/design/experimentation.md 7.3節)", "type": "object", "propertyNames": { "$ref": "../experiment/experiment.schema.json#/$defs/paramKey" }, "additionalProperties": { "type": ["string", "integer", "boolean"] } }, "images_ready": { "type": "array", "items": { "type": "string" } }, "sides": { "description": "この端末で前に決まった holdout の側(campaign の id → 側)。書かない時は空。決まった側は組の holdout の範囲が変わっても変わらない", "type": "object", "additionalProperties": { "enum": ["treatment", "holdout"] } }, "event": { "$ref": "event.schema.json" }, "wait": { "title": "CaseWait", "description": "C4。出来事の後、アプリが busy_seconds の間 busy(ほかの全画面を出している)。busy_seconds が当たったきっかけの wait_seconds 以下なら、now + busy_seconds の時点で判定の3〜5をもう一度通す。set・history を書けば、その時点で SDK が持つ組と回数の記録", "type": "object", "additionalProperties": false, "required": ["busy_seconds"], "properties": { "busy_seconds": { "type": "integer", "minimum": 0 }, "set": { "type": "object" }, "history": { "$ref": "#/$defs/history" } } }, "expect": { "title": "CaseExpect", "type": "object", "additionalProperties": false, "required": ["show", "trigger", "outcomes", "records"], "properties": { "set_schema_valid": { "type": "boolean" }, "show": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/campaignId" }, { "type": "null" }] }, "trigger": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/name" }, { "type": "null" }] }, "values": { "description": "プレースメントに渡す値(言語を選んだ後。案のある件は、選んだ案の値を重ねた後)", "type": "object" }, "outcomes": { "type": "object", "additionalProperties": { "$ref": "#/$defs/outcome" } }, "records": { "type": "array", "items": { "$ref": "events.schema.json#/$defs/decisionRecord" } }, "server_facts_read": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/name" } }, "trace": { "description": "判定の跡(任意)。組の件ごとに1つ、組に書いた順の配列。SDK は件を組の順に見て跡を1つずつ足すので、作った配列をそのまま expect.trace と等しいか比べればよい(id の表にすると、並べ直してから比べる手間と、件の id を2か所に書く重なりが増える)。書くなら outcomes の件の全部の跡を書く。時刻は時刻として比べる", "type": "array", "minItems": 1, "items": { "$ref": "trace.schema.json" } } } } }, "$defs": { "history": { "title": "CaseHistory", "type": "object", "additionalProperties": false, "required": ["session_shown", "shown_at", "campaigns"], "properties": { "session_shown": { "type": "integer", "minimum": 0 }, "launch_events": { "description": "この起動で、今の出来事より前に聞いた出来事(古い順)。件の limits.not_after_in_launch と比べる。書かなければ空", "type": "array", "items": { "$ref": "event.schema.json" } }, "shown_at": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/isoTime" } }, "campaigns": { "type": "object", "additionalProperties": { "title": "CaseCampaignHistory", "description": "shown_count・last_shown_at・shown_by_app_version は出さない側だった回も数える", "type": "object", "additionalProperties": false, "properties": { "shown_count": { "type": "integer", "minimum": 0 }, "last_shown_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] }, "shown_by_app_version": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } }, "dismissed_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] }, "action_completed_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] } } } } } }, "outcome": { "title": "CaseOutcome", "description": "件ごとの結果。段階は docs/contracts.md の判定の順番", "type": "string", "pattern": "^(stale|rejected:(parse_error|schema_too_new|invalid|unknown_placement|unknown_action|unknown_asset|unknown_fact|unknown_operator|unknown_target|missing_value|unknown_value|type_mismatch)|inactive:(status|platform|app_version|channel|not_started|ended)|no_trigger|limited:(max_shown|max_per_app_version|min_hours_between|after_dismiss|after_action|not_after_in_launch|max_per_session|max_per_day)|audience|fact_unavailable|global_holdout|held_out|lower_priority|missing_locale|image_not_ready|busy|withdrawn|show)$" } } },
58
+ "inapp/check-case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/check-case.schema.json", "title": "CheckCase", "description": "schema/cases/check/*.json の1つの check の表。件のフォルダ・R1 の campaign_policy・core が持つバージョンとマニフェストの中身を渡したときに app-growth campaigns check が出す誤りと警告の規則。core の push の確かめ(campaign_policy・requires の解決)も同じ表を読む。カタログは件のきっかけと成果の出来事を全部ある物とする", "type": "object", "additionalProperties": false, "required": ["description", "manifest", "campaign_policy", "releases", "campaigns", "expect"], "properties": { "description": { "type": "string", "minLength": 1 }, "manifest": { "description": "cases/inapp/manifests/<名前>.json", "type": "string", "pattern": "^[a-z0-9-]+$" }, "campaign_policy": { "description": "R1 のプロジェクトの campaign_policy。null は R1 を読めないとき(Access のキーが無い check)", "anyOf": [{ "$ref": "../registry/project.schema.json#/properties/campaign_policy" }, { "type": "null" }] }, "releases": { "title": "CheckCaseReleases", "description": "core が持つバージョン(OS ごと)。requires の解決(packages/campaign-rules の resolveRequires)に渡す。null は core を読めない check(Access のキーが無い)", "anyOf": [{ "type": "object", "additionalProperties": false, "properties": { "ios": { "$ref": "#/$defs/releaseList" }, "android": { "$ref": "#/$defs/releaseList" } } }, { "type": "null" }] }, "campaigns": { "description": "件のフォルダの件(1件で1ファイル)", "type": "array", "items": { "$ref": "campaign.schema.json" } }, "expect": { "title": "CheckCaseExpect", "type": "object", "additionalProperties": false, "required": ["errors", "warnings"], "properties": { "errors": { "description": "誤りの規則(rule)。順は問わない・同じ規則が2つなら2回書く", "type": "array", "items": { "type": "string" } }, "warnings": { "description": "警告の規則", "type": "array", "items": { "type": "string" } } } } }, "$defs": { "releaseList": { "title": "CheckCaseReleaseList", "type": "array", "items": { "$ref": "#/$defs/release" } }, "release": { "title": "CheckCaseRelease", "description": "core の知っているバージョン1つ。store_state はストアの状態で、null はマニフェストだけがあってストアにまだ無い。capabilities はマニフェストの中身の行で、null は中身が分からない(マニフェストが無い)。campaign_sdk はマニフェストの campaign SDK の版で、null は分からないか入っていない", "type": "object", "additionalProperties": false, "required": ["version", "store_state", "capabilities", "campaign_sdk"], "properties": { "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "store_state": { "anyOf": [{ "$ref": "../releases/admin.schema.json#/$defs/storeState" }, { "type": "null" }] }, "capabilities": { "anyOf": [{ "type": "array", "uniqueItems": true, "items": { "$ref": "../releases/manifest.schema.json#/$defs/capability" } }, { "type": "null" }] }, "campaign_sdk": { "anyOf": [{ "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" }, { "type": "null" }] } } } } },
59
+ "inapp/event.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/event.schema.json", "title": "ObservedEvent", "description": "端末の SDK が受ける出来事(C6)。アプリは計測(swift-analytics)に1回撃つだけで、同じ出来事が型付きのまま SDK にも届く。値を文字列にして渡さない。campaign で始まる出来事はきっかけにしない", "type": "object", "additionalProperties": false, "required": ["name", "props"], "properties": { "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "props": { "$ref": "../common.schema.json#/$defs/typedProps" } } },
60
+ "inapp/events.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/events.schema.json", "title": "CampaignEvent", "description": "R4 の SDK が作ってアプリの計測に渡す出来事(共通のカタログに入れる)。SDK は送らない(送るのはアプリの計測)。値は型付きのまま", "oneOf": [{ "$ref": "#/$defs/eligible" }, { "$ref": "#/$defs/skipped" }, { "$ref": "#/$defs/rejected" }, { "$ref": "#/$defs/stale" }, { "$ref": "#/$defs/shown" }, { "$ref": "#/$defs/tapped" }, { "$ref": "#/$defs/dismissed" }, { "$ref": "#/$defs/actionCompleted" }, { "$ref": "#/$defs/appUpdated" }, { "$ref": "#/$defs/loaded" }, { "$ref": "#/$defs/surveyAnswered" }], "$defs": { "rejectReason": { "title": "RejectReason", "description": "campaign_rejected の理由。parse_error と schema_too_new は組(_set)だけ", "enum": ["parse_error", "schema_too_new", "invalid", "unknown_placement", "unknown_action", "unknown_asset", "unknown_fact", "unknown_operator", "unknown_target", "missing_value", "unknown_value", "type_mismatch"] }, "skipReason": { "title": "SkipReason", "description": "campaign_skipped の理由。withdrawn は待っている間に件が組から消えた(C4)", "enum": ["busy", "lower_priority", "missing_locale", "image_not_ready", "fact_unavailable", "withdrawn"] }, "eligible": { "title": "CampaignEligibleEvent", "description": "判定の8(holdout)まで全部の条件を通った。出す側(treatment)も出さない側(holdout)も1回ずつ。成果の比べはこの人たちで数える", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaign_eligible" }, "params": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "trigger", "side"], "properties": { "campaign": { "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "set_version": { "type": "integer", "minimum": 0 }, "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "side": { "enum": ["treatment", "holdout"] }, "propensity": { "$ref": "../common.schema.json#/$defs/propensity" }, "policy_version": { "$ref": "../common.schema.json#/$defs/policyVersion" } } } } }, "skipped": { "title": "CampaignSkippedEvent", "description": "出す側で条件は通ったが出さなかった", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaign_skipped" }, "params": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "trigger", "reason"], "properties": { "campaign": { "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "set_version": { "type": "integer", "minimum": 0 }, "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "reason": { "$ref": "#/$defs/skipReason" } } } } }, "rejected": { "title": "CampaignRejectedEvent", "description": "件か組を読めなかった・使えなかった(件の id・組のバージョン・理由ごとに1回)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaign_rejected" }, "params": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "reason"], "properties": { "campaign": { "description": "件の id。組なら _set、id が読めない件は _invalid", "type": "string", "pattern": "^([a-z0-9-]{3,40}|_set|_invalid)$" }, "set_version": { "type": "integer", "minimum": 0 }, "reason": { "$ref": "#/$defs/rejectReason" } } } } }, "stale": { "title": "CampaignsStaleEvent", "description": "手元の組が cache_hours を過ぎた(1回)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaigns_stale" }, "params": { "type": "object", "additionalProperties": false, "required": ["set_version", "hours"], "properties": { "set_version": { "type": "integer", "minimum": 0 }, "hours": { "type": "integer", "minimum": 0 } } } } }, "shown": { "title": "CampaignShownEvent", "description": "プレースメントに出した(system の kind は動きを動かした)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaign_shown" }, "params": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "trigger", "placement"], "properties": { "campaign": { "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "set_version": { "type": "integer", "minimum": 0 }, "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "placement": { "$ref": "../common.schema.json#/$defs/name" } } } } }, "tapped": { "title": "CampaignTappedEvent", "description": "主のボタンをタップした(system の kind は記録しない)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaign_tapped" }, "params": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "trigger", "target"], "properties": { "campaign": { "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "set_version": { "type": "integer", "minimum": 0 }, "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "target": { "enum": ["action", "link"] } } } } }, "dismissed": { "title": "CampaignDismissedEvent", "description": "閉じた", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaign_dismissed" }, "params": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "trigger", "via"], "properties": { "campaign": { "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "set_version": { "type": "integer", "minimum": 0 }, "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "via": { "enum": ["secondary", "close_button", "swipe_down", "outside"] } } } } }, "actionCompleted": { "title": "CampaignActionCompletedEvent", "description": "登録した動きが終わった・リンクを開いた", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaign_action_completed" }, "params": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "trigger", "action", "result"], "properties": { "campaign": { "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "set_version": { "type": "integer", "minimum": 0 }, "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "action": { "description": "動きの名前か link", "$ref": "../common.schema.json#/$defs/name" }, "result": { "enum": ["completed", "failed", "cancelled"] } } } } }, "loaded": { "title": "CampaignsLoadedEvent", "description": "campaigns_loaded(K2-1)。端末が組を読み直した結果が前と違うときだけ1回(同じ version の 304 が続いても記録しない)。起動の最初の1回は必ず。サーバーの set_served と照らして、どの端末がどの version で判定したかを確かめる(docs/testing-and-verification.md 4.3節)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "campaigns_loaded" }, "params": { "type": "object", "additionalProperties": false, "required": ["set_version", "result", "age_seconds"], "properties": { "set_version": { "description": "SDK が今持つ組の version。何も無い(none)なら 0", "type": "integer", "minimum": 0 }, "result": { "title": "CampaignsLoadResult", "description": "fetched 新しい組を取れた・not_modified 304・cached 取れず手元の組を使う・none 取れず手元にも無い", "enum": ["fetched", "not_modified", "cached", "none"] }, "age_seconds": { "description": "今持つ組を最後に取れてからの秒(none は 0)", "type": "integer", "minimum": 0 } } } } }, "appUpdated": { "title": "AppUpdatedEvent", "description": "バージョンが上がった最初の起動。SDK が出す。起動の出来事なので件のきっかけにはできない", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "app_updated" }, "params": { "type": "object", "additionalProperties": false, "required": ["from_version", "to_version"], "properties": { "from_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "to_version": { "$ref": "../common.schema.json#/$defs/appVersion" } } } } }, "decisionRecord": { "title": "DecisionRecord", "description": "判定が作る計測(cases の expect.records)。出す・押す・閉じるはアプリの見た目が渡すので入らない", "oneOf": [{ "$ref": "#/$defs/eligible" }, { "$ref": "#/$defs/skipped" }, { "$ref": "#/$defs/rejected" }, { "$ref": "#/$defs/stale" }] }, "surveyAnswered": { "title": "SurveyAnsweredEvent", "description": "型 survey の件で答えを選んだ(submit_answer)。文を書いたかは持たない(文は POST /v1/support/feedback)。どの件もきっかけにしない(survey.not_a_condition)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "survey_answered" }, "params": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "choice"], "properties": { "campaign": { "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "set_version": { "type": "integer", "minimum": 0 }, "choice": { "description": "選んだ答え。choice_1〜choice_6 の名前か、scale の件は 0〜10 の数(support/feedback.schema.json の SurveyChoice と同じ)", "type": "string", "pattern": "^(choice_[1-6]|[0-9]|10)$" } } } } } } },
61
+ "inapp/manifest.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/manifest.schema.json", "title": "CampaignManifest", "description": "アプリの repo の campaigns/manifest.json。アプリ(と SDK の型)が登録したプレースメント・画像・動き・相手の値を書く。check と SDK の確かめがこれを読む", "type": "object", "additionalProperties": false, "required": ["project", "placements", "assets", "actions", "facts", "link_hosts"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "placements": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/placement" } }, "assets": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "type": "object", "additionalProperties": false, "required": ["since"], "properties": { "since": { "$ref": "#/$defs/since" } } } }, "actions": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/action" } }, "facts": { "description": "アプリの相手の値。SDK の値(platform・app_version・build・channel・lang・region・days_since_first_seen・session_seconds・version_age_days)は書かない", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/fact" } }, "link_hosts": { "type": "array", "items": { "type": "string", "pattern": "^[a-z0-9.-]+$" }, "uniqueItems": true }, "voice": { "title": "ManifestVoice", "description": "製品の言葉の決まり。check が件の文(values の text)を見る", "type": "object", "additionalProperties": false, "required": ["banned_words"], "properties": { "banned_words": { "description": "言語ごとの、この製品の文に書かない語(ごほうび習慣の ja なら「ポイント」「稼ぐ」)。言語の頭(zh)の語は zh-Hant・zh-Hans の文にも当てる。英字は大文字と小文字を区別しない。含まれたら誤り", "type": "object", "minProperties": 1, "propertyNames": { "$ref": "../common.schema.json#/$defs/langTag" }, "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1, "uniqueItems": true } } } } }, "$defs": { "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" }, "since": { "title": "ManifestSince", "description": "その物が入ったアプリのバージョン。OS ごと", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "ios": { "$ref": "#/$defs/version" }, "android": { "$ref": "#/$defs/version" } } }, "valueType": { "title": "PlacementFieldType", "enum": ["text", "image", "int", "bool", "string"] }, "argType": { "title": "ActionArgType", "enum": ["string", "int", "number", "bool"] }, "field": { "title": "PlacementField", "type": "object", "additionalProperties": false, "required": ["type", "required"], "properties": { "type": { "$ref": "#/$defs/valueType" }, "required": { "type": "boolean" }, "max_chars": { "type": "integer", "minimum": 1 } } }, "placementKind": { "title": "PlacementKind", "description": "modal はアプリ(か SDK の型)の見た目で出す1枚。sheet は画面の下から出す半分の高さの1枚(survey のアンケート。閉じても元の画面がそのまま見える)。system は見た目を持たず、出した時に on_tap の動きをすぐ動かす(review_ask の OS の評価の窓)。inline・web は作らない", "enum": ["modal", "sheet", "system", "inline", "web"] }, "placementBody": { "title": "PlacementBody", "description": "プレースメントの形(since を除く)。型のテンプレートもこの形で書く", "type": "object", "additionalProperties": false, "required": ["kind", "fields"], "properties": { "kind": { "$ref": "#/$defs/placementKind" }, "fields": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/field" } } } }, "placement": { "title": "ManifestPlacement", "type": "object", "additionalProperties": false, "required": ["kind", "since", "fields"], "properties": { "kind": { "$ref": "#/$defs/placementKind" }, "since": { "$ref": "#/$defs/since" }, "template": { "description": "型の既定のプレースメントを使う。kind と fields はテンプレートと同じでなければならない", "$ref": "campaign.schema.json#/$defs/campaignType" }, "fields": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/field" } } } }, "actionArgs": { "title": "ActionArgs", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "type": "object", "additionalProperties": false, "required": ["type", "required"], "properties": { "type": { "$ref": "#/$defs/argType" }, "required": { "type": "boolean" } } } }, "action": { "title": "ManifestAction", "type": "object", "additionalProperties": false, "required": ["since", "args"], "properties": { "since": { "$ref": "#/$defs/since" }, "template": { "description": "型の既定の動きを使う。args はテンプレートと同じでなければならない", "$ref": "campaign.schema.json#/$defs/campaignType" }, "args": { "$ref": "#/$defs/actionArgs" } } }, "fact": { "title": "ManifestFact", "type": "object", "additionalProperties": false, "required": ["type", "source", "since"], "properties": { "type": { "enum": ["bool", "int", "number", "string"] }, "source": { "description": "device はアプリが端末で渡す。server はアプリ自身のサーバーへの問い合わせ(ほかの条件が全部通った後にだけ聞く)", "enum": ["device", "server"] }, "since": { "$ref": "#/$defs/since" }, "mirror": { "title": "ManifestFactMirror", "description": "core にあるこの値のコピー(K2-4)。simulate・explain が端末と同じ判定を core の中で回すときに読む。trait は people_trait の名前、person は people_person の列。書かない値は simulate で「分からない」に数える。使えるのは type が bool・int・number の値と、決まった選択肢の string(人の書いた文を入れない)", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["trait"], "properties": { "trait": { "$ref": "../common.schema.json#/$defs/name" } } }, { "type": "object", "additionalProperties": false, "required": ["person"], "properties": { "person": { "enum": ["subscription", "platform", "app_version", "channel", "lang", "region", "promotional_consent", "first_seen_at", "last_open_at", "last_notification_open_at"] } } }] } } } } },
62
+ "inapp/personas.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/personas.schema.json", "title": "CampaignPersonas", "description": "1件の判定を、名前の付いた人(ペルソナ)で確かめる表(docs/testing-and-verification.md 4.2節)。アプリの repo の campaigns/<件の id>.personas.json に件と並べて置く。app-growth campaigns check(TypeScript)と、アプリの repo の PersonaRunner(Swift・Kotlin)が同じ物を回す。件を書いた AI が同じ PR で書く", "type": "object", "additionalProperties": false, "required": ["campaign", "personas"], "properties": { "campaign": { "description": "確かめる件の id。同じフォルダの <id>.json", "$ref": "../common.schema.json#/$defs/campaignId" }, "personas": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/persona" } } }, "$defs": { "persona": { "title": "CampaignPersona", "description": "1人分。書かない項目はマニフェストとプロジェクトの既定(context は ios・最新のバージョン・appstore・ja、facts は空(全部取れない)、history は空、side はハッシュのまま)。person_id は name から作るので、side を書かなければ name のハッシュで側が決まり、期待もそれに合わせる。events を順に流し、各出来事の時刻は回す側が決める始まりの時刻 + after_seconds。前の出来事で出した物は回数の記録に入る", "type": "object", "additionalProperties": false, "required": ["name", "events", "expect"], "properties": { "name": { "description": "読む人に分かる名前。ファイルの中で重ならない", "type": "string", "minLength": 1, "maxLength": 80 }, "context": { "$ref": "#/$defs/context" }, "facts": { "description": "相手の値。無い名前は取れなかった(device・server とも)", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "../common.schema.json#/$defs/typedValue" } }, "history": { "$ref": "#/$defs/history" }, "side": { "description": "holdout の側をこれに固定する(ペルソナが読みやすいように)", "enum": ["treatment", "holdout"] }, "events": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/event" } }, "expect": { "$ref": "#/$defs/expect" } } }, "context": { "title": "PersonaContext", "description": "端末の文脈。判定の表の CaseContext と同じ項目で、どれも書かなくてよい", "type": "object", "additionalProperties": false, "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "type": "string" }, "channel": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "region": { "type": "string" }, "time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "internal_device": { "type": "boolean" }, "days_since_first_seen": { "type": "integer", "minimum": 0 }, "session_seconds": { "type": "integer", "minimum": 0 }, "version_age_days": { "description": "今のバージョンが公開されてからの日数(SDK の値 version_age_days)。書けば組の releases に今のバージョンをその日数前の公開として入れる。書かなければ取れない値になる", "type": "integer", "minimum": 0 } } }, "history": { "title": "PersonaHistory", "description": "回数の記録。判定の表の CaseHistory と同じ項目で、どれも書かなくてよい(書かなければ 0・空)", "type": "object", "additionalProperties": false, "properties": { "session_shown": { "$ref": "case.schema.json#/$defs/history/properties/session_shown" }, "shown_at": { "$ref": "case.schema.json#/$defs/history/properties/shown_at" }, "campaigns": { "$ref": "case.schema.json#/$defs/history/properties/campaigns" } } }, "event": { "title": "PersonaEvent", "description": "流す出来事1つ。props の値は型付き(ObservedEvent と同じ)", "type": "object", "additionalProperties": false, "required": ["after_seconds", "name", "props"], "properties": { "after_seconds": { "description": "始まりの時刻からの秒。前の出来事より小さくしない", "type": "integer", "minimum": 0 }, "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "props": { "$ref": "../common.schema.json#/$defs/typedProps" } } }, "expect": { "title": "PersonaExpect", "description": "期待。outcome・trigger・stopped_at は最後の出来事の判定のこの件の結果。records は全部の出来事を通してこの件について出た判定の記録(DecisionRecord)を順に", "type": "object", "additionalProperties": false, "required": ["outcome"], "properties": { "outcome": { "$ref": "case.schema.json#/$defs/outcome" }, "trigger": { "description": "当たったきっかけの id(判定の跡の trigger の detail.trigger)", "$ref": "../common.schema.json#/$defs/name" }, "stopped_at": { "description": "判定の跡で止まった条件の道(CampaignTrace の TraceLeafMiss・TraceAnyMiss の path)。audience・fact_unavailable・no_trigger(where_failed)の時だけ書ける。outcome だけでなく、どの条件で落ちたかまで確かめるので、別の条件で偶然落ちたのを見逃さない", "$ref": "trace.schema.json#/$defs/conditionPath" }, "records": { "type": "array", "items": { "$ref": "events.schema.json#/$defs/decisionRecord" } } } } } },
63
+ "inapp/policy.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/policy.schema.json", "title": "CampaignPolicy", "description": "製品をまたぐ決まり(組の policy)。書かなかった項目は、端末が max_per_session 1・max_per_day 1・cache_hours 72 として読む", "type": "object", "additionalProperties": false, "properties": { "max_per_session": { "type": "integer", "minimum": 1, "maximum": 10, "default": 1 }, "max_per_day": { "type": "integer", "minimum": 1, "maximum": 10, "default": 1 }, "cache_hours": { "type": "number", "exclusiveMinimum": 0, "maximum": 720, "default": 72 }, "global_holdout": { "description": "R10 の製品全体の holdout(experiment/holdout.schema.json の global。レイヤー global の [0, 50))を当てる。当たった人には件を全部出さない。書かなければ false(docs/design/personalization.md 4.2節)", "type": "boolean", "default": false } } },
64
+ "inapp/screen-campaign.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/screen-campaign.schema.json", "title": "ScreenCampaign", "description": "R4 のキャンペーンの型 screen(campaigns/<id>.json の type が screen の物)。プレースメントで、オーディエンスに当たった人に1つの画面を出す。画面の案は、画面の id を値に持つパラメーター(型 string)を変える実験で書き、screen に { \"param\": \"<key>\" } を書く(docs/design/experimentation.md 7.3節)。判定の順は R4 の4節のまま(きっかけ=プレースメント)。組では campaigns と別の screen_campaigns に入る(docs/design/remote-screens.md 1節)", "type": "object", "additionalProperties": false, "required": ["schema_version", "id", "type", "status", "title", "purpose", "priority", "platforms", "starts_at", "ends_at", "placements", "audience", "limits", "layer", "holdout", "screen", "review"], "properties": { "schema_version": { "type": "integer", "const": 1 }, "id": { "$ref": "../common.schema.json#/$defs/campaignId" }, "type": { "const": "screen" }, "status": { "description": "paused と draft は組に入れない", "enum": ["active", "paused", "draft"] }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "purpose": { "type": "string", "minLength": 1, "maxLength": 500 }, "priority": { "description": "同じプレースメントで当たったキャンペーンの順(大きい方が先)", "type": "integer", "minimum": 0, "maximum": 1000 }, "platforms": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/platform" } }, "channels": { "description": "書かなければ appstore・play だけ。TestFlight・Play の内部テスト・debug のビルドで確かめるときは足す", "type": "array", "items": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "minItems": 1, "uniqueItems": true }, "starts_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] }, "ends_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] }, "placements": { "description": "出すプレースメント(config/manifest.json の placements の名前)。アプリがこの名前で register を呼んだ時がきっかけ", "type": "array", "minItems": 1, "maxItems": 10, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "audience": { "description": "だれに出すか。端末の値の条件と群れの所属({ segment, not? }。群れの条件の形は schema/segments の担当)。null は全員", "anyOf": [{ "type": "object" }, { "type": "null" }] }, "limits": { "$ref": "campaign.schema.json#/$defs/limits" }, "layer": { "description": "holdout の範囲を置くレイヤー。ふつうは件の id", "$ref": "../experiment/experiment.schema.json#/$defs/layer" }, "holdout": { "description": "レイヤーの中の出さない範囲 [from, to)(アプリの組み込みの画面)。幅は500まで。出さない人を作らない件は null", "anyOf": [{ "$ref": "../experiment/holdout.schema.json#/$defs/range" }, { "type": "null" }] }, "screen": { "description": "出す画面の id か、画面の id を値に持つパラメーターの参照", "anyOf": [{ "$ref": "../screens/screen.schema.json#/$defs/screenId" }, { "$ref": "../experiment/experiment.schema.json#/$defs/paramRef" }] }, "review": { "description": "見直し(review_by と stop_if)。形は件の見直しの schema が決める", "type": "object" }, "app_version": { "description": "core が解決して書く。送る本文には書かない", "$ref": "../releases/manifest.schema.json#/$defs/resolvedAppVersion" } } },
65
+ "inapp/set.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/set.schema.json", "title": "CampaignSet", "description": "キャンペーンの組。端末が GET /v1/campaigns/sets/<public_key>(api.appgrowstack.com)で読む。プロジェクトの全員に同じ物を返す", "type": "object", "additionalProperties": false, "required": ["schema_version", "project", "version", "published_at", "policy", "targets", "campaigns", "releases"], "properties": { "schema_version": { "type": "integer", "const": 1 }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "version": { "description": "プロジェクトごとに送るたびに1ずつ上がる。ETag は \"v<version>\"", "type": "integer", "minimum": 0 }, "published_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "policy": { "$ref": "policy.schema.json" }, "targets": { "description": "cross_promo の件が紹介する製品。組を作るときに core が R1 から写す(件の open_store_page の target はここにある物だけ)", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/projectId" }, "additionalProperties": { "$ref": "#/$defs/target" } }, "campaigns": { "description": "組の件。件のファイルの中身に、core が requires と exclude_app_versions から解決した app_version を足した物(docs/design/releases.md 6.2節)", "type": "array", "items": { "allOf": [{ "$ref": "campaign.schema.json" }, { "type": "object", "required": ["app_version"] }] } }, "releases": { "description": "OS ごとの、公開したバージョンの新しい方から20個と公開の時刻(docs/design/releases.md 7.4節)。core が組を作るときに releases_version から写す。公開したバージョンの無い OS は書かない", "type": "object", "additionalProperties": false, "properties": { "ios": { "$ref": "#/$defs/releaseList" }, "android": { "$ref": "#/$defs/releaseList" } } }, "screen_campaigns": { "description": "型 screen のキャンペーン(docs/design/remote-screens.md 1節)。件のファイルに core が app_version を足した物。書かなければ空", "type": "array", "maxItems": 100, "items": { "allOf": [{ "$ref": "screen-campaign.schema.json" }, { "type": "object", "required": ["app_version"] }] } }, "screens": { "description": "型 screen のキャンペーンの案が指す画面(id → バンドル)。端末は組を取った時に全部のバンドルを先に取り、sha256 を確かめて保存する。書かなければ空", "type": "object", "maxProperties": 100, "propertyNames": { "$ref": "../screens/screen.schema.json#/$defs/screenId" }, "additionalProperties": { "$ref": "../screens/screen.schema.json#/$defs/bundle" } }, "pricing": { "title": "CampaignSetPricing", "description": "値段の段階 → Offering(docs/design/remote-screens.md 4節)。端末は割り当てた段階の Offering の商品を products にする。書かなければアプリの既定の Offering", "type": "object", "additionalProperties": false, "required": ["tiers"], "properties": { "tiers": { "type": "array", "maxItems": 10, "items": { "title": "CampaignPriceTier", "type": "object", "additionalProperties": false, "required": ["id", "offering"], "properties": { "id": { "$ref": "../common.schema.json#/$defs/name" }, "offering": { "description": "RevenueCat の Offering の id", "type": "string", "minLength": 1, "maxLength": 100 }, "default": { "description": "どの段階にも当たらない人の段階(1つだけ)", "type": "boolean" } } } } } }, "key_id": { "description": "署名したキーの id。core に署名のキーが無い時(手元の試し)は無い", "$ref": "../common.schema.json#/$defs/setKeyId" }, "signature": { "description": "core が付ける", "$ref": "../common.schema.json#/$defs/setSignature" } }, "$defs": { "releaseList": { "title": "CampaignSetReleaseList", "description": "新しい方から20個まで", "type": "array", "items": { "$ref": "#/$defs/release" } }, "release": { "title": "CampaignSetRelease", "description": "公開したバージョン1つ。halted は段階公開を止めたバージョン", "type": "object", "additionalProperties": false, "required": ["version", "released_at", "halted"], "properties": { "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "released_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "halted": { "type": "boolean" } } }, "target": { "title": "CrossPromoTarget", "type": "object", "additionalProperties": false, "required": ["name"], "minProperties": 2, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "ios": { "type": "object", "additionalProperties": false, "required": ["asc_app_id"], "properties": { "asc_app_id": { "type": "string", "pattern": "^[0-9]{6,12}$" } } }, "android": { "type": "object", "additionalProperties": false, "required": ["package"], "properties": { "package": { "type": "string", "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$" } } } } } } },
66
+ "inapp/template.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/template.schema.json", "title": "CampaignTemplate", "description": "型(trial_offer・review_ask・cross_promo・survey)のテンプレート。既定のプレースメントと動きの名前・渡す値・型ごとの check・例の件を持つ。アプリのマニフェストは template を書いたプレースメントと動きを、ここと同じ形で登録する", "type": "object", "additionalProperties": false, "required": ["type", "title", "purpose", "provided_by", "placement", "actions", "checks", "example"], "properties": { "type": { "$ref": "campaign.schema.json#/$defs/campaignType" }, "title": { "type": "string", "minLength": 1 }, "purpose": { "description": "何のための型か・比べる成果", "type": "string", "minLength": 1 }, "provided_by": { "title": "TemplateProvider", "description": "プレースメントと動きの中身を誰が持つか。sdk は SDK(package)が既定の見た目と動きを持ち、アプリは登録するだけ。app はアプリが自分で作る", "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["sdk", "app"] }, "packages": { "description": "既定の中身を持つ SDK(swift-review・swift-app-sdk)", "type": "array", "items": { "type": "string", "pattern": "^(swift|kotlin)-[a-z0-9-]+$" }, "uniqueItems": true } } }, "placement": { "title": "TemplatePlacement", "type": "object", "additionalProperties": false, "required": ["name", "kind", "fields"], "properties": { "name": { "$ref": "../common.schema.json#/$defs/name" }, "kind": { "$ref": "manifest.schema.json#/$defs/placementKind" }, "fields": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "manifest.schema.json#/$defs/field" } } } }, "actions": { "description": "型の既定の動き。空なら on_tap はアプリの動きかリンク", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "type": "object", "additionalProperties": false, "required": ["args", "does"], "properties": { "args": { "$ref": "manifest.schema.json#/$defs/actionArgs" }, "does": { "description": "動きが何をするか", "type": "string", "minLength": 1 } } } }, "checks": { "description": "その型の件に app-growth campaigns check が足す確かめ。id は <型>.<何を>", "type": "array", "items": { "$ref": "#/$defs/check" } }, "example": { "description": "そのまま check を通る例の件", "$ref": "campaign.schema.json" } }, "$defs": { "check": { "title": "TemplateCheck", "type": "object", "additionalProperties": false, "required": ["id", "level", "rule", "why"], "properties": { "id": { "type": "string", "pattern": "^[a-z_]+\\.[a-z0-9_]+$" }, "level": { "enum": ["error", "warning"] }, "rule": { "type": "string", "minLength": 1 }, "why": { "description": "根拠(app-playbook の knowledge の行・審査の条)", "type": "string", "minLength": 1 } } } } },
67
+ "inapp/trace.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/inapp/trace.schema.json", "title": "CampaignTrace", "description": "1つの出来事に対する1件の判定の跡(docs/testing-and-verification.md 5.1節)。Swift・Kotlin・TypeScript の3つの実装が同じ形で返す。端末のテスター画面・CLI の explain・テストの失敗の表示が出す。記録(計測)には送らない。steps は docs/contracts.md 6.5節の順番で、止まった所(result が stop)で終わり、その後は書かない。全部通った件は 12 の show(pass)で終わる", "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "event", "outcome", "steps"], "properties": { "campaign": { "$ref": "../common.schema.json#/$defs/campaignId" }, "set_version": { "description": "判定した時の組の version。待った後の見直し(11.5)で組が変わっても、ここは判定した時の物(新しい version は recheck の detail に書く)", "type": "integer", "minimum": 0 }, "event": { "title": "TraceEvent", "description": "判定した出来事。at は判定した時刻(表では now と同じ文字列)。比べるときは文字列でなく時刻として比べる", "type": "object", "additionalProperties": false, "required": ["name", "at"], "properties": { "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "at": { "$ref": "../common.schema.json#/$defs/isoTime" } } }, "outcome": { "$ref": "case.schema.json#/$defs/outcome" }, "steps": { "type": "array", "minItems": 1, "maxItems": 13, "items": { "$ref": "#/$defs/step" } } }, "$defs": { "stepName": { "title": "TraceStepName", "description": "判定の段の名前と、docs/contracts.md 6.5節の順の番号: fresh=1(組が cache_hours 以内)・readable=2(件が読めた)・active=3(status・platform・app_version・channel・期間)・trigger=4(きっかけ)・limits=5(回数)・device_audience=6(端末の値の条件)・server_audience=7(サーバーの値の条件)・holdout=8・priority=9(優先)・content=10(文と画像)・wait=11(出せる状態まで待つ)・recheck=11.5(6.5節の 11'。待った後に 3〜5 と文をもう一度)・show=12(出す)", "enum": ["fresh", "readable", "active", "trigger", "limits", "device_audience", "server_audience", "holdout", "priority", "content", "wait", "recheck", "show"] }, "step": { "title": "TraceStep", "description": "1つの段の結果。step と name の組は TraceStepName の説明のとおり。detail は段と結果ごとに決まった形(下の allOf)。pass で detail を書くのは trigger(当たったきっかけ)・holdout(側)・wait(busy だった時だけ)。stop では fresh・readable・active・trigger・limits・device_audience・server_audience・holdout・priority・content・wait・recheck の全部が detail を書く", "type": "object", "additionalProperties": false, "required": ["step", "name", "result"], "properties": { "step": { "description": "6.5節の順の番号。11' は 11.5", "enum": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11.5, 12] }, "name": { "$ref": "#/$defs/stepName" }, "result": { "enum": ["pass", "stop"] }, "detail": { "$ref": "#/$defs/detail" } }, "allOf": [{ "if": { "properties": { "name": { "const": "fresh" } } }, "then": { "properties": { "step": { "const": 1 }, "detail": { "$ref": "#/$defs/freshDetail" } } } }, { "if": { "properties": { "name": { "const": "readable" } } }, "then": { "properties": { "step": { "const": 2 }, "detail": { "$ref": "#/$defs/readableDetail" } } } }, { "if": { "properties": { "name": { "const": "active" } } }, "then": { "properties": { "step": { "const": 3 }, "detail": { "$ref": "#/$defs/inactiveDetail" } } } }, { "if": { "properties": { "name": { "const": "trigger" } } }, "then": { "properties": { "step": { "const": 4 }, "detail": { "$ref": "#/$defs/triggerDetail" } } } }, { "if": { "properties": { "name": { "const": "limits" } } }, "then": { "properties": { "step": { "const": 5 }, "detail": { "$ref": "#/$defs/limitDetail" } } } }, { "if": { "properties": { "name": { "const": "device_audience" } } }, "then": { "properties": { "step": { "const": 6 }, "detail": { "$ref": "#/$defs/conditionMiss" } } } }, { "if": { "properties": { "name": { "const": "server_audience" } } }, "then": { "properties": { "step": { "const": 7 }, "detail": { "$ref": "#/$defs/conditionMiss" } } } }, { "if": { "properties": { "name": { "const": "holdout" } } }, "then": { "required": ["detail"], "properties": { "step": { "const": 8 }, "detail": { "$ref": "#/$defs/holdoutDetail" } } } }, { "if": { "properties": { "name": { "const": "priority" } } }, "then": { "properties": { "step": { "const": 9 }, "detail": { "$ref": "#/$defs/priorityDetail" } } } }, { "if": { "properties": { "name": { "const": "content" } } }, "then": { "properties": { "step": { "const": 10 }, "detail": { "$ref": "#/$defs/contentDetail" } } } }, { "if": { "properties": { "name": { "const": "wait" } } }, "then": { "properties": { "step": { "const": 11 }, "detail": { "$ref": "#/$defs/waitDetail" } } } }, { "if": { "properties": { "name": { "const": "recheck" } } }, "then": { "properties": { "step": { "const": 11.5 }, "detail": { "$ref": "#/$defs/recheckDetail" } } } }, { "if": { "properties": { "name": { "const": "show" } } }, "then": { "properties": { "step": { "const": 12 }, "result": { "const": "pass" } }, "not": { "required": ["detail"] } } }, { "if": { "properties": { "result": { "const": "stop" } } }, "then": { "required": ["detail"] } }, { "if": { "properties": { "name": { "const": "trigger" }, "result": { "const": "pass" } } }, "then": { "required": ["detail"], "properties": { "detail": { "type": "object", "required": ["trigger"] } } } }, { "if": { "properties": { "name": { "const": "trigger" }, "result": { "const": "stop" } } }, "then": { "properties": { "detail": { "type": "object", "required": ["triggers"], "not": { "required": ["trigger"] } } } } }, { "if": { "properties": { "name": { "enum": ["fresh", "readable", "active", "limits", "device_audience", "server_audience", "priority", "content", "recheck"] }, "result": { "const": "pass" } } }, "then": { "not": { "required": ["detail"] } } }] }, "detail": { "title": "TraceDetail", "description": "段ごとの detail のどれか。どの段がどれを使うかは TraceStep の allOf で決まる", "anyOf": [{ "$ref": "#/$defs/freshDetail" }, { "$ref": "#/$defs/readableDetail" }, { "$ref": "#/$defs/inactiveDetail" }, { "$ref": "#/$defs/triggerDetail" }, { "$ref": "#/$defs/limitDetail" }, { "$ref": "#/$defs/conditionMiss" }, { "$ref": "#/$defs/holdoutDetail" }, { "$ref": "#/$defs/priorityDetail" }, { "$ref": "#/$defs/contentDetail" }, { "$ref": "#/$defs/waitDetail" }, { "$ref": "#/$defs/recheckDetail" }] }, "got": { "title": "TraceGot", "description": "条件が見た値。数・真偽はそのまま。文字列は SDK の値(platform・app_version・build・channel・lang・region)と、件に書いてある値(want)と同じ物だけをそのまま出し、ほかの自由な文字列(string の相手の値・出来事の props の文字列)は \"<文字列 12文字>\" の形(文字の数は Unicode のコードポイントで数える)にする(docs/testing-and-verification.md 5.5節)。null は値が無かった・取れなかった。exists の条件では、値があったかの真偽", "type": ["number", "boolean", "string", "null"] }, "want": { "title": "TraceWant", "description": "件に書いた比べる相手(演算子の右側)をそのまま。exists は真偽、in・not_in は配列", "anyOf": [{ "$ref": "campaign.schema.json#/$defs/scalar" }, { "$ref": "campaign.schema.json#/$defs/list" }] }, "conditionMiss": { "title": "TraceConditionMiss", "description": "条件(件の audience・きっかけの where)が外れた所。all は最初に外れた子を、any は外れた子の全部を any に並べる。端末の値の条件(6)とサーバーの値の条件(7)の stop、きっかけの where_failed が使う", "oneOf": [{ "$ref": "#/$defs/leafMiss" }, { "$ref": "#/$defs/anyMiss" }] }, "leafMiss": { "title": "TraceLeafMiss", "description": "外れた1つの条件。path は件の根からの道(audience・audience.all[1]・audience.all[3].any[0]・triggers[1].where.all[0])。番号は 0 から。ペルソナの expect.stopped_at はこの path", "type": "object", "additionalProperties": false, "required": ["path", "op", "want", "got"], "oneOf": [{ "required": ["fact"] }, { "required": ["prop"] }, { "required": ["segment"] }], "properties": { "path": { "$ref": "#/$defs/conditionPath" }, "fact": { "$ref": "../common.schema.json#/$defs/name" }, "prop": { "$ref": "../common.schema.json#/$defs/name" }, "segment": { "description": "群れの条件。op は eq、want は所属していれば当たる時 true(not なら false)、got は所属しているか", "$ref": "../segments/segment.schema.json#/$defs/segmentId" }, "op": { "enum": ["eq", "ne", "in", "not_in", "gte", "lte", "exists"] }, "want": { "$ref": "#/$defs/want" }, "got": { "$ref": "#/$defs/got" }, "type_mismatch": { "description": "型の違う比べで外れた(campaign_rejected(type_mismatch) を記録した)。そうでなければ書かない", "const": true } } }, "anyMiss": { "title": "TraceAnyMiss", "description": "子の全部が外れた any。path はその any の道(audience.all[2])", "type": "object", "additionalProperties": false, "required": ["path", "any"], "properties": { "path": { "$ref": "#/$defs/conditionPath" }, "any": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/conditionMiss" } } } }, "conditionPath": { "title": "TraceConditionPath", "description": "件の根からの条件の道。番号は 0 から", "type": "string", "pattern": "^(audience|triggers\\[\\d+\\]\\.where)(\\.(all|any)\\[\\d+\\])*$" }, "freshDetail": { "title": "TraceFreshDetail", "description": "1 の stop(stale)。age_hours は campaigns_stale の hours と同じ(取った時からの時間の切り捨て)", "type": "object", "additionalProperties": false, "required": ["fetched_at", "age_hours", "cache_hours"], "properties": { "fetched_at": { "$ref": "../common.schema.json#/$defs/isoTime" }, "age_hours": { "type": "integer", "minimum": 0 }, "cache_hours": { "type": "number", "exclusiveMinimum": 0 } } }, "readableDetail": { "title": "TraceReadableDetail", "description": "2 の stop(rejected:<理由>)", "type": "object", "additionalProperties": false, "required": ["reason"], "properties": { "reason": { "$ref": "events.schema.json#/$defs/rejectReason" } } }, "inactiveDetail": { "title": "TraceInactiveDetail", "description": "3 の stop(inactive:<何>)と、待った後の見直しの inactive。want と got: status は \"active\" と件の status・platform は件の platforms と端末の platform・app_version は件のその platform の解決した範囲(min と exclude。無ければ null)と端末のバージョン・channel は件の channels(書かなければ [\"appstore\",\"play\"])と端末の channel・not_started は starts_at と判定の時刻・ended は ends_at と判定の時刻", "type": "object", "additionalProperties": false, "required": ["inactive", "want", "got"], "properties": { "inactive": { "enum": ["status", "platform", "app_version", "channel", "not_started", "ended"] }, "want": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" }, "minItems": 1 }, { "$ref": "../releases/manifest.schema.json#/$defs/resolvedRange" }, { "type": "null" }] }, "got": { "type": "string" } } }, "triggerDetail": { "title": "TraceTriggerDetail", "description": "4 のきっかけ。pass は当たったきっかけの id(trigger)だけ。stop は件のきっかけの全部を書いた順に triggers に並べる", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "triggers": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/triggerResult" } } } }, "triggerResult": { "title": "TraceTriggerResult", "description": "1つのきっかけの結果。other_event は出来事の名前が違う・where_failed は名前は同じで where が外れた(miss にどの葉か)・matched は当たった(stop には出ない)", "type": "object", "additionalProperties": false, "required": ["trigger", "result"], "properties": { "trigger": { "$ref": "../common.schema.json#/$defs/name" }, "result": { "enum": ["other_event", "where_failed", "matched"] }, "miss": { "$ref": "#/$defs/conditionMiss" } }, "if": { "properties": { "result": { "const": "where_failed" } } }, "then": { "required": ["miss"] }, "else": { "not": { "required": ["miss"] } } }, "limitDetail": { "title": "TraceLimitDetail", "description": "5 の stop(limited:<何>)と、待った後の見直しの limited。count と max は数で決まる物だけ: max_shown は shown_count と max_shown・max_per_app_version は今のバージョンの shown_by_app_version と上限・max_per_session はこの起動で出した数と policy の上限・max_per_day はその日(端末の時間帯)に出した数と policy の上限。next_allowed_at はまた出せるようになる時刻(端末の時間帯の時差で書く): min_hours_between は last_shown_at + 時間・after_dismiss は dismissed_at + 日・after_action は action_completed_at + 日・max_per_day は次の日の 0 時。時刻では戻らない物(max_shown・max_per_app_version・not_after_in_launch・max_per_session・after_action_days が null の after_action)は null", "type": "object", "additionalProperties": false, "required": ["limit", "next_allowed_at"], "properties": { "limit": { "enum": ["max_shown", "max_per_app_version", "min_hours_between", "after_dismiss", "after_action", "not_after_in_launch", "max_per_session", "max_per_day"] }, "count": { "type": "integer", "minimum": 0 }, "max": { "type": "integer", "minimum": 1 }, "next_allowed_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/isoTime" }, { "type": "null" }] } } }, "holdoutDetail": { "title": "TraceHoldoutDetail", "description": "8 の側。pass(treatment)でも stop(held_out)でも書く。bucket は件の layer の中の位置(floor(hash32(\"<project>:<assignment_id>:<layer>:layer\") × 1000 / 2^32)。assignment_id は割り当ての材料の id で、実験と同じ)。holdout は件の範囲で、bucket が入れば holdout。本人・テスターの端末(internal)は hash を見ずに treatment なので bucket は null で internal を true。前にこの端末で決まった側を使った時は remembered を true。製品全体の holdout で止めた時は global(outcome は global_holdout)", "type": "object", "additionalProperties": false, "required": ["bucket", "holdout", "side"], "properties": { "bucket": { "anyOf": [{ "type": "integer", "minimum": 0, "maximum": 999 }, { "type": "null" }] }, "holdout": { "anyOf": [{ "$ref": "../experiment/holdout.schema.json#/$defs/range" }, { "type": "null" }] }, "side": { "enum": ["treatment", "holdout"] }, "internal": { "const": true }, "remembered": { "const": true }, "global": { "description": "組の policy の global_holdout が true の時の、製品全体の holdout の位置(人の id のレイヤー global の bucket)。[0, 50) に入って止めた時だけ書く。その時は件の位置を見ないので bucket は null・side は holdout", "type": "integer", "minimum": 0, "maximum": 49 } } }, "priorityDetail": { "title": "TracePriorityDetail", "description": "9 の stop(lower_priority)。winner は出す件、by は何で負けたか(priority が小さい・priority が同じで starts_at が古い・どちらも同じで id が後)", "type": "object", "additionalProperties": false, "required": ["winner", "by"], "properties": { "winner": { "$ref": "../common.schema.json#/$defs/campaignId" }, "by": { "enum": ["priority", "starts_at", "id"] } } }, "contentDetail": { "title": "TraceContentDetail", "description": "10 の stop(missing_locale・image_not_ready)と、待った後の見直しの同じ物。lang は端末の言語。texts は文が選べなかった必須の text の値の名前(values にも <text_key>.<名前> の表にも無い)、images はまだ取れていない画像の値の名前。どちらも書いた順(マニフェストのプレースメントの fields の順)", "type": "object", "additionalProperties": false, "required": ["lang"], "minProperties": 2, "properties": { "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "texts": { "type": "array", "minItems": 1, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "images": { "type": "array", "minItems": 1, "items": { "$ref": "../common.schema.json#/$defs/name" } } } }, "waitDetail": { "title": "TraceWaitDetail", "description": "11 の待ち。busy_seconds はアプリが busy だった秒、wait_seconds は当たったきっかけの wait_seconds。busy_seconds が wait_seconds を超えたら stop(busy)。busy でなかった(待たなかった)pass は detail を書かない", "type": "object", "additionalProperties": false, "required": ["busy_seconds", "wait_seconds"], "properties": { "busy_seconds": { "type": "integer", "minimum": 0 }, "wait_seconds": { "type": "integer", "minimum": 0 } } }, "recheckDetail": { "title": "TraceRecheckDetail", "description": "11.5 の stop。set_version は待った後に SDK が持つ組の version(withdrawn の campaign_skipped と同じ)。withdrawn・inactive・limit・content のどれか1つで、何で外れたかを書く", "type": "object", "additionalProperties": false, "required": ["set_version"], "minProperties": 2, "maxProperties": 2, "properties": { "set_version": { "type": "integer", "minimum": 0 }, "withdrawn": { "description": "件が組から消えた", "const": true }, "inactive": { "$ref": "#/$defs/inactiveDetail" }, "limit": { "$ref": "#/$defs/limitDetail" }, "content": { "$ref": "#/$defs/contentDetail" } } } } },
68
+ "insights/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/admin.schema.json", "title": "InsightsSqlRequest", "description": "POST /v1/insights/sql(runInsightsSql)の本文。データレイクへの1つの SELECT(docs/design/insights.md 9節)。送る前に構文ツリーにして、1つの SELECT か・day の条件があるか・400日を超えないかを確かめ、合わなければ 400 sql_refused。LIMIT が無ければ 1000 を付ける。結果の列に person_key があれば断る。1回のスキャンは1GB・1日は製品をまたいで5GBまで(超えたら 429 scan_limit)", "type": "object", "additionalProperties": false, "required": ["query"], "properties": { "query": { "type": "string", "minLength": 1, "maxLength": 20000 }, "project": { "description": "スキャンの上限を数える製品。SQL の中の project の条件と同じにする", "$ref": "../common.schema.json#/$defs/projectId" }, "purpose": { "description": "なぜ読むか(1行)。insights_query に残す", "type": "string", "maxLength": 300 } }, "$defs": { "sqlResult": { "title": "InsightsSqlResult", "description": "runInsightsSql の答え。rows は列の並びの配列。truncated は LIMIT に当たった", "type": "object", "additionalProperties": false, "required": ["query", "columns", "rows", "truncated", "scanned_bytes", "ms"], "properties": { "query": { "$ref": "metric.schema.json#/$defs/queryId" }, "columns": { "type": "array", "maxItems": 100, "items": { "type": "string", "maxLength": 120 } }, "rows": { "type": "array", "maxItems": 10000, "items": { "type": "array", "items": { "type": ["string", "number", "boolean", "null"] } } }, "truncated": { "type": "boolean" }, "scanned_bytes": { "type": "integer", "minimum": 0 }, "ms": { "type": "integer", "minimum": 0 } } }, "tool": { "title": "InsightsTool", "description": "AI に渡すツールの名前(9節)。screen_stats は R8 の画面ごとの日の数(sessions_screen_day)。portfolio は AI のツールでなく、毎週月曜の流れが週の表と広告費の案の数を残した記録(広告費の案の指摘の根拠)。seo も AI のツールでなく、毎週月曜の流れが Search Console の28日の語×ページの数を残した記録(記事の直しどころの指摘の根拠)", "enum": ["metric", "compare", "sql", "search_ledger", "list_releases", "screen_stats", "portfolio", "seo"] }, "query": { "title": "InsightsQuery", "description": "ツールの呼び出しの1回(insights_query)。結果は検算のために集計の行だけを200行まで残す", "type": "object", "additionalProperties": false, "required": ["id", "project", "actor", "job", "tool", "query", "status", "reason", "scanned_bytes", "row_count", "ms", "result", "created_at"], "properties": { "id": { "$ref": "metric.schema.json#/$defs/queryId" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "actor": { "description": "呼んだ主体(usr_・agt_・sys:insights-daily)", "type": "string", "maxLength": 80 }, "job": { "description": "毎日の Workflow の回の id か指摘の id。CLI から呼んだ物は null", "type": ["string", "null"], "maxLength": 80 }, "tool": { "$ref": "#/$defs/tool" }, "query": { "description": "SQL の文か、ツールの引数の JSON", "type": "string", "maxLength": 20000 }, "status": { "enum": ["ok", "refused", "error"] }, "reason": { "type": ["string", "null"], "maxLength": 300 }, "scanned_bytes": { "type": ["integer", "null"], "minimum": 0 }, "row_count": { "type": ["integer", "null"], "minimum": 0 }, "ms": { "type": ["integer", "null"], "minimum": 0 }, "result": { "description": "残した結果(列と200行まで)", "anyOf": [{ "$ref": "#/$defs/sqlResult" }, { "type": "null" }] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "collectRequest": { "title": "InsightsCollectRequest", "description": "POST /v1/insights/collect(collectInsights)の本文。毎日の Workflow の取り込みの step だけを、すぐ回す(app-growth insights collect)。何も書かなければ全部の取り込み元・呼び手の見える全部の製品・前の日", "type": "object", "additionalProperties": false, "properties": { "sources": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "$ref": "#/$defs/source" } }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "day": { "$ref": "../common.schema.json#/$defs/day" } } }, "pushRequest": { "title": "InsightsPushRequest", "description": "POST /v1/insights/push/:source(pushInsights)の本文。手元でしか取れない取り込み元(packages/metrics の sources.toml の runs_on が push の物。aso-rank)の、取ってきたままの応答を送る。insights が R2 に残し、日ごとの数を作って insights_observation に書く。答えは InsightsCollection(run は push_ で始まる)。app-growth insights push", "type": "object", "additionalProperties": false, "required": ["project", "records"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "records": { "type": "array", "minItems": 1, "maxItems": 500, "items": { "$ref": "#/$defs/rawRecord" } } } }, "rawRecord": { "title": "InsightsRawRecord", "description": "取ってきたままの応答の1つ(R2 appgrowstack-insights-raw の1行)。source は送り先のパスの取り込み元と同じにする。payload の形は取り込み元ごと", "type": "object", "additionalProperties": false, "required": ["v", "source", "kind", "fetched_at", "params", "payload"], "properties": { "v": { "const": 1 }, "source": { "$ref": "#/$defs/source" }, "kind": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$" }, "fetched_at": { "description": "取った時刻(ISO 8601)", "type": "string", "maxLength": 40 }, "params": { "type": "object" }, "payload": {} } }, "source": { "title": "InsightsSource", "description": "取り込み元の名前(7節)。動く場所・間隔・キーは packages/metrics の取り込み元の表を正とする", "type": "string", "pattern": "^[a-z][a-z0-9-]{1,39}$" }, "collection": { "title": "InsightsCollection", "description": "取り込みの step の1つの結果(insights_collection)。ok 取れた・fresh 前に取った物が新しいので取らなかった・partial 一部だけ(429 など)・error 取れなかった。キーの無い取り込み元は error にして reason に書き、0を入れない", "type": "object", "additionalProperties": false, "required": ["id", "run", "source", "project", "day", "status", "reason", "raw_key", "row_count", "started_at", "finished_at"], "properties": { "id": { "type": "string", "pattern": "^col_[A-Za-z0-9]{16}$" }, "run": { "description": "毎日の Workflow の回の id か、collectInsights の回の id", "type": "string", "maxLength": 80 }, "source": { "$ref": "#/$defs/source" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "status": { "enum": ["ok", "fresh", "partial", "error"] }, "reason": { "type": ["string", "null"], "maxLength": 300 }, "raw_key": { "description": "元の応答を書いた R2(appgrowstack-insights-raw)のキー", "type": ["string", "null"], "maxLength": 300 }, "row_count": { "type": "integer", "minimum": 0 }, "started_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "finished_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "collectResult": { "title": "InsightsCollectResult", "description": "collectInsights の答え。step ごとの結果", "type": "object", "additionalProperties": false, "required": ["run", "items"], "properties": { "run": { "type": "string", "maxLength": 80 }, "items": { "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/collection" } } } } } },
69
+ "insights/competitors.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/competitors.schema.json", "title": "CompetitorReport", "description": "GET /v1/insights/competitors/:project(getCompetitors)の答え。競合のアプリ(R1 の competitors の App Store の物)と自分のアプリの評価・評価の数・今のバージョン(iTunes の lookup)と、集めた競合のレビュー(日本の App Store の RSS・毎週)。competitor-reviews の取り込みが insights の D1 に書いた物で、データレイクを読まない。競合の★1〜2のレビューの不満の要点は、毎日の流れが週に1回 Claude でまとめて残した物。自分の検索の順位は aso.rank の新しい日の物と、その前に調べた日の物", "type": "object", "additionalProperties": false, "required": ["project", "collected_at", "apps", "reviews", "complaints", "ranks"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "collected_at": { "description": "最後に取り込んだ時刻。1回も取り込んでいなければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "apps": { "description": "自分のアプリと、R1 の競合。R1 にあって lookup がまだ無い競合も、R1 の名前で入れる(数は null)", "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/app" } }, "reviews": { "description": "集めた競合のレビューの新しい順。★1〜2の新しい120件と★3〜5の新しい80件を合わせる(画面の既定は★1〜2なので、★5の多い競合でも低い評価が欠けないように分けて取る)。自分のアプリのレビューは入れない", "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/review" } }, "complaints": { "description": "競合の★1〜2のレビューの不満の要点。毎日の流れが週に1回 Claude でまとめて insights の D1 に残した物。まだまとめていなければ null", "anyOf": [{ "$ref": "#/$defs/complaints" }, { "type": "null" }] }, "ranks": { "description": "自分のアプリの検索の順位。語と国ごとに1つ(同じ語の App Store と Google Play の順位を1つにまとめる)。ストアごとに aso.results の新しい日と、その日の aso.rank。競合の順位は集めていない", "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/rank" } } }, "$defs": { "app": { "title": "CompetitorApp", "type": "object", "additionalProperties": false, "required": ["app_id", "self", "name", "seller", "rating", "rating_count", "version", "version_at", "price", "genre", "collected_at", "review_count", "review_stars", "latest_review_at"], "properties": { "app_id": { "description": "App Store のアプリの id", "type": "string", "pattern": "^[0-9]{1,20}$" }, "self": { "description": "自分のアプリか", "type": "boolean" }, "name": { "type": "string", "maxLength": 200 }, "seller": { "type": ["string", "null"], "maxLength": 200 }, "rating": { "description": "App Store の評価の平均(1〜5)", "type": ["number", "null"] }, "rating_count": { "type": ["integer", "null"], "minimum": 0 }, "version": { "type": ["string", "null"], "maxLength": 40 }, "version_at": { "description": "今のバージョンを出した時刻(ISO 8601)", "type": ["string", "null"], "maxLength": 40 }, "price": { "description": "ストアに出ている値段の文字(無料なら 無料)", "type": ["string", "null"], "maxLength": 40 }, "genre": { "type": ["string", "null"], "maxLength": 80 }, "collected_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "review_count": { "description": "集めた文のあるレビュー(日本の App Store の RSS・毎週の新しい50件を積み上げた物)の数。自分のアプリも同じ物差しで集める。rating_count(星だけの評価も含むストアの合計)とは別の数", "type": "integer", "minimum": 0 }, "review_stars": { "description": "集めたレビューの星ごとの数(1〜5 の順)", "type": "array", "minItems": 5, "maxItems": 5, "items": { "type": "integer", "minimum": 0 } }, "latest_review_at": { "type": ["string", "null"], "maxLength": 40 } } }, "review": { "title": "CompetitorReview", "type": "object", "additionalProperties": false, "required": ["app_id", "stars", "title", "body", "version", "published_at"], "properties": { "app_id": { "type": "string", "pattern": "^[0-9]{1,20}$" }, "stars": { "type": "integer", "minimum": 1, "maximum": 5 }, "title": { "type": "string", "maxLength": 500 }, "body": { "type": "string", "maxLength": 4000 }, "version": { "type": ["string", "null"], "maxLength": 40 }, "published_at": { "type": "string", "maxLength": 40 } } }, "rank": { "title": "CompetitorKeywordRank", "type": "object", "additionalProperties": false, "required": ["keyword", "country", "app_store", "google_play"], "properties": { "keyword": { "type": "string", "maxLength": 200 }, "country": { "type": "string", "maxLength": 8 }, "app_store": { "description": "App Store(iPhone)の公開の検索での順位。その語をこの国の App Store で調べていなければ null", "anyOf": [{ "$ref": "#/$defs/storeRank" }, { "type": "null" }] }, "google_play": { "description": "Google Play の Web の検索の1ページ目(30件ほど)での順位。端末の Play アプリの順位とずれることがある目安。調べていなければ null", "anyOf": [{ "$ref": "#/$defs/storeRank" }, { "type": "null" }] } } }, "storeRank": { "title": "CompetitorStoreRank", "type": "object", "additionalProperties": false, "required": ["rank", "day", "previous"], "properties": { "rank": { "description": "順位。圏外(aso.results だけがある日)は null", "type": ["integer", "null"], "minimum": 1 }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "previous": { "description": "その前に調べた日の順位。前に調べていなければ null。画面は順位が動いた語を出すのに使う", "anyOf": [{ "$ref": "#/$defs/previousRank" }, { "type": "null" }] } } }, "previousRank": { "title": "CompetitorPreviousRank", "type": "object", "additionalProperties": false, "required": ["rank", "day"], "properties": { "rank": { "description": "順位。圏外は null", "type": ["integer", "null"], "minimum": 1 }, "day": { "$ref": "../common.schema.json#/$defs/day" } } }, "complaints": { "title": "CompetitorComplaints", "type": "object", "additionalProperties": false, "required": ["summarized_at", "review_count", "latest_review_at", "points"], "properties": { "summarized_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "review_count": { "description": "まとめるのに読んだ★1〜2のレビューの数", "type": "integer", "minimum": 0 }, "latest_review_at": { "description": "読んだ中で一番新しいレビューの時刻(ISO 8601)", "type": "string", "maxLength": 40 }, "points": { "description": "不満の要点。多い順に5個まで", "type": "array", "maxItems": 5, "items": { "$ref": "#/$defs/complaint" } } } }, "complaint": { "title": "CompetitorComplaint", "type": "object", "additionalProperties": false, "required": ["title", "detail", "count", "apps", "quote"], "properties": { "title": { "description": "不満の名前。利用者の言葉に近い短い句", "type": "string", "maxLength": 80 }, "detail": { "description": "何が不満かと、自分のアプリで先回りできること(1〜2文)", "type": "string", "maxLength": 300 }, "count": { "description": "この不満に当たるレビューの数", "type": "integer", "minimum": 1 }, "apps": { "description": "この不満が出ている競合の App Store の id(多い順)", "type": "array", "maxItems": 10, "items": { "type": "string", "pattern": "^[0-9]{1,20}$" } }, "quote": { "description": "代表のレビューの言葉(40字まで・書いた人の名前は入れない)。無ければ null", "type": ["string", "null"], "maxLength": 80 } } } } },
70
+ "insights/finding.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/finding.schema.json", "title": "InsightsFinding", "description": "指摘の1件(insights_finding・docs/design/insights.md 8.3〜8.5節)。検知を Claude が説明し、根拠の数・理由の候補・打ち手・見込む変化・確認の仕方を付けた物と、検算の結果。検算を通った指摘だけが承認待ち(種類 insights_finding)に出る", "type": "object", "additionalProperties": false, "required": ["id", "project", "signal", "day", "status", "title", "what", "evidence", "hypotheses", "action", "expected", "check", "verification", "hypothesis", "decided_by", "decided_at", "decision_note", "cost", "created_at"], "properties": { "id": { "$ref": "#/$defs/findingId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "signal": { "description": "元の検知。毎月1日の広告費の案のように検知から来ない指摘は null", "anyOf": [{ "$ref": "signal.schema.json#/$defs/signalId" }, { "type": "null" }] }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "status": { "$ref": "#/$defs/status" }, "title": { "description": "一覧に出す題。30字まで。何を変えて、何が上がるかを書き、長い説明は what に書く。2026-12 より前の指摘は null", "type": ["string", "null"], "minLength": 1, "maxLength": 30 }, "what": { "description": "何が起きたか(1文)", "type": "string", "minLength": 1, "maxLength": 300 }, "evidence": { "description": "根拠の数。全部が insights_query の id と結果の中の場所を持つ", "type": "array", "minItems": 1, "maxItems": 20, "items": { "$ref": "#/$defs/evidence" } }, "hypotheses": { "description": "理由の候補(仮説の形)", "type": "array", "minItems": 1, "maxItems": 3, "items": { "type": "string", "minLength": 1, "maxLength": 300 } }, "action": { "$ref": "ledger.schema.json#/$defs/action" }, "expected": { "$ref": "#/$defs/expected" }, "check": { "$ref": "#/$defs/check" }, "verification": { "$ref": "#/$defs/verification" }, "hypothesis": { "description": "採った時に作った仮説。決める前は null", "anyOf": [{ "$ref": "ledger.schema.json#/$defs/hypothesisId" }, { "type": "null" }] }, "decided_by": { "description": "決めた主体(usr_・agt_)", "type": ["string", "null"], "maxLength": 80 }, "decided_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "decision_note": { "description": "却下の理由(1行)。採った時と後での時は任意", "type": ["string", "null"], "maxLength": 300 }, "cost": { "description": "説明にかかった費用(8.3節)。費用を残す前(0005 より前)の指摘は null", "anyOf": [{ "$ref": "#/$defs/cost" }, { "type": "null" }] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "findingId": { "title": "InsightsFindingId", "type": "string", "pattern": "^fnd_[A-Za-z0-9]{16}$" }, "status": { "title": "InsightsFindingStatus", "description": "proposed 承認待ち・accepted 採った(仮説を作った)・rejected 却下・later 後で・discarded 検算で捨てた(承認待ちに出さない)", "enum": ["proposed", "accepted", "rejected", "later", "discarded"] }, "evidence": { "title": "InsightsEvidence", "description": "根拠の数の1つ。query の結果の path の値が value と同じかを検算が確かめる", "type": "object", "additionalProperties": false, "required": ["query", "path", "value", "label"], "properties": { "query": { "$ref": "metric.schema.json#/$defs/queryId" }, "path": { "description": "結果の中の値の場所(JSON Pointer。/rows/0/2・/points/3/value)", "type": "string", "pattern": "^(/[^/]*)+$", "maxLength": 200 }, "value": { "type": "number" }, "label": { "description": "文の中で何の数か", "type": "string", "minLength": 1, "maxLength": 120 } } }, "expected": { "title": "InsightsExpectedChange", "description": "見込む変化", "type": "object", "additionalProperties": false, "required": ["metric", "direction", "size"], "properties": { "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "direction": { "enum": ["up", "down"] }, "size": { "description": "見込む大きさ(指標の単位)。言えなければ null", "type": ["number", "null"] } } }, "check": { "title": "InsightsCheckPlan", "description": "確認する指標・日・比べ方。日の既定は打ち手から28日後", "type": "object", "additionalProperties": false, "required": ["metric", "after_days", "method"], "properties": { "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "after_days": { "description": "打ち手を当てた日から何日後に確かめるか", "type": "integer", "minimum": 7, "maximum": 180 }, "method": { "$ref": "ledger.schema.json#/$defs/method" } } }, "verification": { "title": "InsightsVerification", "description": "検算の結果(8.4節)。evidence の全部の値を、記録した SQL をもう一度実行して比べた", "type": "object", "additionalProperties": false, "required": ["passed", "needs_review", "reasons", "checked_at"], "properties": { "passed": { "description": "全部が合った。1つでも合わない・query の無い数があれば false で、指摘は discarded", "type": "boolean" }, "needs_review": { "description": "検算は合ったが、前の90日の範囲から大きく外れる値がある", "type": "boolean" }, "reasons": { "description": "合わなかった数・外れた数の説明", "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 300 } }, "checked_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "cost": { "title": "InsightsFindingCost", "description": "1件の指摘を作るのにかかった物。usd_micros は Claude を呼んだ費用の合計(insights_ai_usage と同じ数え方・100万分の1ドル)。検算の SQL は数えない", "type": "object", "additionalProperties": false, "required": ["usd_micros", "tool_calls", "model"], "properties": { "usd_micros": { "type": "integer", "minimum": 0 }, "tool_calls": { "description": "ツールの呼び出しの回数(20回まで)", "type": "integer", "minimum": 0 }, "model": { "type": ["string", "null"], "maxLength": 80 } } }, "list": { "title": "InsightsFindingList", "description": "GET /v1/insights/findings(listInsightsFindings)の答え。新しい順。?project=&status=&since=。呼び手の組織の、insights.read で見えるプロジェクトの分だけ", "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "maxItems": 500, "items": { "$ref": "#" } } } }, "detail": { "title": "InsightsFindingDetail", "description": "GET /v1/insights/findings/:finding(getInsightsFinding)の答え。根拠の数ごとに、実行した SQL の文と結果を開ける", "type": "object", "additionalProperties": false, "required": ["finding", "signal", "queries"], "properties": { "finding": { "$ref": "#" }, "signal": { "anyOf": [{ "$ref": "signal.schema.json" }, { "type": "null" }] }, "queries": { "type": "array", "maxItems": 20, "items": { "$ref": "admin.schema.json#/$defs/query" } } } }, "decideRequest": { "title": "InsightsFindingDecision", "description": "POST /v1/insights/findings/:finding/decide(decideInsightsFinding)の本文。accept は仮説(open・出どころ finding)を作って指摘と検知につなぐ。打ち手が基盤の操作なら action.detail がその操作の依頼で、実行は今の API で行う。エージェントの accept は 202 で承認を通す。reject は理由を1行書く。proposed と later でない指摘は 409 conflict", "type": "object", "additionalProperties": false, "required": ["decision"], "properties": { "decision": { "enum": ["accept", "reject", "later"] }, "note": { "type": "string", "minLength": 1, "maxLength": 300 } }, "if": { "properties": { "decision": { "const": "reject" } } }, "then": { "required": ["decision", "note"] } } } },
71
+ "insights/kpi.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/kpi.schema.json", "title": "KpiTree", "description": "製品の KPI のツリーと、KPI ごとの日の値(docs/design/kpi.md)。GET /v1/insights/kpis/:project(getKpiTree)の答え。?from=&to=(既定は前の日までの90日)。値は見分けが real の人だけで、本人・テスター・審査の端末と debug・testflight・play_test のビルドの出来事を数えない", "type": "object", "additionalProperties": false, "required": ["project", "from", "to", "updated_at", "updated_by", "kpis"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "from": { "$ref": "../common.schema.json#/$defs/day" }, "to": { "$ref": "../common.schema.json#/$defs/day" }, "updated_at": { "description": "木を最後に書いた時刻。書いたことが無ければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "updated_by": { "description": "木を最後に書いた主体の id。書いたことが無ければ null", "type": ["string", "null"], "maxLength": 80 }, "kpis": { "description": "定義の順。段(tier)の中の順は書いた順", "type": "array", "maxItems": 30, "items": { "$ref": "#/$defs/view" } } }, "$defs": { "kpiKey": { "title": "KpiKey", "description": "製品の中の KPI の名前。日の値は insights_observation の指標 kpi.<key> に入る", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$" }, "tier": { "title": "KpiTier", "description": "層。north_star 利用者の価値(一番大事な指標)・funnel 獲得から課金の漏斗(書いた順がステップの順)・marketing 細かい率(通知の許諾・ペイウォールの閉じ・オファー)", "enum": ["north_star", "funnel", "marketing"] }, "eventFilter": { "title": "KpiEventFilter", "description": "数える出来事。event はアプリの出来事(データレイクの events)、subscription は課金の通知(subscriptions)。props はデータレイクに残る引数(カタログの enum・bucket・flag)の値で絞る。newcomers は最初の first_open の kind が upgraded でない新規の人だけ", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["event"], "properties": { "event": { "$ref": "../common.schema.json#/$defs/eventName" }, "props": { "type": "object", "maxProperties": 4, "propertyNames": { "pattern": "^[a-z][a-z0-9_]{0,39}$" }, "additionalProperties": { "anyOf": [{ "type": "string", "pattern": "^[A-Za-z0-9_+.-]{1,40}$" }, { "type": "array", "minItems": 1, "items": { "type": "string", "pattern": "^[A-Za-z0-9_+.-]{1,40}$" } }] } }, "newcomers": { "type": "boolean" } } }, { "type": "object", "additionalProperties": false, "required": ["subscription"], "properties": { "subscription": { "enum": ["INITIAL_PURCHASE", "RENEWAL", "CANCELLATION", "UNCANCELLATION", "EXPIRATION", "PRODUCT_CHANGE", "BILLING_ISSUE"] }, "period": { "enum": ["TRIAL", "INTRO", "NORMAL", "PROMOTIONAL"] }, "newcomers": { "type": "boolean" } } }] }, "measure": { "title": "KpiMeasure", "description": "数え方。窓は値の日を終わりにした window_days 日。metric 定義した指標(metrics.toml)を窓で足した値(割合は分子と分母を足して割る)・people 窓の中に出来事を送った人・count 窓の中の出来事の数・per_person 窓の中の1人あたりの出来事の数・conversion 窓の中で初めて from をした人のうち within_days 日の中で to をした人の割合(窓は within_days 日前で閉じる)・repeat 前の窓で出来事をした人のうち今の窓でもした人の割合", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["kind", "metric", "window_days"], "properties": { "kind": { "const": "metric" }, "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "window_days": { "type": "integer", "minimum": 1, "maximum": 28 } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "event", "window_days"], "properties": { "kind": { "enum": ["people", "count", "per_person", "repeat"] }, "event": { "$ref": "#/$defs/eventFilter" }, "window_days": { "type": "integer", "minimum": 1, "maximum": 28 } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "from", "to", "within_days", "window_days"], "properties": { "kind": { "const": "conversion" }, "from": { "$ref": "#/$defs/eventFilter" }, "to": { "$ref": "#/$defs/eventFilter" }, "within_days": { "type": "integer", "minimum": 1, "maximum": 35 }, "window_days": { "type": "integer", "minimum": 1, "maximum": 28 } } }] }, "kpi": { "title": "Kpi", "description": "KPI の1つ。target を書くと、前の日の値が target より悪い時(good の向きで比べる)に毎日の検知が kpi_off_target を出す。割合は分母が min_den に届かない日は比べない", "type": "object", "additionalProperties": false, "required": ["key", "tier", "label", "measure", "good"], "properties": { "key": { "$ref": "#/$defs/kpiKey" }, "tier": { "$ref": "#/$defs/tier" }, "label": { "description": "画面に出す名前", "type": "string", "minLength": 1, "maxLength": 40 }, "measure": { "$ref": "#/$defs/measure" }, "good": { "description": "良い向き", "enum": ["up", "down"] }, "target": { "description": "外れたら知らせる値。割合は0〜1。書かなければ比べない", "type": ["number", "null"] }, "min_den": { "description": "割合で比べる分母の下限。既定30", "type": "integer", "minimum": 1, "maximum": 10000 }, "why": { "description": "なぜ見るか(1文)", "type": "string", "maxLength": 200 } } }, "unit": { "title": "KpiUnit", "description": "値の単位。people 人・count 件・number 1人あたりの数・ratio 割合(0〜1)・jpy 円・usd ドル", "enum": ["people", "count", "number", "ratio", "jpy", "usd"] }, "status": { "title": "KpiStatus", "description": "前の日の値の判定。ok 目標に届いている・off 目標より悪い・thin 分母が min_den に届かず比べない・no_data 値が無い(出来事が来ていない・定義の指標が無い)・no_target 目標を書いていない", "enum": ["ok", "off", "thin", "no_data", "no_target"] }, "point": { "title": "KpiPoint", "type": "object", "additionalProperties": false, "required": ["day", "value", "num", "den"], "properties": { "day": { "$ref": "../common.schema.json#/$defs/day" }, "value": { "description": "その日を終わりにした窓の値。無ければ null", "type": ["number", "null"] }, "num": { "description": "割合と1人あたりの分子(人・件)。ほかは null", "type": ["number", "null"] }, "den": { "description": "割合と1人あたりの分母(人)。ほかは null", "type": ["integer", "null"], "minimum": 0 } } }, "view": { "title": "KpiView", "description": "KPI の定義と、期間の日の値と、前の日の判定", "type": "object", "additionalProperties": false, "required": ["kpi", "unit", "points", "latest", "status", "note"], "properties": { "kpi": { "$ref": "#/$defs/kpi" }, "unit": { "$ref": "#/$defs/unit" }, "points": { "type": "array", "maxItems": 400, "items": { "$ref": "#/$defs/point" } }, "latest": { "description": "期間の最後の日の値。値が無ければ値の欄が null", "$ref": "#/$defs/point" }, "status": { "$ref": "#/$defs/status" }, "note": { "description": "判定の理由(1文)", "type": "string", "maxLength": 200 } } }, "putRequest": { "title": "PutKpiTreeRequest", "description": "PUT /v1/insights/kpis/:project の本文。製品の KPI のツリーを全部置き換える。空の配列で消す。key は重ならない。north_star は1〜3個", "type": "object", "additionalProperties": false, "required": ["kpis"], "properties": { "kpis": { "type": "array", "maxItems": 30, "items": { "$ref": "#/$defs/kpi" } } } }, "computeRequest": { "title": "ComputeKpisRequest", "description": "POST /v1/insights/kpis/:project/compute の本文。from〜to の日の KPI の値をデータレイクから数え直し、検知も回す(毎日の流れの only kpi)。90日まで", "type": "object", "additionalProperties": false, "required": ["from", "to"], "properties": { "from": { "$ref": "../common.schema.json#/$defs/day" }, "to": { "$ref": "../common.schema.json#/$defs/day" } } }, "computeResult": { "title": "ComputeKpisResult", "description": "数え直しを始めた毎日の流れの id と日の数。終わるまで数分かかる", "type": "object", "additionalProperties": false, "required": ["run", "days"], "properties": { "run": { "type": "string", "pattern": "^run_[A-Za-z0-9]{1,40}$" }, "days": { "type": "integer", "minimum": 1, "maximum": 90 } } } } },
72
+ "insights/lake.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/lake.schema.json", "title": "LakeEvent", "description": "データレイクの表 events の1行(docs/design/insights.md 4.1節)。core が track と端末の出来事を受けた時に、Pipeline appgrowstack-insights-events に送る形。人の id(person_id・install_id・uid)は書かず、製品ごとの person_key を書く。day はプロジェクトの default_time_zone の日付で、core が受けた時に決める。利用者が書いた文は入れない", "type": "object", "additionalProperties": false, "required": ["project", "platform", "event_id", "name", "at", "day", "person_key", "session_id", "screen", "app_version", "channel", "country", "audience", "props"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "event_id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "person_key": { "$ref": "#/$defs/personKey" }, "session_id": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/sessionId" }, { "type": "null" }] }, "screen": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/screenName" }, { "type": "null" }] }, "app_version": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/appVersion" }, { "type": "null" }] }, "channel": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/buildChannel" }, { "type": "null" }] }, "country": { "description": "ISO 3166-1 alpha-2。分からなければ null", "type": ["string", "null"], "pattern": "^[A-Z]{2}$" }, "audience": { "description": "受けた時の見分け。数えるときは people_changes のその人の最新の行で決める", "$ref": "../common.schema.json#/$defs/audience" }, "props": { "description": "core が受け入れた型の付いた値だけを JSON の文字にした物", "type": "string", "maxLength": 8192 } }, "$defs": { "personKey": { "title": "PersonKey", "description": "insights が製品と人ごとに作るランダムな32文字(4.2節)。対応は insights_person_key の1行だけが持ち、forget で消す。2つのアプリで同じ人に同じ値を付けない", "type": "string", "pattern": "^[A-Za-z0-9]{32}$" }, "subscription": { "title": "LakeSubscription", "description": "表 subscriptions の1行。core が subscription(RevenueCat の webhook の1件)を受けた時に送る", "type": "object", "additionalProperties": false, "required": ["project", "event_id", "at", "day", "person_key", "type", "period_type", "product_id", "offering", "price_usd", "store", "country", "audience"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "event_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "person_key": { "$ref": "#/$defs/personKey" }, "type": { "description": "RevenueCat の event.type(INITIAL_PURCHASE・RENEWAL・CANCELLATION など)", "type": "string", "maxLength": 40 }, "period_type": { "description": "TRIAL・INTRO・NORMAL・PROMOTIONAL", "type": ["string", "null"], "maxLength": 20 }, "product_id": { "type": ["string", "null"], "maxLength": 200 }, "offering": { "type": ["string", "null"], "maxLength": 200 }, "price_usd": { "type": ["number", "null"] }, "store": { "type": ["string", "null"], "maxLength": 40 }, "country": { "type": ["string", "null"], "pattern": "^[A-Z]{2}$" }, "audience": { "$ref": "../common.schema.json#/$defs/audience" } } }, "peopleChange": { "title": "LakePeopleChange", "description": "表 people_changes の1行。insights が毎日、core の people_person と acq_attribution(人の紐付け)の前の日に変わった行から書く。寄せた人(merged_from)は寄せた先の person_key を merged_into に書く", "type": "object", "additionalProperties": false, "required": ["project", "day", "person_key", "audience", "first_seen_day", "platform", "country", "subscription", "source", "campaign", "merged_into"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "person_key": { "$ref": "#/$defs/personKey" }, "audience": { "$ref": "../common.schema.json#/$defs/audience" }, "first_seen_day": { "$ref": "../common.schema.json#/$defs/day" }, "platform": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/platform" }, { "type": "null" }] }, "country": { "type": ["string", "null"], "pattern": "^[A-Z]{2}$" }, "subscription": { "description": "課金の状態(none・trial・active・grace・expired)", "type": ["string", "null"], "maxLength": 20 }, "source": { "description": "獲得のチャネルの id(acq_attribution の channel。決まらない人は unknown)", "type": ["string", "null"], "maxLength": 80 }, "campaign": { "type": ["string", "null"], "maxLength": 80 }, "merged_into": { "anyOf": [{ "$ref": "#/$defs/personKey" }, { "type": "null" }] } } }, "delivery": { "title": "LakeDelivery", "description": "表 deliveries の1行。insights が毎日、notify の D1 の前の日の配信から書く", "type": "object", "additionalProperties": false, "required": ["project", "day", "send_id", "person_key", "campaign", "kind", "variant", "side", "propensity", "sent_at", "opened_at", "converted_at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "send_id": { "type": "string", "minLength": 1, "maxLength": 64 }, "person_key": { "$ref": "#/$defs/personKey" }, "campaign": { "type": "string", "maxLength": 64 }, "kind": { "type": "string", "maxLength": 40 }, "variant": { "type": ["string", "null"], "maxLength": 64 }, "side": { "description": "treatment・holdout", "type": ["string", "null"], "maxLength": 20 }, "propensity": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/propensity" }, { "type": "null" }] }, "sent_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "opened_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "converted_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "decision": { "title": "LakeDecision", "description": "表 decisions の1行。insights が毎日、core の decision_log の前の日の行から書く", "type": "object", "additionalProperties": false, "required": ["project", "day", "decision_id", "person_key", "surface", "unit", "arm", "propensity", "policy_version", "app_version"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "decision_id": { "type": "string", "minLength": 1, "maxLength": 64 }, "person_key": { "$ref": "#/$defs/personKey" }, "surface": { "type": "string", "maxLength": 40 }, "unit": { "type": "string", "maxLength": 80 }, "arm": { "type": "string", "maxLength": 80 }, "propensity": { "$ref": "../common.schema.json#/$defs/propensity" }, "policy_version": { "$ref": "../common.schema.json#/$defs/policyVersion" }, "app_version": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/appVersion" }, { "type": "null" }] } } } } },
73
+ "insights/ledger.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/ledger.schema.json", "title": "LedgerHypothesis", "description": "仮説の記録の1つの仮説(ledger_hypothesis・docs/design/insights.md 10.1節)。どのアプリの・どの対象で・何を変えると・何がどう動くかと、その結論。R5 通知・R12 ストアの素材・R13 の指摘・手で足した仮説を全部ここに置く。outcome と decision は数の決まりで決め、AI と管理のパスは書けない", "type": "object", "additionalProperties": false, "required": ["id", "project", "title", "surface", "appeal", "expectation", "decides", "action", "metric", "check_at", "method", "parent", "spread_reason", "rule", "source", "status", "outcome", "decision", "decided_at", "extensions", "effect", "result", "conclusion", "next", "applied_at", "created_by", "created_at", "updated_at", "concluded_at", "check_note"], "properties": { "id": { "$ref": "#/$defs/hypothesisId" }, "project": { "description": "製品。全部の製品に当てる仮説は null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "title": { "description": "一覧に出す題。30字まで。何を変えて、何が上がるかを書き、長い説明は expectation に書く。流れが足して題の無い仮説は null", "type": ["string", "null"], "minLength": 1, "maxLength": 30 }, "surface": { "$ref": "#/$defs/surface" }, "appeal": { "description": "訴求。何を訴えるか。creative・notify・inapp で使う", "type": ["string", "null"], "maxLength": 300 }, "expectation": { "description": "何が変わると見込むか", "type": "string", "minLength": 1, "maxLength": 500 }, "decides": { "description": "検証の目的。結果で何を決めるか", "type": "string", "minLength": 1, "maxLength": 300 }, "action": { "$ref": "#/$defs/action" }, "metric": { "description": "確認する指標", "anyOf": [{ "$ref": "metric.schema.json#/$defs/metricName" }, { "type": "null" }] }, "check_at": { "description": "確認の日。applied_at から決める。当てる前は null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] }, "method": { "anyOf": [{ "$ref": "#/$defs/method" }, { "type": "null" }] }, "parent": { "description": "別の製品で当たった仮説を広げた時の元の仮説", "anyOf": [{ "$ref": "#/$defs/hypothesisId" }, { "type": "null" }] }, "spread_reason": { "description": "元の仮説が supported になる前に広げた理由。parent が supported でない仮説は必ず持つ(docs/design/insights.md 10.6節)", "type": ["string", "null"], "maxLength": 300 }, "rule": { "$ref": "#/$defs/rule" }, "source": { "$ref": "#/$defs/source" }, "status": { "$ref": "#/$defs/status" }, "outcome": { "anyOf": [{ "$ref": "#/$defs/outcome" }, { "type": "null" }] }, "decision": { "description": "出すかの判断。決める日に毎日の流れが rule で書く。extend の間は testing のまま", "anyOf": [{ "$ref": "#/$defs/decision" }, { "type": "null" }] }, "decided_at": { "description": "decision を書いた時刻", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "extensions": { "description": "extend で決める日を延ばした回数", "type": "integer", "minimum": 0 }, "effect": { "description": "上げ幅(指標の単位)。結論の前は null", "type": ["number", "null"] }, "result": { "description": "確認の日に写した数(実験の答えか、前後の比べの答え)。結論の前は null", "anyOf": [{ "$ref": "#/$defs/result" }, { "type": "null" }] }, "conclusion": { "description": "結論の文。unmeasured は1段落目が比べられなかった理由の平易な1文で、空行の後に数と詳しい理由(8.7節)", "type": ["string", "null"], "maxLength": 1000 }, "next": { "description": "次にすること。unmeasured は比べられなかった理由ごとの別の比べ方(8.7節)", "type": ["string", "null"], "maxLength": 500 }, "applied_at": { "description": "打ち手を当てた時刻。status を testing にする", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "created_by": { "description": "作った主体(usr_・agt_・sys:)", "type": "string", "maxLength": 80 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "concluded_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "check_note": { "description": "答え合わせを待っている理由。確認の日が来たのに数がそろわない testing の仮説に、毎日の流れが書く(8.7節)。結論を書いたら null", "anyOf": [{ "$ref": "#/$defs/checkNote" }, { "type": "null" }] } }, "$defs": { "checkNote": { "title": "LedgerCheckNote", "description": "答え合わせを待っている理由と、最後に見た日", "type": "object", "additionalProperties": false, "required": ["day", "reason", "until"], "properties": { "day": { "description": "最後に答え合わせを試した日(製品の時間帯)", "$ref": "../common.schema.json#/$defs/day" }, "reason": { "type": "string", "minLength": 1, "maxLength": 1000 }, "until": { "description": "数がそろわないまま、この日に unmeasured で結論を書く(確認の日の7日後)", "$ref": "../common.schema.json#/$defs/day" } } }, "hypothesisId": { "title": "LedgerHypothesisId", "description": "仮説の記録の仮説の id。R12 の案・実験・参考の素材と R5 の案もこの id で仮説を指し、creative と notify は INSIGHTS.ledgerGet で引く", "type": "string", "pattern": "^hyp_[A-Za-z0-9]{16}$" }, "learningId": { "title": "LedgerLearningId", "type": "string", "pattern": "^lrn_[A-Za-z0-9]{16}$" }, "surface": { "title": "LedgerSurface", "description": "仮説の対象", "enum": ["onboarding", "paywall", "pricing", "notify", "inapp", "config", "creative", "aso", "ads", "acquisition", "product", "release"] }, "method": { "title": "LedgerCheckMethod", "description": "比べ方。experiment 無作為に分けた実験(R3・R9・R12)・before_after リリースや変更の前後(R11 の前後の数と同じ式)", "enum": ["experiment", "before_after"] }, "source": { "title": "LedgerSource", "description": "どこから来たか。finding R13 の指摘・agent エージェント・owner 本人・import 1回だけの移し替え(app-playbook の plays・R12 と R5 の前の表)", "enum": ["finding", "agent", "owner", "import"] }, "status": { "title": "LedgerHypothesisStatus", "description": "proposed → open → testing → concluded。途中で rejected_proposal(採らなかった)・abandoned(試さずにやめた)", "enum": ["proposed", "open", "testing", "concluded", "rejected_proposal", "abandoned"] }, "outcome": { "title": "LedgerOutcome", "description": "知識としての判定(8.7節)。数がそろって比べた時、仮説の側が良い確率が95%を超えれば supported、悪い確率が95%を超えれば rejected、ほかは inconclusive(差が分からない)。前後の比べ(before_after)は数がそろっても inconclusive。数がそろわず比べられなかった時(数が無い・指標や当てた日や実験が無い・前か後の窓に記録が無い・実験の人数が足りない)は unmeasured(検証できなかった)。出すかは outcome でなく decision で決める。判定の表は schema/cases/insights/outcome.json", "enum": ["supported", "rejected", "inconclusive", "unmeasured"] }, "decision": { "title": "LedgerDecision", "description": "出すかの判断(8.9節)。keep 残す・revert 戻す・extend 決める日を延ばす。outcome と別に、rule の keep_probability で決める。前後の比べも同じ規則で決める。判定の表は schema/cases/insights/decision.json", "enum": ["keep", "revert", "extend"] }, "guardrail": { "title": "LedgerGuardrail", "description": "悪くなってはいけない指標と非劣性の幅(比べる側の値に対する割合)", "type": "object", "additionalProperties": false, "required": ["metric", "margin"], "properties": { "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "margin": { "type": "number", "minimum": 0, "maximum": 0.5 } } }, "rule": { "title": "LedgerDecisionRule", "description": "決める規則(8.9節)。既定値は組織の決まり(ledger の policy)から入る。needed_per_arm と weeks_needed は足した時に R3 の plan で計算する。数で計算できない指標は null", "type": "object", "additionalProperties": false, "required": ["keep_probability", "guardrails", "max_extensions", "extend_days", "needed_per_arm", "weeks_needed", "stop_at_den"], "properties": { "keep_probability": { "description": "仮説の側が良い確率がこれ以上で keep、悪い確率がこれ以上で revert", "type": "number", "minimum": 0.5, "maximum": 0.99 }, "guardrails": { "type": "array", "maxItems": 5, "items": { "$ref": "#/$defs/guardrail" } }, "max_extensions": { "description": "extend できる回数。超えたら期待損失の小さい方に決める", "type": "integer", "minimum": 0, "maximum": 3 }, "extend_days": { "description": "extend で決める日を延ばす日数", "type": "integer", "minimum": 7, "maximum": 90 }, "needed_per_arm": { "description": "1つの側に要る人数(R3 の plan)", "type": ["integer", "null"], "minimum": 1 }, "weeks_needed": { "description": "今の人の流れで needed_per_arm がそろう週", "type": ["number", "null"], "minimum": 0 }, "stop_at_den": { "description": "当てた日からの分母がこの数に届いても分子が0なら、決める日を待たずに rule_hit で知らせる", "type": ["integer", "null"], "minimum": 1 } } }, "ruleInput": { "title": "LedgerDecisionRuleInput", "description": "仮説を足す時と直す時の規則。書かなかった項目は組織の決まりの既定値になる", "type": "object", "additionalProperties": false, "properties": { "keep_probability": { "type": "number", "minimum": 0.5, "maximum": 0.99 }, "guardrails": { "type": "array", "maxItems": 5, "items": { "$ref": "#/$defs/guardrail" } }, "max_extensions": { "type": "integer", "minimum": 0, "maximum": 3 }, "extend_days": { "type": "integer", "minimum": 7, "maximum": 90 }, "stop_at_den": { "type": "integer", "minimum": 1 } } }, "actionKind": { "title": "LedgerActionKind", "description": "打ち手の種類。campaign 画面の中の件・flag 設定・experiment 実験・notify_variant 通知の文面・creative_test 素材の実験・code アプリのコード・store ストアの値段・ads_budget 広告の予算・ads_change Apple Ads の変更(止める・入札・除く語・足す)・content 記事・video 動画・none 見守るだけ", "enum": ["campaign", "flag", "experiment", "notify_variant", "creative_test", "code", "store", "ads_budget", "ads_change", "content", "video", "none"] }, "action": { "title": "LedgerAction", "description": "打ち手の種類と中身。基盤に無い打ち手(code・store・ads_budget)は Claude Code に渡す依頼の文を detail に書く", "type": "object", "additionalProperties": false, "required": ["kind", "detail"], "properties": { "kind": { "$ref": "#/$defs/actionKind" }, "detail": { "type": "string", "maxLength": 2000 } } }, "result": { "title": "LedgerResult", "description": "確認の日に写した数。後から元の数が変わっても、結論はこの数で読む", "type": "object", "additionalProperties": false, "required": ["method", "metric", "control", "treatment", "probability_better", "copied_at"], "properties": { "method": { "$ref": "#/$defs/method" }, "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "control": { "description": "比べる側(実験の control・前後の前)", "$ref": "metric.schema.json#/$defs/interval" }, "treatment": { "description": "仮説の側(実験の treatment・前後の後)", "$ref": "metric.schema.json#/$defs/interval" }, "probability_better": { "description": "仮説の側が良い確率。出せなければ null", "type": ["number", "null"], "minimum": 0, "maximum": 1 }, "copied_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "linkKind": { "title": "LedgerLinkKind", "description": "仮説とつながる物の種類。knowledge は app-playbook の知見の行(paywall#P1 の形)。doc は製品の repo の実験の設計の文書(GitHub の https の URL・docs/design/insights.md 10.8節)", "enum": ["finding", "campaign", "flag", "experiment", "notify_campaign", "variant", "creative_test", "creative_variant", "reference", "release_change", "page", "acq_node", "knowledge", "doc"] }, "link": { "title": "LedgerLink", "description": "仮説とつながる物の1行(ledger_link)", "type": "object", "additionalProperties": false, "required": ["kind", "ref"], "properties": { "kind": { "$ref": "#/$defs/linkKind" }, "ref": { "description": "つながる物の id。doc は URL", "type": "string", "minLength": 1, "maxLength": 300 } } }, "learningSource": { "title": "LedgerLearningSource", "description": "学んだことを書いた所。insights 毎日の流れの答え合わせ・notify R5 の週の改善・creative R12 の週の流れ・agent エージェント・owner 本人", "enum": ["insights", "notify", "creative", "agent", "owner"] }, "learning": { "title": "LedgerLearning", "description": "学んだことの1行(ledger_learning)。追記だけ。仮説の id は任意", "type": "object", "additionalProperties": false, "required": ["id", "project", "hypothesis", "surface", "text", "detail", "source", "created_by", "created_at"], "properties": { "id": { "$ref": "#/$defs/learningId" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "hypothesis": { "anyOf": [{ "$ref": "#/$defs/hypothesisId" }, { "type": "null" }] }, "surface": { "anyOf": [{ "$ref": "#/$defs/surface" }, { "type": "null" }] }, "text": { "description": "読む人の言葉で書いた学んだこと。内部の名前(packages/contract の internalTerms)を入れない(docs/design/insights.md 10.5節)", "type": "string", "minLength": 1, "maxLength": 2000 }, "detail": { "description": "作る側向けのメモ(指標や出来事の名前・id・数え方の細部)。console は「詳しく」の中だけに出す", "type": ["string", "null"], "maxLength": 2000 }, "source": { "$ref": "#/$defs/learningSource" }, "created_by": { "type": "string", "maxLength": 80 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "hypothesisInput": { "title": "LedgerHypothesisInput", "description": "POST /v1/ledger/hypotheses(addLedgerHypothesis)の本文と、InsightsRpc.ledgerPut の仮説。outcome・decision・result・effect・結論は書けない(結論は ledgerConclude)。管理のパスで足した仮説は open で始まり、title(30字まで)と metric(metrics.toml に有る物)が要る。parent が supported でなければ spread_reason が要る", "type": "object", "additionalProperties": false, "required": ["surface", "expectation", "decides", "action"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "title": { "description": "一覧に出す題。30字まで。何を変えて、何が上がるかを書き、長い説明は expectation に書く", "type": "string", "minLength": 1, "maxLength": 30 }, "surface": { "$ref": "#/$defs/surface" }, "appeal": { "type": "string", "minLength": 1, "maxLength": 300 }, "expectation": { "type": "string", "minLength": 1, "maxLength": 500 }, "decides": { "type": "string", "minLength": 1, "maxLength": 300 }, "action": { "$ref": "#/$defs/action" }, "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "method": { "$ref": "#/$defs/method" }, "parent": { "$ref": "#/$defs/hypothesisId" }, "spread_reason": { "type": "string", "minLength": 1, "maxLength": 300 }, "rule": { "$ref": "#/$defs/ruleInput" }, "links": { "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/link" } } } }, "hypothesisUpdate": { "title": "LedgerHypothesisUpdate", "description": "PATCH /v1/ledger/hypotheses/:hypothesis(updateLedgerHypothesis)の本文。書いた項目だけ変える。status は open(proposed から)と abandoned だけ。結論の文と次にすることは concluded の仮説だけに書ける。outcome は書けない", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "status": { "enum": ["open", "abandoned"] }, "title": { "description": "一覧に出す題。30字まで。何を変えて、何が上がるかを書き、長い説明は expectation に書く", "type": "string", "minLength": 1, "maxLength": 30 }, "appeal": { "type": "string", "minLength": 1, "maxLength": 300 }, "expectation": { "type": "string", "minLength": 1, "maxLength": 500 }, "decides": { "type": "string", "minLength": 1, "maxLength": 300 }, "action": { "$ref": "#/$defs/action" }, "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "method": { "$ref": "#/$defs/method" }, "rule": { "$ref": "#/$defs/ruleInput" }, "spread_reason": { "type": "string", "minLength": 1, "maxLength": 300 }, "conclusion": { "type": "string", "minLength": 1, "maxLength": 1000 }, "next": { "type": "string", "minLength": 1, "maxLength": 500 }, "links": { "description": "足すつながり。消さない", "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/link" } } } }, "appliedRequest": { "title": "LedgerAppliedRequest", "description": "POST /v1/ledger/hypotheses/:hypothesis/applied(markLedgerApplied)の本文。基盤に無い打ち手を当てた日を書き、status を testing にして確認の日を決める。open でない仮説は 409 conflict。前後の比べで、前の窓が指標の記録の始まりより前なら 400 input。R11 の変更につないだ仮説は、毎日の流れがバージョンの公開日から書く", "type": "object", "additionalProperties": false, "required": ["applied_at"], "properties": { "applied_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "check_after_days": { "description": "確認の日を当てた日から何日後にするか。既定28", "type": "integer", "minimum": 7, "maximum": 180 }, "note": { "type": "string", "maxLength": 300 } } }, "learningInput": { "title": "LedgerLearningInput", "description": "POST /v1/ledger/learnings(addLedgerLearning)の本文と、InsightsRpc.ledgerLearn の学んだこと", "type": "object", "additionalProperties": false, "required": ["text"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "hypothesis": { "$ref": "#/$defs/hypothesisId" }, "surface": { "$ref": "#/$defs/surface" }, "text": { "description": "読む人の言葉で書いた学んだこと。内部の名前を入れない(docs/design/insights.md 10.5節)", "type": "string", "minLength": 1, "maxLength": 2000 }, "detail": { "description": "作る側向けのメモ。console は「詳しく」の中だけに出す", "type": "string", "minLength": 1, "maxLength": 2000 } } }, "conclusionInput": { "title": "LedgerConclusionInput", "description": "InsightsRpc.ledgerConclude の入力。creative と notify の週の流れが、実験の答えから数の決まりで決めた outcome と写した数を書く。testing でない仮説は conflict", "type": "object", "additionalProperties": false, "required": ["hypothesis", "outcome", "effect", "result", "conclusion", "next"], "properties": { "hypothesis": { "$ref": "#/$defs/hypothesisId" }, "outcome": { "$ref": "#/$defs/outcome" }, "effect": { "type": ["number", "null"] }, "result": { "$ref": "#/$defs/result" }, "conclusion": { "type": "string", "minLength": 1, "maxLength": 1000 }, "next": { "type": "string", "minLength": 1, "maxLength": 500 } } }, "hypothesisList": { "title": "LedgerHypothesisList", "description": "GET /v1/ledger/hypotheses(listLedgerHypotheses)の答え。新しい順。?project=&surface=&status=&outcome=。呼び手の組織の、ledger.read で見えるプロジェクトの分と、project が null の仮説", "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "maxItems": 500, "items": { "$ref": "#" } } } }, "hypothesisDetail": { "title": "LedgerHypothesisDetail", "description": "GET /v1/ledger/hypotheses/:hypothesis(getLedgerHypothesis)の答え。つながる物・学んだこと・広げた子の仮説", "type": "object", "additionalProperties": false, "required": ["hypothesis", "links", "learnings", "children"], "properties": { "hypothesis": { "$ref": "#" }, "links": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/link" } }, "learnings": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/learning" } }, "children": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/hypothesisId" } } } }, "learningList": { "title": "LedgerLearningList", "description": "GET /v1/ledger/learnings(listLedgerLearnings)の答え。新しい順。?project=&surface=&since=", "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/learning" } } } }, "searchHit": { "title": "LedgerSearchHit", "description": "ナレッジの検索の1件。hypothesis 仮説の文と結論・learning 学んだこと・reference R12 の参考の素材のメモとタグ(中身は creative の D1 にある)・knowledge app-playbook の知見の行(id は paywall#P1 の形)", "type": "object", "additionalProperties": false, "required": ["kind", "id", "project", "snippet", "rank", "url"], "properties": { "kind": { "$ref": "#/$defs/searchKind" }, "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "snippet": { "description": "当たった所の前後", "type": "string", "maxLength": 400 }, "rank": { "description": "FTS5 の bm25。小さいほど近い", "type": "number" }, "url": { "description": "knowledge の行を GitHub で開く URL(取り込んだ commit の行)。ほかは null", "type": ["string", "null"], "maxLength": 400 } } }, "searchKind": { "title": "LedgerSearchKind", "description": "検索で引く物の種類", "enum": ["hypothesis", "learning", "reference", "knowledge"] }, "searchResult": { "title": "LedgerSearchResult", "description": "GET /v1/ledger/search(searchLedger)の答え。?q=&project=&surface=&kind=&limit=。日本語は trigram なので、q は3文字以上", "type": "object", "additionalProperties": false, "required": ["q", "items"], "properties": { "q": { "type": "string", "minLength": 3, "maxLength": 200 }, "items": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/searchHit" } } } }, "knowledgeRef": { "title": "LedgerKnowledgeRef", "description": "知見の行の id。知見の文書のファイルの名前(.md を除く)と行の番号(paywall#P1)", "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*#[A-Za-z0-9][A-Za-z0-9-]*$", "maxLength": 64 }, "knowledgeRowInput": { "title": "LedgerKnowledgeRowInput", "description": "取り込む知見の1行。text は表の行のセルを「 · 」でつないだ文", "type": "object", "additionalProperties": false, "required": ["ref", "heading", "line", "text"], "properties": { "ref": { "$ref": "#/$defs/knowledgeRef" }, "heading": { "description": "行がある節の見出し", "type": "string", "maxLength": 200 }, "line": { "description": "ファイルの中の行の番号(1から)", "type": "integer", "minimum": 1 }, "text": { "type": "string", "minLength": 1, "maxLength": 4000 } } }, "knowledgeSync": { "title": "LedgerKnowledgeSync", "description": "PUT /v1/ledger/knowledge(putLedgerKnowledge)の本文。知見の文書のフォルダ(app-playbook の knowledge)の行を全部送り、前に取り込んだ行と入れ替える。送らなかった行は消す。基盤は送られた行を持つだけで、元の文書に書き返さない", "type": "object", "additionalProperties": false, "required": ["repo", "dir", "commit", "rows"], "properties": { "repo": { "$ref": "../registry/project.schema.json#/$defs/repoName" }, "dir": { "description": "repo の根からの知見の文書のフォルダ(knowledge)。行の URL に使う", "type": "string", "pattern": "^[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)*$", "maxLength": 200 }, "commit": { "description": "読んだ app-playbook の commit", "type": "string", "pattern": "^[0-9a-f]{40}$" }, "rows": { "type": "array", "minItems": 1, "maxItems": 3000, "items": { "$ref": "#/$defs/knowledgeRowInput" } } } }, "knowledgeSyncResult": { "title": "LedgerKnowledgeSyncResult", "description": "putLedgerKnowledge の答え", "type": "object", "additionalProperties": false, "required": ["commit", "rows", "added", "changed", "removed"], "properties": { "commit": { "type": "string" }, "rows": { "description": "取り込んだ後の行の数", "type": "integer", "minimum": 0 }, "added": { "type": "integer", "minimum": 0 }, "changed": { "type": "integer", "minimum": 0 }, "removed": { "type": "integer", "minimum": 0 } } }, "knowledgeRow": { "title": "LedgerKnowledgeRow", "description": "取り込んだ知見の1行と、その行につないだ仮説(ledger_link の knowledge)", "type": "object", "additionalProperties": false, "required": ["ref", "heading", "text", "url", "commit", "synced_at", "hypotheses"], "properties": { "ref": { "$ref": "#/$defs/knowledgeRef" }, "heading": { "type": "string", "maxLength": 200 }, "text": { "type": "string", "maxLength": 4000 }, "url": { "description": "取り込んだ commit のその行を GitHub で開く URL", "type": "string", "maxLength": 400 }, "commit": { "type": "string" }, "synced_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "hypotheses": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/knowledgeHypothesis" } } } }, "knowledgeHypothesis": { "title": "LedgerKnowledgeHypothesis", "description": "知見の行につないだ仮説の今の状態", "type": "object", "additionalProperties": false, "required": ["id", "project", "title", "status", "outcome", "decision"], "properties": { "id": { "$ref": "#/$defs/hypothesisId" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "title": { "type": ["string", "null"], "maxLength": 30 }, "status": { "$ref": "#/$defs/status" }, "outcome": { "anyOf": [{ "$ref": "#/$defs/outcome" }, { "type": "null" }] }, "decision": { "anyOf": [{ "$ref": "#/$defs/decision" }, { "type": "null" }] } } }, "knowledgeList": { "title": "LedgerKnowledgeList", "description": "GET /v1/ledger/knowledge(listLedgerKnowledge)の答え。?file=<ファイルの名前>&linked=true(仮説につないだ行だけ)。ファイルと行の番号の順", "type": "object", "additionalProperties": false, "required": ["repo", "commit", "synced_at", "items"], "properties": { "repo": { "description": "取り込んだ repo。まだ取り込んでいなければ null", "type": ["string", "null"] }, "commit": { "type": ["string", "null"] }, "synced_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "items": { "type": "array", "maxItems": 3000, "items": { "$ref": "#/$defs/knowledgeRow" } } } } } },
74
+ "insights/metric.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/metric.schema.json", "title": "InsightsMetricAnswer", "description": "GET /v1/insights/metrics/:project/:metric(getInsightsMetric)の答え。packages/metrics/metrics.toml で定義した1つの指標の、日ごとの値(docs/design/insights.md 6節)。?from=&to=&dims=&audience=。数えるのは既定で見分けが real の人だけで、外した人の数を excluded に必ず付ける(5節)", "type": "object", "additionalProperties": false, "required": ["project", "metric", "unit", "agg", "from", "to", "audience", "dims", "points", "excluded", "missing", "as_of", "benchmark"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "metric": { "$ref": "#/$defs/metricName" }, "unit": { "$ref": "#/$defs/unit" }, "agg": { "$ref": "#/$defs/agg" }, "from": { "$ref": "../common.schema.json#/$defs/day" }, "to": { "$ref": "../common.schema.json#/$defs/day" }, "audience": { "description": "数えた見分け。既定は [real]。?audience=all で5つ全部", "type": "array", "minItems": 1, "maxItems": 5, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/audience" } }, "dims": { "description": "内訳の軸(country・platform・source など)。無ければ空", "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/dimName" } }, "points": { "type": "array", "maxItems": 5000, "items": { "$ref": "#/$defs/point" } }, "excluded": { "description": "期間の中で外した人の数(見分けごと)。real の欄は数えた人。外の数(ASC・Apple Ads・Search Console)は人で外せないので全部0にし、missing に理由を書く", "$ref": "../common.schema.json#/$defs/audienceCounts" }, "missing": { "description": "答えに含まれない物の理由(取り込み元のキーが無い・その日の取り込みが partial・中国本土の利用者は出来事に出ない・為替の率がまだ無い)。1つ1文", "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 200 } }, "benchmark": { "description": "指標の相場(packages/metrics/metrics.toml の benchmark.value)。相場の無い指標は null。console のホームの判定は、継続がこの半分に届かない時に注意にする", "type": ["number", "null"] }, "as_of": { "description": "答えの元の新しさ。insights_observation の computed_at の最小、今日の分を core から読んだ時はその時刻", "$ref": "../common.schema.json#/$defs/epochMs" }, "query": { "description": "答えを作った呼び出しの記録(insights_query の id)。検算と根拠に使う", "$ref": "#/$defs/queryId" } }, "$defs": { "metricName": { "title": "MetricName", "description": "<名前空間>.<名前>。名前空間は active・funnel・retention・cohort・sub・sales・store・ads・acq・aso・web・social・notify・sessions・agent(docs/design/insights.md 6節)と、製品の KPI の kpi(docs/design/kpi.md)", "type": "string", "pattern": "^(active|funnel|retention|cohort|sub|sales|store|ads|acq|aso|web|social|notify|sessions|agent|kpi)\\.[a-z][a-z0-9_]{0,62}$" }, "dimName": { "title": "MetricDimName", "description": "内訳の軸の名前。軸の一覧は指標ごとに metrics.toml が持つ", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,31}$" }, "unit": { "title": "MetricUnit", "description": "count 件数・people 人数・ratio 0〜1 の割合・usd ドル・jpy 円・seconds 秒・rank 順位", "enum": ["count", "people", "ratio", "usd", "jpy", "seconds", "rank"] }, "agg": { "title": "MetricAgg", "description": "期間の集め方。sum 足す・last 最後の日の値・avg 日の値の平均(DAU・順位・表示シェア)・ratio 分子と分母を別に足して割る", "enum": ["sum", "last", "avg", "ratio"] }, "queryId": { "title": "InsightsQueryId", "description": "insights_query の id", "type": "string", "pattern": "^qry_[A-Za-z0-9]{16}$" }, "point": { "title": "MetricPoint", "description": "1日(と内訳の1つ)の値。value が null の日は、窓が閉じていないか取り込めていない(missing に理由)", "type": "object", "additionalProperties": false, "required": ["day", "value", "den", "dims"], "properties": { "day": { "$ref": "../common.schema.json#/$defs/day" }, "value": { "type": ["number", "null"] }, "den": { "description": "割合の分母。割合でない指標は null", "type": ["integer", "null"], "minimum": 0 }, "dims": { "description": "内訳の軸ごとの値。内訳が無ければ空", "type": "object", "maxProperties": 3, "additionalProperties": { "type": "string", "maxLength": 80 } } } }, "interval": { "title": "MetricInterval", "description": "期間の値と95%の幅(割合は Wilson、件数はポアソン分布)。分母が min_den に届かない割合は low と high を null にし、向きだけを読む(15節)", "type": "object", "additionalProperties": false, "required": ["value", "den", "low", "high"], "properties": { "value": { "type": ["number", "null"] }, "den": { "type": ["integer", "null"], "minimum": 0 }, "low": { "type": ["number", "null"] }, "high": { "type": ["number", "null"] } } }, "compare": { "title": "InsightsMetricCompare", "description": "GET /v1/insights/metrics/:project/:metric/compare(compareInsightsMetric)の答え。ある日の前後 weeks 週の値と95%の幅。?at=&weeks=。前後の比べは無作為に分けていないので、因果と読まない。流入元の内訳を by_source に必ず付ける(15節)", "type": "object", "additionalProperties": false, "required": ["project", "metric", "unit", "at", "weeks", "before", "after", "separated", "by_source", "excluded", "missing", "as_of"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "metric": { "$ref": "#/$defs/metricName" }, "unit": { "$ref": "#/$defs/unit" }, "at": { "description": "境の日。この日から後の側に入る", "$ref": "../common.schema.json#/$defs/day" }, "weeks": { "type": "integer", "minimum": 1, "maximum": 12 }, "before": { "$ref": "#/$defs/interval" }, "after": { "$ref": "#/$defs/interval" }, "separated": { "description": "前と後の95%の幅が重ならないか。幅が出せない時は null", "type": ["boolean", "null"] }, "by_source": { "description": "流入元ごとの前と後", "type": "array", "maxItems": 20, "items": { "type": "object", "additionalProperties": false, "required": ["source", "before", "after"], "properties": { "source": { "type": "string", "maxLength": 80 }, "before": { "$ref": "#/$defs/interval" }, "after": { "$ref": "#/$defs/interval" } } } }, "excluded": { "$ref": "../common.schema.json#/$defs/audienceCounts" }, "missing": { "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 200 } }, "as_of": { "$ref": "../common.schema.json#/$defs/epochMs" }, "query": { "$ref": "#/$defs/queryId" } } } } },
75
+ "insights/portfolio.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/portfolio.schema.json", "title": "PortfolioReport", "description": "GET /v1/insights/portfolio(getInsightsPortfolio)の答え。毎週月曜の流れが作る、製品 × インストールの月のコホートの週の表と、広告費の案・広げる候補(docs/design/insights.md 10.3節・11節)。?week=(月曜の日付。無ければ新しい物)。呼び手の組織の、insights.read で見えるプロジェクトの分だけ。表に載るのは R1 の track が portfolio の製品。Claude Code の額は参考の値なので入れない", "type": "object", "additionalProperties": false, "required": ["week", "generated_at", "usd_jpy", "rows", "missing", "ads_budget", "spread"], "properties": { "week": { "description": "表を作った週の月曜", "$ref": "../common.schema.json#/$defs/day" }, "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "usd_jpy": { "description": "Apple Ads の費用(円)をドルにした率(1ドルが何円か)。広告費の案の順は率に依らない", "type": "number", "exclusiveMinimum": 0 }, "rows": { "type": "array", "maxItems": 1000, "items": { "$ref": "#/$defs/row" } }, "missing": { "description": "数の元が無く、行を出せなかった製品と理由。0 の行にしない", "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/missing" } }, "ads_budget": { "description": "その月の広告費の案。毎月1日の後の最初の表だけに付く。ほかは null", "anyOf": [{ "$ref": "#/$defs/adsBudget" }, { "type": "null" }] }, "spread": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/spreadCandidate" } } }, "$defs": { "rate": { "title": "PortfolioRate", "description": "割合と分母。窓が閉じた人だけで数え、den はその人数(窓が閉じた人がいなければ value は null)。人数が30に届かない値は small を true にし、画面は色を付けずに人数を横に出す", "type": "object", "additionalProperties": false, "required": ["value", "den", "small"], "properties": { "value": { "type": ["number", "null"] }, "den": { "type": "integer", "minimum": 0 }, "small": { "type": "boolean" } } }, "row": { "title": "PortfolioRow", "description": "1つの製品の1つのインストールの月のコホート。数えるのは core の見分けが real の人だけ。インストールの日はその人が初めて開いた日(プロジェクトの時間帯)。d1・d7・d28 は使い始めてから1・7・28日後に開いた人の割合(数字の画面の継続と同じ retention.dN の分子と分母を月で足した物。N日後が来た人だけが分母)、install_to_trial・install_to_paid はインストールから30日以内に無料体験を始めた・有料になった人の割合、trial_to_paid は無料体験を始めた人のうち30日以内に有料になった人の割合(RevenueCat の webhook・サンドボックスを除く)", "type": "object", "additionalProperties": false, "required": ["project", "cohort", "stage", "installs", "ads_installs", "d1", "d7", "d28", "install_to_trial", "trial_to_paid", "install_to_paid", "net_per_install_30", "net_per_install_90", "cpi_ads", "cpi_all", "payback_days", "benchmark_gap", "focus", "open_hypotheses", "testing_hypotheses", "spread_candidates", "missing"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "cohort": { "description": "インストールの月(YYYY-MM)", "type": "string", "pattern": "^\\d{4}-\\d{2}$" }, "stage": { "anyOf": [{ "$ref": "../registry/project.schema.json#/$defs/stage" }, { "type": "null" }] }, "installs": { "description": "初めて開いた日がその月の、見分けが real の人(core の people_activity_day)。手取りと全体の CPI の人数でもある", "type": "integer", "minimum": 0 }, "ads_installs": { "description": "Apple Ads のインストール(その月の獲得の行の Apple Ads のキャンペーンの段の total_installs の合計)。cpi_ads の人数。Apple Ads の数が無ければ null", "type": ["integer", "null"], "minimum": 0 }, "d1": { "$ref": "#/$defs/rate" }, "d7": { "$ref": "#/$defs/rate" }, "d28": { "$ref": "#/$defs/rate" }, "install_to_trial": { "$ref": "#/$defs/rate" }, "trial_to_paid": { "$ref": "#/$defs/rate" }, "install_to_paid": { "$ref": "#/$defs/rate" }, "net_per_install_30": { "description": "インストールあたり30日の手取り(ドル)。core の subscription_changed の price_usd に (1 − R1 の store_fee_rate) を掛けた合計 ÷ installs。コホートの全部の人の30日が閉じてから出し、core が出来事を90日で消した後は前の週の値を引き継ぐ。出せなければ null で、理由は missing", "type": ["number", "null"] }, "net_per_install_90": { "type": ["number", "null"], "description": "インストールあたり90日の手取り(ドル)。core は出来事を90日しか持たないので、データレイクの subscriptions から出すまで null" }, "cpi_ads": { "description": "Apple Ads の費用 ÷ Apple Ads のインストール(ドル。その月の合計。円は usd_jpy でドルにする)", "type": ["number", "null"] }, "cpi_all": { "description": "Apple Ads の費用 ÷ installs(ドル)", "type": ["number", "null"] }, "payback_days": { "description": "インストールあたりの手取りの累計が CPI(cpi_ads。無ければ cpi_all)を超えた、インストールから何日目か(30日まで)。超えていなければ null", "type": ["integer", "null"], "minimum": 0 }, "benchmark_gap": { "description": "相場との差。metrics.toml に benchmark のある指標だけ", "type": "array", "maxItems": 20, "items": { "type": "object", "additionalProperties": false, "required": ["metric", "value", "benchmark"], "properties": { "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "value": { "type": ["number", "null"] }, "benchmark": { "type": "number" } } } }, "focus": { "description": "R1 の見る指標と目標への進み。focus が無ければ null", "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["metric", "value", "target", "by"], "properties": { "metric": { "$ref": "metric.schema.json#/$defs/metricName" }, "value": { "type": ["number", "null"] }, "target": { "type": ["number", "null"] }, "by": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] } } }, { "type": "null" }] }, "open_hypotheses": { "type": "integer", "minimum": 0 }, "testing_hypotheses": { "type": "integer", "minimum": 0 }, "spread_candidates": { "type": "integer", "minimum": 0 }, "missing": { "description": "値を出せなかった理由(store_fee_rate が無い・Apple Ads の数が無い・窓が閉じていない など)", "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 200 } } } }, "adsBudget": { "title": "AdsBudgetProposal", "description": "広告費の配分の案(11節)。「インストールあたり30日の手取り ÷ CPI」(score)の高い製品から並べ、1 − explore_share を score に比例して分け、explore_share を score の無い製品(無ければ score のある製品)に等しく分ける。額は本人が決めるので、割合だけを出す。指摘(action が ads_budget)としても出る", "type": "object", "additionalProperties": false, "required": ["month", "finding", "explore_share", "items"], "properties": { "month": { "type": "string", "pattern": "^\\d{4}-\\d{2}$" }, "finding": { "anyOf": [{ "$ref": "finding.schema.json#/$defs/findingId" }, { "type": "null" }] }, "explore_share": { "description": "試す分(0.1〜0.2)", "type": "number", "minimum": 0.1, "maximum": 0.2 }, "items": { "type": "array", "maxItems": 50, "items": { "type": "object", "additionalProperties": false, "required": ["project", "cohort", "score", "share"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "score": { "description": "インストールあたり30日の手取り ÷ CPI。出せなければ null", "type": ["number", "null"] }, "share": { "type": "number", "minimum": 0, "maximum": 1 }, "cohort": { "description": "score を出したコホート(net_per_install_30 と cpi_ads の両方がある新しい月)。無ければ null", "anyOf": [{ "type": "string", "pattern": "^\\d{4}-\\d{2}$" }, { "type": "null" }] } } } } } }, "spreadCandidate": { "title": "SpreadCandidate", "description": "広げる候補(10.3節)。supported の仮説のうち、同じ surface を持つほかの製品に子の仮説が無い物。段階が prelaunch と building の製品には出さない", "type": "object", "additionalProperties": false, "required": ["hypothesis", "from", "surface", "to", "conclusion", "learnings"], "properties": { "hypothesis": { "$ref": "ledger.schema.json#/$defs/hypothesisId" }, "from": { "$ref": "../common.schema.json#/$defs/projectId" }, "surface": { "$ref": "ledger.schema.json#/$defs/surface" }, "to": { "type": "array", "minItems": 1, "maxItems": 50, "items": { "$ref": "../common.schema.json#/$defs/projectId" } }, "conclusion": { "description": "元の仮説の結論の文", "type": ["string", "null"], "maxLength": 2000 }, "learnings": { "description": "元の仮説につながる学んだこと(新しい順に3つまで)", "type": "array", "maxItems": 3, "items": { "type": "string", "maxLength": 2000 } } } }, "missing": { "title": "PortfolioMissing", "type": "object", "additionalProperties": false, "required": ["project", "reason"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "reason": { "type": "string", "maxLength": 200 } } } } },
76
+ "insights/signal.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/insights/signal.schema.json", "title": "InsightsSignal", "description": "検知の1件(insights_signal・docs/design/insights.md 8.2節)。毎日の Workflow が決まった規則で選んだ「見るべき変化」。LLM を呼ばずに作る。1つの製品で1日に重さの順に5件まで(check_due・stale・idle・not_indexed は数に入れない)。同じ製品・指標・種類(not_indexed はページ)は7日の間に2回出さない", "type": "object", "additionalProperties": false, "required": ["id", "project", "day", "kind", "metric", "weight", "detail", "hypothesis", "finding", "created_at"], "properties": { "id": { "$ref": "#/$defs/signalId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "day": { "description": "検知した前の日(プロジェクトの default_time_zone の日付)", "$ref": "../common.schema.json#/$defs/day" }, "kind": { "$ref": "#/$defs/kind" }, "metric": { "description": "変わった指標。stale・idle・check_due は null のことがあり、not_indexed は web.gsc_indexed", "anyOf": [{ "$ref": "metric.schema.json#/$defs/metricName" }, { "type": "null" }] }, "weight": { "description": "重さ。1日5件を選ぶ順に使う。大きいほど先", "type": "number", "minimum": 0 }, "detail": { "$ref": "#/$defs/detail" }, "hypothesis": { "description": "check_due の時の仮説", "anyOf": [{ "$ref": "ledger.schema.json#/$defs/hypothesisId" }, { "type": "null" }] }, "finding": { "description": "この検知から作った指摘。まだ無いか、説明しない種類なら null", "anyOf": [{ "$ref": "finding.schema.json#/$defs/findingId" }, { "type": "null" }] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "signalId": { "title": "InsightsSignalId", "type": "string", "pattern": "^sig_[A-Za-z0-9]{16}$" }, "kind": { "title": "InsightsSignalKind", "description": "count_shift 件数がポアソン分布の99%の範囲を外れた・rate_shift 割合の Wilson の95%の幅が前の28日と重ならない・funnel_step ファネルの1つのステップが悪くなった・screen_friction 画面ごとのつまずき(そこで終わった・何度もタップ・反応なし・すぐ戻った)の割合が、直近7日でその前の28日より悪くなった(重さの上位3つ)・release 公開の前後で主な指標が変わった・behavior 初日の行動の有無で継続か課金が違う(週1回)・benchmark_gap コホートの指標が相場の半分に届かない(週1回)・check_due 仮説の確認の日が来た・stale 取り込み元が決めた時間より古い・idle 出来事が1日来ない・not_indexed 記事のサイトの sitemap のページが、lastmod か初めて見た日の早い方から、URL is unknown to Google は7日・Discovered - currently not indexed と Crawled - currently not indexed は14日たっても Google に載っていない・decision_overdue 判定の日を過ぎた R11 の変更に出すかの判断が無い(仮説が無い)・undelivered 出るはずの物が届いていない(件や設定が端末ではじかれた・active の件が3日 campaign_eligible 0件・値段の読めないペイウォール)・rule_hit 仮説の stop_at_den に届いても分子が0・spread_unproven 確かめる前に広げた子の仮説が3件 unmeasured になった親(abandoned の候補)・unmeasured 数が来ず決める日を延ばしたか、延ばしても数が来ず判断を付けずに結論した仮説(届いていない所を直す作業にする)・kpi_off_target 製品の KPI の前の日の値が目標より悪い(docs/design/kpi.md)・kpi_unmeasured 製品の KPI の元の出来事が窓の中に1件も来ていない", "enum": ["count_shift", "rate_shift", "funnel_step", "screen_friction", "release", "behavior", "benchmark_gap", "check_due", "stale", "idle", "not_indexed", "decision_overdue", "undelivered", "rule_hit", "spread_unproven", "unmeasured", "kpi_off_target", "kpi_unmeasured"] }, "detail": { "title": "InsightsSignalDetail", "description": "検知の数。種類ごとに使う欄が違い、使わない欄は null", "type": "object", "additionalProperties": false, "required": ["observed", "expected", "low", "high", "den", "screen", "friction", "app_version", "source", "page", "coverage", "note"], "properties": { "observed": { "description": "今の値(not_indexed は lastmod か初めて見た日の早い方からの日数)", "type": ["number", "null"] }, "expected": { "description": "比べた値(前の4週の同じ曜日の平均・前の28日の割合・相場)", "type": ["number", "null"] }, "low": { "description": "比べた側の範囲の下", "type": ["number", "null"] }, "high": { "description": "比べた側の範囲の上", "type": ["number", "null"] }, "den": { "description": "割合の分母", "type": ["integer", "null"], "minimum": 0 }, "screen": { "description": "screen_friction の画面", "anyOf": [{ "$ref": "../common.schema.json#/$defs/screenName" }, { "type": "null" }] }, "friction": { "description": "screen_friction のつまずきの種類。exit そこで終わった・rage 何度もタップ・dead 反応なし・quick_back すぐ戻った(どれも見た回数に対する割合)", "anyOf": [{ "$ref": "#/$defs/friction" }, { "type": "null" }] }, "app_version": { "description": "release のバージョン", "anyOf": [{ "$ref": "../common.schema.json#/$defs/appVersion" }, { "type": "null" }] }, "source": { "description": "stale の取り込み元", "type": ["string", "null"], "maxLength": 40 }, "page": { "description": "not_indexed のページの URL", "type": ["string", "null"], "maxLength": 2048 }, "coverage": { "description": "not_indexed の URL Inspection の coverageState(英語の文)", "type": ["string", "null"], "maxLength": 100 }, "note": { "description": "決まりの名前と窓(rate_shift 28d/28d など)", "type": "string", "maxLength": 200 } } }, "friction": { "title": "InsightsScreenFriction", "description": "画面ごとのつまずきの種類(sessions_screen_day の exits・rage・dead・quick_backs を views で割る)", "enum": ["exit", "rage", "dead", "quick_back"] }, "list": { "title": "InsightsSignalList", "description": "GET /v1/insights/signals(listInsightsSignals)の答え。新しい順。?project=&kind=&since=。呼び手の組織の、insights.read で見えるプロジェクトの分だけ", "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "maxItems": 500, "items": { "$ref": "#" } } } } } },
77
+ "legal/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/legal/admin.schema.json", "title": "LegalAdmin", "description": "法務のページの製品のデータを送る管理の道(docs/design/legal.md)。製品のデータの形と決まりは packages/legal の Product と checkProduct が持ち、appgrowstack-legal が確かめる", "$defs": { "pushRequest": { "title": "LegalPushRequest", "description": "PUT /v1/legal/products/:product。appgrowstack/legal-texts の products/<id>.json をそのまま送る。確かめるだけなら checkRequest", "type": "object", "additionalProperties": false, "required": ["product", "published_by"], "properties": { "product": { "type": "object", "required": ["id"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,40}$" } } }, "published_by": { "description": "送った元の commit", "type": "string", "minLength": 1, "maxLength": 200 } } }, "checkRequest": { "title": "LegalCheckRequest", "description": "POST /v1/legal/products/:product/check。送り先で確かめるだけで入れない(読みの権限 legal.check)", "type": "object", "additionalProperties": false, "required": ["product"], "properties": { "product": { "type": "object", "required": ["id"], "properties": { "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,40}$" } } } } }, "pushResponse": { "title": "LegalPushResponse", "type": "object", "additionalProperties": false, "required": ["product", "stored", "pages"], "properties": { "product": { "type": "string" }, "stored": { "description": "false は確かめただけ(check)", "type": "boolean" }, "pages": { "description": "出すページの数", "type": "integer", "minimum": 0 } } } } },
78
+ "links/attribution.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/links/attribution.schema.json", "title": "AttributionRequest", "description": "POST /v1/links/attributions(api.appgrowstack.com・公開キー)の本文。入れた後の最初の起動で、SDK(swift-app-sdk・kotlin-app-sdk)の linksが1回だけ送る(成功するまで次の起動で送り直す)。流入元は確かな手がかりだけで付け、IP や端末の指紋で推し量らない。手がかりの順と中の行(acq_attribution)は acquisition/attribution.schema.json と schema/cases/acquisition/attribution-order.json。公開済みのアプリが送っているので、この形は変えない", "type": "object", "additionalProperties": false, "required": ["install_id", "platform", "app_version", "first_open_at"], "properties": { "install_id": { "$ref": "../common.schema.json#/$defs/installId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "first_open_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "play_install_referrer": { "description": "Play Install Referrer の referrer の文字列そのまま(utm_source=…&utm_campaign=…&code=…)", "type": "string", "maxLength": 1024 }, "opened_url": { "description": "最初の起動を開いたユニバーサルリンク・App Link", "$ref": "../common.schema.json#/$defs/httpsUrl" }, "apple_ads_token": { "description": "AdServices の attributionToken。サーバーが Apple に問い合わせる", "type": "string", "maxLength": 4096 } }, "$defs": { "response": { "title": "AttributionResponse", "description": "200 で返す。同じ install_id の2回目は最初の答えを返す(上書きしない)。公開済みの SDK が matched_by と source を読むので、この形は変えない。中の行(AcquisitionAttribution)から写す: matched_by は play_referrer・invite・cross_promo → play_install_referrer(iOS の招待は opened_url)、opened_url → opened_url、apple_ads → apple_ads、ほか → organic。source はチャネルの id の - を _ にした物(決まらなければ organic・招待は invite)。medium はチャネルの種類(決まらなければ null)。campaign はキャンペーンの階層のキー(空なら null)", "type": "object", "additionalProperties": false, "required": ["matched_by", "source", "medium", "campaign", "code", "ad"], "properties": { "matched_by": { "enum": ["play_install_referrer", "opened_url", "apple_ads", "organic"] }, "source": { "description": "organic なら organic", "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "medium": { "type": ["string", "null"], "maxLength": 40 }, "campaign": { "type": ["string", "null"], "maxLength": 64 }, "code": { "anyOf": [{ "$ref": "link.schema.json#/$defs/code" }, { "type": "null" }] }, "ad": { "title": "AttributionAdDetail", "description": "広告の細目。apple_ads のときだけ(AdServices の答えの campaignId・adGroupId・keywordId・adId)。ほかは null。campaign は campaignId と同じ値。adId は広告(CPP の製品ページ)の id", "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["campaign_id", "ad_group_id", "keyword_id", "ad_id", "org_id", "country"], "properties": { "campaign_id": { "type": "string", "pattern": "^[0-9]{1,20}$" }, "ad_group_id": { "type": ["string", "null"], "pattern": "^[0-9]{1,20}$" }, "keyword_id": { "type": ["string", "null"], "pattern": "^[0-9]{1,20}$" }, "ad_id": { "type": ["string", "null"], "pattern": "^[0-9]{1,20}$" }, "org_id": { "type": ["string", "null"], "pattern": "^[0-9]{1,20}$" }, "country": { "type": ["string", "null"], "pattern": "^[A-Z]{2}$" } } }, { "type": "null" }] } } }, "recordInput": { "title": "RecordAttributionInput", "description": "RPC recordAttribution。アプリの Worker が自分の API で流入元の手がかりを受けたときに渡す(中身は端末の本文と同じ・project を足す)", "type": "object", "additionalProperties": false, "required": ["project", "request"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "request": { "$ref": "#" } } }, "recordedEvent": { "title": "AttributionRecordedEvent", "description": "attribution_recorded。core が流入元を付けたとき、R2 の track にこの名前で入れる(成果の比べと insights が読む)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "attribution_recorded" }, "params": { "$ref": "#/$defs/response" } } } } },
79
+ "links/link.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/links/link.schema.json", "title": "Link", "description": "R6 の短いリンク。利用者に見える URL は製品のドメインの /l/<code>(作ったリンク・招待のリンク)と /go/<code>(人が名前を付けたリンク)で、どちらも appgrowstack-api が Workers のルートで受けて 302 で行き先へ送り、links_click に1行足す。人の値は持たない(IP・端末の指紋を残さない)。表は links_link。招待のリンクの招いた人は links_invite に分けて持ち、この形にも URL にも出さない", "type": "object", "additionalProperties": false, "required": ["code", "project", "url", "destination", "channel", "campaign", "group", "status", "created_at", "expires_at"], "properties": { "code": { "$ref": "#/$defs/code" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "url": { "description": "利用者に見せる URL(https://<web_domain>/l/<code> か /go/<code>)", "$ref": "../common.schema.json#/$defs/httpsUrl" }, "destination": { "$ref": "#/$defs/destination" }, "channel": { "description": "獲得のチャネルの id(acq_channel・docs/design/acquisition.md 3.3節)。Play の utm_source にもこの値を入れる。招待のリンク(createInvite が作った物)だけ invite", "$ref": "#/$defs/channel" }, "campaign": { "description": "キャンペーンの階層のキー(自分で付けた名前・kebab-case)。無ければ空の文字。Play の utm_campaign", "$ref": "#/$defs/nodeKey" }, "group": { "description": "組の階層のキー(投稿・号・動画。web_search はクリックのページ p が組になるので空)。無ければ空の文字。Play の utm_content", "$ref": "#/$defs/nodeKey" }, "status": { "description": "disabled は製品のトップへ送る", "enum": ["active", "disabled"] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "expires_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } }, "$defs": { "code": { "title": "LinkCode", "description": "作ったリンクは大文字を1つ以上含む8文字の英数字。招待のリンクは大文字を1つ以上含む16文字の英数字(招いた先の URL を当てて見られないように長くする)。名前を付けたリンク(/go/)は kebab-case", "type": "string", "pattern": "^([A-Za-z0-9]{8}|[A-Za-z0-9]{16}|[a-z0-9][a-z0-9-]{1,39})$" }, "destination": { "title": "LinkDestination", "description": "store は端末の OS を見て App Store か Play の製品ページへ(どちらでもなければ web_fallback)。web は製品のサイトの URL。app は製品のアプリの中への URL(ユニバーサルリンク・入っていなければサイトで開く)。invite は招待のリンク(createInvite だけが作る)で、url は招いた先(製品のドメインの、アプリの中への URL)。Android は Play の製品ページ(referrer に utm_source=invite と code。入れた後の最初の起動で招待が付く)、iOS とほかは url(入っていればアプリ、無ければサイトで開く。入れた後にもう一度開けば opened_url で付く)", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["kind", "web_fallback"], "properties": { "kind": { "const": "store" }, "web_fallback": { "$ref": "../common.schema.json#/$defs/httpsUrl" }, "page": { "description": "R12 のストアのページのキー(creative_page)。無ければ既定のページ。CPP なら core が App Store の URL に ppid を付ける", "$ref": "../creative/page.schema.json#/$defs/pageKey" } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "url"], "properties": { "kind": { "const": "web" }, "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "url"], "properties": { "kind": { "const": "app" }, "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "url"], "properties": { "kind": { "const": "invite" }, "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" } } }] }, "createInput": { "title": "CreateLinkInput", "description": "リンクを作る(RPC createLink・POST /v1/links/projects/:project/links)。channel は登録したチャネル(acq_channel の active)でなければ 400(code input)。code を書けば /go/<code> の名前付き、書かなければ8文字を作る。destination の invite と channel の invite は使えない(招待は createInvite)", "type": "object", "additionalProperties": false, "required": ["project", "destination", "channel"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "code": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,39}$" }, "destination": { "$ref": "#/$defs/destination" }, "channel": { "$ref": "#/$defs/channel" }, "campaign": { "$ref": "#/$defs/nodeKey" }, "group": { "$ref": "#/$defs/nodeKey" }, "expires_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "inviteInput": { "title": "CreateInviteInput", "description": "RPC createInvite(アプリの Worker の APPGROWSTACK だけ。管理の API と CLI には無い)。招いた人(actor)の person_id を新しい code に結び links_invite に入れ、destination が invite のリンクを返す(channel は invite)。同じ人の同じ url は前に作ったリンクを返し、作り直さない(invite_sent も1回だけ)。招く相手に特典は付けない(docs/design/links.md の4節)。links が off なら code project", "type": "object", "additionalProperties": false, "required": ["project", "actor", "url"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "description": "招いた人", "$ref": "../common.schema.json#/$defs/actor" }, "url": { "description": "招いた先。製品のドメイン(registry_project.web_domain・www. も可)の URL だけ(違えば code input)", "$ref": "../common.schema.json#/$defs/httpsUrl" }, "campaign": { "description": "招待を出した画面や場面の名前(utm_campaign)。人ごとの値を入れない", "type": "string", "pattern": "^[a-z0-9_-]{1,64}$" } } }, "openedEvent": { "title": "LinkOpenedEvent", "description": "link_opened。短いリンクが押された(サーバーが links_click に書く)か、SDK が製品ページを開いた(kind=store_page・アプリの計測に渡す)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "link_opened" }, "params": { "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["short", "store_page"] }, "code": { "$ref": "#/$defs/code" }, "target": { "$ref": "../common.schema.json#/$defs/projectId" }, "campaign": { "type": "string", "pattern": "^[a-z0-9_-]{1,64}$" } } } } }, "inviteSentEvent": { "title": "InviteSentEvent", "description": "invite_sent。createInvite が新しい招待のリンクを作ったとき、招いた人の出来事として R2 に入れる(id invite_sent:<code>)。同じ人の同じ url の2回目は入れない", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "invite_sent" }, "params": { "type": "object", "additionalProperties": false, "required": ["code"], "properties": { "code": { "$ref": "#/$defs/code" } } } } }, "inviteAcceptedEvent": { "title": "InviteAcceptedEvent", "description": "invite_accepted。招待のリンクで入れた人が最初に開き、流入元が付いたとき、招いた人の出来事として R2 に入れる(id invite_accepted:<sha256(project:install_id) の頭32文字>)。招かれた人の id は引数にも id にもそのまま入れない。招いた人と同じ人・本人とテスターの端末で入れたときは入れない。install ごとに1回だけ", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "invite_accepted" }, "params": { "type": "object", "additionalProperties": false, "required": ["code"], "properties": { "code": { "$ref": "#/$defs/code" } } } } }, "listResponse": { "title": "ListLinksResponse", "description": "GET /v1/links/projects/:project/links(admin)。新しい順。?limit=50(200まで)。招待のリンク(channel=invite)は入れない(利用者が作り、人の数だけある)。招待のリンクも getLink では読める", "type": "object", "additionalProperties": false, "required": ["links"], "properties": { "links": { "type": "array", "items": { "$ref": "#" } } } }, "detail": { "title": "LinkDetail", "description": "GET /v1/links/projects/:project/links/:code(admin・app-growth links show)。人が押した回数(OS ごと)と人でない物の数と、このリンクで人の紐付けが付いた入れた数", "type": "object", "additionalProperties": false, "required": ["link", "clicks", "attributions"], "properties": { "link": { "$ref": "#" }, "clicks": { "type": "object", "additionalProperties": false, "required": ["total", "ios", "android", "other", "robot"], "properties": { "total": { "type": "integer", "minimum": 0 }, "ios": { "type": "integer", "minimum": 0 }, "android": { "type": "integer", "minimum": 0 }, "other": { "type": "integer", "minimum": 0 }, "robot": { "description": "人でないと判じて数から外したクリック(links_click の bot のある行・docs/design/links.md 1.1節)。total と OS ごとの数は人のクリックだけ", "type": "integer", "minimum": 0 } } }, "attributions": { "description": "acq_attribution でこの code が付いた install の数", "type": "integer", "minimum": 0 } } }, "channel": { "title": "LinkChannel", "type": "string", "pattern": "^[a-z][a-z0-9-]{0,29}$" }, "nodeKey": { "type": "string", "pattern": "^([a-z0-9][a-z0-9_-]{0,63})?$" } } },
80
+ "notices/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notices/admin.schema.json", "title": "NoticePushRequest", "description": "POST /v1/notices/projects/:project/notices の本文。アプリの repo の notices/*.json の全部(image は sha256 に替えた物)。送った一覧で置き換え、無くなったお知らせは一覧から外す", "type": "object", "additionalProperties": false, "required": ["notices", "published_by"], "properties": { "notices": { "type": "array", "maxItems": 100, "items": { "$ref": "notice.schema.json" } }, "published_by": { "description": "送った人か git の commit(CLI が入れる)", "type": "string", "minLength": 1, "maxLength": 200 } }, "$defs": { "problem": { "title": "NoticeProblem", "type": "object", "additionalProperties": false, "required": ["level", "rule", "path", "message"], "properties": { "level": { "enum": ["error", "warning"] }, "rule": { "type": "string" }, "path": { "description": "/notices/<番号>/… の JSON Pointer", "type": "string" }, "message": { "type": "string" } } }, "checkResponse": { "title": "NoticeCheckResponse", "description": "POST /v1/notices/projects/:project/notices/check の答え。送らずに core の確かめ(群れ・requires・プッシュの間隔を含む)だけを返す", "type": "object", "additionalProperties": false, "required": ["ok", "problems"], "properties": { "ok": { "type": "boolean" }, "problems": { "type": "array", "items": { "$ref": "#/$defs/problem" } } } }, "pushResponse": { "title": "NoticePushResponse", "type": "object", "additionalProperties": false, "required": ["version", "pushed_at", "notices", "problems"], "properties": { "version": { "description": "お知らせの一覧の版(送るたびに1つ増える)", "type": "integer", "minimum": 1 }, "pushed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "notices": { "type": "array", "items": { "$ref": "#/$defs/summary" } }, "problems": { "description": "警告(誤りがあれば送らずに 400)", "type": "array", "items": { "$ref": "#/$defs/problem" } } } }, "status": { "title": "NoticeStatus", "description": "scheduled(始まる前)・live(出している)・ended(期間が終わった)・stopped(止めた)", "enum": ["scheduled", "live", "ended", "stopped"] }, "pushState": { "title": "NoticePushState", "description": "プッシュの進み。push でないお知らせは null", "type": "object", "additionalProperties": false, "required": ["status", "targeted", "sent", "reason", "started_at", "finished_at"], "properties": { "status": { "enum": ["waiting", "sending", "sent", "failed", "stopped"] }, "targeted": { "description": "send を呼んだ人の数", "type": "integer", "minimum": 0 }, "sent": { "description": "notify が scheduled と答えた数", "type": "integer", "minimum": 0 }, "reason": { "description": "failed の理由(no_notice_campaign など)", "type": ["string", "null"] }, "started_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "finished_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "summary": { "title": "NoticeSummary", "description": "core が持つお知らせ1本と数", "type": "object", "additionalProperties": false, "required": ["notice", "status", "starts_at", "ends_at", "stopped_at", "app_version", "push_state", "delivered", "read", "read_rate", "updated_at"], "properties": { "notice": { "$ref": "notice.schema.json" }, "status": { "$ref": "#/$defs/status" }, "starts_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "ends_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "stopped_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "app_version": { "description": "requires を解いた OS ごとの範囲。requires が無ければ null", "anyOf": [{ "$ref": "#/$defs/resolvedRanges" }, { "type": "null" }] }, "push_state": { "anyOf": [{ "$ref": "#/$defs/pushState" }, { "type": "null" }] }, "delivered": { "description": "一覧で届いた人(読む人)の数", "type": "integer", "minimum": 0 }, "read": { "description": "読んだ人の数", "type": "integer", "minimum": 0 }, "read_rate": { "description": "read ÷ delivered。届いた人が0なら null", "type": ["number", "null"] }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "resolvedRanges": { "title": "NoticeResolvedRanges", "type": "object", "additionalProperties": false, "properties": { "ios": { "$ref": "#/$defs/resolvedRange" }, "android": { "$ref": "#/$defs/resolvedRange" } } }, "resolvedRange": { "title": "NoticeResolvedRange", "type": "object", "additionalProperties": false, "required": ["min", "exclude"], "properties": { "min": { "$ref": "../common.schema.json#/$defs/appVersion" }, "exclude": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/appVersion" } } } }, "list": { "title": "NoticeList", "description": "GET /v1/notices/projects/:project/notices の答え", "type": "object", "additionalProperties": false, "required": ["project", "version", "pushed_at", "notices"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "version": { "description": "まだ送っていなければ0", "type": "integer", "minimum": 0 }, "pushed_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "notices": { "type": "array", "items": { "$ref": "#/$defs/summary" } } } }, "liveList": { "title": "LiveNoticeList", "description": "GET /v1/notices/live の答え。見える製品の、今出しているお知らせ(console のホームの「配信中」)", "type": "object", "additionalProperties": false, "required": ["notices"], "properties": { "notices": { "type": "array", "items": { "title": "LiveNotice", "type": "object", "additionalProperties": false, "required": ["project", "summary"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "summary": { "$ref": "#/$defs/summary" } } } } } }, "imageUpload": { "title": "NoticeImageUpload", "description": "PUT /v1/notices/projects/:project/images/:digest の答え", "type": "object", "additionalProperties": false, "required": ["sha256", "bytes", "created"], "properties": { "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "bytes": { "type": "integer", "minimum": 1 }, "created": { "description": "新しく置いたか(同じ物が既にあれば false)", "type": "boolean" } } } } },
81
+ "notices/case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notices/case.schema.json", "title": "NoticeCase", "description": "schema/cases/notices/*.json の1つ。お知らせがその端末に出るか(noticeVisible)と、どの言語の文を選ぶか(pickNoticeText)。packages/notice-rules が同じ答えを返す", "type": "object", "additionalProperties": false, "required": ["description", "now", "notice", "reader", "expect"], "properties": { "description": { "type": "string" }, "now": { "$ref": "../common.schema.json#/$defs/isoTime" }, "notice": { "type": "object", "additionalProperties": false, "required": ["text", "starts_at", "ends_at"], "properties": { "text": { "$ref": "notice.schema.json#/properties/text" }, "starts_at": { "$ref": "../common.schema.json#/$defs/isoTime" }, "ends_at": { "$ref": "../common.schema.json#/$defs/isoTime" }, "stopped": { "type": "boolean" }, "audience": { "$ref": "notice.schema.json#/$defs/audience" }, "app_version": { "$ref": "admin.schema.json#/$defs/resolvedRanges" } } }, "reader": { "type": "object", "additionalProperties": false, "required": ["lang", "platform", "app_version", "segments"], "properties": { "lang": { "type": ["string", "null"] }, "platform": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/platform" }, { "type": "null" }] }, "app_version": { "type": ["string", "null"] }, "segments": { "type": "array", "items": { "type": "string" } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["visible", "text_lang"], "properties": { "visible": { "type": "boolean" }, "text_lang": { "description": "選ぶ文の言語", "type": "string" } } } } },
82
+ "notices/device.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notices/device.schema.json", "title": "NoticeFeed", "description": "GET /v1/notices の答え(docs/design/notices.md 3節)。その人に今出すお知らせの新しい順(50件まで)・未読の数・起動時に枚で出すお知らせの id", "type": "object", "additionalProperties": false, "required": ["notices", "unread", "card"], "properties": { "notices": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/deviceNotice" } }, "unread": { "type": "integer", "minimum": 0 }, "card": { "description": "起動時に枚で出すお知らせの id。無ければ null", "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 80 }, { "type": "null" }] } }, "$defs": { "deviceNotice": { "title": "DeviceNotice", "description": "端末に返すお知らせ1件。文は端末の言語で選んだ物", "type": "object", "additionalProperties": false, "required": ["id", "kind", "importance", "title", "body", "image", "link", "published_at", "ends_at", "read"], "properties": { "id": { "description": "お知らせの id(人だけのお知らせは sr_ で始まる)", "type": "string", "minLength": 1, "maxLength": 80 }, "kind": { "$ref": "notice.schema.json#/$defs/kind" }, "importance": { "$ref": "notice.schema.json#/$defs/importance" }, "title": { "type": "string" }, "body": { "description": "短い Markdown", "type": "string" }, "image": { "anyOf": [{ "title": "DeviceNoticeImage", "type": "object", "additionalProperties": false, "required": ["url", "width", "height", "alt"], "properties": { "url": { "type": "string" }, "width": { "type": "integer", "minimum": 1 }, "height": { "type": "integer", "minimum": 1 }, "alt": { "type": ["string", "null"] } } }, { "type": "null" }] }, "link": { "anyOf": [{ "title": "DeviceNoticeLink", "type": "object", "additionalProperties": false, "required": ["kind", "label"], "properties": { "kind": { "enum": ["route", "url"] }, "route": { "type": "string" }, "url": { "type": "string" }, "label": { "description": "ボタンの文。書いていなければ null(SDK が既定の文を出す)", "type": ["string", "null"] } } }, { "type": "null" }] }, "published_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "ends_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "read": { "type": "boolean" } } }, "readRequest": { "title": "NoticeReadRequest", "description": "POST /v1/notices/read の本文", "type": "object", "additionalProperties": false, "required": ["ids"], "properties": { "ids": { "type": "array", "minItems": 1, "maxItems": 50, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 80 } } } }, "readResponse": { "title": "NoticeReadResponse", "type": "object", "additionalProperties": false, "required": ["unread"], "properties": { "unread": { "type": "integer", "minimum": 0 } } } } },
83
+ "notices/events.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notices/events.schema.json", "title": "NoticeEvent", "description": "お知らせの SDK が作ってアプリの計測に渡す出来事(docs/design/notices.md 4節)。共通のカタログでは sent_by: sdk", "oneOf": [{ "$ref": "#/$defs/shown" }, { "$ref": "#/$defs/opened" }, { "$ref": "#/$defs/linkTapped" }], "$defs": { "shown": { "title": "NoticeShownEvent", "description": "一覧の行か起動時の枚が画面に出た(同じお知らせは起動ごとに1回)", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "notice_shown" }, "params": { "type": "object", "additionalProperties": false, "required": ["notice", "kind", "surface"], "properties": { "notice": { "type": "string", "minLength": 1, "maxLength": 80 }, "kind": { "$ref": "notice.schema.json#/$defs/kind" }, "surface": { "enum": ["list", "card"] } } } } }, "opened": { "title": "NoticeOpenedEvent", "description": "詳しい画面を開いた", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "notice_opened" }, "params": { "type": "object", "additionalProperties": false, "required": ["notice", "kind", "from"], "properties": { "notice": { "type": "string", "minLength": 1, "maxLength": 80 }, "kind": { "$ref": "notice.schema.json#/$defs/kind" }, "from": { "enum": ["list", "card", "push"] } } } } }, "linkTapped": { "title": "NoticeLinkTappedEvent", "description": "リンクのボタンをタップした", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "notice_link_tapped" }, "params": { "type": "object", "additionalProperties": false, "required": ["notice", "kind", "link"], "properties": { "notice": { "type": "string", "minLength": 1, "maxLength": 80 }, "kind": { "$ref": "notice.schema.json#/$defs/kind" }, "link": { "enum": ["route", "url"] } } } } } } },
84
+ "notices/notice.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notices/notice.schema.json", "title": "Notice", "description": "お知らせ1本(docs/design/notices.md 1節)。アプリの repo の notices/<id>.json。image は repo では path、送る時は CLI が sha256 に替える", "type": "object", "additionalProperties": false, "required": ["id", "kind", "importance", "text", "starts_at", "ends_at"], "properties": { "id": { "$ref": "#/$defs/noticeId" }, "kind": { "$ref": "#/$defs/writtenKind" }, "importance": { "$ref": "#/$defs/importance" }, "text": { "description": "言語ごとの文。キーは言語の札(ja・en・zh-Hans)", "type": "object", "minProperties": 1, "maxProperties": 40, "propertyNames": { "$ref": "../common.schema.json#/$defs/langTag" }, "additionalProperties": { "$ref": "#/$defs/text" } }, "image": { "oneOf": [{ "$ref": "#/$defs/imageFile" }, { "$ref": "#/$defs/image" }] }, "link": { "$ref": "#/$defs/link" }, "audience": { "$ref": "#/$defs/audience" }, "starts_at": { "description": "出し始める時刻(ISO 8601・時差つき)", "$ref": "../common.schema.json#/$defs/isoTime" }, "ends_at": { "description": "出し終える時刻(ISO 8601・時差つき)。starts_at から90日まで(important は30日まで)", "$ref": "../common.schema.json#/$defs/isoTime" }, "push": { "description": "true ならプッシュも送る(notify の施策 notice。docs/design/notices.md 5節)", "type": "boolean" } }, "$defs": { "noticeId": { "title": "NoticeId", "description": "お知らせの id。英小文字で始まり、英小文字・数字・_ の60文字まで。ファイルの名前と同じ", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,59}$" }, "writtenKind": { "title": "WrittenNoticeKind", "description": "repo に書ける種類。announcement(運営から)・feature(新しい機能)・maintenance(メンテナンスと障害)", "enum": ["announcement", "feature", "maintenance"] }, "kind": { "title": "NoticeKind", "description": "お知らせの種類。support_reply は問い合わせの返事が届いた時に core が作る", "enum": ["announcement", "feature", "maintenance", "support_reply"] }, "importance": { "title": "NoticeImportance", "description": "normal は一覧だけ。important は一覧に加えて起動時の枚", "enum": ["normal", "important"] }, "text": { "title": "NoticeText", "type": "object", "additionalProperties": false, "required": ["title", "body"], "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 40 }, "body": { "description": "短い Markdown(太字・箇条書き・https のリンク)", "type": "string", "minLength": 1, "maxLength": 1000 }, "link_label": { "description": "リンクのボタンの文", "type": "string", "minLength": 1, "maxLength": 20 }, "push_body": { "description": "プッシュの本文。push の時だけ要る", "type": "string", "minLength": 1, "maxLength": 120 } } }, "imageFile": { "title": "NoticeImageFile", "description": "repo の notices/ からの画像のパス(PNG・JPEG・WebP・1MB まで)", "type": "object", "additionalProperties": false, "required": ["path"], "properties": { "path": { "type": "string", "pattern": "^[A-Za-z0-9_./-]{1,200}\\.(png|jpg|jpeg|webp)$" }, "alt": { "$ref": "#/$defs/alt" } } }, "image": { "title": "NoticeImage", "description": "送った画像。中身は R2 の <project>/notices/<sha256>", "type": "object", "additionalProperties": false, "required": ["sha256", "content_type", "bytes", "width", "height"], "properties": { "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "content_type": { "enum": ["image/png", "image/jpeg", "image/webp"] }, "bytes": { "type": "integer", "minimum": 1, "maximum": 1000000 }, "width": { "type": "integer", "minimum": 1, "maximum": 4096 }, "height": { "type": "integer", "minimum": 1, "maximum": 4096 }, "alt": { "$ref": "#/$defs/alt" } } }, "alt": { "description": "言語ごとの画像の代わりの文", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/langTag" }, "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 120 } }, "link": { "title": "NoticeLink", "description": "アプリの中の画面(route)か Web(url)", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["route"], "properties": { "route": { "type": "string", "minLength": 1, "maxLength": 100 } } }, { "type": "object", "additionalProperties": false, "required": ["url"], "properties": { "url": { "type": "string", "minLength": 9, "maxLength": 500 } } }] }, "audience": { "title": "NoticeAudience", "description": "だれに出すか。無ければ全員。書いた条件は全部満たす", "type": "object", "additionalProperties": false, "properties": { "segments": { "description": "どれかに入っている人", "type": "array", "minItems": 1, "maxItems": 10, "uniqueItems": true, "items": { "$ref": "../segments/segment.schema.json#/$defs/segmentId" } }, "exclude_segments": { "description": "どれかに入っている人には出さない", "type": "array", "minItems": 1, "maxItems": 10, "uniqueItems": true, "items": { "$ref": "../segments/segment.schema.json#/$defs/segmentId" } }, "langs": { "description": "端末の言語の頭(ja・en)", "type": "array", "minItems": 1, "maxItems": 40, "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z]{2,3}$" } }, "platforms": { "type": "array", "minItems": 1, "maxItems": 2, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/platform" } }, "requires": { "description": "機能のキー(feature:<キー>)。R11 の resolveRequires でバージョンの範囲にする", "type": "array", "minItems": 1, "maxItems": 10, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 80 } } } } } },
85
+ "notify/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notify/admin.schema.json", "title": "ApproveVariantRequest", "description": "POST /v1/notify/projects/:project/variants/:variant_id/approve(admin.appgrowstack.com)の本文。案を live にする。live の数がアプリの上限(AppDefinition.maxLive・既定2)を超えるときは retire に下ろす live の案を渡す。案が前の案を置き換える(supersedes)なら、前の案も下ろす。施策の割合(allocations)は消し、次に送るときは等しく分ける", "type": "object", "additionalProperties": false, "properties": { "retire": { "description": "一緒に下ろす、同じ施策の live の案", "$ref": "#/$defs/variantId" } }, "$defs": { "variantId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$" }, "campaign": { "description": "通知の施策の id(アプリの repo の notify/app.json の campaigns[].id)", "type": "string", "pattern": "^[a-z][a-z0-9_]{1,40}$" }, "variantStatus": { "title": "NotifyVariantStatus", "type": "string", "enum": ["proposed", "live", "retired"] }, "variant": { "title": "NotifyVariant", "description": "通知の文面の案。content は GET variants/:variant_id だけが返す(一覧には入れない)", "type": "object", "additionalProperties": false, "required": ["id", "campaign", "status", "author", "model", "hypothesis", "supersedes", "created_at", "approved_at", "approved_by", "retired_at", "retired_reason"], "properties": { "id": { "$ref": "#/$defs/variantId" }, "campaign": { "$ref": "#/$defs/campaign" }, "status": { "$ref": "#/$defs/variantStatus" }, "author": { "type": "string", "enum": ["human", "ai"] }, "model": { "description": "AI が書いたときのモデル", "type": ["string", "null"] }, "hypothesis": { "description": "何を確かめるつもりか", "type": "string" }, "supersedes": { "description": "置き換える前の案", "type": ["string", "null"] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "approved_at": { "oneOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "approved_by": { "type": ["string", "null"] }, "retired_at": { "oneOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "retired_reason": { "description": "rejected・retired_by_hand・replaced_by_<id>・superseded_by_<id>・not_chosen_<id>・週の流れの理由", "type": ["string", "null"] }, "content": { "description": "言語の札 → 文面", "type": "object", "additionalProperties": {} } } }, "variantList": { "title": "NotifyVariantList", "description": "GET /v1/notify/projects/:project/variants?campaign=&status=。施策・状態・作った順", "type": "object", "additionalProperties": false, "required": ["variants", "campaigns"], "properties": { "variants": { "type": "array", "items": { "$ref": "#/$defs/variant" } }, "campaigns": { "description": "variants に出た施策ごとの目的と、今 live の案の数。live が0の施策は、今その通知を送っていない", "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["id", "purpose", "live"], "properties": { "id": { "$ref": "#/$defs/campaign" }, "purpose": { "description": "何のための通知か(アプリの repo の notify/app.json の campaigns[].purpose)", "type": "string" }, "live": { "type": "integer", "minimum": 0 } } } } } }, "approveResponse": { "title": "ApproveVariantResponse", "type": "object", "additionalProperties": false, "required": ["variant", "retired"], "properties": { "variant": { "$ref": "#/$defs/variant" }, "retired": { "description": "一緒に下ろした案(retire・supersedes の前の案・同じ施策のほかの承認待ちの案)", "type": "array", "items": { "$ref": "#/$defs/variantId" } } } }, "campaignState": { "title": "NotifyCampaignState", "description": "施策を止めたか。止めている間も入りの記録は続ける", "type": "object", "additionalProperties": false, "required": ["campaign", "paused", "updated_at", "updated_by"], "properties": { "campaign": { "$ref": "#/$defs/campaign" }, "paused": { "type": "boolean" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_by": { "type": "string" } } }, "campaignStateList": { "title": "NotifyCampaignStateList", "description": "GET /v1/notify/projects/:project/campaigns。一度でも止めた・再開した施策だけ(無い施策は配っている)", "type": "object", "additionalProperties": false, "required": ["campaigns"], "properties": { "campaigns": { "type": "array", "items": { "$ref": "#/$defs/campaignState" } } } }, "run": { "title": "NotifyRun", "description": "週の流れ(文面の改善)の1回分。summary はアプリごとのまとめ(終わっていなければ null)", "type": "object", "additionalProperties": false, "required": ["id", "started_at", "finished_at", "summary"], "properties": { "id": { "type": "string" }, "started_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "finished_at": { "oneOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "summary": {} } }, "runList": { "title": "NotifyRunList", "description": "GET /v1/notify/runs?limit=1。新しい順に limit 件(1〜20)", "type": "object", "additionalProperties": false, "required": ["runs"], "properties": { "runs": { "type": "array", "items": { "$ref": "#/$defs/run" } } } }, "suppressReason": { "title": "NotifySuppressReason", "description": "通知を送らなかった理由(notify の src/delivery/types.ts の SuppressReason と同じ)", "enum": ["no_consent", "no_device", "quiet", "stopped", "thinned", "capped", "outranked", "no_copy", "paused", "forgotten", "not_eligible", "returned", "global_holdout", "app_version"] }, "previewRequest": { "title": "NotifyPreviewRequest", "description": "POST /v1/notify/projects/:project/campaigns/:campaign/preview(K2-8)の本文。at を書かなければ今。書き込まずに decide を回す", "type": "object", "additionalProperties": false, "properties": { "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "preview": { "title": "NotifyPreview", "description": "preview の答え。その時刻にセグメントに入る人ごとに decide を書き込まずに回した数と、例の person_id", "type": "object", "additionalProperties": false, "required": ["project", "campaign", "at", "segment", "would_send", "held_out", "suppressed", "by_stage", "by_lang", "examples"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "campaign": { "$ref": "#/$defs/campaign" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "segment": { "description": "セグメントに入る人", "type": "integer", "minimum": 0 }, "would_send": { "type": "integer", "minimum": 0 }, "held_out": { "type": "integer", "minimum": 0 }, "suppressed": { "description": "送らない理由ごとの人の数", "type": "object", "propertyNames": { "$ref": "#/$defs/suppressReason" }, "additionalProperties": { "type": "integer", "minimum": 0 } }, "by_stage": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } }, "by_lang": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } }, "examples": { "description": "would_send・held_out・理由ごとに3人まで", "type": "object", "additionalProperties": { "type": "array", "maxItems": 3, "items": { "$ref": "../common.schema.json#/$defs/personId" } } } } }, "explain": { "title": "NotifyExplain", "description": "GET /v1/notify/projects/:project/people/:person(K2-8)。施策ごとに、セグメントに入っているか・最後の配信の状態と理由・次に送る予定の時刻。段階2(people.person.read)", "type": "object", "additionalProperties": false, "required": ["project", "person_id", "campaigns"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "campaigns": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["campaign", "in_segment", "last", "next_at"], "properties": { "campaign": { "$ref": "#/$defs/campaign" }, "in_segment": { "type": "boolean" }, "last": { "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["send_id", "status", "reason", "at"], "properties": { "send_id": { "type": "string" }, "status": { "enum": ["scheduled", "sent", "opened", "failed", "suppressed", "held_out"] }, "reason": { "anyOf": [{ "$ref": "#/$defs/suppressReason" }, { "type": "null" }] }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, { "type": "null" }] }, "next_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } } } } }, "guardrailReport": { "title": "NotifyGuardrailReport", "description": "core → NOTIFY_ADMIN.guardrails。lifecycle と promotional の施策ごとの、自動で止める条件の数と当たった理由(docs/design/personalization.md 4.5節)。止めるのは core(setCampaignPaused)。本人とテスターの端末の人は数えない", "type": "object", "additionalProperties": false, "required": ["project", "computed_at", "campaigns"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "campaigns": { "type": "array", "items": { "$ref": "#/$defs/guardrail" } } } }, "guardrail": { "title": "NotifyGuardrail", "type": "object", "additionalProperties": false, "required": ["campaign", "paused", "srm", "opt_out", "uninstall", "trips"], "properties": { "campaign": { "type": "string" }, "paused": { "description": "今止めている", "type": "boolean" }, "srm": { "$ref": "../registry/admin.schema.json#/$defs/healthCampaign/properties/srm" }, "opt_out": { "description": "直近28日に送った人と、全体の holdout で送らなかった人(送れる端末があった人)のうち、今その端末の通知を全部切っている人", "type": "object", "additionalProperties": false, "required": ["sent_people", "sent_opted_out", "global_people", "global_opted_out"], "properties": { "sent_people": { "type": "integer", "minimum": 0 }, "sent_opted_out": { "type": "integer", "minimum": 0 }, "global_people": { "type": "integer", "minimum": 0 }, "global_opted_out": { "type": "integer", "minimum": 0 } } }, "uninstall": { "description": "直近7日に送った数と、APNs が端末が無いと答えた数(410・BadDeviceToken・Unregistered)。比べる元はアプリの全部の施策のその前の28日", "type": "object", "additionalProperties": false, "required": ["sent", "bad_token", "baseline_sent", "baseline_bad_token"], "properties": { "sent": { "type": "integer", "minimum": 0 }, "bad_token": { "type": "integer", "minimum": 0 }, "baseline_sent": { "type": "integer", "minimum": 0 }, "baseline_bad_token": { "type": "integer", "minimum": 0 } } }, "trips": { "type": "array", "items": { "$ref": "#/$defs/guardrailTrip" } } } }, "guardrailTrip": { "title": "NotifyGuardrailTrip", "description": "止める理由。srm: 割り当てのずれ(p < 0.001)。opt_out: 通知を切った率が全体の holdout の1.5倍より上。uninstall: 端末が無いと答えた率が前の28日の1.5倍より上", "enum": ["srm", "opt_out", "uninstall"] }, "stats": { "title": "NotifyStats", "description": "GET /v1/notify/projects/:project/campaigns/:campaign/stats?days=7(KD-3・getNotifyStats)。core → NOTIFY_ADMIN.stats。案ごとの配信の数と成果・holdout・止めた理由(days の窓)と、施策の全部で数える SRM・止めた後に送った数。srm は送った後の割り当てのずれ(docs/design/testing.md の 3.3節・3.4節)。days の窓でなく、施策の全部の配信で数える。人ごとにその施策で最初に判断された側を取り、出す側は holdout の割り当てを通った人(判断のときに同意・端末・送る時刻で先に止めた人は入れない。割り当ての後、送る直前に端末が無くなった人は出す側に数える)。期待の割合はアプリの DeliveryPolicy.holdout。transactional の施策と holdout 0 は counted false・method none。本人とテスターの端末の人(treatment に固定)は数えない(docs/design/testing.md の 4.3節)", "type": "object", "additionalProperties": false, "required": ["project", "campaign", "days", "computed_at", "goal", "variants", "held_out", "held_out_converted", "waiting", "suppressed", "srm", "sent_after_stop", "send_time"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "campaign": { "$ref": "#/$defs/campaign" }, "days": { "type": "integer", "minimum": 1, "maximum": 90 }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "goal": { "description": "施策の成果(Campaign.goal)。成果の出来事と、送った時刻(holdout は送っていたはずの時刻)からの窓", "type": "object", "additionalProperties": false, "required": ["event", "within_hours"], "properties": { "event": { "$ref": "../common.schema.json#/$defs/eventName" }, "within_hours": { "type": "integer", "minimum": 1 } } }, "variants": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["variant_id", "sent", "opened", "converted", "failed"], "properties": { "variant_id": { "$ref": "#/$defs/variantId" }, "sent": { "type": "integer", "minimum": 0 }, "opened": { "type": "integer", "minimum": 0 }, "converted": { "description": "送った配信のうち、送った時刻から goal の窓の中に成果の出来事が届いた数(conversions の表)", "type": "integer", "minimum": 0 }, "failed": { "description": "送れなかった数を APNs・FCM の理由ごとに", "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } } } } }, "held_out": { "description": "出さない側に入った配信の数(人でなく行。同じ人の回ごとの行を全部数える。variants の sent と同じ単位)", "type": "integer", "minimum": 0 }, "held_out_converted": { "description": "出さない側の配信のうち、送っていたはずの時刻から goal の窓の中に成果の出来事が届いた数", "type": "integer", "minimum": 0 }, "waiting": { "description": "送る時刻を待っている配信の数(days の窓に作った行のうち、まだ送っていない scheduled・sending)。送った数が0でもこれが1以上なら、送る時刻がまだ来ていない", "type": "integer", "minimum": 0 }, "suppressed": { "description": "止めた理由ごとの数", "type": "object", "propertyNames": { "$ref": "#/$defs/suppressReason" }, "additionalProperties": { "type": "integer", "minimum": 0 } }, "srm": { "$ref": "../registry/admin.schema.json#/$defs/healthCampaign/properties/srm" }, "sent_after_stop": { "description": "止めた後に送った数(docs/design/testing.md 3.4節の「止めた施策」。1件でもあれば誤り)。今止めているときだけ stopped_at に止めた時刻を入れ、その後に sent になった配信を数える。止めていなければ stopped_at null・sent 0", "type": "object", "additionalProperties": false, "required": ["stopped_at", "sent"], "properties": { "stopped_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "sent": { "type": "integer", "minimum": 0 } } }, "send_time": { "description": "人ごとの送る時刻(docs/design/personalization.md 4.4節)で送った数を、時刻を選んだ理由ごとに数えた物(days の窓の送った配信)。person はその人の一番多い1時間・product は製品で一番多い1時間・campaign は施策の時刻(理由を残す前の配信を含む)。施策が人ごとの時刻を選ばなければ null", "type": ["object", "null"], "additionalProperties": false, "required": ["person", "product", "campaign"], "properties": { "person": { "type": "integer", "minimum": 0 }, "product": { "type": "integer", "minimum": 0 }, "campaign": { "type": "integer", "minimum": 0 } } } } } } },
86
+ "notify/device.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notify/device.schema.json", "title": "RegisterDeviceInput", "description": "RPC registerDevice の入力。端末の登録・更新。許可が無い端末も送る(届く人の割合を数える)。1つのトークンの持ち主はいつも1人(最後に登録した人)。サインインし直した・アカウントを切り替えたときは、トークンが変わらなくても送り直す", "type": "object", "additionalProperties": false, "required": ["project", "actor", "token", "apns_env", "time_zone", "locale", "app_version", "authorization"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "$ref": "../common.schema.json#/$defs/actor" }, "token": { "$ref": "#/$defs/apnsToken" }, "apns_env": { "$ref": "#/$defs/apnsEnv" }, "time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "locale": { "description": "Locale.current.identifier(ja_JP)か言語の札(ja-JP)", "type": "string", "minLength": 2, "maxLength": 35 }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "authorization": { "title": "NotificationAuthorization", "enum": ["authorized", "provisional", "ephemeral", "denied", "not_determined"] } }, "$defs": { "apnsToken": { "title": "ApnsToken", "description": "APNs のトークン(16進)", "type": "string", "pattern": "^[0-9a-fA-F]{32,200}$" }, "apnsEnv": { "title": "ApnsEnv", "description": "DEBUG ビルドは sandbox、それ以外は production", "enum": ["sandbox", "production"] }, "unregister": { "title": "UnregisterDeviceInput", "description": "RPC unregisterDevice。この端末を誰の通知も受けない状態にする(サインアウト)。無いトークンでも成功する", "type": "object", "additionalProperties": false, "required": ["project", "token"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "token": { "$ref": "#/$defs/apnsToken" } } }, "registerWidgetPush": { "title": "RegisterWidgetPushInput", "description": "RPC registerWidgetPush。ウィジェットのプッシュ更新のトークン(WidgetKit の pushTokenDidChange)", "type": "object", "additionalProperties": false, "required": ["project", "actor", "token", "apns_env"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "$ref": "../common.schema.json#/$defs/actor" }, "token": { "$ref": "#/$defs/apnsToken" }, "apns_env": { "$ref": "#/$defs/apnsEnv" } } }, "unregisterWidgetPush": { "title": "UnregisterWidgetPushInput", "type": "object", "additionalProperties": false, "required": ["project", "token"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "token": { "$ref": "#/$defs/apnsToken" } } }, "refreshWidgets": { "title": "RefreshWidgetsInput", "description": "RPC refreshWidgets。その人のウィジェットに「読み直して」を送る(中身は送らない)", "type": "object", "additionalProperties": false, "required": ["project", "actor"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "$ref": "../common.schema.json#/$defs/actor" } } }, "refreshWidgetsResult": { "title": "RefreshWidgetsResult", "description": "sent は今送った。scheduled は間の中なので明けた時に1回送る。coalesced は明けた時の1回がもう入っている。capped は24時間の上限。no_token はトークンが無い", "type": "object", "additionalProperties": false, "required": ["status"], "properties": { "status": { "enum": ["sent", "scheduled", "coalesced", "capped", "no_token"] } } } } },
87
+ "notify/opened.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notify/opened.schema.json", "title": "NotifyOpenedRequest", "description": "POST /v1/notify/opened(api.appgrowstack.com・公開キー)の本文。swift-remote-notifications が通知を押されたときに送る。返事は 204", "type": "object", "additionalProperties": false, "required": ["send_id"], "properties": { "send_id": { "description": "通知の payload の send_id", "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" } } },
88
+ "notify/plan.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notify/plan.schema.json", "title": "NotifyPlanPushRequest", "description": "POST /v1/notify/projects/:project/plans の本文。アプリの repo の notify/app.json(施策の決まり)と notify/copy/<施策>.json(人と AI が書いた文面の案)を、app-growth notify push が1つにして送る。notify はアプリの中身を持たず、最後に送られた決まりで動く。同じ本文を /plans/check に送ると確かめるだけで書かない(app-growth notify check・読みの権限 notify.plan.check)", "type": "object", "additionalProperties": false, "required": ["app", "variants", "pushed_by"], "properties": { "app": { "$ref": "#/$defs/app" }, "variants": { "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/variantDraft" } }, "pushed_by": { "description": "送った物(commit の sha か、人が読む印)", "type": "string", "minLength": 1, "maxLength": 200 } }, "$defs": { "campaignId": { "type": "string", "pattern": "^[a-z][a-z0-9_]{1,40}$" }, "variantId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$" }, "hhmm": { "type": "string", "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$" }, "locale": { "type": "string", "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$" }, "weekday": { "description": "1=日曜〜7=土曜", "type": "integer", "minimum": 1, "maximum": 7 }, "stage": { "enum": ["new", "active", "lapsing", "dormant", "gone"] }, "subscriptionState": { "enum": ["free", "trial", "trial_cancelled", "paid", "paid_cancelled", "expired"] }, "app": { "title": "NotifyApp", "description": "1つのアプリの通知の決まり。id はプロジェクトの id(パスの :project と同じ)", "type": "object", "additionalProperties": false, "required": ["id", "topic", "locales", "fallbackLocale", "defaultTimeZone", "policy", "stages", "review", "traits", "voice", "campaigns"], "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,40}$" }, "topic": { "description": "APNs の apns-topic(バンドル ID)", "type": "string", "minLength": 1, "maxLength": 200 }, "locales": { "description": "案が持つ言語。全部そろわない案は捨てる", "type": "array", "minItems": 1, "maxItems": 40, "uniqueItems": true, "items": { "$ref": "#/$defs/locale" } }, "fallbackLocale": { "description": "その人の言語が locales に無いときの言語", "$ref": "#/$defs/locale" }, "defaultTimeZone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "policy": { "$ref": "#/$defs/deliveryPolicy" }, "stages": { "$ref": "#/$defs/stageThresholds" }, "review": { "description": "案を live にする前の承認の段", "enum": ["required", "notify", "auto"] }, "traits": { "$ref": "#/$defs/traitSchema" }, "weekStartsOn": { "description": "週ごとに数え直す Trait を持つアプリの週の初めの曜日", "$ref": "#/$defs/weekday" }, "dayStartsAt": { "description": "日ごとに数え直す Trait を持つアプリの1日の切り替わる時刻(その人の時間帯)", "$ref": "#/$defs/hhmm" }, "maxLive": { "description": "施策ごとに live にしておける案の数。省くと2", "type": "integer", "minimum": 1, "maximum": 20 }, "voice": { "$ref": "#/$defs/voiceGuide" }, "campaigns": { "type": "array", "maxItems": 60, "items": { "$ref": "#/$defs/campaign" } }, "widgetPush": { "description": "ウィジェットのプッシュ更新(WidgetKit)を使うアプリだけ。間の中に来た頼みは、間が明けた時に1回にまとめる", "type": "object", "additionalProperties": false, "required": ["topic", "minIntervalMinutes", "perDay"], "properties": { "topic": { "type": "string", "pattern": "\\.push-type\\.widgets$" }, "minIntervalMinutes": { "type": "integer", "minimum": 1 }, "perDay": { "type": "integer", "minimum": 1 } } } } }, "stageThresholds": { "description": "段を決める日数。newDays より前にインストールし最近開いた人は new、activeMaxDays 以内に開いた人は active、lapsingMaxDays までが lapsing、dormantMaxDays までが dormant、その後は gone(送らない)", "type": "object", "additionalProperties": false, "required": ["newDays", "activeMaxDays", "lapsingMaxDays", "dormantMaxDays"], "properties": { "newDays": { "type": "integer", "minimum": 1 }, "activeMaxDays": { "type": "integer", "minimum": 0 }, "lapsingMaxDays": { "type": "integer", "minimum": 1 }, "dormantMaxDays": { "type": "integer", "minimum": 1 } } }, "quietHours": { "description": "その人の時間帯で送らない時間。from が to より後なら日をまたぐ", "type": "object", "additionalProperties": false, "required": ["from", "to"], "properties": { "from": { "$ref": "#/$defs/hhmm" }, "to": { "$ref": "#/$defs/hhmm" } } }, "deliveryPolicy": { "title": "NotifyDeliveryPolicy", "description": "アプリごとの配信の決まり。AI は変えられない", "type": "object", "additionalProperties": false, "required": ["perDay", "perWeek", "quietHours", "reminderTrait", "reminderGapMinutes", "holdout", "globalHoldout", "stopAfterUnopened"], "properties": { "perDay": { "description": "その人の時間帯の1日に届く上限", "type": "integer", "minimum": 0 }, "perWeek": { "description": "続いた7日の上限", "type": "integer", "minimum": 0 }, "quietHours": { "$ref": "#/$defs/quietHours" }, "reminderTrait": { "description": "リマインダーの時刻を持つ weekly_times の Trait。null ならぶつかりを見ない", "type": ["string", "null"] }, "reminderGapMinutes": { "description": "リマインダーの前後この分は送らない", "type": "integer", "minimum": 0 }, "holdout": { "description": "施策ごとの抑止群の割合", "type": "number", "minimum": 0, "maximum": 1 }, "globalHoldout": { "description": "製品全体の holdout を lifecycle と promotional の施策に当てるか", "type": "boolean" }, "stopAfterUnopened": { "description": "同じ施策をこの回数続けて開かなかった人には、その施策を止める", "type": "integer", "minimum": 1 }, "thinAfterUnopened": { "description": "同じ施策を after 回続けて開かなかった人には、前に送った日から everyDays 日たつまで送らない", "type": "object", "additionalProperties": false, "required": ["after", "everyDays"], "properties": { "after": { "type": "integer", "minimum": 1 }, "everyDays": { "type": "integer", "minimum": 1 } } }, "transactional": { "description": "頼まれた知らせ(transactional の施策)の上限。抑止群に入れず、開かなくても止めない", "type": "object", "additionalProperties": false, "required": ["perDay", "quietHours"], "properties": { "perDay": { "type": "integer", "minimum": 1 }, "quietHours": { "oneOf": [{ "$ref": "#/$defs/quietHours" }, { "type": "null" }] }, "groups": { "description": "施策のまとまり(limits.group)ごとの1日の上限", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "type": "object", "additionalProperties": false, "required": ["perDay"], "properties": { "perDay": { "type": "integer", "minimum": 1 } } } } } } } }, "traitSchema": { "description": "アプリが identify で送る Trait と、transactional の施策の頼みの値の宣言。AI は名前・型・説明だけを見る", "type": "object", "maxProperties": 60, "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/traitSpec" } }, "traitSpec": { "title": "NotifyTraitSpec", "type": "object", "additionalProperties": false, "required": ["type", "description"], "properties": { "type": { "enum": ["int", "number", "string", "bool", "weekly_times", "url"] }, "description": { "type": "string", "minLength": 1, "maxLength": 400 }, "userText": { "description": "利用者が書いた文。差し込めるが AI には値を見せない", "type": "boolean" }, "maxLength": { "description": "差し込むときの最長(書記素)。超えたら「…」で切る", "type": "integer", "minimum": 1 }, "hardMaxLength": { "description": "これより長い値は差し込まず、差し込みの無い文にする", "type": "integer", "minimum": 1 }, "min": { "description": "これより小さい数は値が無いとみなす", "type": "number" }, "weekly": { "description": "アプリが送った週がその人の今の週と違えば reset の値として読む", "type": "object", "additionalProperties": false, "required": ["reset"], "properties": { "reset": { "oneOf": [{ "type": "number" }, { "type": "object", "additionalProperties": false, "required": ["trait"], "properties": { "trait": { "$ref": "../common.schema.json#/$defs/name" } } }] } } }, "daily": { "description": "アプリが送った日がその人の今の日と違えば reset の値として読む", "type": "object", "additionalProperties": false, "required": ["reset"], "properties": { "reset": { "type": ["number", "boolean"] } } }, "choices": { "description": "決まったキーだけを受け、差し込むときはその人の言語の文を入れる。キー → 言語 → 文", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "numberCondition": { "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "gte": { "type": "number" }, "lte": { "type": "number" }, "gt": { "type": "number" }, "lt": { "type": "number" }, "eq": { "type": "number" } } }, "traitCondition": { "title": "NotifyTraitCondition", "description": "ne は「値が無いか、この値でない」", "oneOf": [{ "$ref": "#/$defs/numberCondition" }, { "type": "object", "additionalProperties": false, "required": ["eq"], "properties": { "eq": { "type": ["string", "boolean"] } } }, { "type": "object", "additionalProperties": false, "required": ["ne"], "properties": { "ne": { "type": ["string", "boolean"] } } }, { "type": "object", "additionalProperties": false, "required": ["in"], "properties": { "in": { "type": "array", "items": { "type": "string" } } } }, { "type": "object", "additionalProperties": false, "required": ["exists"], "properties": { "exists": { "type": "boolean" } } }] }, "traitConditions": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/traitCondition" } }, "segment": { "title": "NotifySegment", "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": { "$ref": "../common.schema.json#/$defs/name" }, "stage": { "oneOf": [{ "$ref": "#/$defs/stage" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/stage" } }] }, "facts": { "type": "object", "additionalProperties": false, "properties": { "reachable": { "description": "許可していて届く端末が1台以上ある", "type": "boolean" }, "subscription": { "oneOf": [{ "$ref": "#/$defs/subscriptionState" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/subscriptionState" } }] }, "daysSinceOpen": { "$ref": "#/$defs/numberCondition" }, "daysSinceInstall": { "$ref": "#/$defs/numberCondition" }, "openedDays7": { "$ref": "#/$defs/numberCondition" }, "openedDays28": { "$ref": "#/$defs/numberCondition" } } }, "traits": { "$ref": "#/$defs/traitConditions" } } }, "calendarDay": { "title": "NotifyCalendarDay", "description": "暦の月と日。その人の時間帯の日付から daysBefore 日後が、calendar の暦で month 月 day 日に当たる日だけ送る(ラマダンの3日前など)。month を省くと毎月の day 日", "type": "object", "additionalProperties": false, "required": ["calendar", "day"], "properties": { "calendar": { "enum": ["gregory", "islamic-umalqura"] }, "month": { "type": "integer", "minimum": 1, "maximum": 12 }, "day": { "type": "integer", "minimum": 1, "maximum": 31 }, "daysBefore": { "type": "integer", "minimum": 0, "maximum": 60 } } }, "trigger": { "title": "NotifyTrigger", "oneOf": [{ "description": "その人がセグメントに入ったとき(1回の入りに1回)", "type": "object", "additionalProperties": false, "required": ["kind", "segment"], "properties": { "kind": { "const": "entered" }, "segment": { "$ref": "#/$defs/segment" } } }, { "description": "出来事が届いたとき。segment があれば、その時にセグメントにいる人だけ", "type": "object", "additionalProperties": false, "required": ["kind", "event"], "properties": { "kind": { "const": "event" }, "event": { "$ref": "../common.schema.json#/$defs/name" }, "segment": { "$ref": "#/$defs/segment" } } }, { "description": "その人の時間帯で決まった曜日か毎日。onDate はその暦の日だけ。whileStopped は同じアプリの別の施策がその人に止まっている間だけ", "type": "object", "additionalProperties": false, "required": ["kind", "weekday", "segment"], "properties": { "kind": { "const": "schedule" }, "weekday": { "oneOf": [{ "$ref": "#/$defs/weekday" }, { "const": "daily" }] }, "segment": { "$ref": "#/$defs/segment" }, "onDate": { "$ref": "#/$defs/calendarDay" }, "whileStopped": { "$ref": "#/$defs/campaignId" } } }, { "description": "同じアプリの施策 campaign が、続けて開かれずにその人に止まったとき(止まる前の1通)", "type": "object", "additionalProperties": false, "required": ["kind", "campaign"], "properties": { "kind": { "const": "stopped" }, "campaign": { "$ref": "#/$defs/campaignId" } } }, { "description": "アプリが send で頼んだ知らせ(transactional の施策だけ)。data は頼みの値の宣言", "type": "object", "additionalProperties": false, "required": ["kind", "data"], "properties": { "kind": { "const": "request" }, "data": { "$ref": "#/$defs/traitSchema" } } }] }, "timing": { "title": "NotifyTiming", "description": "いつ送るか(その人の時間帯)。immediate は頼まれたらすぐ(transactional の施策だけ)", "oneOf": [{ "const": "immediate" }, { "type": "object", "additionalProperties": false, "required": ["at"], "properties": { "at": { "$ref": "#/$defs/hhmm" }, "dayOffset": { "type": "integer", "minimum": 0, "maximum": 7 }, "beforeReminderMinutes": { "description": "その日にリマインダーが鳴る人は、最初のリマインダーのこの分だけ前", "type": "integer", "minimum": 0 }, "withinMinutes": { "description": "望む時刻からこの分のうちに送れなければ送らない", "type": "integer", "minimum": 1 }, "personalHour": { "description": "at の代わりに、その人がふだん開く1時間", "type": "boolean" } } }] }, "campaign": { "title": "NotifyCampaign", "type": "object", "additionalProperties": false, "required": ["id", "kind", "purpose", "goal", "trigger", "timing", "messageClass", "priority", "route"], "properties": { "id": { "$ref": "#/$defs/campaignId" }, "kind": { "description": "週の改善が、同じ種類のほかの製品の施策の結果を事前分布にする", "enum": ["reminder", "streak", "progress", "onboarding", "trial_end", "winback", "farewell", "request"] }, "purpose": { "description": "何のための施策か。AI に渡す", "type": "string", "minLength": 1, "maxLength": 400 }, "goal": { "description": "成果とみなす出来事と、配信からの時間", "type": "object", "additionalProperties": false, "required": ["event", "withinHours"], "properties": { "event": { "$ref": "../common.schema.json#/$defs/name" }, "withinHours": { "type": "number", "exclusiveMinimum": 0 } } }, "trigger": { "$ref": "#/$defs/trigger" }, "timing": { "$ref": "#/$defs/timing" }, "messageClass": { "description": "promotional は別に同意した人だけ。transactional は頼まれた知らせ", "enum": ["lifecycle", "promotional", "transactional"] }, "priority": { "description": "同じ人に同じ日に2つ届くときは大きい方", "type": "integer", "minimum": 0, "maximum": 100 }, "route": { "description": "押したときに開く画面。頼みの値を差し込める", "type": "string", "minLength": 1, "maxLength": 200 }, "presentation": { "type": "object", "additionalProperties": false, "properties": { "category": { "type": "string", "minLength": 1, "maxLength": 64 }, "mutableContent": { "type": "boolean" }, "sound": { "type": "boolean" }, "collapseId": { "description": "差し替えの鍵。null は差し替えない", "type": ["string", "null"], "maxLength": 64 }, "passthrough": { "description": "payload の上の段にそのまま載せる頼みの値", "type": "array", "items": { "$ref": "../common.schema.json#/$defs/name" } } } }, "sendIf": { "description": "送る直前に、その人の今の Trait がこの条件に合うときだけ送る", "$ref": "#/$defs/traitConditions" }, "rotation": { "description": "その人に最近出した avoidRecent 個の案は選ばない", "type": "object", "additionalProperties": false, "required": ["avoidRecent"], "properties": { "avoidRecent": { "type": "integer", "minimum": 1 } } }, "limits": { "description": "transactional の施策だけ", "type": "object", "additionalProperties": false, "properties": { "perDay": { "type": "integer", "minimum": 1 }, "minIntervalMinutes": { "type": "integer", "minimum": 1 }, "group": { "$ref": "../common.schema.json#/$defs/name" } } }, "requires": { "description": "中身の条件(feature:<key> など)。core が解決したバージョンの範囲の人だけに送る", "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "pattern": "^((feature|event|placement|template|fact|action):[a-z0-9_]{1,64}|flag:[a-z0-9_]{1,40}(\\.[a-z0-9_]{1,40}){0,3})$" } }, "excludeAppVersions": { "type": "object", "additionalProperties": false, "properties": { "ios": { "type": "array", "items": { "type": "string", "pattern": "^\\d+\\.\\d+(\\.\\d+)?$" } }, "android": { "type": "array", "items": { "type": "string", "pattern": "^\\d+\\.\\d+(\\.\\d+)?$" } } } }, "expiresAfterMinutes": { "description": "transactional の施策だけ。頼まれてからこの分のうちに送れなければ送らない", "type": "integer", "minimum": 1 } } }, "voiceGuide": { "title": "NotifyVoiceGuide", "description": "アプリの声の決まり。limits・bannedWords・billingWords・emoji・appTerms は機械で確かめ、tone と principles は AI に読ませる", "type": "object", "additionalProperties": false, "required": ["limits", "bannedWords", "billingWords", "emoji", "appTerms", "tone", "principles"], "properties": { "limits": { "description": "言語ごとの題と本文の最長(書記素)", "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "required": ["title", "body"], "properties": { "title": { "type": "integer", "minimum": 1 }, "body": { "type": "integer", "minimum": 1 } } } }, "bannedWords": { "description": "言語 → 使ってはいけない語。* はどの言語にも効く", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1 } } }, "billingWords": { "description": "lifecycle の案に入れてはいけない課金の語", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1 } } }, "emoji": { "type": "object", "additionalProperties": false, "required": ["allowed", "maxPerField", "maxPerMessage", "placement"], "properties": { "allowed": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "maxPerField": { "type": "integer", "minimum": 0 }, "maxPerMessage": { "type": "integer", "minimum": 0 }, "placement": { "enum": ["end", "edges", "any"] } } }, "appTerms": { "description": "言語 → アプリの中の語。題には書けず、本文は日常の言い方か説明の差し込みが同じ文にあるときだけ書ける", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["term", "meaning", "everyday"], "properties": { "term": { "type": "string", "minLength": 1 }, "meaning": { "type": "string", "minLength": 1 }, "everyday": { "type": "string", "minLength": 1 }, "forms": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "explainedBy": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/name" } } } } } }, "tone": { "type": "string" }, "principles": { "type": "array", "items": { "type": "string" } } } }, "localizedCopy": { "title": "NotifyLocalizedCopy", "description": "1つの言語の文面。fallback は差し込む値が無い人に出す文で、差し込みを持たない。extras は payload の上の段に載せる文", "type": "object", "additionalProperties": false, "required": ["title", "body", "fallback"], "properties": { "title": { "type": "string" }, "body": { "type": "string" }, "extras": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "type": "string" } }, "fallback": { "type": "object", "additionalProperties": false, "required": ["title", "body"], "properties": { "title": { "type": "string" }, "body": { "type": "string" } } } } }, "variantDraft": { "title": "NotifyVariantDraft", "description": "repo に書いた案。新しい id は承認を待つ案(proposed)として入る。承認を待つ案は中身を直せる。送ったことのある案(live・retired)の中身は変えられない(変えるなら新しい id にする)", "type": "object", "additionalProperties": false, "required": ["id", "campaign", "hypothesis", "author", "content"], "properties": { "id": { "$ref": "#/$defs/variantId" }, "campaign": { "$ref": "#/$defs/campaignId" }, "hypothesis": { "description": "何を確かめるつもりか", "type": "string", "minLength": 1, "maxLength": 400 }, "author": { "enum": ["human", "ai"] }, "model": { "description": "AI が書いたときのモデル", "type": "string", "minLength": 1, "maxLength": 100 }, "supersedes": { "description": "承認したときに下ろす前の案", "$ref": "#/$defs/variantId" }, "content": { "type": "object", "minProperties": 1, "additionalProperties": { "$ref": "#/$defs/localizedCopy" } } } }, "pushResponse": { "title": "NotifyPlanPushResponse", "description": "problems が1つでもあれば何も書かない(push では 400)。version は書いた決まりのバージョン(check と、書かなかった時は null)", "type": "object", "additionalProperties": false, "required": ["version", "problems", "added", "revised", "removed_campaigns", "retired"], "properties": { "version": { "type": ["integer", "null"], "minimum": 1 }, "problems": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/problem" } }, "added": { "description": "承認を待つ案として入れる案", "type": "array", "items": { "$ref": "#/$defs/variantId" } }, "revised": { "description": "中身を直す、承認を待つ案", "type": "array", "items": { "$ref": "#/$defs/variantId" } }, "removed_campaigns": { "description": "前のバージョンにあって、このバージョンに無い施策。承認を待つ案と割合と止めた記録を消す", "type": "array", "items": { "$ref": "#/$defs/campaignId" } }, "retired": { "description": "消した施策の live の案。行を残して retired(campaign_removed)に下ろす", "type": "array", "items": { "$ref": "#/$defs/variantId" } } } } } },
89
+ "notify/send.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/notify/send.schema.json", "title": "SendInput", "description": "RPC send の入力。その人が頼んだ知らせ(transactional の施策)が起きた。誰に届けるかだけをアプリが決め、何と書くか・いつ・どの端末へ・送るか・測るかは R5 が決める。core が actor を人の id にして appgrowstack-notify へ渡す", "type": "object", "additionalProperties": false, "required": ["project", "actor", "campaign", "key", "data"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "description": "宛先の人", "$ref": "../common.schema.json#/$defs/actor" }, "campaign": { "description": "request のきっかけの施策の id", "type": "string", "pattern": "^[a-z][a-z0-9_]{1,40}$" }, "key": { "description": "二重に送らない鍵。同じ人・同じ施策・同じ鍵の2回目は送らない(<品の id>:<日付>)", "type": "string", "minLength": 1, "maxLength": 200 }, "data": { "description": "施策の data に宣言した値だけ。送り終えたら消す", "type": "object", "propertyNames": { "type": "string", "maxLength": 64 }, "additionalProperties": { "type": ["string", "integer", "number", "boolean"], "maxLength": 2048 } }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "result": { "title": "SendResult", "description": "scheduled は送る時刻を決めた。suppressed は送らないと決めた(理由つき・記録は残る)。duplicate は同じ鍵がもうある。paused は施策を止めている", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["status", "send_id", "scheduled_for"], "properties": { "status": { "const": "scheduled" }, "send_id": { "type": "string" }, "scheduled_for": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, { "type": "object", "additionalProperties": false, "required": ["status", "send_id", "reason"], "properties": { "status": { "const": "suppressed" }, "send_id": { "type": "string" }, "reason": { "type": "string" } } }, { "type": "object", "additionalProperties": false, "required": ["status"], "properties": { "status": { "const": "duplicate" } } }, { "type": "object", "additionalProperties": false, "required": ["status"], "properties": { "status": { "const": "paused" } } }] } } },
90
+ "people/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/people/admin.schema.json", "title": "PeopleSummary", "description": "GET /v1/people/projects/:project/summary(KD-4・getPeopleSummary)。人の数だけ(段階1・people.aggregate.read)。利用者(audience が real)だけを数える。数の定義は docs/design/numbers.md", "type": "object", "additionalProperties": false, "required": ["project", "computed_at", "total", "without_open", "active_7d", "active_30d", "paying", "trial", "granted", "by_platform"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "total": { "description": "利用者。これまでに一度でもアプリを開いた人(people_activity_day が1日以上ある人)", "type": "integer", "minimum": 0 }, "without_open": { "description": "開いた記録の無い人(前の仕組みから移したアカウント・購入や trait だけで分かった人)。total に入れない", "type": "integer", "minimum": 0 }, "active_7d": { "description": "今日を含む直近7日(プロジェクトの時刻の帯)に開いた人。getMetrics の active_people.last_7d と同じ", "type": "integer", "minimum": 0 }, "active_30d": { "description": "今日を含む直近30日に開いた人。getMetrics の active_people.last_30d と同じ", "type": "integer", "minimum": 0 }, "paying": { "description": "課金中の人。有料の期間にいる人(paid・paid_cancelled。解約の予定を含み、無料体験は含まない)。開いた記録の有無を問わない", "type": "integer", "minimum": 0 }, "trial": { "description": "無料体験中の人(trial・trial_cancelled)", "type": "integer", "minimum": 0 }, "granted": { "description": "アプリの付与がある人(people_person.access_grant が null でない人。docs/design/people.md 7節)。ストアの課金でなくアプリが有料の機能を渡している人で、paying・trial とは別に数える(両方に入る人もいる)。開いた記録の有無を問わない", "type": "integer", "minimum": 0 }, "by_platform": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/platform" }, "additionalProperties": { "type": "integer", "minimum": 0 }, "description": "total(利用者)の OS ごとの人数。OS が分からない人(前の仕組みから移した記録など)は入らず、total との差がその人数" } }, "$defs": { "personView": { "title": "PersonView", "description": "GET /v1/people/projects/:project/find?q=(KD-4・findPerson)。q は person_id・install_id・uid のどれかで、1人だけ。段階2(people.person.read・監査に残す)。trait は数・真偽・決まった選択肢の値だけ。文字列の trait は名前の数だけ(string_traits)。見つからなければ 404", "type": "object", "additionalProperties": false, "required": ["project", "person_id", "first_seen_at", "last_seen_at", "platform", "app_version", "channel", "lang", "subscription", "access_grant", "traits", "string_traits", "open_days", "touches_today", "internal"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "first_seen_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "last_seen_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "platform": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/platform" }, { "type": "null" }] }, "app_version": { "type": ["string", "null"] }, "channel": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/buildChannel" }, { "type": "null" }] }, "lang": { "type": ["string", "null"] }, "subscription": { "$ref": "subscription.schema.json#/$defs/state" }, "access_grant": { "description": "アプリの付与の理由(docs/design/people.md 7節)。無ければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/accessGrant" }, { "type": "null" }] }, "traits": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "type": ["integer", "number", "boolean", "string"] } }, "string_traits": { "description": "出さなかった文字列の trait の数", "type": "integer", "minimum": 0 }, "open_days": { "description": "開いた日の数(people_activity_day)", "type": "integer", "minimum": 0 }, "touches_today": { "type": "integer", "minimum": 0 }, "internal": { "description": "R1 の本人とテスターの端末", "type": "boolean" } } }, "personTimeline": { "title": "PersonTimeline", "description": "GET /v1/people/projects/:project/people/:person/timeline(getPersonTimeline)。1人のセッション・購入と課金・キャンペーン・割り当て・群れ・問い合わせ・アプリの付与を1つの時間の並びにする(新しい順・種類ごとに200件まで)。ids はその人につながっている ID の数だけで、値は出さない。段階2(people.person.read・監査に残す)。見つからなければ 404", "type": "object", "additionalProperties": false, "required": ["project", "person_id", "ids", "items", "truncated"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "ids": { "title": "PersonIdCounts", "type": "object", "additionalProperties": false, "required": ["installs", "uids", "merged"], "properties": { "installs": { "description": "つながっている install_id の数", "type": "integer", "minimum": 0 }, "uids": { "description": "つながっている uid の数", "type": "integer", "minimum": 0 }, "merged": { "description": "この人に寄せた人の数(people_merge・直近30日)", "type": "integer", "minimum": 0 } } }, "truncated": { "description": "どれかの種類が200件を超え、古い物を出していない", "type": "boolean" }, "items": { "type": "array", "items": { "title": "PersonTimelineItem", "oneOf": [{ "title": "PersonTimelineSession", "description": "セッション(sessions_session)。at は始まり", "type": "object", "additionalProperties": false, "required": ["kind", "at", "session_id", "duration_ms", "taps", "end_reason", "replay", "platform", "app_version"], "properties": { "kind": { "const": "session" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "session_id": { "type": "string", "minLength": 1, "maxLength": 64 }, "duration_ms": { "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }, "taps": { "type": "integer", "minimum": 0 }, "end_reason": { "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 32 }, { "type": "null" }] }, "replay": { "type": "string", "minLength": 1, "maxLength": 16 }, "platform": { "type": "string", "minLength": 1, "maxLength": 16 }, "app_version": { "type": "string", "minLength": 1, "maxLength": 32 } } }, { "title": "PersonTimelineSubscription", "description": "購入と課金(people_subscription_event)", "type": "object", "additionalProperties": false, "required": ["kind", "at", "type", "period_type", "environment"], "properties": { "kind": { "const": "subscription" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "type": { "type": "string", "minLength": 1, "maxLength": 64 }, "period_type": { "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 32 }, { "type": "null" }] }, "environment": { "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 32 }, { "type": "null" }] } } }, { "title": "PersonTimelineCampaign", "description": "キャンペーン(inapp_exposure)。at は初めて出た時刻、出ていなければ初めて当たった時刻", "type": "object", "additionalProperties": false, "required": ["kind", "at", "campaign", "side", "shown"], "properties": { "kind": { "const": "campaign" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "campaign": { "type": "string", "minLength": 1, "maxLength": 128 }, "side": { "anyOf": [{ "enum": ["treatment", "holdout"] }, { "type": "null" }] }, "shown": { "type": "boolean" } } }, { "title": "PersonTimelineExperiment", "description": "R9の実験の割り当て(experiment_exposure)", "type": "object", "additionalProperties": false, "required": ["kind", "at", "experiment", "variant"], "properties": { "kind": { "const": "experiment" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "experiment": { "type": "string", "minLength": 1, "maxLength": 128 }, "variant": { "type": "string", "minLength": 1, "maxLength": 128 } } }, { "title": "PersonTimelinePriceTier", "description": "値段の段階(people_price_tier)", "type": "object", "additionalProperties": false, "required": ["kind", "at", "tier", "reason", "assignment_source"], "properties": { "kind": { "const": "price_tier" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "tier": { "type": "string", "minLength": 1, "maxLength": 64 }, "reason": { "type": "string", "minLength": 1, "maxLength": 64 }, "assignment_source": { "type": "string", "minLength": 1, "maxLength": 32 } } }, { "title": "PersonTimelineSegment", "description": "群れに入った(people_segment)", "type": "object", "additionalProperties": false, "required": ["kind", "at", "segment"], "properties": { "kind": { "const": "segment" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "segment": { "type": "string", "minLength": 1, "maxLength": 128 } } }, { "title": "PersonTimelineTicket", "description": "問い合わせ(support_ticket)。中身は出さない", "type": "object", "additionalProperties": false, "required": ["kind", "at", "ticket_id", "status", "category"], "properties": { "kind": { "const": "ticket" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "ticket_id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "minLength": 1, "maxLength": 32 }, "category": { "type": "string", "minLength": 1, "maxLength": 64 } } }, { "title": "PersonTimelineAccessGrant", "description": "アプリの付与の今の値(people_person.access_grant_at)。外した時は null", "type": "object", "additionalProperties": false, "required": ["kind", "at", "access_grant"], "properties": { "kind": { "const": "access_grant" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "access_grant": { "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 32 }, { "type": "null" }] } } }] } } } } } },
91
+ "people/forget.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/people/forget.schema.json", "title": "ForgetInput", "description": "R2 の RPC forget の入力(アカウントの削除)。その人の像・つなぎ・値・出来事・触れた記録・端末・問い合わせを消し、配信と判定の記録からはその人の id を外して残す。何度呼んでも同じ結果", "type": "object", "additionalProperties": false, "required": ["project", "actor"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "$ref": "../common.schema.json#/$defs/actor" } } },
92
+ "people/identify.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/people/identify.schema.json", "title": "IdentifyInput", "description": "R2 の RPC identify の入力。その人の今の値(trait)を入れ、actor に uid があれば install と uid をつなぐ(docs/contracts.md の人の id)。trait の名前と型はアプリの TraitSchema に宣言した物だけ。null はその値を消す", "type": "object", "additionalProperties": false, "required": ["project", "actor", "at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "$ref": "../common.schema.json#/$defs/actor" }, "traits": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "maxProperties": 60, "additionalProperties": { "anyOf": [{ "$ref": "#/$defs/traitValue" }, { "type": "null" }] } }, "context": { "$ref": "track.schema.json#/$defs/deviceContext" }, "first_seen_at": { "description": "アプリが知っている、この人が最初に使った時刻(appgrowstack を入れる前のバージョンから使っている人の初回の日)。core は people_person.first_seen_at を今の値とこれの早い方にする。端末の days_since_first_seen は SDK がこの値を受けて同じ起点で数える(受け方は docs/sdk.md)", "$ref": "../common.schema.json#/$defs/epochMs" }, "access_grant": { "description": "アプリの付与(docs/design/people.md 7節)。アプリが今その人に渡している有料の機能の理由。書かなければ変えない。null で外す。値が変わった時だけ core は people_person.access_grant を書き換え、データレイクの events に出来事 access_grant_changed を1行書く。期限のある付与(数日のお試しなど)は送らない", "anyOf": [{ "$ref": "../common.schema.json#/$defs/accessGrant" }, { "type": "null" }] }, "promotional_consent": { "description": "promotional の通知にアプリの中で同意したか(審査の 4.5.4)。書かなければ変えない", "type": "boolean" }, "previous_uid": { "description": "同じ人がこの install で前に使っていた匿名の uid(匿名で始めた人が、ほかの端末で作ったアカウントにサインインした)。core はその uid の人を actor の人に寄せる。匿名でないアカウントからの切り替えには渡さない(docs/design/identity.md)", "$ref": "../common.schema.json#/$defs/uid" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "weeklyTime": { "title": "WeeklyTime", "description": "毎週決まった曜日と時刻。weekday は 1=日曜〜7=土曜(Calendar の weekday と同じ)", "type": "object", "additionalProperties": false, "required": ["weekday", "hour", "minute"], "properties": { "weekday": { "type": "integer", "minimum": 1, "maximum": 7 }, "hour": { "type": "integer", "minimum": 0, "maximum": 23 }, "minute": { "type": "integer", "minimum": 0, "maximum": 59 } } }, "traitValue": { "title": "TraitValue", "anyOf": [{ "$ref": "../common.schema.json#/$defs/typedValue" }, { "type": "array", "maxItems": 14, "items": { "$ref": "#/$defs/weeklyTime" } }] }, "result": { "title": "IdentifyResult", "description": "アプリは person_id を端末の SDK の person に渡す(holdout の側はこの id で決まる)", "type": "object", "additionalProperties": false, "required": ["person_id", "linked", "merged_from"], "properties": { "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "linked": { "description": "この呼び出しで install と uid を新しくつないだ", "type": "boolean" }, "merged_from": { "description": "この呼び出しで、この人に寄せた別の人の id(入れ直した後にサインインした・ほかの端末で同じアカウントに入った)", "anyOf": [{ "$ref": "../common.schema.json#/$defs/personId" }, { "type": "null" }] } } }, "deviceIdentity": { "title": "AppGrowStackIdentity", "description": "アプリの Worker が identify の答えを端末へ返す形。アプリの API の答えの最上位に項目 appgrowstack としてこのまま載せる({\"appgrowstack\": {\"person_id\": …}})。端末は person_id を SDK の person に渡す。merged が true なら端末の側が変わったことがある", "type": "object", "additionalProperties": false, "required": ["person_id", "merged"], "properties": { "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "merged": { "description": "IdentifyResult の merged_from が null でない", "type": "boolean" } } } } },
93
+ "people/identity-cases.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/people/identity-cases.schema.json", "title": "IdentityCases", "description": "schema/cases/people/identity.json。R2 の人の id の決め方の表(B3 が通す)", "type": "object", "additionalProperties": false, "required": ["description", "cases"], "properties": { "description": { "type": "string" }, "cases": { "type": "array", "minItems": 1, "items": { "title": "IdentityCase", "type": "object", "additionalProperties": false, "required": ["description", "project", "steps", "links"], "properties": { "description": { "type": "string" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "steps": { "type": "array", "minItems": 1, "items": { "title": "IdentityStep", "type": "object", "additionalProperties": false, "required": ["call", "actor", "expect"], "properties": { "call": { "enum": ["track", "identify", "subscription"] }, "actor": { "$ref": "../common.schema.json#/$defs/actor" }, "previous_uid": { "description": "identify だけ", "$ref": "../common.schema.json#/$defs/uid" }, "expect": { "type": "object", "additionalProperties": false, "required": ["person_id"], "properties": { "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "linked": { "type": "boolean" }, "merged_from": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/personId" }, { "type": "null" }] } } } } } }, "links": { "description": "最後のつなぎ。<install|uid>:<値> → person_id", "type": "object", "propertyNames": { "pattern": "^(install|uid):" }, "additionalProperties": { "$ref": "../common.schema.json#/$defs/personId" } } } } } } },
94
+ "people/subscription.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/people/subscription.schema.json", "title": "SubscriptionInput", "description": "R2 の RPC subscription の入力。アプリの Worker が自分の webhook で受けた RevenueCat の1件をそのまま渡す(app-growth は RevenueCat の鍵を持たない)。形の正本は RevenueCat の webhook の event", "type": "object", "additionalProperties": false, "required": ["project", "actor", "id", "type", "period_type", "environment", "at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "description": "uid は app_user_id → aliases → original_app_user_id → transferred_to の順に選んだ匿名でない id", "$ref": "../common.schema.json#/$defs/actor" }, "id": { "description": "event.id。同じ id の2回目は何もしない", "type": "string", "minLength": 1, "maxLength": 200 }, "type": { "description": "event.type(INITIAL_PURCHASE・CANCELLATION など)", "type": "string", "minLength": 1, "maxLength": 64 }, "period_type": { "anyOf": [{ "type": "string", "maxLength": 64 }, { "type": "null" }] }, "environment": { "anyOf": [{ "enum": ["PRODUCTION", "SANDBOX"] }, { "type": "null" }] }, "at": { "description": "event.event_timestamp_ms", "$ref": "../common.schema.json#/$defs/epochMs" }, "product_id": { "description": "event.product_id(K8-1)。R9 のペイウォールの物差しが商品ごとに数える", "type": "string", "minLength": 1, "maxLength": 200 }, "presented_offering_id": { "description": "event.presented_offering_id(K8-1)。買ったときに出ていた Offering。ConfigReport のペイウォールの物差しを Offering ごとに分ける", "anyOf": [{ "type": "string", "minLength": 1, "maxLength": 200 }, { "type": "null" }] }, "price_usd": { "description": "event.price_in_purchased_currency を USD にした物(event.price)。返金は負", "anyOf": [{ "type": "number" }, { "type": "null" }] }, "store": { "description": "event.store(APP_STORE・PLAY_STORE など)", "type": "string", "minLength": 1, "maxLength": 40 }, "country": { "description": "event.country_code(RevenueCat が利用者の最後の通信の場所から決めた国・ISO 3166-1 alpha-2)。データレイクの subscriptions.country はこの値で、無ければ人の通信の国(people_person.country)", "type": "string", "pattern": "^[A-Z]{2}$" } }, "$defs": { "state": { "title": "SubscriptionState", "description": "人の像の課金の状態(people_person.subscription)", "enum": ["free", "trial", "trial_cancelled", "paid", "paid_cancelled", "expired"] } } },
95
+ "people/touch.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/people/touch.schema.json", "title": "TouchInput", "description": "R2 の RPC touch の入力。1人に触れた1回を数える。record は起きた後に数える(画面の中は端末が出した後に campaign_shown から)。reserve は触れる前に上限を確かめて1回分を取る(通知が送る前に呼ぶ)。上限は registry の touch_budget", "type": "object", "additionalProperties": false, "required": ["project", "person_id", "channel", "class", "source", "key", "mode", "at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "channel": { "$ref": "#/$defs/channel" }, "class": { "description": "transactional は数えるが上限で止めない", "enum": ["lifecycle", "promotional", "transactional"] }, "source": { "title": "TouchSource", "type": "object", "additionalProperties": false, "required": ["context", "campaign"], "properties": { "context": { "enum": ["inapp", "notify", "support"] }, "campaign": { "description": "件か施策の id", "type": "string", "pattern": "^[a-z0-9_-]{1,64}$" } } }, "key": { "description": "同じ人・同じ経路・同じ source で、同じ鍵の2回目は数えない(画面の中は campaign_shown の出来事の id・通知は send_id)", "type": "string", "minLength": 1, "maxLength": 200 }, "mode": { "enum": ["record", "reserve"] }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "channel": { "title": "TouchChannel", "enum": ["inapp", "push", "email"] }, "result": { "title": "TouchResult", "description": "recorded は数えた(record)・reserved は取れた(reserve)・capped は上限で取れなかった(reserve だけ。数えない)・duplicate は同じ鍵が前にある", "type": "object", "additionalProperties": false, "required": ["status", "day", "used", "remaining"], "properties": { "status": { "enum": ["recorded", "reserved", "capped", "duplicate"] }, "day": { "$ref": "../common.schema.json#/$defs/day" }, "used": { "title": "TouchUsed", "description": "この呼び出しの後の数", "type": "object", "additionalProperties": false, "required": ["day", "week", "channel_day"], "properties": { "day": { "type": "integer", "minimum": 0 }, "week": { "type": "integer", "minimum": 0 }, "channel_day": { "type": "integer", "minimum": 0 } } }, "remaining": { "description": "今日あと何回触れてよいか(全部の経路と、この経路の小さい方)", "type": "integer", "minimum": 0 } } } } },
96
+ "people/track.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/people/track.schema.json", "title": "TrackInput", "description": "R2 の RPC track の入力。アプリの Worker が、端末から受けた封筒の出来事のうち判定と成果に要る物を渡す。1回の呼び出しは1人分。app_open は R2 が意味を知っている(最後に開いた日・開いた日を進める)", "type": "object", "additionalProperties": false, "required": ["project", "actor", "events"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "actor": { "$ref": "../common.schema.json#/$defs/actor" }, "context": { "$ref": "#/$defs/deviceContext" }, "events": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "$ref": "#/$defs/trackedEvent" } } }, "$defs": { "trackedEvent": { "title": "TrackedEvent", "type": "object", "additionalProperties": false, "required": ["id", "name", "at", "props"], "properties": { "id": { "description": "封筒の出来事の id。同じ id の2回目は入れない", "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "props": { "$ref": "../common.schema.json#/$defs/typedProps" } } }, "deviceContext": { "title": "DeviceContext", "description": "封筒の端末の値。書いた物だけ人の像を上書きする", "type": "object", "additionalProperties": false, "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "channel": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "region": { "description": "端末の言語の設定の地域(Locale の region)。国ではない。フィリピンなどは en-US の端末が多く US になる", "type": "string", "pattern": "^[A-Z]{2}$" }, "country": { "description": "端末の通信の国(ISO 3166-1 alpha-2)。アプリの Worker が受けた要求の request.cf.country(IP の国)を渡す。XX・T1 は渡さない。データレイクの events.country はこの値", "type": "string", "pattern": "^[A-Z]{2}$" }, "time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "sdk_version": { "description": "端末の SDK(swift-app-sdk・kotlin-app-sdk)の版。core の doctor が出す", "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$", "maxLength": 32 }, "asn": { "description": "端末の通信の AS 番号。アプリの Worker が受けた要求の request.cf.asn をそのまま渡す。Apple と Google の AS なら人を review・robot にする(docs/design/people.md 6節)", "type": "integer", "minimum": 0, "maximum": 4294967295 } } }, "result": { "title": "TrackResult", "type": "object", "additionalProperties": false, "required": ["person_id", "accepted", "duplicates", "dropped"], "properties": { "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "accepted": { "type": "integer", "minimum": 0 }, "duplicates": { "description": "id が前に入っていて捨てた数", "type": "integer", "minimum": 0 }, "dropped": { "description": "受け入れの絞り込み(K2-6)で残さなかった数。名前が campaign_*・campaigns_*・app_open・app_updated でも、直近90日に送った組の件のきっかけ・成果でもない出来事", "type": "integer", "minimum": 0 } } } } },
97
+ "pricing/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/pricing/admin.schema.json", "title": "PricingPushRequest", "description": "POST /v1/pricing/projects/:project の本文。アプリの repo の pricing/ladder.json と pricing/offers.json をまとめて置き換える", "type": "object", "additionalProperties": false, "required": ["ladder", "offers", "published_by"], "properties": { "ladder": { "$ref": "ladder.schema.json" }, "offers": { "$ref": "offers.schema.json" }, "published_by": { "type": "string", "minLength": 1, "maxLength": 200 } }, "$defs": { "pushResponse": { "title": "PricingPushResponse", "type": "object", "additionalProperties": false, "required": ["version", "pushed_at"], "properties": { "version": { "type": "integer", "minimum": 1 }, "pushed_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "tierReason": { "title": "PriceTierReason", "description": "段階を決めた理由。eu_storefront: 欧州(EU と英国)か storefront が分からない端末は既定。kept: 30日の間は前に決めた段階のまま。rule: 群れの規則。experiment: 値段の実験(組の experiments のうち pricing.tier を変える物)の案。experiment_pinned: 値段の実験の中だが install_id の端末なので最初の案。default: どれにも当たらない", "enum": ["eu_storefront", "kept", "rule", "experiment", "experiment_pinned", "default"] }, "signatureRequest": { "title": "OfferSignatureRequest", "description": "POST /v1/pricing/offer-signatures の本文(端末)。今の pricing/offers.json の ios のオファーと、今の階段の商品だけを署名する", "type": "object", "additionalProperties": false, "required": ["product_id", "offer_id"], "properties": { "product_id": { "type": "string", "minLength": 1, "maxLength": 100 }, "offer_id": { "type": "string", "minLength": 1, "maxLength": 100 }, "app_account_token": { "description": "StoreKit の appAccountToken(UUID)。書けば署名に入る", "type": "string", "pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$" } } }, "signature": { "title": "OfferSignature", "description": "StoreKit の Product.PurchaseOption.promotionalOffer に渡す値", "type": "object", "additionalProperties": false, "required": ["key_id", "nonce", "timestamp", "signature"], "properties": { "key_id": { "type": "string" }, "nonce": { "description": "小文字の UUID", "type": "string" }, "timestamp": { "$ref": "../common.schema.json#/$defs/epochMs" }, "signature": { "description": "ECDSA P-256・SHA-256 の DER を base64", "type": "string" } } }, "priceExperiment": { "title": "PriceExperimentAssignment", "description": "値段の段階を決めた実験の割り当て。SDK はこの段階の値段を出したペイウォールを表示した時に experiment_exposed(surface price・key pricing.tier)を送る", "type": "object", "additionalProperties": false, "required": ["experiment", "variant", "layer", "propensity"], "properties": { "experiment": { "$ref": "../experiment/experiment.schema.json#/$defs/id" }, "variant": { "$ref": "../common.schema.json#/$defs/name" }, "layer": { "$ref": "../experiment/experiment.schema.json#/$defs/layer" }, "propensity": { "$ref": "../common.schema.json#/$defs/propensity" } } } } },
98
+ "pricing/case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/pricing/case.schema.json", "title": "PriceTierCase", "description": "schema/cases/pricing/*.json の1つ。値段の段階の決め方(欧州 → 30日 → 群れの規則 → 値段の実験 → 既定)。値段の実験は組の experiments のうち pricing.tier を変える物を中核の assignExperiment で割り当てる。TypeScript(packages/campaign-rules の decidePriceTier。core が使う)が答えを返す", "type": "object", "additionalProperties": false, "required": ["description", "project", "ladder", "experiments", "segments", "storefront", "assignment", "previous", "now", "expect"], "properties": { "description": { "type": "string" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "ladder": { "$ref": "ladder.schema.json" }, "experiments": { "description": "組の experiments(served の形)", "type": "array", "items": { "$ref": "../experiment/experiment.schema.json#/$defs/served" } }, "facts": { "description": "core が知っている端末の値(platform・app_version・lang・region)。実験の when と app_version に使う。無い値の条件は当たらない", "$ref": "../common.schema.json#/$defs/typedProps" }, "segments": { "type": "array", "items": { "$ref": "../segments/segment.schema.json#/$defs/segmentId" } }, "storefront": { "description": "ストアの国(ISO 3166-1 の2文字・大文字)。分からなければ null", "anyOf": [{ "type": "string", "pattern": "^[A-Z]{2}$" }, { "type": "null" }] }, "assignment": { "$ref": "../experiment/variant.schema.json#/$defs/assignment" }, "previous": { "description": "前に決めた段階。無ければ null", "anyOf": [{ "type": "null" }, { "type": "object", "additionalProperties": false, "required": ["tier", "reason", "decided_at"], "properties": { "tier": { "$ref": "ladder.schema.json#/$defs/tierId" }, "reason": { "$ref": "admin.schema.json#/$defs/tierReason" }, "decided_at": { "$ref": "../common.schema.json#/$defs/isoTime" } } }] }, "now": { "$ref": "../common.schema.json#/$defs/isoTime" }, "expect": { "type": "object", "additionalProperties": false, "required": ["tier", "reason", "decided_at", "experiment"], "properties": { "tier": { "$ref": "ladder.schema.json#/$defs/tierId" }, "reason": { "$ref": "admin.schema.json#/$defs/tierReason" }, "decided_at": { "description": "kept なら前に決めた時刻、ほかは now", "$ref": "../common.schema.json#/$defs/isoTime" }, "experiment": { "anyOf": [{ "$ref": "admin.schema.json#/$defs/priceExperiment" }, { "type": "null" }] } } } } },
99
+ "pricing/check-case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/pricing/check-case.schema.json", "title": "PricingCheckCase", "description": "schema/cases/pricing-check/*.json の1つ。値段の階段の確かめ(packages/campaign-rules の pricingProblems。CLI の pricing check と core の push が使う)が、どの欄を誤りにするか。段階は年額の値段で分けるので、年額は段階ごとに別の商品にする。月額は段階の間で共有してよい。1つの商品を年額と月額の両方の欄に書いたら誤り", "type": "object", "additionalProperties": false, "required": ["description", "ladder", "segments", "expect"], "properties": { "description": { "type": "string" }, "ladder": { "$ref": "ladder.schema.json" }, "segments": { "description": "segments/ にある群れの id", "type": "array", "items": { "$ref": "../segments/segment.schema.json#/$defs/segmentId" } }, "expect": { "description": "誤りにする欄の JSON Pointer(/ladder から)。並びは pricingProblems が返す順。誤りが無ければ空", "type": "array", "items": { "type": "string", "pattern": "^/ladder(/.*)?$" } } } },
100
+ "pricing/ladder.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/pricing/ladder.schema.json", "title": "PricingLadder", "description": "値段の階段(docs/design/remote-screens.md 4.1節)。アプリの repo の pricing/ladder.json。商品は先に App Store Connect と Play Console に作り、審査に1度通した物だけを書く。段階ごとに日本の storefront の年額と月額を書き、core が送る時に事業の決まり(値段の下限・値下げしない)で確かめる(docs/design/registry.md 5節)。1人に1つの段階を、群れの規則 → 値段の実験(pricing.tier を変えるレイヤー pricing の実験。docs/design/experimentation.md 7.4節)→ 既定の順に決め、30日は変えない。欧州(EU と英国)の storefront は既定だけ", "type": "object", "additionalProperties": false, "required": ["tiers"], "properties": { "tiers": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "$ref": "#/$defs/tier" } }, "rules": { "description": "上から見て、最初に所属している群れの段階にする", "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/rule" } } }, "$defs": { "tierId": { "title": "PriceTierId", "description": "値段の段階の id。英小文字で始まり、英小文字・数字・_ の40文字まで(t4800 など)", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$" }, "tier": { "title": "PriceTier", "type": "object", "additionalProperties": false, "required": ["id", "offering", "annual", "monthly", "annual_jpy", "monthly_jpy"], "properties": { "id": { "$ref": "#/$defs/tierId" }, "offering": { "description": "RevenueCat の Offering の id", "type": "string", "minLength": 1, "maxLength": 100 }, "annual": { "description": "年額の商品の id", "type": "string", "minLength": 1, "maxLength": 100 }, "monthly": { "description": "月額の商品の id", "type": "string", "minLength": 1, "maxLength": 100 }, "annual_jpy": { "description": "年額の商品の日本の storefront の値段(円・税込)。App Store Connect と Play Console に付けた値と同じにする。core が決まり pricing.annual_min_jpy と pricing.no_markdown で確かめる", "type": "integer", "minimum": 1, "maximum": 1000000 }, "monthly_jpy": { "description": "月額の商品の日本の storefront の値段(円・税込)。core が決まり pricing.monthly_min_jpy と pricing.no_markdown で確かめる", "type": "integer", "minimum": 1, "maximum": 100000 }, "default": { "description": "既定の段階。ちょうど1つに書く", "const": true } } }, "rule": { "title": "PriceTierRule", "type": "object", "additionalProperties": false, "required": ["segment", "tier"], "properties": { "segment": { "$ref": "../segments/segment.schema.json#/$defs/segmentId" }, "tier": { "$ref": "#/$defs/tierId" } } } } },
101
+ "pricing/offers.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/pricing/offers.schema.json", "title": "PricingOffers", "description": "オファー(docs/design/remote-screens.md 4.2節)。アプリの repo の pricing/offers.json。「値段が高すぎた」の合図をきっかけに、ストアのオファーを中身にした画面を出す。R4 の件として配る。1人に同じオファーは1回まで、オファーを全部合わせて14日に1回まで", "type": "object", "additionalProperties": false, "required": ["offers"], "properties": { "offers": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/offer" } } }, "$defs": { "offer": { "title": "PricingOffer", "type": "object", "additionalProperties": false, "required": ["id", "when", "screen", "store_offer", "max_per_person"], "properties": { "id": { "description": "R4 の件の id にもなる", "type": "string", "pattern": "^[a-z0-9_-]{3,40}$" }, "when": { "$ref": "#/$defs/when" }, "screen": { "description": "出すリモート画面の id", "type": "string", "pattern": "^[a-z0-9_]{1,64}$" }, "store_offer": { "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "ios": { "description": "Apple のプロモーションのオファーの id(署名は core の POST /v1/pricing/offer-signatures)", "type": "string", "minLength": 1, "maxLength": 100 }, "android": { "description": "Play の開発者が決めるオファーのタグ", "type": "string", "minLength": 1, "maxLength": 100 } } }, "max_per_person": { "description": "1人に出す回数。1だけ", "const": 1 } } }, "when": { "title": "PricingOfferWhen", "type": "object", "additionalProperties": false, "required": ["event"], "properties": { "event": { "description": "きっかけの出来事(paywall_closed など)", "$ref": "../common.schema.json#/$defs/eventName" }, "where": { "description": "出来事の引数の条件。{ \"<引数>\": { \"<演算子>\": 値 } }", "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "type": "object", "minProperties": 1, "maxProperties": 1, "additionalProperties": false, "properties": { "eq": { "$ref": "../common.schema.json#/$defs/typedValue" }, "gte": { "type": "number" }, "lte": { "type": "number" } } } }, "not_purchased_days": { "description": "この日数のあいだ買っていない人だけ", "type": "integer", "minimum": 0, "maximum": 90 } } } } },
102
+ "registry/account.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/account.schema.json", "title": "Account", "description": "R1 のアカウントの1件(docs/design/registry.md 6節)。組織が持つ外のアカウントと契約(ストアの開発者・SNS・動画のチャンネル)。名前・状態・入っている制度・使うキーのプロファイルの名前だけを持ち、秘密の値とログインのメールは持たない。表は registry_account", "type": "object", "additionalProperties": false, "required": ["org", "id", "kind", "name", "handle", "status", "projects", "programs", "key_profile", "note", "updated_at", "updated_by"], "properties": { "org": { "type": "string", "pattern": "^org_[A-Za-z0-9]{16}$" }, "id": { "$ref": "#/$defs/accountId" }, "kind": { "$ref": "#/$defs/accountKind" }, "name": { "description": "人が読む名前", "type": "string", "minLength": 1, "maxLength": 80 }, "handle": { "description": "外で見える名前か id(@gohobishukan・UC… のチャンネルの id・Play の開発者の id)。無ければ null", "type": ["string", "null"], "maxLength": 120 }, "status": { "$ref": "#/$defs/accountStatus" }, "projects": { "description": "このアカウントを使うプロジェクト。組織の全部の製品で使う物は空", "type": "array", "maxItems": 30, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/projectId" } }, "programs": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/accountProgram" } }, "key_profile": { "description": "このアカウントに触る with-secrets のプロファイルの名前。無ければ null", "type": ["string", "null"], "pattern": "^[a-z0-9-]{1,40}$" }, "note": { "description": "基盤の外でしか分からない事(ログインの仕方の種類・制限の理由)。秘密の値は書かない", "type": "string", "maxLength": 500 }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_by": { "description": "書いた主体の id", "type": "string", "maxLength": 80 } }, "$defs": { "accountId": { "title": "AccountId", "description": "アカウントの id。英小文字・数字・- の40文字まで(instagram-gohobishukan)", "type": "string", "pattern": "^[a-z][a-z0-9-]{1,39}$" }, "accountKind": { "title": "AccountKind", "description": "アカウントの種類。apple_developer Apple の開発者・google_play Play の開発者・apple_ads Apple Ads・instagram・tiktok・youtube・x", "enum": ["apple_developer", "google_play", "apple_ads", "instagram", "tiktok", "youtube", "x"] }, "accountStatus": { "title": "AccountStatus", "description": "active 使える・pending 申し込みか審査の途中・restricted 一部の操作が止められている・closed 閉じた", "enum": ["active", "pending", "restricted", "closed"] }, "accountProgram": { "title": "AccountProgram", "description": "アカウントに入っている制度と契約(Small Business Program・Private Cloud Compute など)", "type": "object", "additionalProperties": false, "required": ["name", "status", "since"], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "status": { "$ref": "#/$defs/accountStatus" }, "since": { "description": "今の状態になった日。分からなければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] } } }, "putAccountRequest": { "title": "PutAccountRequest", "description": "PUT /v1/registry/accounts/:account の本文。作るか置き換える", "type": "object", "additionalProperties": false, "required": ["kind", "name", "status"], "properties": { "kind": { "$ref": "#/$defs/accountKind" }, "name": { "$ref": "#/properties/name" }, "handle": { "$ref": "#/properties/handle" }, "status": { "$ref": "#/$defs/accountStatus" }, "projects": { "$ref": "#/properties/projects" }, "programs": { "$ref": "#/properties/programs" }, "key_profile": { "$ref": "#/properties/key_profile" }, "note": { "$ref": "#/properties/note" } } }, "accountList": { "title": "AccountList", "description": "GET /v1/registry/accounts(listAccounts)の答え。組織のアカウントを種類・id の順で。?project=<id> でそのプロジェクトのアカウントと、組織の全部で使うアカウントだけ", "type": "object", "additionalProperties": false, "required": ["accounts"], "properties": { "accounts": { "type": "array", "maxItems": 200, "items": { "$ref": "#" } } } } } },
103
+ "registry/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/admin.schema.json", "title": "CreateProjectRequest", "description": "POST /v1/registry/projects(admin.appgrowstack.com)の本文。公開キーとサーバーキーを1つずつ作り、touch_budget を既定(1日2・1週6)で、campaign_policy を書かなければ既定(4回・0.2)で入れる", "type": "object", "additionalProperties": false, "required": ["id", "name", "web_domain", "support_email", "default_time_zone"], "properties": { "id": { "$ref": "../common.schema.json#/$defs/projectId", "not": { "$ref": "../common.schema.json#/$defs/reservedProjectId" } }, "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "web_domain": { "type": "string", "pattern": "^[a-z0-9.-]+\\.[a-z]{2,}$" }, "support_email": { "type": "string", "pattern": "^[^@\\s]+@[a-z0-9.-]+\\.[a-z]{2,}$" }, "default_time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "features": { "$ref": "project.schema.json#/properties/features" }, "campaign_policy": { "$ref": "project.schema.json#/properties/campaign_policy" } }, "$defs": { "createResponse": { "title": "CreateProjectResponse", "description": "201。server_key は今だけ見せる(表には sha256 だけ)", "type": "object", "additionalProperties": false, "required": ["project", "public_key", "server_key"], "properties": { "project": { "$ref": "project.schema.json" }, "public_key": { "$ref": "../common.schema.json#/$defs/publicKey" }, "server_key": { "$ref": "../common.schema.json#/$defs/serverKey" } } }, "updateProjectRequest": { "title": "UpdateProjectRequest", "description": "PATCH /v1/registry/projects/:project。書いた項目だけ変える。track から china_events_since までは R13 の判断の値(docs/design/insights.md 2.1節・app-growth project set)、repos は作業を結ぶ repo、release_weekday から release_hold_paths までは週1回のリリースの値で、null を書くと消す", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "status": { "enum": ["active", "paused"] }, "web_domain": { "type": "string", "pattern": "^[a-z0-9.-]+\\.[a-z]{2,}$" }, "support_email": { "type": "string", "pattern": "^[^@\\s]+@[a-z0-9.-]+\\.[a-z]{2,}$" }, "default_time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "features": { "$ref": "project.schema.json#/properties/features" }, "campaign_policy": { "$ref": "project.schema.json#/properties/campaign_policy" }, "track": { "anyOf": [{ "$ref": "project.schema.json#/properties/track" }, { "type": "null" }] }, "stage": { "anyOf": [{ "$ref": "project.schema.json#/properties/stage" }, { "type": "null" }] }, "focus": { "anyOf": [{ "$ref": "project.schema.json#/properties/focus" }, { "type": "null" }] }, "targets": { "anyOf": [{ "$ref": "project.schema.json#/properties/targets" }, { "type": "null" }] }, "decide_on": { "anyOf": [{ "$ref": "project.schema.json#/properties/decide_on" }, { "type": "null" }] }, "store_fee_rate": { "anyOf": [{ "$ref": "project.schema.json#/properties/store_fee_rate" }, { "type": "null" }] }, "competitors": { "anyOf": [{ "$ref": "project.schema.json#/properties/competitors" }, { "type": "null" }] }, "keywords": { "anyOf": [{ "$ref": "project.schema.json#/properties/keywords" }, { "type": "null" }] }, "china_events_since": { "anyOf": [{ "$ref": "project.schema.json#/properties/china_events_since" }, { "type": "null" }] }, "repos": { "anyOf": [{ "$ref": "project.schema.json#/properties/repos" }, { "type": "null" }] }, "release_weekday": { "anyOf": [{ "$ref": "project.schema.json#/properties/release_weekday" }, { "type": "null" }] }, "release_path": { "anyOf": [{ "$ref": "project.schema.json#/properties/release_path" }, { "type": "null" }] }, "release_hold_paths": { "anyOf": [{ "$ref": "project.schema.json#/properties/release_hold_paths" }, { "type": "null" }] } } }, "putAppRequest": { "title": "PutAppRequest", "description": "PUT /v1/registry/projects/:project/apps/:platform。project・platform・created_at は道と core が決める", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["bundle_id", "asc_app_id"], "properties": { "bundle_id": { "type": "string", "pattern": "^[A-Za-z0-9.-]{3,155}$" }, "asc_app_id": { "type": "string", "pattern": "^[0-9]{6,12}$" }, "asc_provider_token": { "$ref": "app.schema.json#/$defs/ascProviderToken" }, "status": { "enum": ["active", "retired"] } } }, { "type": "object", "additionalProperties": false, "required": ["package"], "properties": { "package": { "type": "string", "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$" }, "status": { "enum": ["active", "retired"] } } }] }, "createKeyRequest": { "title": "CreateKeyRequest", "description": "POST /v1/registry/projects/:project/keys。回すときは新しいキーを作り、アプリを出した後に古いキーを revoke する", "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["public", "server"] }, "scopes": { "description": "server だけ。書かなければ全部", "type": "array", "uniqueItems": true, "minItems": 1, "items": { "$ref": "key.schema.json#/$defs/serverScope" } }, "days": { "description": "server だけ。期限の日数(既定365)", "type": "integer", "minimum": 1, "maximum": 365 } } }, "createKeyResponse": { "title": "CreateKeyResponse", "description": "201。secret はサーバーキーのときだけ・今だけ", "type": "object", "additionalProperties": false, "required": ["key"], "properties": { "key": { "$ref": "key.schema.json" }, "secret": { "$ref": "../common.schema.json#/$defs/serverKey" } } }, "putInternalMarkRequest": { "title": "PutInternalMarkRequest", "description": "PUT /v1/registry/projects/:project/internal/:match/:value(app-growth registry internal add)。同じマークの2回目は kind と label を書き換える", "type": "object", "additionalProperties": false, "required": ["kind", "label"], "properties": { "kind": { "enum": ["owner", "tester"] }, "label": { "type": "string", "minLength": 1, "maxLength": 80 } } }, "internalMarkResult": { "title": "InternalMarkResult", "description": "マークを付けた・外した答え。people はマークで audience が変わった人の数(その人の出来事も書き換えた)", "type": "object", "additionalProperties": false, "required": ["mark", "people"], "properties": { "mark": { "$ref": "internal.schema.json" }, "people": { "type": "integer", "minimum": 0 } } }, "internalMarkList": { "title": "InternalMarkList", "description": "GET /v1/registry/projects/:project/internal(app-growth registry internal list)。marks はマーク、audiences は今の見分けごとの人数", "type": "object", "additionalProperties": false, "required": ["marks", "audiences"], "properties": { "marks": { "type": "array", "items": { "$ref": "internal.schema.json" } }, "audiences": { "$ref": "../common.schema.json#/$defs/audienceCounts" } } }, "ownerClaim": { "title": "OwnerClaim", "description": "POST /v1/registry/projects/:project/owner-claims。本人が端末に本人のマークを付けるための、10分で切れるリンク。端末で url を開くとアプリがユニバーサルリンク・App Links で受け、SDK が token を頭 AppGrowStack-Owner-Claim に付けて api を呼んだ端末の DeviceHash に owner のマークが付く(docs/design/people.md 6.3節)。token は答えで1回だけ見せ、core は sha256 だけを持つ", "type": "object", "additionalProperties": false, "required": ["url", "expires_at"], "properties": { "url": { "description": "製品のドメインの https://<web_domain>/app/owner-claim/<token>。アプリが受けるリンクで、api はこのパスを持たない", "type": "string", "pattern": "^https://[^/]+/app/owner-claim/[A-Za-z0-9]{32}$" }, "expires_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "ownerClaimEntry": { "title": "OwnerClaimEntry", "description": "本人のリンクの1件(docs/design/people.md 6.3節)。token は持たず、id で指す。state は open(まだ使える)・claimed(端末にマークを付けた)・expired(切れた)・revoked(無効にした)。無効にしたリンクはアプリで開いてもマークを付けない", "type": "object", "additionalProperties": false, "required": ["id", "state", "created_by", "created_at", "expires_at", "claimed_at", "device", "platform", "revoked_at", "revoked_by"], "properties": { "id": { "description": "token の sha256 の頭16文字。秘密ではなく、一覧と無効にする操作で使う", "type": "string", "pattern": "^[0-9a-f]{16}$" }, "state": { "enum": ["open", "claimed", "expired", "revoked"] }, "created_by": { "description": "作った主体の id(agt_・usr_・sys:)", "type": "string", "maxLength": 80 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "expires_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "claimed_at": { "description": "アプリが token を送り、端末にマークを付けた時刻。まだなら null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "device": { "description": "マークを付けた端末", "anyOf": [{ "$ref": "../common.schema.json#/$defs/deviceHash" }, { "type": "null" }] }, "platform": { "description": "マークを付けた端末の OS", "enum": ["ios", "android", "other", null] }, "revoked_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "revoked_by": { "description": "無効にした主体の id", "type": ["string", "null"], "maxLength": 80 } } }, "ownerClaimList": { "title": "OwnerClaimList", "description": "GET /v1/registry/projects/:project/owner-claims(app-growth registry internal claims)。使える物が上、その中は作った時刻の新しい順。切れて1日たったリンクは掃除で消えるので出ない", "type": "object", "additionalProperties": false, "required": ["claims"], "properties": { "claims": { "type": "array", "items": { "$ref": "#/$defs/ownerClaimEntry" } } } }, "putTouchBudgetRequest": { "title": "PutTouchBudgetRequest", "description": "PUT /v1/registry/projects/:project/touch-budget", "type": "object", "additionalProperties": false, "required": ["max_per_day", "max_per_week", "channels"], "properties": { "max_per_day": { "type": "integer", "minimum": 1, "maximum": 20 }, "max_per_week": { "type": "integer", "minimum": 1, "maximum": 100 }, "channels": { "$ref": "touch-budget.schema.json#/properties/channels" } } }, "projectDetail": { "title": "ProjectDetail", "description": "GET /v1/registry/projects/:project と GET /v1/registry/projects/:project/export(app-growth project export が app-playbook の config に書き出す元)", "type": "object", "additionalProperties": false, "required": ["project", "apps", "keys", "internal_marks", "touch_budget"], "properties": { "project": { "$ref": "project.schema.json" }, "apps": { "type": "array", "items": { "$ref": "app.schema.json" } }, "keys": { "type": "array", "items": { "$ref": "key.schema.json" } }, "internal_marks": { "type": "array", "items": { "$ref": "internal.schema.json" } }, "touch_budget": { "$ref": "touch-budget.schema.json" } } }, "projectList": { "title": "ProjectList", "description": "GET /v1/registry/projects", "type": "object", "additionalProperties": false, "required": ["projects"], "properties": { "projects": { "type": "array", "items": { "$ref": "project.schema.json" } } } }, "doctorReport": { "title": "DoctorReport", "description": "GET /v1/registry/doctor(app-growth doctor)。呼んだ主体が見られる全部のプロジェクトの、届いている版・最後の出来事・止まっている物。?project=<id> でそのプロジェクトだけ(KD-6)", "type": "object", "additionalProperties": false, "required": ["generated_at", "projects"], "properties": { "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "projects": { "type": "array", "items": { "title": "DoctorProject", "type": "object", "additionalProperties": false, "required": ["project", "name", "icon", "status", "features", "apps", "active_public_keys", "inapp", "audiences", "app_versions", "sdk_versions", "last_event", "last_seen_at", "stopped"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "name": { "type": "string" }, "icon": { "$ref": "project.schema.json#/properties/icon" }, "status": { "enum": ["active", "paused"] }, "features": { "$ref": "project.schema.json#/properties/features" }, "apps": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["platform", "status"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "status": { "enum": ["active", "retired"] } } } }, "active_public_keys": { "type": "integer", "minimum": 0 }, "inapp": { "type": "object", "additionalProperties": false, "required": ["version", "paused", "campaigns", "published_at"], "properties": { "version": { "type": "integer", "minimum": 0 }, "paused": { "type": "boolean" }, "campaigns": { "type": "integer", "minimum": 0 }, "published_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "audiences": { "description": "直近30日(今日を含む・プロジェクトの時刻の帯の日)に開いた人(people_activity_day)の、見分けごとの人数(people_person.audience)。getMetrics の audiences と同じ物差し。app_versions・sdk_versions は real だけを数える", "$ref": "../common.schema.json#/$defs/audienceCounts" }, "app_versions": { "description": "30日の利用者(直近30日に開いた audience が real の人)の、OS とアプリのバージョンごとの人数(people_person.platform・app_version)。OS かバージョンの分からない人(移行する前の記録など)は null の行に入れるので、足すと getMetrics の active_people.last_30d と同じ数になる", "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["platform", "app_version", "people"], "properties": { "platform": { "description": "OS。分からなければ null", "type": ["string", "null"] }, "app_version": { "description": "アプリのバージョン。分からなければ null", "type": ["string", "null"] }, "people": { "type": "integer", "minimum": 0 } } } }, "sdk_versions": { "description": "30日の利用者(real)の、OS と端末の SDK のバージョンごとの人数(track・identify の context.sdk_version → people_person.sdk_version)。分からない人は null の行に入れる(足すと app_versions と同じ数)", "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["platform", "sdk_version", "people"], "properties": { "platform": { "description": "OS。分からなければ null", "type": ["string", "null"] }, "sdk_version": { "description": "SDK のバージョン。分からなければ null", "type": ["string", "null"] }, "people": { "type": "integer", "minimum": 0 } } } }, "last_event": { "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["name", "at"], "properties": { "name": { "type": "string" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, { "type": "null" }] }, "last_seen_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "stopped": { "description": "止まっている物。no_app_open は、直近7日に出来事が届いている(quiet でない)のに、直近30日に app_open(前に出た起動)が1件も無い。アプリが app_open を送っていないか、全部が裏の起動(foreground が false)で、2日目からの開いた日・継続・DAU が数えられない(初めて開いた日は first_open が進める)", "type": "array", "items": { "title": "DoctorStoppedReason", "enum": ["project_paused", "inapp_off", "inapp_paused", "no_public_key", "no_app", "no_events", "no_app_open", "quiet"] } } } } } } }, "healthReport": { "title": "HealthReport", "description": "GET /v1/registry/health(K2-7)。core の Cron が5分ごとに数えた物。呼んだ主体が見られる全部のプロジェクト。app-playbook の Worker が5分ごとに読み、alerts の変わった物だけを Web Push で送る(docs/testing-and-verification.md 6節)。数は core が数えた物で、読む側は計算し直さない", "type": "object", "additionalProperties": false, "required": ["generated_at", "projects"], "properties": { "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "projects": { "type": "array", "items": { "$ref": "#/$defs/healthProject" } } } }, "healthProject": { "title": "HealthProject", "type": "object", "additionalProperties": false, "required": ["project", "computed_at", "probe", "latest_version", "version_share", "stale_share", "campaigns", "alerts"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "probe": { "description": "合成の端末の最後の結果(inapp_probe の最新)。まだ無ければ null", "anyOf": [{ "$ref": "#/$defs/probeResult" }, { "type": "null" }] }, "latest_version": { "description": "D1 の最新の組の version", "type": "integer", "minimum": 0 }, "version_share": { "description": "直近24時間に開いた人のうち、組を読む SDK が組を記録したことのある人(inapp_loaded に行がある人)の中で、最新の version を campaigns_loaded で持つ人の割合。SDK の入っていない古い版の人は opened に入れない", "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["opened", "latest", "ratio"], "properties": { "opened": { "type": "integer", "minimum": 0 }, "latest": { "type": "integer", "minimum": 0 }, "ratio": { "anyOf": [{ "type": "number", "minimum": 0 }, { "type": "null" }] } } }, { "type": "null" }] }, "stale_share": { "description": "直近24時間に開いた、組を記録したことのある人のうち campaigns_stale を記録した人の割合", "anyOf": [{ "type": "number", "minimum": 0 }, { "type": "null" }] }, "campaigns": { "type": "array", "items": { "$ref": "#/$defs/healthCampaign" } }, "alerts": { "type": "array", "items": { "$ref": "#/$defs/healthAlert" } } } }, "probeResult": { "title": "ProbeResult", "description": "合成の端末の1回(inapp_probe の1行)", "type": "object", "additionalProperties": false, "required": ["at", "ok", "status", "etag", "version", "expected_version", "age_seconds", "ms", "not_modified_ok", "problem"], "properties": { "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "ok": { "type": "boolean" }, "status": { "type": "integer", "minimum": 0 }, "etag": { "type": ["string", "null"] }, "version": { "type": ["integer", "null"], "minimum": 0 }, "expected_version": { "type": "integer", "minimum": 0 }, "age_seconds": { "type": ["integer", "null"], "minimum": 0 }, "ms": { "type": "integer", "minimum": 0 }, "not_modified_ok": { "description": "前の ETag を付けた2回目が 304 だった", "type": ["boolean", "null"] }, "problem": { "description": "ok でないときの理由", "anyOf": [{ "enum": ["unreachable", "status", "etag", "schema", "version", "age", "targets"] }, { "type": "null" }] } } }, "healthCampaign": { "title": "HealthCampaign", "description": "件ごとの照合の数(4.3節)", "type": "object", "additionalProperties": false, "required": ["campaign", "eligible", "srm", "shown_ratio", "skipped", "rejected", "shown_after_stop", "simulate"], "properties": { "campaign": { "$ref": "../common.schema.json#/$defs/campaignId" }, "eligible": { "description": "出した日からの campaign_eligible の人(本人とテスターの端末・debug・testflight を外す)", "type": "object", "additionalProperties": false, "required": ["treatment", "holdout", "expected_holdout"], "properties": { "treatment": { "type": "integer", "minimum": 0 }, "holdout": { "type": "integer", "minimum": 0 }, "expected_holdout": { "type": "number", "minimum": 0, "maximum": 1 } } }, "srm": { "title": "SrmResult", "description": "割り当てのずれ(SRM)の p 値(packages/experiment の srm)。30人未満は counted false で p は null。200人未満は二項の正確な検定(両側)、200人からカイ二乗(自由度1)", "type": "object", "additionalProperties": false, "required": ["p", "counted", "method"], "properties": { "p": { "anyOf": [{ "type": "number", "minimum": 0 }, { "type": "null" }] }, "counted": { "type": "boolean" }, "method": { "enum": ["binomial_exact", "chi_square", "none"] } } }, "shown_ratio": { "description": "直近7日の treatment の eligible の人に対する campaign_shown の人", "anyOf": [{ "type": "number", "minimum": 0 }, { "type": "null" }] }, "skipped": { "description": "campaign_skipped の理由ごとの数(直近7日)", "type": "object", "propertyNames": { "$ref": "../inapp/events.schema.json#/$defs/skipReason" }, "additionalProperties": { "type": "integer", "minimum": 0 } }, "rejected": { "description": "campaign_rejected(appstore・play)の数(直近7日)", "type": "integer", "minimum": 0 }, "shown_after_stop": { "description": "止めた後の campaign_shown。same_or_newer は止めた version 以上で出た数(SDK の誤り)、older は古い version のまま出た数", "type": "object", "additionalProperties": false, "required": ["same_or_newer", "older"], "properties": { "same_or_newer": { "type": "integer", "minimum": 0 }, "older": { "type": "integer", "minimum": 0 } } }, "simulate": { "description": "push のときの simulate の eligible(7日分に直した数)と、出した後7日の実際", "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["expected_7d", "observed_7d", "ratio"], "properties": { "expected_7d": { "type": "integer", "minimum": 0 }, "observed_7d": { "type": "integer", "minimum": 0 }, "ratio": { "anyOf": [{ "type": "number", "minimum": 0 }, { "type": "null" }] } } }, { "type": "null" }] } } }, "healthAlert": { "title": "HealthAlert", "description": "知らせる物。key が同じ物は24時間に1回だけ送る(送るのは app-playbook)", "type": "object", "additionalProperties": false, "required": ["key", "level", "kind", "project", "campaign", "since", "message", "value", "threshold", "command"], "properties": { "key": { "description": "<project>:<kind>[:<campaign>]", "type": "string", "minLength": 1, "maxLength": 200 }, "level": { "description": "immediate すぐ・daily 朝8時(JST)にまとめる・weekly 週のまとめ", "enum": ["immediate", "daily", "weekly"] }, "kind": { "title": "HealthAlertKind", "enum": ["probe_failed", "api_5xx", "set_invalid", "stop_slow", "campaign_rejected", "content_missing", "unknown_version", "shown_after_stop", "notify_sent_after_stop", "version_share_low", "srm", "shown_ratio_low", "stale_high", "shown_after_stop_old_version", "apns_failed", "simulate_gap", "notify_preview_gap", "key_expiring", "token_expiring", "sessions_5xx", "sessions_masking_failed", "sessions_replay_degraded", "sessions_bytes_high", "sessions_daily_bytes_near_cap", "sessions_summary_failed", "sessions_crash_ratio_high", "guardrail_stopped", "review_overdue", "campaign_unseen", "stop_if_reached", "auto_reverted", "experiment_decided", "releases_sync_stale", "releases_key_forbidden", "release_halted", "release_rejected", "release_week_stopped", "manifest_missing", "manifest_build_mismatch", "creative_approval_waiting", "creative_step_waiting", "creative_publish_failed", "creative_text_drift", "creative_ingest_stale", "creative_key_forbidden", "creative_review_rejected", "creative_budget_stop", "identity_sessions_unlinked", "identity_sessions_without_uid", "identity_uid_only", "identity_buyers_unlinked", "identity_devices_split", "decision_overdue"] }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "campaign": { "type": ["string", "null"], "maxLength": 64 }, "since": { "$ref": "../common.schema.json#/$defs/epochMs" }, "message": { "type": "string", "maxLength": 500 }, "value": { "type": ["number", "null"] }, "threshold": { "type": ["number", "null"] }, "command": { "description": "次に叩くコマンド(app-growth doctor・campaigns explain・campaigns stop)", "type": "string", "maxLength": 200 } } }, "pendingList": { "title": "PendingList", "description": "GET /v1/registry/pending(KD-1・listPending)。呼んだ主体が見られる全部のプロジェクトの承認待ち(通知の文面の案・問い合わせの下書き・承認の依頼・R13 の指摘)。新しい順。CLI は app-growth pending", "type": "object", "additionalProperties": false, "required": ["generated_at", "items"], "properties": { "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "items": { "type": "array", "items": { "$ref": "#/$defs/pendingItem" } } } }, "pendingItem": { "title": "PendingItem", "type": "object", "additionalProperties": false, "required": ["kind", "project", "id", "title", "created_by", "created_at", "can_decide"], "properties": { "kind": { "title": "PendingKind", "enum": ["notify_variant", "support_draft", "access_approval", "insights_finding", "creative_variant"] }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "id": { "description": "案の id・下書きの id・承認の依頼の id(apr_)・指摘の id(fnd_)・ストアの画像の案の id(cv_)", "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "description": "一覧の題。問い合わせの本文は入れない(段階3)", "type": "string", "maxLength": 120 }, "created_by": { "description": "作った主体の id(agt_・usr_・sys:)", "type": "string", "maxLength": 80 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "can_decide": { "description": "呼んだ主体がこの1件を承認・却下できるか", "type": "boolean" }, "ticket_id": { "description": "support_draft のときの問い合わせ", "type": "string", "maxLength": 64 }, "campaign": { "description": "notify_variant のときの施策", "type": "string", "maxLength": 64 }, "live": { "description": "notify_variant のときの、施策の live の案の数。0 なら今その通知を送っていない", "type": "integer", "minimum": 0 } } }, "globalHoldoutReport": { "title": "GlobalHoldoutReport", "description": "GET /v1/registry/projects/:project/global-holdout(getGlobalHoldout)。製品全体の holdout(自動で選ぶ物を全部出さない5%の人)と、ほかの人を比べた差(docs/design/personalization.md 4.2節)。holdout の側は person_id から packages/experiment の globalHoldoutSide(レイヤー global の [0, 50))で決める。差は packages/experiment の compare(treatment がほかの人)。console の概要が読む", "type": "object", "additionalProperties": false, "required": ["project", "computed_at", "metrics"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "metrics": { "type": "array", "items": { "$ref": "#/$defs/globalHoldoutMetric" } } } }, "globalHoldoutMetric": { "title": "GlobalHoldoutMetric", "description": "retention_7d: 37〜7日前に初めて見た人のうち、7日目より後に開いた人。paid_30d: 90〜30日前に初めて見た人のうち、30日の中に払った人(お試しを除く・SANDBOX を除く)。opt_out: 直近30日に開いた、通知の許可が分かる人のうち、通知を切っている人", "type": "object", "additionalProperties": false, "required": ["metric", "holdout", "rest", "result", "needed"], "properties": { "metric": { "enum": ["retention_7d", "paid_30d", "opt_out"] }, "holdout": { "$ref": "../experiment/compare.schema.json#/$defs/arm" }, "rest": { "$ref": "../experiment/compare.schema.json#/$defs/arm" }, "result": { "$ref": "../experiment/compare.schema.json#/$defs/result" }, "needed": { "description": "差を出すのにあと何人要るか(少ない方の側。足りていれば0)", "type": "integer", "minimum": 0 } } }, "metricsReport": { "title": "MetricsReport", "description": "GET /v1/registry/metrics(getMetrics)。呼んだ主体が見られる全部のプロジェクトの、直近30日の日ごとの数と7日・30日の合計。?project=<id> でそのプロジェクトだけ。console のホームとプロジェクトの概要が読む。数は core が数えた物で、読む側は計算し直さない", "type": "object", "additionalProperties": false, "required": ["generated_at", "projects"], "properties": { "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "projects": { "type": "array", "items": { "$ref": "#/$defs/metricsProject" } } } }, "metricsProject": { "title": "MetricsProject", "description": "1つのプロジェクトの数。日はプロジェクトの default_time_zone(time_zone)で区切る。呼んだ主体がその数を読む段階1の操作を持たないとき・その機能がオフのときは null", "type": "object", "additionalProperties": false, "required": ["project", "time_zone", "days", "active_people", "new_people", "audiences", "campaign_shown", "tickets", "link_clicks"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "days": { "description": "直近30日の日付(古い順・最後が今日)", "type": "array", "items": { "$ref": "../common.schema.json#/$defs/day" } }, "active_people": { "description": "開いた利用者の数(people_activity_day・その人の時刻の帯の日付・audience が real)。people.aggregate.read", "anyOf": [{ "$ref": "#/$defs/metricsSeries" }, { "type": "null" }] }, "new_people": { "description": "初めて開いた利用者の数(その人の people_activity_day の一番古い日・audience が real)。開いていない人(端末の登録・trait だけ)は数えない。people.aggregate.read", "anyOf": [{ "$ref": "#/$defs/metricsSeries" }, { "type": "null" }] }, "audiences": { "description": "直近30日に開いた人(people_activity_day)の見分けごとの人数。real は active_people.last_30d と同じ数。ほかの人の数は real だけを数える。people.aggregate.read", "anyOf": [{ "$ref": "../common.schema.json#/$defs/audienceCounts" }, { "type": "null" }] }, "campaign_shown": { "description": "キャンペーンを表示した回数(campaign_shown・利用者だけ)。campaigns.read。inapp がオフなら null", "anyOf": [{ "$ref": "#/$defs/metricsSeries" }, { "type": "null" }] }, "tickets": { "description": "受けた問い合わせの数(support_ticket.created_at)。support.aggregate.read。support がオフなら null", "anyOf": [{ "$ref": "#/$defs/metricsSeries" }, { "type": "null" }] }, "link_clicks": { "description": "リンクの人のクリックの数(links_click の bot が無い行・docs/design/links.md 1.1節)。links.read。links がオフなら null", "anyOf": [{ "$ref": "#/$defs/metricsSeries" }, { "type": "null" }] } } }, "metricsSeries": { "title": "MetricsSeries", "description": "1つの数の日ごとの並びと、直近7日・その前の7日・直近30日の合計。人の数(active_people)の合計は日ごとの和でなく、その期間に1回でも開いた人の数", "type": "object", "additionalProperties": false, "required": ["daily", "last_7d", "prev_7d", "last_30d"], "properties": { "daily": { "description": "days と同じ長さ・同じ順(古い日から)", "type": "array", "items": { "type": "integer", "minimum": 0 } }, "last_7d": { "description": "今日を含む直近7日", "type": "integer", "minimum": 0 }, "prev_7d": { "description": "その前の7日(8〜14日前)", "type": "integer", "minimum": 0 }, "last_30d": { "description": "今日を含む直近30日", "type": "integer", "minimum": 0 } } } } },
104
+ "registry/app.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/app.schema.json", "title": "RegisteredApp", "description": "R1 のプロジェクトの中の OS ごとのアプリ。1つのプロジェクトに ios と android が1つずつまで。表は registry_app", "oneOf": [{ "title": "IosApp", "type": "object", "additionalProperties": false, "required": ["project", "platform", "bundle_id", "asc_app_id", "asc_provider_token", "status", "created_at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "const": "ios" }, "bundle_id": { "type": "string", "pattern": "^[A-Za-z0-9.-]{3,155}$" }, "asc_app_id": { "description": "App Store Connect の Apple ID(数字)。製品ページは https://apps.apple.com/app/id<asc_app_id>", "type": "string", "pattern": "^[0-9]{6,12}$" }, "asc_provider_token": { "$ref": "#/$defs/ascProviderToken" }, "status": { "enum": ["active", "retired"] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, { "title": "AndroidApp", "type": "object", "additionalProperties": false, "required": ["project", "platform", "package", "status", "created_at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "const": "android" }, "package": { "description": "Play のパッケージ名", "type": "string", "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$" }, "status": { "enum": ["active", "retired"] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }], "$defs": { "ascProviderToken": { "title": "AscProviderToken", "description": "App Store のキャンペーンのリンクの pt(プロバイダのトークン・数字)。R6 のリンクが App Store の URL に ct と一緒に付ける(docs/design/creatives.md 12.2節)。まだ入れていなければ null", "anyOf": [{ "type": "string", "pattern": "^[0-9]{4,20}$" }, { "type": "null" }] } } },
105
+ "registry/cost.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/cost.schema.json", "title": "CostMonth", "description": "GET /v1/registry/cost(getCostMonth)の答え。1か月(UTC)の費用の1つの表と、同じ月の売上・組織の売上の目標(docs/design/registry.md 9節)。?month=YYYY-MM(既定は今月)。費用は4種類: cloudflare(GraphQL Analytics の請求の量を core の日次の Cron が usage_cloudflare_day に書き、値段の表で込みの量を引いて出す)・fixed(usage_fixed_cost の契約。年額は12で割る)・ai(Anthropic に払った額。core の usage_ai と notify・creative・insights の ai_usage)・ads(獲得の費用。insights の獲得の表)。console の最初の画面の「今月の費用と売上」・app-growth cost show・MCP の state が読む", "type": "object", "additionalProperties": false, "required": ["month", "generated_at", "through", "usd_jpy", "lines", "cost_jpy", "revenue_jpy", "revenue_goal_jpy", "net_jpy", "missing"], "properties": { "month": { "type": "string", "pattern": "^\\d{4}-\\d{2}$" }, "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "through": { "description": "数えた最後の日(UTC)。今月は昨日まで", "$ref": "../common.schema.json#/$defs/day" }, "usd_jpy": { "description": "ドルを円にした率(insights の週の表の率)。まだ無ければ null で、ドルの行の amount_jpy も null", "type": ["number", "null"], "exclusiveMinimum": 0 }, "lines": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/costLine" } }, "cost_jpy": { "description": "amount_jpy の合計。円にできない行は入らない(missing に理由)", "type": "number", "minimum": 0 }, "revenue_jpy": { "description": "その月の売上(insights の sales.revenue_jpy を見られる全部のプロジェクトで足した物)。読めなければ null", "type": ["number", "null"] }, "revenue_goal_jpy": { "description": "組織の目標(getOrgTargets)の sales.revenue_jpy のうち、この月かその後で一番近い期日の値(円)。無ければ null", "type": ["number", "null"] }, "net_jpy": { "description": "revenue_jpy − cost_jpy。売上が読めなければ null", "type": ["number", "null"] }, "missing": { "description": "表に入らなかった物の理由。1つ1文", "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 200 } } }, "$defs": { "costKind": { "title": "CostKind", "description": "費用の種類。cloudflare 従量の分・fixed アカウントの契約・ai Anthropic の API・ads 獲得の広告", "enum": ["cloudflare", "fixed", "ai", "ads"] }, "cloudflareResource": { "title": "CloudflareResource", "description": "usage_cloudflare_day の資源。workers_requests 要求の数・workers_cpu_ms CPU の時間・d1_rows_read と d1_rows_written 読んだ行と書いた行・d1_storage_bytes と r2_storage_bytes その日の一番大きい容量・r2_class_a と r2_class_b R2 の書き込みと読みの回数", "enum": ["workers_requests", "workers_cpu_ms", "d1_rows_read", "d1_rows_written", "d1_storage_bytes", "r2_class_a", "r2_class_b", "r2_storage_bytes"] }, "currency": { "title": "CostCurrency", "enum": ["JPY", "USD"] }, "costLine": { "title": "CostLine", "description": "費用の表の1行", "type": "object", "additionalProperties": false, "required": ["kind", "name", "quantity", "included", "unit", "amount", "currency", "amount_jpy"], "properties": { "kind": { "$ref": "#/$defs/costKind" }, "name": { "description": "cloudflare は資源の名前・fixed は契約の名前・ai は ai_usage の持ち主(core・notify・creative・insights)・ads はプロジェクトの id", "type": "string", "maxLength": 80 }, "quantity": { "description": "cloudflare の月の量(容量は月の平均のバイト)。ほかは null", "type": ["number", "null"], "minimum": 0 }, "included": { "description": "cloudflare の契約に込みの量。ほかは null", "type": ["number", "null"], "minimum": 0 }, "unit": { "description": "quantity の単位(requests・ms・rows・bytes・operations)。ほかは null", "type": ["string", "null"], "maxLength": 20 }, "amount": { "description": "その月の額(currency の単位)", "type": "number", "minimum": 0 }, "currency": { "$ref": "#/$defs/currency" }, "amount_jpy": { "description": "円にした額。usd_jpy が無いドルの行は null", "type": ["number", "null"], "minimum": 0 } } }, "fixedCost": { "title": "FixedCost", "description": "usage_fixed_cost の1行。アカウントの契約の固定費(Cloudflare の Workers Paid・Claude の契約・ドメイン・1Password など)", "type": "object", "additionalProperties": false, "required": ["id", "name", "vendor", "amount", "currency", "cycle", "started_on", "ended_on", "note", "updated_at", "updated_by"], "properties": { "id": { "type": "string", "pattern": "^fix_[A-Za-z0-9]{16}$" }, "name": { "$ref": "#/$defs/fixedCostName" }, "vendor": { "description": "払う相手", "type": "string", "minLength": 1, "maxLength": 80 }, "amount": { "description": "1回の請求の額", "type": "number", "minimum": 0 }, "currency": { "$ref": "#/$defs/currency" }, "cycle": { "description": "monthly 月ごと・yearly 年ごと(月の表には12で割って入れる)", "enum": ["monthly", "yearly"] }, "started_on": { "description": "契約を始めた日。その日の月から数える", "$ref": "../common.schema.json#/$defs/day" }, "ended_on": { "description": "やめた日。その日の月まで数える。続いていれば null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] }, "note": { "type": "string", "maxLength": 300 }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_by": { "type": "string", "maxLength": 80 } } }, "fixedCostName": { "title": "FixedCostName", "description": "固定費の名前(kebab-case)。組織の中で1つ", "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 60 }, "putFixedCostRequest": { "title": "PutFixedCostRequest", "description": "PUT /v1/registry/cost/fixed/:name(putFixedCost)の本文。作るか置き換える", "type": "object", "additionalProperties": false, "required": ["vendor", "amount", "currency", "cycle", "started_on"], "properties": { "vendor": { "type": "string", "minLength": 1, "maxLength": 80 }, "amount": { "type": "number", "minimum": 0, "maximum": 10000000 }, "currency": { "$ref": "#/$defs/currency" }, "cycle": { "enum": ["monthly", "yearly"] }, "started_on": { "$ref": "../common.schema.json#/$defs/day" }, "ended_on": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] }, "note": { "type": "string", "maxLength": 300 } } }, "fixedCostList": { "title": "FixedCostList", "description": "GET /v1/registry/cost/fixed(listFixedCosts)の答え。名前の順", "type": "object", "additionalProperties": false, "required": ["costs"], "properties": { "costs": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/fixedCost" } } } } } },
106
+ "registry/internal.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/internal.schema.json", "title": "InternalMark", "description": "R1 の本人とテスターのマーク。アカウント(uid)・入れたアプリ(install_id)・端末(端末の id の DeviceHash)のどれかで付ける。マークに当たる人は、owner のマークなら audience が owner、tester のマークなら test になる(docs/design/people.md 6節)。端末のマークはその端末で見た人を全員、アカウントを作り直しても入れ直しても本人にする。端末の SDK の internal_device は今のままアプリのデバッグの画面が決める。表は registry_internal", "type": "object", "additionalProperties": false, "required": ["project", "match", "value", "kind", "label", "created_at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "match": { "description": "何で当てるか。uid はアカウント、install は入れたアプリ、device は端末", "enum": ["uid", "install", "device"] }, "value": { "description": "uid・install_id(小文字)・DeviceHash", "type": "string", "pattern": "^[A-Za-z0-9._-]{1,128}$" }, "kind": { "description": "owner は本人・tester は頼んだ人", "enum": ["owner", "tester"] }, "label": { "description": "どのマークか(iPhone 16 Pro・本人の日々のアカウント)", "type": "string", "minLength": 1, "maxLength": 80 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } },
107
+ "registry/key.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/key.schema.json", "title": "ProjectKey", "description": "R1 のキー。公開キーはそのまま持ち、サーバーキーは sha256 と末尾4文字だけを持つ。回すときは新しいキーを足してから古いキーを revoked にする。表は registry_key", "oneOf": [{ "title": "PublicProjectKey", "type": "object", "additionalProperties": false, "required": ["id", "project", "kind", "public_key", "status", "created_at", "revoked_at"], "properties": { "id": { "$ref": "#/$defs/keyId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "kind": { "const": "public" }, "public_key": { "$ref": "../common.schema.json#/$defs/publicKey" }, "status": { "$ref": "#/$defs/status" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "revoked_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, { "title": "ServerProjectKey", "type": "object", "additionalProperties": false, "required": ["id", "project", "kind", "hint", "scopes", "status", "created_at", "expires_at", "last_used_at", "revoked_at"], "properties": { "id": { "$ref": "#/$defs/keyId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "kind": { "const": "server" }, "hint": { "description": "sk_ と末尾4文字(sk_…a1B2)", "type": "string", "pattern": "^sk_…[A-Za-z0-9]{4}$" }, "scopes": { "description": "使える RPC(AC-6・docs/access-control.md 4.4節の部分集合)。管理の道はどの scope でも通さない", "type": "array", "uniqueItems": true, "minItems": 1, "items": { "$ref": "#/$defs/serverScope" } }, "status": { "$ref": "#/$defs/status" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "expires_at": { "description": "作ってから365日。30日前から doctor と health が知らせる", "$ref": "../common.schema.json#/$defs/epochMs" }, "last_used_at": { "description": "1時間に1回まで書く", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "revoked_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }], "$defs": { "keyId": { "title": "KeyId", "type": "string", "pattern": "^key_[A-Za-z0-9]{16}$" }, "status": { "title": "KeyStatus", "enum": ["active", "revoked"] }, "serverScope": { "title": "ServerKeyScope", "description": "サーバーキー(sk_)とアプリの Worker の binding が使える RPC の名前", "enum": ["track", "identify", "subscription", "touch", "forget", "send", "registerDevice", "unregisterDevice", "registerWidgetPush", "unregisterWidgetPush", "refreshWidgets", "createLink", "createInvite", "recordAttribution", "createTicket"] } } },
108
+ "registry/org.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/org.schema.json", "title": "OrgTargets", "description": "R1 の組織の目標(docs/design/registry.md 7節)。製品の目標(Project の targets)と同じ形で、値は期日の月の全部の製品の合計。表は registry_org_target。GET /v1/registry/org/targets(getOrgTargets)の答え", "type": "object", "additionalProperties": false, "required": ["org", "targets", "updated_at", "updated_by"], "properties": { "org": { "type": "string", "pattern": "^org_[A-Za-z0-9]{16}$" }, "targets": { "$ref": "project.schema.json#/properties/targets" }, "updated_at": { "description": "最後に書いた時刻。書いたことが無ければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "updated_by": { "description": "最後に書いた主体の id。書いたことが無ければ null", "type": ["string", "null"], "maxLength": 80 } }, "$defs": { "putOrgTargetsRequest": { "title": "PutOrgTargetsRequest", "description": "PUT /v1/registry/org/targets の本文。組織の目標を全部置き換える。空の配列で全部消す", "type": "object", "additionalProperties": false, "required": ["targets"], "properties": { "targets": { "$ref": "project.schema.json#/properties/targets" } } } } },
109
+ "registry/policy.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/policy.schema.json", "title": "Policy", "description": "R1 の事業の決まりの1件(docs/design/registry.md 5節)。組織かプロジェクトに付くキーと値。表は registry_policy。キーは POLICY_KEYS(workers/core/src/registry/policy.ts)の物だけで、値の形もそこで確かめる。文でしか書けない原則は app-playbook の knowledge/ に置き、ここには置かない", "type": "object", "additionalProperties": false, "required": ["org", "project", "key", "value", "reason_kind", "owner_words", "decided_on", "enforced_by", "updated_at", "updated_by"], "properties": { "org": { "type": "string", "pattern": "^org_[A-Za-z0-9]{16}$" }, "project": { "description": "null は組織の決まり。プロジェクトの決まりは同じキーの組織の決まりより先に当たる", "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "key": { "$ref": "#/$defs/policyKey" }, "value": { "$ref": "#/$defs/policyValue" }, "reason_kind": { "$ref": "#/$defs/reasonKind" }, "owner_words": { "description": "本人の言葉をそのまま。本人の決定でなければ null", "type": ["string", "null"], "maxLength": 1000 }, "decided_on": { "description": "決めた日", "$ref": "../common.schema.json#/$defs/day" }, "enforced_by": { "$ref": "#/$defs/enforcedBy" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_by": { "description": "書いた主体の id", "type": "string", "maxLength": 80 } }, "$defs": { "policyKey": { "title": "PolicyKey", "description": "決まりのキー。release.cadence 週ごとか・release.after_approval 承認の後に公開する仕方・release.phased 段階的リリースを使うか・release.exceptions 曜日の外で出してよい理由・release.hold 止める変更の種類・release.skip_unchanged 変更の無い週は出さないか・sdk_follow 端末の SDK と基盤を上げた時にすぐ追従するプロジェクト(ほかのアプリは仕組みが固まった最後に1回だけまとめて追従する)・ledger.keep_probability 仮説を残す・戻すと決める確率・ledger.max_extensions 決めきれない時に延ばす回数・ledger.extend_days 延ばす日数・ledger.max_weeks 人数がそろうのを待つ週の上限(insights の仮説の規則の既定値)・acq.daily_budget_cap_jpy 全アプリの合計の1日の広告費の上限(円。超えない線で目標ではない)・acq.paid お金のかかる獲得の使い方(none 使わない・boost_only 仮説の人数が足りない時のブーストだけ・allocate 毎月の配分の案も出す)・pricing.annual_min_jpy 値段の段階の年額の下限(日本の storefront の円)・pricing.monthly_min_jpy 月額の下限・pricing.no_markdown 前に送った値段の段階より下げないか・content.posts_per_account_day 1つの SNS のアカウントに1日に出す投稿の上限・content.scheduled_ahead_max 1つのアカウントで先に予約しておく投稿の上限・focus.projects 注力するプロジェクト(ほかは数を見るだけで新しい施策を当てない)・avoid 使わない物(PolicyAvoidItem)", "enum": ["release.cadence", "release.after_approval", "release.phased", "release.exceptions", "release.hold", "release.skip_unchanged", "sdk_follow", "ledger.keep_probability", "ledger.max_extensions", "ledger.extend_days", "ledger.max_weeks", "acq.daily_budget_cap_jpy", "acq.paid", "pricing.annual_min_jpy", "pricing.monthly_min_jpy", "pricing.no_markdown", "content.posts_per_account_day", "content.scheduled_ahead_max", "focus.projects", "avoid"] }, "policyValue": { "title": "PolicyValue", "description": "キーごとの値。形はキーで決まる(release.exceptions と avoid は種類の配列・sdk_follow と focus.projects はプロジェクトの id の配列・release.phased と release.skip_unchanged と pricing.no_markdown は真偽・ledger. の4つ・acq.daily_budget_cap_jpy・pricing. の下限・content. の2つは数・ほかは文字列)", "anyOf": [{ "type": "string", "maxLength": 200 }, { "type": "boolean" }, { "type": "number" }, { "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 80 } }] }, "reasonKind": { "title": "PolicyReasonKind", "description": "決まりの元。owner_decision 本人の決定・store_review ストアの審査の決まり・built_in 基盤の作り", "enum": ["owner_decision", "store_review", "built_in"] }, "enforcedBy": { "title": "PolicyEnforcedBy", "description": "この決まりを当てる操作。core:<操作の名前>(coreEndpoints の名前)・insights:<insights の流れの名前>か、手元の CLI の <CLI> <コマンド>。当てる物が無ければ空", "type": "array", "maxItems": 10, "uniqueItems": true, "items": { "type": "string", "pattern": "^(core:[A-Za-z]+|insights:[A-Za-z]+|app-release [a-z ]+|app-growth [a-z ]+)$", "maxLength": 80 } }, "avoidItem": { "title": "PolicyAvoidItem", "description": "決まり avoid に書ける使わない物。github_actions GitHub Actions の CI(確かめは手元の scripts/check.sh)・metered_api 従量課金の API を前提にした作り(LLM の点検はサブエージェント、Gemini はブラウザ。claude -p も含む)・in_app_ads アプリの中の広告・one_time_purchase 買い切り(売り方は継続課金にそろえる)・fastlane fastlane(ストアへの送りは asc と app-release)", "enum": ["github_actions", "metered_api", "in_app_ads", "one_time_purchase", "fastlane"] }, "putPolicyRequest": { "title": "PutPolicyRequest", "description": "PUT /v1/registry/policies/:key(組織)と PUT /v1/registry/projects/:project/policies/:key(プロジェクト)の本文。作るか置き換える", "type": "object", "additionalProperties": false, "required": ["value", "reason_kind", "decided_on"], "properties": { "value": { "$ref": "#/$defs/policyValue" }, "reason_kind": { "$ref": "#/$defs/reasonKind" }, "owner_words": { "type": ["string", "null"], "maxLength": 1000 }, "decided_on": { "$ref": "../common.schema.json#/$defs/day" }, "enforced_by": { "$ref": "#/$defs/enforcedBy" } } }, "policyList": { "title": "PolicyList", "description": "GET /v1/registry/policies(listPolicies)の答え。組織の決まりと、呼んだ主体が見られるプロジェクトの決まり。?project=<id> でそのプロジェクトの決まりと組織の決まりだけ。キー・プロジェクトの順", "type": "object", "additionalProperties": false, "required": ["policies"], "properties": { "policies": { "type": "array", "maxItems": 500, "items": { "$ref": "#" } } } } } },
110
+ "registry/project.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/project.schema.json", "title": "Project", "description": "R1 の製品の登録。プロジェクト(=製品)1つに1行。表は registry_project。track から release_hold_paths までは R13 分析の判断の値(docs/design/insights.md 2.1節)で、本人かエージェントが app-growth project set で書くまで無い", "type": "object", "additionalProperties": false, "required": ["id", "org", "name", "status", "web_domain", "support_email", "default_time_zone", "features", "campaign_policy", "icon", "created_at", "updated_at"], "properties": { "id": { "$ref": "../common.schema.json#/$defs/projectId" }, "org": { "description": "プロジェクトが属する組織(AC-5)。プロジェクトは1つの組織だけに属する。本人のプロジェクトは slug taniguchi-kyoichi の組織", "type": "string", "pattern": "^org_[A-Za-z0-9]{16}$" }, "name": { "description": "人が読む名前(ごほうび習慣)", "type": "string", "minLength": 1, "maxLength": 80 }, "status": { "description": "paused は全部の文脈を止める(組は空・通知は送らない・リンクは製品のトップへ)", "enum": ["active", "paused"] }, "web_domain": { "description": "利用者に見える URL のドメイン(/go/*・/l/*・/help/* をここで出す)", "type": "string", "pattern": "^[a-z0-9.-]+\\.[a-z]{2,}$" }, "support_email": { "description": "問い合わせの返事の差出人(製品のドメイン)", "type": "string", "pattern": "^[^@\\s]+@[a-z0-9.-]+\\.[a-z]{2,}$" }, "default_time_zone": { "description": "人の時間帯が分からないときの1日の区切り(触れた回数の上限)", "$ref": "../common.schema.json#/$defs/timeZone" }, "features": { "title": "ProjectFeatures", "description": "使う機能の on/off。off の文脈は端末の API が空を返し、RPC は何もしない", "type": "object", "additionalProperties": false, "required": ["inapp", "notify", "links", "support", "sessions", "config"], "properties": { "inapp": { "type": "boolean" }, "notify": { "type": "boolean" }, "links": { "type": "boolean" }, "support": { "type": "boolean" }, "sessions": { "description": "R8 行動の記録(K3-8)。off なら api はバッチと塊を 204 で捨て、端末は溜めた物を消す", "type": "boolean" }, "config": { "description": "R9 設定(K6-2)。off なら api は version 0 の空の組を返し、端末はアプリの既定の値を使う", "type": "boolean" } } }, "campaign_policy": { "title": "ProjectCampaignPolicy", "description": "画面の中の件の決まり(app-growth campaigns check と core の push が確かめる)。作るときに書かなければ 1人に4回まで・holdout 0.2 以上。人が増えたら holdout_min を 0.1 に下げる", "type": "object", "additionalProperties": false, "required": ["max_shown_cap", "holdout_min"], "properties": { "max_shown_cap": { "description": "件の limits.max_shown の上限(1人に出す回数)", "type": "integer", "minimum": 1, "maximum": 20 }, "holdout_min": { "description": "件の holdout の下限。review_ask は holdout 0 が決まりなので見ない", "type": "number", "minimum": 0, "maximum": 0.5 } } }, "track": { "description": "R13 の判断の値(docs/design/insights.md 2.1節)。new 新しく作っている・portfolio 出して回している。決めていなければ書かない", "enum": ["new", "portfolio"] }, "stage": { "$ref": "#/$defs/stage" }, "focus": { "description": "今いちばん見る指標の名前(packages/metrics/metrics.toml の名前)", "$ref": "../insights/metric.schema.json#/$defs/metricName" }, "targets": { "description": "指標ごとの目標の値と期日", "type": "array", "maxItems": 20, "items": { "title": "ProjectTarget", "type": "object", "additionalProperties": false, "required": ["metric", "value", "by"], "properties": { "metric": { "$ref": "../insights/metric.schema.json#/$defs/metricName" }, "value": { "type": "number" }, "by": { "$ref": "../common.schema.json#/$defs/day" } } } }, "decide_on": { "description": "続けるか止めるかを決める日", "$ref": "../common.schema.json#/$defs/day" }, "store_fee_rate": { "title": "ProjectStoreFeeRate", "description": "ストアの手数料の率(OS ごと・0〜1)。手取りの計算に使う", "type": "object", "additionalProperties": false, "required": ["ios", "android"], "properties": { "ios": { "type": "number", "minimum": 0, "maximum": 1 }, "android": { "type": "number", "minimum": 0, "maximum": 1 } } }, "competitors": { "description": "競合のアプリ。R12 も読む", "type": "array", "maxItems": 50, "items": { "title": "ProjectCompetitor", "type": "object", "additionalProperties": false, "required": ["platform", "app_id"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_id": { "description": "App Store の数の id か Play のパッケージの名前", "type": "string", "minLength": 1, "maxLength": 200 }, "name": { "type": "string", "maxLength": 120 } } } }, "keywords": { "title": "ProjectKeywords", "description": "ASO で見る語を、App Store の国(ISO の2文字・大文字)ごとに。insights が毎日この国と語で公開の検索の順位を取る(取り込み元 aso-rank・docs/design/acquisition.md 6.3節)。R12 も読む", "type": "object", "maxProperties": 20, "propertyNames": { "pattern": "^[A-Z]{2}$" }, "additionalProperties": { "type": "array", "maxItems": 100, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 100 } } }, "china_events_since": { "title": "ProjectChinaEventsSince", "description": "出来事が中国本土から届くようになった最初のバージョン(OS ごと)。前のバージョンはログインに Firebase Auth(Google)を使っていて、中国本土の利用者の出来事が届かなかった。insights の metric は、期間の appstore・play の出来事にこのバージョンより前の物か、値の無い OS の物が1件でもあるときだけ、中国本土の利用者が出来事に出ない注意を missing に書く(docs/design/insights.md 15節)", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "ios": { "$ref": "../common.schema.json#/$defs/appVersion" }, "android": { "$ref": "../common.schema.json#/$defs/appVersion" } } }, "icon": { "description": "アプリのアイコン。App Store の公開の検索(lookup)から週に1回取り直すか、app-growth project icon で上げた物。core が R2 に置き、GET /v1/registry/projects/:project/icon で配る。無ければ null", "anyOf": [{ "$ref": "#/$defs/projectIcon" }, { "type": "null" }] }, "repos": { "title": "ProjectRepos", "description": "製品のコードと作業がある GitHub の repo(owner/name)。R11 が取り込んだ issue・PR・milestone をこの repo で製品に結ぶ(docs/design/releases.md 12節)。1つの repo に製品が2つ以上あるときは、ラベルか milestone の題に製品の id がある物だけをその製品に結び、どれにも無い物は全部の製品に結ぶ", "type": "array", "maxItems": 10, "uniqueItems": true, "items": { "$ref": "#/$defs/repoName" } }, "release_weekday": { "title": "Weekday", "description": "週1回のリリースの曜日(Asia/Tokyo・mon 月曜〜sun 日曜)。無ければ週1回のリリースに入れない(曜日の外で出すのは決まり release.exceptions の理由だけ)。app-release week run がこの曜日の朝に出す", "enum": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] }, "release_path": { "description": "repos の最初の repo の中の、アプリの ship.toml のあるフォルダ(apps/jft-basic)。repo の根なら書かない", "type": "string", "pattern": "^[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)*$", "maxLength": 200 }, "release_hold_paths": { "description": "戻せない変更のファイルの glob(repo の根からの場所。server/migrations/**)。前回の公開から当たるファイルが変わったバージョンを、今週のリリースで止める(判定の表は schema/cases/release-hold)", "type": "array", "maxItems": 20, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 200 } }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "projectIcon": { "title": "ProjectIcon", "description": "アプリのアイコンの印。source は app_store(App Store の lookup)か upload(手で上げた物)。sha256 は中身の値で、変わったら読み直す", "type": "object", "additionalProperties": false, "required": ["source", "sha256", "updated_at"], "properties": { "source": { "enum": ["app_store", "upload"] }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "repoName": { "title": "RepoName", "description": "GitHub の repo の owner/name", "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,38}/[A-Za-z0-9._-]{1,100}$" }, "stage": { "title": "ProjectStage", "description": "製品の段階(R13 の判断の値)。prelaunch 出す前・building 作っている・acquire 人を集める・grow 課金を伸ばす・defend 守る・stop 止める。週の表は段階ごとに見る列を決める", "enum": ["prelaunch", "building", "acquire", "grow", "defend", "stop"] } } },
111
+ "registry/run.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/run.schema.json", "title": "Run", "description": "R1 の定期実行の1回(docs/design/registry.md 8節)。表は registry_run。Worker の Cron は終わった時に1行を書き(packages/run-log の withCronRun)、手元の Mac(launchd)とクラウドの定期実行は startRun で始めて finishRun で終える。90日より古い行は core の Cron が消す", "type": "object", "additionalProperties": false, "required": ["id", "job", "host", "started_at", "ended_at", "state", "reason", "updated_by"], "properties": { "id": { "type": "string", "pattern": "^run_[A-Za-z0-9]{16}$" }, "job": { "$ref": "#/$defs/runJobName" }, "host": { "description": "動いた所。Worker の名前・Mac のホスト名・クラウドの定期実行の名前", "type": "string", "maxLength": 120 }, "started_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "ended_at": { "description": "終わった時刻。動いている間は null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "state": { "$ref": "#/$defs/runState" }, "reason": { "description": "結果の理由(人が読む文)。ok なら空でよい", "type": "string", "maxLength": 500 }, "updated_by": { "description": "書いた主体の id。Worker の Cron は sys:<Worker の名前>", "type": "string", "maxLength": 80 } }, "$defs": { "runJobName": { "title": "RunJobName", "description": "定期実行の名前。<持ち主>.<仕事>(kebab-case)。持ち主は Worker の役割か repo(core・notify・self-improve・channel・app-release・app-growth・life・appgrowstack)", "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*\\.[a-z0-9]+(?:-[a-z0-9]+)*$", "maxLength": 80 }, "runRunner": { "title": "RunRunner", "description": "どこで動くか。worker は Cloudflare の Worker の Cron・launchd は手元の Mac・cloud はクラウドの定期実行(Claude Code)", "enum": ["worker", "launchd", "cloud"] }, "runTz": { "title": "RunTz", "description": "cron の時刻の時間帯。Worker は UTC、launchd とクラウドの定期実行は Asia/Tokyo", "enum": ["UTC", "Asia/Tokyo"] }, "runState": { "title": "RunState", "description": "1回の状態。今週のリリースのステップ(ReleaseWeekState)と同じ語にそろえる。running 動いている・ok 終わった・skip することが無く何もせず終わった・failed 止まった", "enum": ["running", "ok", "skip", "failed"] }, "runJobStatus": { "title": "RunJobStatus", "description": "定期実行の今。ok 最後の回が ok か skip で、来るはずの時刻に来ている・running 最後の回が動いている・failed 最後の回が failed・missed 来るはずの時刻(cron の直近の時刻から grace_minutes を過ぎた)に始まっていない。failed と missed を「止まった定期実行」として console の最初の画面・state・本人へのメールに出す", "enum": ["ok", "running", "failed", "missed"] }, "startRunRequest": { "title": "StartRunRequest", "description": "POST /v1/registry/runs(startRun)の本文。定期実行の登録も同じ本文で置き換える(名前が初めてなら作る)。答えは Run で、id を finishRun に渡す", "type": "object", "additionalProperties": false, "required": ["job", "runner", "host", "cron"], "properties": { "job": { "$ref": "#/$defs/runJobName" }, "runner": { "$ref": "#/$defs/runRunner" }, "host": { "type": "string", "minLength": 1, "maxLength": 120 }, "cron": { "description": "来るはずの時刻(5つの欄の cron。launchd の StartInterval は */n で書く)。読めない式は 400", "type": "string", "minLength": 9, "maxLength": 100 }, "tz": { "description": "無ければ runner が worker なら UTC、ほかは Asia/Tokyo", "$ref": "#/$defs/runTz" }, "grace_minutes": { "description": "来るはずの時刻から何分待って missed にするか。無ければ worker 30・launchd 360(Mac が寝ていた分を待つ)・cloud 120", "type": "integer", "minimum": 1, "maximum": 10080 } } }, "finishRunRequest": { "title": "FinishRunRequest", "description": "POST /v1/registry/runs/:run/finish(finishRun)の本文。終わった回は 409 conflict", "type": "object", "additionalProperties": false, "required": ["state"], "properties": { "state": { "enum": ["ok", "skip", "failed"] }, "reason": { "type": "string", "maxLength": 500 } } }, "runList": { "title": "RunList", "description": "GET /v1/registry/runs(listRuns)の答え。新しい順。?job=<名前>・?limit=(1〜200・既定50)", "type": "object", "additionalProperties": false, "required": ["runs"], "properties": { "runs": { "type": "array", "maxItems": 200, "items": { "$ref": "#" } } } }, "runJob": { "title": "RunJob", "description": "registry_run_job の1行と今の状態", "type": "object", "additionalProperties": false, "required": ["job", "runner", "host", "cron", "tz", "grace_minutes", "status", "reason", "due_at", "last_run", "last_started_at", "last_ended_at", "last_state", "last_ok_at"], "properties": { "job": { "$ref": "#/$defs/runJobName" }, "runner": { "$ref": "#/$defs/runRunner" }, "host": { "type": "string", "maxLength": 120 }, "cron": { "type": "string", "maxLength": 100 }, "tz": { "$ref": "#/$defs/runTz" }, "grace_minutes": { "type": "integer", "minimum": 1 }, "status": { "$ref": "#/$defs/runJobStatus" }, "reason": { "description": "status の理由(人が読む文)。failed は最後の回の理由、missed はいつから来ていないか", "type": "string", "maxLength": 600 }, "due_at": { "description": "直近の来るはずの時刻(grace_minutes を引いた今より前の cron の時刻)。35日の内に無ければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "last_run": { "type": ["string", "null"], "pattern": "^run_[A-Za-z0-9]{16}$" }, "last_started_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "last_ended_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "last_state": { "anyOf": [{ "$ref": "#/$defs/runState" }, { "type": "null" }] }, "last_ok_at": { "description": "最後に ok か skip で終わった時刻", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "runJobList": { "title": "RunJobList", "description": "GET /v1/registry/runs/jobs(listRunJobs)の答え。止まった物(failed・missed)が先、ほかは名前の順。?stopped=true で止まった物だけ", "type": "object", "additionalProperties": false, "required": ["generated_at", "jobs"], "properties": { "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "jobs": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/runJob" } } } } } },
112
+ "registry/today.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/today.schema.json", "title": "TodayReport", "description": "GET /v1/registry/today(getToday)の答え。日々の施策の検討・分析・実装を始める時に最初に読む一覧(ADR 0067)。呼んだ主体が見られる動いている製品の、すぐの知らせ・決めること・止まっている物・出せる施策・作る物が要る施策・確かめ中の仮説・直近7日の検知と知らせ・仮説につながっていない件を1つの一覧にする。1行ごとにどこで進めるか(where)と次に叩くコマンド。?project= で1つの製品に絞る。app-growth today・MCP の today", "type": "object", "additionalProperties": false, "required": ["generated_at", "projects", "items"], "properties": { "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "projects": { "description": "読んだ製品", "type": "array", "maxItems": 200, "items": { "$ref": "../common.schema.json#/$defs/projectId" } }, "items": { "description": "section の順(immediate → decide → stopped → ready → build → testing → watch → unlinked)。同じ section の中は古い順", "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/item" } } }, "$defs": { "section": { "title": "TodaySection", "description": "immediate はすぐの知らせ。decide は本人か点検役が決める物(承認待ち・指摘・文面の案・決められる実験)。stopped は止まっている製品と定期実行。ready は基盤の操作だけで出せる open の仮説。build は製品の repo で作る物が要る open の仮説(PR の段階つき)。testing は確かめ中の仮説。watch は直近7日の検知と日次・週次の知らせ。unlinked は今の件の組にあって仮説につながっていない件", "enum": ["immediate", "decide", "stopped", "ready", "build", "testing", "watch", "unlinked"] }, "where": { "title": "TodayWhere", "description": "どこで進めるか。cloud は基盤の操作だけで済み、claude.ai・スマホ・クラウドのセッションから MCP か CLI で進める。local は製品の repo で作る物が要り、repo を開いた Claude Code で進める(アプリのビルド・シミュレーター・実機・撮影・ストアの画像は Mac)", "enum": ["cloud", "local"] }, "buildStage": { "title": "TodayBuildStage", "description": "build の仮説の作業の段階。本文に仮説の id を書いた PR から決める。none は PR が無い、open は PR が開いている、merged は main に入って次のリリースを待つ、released は PR が入ったバージョンを出したのに仮説が open のまま(当てた日を書く)", "enum": ["none", "open", "merged", "released"] }, "item": { "title": "TodayItem", "type": "object", "additionalProperties": false, "required": ["section", "where", "project", "title", "command", "since", "hypothesis"], "properties": { "section": { "$ref": "#/$defs/section" }, "where": { "$ref": "#/$defs/where" }, "project": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/projectId" }, { "type": "null" }] }, "title": { "description": "一覧の1行", "type": "string", "maxLength": 200 }, "command": { "description": "次に叩く CLI のコマンド", "type": "string", "maxLength": 300 }, "since": { "description": "いつから。分からなければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "hypothesis": { "description": "つながる仮説", "anyOf": [{ "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, { "type": "null" }] }, "build": { "description": "section が build の時だけ", "$ref": "#/$defs/buildStage" }, "prs": { "description": "section が build の時の、本文に仮説の id を書いた PR の URL", "type": "array", "maxItems": 10, "items": { "type": "string", "maxLength": 300 } } } } } },
113
+ "registry/touch-budget.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/registry/touch-budget.schema.json", "title": "TouchBudget", "description": "R1 の1人に触れる回数の上限。画面の中(R4)と通知(R5)が R2 の touch で同じ数を見る。1日の区切りはその人の時間帯(分からなければ project.default_time_zone)の0時、週は月曜から。transactional(その人が頼んだ知らせ)は数えるが上限で止めない。表は registry_touch_budget", "type": "object", "additionalProperties": false, "required": ["project", "max_per_day", "max_per_week", "channels", "updated_at"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "max_per_day": { "description": "全部の経路を合わせて1日に", "type": "integer", "minimum": 1, "maximum": 20 }, "max_per_week": { "description": "全部の経路を合わせて1週に", "type": "integer", "minimum": 1, "maximum": 100 }, "channels": { "title": "TouchBudgetChannels", "description": "経路ごとの1日の上限。書かない経路は max_per_day だけで止める", "type": "object", "additionalProperties": false, "properties": { "inapp": { "type": "integer", "minimum": 0, "maximum": 20 }, "push": { "type": "integer", "minimum": 0, "maximum": 20 }, "email": { "type": "integer", "minimum": 0, "maximum": 20 } } }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } },
114
+ "releases/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/releases/admin.schema.json", "title": "ReleaseList", "description": "GET /v1/releases/projects/:project/versions(listReleases・core)の答え。OS ごとに新しいバージョンの順。app-growth releases list・console・insights が読む", "type": "object", "additionalProperties": false, "required": ["project", "releases"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "releases": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/release" } } }, "$defs": { "storeState": { "title": "StoreState", "description": "ストアの状態。App Store と Google Play の状態の対応は docs/design/releases.md 3.2節", "enum": ["preparing", "in_review", "approved", "rejected", "rolling_out", "halted", "released", "replaced", "removed"] }, "releasedAtSource": { "title": "ReleasedAtSource", "description": "公開の時刻の出どころ。lookup は iTunes の lookup の currentVersionReleaseDate、observed は rolling_out か released を初めて読んだ Cron の時刻、imported は app-playbook の TOML から移した時刻", "enum": ["lookup", "observed", "imported"] }, "contents": { "title": "ReleaseContents", "description": "中身が分かるか。マニフェストがあれば known。unknown のバージョンには requires のある件・規則・実験・通知が当たらない", "enum": ["known", "unknown"] }, "release": { "title": "Release", "description": "releases_version の1行と、前の日の releases_adoption_day の人数", "type": "object", "additionalProperties": false, "required": ["platform", "version", "build", "store_state", "rollout_fraction", "submitted_at", "released_at", "released_at_source", "first_seen_at", "contents", "synced_at", "sync_error", "people", "share"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "anyOf": [{ "$ref": "manifest.schema.json#/$defs/buildNumber" }, { "type": "null" }] }, "store_state": { "$ref": "#/$defs/storeState" }, "rollout_fraction": { "description": "段階公開の割合。段階公開でなければ null。iOS の割合は自動のアップデートだけに当たる", "type": ["number", "null"], "minimum": 0, "maximum": 1 }, "submitted_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "released_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "released_at_source": { "anyOf": [{ "$ref": "#/$defs/releasedAtSource" }, { "type": "null" }] }, "first_seen_at": { "description": "このバージョンの出来事が最初に届いた時刻", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "contents": { "$ref": "#/$defs/contents" }, "synced_at": { "description": "最後にストアから読めた時刻。移行で作った行は null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "sync_error": { "description": "最後の同期の誤りの code。読めていれば null", "type": ["string", "null"], "maxLength": 200 }, "people": { "description": "前の日に開いた人のうち、このバージョンの人数。本人の端末を除く", "type": ["integer", "null"], "minimum": 0 }, "share": { "description": "前の日に開いた人のうち、このバージョンの割合", "type": ["number", "null"], "minimum": 0, "maximum": 1 } } }, "stateChange": { "title": "ReleaseStateChange", "description": "releases_state_change の1行。状態か割合が変わった時刻", "type": "object", "additionalProperties": false, "required": ["platform", "version", "store_state", "rollout_fraction", "at"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "store_state": { "$ref": "#/$defs/storeState" }, "rollout_fraction": { "type": ["number", "null"], "minimum": 0, "maximum": 1 }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "note": { "title": "ReleaseNote", "description": "releases_note の1行。ストアの、言語ごとの新機能の文", "type": "object", "additionalProperties": false, "required": ["locale", "text", "synced_at"], "properties": { "locale": { "description": "ストアの言語の札(ja・en-US)", "type": "string", "minLength": 2, "maxLength": 16 }, "text": { "type": "string", "maxLength": 4000 }, "synced_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "storeKeywords": { "title": "ReleaseStoreKeywords", "description": "releases_keywords の1行。App Store のバージョンの、言語ごとのキーワード欄(appStoreVersionLocalizations の keywords)。バージョンと一緒に審査され、公開の時刻から検索に効く。ASO の前後の比べ(app-growth insights aso)が読む", "type": "object", "additionalProperties": false, "required": ["locale", "keywords", "synced_at"], "properties": { "locale": { "description": "ストアの言語の札(ja・en-US)", "type": "string", "minLength": 2, "maxLength": 16 }, "keywords": { "description": "欄の文字のまま(カンマ区切り・100バイトまで)", "type": "string", "maxLength": 200 }, "synced_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "storedManifest": { "title": "StoredBuildManifest", "description": "releases_manifest の1行。locked_at が null の間は送り直すと上書きする", "type": "object", "additionalProperties": false, "required": ["body", "sha256", "pushed_at", "pushed_by", "locked_at"], "properties": { "body": { "$ref": "manifest.schema.json" }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "pushed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "pushed_by": { "description": "送った主体の id", "type": "string", "maxLength": 80 }, "locked_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "releaseDetail": { "title": "ReleaseDetail", "description": "GET /v1/releases/projects/:project/apps/:platform/versions/:version(getRelease)の答え。状態の変化は古い順。app-growth releases show・console", "type": "object", "additionalProperties": false, "required": ["project", "release", "state_changes", "notes", "keywords", "manifest", "changes"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "release": { "$ref": "#/$defs/release" }, "state_changes": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/stateChange" } }, "notes": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/note" } }, "keywords": { "description": "App Store のキーワード欄(言語ごと)。Google Play は欄が無いので空", "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/storeKeywords" } }, "manifest": { "anyOf": [{ "$ref": "#/$defs/storedManifest" }, { "type": "null" }] }, "changes": { "description": "このバージョンにつながる変更", "type": "array", "maxItems": 200, "items": { "$ref": "change.schema.json" } } } }, "adoptionDay": { "title": "ReleaseAdoptionDay", "description": "releases_adoption_day の1行。その日に開いた人を、その日の終わりのバージョンで集計した数。本人の端末を除く", "type": "object", "additionalProperties": false, "required": ["day", "platform", "app_version", "people"], "properties": { "day": { "$ref": "#/$defs/utcDay" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "people": { "type": "integer", "minimum": 0 } } }, "utcDay": { "title": "UtcDay", "description": "UTC の日付", "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "timelineChange": { "title": "ReleaseTimelineChange", "description": "タイムラインに出す変更。version は platform のバージョンで、kind が store の変更は null と at", "type": "object", "additionalProperties": false, "required": ["id", "title", "kind", "status", "platform", "version", "at"], "properties": { "id": { "$ref": "change.schema.json#/$defs/changeId" }, "title": { "type": "string", "maxLength": 300 }, "kind": { "$ref": "change.schema.json#/$defs/kind" }, "status": { "$ref": "change.schema.json#/$defs/status" }, "platform": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/platform" }, { "type": "null" }] }, "version": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/appVersion" }, { "type": "null" }] }, "at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "timeline": { "title": "ReleaseTimeline", "description": "GET /v1/releases/projects/:project/timeline(getReleaseTimeline)の答え。?since= が無ければ90日前から。日ごと・バージョンごとの人数と、状態の変化と変更。console のタイムラインが読む", "type": "object", "additionalProperties": false, "required": ["project", "since", "days", "state_changes", "changes"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "since": { "$ref": "../common.schema.json#/$defs/epochMs" }, "days": { "type": "array", "maxItems": 5000, "items": { "$ref": "#/$defs/adoptionDay" } }, "state_changes": { "type": "array", "maxItems": 1000, "items": { "$ref": "#/$defs/stateChange" } }, "changes": { "type": "array", "maxItems": 1000, "items": { "$ref": "#/$defs/timelineChange" } } } }, "reportAdoption": { "title": "ReleaseReportAdoption", "description": "公開からの日ごとの、開いた人のうちこのバージョンの割合", "type": "object", "additionalProperties": false, "required": ["day", "days_since_release", "people", "share"], "properties": { "day": { "$ref": "#/$defs/utcDay" }, "days_since_release": { "type": "integer", "minimum": 0 }, "people": { "type": "integer", "minimum": 0 }, "share": { "type": ["number", "null"], "minimum": 0, "maximum": 1 } } }, "reportComparison": { "title": "ReleaseReportComparison", "description": "成果の率の比較。treatment は新しいバージョンの人か公開の後、holdout は古いバージョンの人か公開の前。式は packages/experiment の compare", "type": "object", "additionalProperties": false, "required": ["treatment", "holdout", "result"], "properties": { "treatment": { "$ref": "../experiment/compare.schema.json#/$defs/arm" }, "holdout": { "$ref": "../experiment/compare.schema.json#/$defs/arm" }, "result": { "$ref": "../experiment/compare.schema.json#/$defs/result" } } }, "reportChange": { "title": "ReleaseReportChange", "description": "成果の出来事のある変更の1件。same_day は同じ日の新しいバージョンの人と古いバージョンの人、before_after は公開の前28日と後28日の全員", "type": "object", "additionalProperties": false, "required": ["change", "event", "same_day", "before_after"], "properties": { "change": { "$ref": "change.schema.json#/$defs/changeId" }, "event": { "$ref": "../common.schema.json#/$defs/eventName" }, "same_day": { "$ref": "#/$defs/reportComparison" }, "before_after": { "$ref": "#/$defs/reportComparison" } } }, "releaseReport": { "title": "ReleaseReport", "description": "GET /v1/releases/projects/:project/apps/:platform/versions/:version/report(getReleaseReport)の答え。数だけ。公開していないバージョンは 409 not_released。同じ日に並べる比較は早くアップデートする人ほどよく使う人なので、cautions に early_adopter_bias を付ける。前後の比較と両方を見る", "type": "object", "additionalProperties": false, "required": ["project", "platform", "version", "released_at", "computed_at", "adoption", "changes", "cautions"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "released_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "adoption": { "type": "array", "maxItems": 60, "items": { "$ref": "#/$defs/reportAdoption" } }, "changes": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/reportChange" } }, "cautions": { "type": "array", "uniqueItems": true, "items": { "enum": ["early_adopter_bias"] } } } }, "syncApp": { "title": "ReleaseSyncApp", "type": "object", "additionalProperties": false, "required": ["platform", "versions", "state_changes", "error"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "versions": { "description": "読めたバージョンの数", "type": "integer", "minimum": 0 }, "state_changes": { "description": "足した状態の変化の数", "type": "integer", "minimum": 0 }, "error": { "description": "同期の誤りの code。読めれば null", "type": ["string", "null"], "maxLength": 200 } } }, "syncResult": { "title": "ReleaseSyncResult", "description": "POST /v1/releases/projects/:project/sync(syncReleases)の答え。Cron と同じ同期をすぐ回した結果。app-growth releases sync・app-release ship submit", "type": "object", "additionalProperties": false, "required": ["project", "synced_at", "apps"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "synced_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "apps": { "type": "array", "maxItems": 2, "items": { "$ref": "#/$defs/syncApp" } } } }, "manifestResult": { "title": "ManifestPushResult", "description": "PUT /v1/releases/projects/:project/apps/:platform/versions/:version/manifest(pushManifest)の答え。固定の後に同じ sha256 を送ると changed が false。sets は requires の解決が変わって core が作った組の新しいバージョン", "type": "object", "additionalProperties": false, "required": ["project", "platform", "version", "sha256", "changed", "locked", "late", "sets"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "changed": { "type": "boolean" }, "locked": { "type": "boolean" }, "late": { "description": "公開の後に1回だけ送ったマニフェスト", "type": "boolean" }, "sets": { "type": "array", "maxItems": 2, "items": { "type": "object", "additionalProperties": false, "required": ["surface", "version"], "properties": { "surface": { "enum": ["inapp", "config"] }, "version": { "type": "integer", "minimum": 0 } } } } } }, "resolveRequest": { "title": "ResolveRequiresRequest", "description": "POST /v1/releases/projects/:project/resolve(resolveRequires)の本文。campaigns check・config check・core の push が同じ解決を使う", "type": "object", "additionalProperties": false, "required": ["platforms", "requires"], "properties": { "platforms": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/platform" } }, "requires": { "$ref": "manifest.schema.json#/$defs/requires" }, "exclude_app_versions": { "$ref": "manifest.schema.json#/$defs/excludeAppVersions" }, "campaign_sdk": { "description": "件を読める最初の campaign SDK の版(packages/campaign-rules の campaignSdkMin)。件の解決だけに書く。マニフェストの campaign SDK がこれより古いバージョンには当てない。規則と実験は書かない", "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" } } }, "resolveProblem": { "title": "ResolveProblem", "description": "解決の誤りと警告。requires_unknown(誤り・どのマニフェストにも無い)・requires_not_released(警告・公開したビルドに無い)・requires_platform_missing(警告・その OS だけ解決できない)・unknown_app_version(誤り・exclude_app_versions に core の知らないバージョン)・campaign_sdk_old(警告・公開したバージョンの campaign SDK が古く件を読めない。そのバージョンには出ない)・campaign_sdk_missing(誤り・requires を持つバージョンの campaign SDK が全部古い)", "type": "object", "additionalProperties": false, "required": ["code", "level", "platform", "message"], "properties": { "code": { "enum": ["requires_unknown", "requires_not_released", "requires_platform_missing", "unknown_app_version", "campaign_sdk_old", "campaign_sdk_missing"] }, "level": { "enum": ["error", "warning"] }, "platform": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/platform" }, { "type": "null" }] }, "message": { "type": "string", "maxLength": 500 } } }, "resolveResult": { "title": "ResolveRequiresResult", "description": "resolveRequires の答え。app_version は OS ごとの min と exclude。released は、その OS で範囲に入るバージョンが公開済みか", "type": "object", "additionalProperties": false, "required": ["app_version", "released", "problems"], "properties": { "app_version": { "$ref": "manifest.schema.json#/$defs/resolvedAppVersion" }, "released": { "type": "object", "additionalProperties": false, "properties": { "ios": { "type": "boolean" }, "android": { "type": "boolean" } } }, "problems": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/resolveProblem" } } } }, "changeList": { "title": "ChangeList", "description": "GET /v1/releases/projects/:project/changes(listChanges)の答え。?platform=&version=&feature=&status=&kind= で絞る。新しい順。app-growth changes list・app-playbook・insights", "type": "object", "additionalProperties": false, "required": ["project", "changes"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "changes": { "type": "array", "maxItems": 500, "items": { "$ref": "change.schema.json" } } } } } },
115
+ "releases/change.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/releases/change.schema.json", "title": "Change", "description": "R11 の変更の1件。利用者に影響する1つの変更。似た小さな PR は1件にまとめ、refs に並べる。PUT /v1/releases/projects/:project/changes/:change(putChange)の本文と答え。本文の id はパスの :change と同じにする。platforms に core の知らないバージョンがあれば 400 unknown_app_version。kind が onboarding・paywall・pricing・notification・store・campaign の変更は hypothesis か untested のどちらかが要る(無ければ 400 hypothesis_required)。decision と decided_on は core が仮説から写す(本文の値は無視する)", "type": "object", "additionalProperties": false, "required": ["id", "title", "kind", "area", "refs", "status", "note", "platforms", "features", "campaign", "at", "metric", "check", "hypothesis", "untested", "experiment", "decision", "decided_on"], "properties": { "id": { "$ref": "#/$defs/changeId" }, "title": { "type": "string", "minLength": 1, "maxLength": 300 }, "kind": { "$ref": "#/$defs/kind" }, "area": { "description": "変えた所(onboarding・paywall・store-listing)", "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,39}$" }, "refs": { "description": "PR・設計の文書の URL。似た小さな PR をまとめた変更は多くなる", "type": "array", "maxItems": 50, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/httpsUrl" } }, "status": { "$ref": "#/$defs/status" }, "note": { "description": "判定の経緯。書くことが無ければ空の文字列", "type": "string", "maxLength": 2000 }, "platforms": { "description": "OS ごとの、変更が入ったバージョン。kind が store か campaign の変更は空でよい", "type": "object", "additionalProperties": false, "properties": { "ios": { "$ref": "../common.schema.json#/$defs/appVersion" }, "android": { "$ref": "../common.schema.json#/$defs/appVersion" } } }, "features": { "description": "変更につながる機能のキー", "type": "array", "maxItems": 20, "uniqueItems": true, "items": { "$ref": "manifest.schema.json#/$defs/featureKey" } }, "campaign": { "description": "kind が campaign の変更の件の id。期間は件を送った組の履歴から出す", "anyOf": [{ "$ref": "../common.schema.json#/$defs/campaignId" }, { "type": "null" }] }, "at": { "description": "kind が store の変更の、ストアの掲載を変えた時刻。ほかの変更は null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "metric": { "description": "成果の出来事。書いた変更は releases_metric_day の集計の対象になる", "anyOf": [{ "$ref": "#/$defs/metric" }, { "type": "null" }] }, "check": { "description": "判定の手順の文。core は解釈しない", "anyOf": [{ "$ref": "#/$defs/check" }, { "type": "null" }] }, "hypothesis": { "description": "効き目を確かめる仮説(R13)。毎日の流れが、バージョンの公開日をこの仮説の当てた日にする", "anyOf": [{ "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, { "type": "null" }] }, "untested": { "description": "仮説を持たない理由(直しで効き目を問わない等)。hypothesis と同時には持たない", "type": ["string", "null"], "minLength": 1, "maxLength": 300 }, "experiment": { "description": "変更を置いたフラグの裏の実験(R9 の実験の名前)。同じバージョンの作り替えの数に入れない", "anyOf": [{ "$ref": "#/$defs/experimentName" }, { "type": "null" }] }, "decision": { "description": "仮説の出すかの判断の写し。判定の日が来ると core の毎日の流れが書く", "anyOf": [{ "$ref": "../insights/ledger.schema.json#/$defs/decision" }, { "type": "null" }] }, "decided_on": { "description": "decision を写した日(JST)", "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] } }, "$defs": { "experimentName": { "title": "ChangeExperimentName", "description": "R9 の実験の名前(config の set の experiments のキー)", "type": "string", "pattern": "^[a-z0-9-]{3,40}$" }, "changeId": { "title": "ChangeId", "description": "変更の id。プロジェクトの中で一意の kebab-case", "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,63}$" }, "kind": { "title": "ChangeKind", "enum": ["fix", "feature", "onboarding", "paywall", "store", "copy", "notification", "perf", "pricing", "campaign"] }, "testedKind": { "title": "ChangeTestedKind", "description": "効き目を問う種類。hypothesis か untested が要る", "enum": ["onboarding", "paywall", "pricing", "notification", "store", "campaign"] }, "status": { "title": "ChangeStatus", "description": "判定の結果。shipped は出したがまだ判定していない。出した物を戻したときは変更を消さず reverted にする", "enum": ["shipped", "verified", "no_effect", "reverted"] }, "metric": { "title": "ChangeMetric", "type": "object", "additionalProperties": false, "required": ["event"], "properties": { "event": { "$ref": "../common.schema.json#/$defs/eventName" } } }, "check": { "title": "ChangeCheck", "type": "object", "additionalProperties": false, "properties": { "command": { "description": "判定に叩くコマンド", "type": "string", "maxLength": 500 }, "look": { "description": "見る数", "type": "string", "maxLength": 1000 }, "expect": { "description": "期待する結果", "type": "string", "maxLength": 1000 }, "judge_on": { "description": "判定する日", "$ref": "../common.schema.json#/$defs/day" } } }, "judgeRequest": { "title": "JudgeChangeRequest", "description": "POST /v1/releases/projects/:project/changes/:change/judge(judgeChange)の本文。判定の結果を書く。note を書けば前の note を置き換える", "type": "object", "additionalProperties": false, "required": ["status"], "properties": { "status": { "$ref": "#/$defs/status" }, "note": { "type": "string", "maxLength": 2000 } } } } },
116
+ "releases/manifest.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/releases/manifest.schema.json", "title": "BuildManifest", "description": "R11 のビルドのマニフェスト。1つのバージョンに1つ。app-growth releases manifest build がアプリの repo のビルドの commit から作り、releases manifest push が PUT /v1/releases/projects/:project/apps/:platform/versions/:version/manifest(pushManifest)で送る。store_state が rolling_out か released になると core が固定する。schema_version は 1", "type": "object", "additionalProperties": false, "required": ["schema_version", "project", "platform", "version", "build", "commit", "built_at", "sdk", "events", "event_params", "placements", "actions", "facts", "flags", "features"], "properties": { "schema_version": { "type": "integer", "const": 1 }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "$ref": "#/$defs/buildNumber" }, "commit": { "description": "ビルドを作った commit の sha", "type": "string", "pattern": "^[0-9a-f]{40}$" }, "built_at": { "$ref": "../common.schema.json#/$defs/isoTime" }, "sdk": { "description": "解決した SDK のパッケージとバージョン。Package.resolved と Gradle の lock から読む", "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/sdkPackage" } }, "events": { "description": "出来事の名前。analytics/catalog.json から読む。引数は event_params", "type": "array", "maxItems": 500, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/eventName" } }, "event_params": { "description": "出来事ごとの引数の key と型。analytics/catalog.json の parameters から読む。enum と bucket は通してよい値も持つ。core はこれで、アプリだけの出来事の引数のうち自由な文字列でない物をデータレイクの events.props に残す(docs/design/insights.md 4.1節)", "type": "array", "maxItems": 4000, "items": { "$ref": "#/$defs/eventParam" } }, "placements": { "description": "プレースメントの名前と型。campaigns/manifest.json から読む", "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/placement" } }, "actions": { "description": "動きの名前。campaigns/manifest.json から読む", "type": "array", "maxItems": 200, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "facts": { "description": "事実の名前。campaigns/manifest.json から読む", "type": "array", "maxItems": 200, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "flags": { "description": "R9 のフラグの key と型。config/manifest.json から読む", "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/flag" } }, "features": { "description": "機能のキー。アプリの repo の releases/features.json から読む。機能を消したらキーも消す", "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/feature" } } }, "$defs": { "buildNumber": { "title": "BuildNumber", "description": "ビルド番号。iOS は CFBundleVersion、Android は versionCode を10進の文字列にした物", "type": "string", "pattern": "^\\d+(\\.\\d+){0,3}$", "maxLength": 32 }, "featureKey": { "title": "FeatureKey", "description": "機能のキー。アプリの repo が決める。requires に feature:<key> で書く", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,47}$" }, "feature": { "title": "BuildManifestFeature", "type": "object", "additionalProperties": false, "required": ["key", "title"], "properties": { "key": { "$ref": "#/$defs/featureKey" }, "title": { "description": "1行の説明", "type": "string", "minLength": 1, "maxLength": 120 } } }, "eventParam": { "title": "BuildManifestEventParam", "description": "1つの出来事の1つの引数。type は計測のカタログ(swift-analytics の SCHEMA.md)の型", "type": "object", "additionalProperties": false, "required": ["event", "key", "type"], "properties": { "event": { "$ref": "../common.schema.json#/$defs/eventName" }, "key": { "$ref": "../common.schema.json#/$defs/name" }, "type": { "type": "string", "enum": ["enum", "token", "count", "number", "bucket", "flag"] }, "values": { "description": "enum は通してよい値の全部、bucket は帯の札の全部。ほかの型には書かない", "type": "array", "maxItems": 300, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 100 } } } }, "sdkPackage": { "title": "BuildManifestSdk", "type": "object", "additionalProperties": false, "required": ["package", "version"], "properties": { "package": { "description": "パッケージの名前。iOS は Package.resolved の identity(swift-app-sdk)、Android は JitPack の座標(com.github.appgrowstack.kotlin-app-sdk:campaign-core)。core はここから SDK の版を読み、件の解決に使う", "type": "string", "minLength": 1, "maxLength": 120 }, "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$" } } }, "placement": { "title": "BuildManifestPlacement", "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": { "$ref": "../common.schema.json#/$defs/name" }, "template": { "description": "プレースメントの型。型の既定のプレースメントを使う物だけ", "$ref": "../inapp/campaign.schema.json#/$defs/campaignType" } } }, "flag": { "title": "BuildManifestFlag", "type": "object", "additionalProperties": false, "required": ["key", "type"], "properties": { "key": { "$ref": "../experiment/experiment.schema.json#/$defs/paramKey" }, "type": { "$ref": "../config/set.schema.json#/$defs/flagType" } } }, "capability": { "title": "ReleaseCapability", "description": "中身の行。マニフェストの中身を1つずつ開いた物で、requires の1つの条件と同じ形。feature:<key>・event:<name>・placement:<name>・template:<型>・fact:<name>・flag:<key>・action:<name>", "type": "string", "pattern": "^((feature|event|placement|template|fact|action):[a-z0-9_]{1,64}|flag:[a-z0-9_]{1,40}(\\.[a-z0-9_]{1,40}){0,3})$" }, "requires": { "title": "ReleaseRequires", "description": "中身の条件。全部を持つビルドだけに当たる。件・R9 の規則・R9 の実験・R5 の施策に書く。20個まで(core の push が落とす)", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/capability" } }, "excludeAppVersions": { "title": "ExcludeAppVersions", "description": "OS ごとの、除くバージョン。不具合のあるバージョンを外すときだけ書く。core の知らないバージョンは誤り unknown_app_version", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "ios": { "$ref": "#/$defs/versionList" }, "android": { "$ref": "#/$defs/versionList" } } }, "versionList": { "type": "array", "minItems": 1, "maxItems": 50, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/appVersion" } }, "resolvedRange": { "title": "ResolvedVersionRange", "description": "1つの OS の解決した範囲。min 以上で exclude に無いバージョンに当たる。min より新しく core が知らないバージョンも当たる", "type": "object", "additionalProperties": false, "required": ["min", "exclude"], "properties": { "min": { "$ref": "../common.schema.json#/$defs/appVersion" }, "exclude": { "type": "array", "maxItems": 200, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/appVersion" } } } }, "resolvedAppVersion": { "title": "ResolvedAppVersion", "description": "requires と exclude_app_versions から core が解決した、OS ごとの範囲。解決できない OS は書かない(その OS には出さない)", "type": "object", "additionalProperties": false, "properties": { "ios": { "$ref": "#/$defs/resolvedRange" }, "android": { "$ref": "#/$defs/resolvedRange" } } } } },
117
+ "releases/sources.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/releases/sources.schema.json", "title": "ProjectSources", "description": "GET /v1/releases/projects/:project/sources(getProjectSources)の答え。製品の repo から送った物(件の組・設定の組・通知の決まり・群れ・値段・お知らせ)ごとに、最後に送った commit と、その commit から repo の main で同じフォルダが変わったか(送り忘れ)を並べる。GitHub は読むだけ。app-growth state・MCP の state", "type": "object", "additionalProperties": false, "required": ["project", "repo", "main", "checked_at", "github_error", "sources"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "repo": { "description": "R1 の repos の最初の repo。無ければ null で、ずれは読めない", "anyOf": [{ "$ref": "../registry/project.schema.json#/$defs/repoName" }, { "type": "null" }] }, "main": { "description": "読んだ時の repo の main の commit。GitHub を読めなければ null", "anyOf": [{ "$ref": "#/$defs/commit" }, { "type": "null" }] }, "checked_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "github_error": { "description": "GitHub を読めない理由。no_repo は R1 に repos が無い、no_token は core が GitHub を読めない。ほかは GitHub が返した誤り(not_found・forbidden・unavailable)。読めていれば null", "enum": ["no_repo", "no_token", "not_found", "forbidden", "unavailable", null] }, "sources": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/source" } } }, "$defs": { "commit": { "description": "git の commit の sha(7〜40文字の16進)", "type": "string", "pattern": "^[0-9a-f]{7,40}$" }, "kind": { "title": "ProjectSourceKind", "description": "repo から送る物の種類。campaigns は件の組(campaigns push。screens の画面も一緒に送る)・config は設定の組(config push。experiments の実験も一緒に送る)・notify は通知の決まり(notify push)・segments は群れ(segments push)・pricing は値段(pricing push)・notices はお知らせ(notices push)", "enum": ["campaigns", "config", "notify", "segments", "pricing", "notices"] }, "pushed": { "title": "PushedSource", "description": "最後に送った版。pushed_by は CLI が送った時の repo の commit か、core が書いた印(止める・戻す)", "type": "object", "additionalProperties": false, "required": ["version", "pushed_at", "pushed_by"], "properties": { "version": { "type": "integer", "minimum": 0 }, "pushed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "pushed_by": { "type": "string", "maxLength": 200 } } }, "source": { "title": "ProjectSource", "description": "repo から送る物の1種類。state は same(main で同じフォルダが変わっていない)・behind(送った後に main で変わった。送り忘れ)・not_pushed(まだ一度も送っていない)・unknown(送った印が commit でない・GitHub を読めない)", "type": "object", "additionalProperties": false, "required": ["kind", "paths", "pushed", "commit", "state", "changed_files", "changed_count", "reason"], "properties": { "kind": { "$ref": "#/$defs/kind" }, "paths": { "description": "見る repo の中のフォルダ。R1 の release_path があればその下", "type": "array", "items": { "type": "string", "maxLength": 200 } }, "pushed": { "description": "最後に送った版。まだ無ければ null", "anyOf": [{ "$ref": "#/$defs/pushed" }, { "type": "null" }] }, "commit": { "description": "比べる元の commit。最後に送った版のうち、送った印が commit の一番新しい物", "anyOf": [{ "$ref": "#/$defs/commit" }, { "type": "null" }] }, "state": { "enum": ["same", "behind", "not_pushed", "unknown"] }, "changed_files": { "description": "commit から main までに変わった paths の中のファイル(50件まで)", "type": "array", "maxItems": 50, "items": { "type": "string", "maxLength": 300 } }, "changed_count": { "description": "変わったファイルの数", "type": "integer", "minimum": 0 }, "reason": { "description": "読む人向けの1行。behind なら送るコマンド", "type": "string", "maxLength": 500 } } } } },
118
+ "releases/week.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/releases/week.schema.json", "title": "ReleaseWeek", "description": "GET /v1/releases/week(getReleaseWeek)の答え。1週(月曜から日曜・Asia/Tokyo)の今週のリリース。プロジェクトの release_weekday の日ごとに1件と、曜日の外で出した例外の件。?week=<月曜の日付>(既定は今週)・?day=<日付>(その日の件だけ)・?project=<id>。console の最初の画面・app-growth releases week list・app-release week run・MCP の state が読む(docs/design/releases.md 13節)", "type": "object", "additionalProperties": false, "required": ["week", "generated_at", "entries"], "properties": { "week": { "description": "週の月曜の日付", "$ref": "../common.schema.json#/$defs/day" }, "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "entries": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/entry" } } }, "$defs": { "step": { "title": "ReleaseWeekStep", "description": "app-release week run のステップ。plan 出す版と止める条件を決める・worktree・version 版の文字列・store 掲載の文・commit・asc ASC の版・check・upload・submit 審査への提出・land 版を上げた PR を main に入れる・done", "enum": ["plan", "worktree", "version", "store", "commit", "asc", "check", "upload", "submit", "land", "done"] }, "state": { "title": "ReleaseWeekState", "description": "件の状態。planned まだ始まっていない(core の Cron が入る PR を読んで作る)・running 進めている・submitted 審査に出した・none 前回の公開から変更が無い・skip 審査中の版があるなどで見送った・hold 止める条件に当たった・failed 止まった・missed 日が過ぎたのにその週の版を審査に出していない。submitted と missed は読む時にも App Store の版(releases_version)から決める。planned と running の件は、その週に審査に出した版があれば submitted、無いまま日が過ぎた planned は missed にして返す。missed は表に書かない", "enum": ["planned", "running", "submitted", "none", "skip", "hold", "failed", "missed"] }, "exception": { "title": "ReleaseWeekException", "description": "曜日の外で出す理由。決まり release.exceptions にある物だけ通る。crash クラッシュ・purchase_broken 課金が通らない・data_loss データが消える", "enum": ["crash", "purchase_broken", "data_loss"] }, "hold": { "title": "ReleaseWeekHold", "description": "止める理由の1つ。path は release_hold_paths に当たったファイル、trailer は commit の Release-Hold: の値、rework はその版で同じ種類の作り替え(onboarding・paywall・pricing)が実験の裏に無いまま2件以上ある時", "type": "object", "additionalProperties": false, "required": ["kind", "detail"], "properties": { "kind": { "enum": ["path", "trailer", "rework"] }, "detail": { "description": "path はファイルの場所、trailer は commit の頭の12文字と理由、rework は種類と変更の id", "type": "string", "maxLength": 300 }, "pattern": { "description": "kind が path の時に当たった glob", "type": "string", "maxLength": 200 }, "commit": { "description": "kind が trailer の時の commit", "type": "string", "pattern": "^[0-9a-f]{7,40}$" } } }, "pr": { "title": "ReleaseWeekPr", "description": "releases_week_pr の1行。前回の公開の commit から main までに入った PR", "type": "object", "additionalProperties": false, "required": ["repo", "number", "title", "url", "author", "merged_at"], "properties": { "repo": { "$ref": "../registry/project.schema.json#/$defs/repoName" }, "number": { "type": "integer", "minimum": 1 }, "title": { "type": "string", "maxLength": 300 }, "url": { "type": "string", "maxLength": 300 }, "author": { "type": ["string", "null"], "maxLength": 80 }, "merged_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "github": { "title": "ReleaseWeekGithub", "description": "GitHub から入る PR を読んだ結果。read_at が null ならまだ読んでいない。error は読めなかった理由(no_github_app は core に GitHub App が無い・not_installed は repo の持ち主に App が入っていない・repo_not_installed は repo が installation の外・app_auth は App の ID か秘密鍵が違う・no_repo・no_base・not_found・forbidden・unavailable)", "type": "object", "additionalProperties": false, "required": ["read_at", "error"], "properties": { "read_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "error": { "type": ["string", "null"], "maxLength": 200 } } }, "entry": { "title": "ReleaseWeekEntry", "description": "releases_week の1行と入る PR。1つのプロジェクトの1日の iOS のリリース", "type": "object", "additionalProperties": false, "required": ["project", "name", "day", "weekday", "kind", "exception", "version", "base_commit", "base_source", "head_commit", "commits", "files", "step", "state", "reason", "holds", "allow_hold", "prs", "commits_without_pr", "landing_pr", "store_state", "github", "updated_at", "updated_by"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "name": { "description": "製品の名前(registry_project.name)", "type": "string", "maxLength": 80 }, "day": { "description": "出す日(Asia/Tokyo)", "$ref": "../common.schema.json#/$defs/day" }, "weekday": { "$ref": "../registry/project.schema.json#/properties/release_weekday" }, "kind": { "description": "scheduled は release_weekday の日・exception は曜日の外", "enum": ["scheduled", "exception"] }, "exception": { "anyOf": [{ "$ref": "#/$defs/exception" }, { "type": "null" }] }, "version": { "description": "出すバージョン。決まる前は null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/appVersion" }, { "type": "null" }] }, "base_commit": { "description": "前回の公開の commit", "type": ["string", "null"], "pattern": "^[0-9a-f]{7,40}$" }, "base_source": { "description": "base_commit の出どころ。manifest は公開した版のマニフェスト、git は版の文字列を書いた commit", "enum": ["manifest", "git", null] }, "head_commit": { "description": "出す main の commit", "type": ["string", "null"], "pattern": "^[0-9a-f]{7,40}$" }, "commits": { "description": "base_commit から head_commit までの merge でない commit の数", "type": "integer", "minimum": 0 }, "files": { "description": "変わったファイルの数", "type": "integer", "minimum": 0 }, "step": { "$ref": "#/$defs/step" }, "state": { "$ref": "#/$defs/state" }, "reason": { "description": "今の状態の理由(人が読む文)", "type": "string", "maxLength": 500 }, "holds": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/hold" } }, "allow_hold": { "description": "本人に確かめて、止める条件を外して出した", "type": "boolean" }, "prs": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/pr" } }, "commits_without_pr": { "description": "PR に入っていない commit の数", "type": "integer", "minimum": 0 }, "landing_pr": { "description": "版の文字列を上げて main に入れた PR の URL", "type": ["string", "null"], "maxLength": 300 }, "store_state": { "description": "version の App Store の状態(releases_version)。まだ ASC に無ければ null", "anyOf": [{ "$ref": "admin.schema.json#/$defs/storeState" }, { "type": "null" }] }, "github": { "$ref": "#/$defs/github" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_by": { "type": "string", "maxLength": 80 } } }, "planCommit": { "title": "ReleaseWeekCommit", "type": "object", "additionalProperties": false, "required": ["hash", "subject", "release_hold"], "properties": { "hash": { "type": "string", "pattern": "^[0-9a-f]{7,40}$" }, "subject": { "type": "string", "maxLength": 300 }, "release_hold": { "description": "commit の trailer Release-Hold: の値。無ければ null", "type": ["string", "null"], "maxLength": 300 } } }, "planRequest": { "title": "PlanReleaseWeekRequest", "description": "POST /v1/releases/projects/:project/week/:day/plan(planReleaseWeek)の本文。app-release week run が手元で読んだ前回の公開からの commit と変わったファイルを送り、core が止める条件を決める(判定の表は schema/cases/release-hold)。答えは ReleaseWeekEntry で、state が running なら続け、hold・none なら止める", "type": "object", "additionalProperties": false, "required": ["kind", "version", "base_commit", "base_source", "head_commit", "commits", "files"], "properties": { "kind": { "enum": ["scheduled", "exception"] }, "exception": { "$ref": "#/$defs/exception" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "base_commit": { "description": "初めての版は null", "type": ["string", "null"], "pattern": "^[0-9a-f]{7,40}$" }, "base_source": { "enum": ["manifest", "git", null] }, "head_commit": { "type": "string", "pattern": "^[0-9a-f]{7,40}$" }, "commits": { "type": "array", "maxItems": 2000, "items": { "$ref": "#/$defs/planCommit" } }, "files": { "description": "repo の根からの場所", "type": "array", "maxItems": 5000, "items": { "type": "string", "minLength": 1, "maxLength": 400 } }, "allow_hold": { "description": "本人に確かめた後に、止める条件を外す", "type": "boolean" } } }, "stepRequest": { "title": "ReleaseWeekStepRequest", "description": "POST /v1/releases/projects/:project/week/:day/step(putReleaseWeekStep)の本文。app-release がステップごとに返す。plan より前に止まった時(審査中の版がある・変更が無い・ASC を読めない)もこれで返す", "type": "object", "additionalProperties": false, "required": ["step", "state"], "properties": { "step": { "$ref": "#/$defs/step" }, "state": { "description": "planned は書けない", "enum": ["running", "submitted", "none", "skip", "hold", "failed"] }, "reason": { "type": "string", "maxLength": 500 }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "landing_pr": { "type": "string", "maxLength": 300 } } }, "holdCase": { "title": "ReleaseHoldCase", "description": "判定の表 schema/cases/release-hold の1件。止める条件の判定(workers/core/src/releases/hold.ts の judgeHold)に input を渡し、expect と同じ答えになる", "type": "object", "additionalProperties": false, "required": ["description", "input", "expect"], "properties": { "description": { "type": "string" }, "input": { "type": "object", "additionalProperties": false, "required": ["hold_paths", "files", "commits", "changes", "allow_hold"], "properties": { "hold_paths": { "type": "array", "items": { "type": "string" } }, "changes": { "description": "その版につないだ変更(releases_change)の id・種類・実験", "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["id", "kind", "experiment"], "properties": { "id": { "type": "string" }, "kind": { "type": "string" }, "experiment": { "anyOf": [{ "type": "string" }, { "type": "null" }] } } } }, "files": { "type": "array", "items": { "type": "string" } }, "commits": { "type": "array", "items": { "$ref": "#/$defs/planCommit" } }, "allow_hold": { "type": "boolean" } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["held", "holds"], "properties": { "held": { "type": "boolean" }, "holds": { "type": "array", "items": { "$ref": "#/$defs/hold" } } } } } } } },
119
+ "releases/work.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/releases/work.schema.json", "title": "WorkReport", "description": "GET /v1/releases/projects/:project/work(getProjectWork)の答え。R11 が GitHub から取り込んだ issue・PR・milestone を、R1 の repos で製品に結んで並べる。進んでいる作業・止まっている PR・次のリリースに入る PR・開いている milestone・仮説ごとの PR。app-growth work list・MCP の state・console の製品の画面", "type": "object", "additionalProperties": false, "required": ["project", "repos", "generated_at", "synced_at", "github_error", "repos_outside_app", "in_progress", "stalled_prs", "next_release", "milestones", "hypotheses"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "repos": { "description": "R1 の repos。空なら作業は何も結ばれない", "type": "array", "items": { "$ref": "../registry/project.schema.json#/$defs/repoName" } }, "generated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "synced_at": { "description": "repos の owner のうち、一番古い取り込みの時刻。一度も取り込んでいなければ null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "github_error": { "description": "GitHub を読めない理由。no_github_app は core に GitHub App が無い。not_installed は repo の持ち主に App が入っていない。ほかは最後の取り込みで owner ごとに返った誤り(not_found・forbidden・unavailable など)。読めていれば null。null でない時、作業の列と milestone は GitHub の今の姿でない", "type": ["string", "null"], "maxLength": 200 }, "repos_outside_app": { "description": "repos のうち GitHub App の installation の外にあって読めない repo。持ち主に App が入っていない repo も入れる。App が無い時と App に問い合わせられない時は空。空でない時、その repo の作業と milestone は並ばない。GitHub の App の設定で installation に足す", "type": "array", "maxItems": 50, "items": { "$ref": "../registry/project.schema.json#/$defs/repoName" } }, "in_progress": { "description": "開いている issue と PR のうち、7日の内に動いた物。止まっている PR は入れない。新しく動いた順", "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/workItem" } }, "stalled_prs": { "description": "開いている PR のうち、3日より長く動いていない物。古い順", "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/workItem" } }, "next_release": { "description": "main に入った PR のうち、入った後にストアへ出したバージョンがまだ無い物。入った順", "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/workItem" } }, "milestones": { "description": "repos の開いている milestone。期日の近い順(期日の無い物は後ろ)", "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/workMilestone" } }, "hypotheses": { "description": "PR の本文に書かれた仮説の id ごとの PR。仮説の記録から当てた PR を引く", "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/workHypothesis" } } }, "$defs": { "workItem": { "title": "WorkItem", "description": "GitHub の issue か PR の1件(R11 の releases_work_item)。読むだけ。書くのは GitHub のまま", "type": "object", "additionalProperties": false, "required": ["repo", "number", "kind", "title", "state", "draft", "author", "labels", "milestone", "hypotheses", "release", "url", "created_at", "updated_at", "closed_at", "merged_at"], "properties": { "repo": { "$ref": "../registry/project.schema.json#/$defs/repoName" }, "number": { "type": "integer", "minimum": 1 }, "kind": { "enum": ["issue", "pr"] }, "title": { "type": "string", "maxLength": 500 }, "state": { "description": "open 開いている・closed 閉じた(PR は入れずに閉じた)・merged main に入った", "enum": ["open", "closed", "merged"] }, "draft": { "type": "boolean" }, "author": { "type": "string", "maxLength": 100 }, "labels": { "type": "array", "maxItems": 50, "items": { "type": "string", "maxLength": 100 } }, "milestone": { "description": "付いている milestone の題。無ければ null", "anyOf": [{ "type": "string", "maxLength": 300 }, { "type": "null" }] }, "hypotheses": { "description": "本文に書かれた仮説の id", "type": "array", "maxItems": 20, "items": { "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" } }, "release": { "description": "main に入った PR が最初に入ったストアのバージョン(入った時刻より後に提出か公開したバージョンのうち、一番早い物)。まだ無いか PR でなければ null", "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["platform", "version"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "version": { "$ref": "../common.schema.json#/$defs/appVersion" } } }, { "type": "null" }] }, "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "closed_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "merged_at": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "workMilestone": { "title": "WorkMilestone", "description": "GitHub の milestone の1つ(R11 の releases_work_milestone)。ロードマップの1区切り", "type": "object", "additionalProperties": false, "required": ["repo", "number", "title", "state", "due_on", "open_issues", "closed_issues", "url"], "properties": { "repo": { "$ref": "../registry/project.schema.json#/$defs/repoName" }, "number": { "type": "integer", "minimum": 1 }, "title": { "type": "string", "maxLength": 300 }, "state": { "enum": ["open", "closed"] }, "due_on": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/day" }, { "type": "null" }] }, "open_issues": { "type": "integer", "minimum": 0 }, "closed_issues": { "type": "integer", "minimum": 0 }, "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" } } }, "workHypothesis": { "title": "WorkHypothesis", "type": "object", "additionalProperties": false, "required": ["hypothesis", "prs"], "properties": { "hypothesis": { "$ref": "../insights/ledger.schema.json#/$defs/hypothesisId" }, "prs": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/workItem" } } } }, "workSyncOwner": { "title": "WorkSyncOwner", "description": "1つの owner の取り込みの結果。error は no_github_app(core に GitHub App が無い)・not_installed(この owner に App が入っていない)・app_auth(App の ID か秘密鍵が違う)・github_http_<status> など", "type": "object", "additionalProperties": false, "required": ["owner", "items", "milestones", "synced_at", "error"], "properties": { "owner": { "type": "string", "maxLength": 39 }, "items": { "description": "この回に入れ直した issue と PR の数", "type": "integer", "minimum": 0 }, "milestones": { "type": "integer", "minimum": 0 }, "synced_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "error": { "anyOf": [{ "type": "string", "maxLength": 300 }, { "type": "null" }] } } }, "workSyncResult": { "title": "WorkSyncResult", "description": "POST /v1/releases/work/sync(syncWork)の答え。Cron と同じ取り込みをすぐ回す", "type": "object", "additionalProperties": false, "required": ["owners"], "properties": { "owners": { "type": "array", "items": { "$ref": "#/$defs/workSyncOwner" } } } } } },
120
+ "screens/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/admin.schema.json", "title": "ScreenBundleUploadResult", "description": "PUT /v1/campaigns/projects/:project/bundles/:sha256(putScreenBundle)の答え", "type": "object", "additionalProperties": false, "required": ["sha256", "bytes", "created"], "properties": { "sha256": { "$ref": "screen.schema.json#/$defs/sha256" }, "bytes": { "type": "integer", "minimum": 1 }, "created": { "description": "false は同じ物が R2 にあった", "type": "boolean" } }, "$defs": { "bundleRead": { "title": "ScreenBundleRead", "description": "GET /v1/campaigns/projects/:project/bundles/:digest(getScreenBundle)の答え。console のプレビューが閉じ込めた iframe で開く", "type": "object", "additionalProperties": false, "required": ["sha256", "html"], "properties": { "sha256": { "$ref": "screen.schema.json#/$defs/sha256" }, "html": { "type": "string" } } }, "patternUseList": { "title": "PatternUseList", "description": "GET /v1/campaigns/projects/:project/patterns(listPatternUses)の答え。型ごとに、この製品で使った画面・キャンペーン・実験と仮説の結果(docs/design/screen-patterns.md 4節)", "type": "object", "additionalProperties": false, "required": ["project", "version", "theme", "uses"], "properties": { "project": { "type": "string" }, "version": { "description": "今の組のバージョン。0 は組が無い", "type": "integer", "minimum": 0 }, "theme": { "anyOf": [{ "$ref": "theme.schema.json" }, { "type": "null" }] }, "uses": { "type": "array", "items": { "$ref": "#/$defs/patternUse" } } } }, "patternUse": { "title": "PatternUse", "description": "1つの画面(id と中身の sha256)が型を使った記録。push のたびに last_version を進める", "type": "object", "additionalProperties": false, "required": ["pattern", "screen", "sha256", "kind", "live", "first_version", "last_version", "first_at", "last_at", "campaigns"], "properties": { "pattern": { "$ref": "pattern.schema.json#/$defs/patternId" }, "screen": { "$ref": "screen.schema.json#/$defs/screenId" }, "sha256": { "$ref": "screen.schema.json#/$defs/sha256" }, "kind": { "$ref": "screen.schema.json#/$defs/kind" }, "live": { "description": "今の組がこの画面のこの中身を指す", "type": "boolean" }, "first_version": { "type": "integer", "minimum": 1 }, "last_version": { "type": "integer", "minimum": 1 }, "first_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "last_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "campaigns": { "type": "array", "items": { "$ref": "#/$defs/patternCampaign" } } } }, "patternCampaign": { "title": "PatternCampaign", "description": "画面を出すキャンペーンと、その仮説の結果", "type": "object", "additionalProperties": false, "required": ["campaign", "hypothesis", "outcome"], "properties": { "campaign": { "type": "string" }, "hypothesis": { "anyOf": [{ "type": "string" }, { "type": "null" }] }, "outcome": { "description": "仮説の記録の結論(supported・rejected・inconclusive・unmeasured)。結論の前は null", "anyOf": [{ "$ref": "../insights/ledger.schema.json#/$defs/outcome" }, { "type": "null" }] } } } } },
121
+ "screens/bridge-case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/bridge-case.schema.json", "title": "ScreenBridgeCase", "description": "schema/cases/screens/bridge/<名前>.json の1つ。ホストの状態遷移の関数(packages/campaign-rules の screenHostStep・Kotlin の ScreenSession・Swift)に steps の入力を順に入れ、答えの文字列・ホストがすること(effects)・計測(events)・状態(phase)が expect と同じになる。時刻は register を呼んだ時を 0 にしたミリ秒", "type": "object", "additionalProperties": false, "required": ["description", "setup", "steps"], "properties": { "description": { "type": "string", "minLength": 1 }, "setup": { "$ref": "#/$defs/setup" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/step" } } }, "$defs": { "setup": { "title": "ScreenHostSetup", "description": "出す画面と、この人の値。products は割り当てた Offering の商品だけ。store は購入と復元をストアが返す答え", "type": "object", "additionalProperties": false, "required": ["plan", "lang", "region", "manifest", "products", "screen_facts", "facts", "store"], "properties": { "plan": { "title": "ScreenHostPlan", "type": "object", "additionalProperties": false, "required": ["screen", "sha256", "kind", "placement", "campaign", "price_tier", "set_version", "inline_height"], "properties": { "screen": { "$ref": "screen.schema.json#/$defs/screenId" }, "sha256": { "$ref": "screen.schema.json#/$defs/sha256" }, "kind": { "$ref": "screen.schema.json#/$defs/kind" }, "placement": { "$ref": "../common.schema.json#/$defs/name" }, "campaign": { "type": "string", "minLength": 1 }, "price_tier": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/name" }, { "type": "null" }] }, "set_version": { "type": "integer", "minimum": 0 }, "inline_height": { "description": "プレースメントが inline の時の高さの範囲。ready の height をこの中に収める。書かなければ height は null", "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["min", "max"], "properties": { "min": { "type": "number", "minimum": 0 }, "max": { "type": "number", "minimum": 0 } } }, { "type": "null" }] } } }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "region": { "type": "string", "pattern": "^[A-Z]{2}$" }, "manifest": { "type": "object", "additionalProperties": false, "required": ["actions", "url_hosts"], "properties": { "actions": { "type": "object", "additionalProperties": { "$ref": "../config/manifest.schema.json#/$defs/action" } }, "url_hosts": { "type": "array", "items": { "type": "string" } } } }, "products": { "type": "array", "items": { "$ref": "fixture.schema.json#/$defs/product" } }, "screen_facts": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/name" } }, "facts": { "$ref": "../common.schema.json#/$defs/typedProps" }, "store": { "type": "object", "additionalProperties": false, "required": ["purchase", "restore"], "properties": { "purchase": { "$ref": "bridge.schema.json#/$defs/purchaseResult" }, "restore": { "$ref": "bridge.schema.json#/$defs/restoreResult" } } } } }, "step": { "type": "object", "additionalProperties": false, "required": ["input", "expect"], "properties": { "input": { "title": "ScreenHostInput", "description": "message はバンドルから届いた文字列そのもの(形の違う物も入れる)。tick は時刻が進んだ(ready が来ないまま 1500 を過ぎたら fallback)。native_close はネイティブの×かスワイプ", "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["kind", "at_ms", "message"], "properties": { "kind": { "const": "message" }, "at_ms": { "type": "integer", "minimum": 0 }, "message": { "type": "string" } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "at_ms"], "properties": { "kind": { "const": "tick" }, "at_ms": { "type": "integer", "minimum": 0 } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "at_ms", "how"], "properties": { "kind": { "const": "native_close" }, "at_ms": { "type": "integer", "minimum": 0 }, "how": { "enum": ["close_button", "swipe"] } } }] }, "expect": { "type": "object", "additionalProperties": false, "required": ["reply", "effects", "events", "phase"], "properties": { "reply": { "description": "答え(JSON として比べる)。message でない入力は null", "anyOf": [{ "$ref": "bridge.schema.json#/$defs/reply" }, { "type": "null" }] }, "effects": { "type": "array", "items": { "$ref": "#/$defs/effect" } }, "events": { "type": "array", "items": { "$ref": "#/$defs/event" } }, "phase": { "enum": ["loading", "shown", "closed", "failed"] } } } } }, "effect": { "title": "ScreenHostEffect", "description": "ホストがすること(順に)。show は表示を始める(height は inline の時だけ)・purchase と restore はストア・close はネイティブが閉じる・action はアプリの動き・open_url は外のページ・haptic は触覚・fallback は fallback の画面かアプリの組み込みの画面に替える", "type": "object", "required": ["do"], "properties": { "do": { "enum": ["show", "purchase", "restore", "close", "action", "open_url", "haptic", "fallback"] }, "height": { "anyOf": [{ "type": "number" }, { "type": "null" }] }, "package_id": { "type": "string" }, "how": { "enum": ["close_button", "swipe", "action", "purchased"] }, "name": { "type": "string" }, "args": { "type": "object" }, "url": { "type": "string" }, "kind": { "type": "string" }, "reason": { "enum": ["timeout", "bridge_error"] } } }, "event": { "title": "ScreenHostEvent", "description": "送る計測(schema/screens/events.schema.json の props)。screen_shown は最初の ready の時に1回(ready_ms は register から ready を受けるまで)・screen_action は track と action・screen_closed は表示した後に閉じた時(seconds は ready から閉じるまでの切り捨ての秒)・screen_failed は出せなかった時", "type": "object", "additionalProperties": false, "required": ["name", "props"], "properties": { "name": { "enum": ["screen_shown", "screen_action", "screen_closed", "screen_failed"] }, "props": { "type": "object" } } } } },
122
+ "screens/bridge.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/bridge.schema.json", "title": "ScreenBridgeMessage", "description": "バンドルからホストへの1通(docs/design/remote-screens.md 2.4節)。ページのコードは window.appgrowstack(ready・context・purchase・restore・close・action・openURL・haptic・track。どれも Promise)だけを呼ぶ。ホストは window.agsScreenHost(postMessage(文字列)・onmessage({data: 文字列}))を入れる。iOS は WKScriptMessageHandler の名前 agsScreenHost で受け、evaluateJavaScript で onmessage を呼ぶ。screens-kit がこの形の JSON の文字列を送り、ScreenBridgeReply の JSON の文字列を受けて window.appgrowstack を作る。ホストの判断は全部、文字列を入れて文字列と効果と計測を返す純粋な状態遷移の関数(packages/campaign-rules の screenHostStep。表は schema/cases/screens/bridge)。WebView は文字列を渡して返すだけ", "type": "object", "additionalProperties": false, "required": ["id", "method"], "properties": { "id": { "description": "バンドルの中で1から数える通し番号。答えの id と合わせる", "type": "integer", "minimum": 1 }, "method": { "enum": ["ready", "context", "purchase", "restore", "close", "action", "openURL", "haptic", "track"] }, "args": { "description": "ready は height?(inline の時の高さ px)・purchase は packageId・close は how・action は name と args・openURL は url・haptic は kind・track は name と props", "type": "object", "additionalProperties": false, "properties": { "height": { "type": "number", "minimum": 0 }, "packageId": { "type": "string" }, "how": { "enum": ["close_button", "swipe", "action", "purchased"] }, "name": { "type": "string" }, "args": { "type": "object", "additionalProperties": { "type": ["string", "number", "boolean"] } }, "url": { "type": "string" }, "kind": { "enum": ["selection", "success", "light"] }, "props": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "$defs": { "reply": { "title": "ScreenBridgeReply", "description": "ホストの答え(JSON の文字列)。キーは id・ok・result か error。形の読めない1通は id: null。purchase の result は purchased・cancelled・pending・failed、restore は restored・nothing・failed、context は ScreenBridgeContext、ほかは null", "type": "object", "additionalProperties": false, "required": ["id", "ok"], "properties": { "id": { "anyOf": [{ "type": "integer", "minimum": 1 }, { "type": "null" }] }, "ok": { "type": "boolean" }, "error": { "$ref": "#/$defs/error" }, "result": {} } }, "purchaseResult": { "title": "ScreenPurchaseResult", "enum": ["purchased", "cancelled", "pending", "failed"] }, "restoreResult": { "title": "ScreenRestoreResult", "enum": ["restored", "nothing", "failed"] }, "error": { "title": "ScreenBridgeError", "description": "断った理由。bad_message は JSON でない・id か method が無い・args がオブジェクトでない。unknown_method は知らない method。bad_args は引数の型の違い(close の how は close_button か action だけ・action の引数がマニフェストの型と違う・ready の height が負)。not_in_offering は割り当てた Offering の外の購入。unknown_action はマニフェストの actions の外。host_not_allowed は url_hosts の外・https でない・URL に名前とパスワード。unknown_haptic は selection・success・light の外。bad_track は名前が英小文字と数字と _ の40字でない・props が5つを超える・props の名前が screen か action・値が文字でない・64バイトを超える。closed は閉じた後か出せなかった後の1通", "enum": ["bad_message", "unknown_method", "bad_args", "not_in_offering", "unknown_action", "host_not_allowed", "unknown_haptic", "bad_track", "closed"] } } },
123
+ "screens/check-case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/check-case.schema.json", "title": "ScreenCheckCase", "description": "schema/cases/screens/check/<名前>.json の1つ。同じ名前の .html(書き出したバンドルの例)を packages/screens-check で開いた時に落ちる確かめの id。fixtures は schema/cases/screens/fixtures/ の名前", "type": "object", "additionalProperties": false, "required": ["description", "kind", "fixture", "expect"], "properties": { "description": { "type": "string", "minLength": 1 }, "kind": { "$ref": "screen.schema.json#/$defs/kind" }, "fixture": { "description": "例のデータ(fixtures/<名前>.json)", "type": "string", "pattern": "^[a-z0-9_-]+$" }, "source": { "description": "静的に探す元の TSX(審査の時だけ違う書き方)。書かなければ HTML の script", "type": "string" }, "expect": { "type": "object", "additionalProperties": false, "required": ["failures"], "properties": { "failures": { "description": "落ちる確かめの id(順は問わない)", "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/checkId" } } } } }, "$defs": { "checkId": { "title": "ScreenCheckId", "description": "確かめの id(設計 2.5節の表の順)", "enum": ["network", "price_text", "price_largest", "purchase", "close_area", "urgency", "countdown", "feature", "review", "contrast", "overflow", "review_only", "motion"] } } },
124
+ "screens/events.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/events.schema.json", "title": "ScreenEvent", "description": "リモート画面のホスト(端末の SDK)が作ってアプリの計測に渡す出来事。paywall の画面は今の paywall_shown・paywall_closed・paywall_purchase_tapped・paywall_purchase_result も screen 付きで送る(docs/design/remote-screens.md 2.6節)", "oneOf": [{ "$ref": "#/$defs/shown" }, { "$ref": "#/$defs/action" }, { "$ref": "#/$defs/closed" }, { "$ref": "#/$defs/failed" }], "$defs": { "shown": { "title": "ScreenShownEvent", "description": "ready の後に画面を出した", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "screen_shown" }, "params": { "type": "object", "additionalProperties": false, "required": ["screen", "sha256", "placement", "campaign", "ready_ms", "set_version"], "properties": { "screen": { "$ref": "screen.schema.json#/$defs/screenId" }, "sha256": { "$ref": "screen.schema.json#/$defs/sha256" }, "placement": { "$ref": "../common.schema.json#/$defs/name" }, "campaign": { "$ref": "../common.schema.json#/$defs/campaignId" }, "price_tier": { "$ref": "../common.schema.json#/$defs/name" }, "ready_ms": { "description": "アプリが register(プレースメントを撃つ)を呼んでから、ホストがバンドルの ready を受けるまでのミリ秒(バンドルの取り出し・WebView の読み込みを含む)", "type": "integer", "minimum": 0 }, "prepare_ms": { "description": "register を呼んでから画面の用意ができるまでのミリ秒", "type": "integer", "minimum": 0 }, "webview_ms": { "description": "register を呼んでから WebView を取れるまでのミリ秒", "type": "integer", "minimum": 0 }, "page_ms": { "description": "register を呼んでからページを読み終えるまでのミリ秒", "type": "integer", "minimum": 0 }, "bridge_ms": { "description": "register を呼んでからブリッジがつながるまでのミリ秒", "type": "integer", "minimum": 0 }, "warm": { "description": "温めておいた WebView を使ったか", "type": "boolean" }, "set_version": { "description": "R4 の組の version", "type": "integer", "minimum": 0 }, "assignment_source": { "enum": ["app_transaction", "android_id", "install_id"] } } } } }, "action": { "title": "ScreenActionEvent", "description": "ブリッジの track と動き(action)。封筒の引数は入れ子にしないので、track の props は screen・action と同じ階層に並べる", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "screen_action" }, "params": { "type": "object", "required": ["screen", "action"], "maxProperties": 7, "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "properties": { "screen": { "$ref": "screen.schema.json#/$defs/screenId" }, "action": { "description": "動きの名前(track の name か、action の name)", "type": "string", "pattern": "^[a-z0-9_]{1,40}$" } }, "additionalProperties": { "description": "track の props(64バイトまでの文字が5つまで。名前に screen と action は使えない)", "type": "string", "maxLength": 64 } } } }, "closed": { "title": "ScreenClosedEvent", "description": "画面を閉じた", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "screen_closed" }, "params": { "type": "object", "additionalProperties": false, "required": ["screen", "seconds", "how"], "properties": { "screen": { "$ref": "screen.schema.json#/$defs/screenId" }, "seconds": { "type": "number", "minimum": 0 }, "how": { "enum": ["close_button", "swipe", "action", "purchased"] } } } } }, "failureReason": { "title": "ScreenFailureReason", "description": "screen_failed の理由。host_too_old は min_host に足りない・bundle_missing は保存が無い・hash_mismatch は sha256 が合わない・timeout は1.5秒で ready が来ない・bridge_error はブリッジの呼び方が壊れている", "enum": ["host_too_old", "bundle_missing", "hash_mismatch", "timeout", "bridge_error"] }, "failed": { "title": "ScreenFailedEvent", "description": "出せずに fallback にした", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "screen_failed" }, "params": { "type": "object", "additionalProperties": false, "required": ["screen", "reason"], "properties": { "screen": { "$ref": "screen.schema.json#/$defs/screenId" }, "reason": { "$ref": "#/$defs/failureReason" } } } } } } },
125
+ "screens/fixture.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/fixture.schema.json", "title": "ScreenCheckFixture", "description": "schema/cases/screens/fixtures/*.json の1つ。packages/screens-check が context() に入れる本人の値と値段の例、照らすマニフェスト。言語ごとに表示する", "type": "object", "additionalProperties": false, "required": ["description", "langs", "region", "facts", "products", "manifest"], "properties": { "description": { "type": "string", "minLength": 1 }, "langs": { "type": "array", "minItems": 1, "items": { "$ref": "../common.schema.json#/$defs/langTag" } }, "region": { "type": "string", "pattern": "^[A-Z]{2}$" }, "facts": { "$ref": "../common.schema.json#/$defs/typedProps" }, "products": { "type": "array", "items": { "$ref": "#/$defs/product" } }, "manifest": { "description": "照らす config/manifest.json の一部(paywall.features・reviews・facts の kind)", "type": "object", "additionalProperties": false, "required": ["features", "reviews", "deadline_facts"], "properties": { "features": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/name" } }, "reviews": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/name" } }, "deadline_facts": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/name" } } } } }, "$defs": { "product": { "title": "ScreenBridgeProduct", "description": "context() の products の1つ。ストアから取った値段の文字・期間・オファーの有無", "type": "object", "additionalProperties": false, "required": ["package_id", "product_id", "price", "period", "has_intro_offer"], "properties": { "package_id": { "type": "string" }, "product_id": { "type": "string" }, "price": { "description": "ストアの値段の文字(¥6,000・$39.99)", "type": "string" }, "price_per_month": { "description": "月あたりに直した値段の文字(年額の時)", "type": "string" }, "period": { "enum": ["week", "month", "year", "lifetime"] }, "has_intro_offer": { "description": "この人が intro_offer を使えるか(ストアが1年目の値段を請求するか)", "type": "boolean" }, "intro_offer": { "$ref": "#/$defs/introOffer" }, "commitment": { "$ref": "#/$defs/commitment" } } }, "introOffer": { "title": "ScreenBridgeIntroOffer", "description": "商品に付いた導入の値段(App Store の introductoryOffer・Play の offer の最初の価格の段階)。has_intro_offer が true の時、ストアが請求するのは price で、画面は price を一番大きく出す(knowledge の paywall#P17)", "type": "object", "additionalProperties": false, "required": ["price", "period", "period_count", "cycles", "payment_mode", "renewal_price"], "properties": { "price": { "description": "導入の値段の文字(1回の期間の値段。¥5,000・$0)", "type": "string" }, "period": { "description": "1回の期間の単位", "enum": ["day", "week", "month", "year"] }, "period_count": { "description": "1回の期間に period がいくつ入るか(3日なら period が day で 3)", "type": "integer", "minimum": 1 }, "cycles": { "description": "導入の値段を何回続けるか(前払いと無料の期間は 1)", "type": "integer", "minimum": 1 }, "payment_mode": { "enum": ["free_trial", "pay_up_front", "pay_as_you_go"] }, "renewal_price": { "description": "導入の期間が終わった後の値段の文字(2年目からの値段。商品の price と同じ)", "type": "string" } } }, "commitment": { "title": "ScreenBridgeCommitment", "description": "年額の商品に付いた、同じ購読の12か月の約束の月払い(App Store・iOS 26.4 以上)。その国の店が売っていて、アプリが出すと決めた時だけ付く。画面は package_id で買い、price を月々の値段として出す。total_price は12か月の合計", "type": "object", "additionalProperties": false, "required": ["package_id", "price", "period", "installments", "total_price"], "properties": { "package_id": { "description": "買う時に渡す package の id(12mo_commitment)", "type": "string" }, "price": { "description": "月々の値段の文字(¥500)", "type": "string" }, "period": { "description": "払う間隔", "enum": ["month"] }, "installments": { "description": "約束の回数(12)", "type": "integer", "minimum": 1 }, "total_price": { "description": "約束の合計の値段の文字(¥6,000)", "type": "string" } } }, "context": { "title": "ScreenBridgeContext", "description": "ブリッジの context() の答え(window.appgrowstack.context() が返す JSON)。facts は画面の facts に書いた物だけ。値段の文字は products だけが持つ(docs/design/remote-screens.md 2.4節)", "type": "object", "additionalProperties": false, "required": ["lang", "region", "facts", "products", "placement", "screen"], "properties": { "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "region": { "type": "string", "pattern": "^[A-Z]{2}$" }, "facts": { "$ref": "../common.schema.json#/$defs/typedProps" }, "products": { "type": "array", "items": { "$ref": "#/$defs/product" } }, "placement": { "$ref": "../common.schema.json#/$defs/name" }, "screen": { "$ref": "screen.schema.json#/$defs/screenId" } } } } },
126
+ "screens/pattern.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/pattern.schema.json", "title": "ScreenPattern", "description": "画面の型の目録(packages/screens-kit/src/patterns/<id>/pattern.json)。型は構図と強調の手法の組で、どのアプリのテーマと文言でも組める。結果は core の inapp_screen_pattern_use、散文の知見は app-playbook の knowledge が型の id を指す(docs/design/screen-patterns.md)", "type": "object", "additionalProperties": false, "required": ["id", "kind", "component", "title", "layout", "emphasis", "motion", "essence", "refs", "slots", "facts", "cautions", "examples"], "properties": { "id": { "$ref": "#/$defs/patternId" }, "kind": { "$ref": "screen.schema.json#/$defs/kind" }, "component": { "description": "@appgrowstack/screens が出す React の部品の名前。画面の screen.tsx はこれを使う", "type": "string", "pattern": "^[A-Z][A-Za-z0-9]{2,60}$" }, "title": { "description": "一覧に出す短い名前", "type": "string", "minLength": 1, "maxLength": 40 }, "layout": { "description": "構図。上から何がどう並ぶか", "type": "string", "minLength": 1, "maxLength": 200 }, "emphasis": { "description": "強調の手法。screens-kit の Glow・Shimmer・Pulse・Sparkles・Video と、値段と社会的証明の見せ方", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/emphasis" } }, "motion": { "description": "動き。部品の名前と、この型で何に付けたか。時間とイージングは screens-kit の motion.ts の値(app-playbook の knowledge/motion.md のペイウォールの動きの節)", "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/motion" } }, "essence": { "description": "なぜ効くか。真似る元から抜いた本質を1〜2文", "type": "string", "minLength": 1, "maxLength": 240 }, "refs": { "description": "真似た元。アプリ名と R12 の参考の素材の id", "type": "array", "minItems": 1, "maxItems": 6, "items": { "$ref": "#/$defs/ref" } }, "slots": { "description": "中身を差し込む口(React の props)。文言・画像・機能の行・レビュー", "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/slot" } }, "facts": { "description": "要る本人の値。プレースメントの facts に無ければ使えない", "type": "array", "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "cautions": { "description": "審査と確かめに当たる注意。check は screens-check の確かめの id", "type": "array", "items": { "$ref": "#/$defs/caution" } }, "examples": { "description": "プレビューと確かめの例(facts・値段・マニフェスト)。1つ目が既定", "type": "array", "minItems": 1, "maxItems": 4, "items": { "$ref": "#/$defs/example" } } }, "$defs": { "patternId": { "title": "ScreenPatternId", "description": "型の id。種類で始め、英小文字・数字・_", "type": "string", "pattern": "^(paywall|fullscreen|sheet|modal|card|banner)_[a-z0-9_]{2,40}$" }, "emphasis": { "title": "ScreenEmphasis", "enum": ["cta_glow", "cta_shimmer", "cta_pulse", "cta_press_depth", "plan_glow", "per_month_anchor", "compare_columns", "personal_progress", "real_reviews", "sparkles", "feature_carousel", "hero_image", "video_hero", "trial_timeline", "proof_number"] }, "motionPiece": { "title": "ScreenMotionPiece", "description": "enter=見出しと中身が順に下から入る・hero=絵やキャラクターが跳ねて入る・pop=印や札が弾んで出る・select=選んだプランが沈んで戻る・cta_shine=購入ボタンの光の帯・count=数が回って決まる・fill=進みの棒が伸びる・carousel=機能をスワイプで1枚ずつ送る・video=動画を読み込んでから出す", "enum": ["enter", "hero", "pop", "select", "cta_shine", "count", "fill", "carousel", "video"] }, "motion": { "type": "object", "additionalProperties": false, "required": ["piece", "note"], "properties": { "piece": { "$ref": "#/$defs/motionPiece" }, "note": { "description": "この型の何に付けたか", "type": "string", "minLength": 1, "maxLength": 160 } } }, "ref": { "type": "object", "additionalProperties": false, "required": ["app", "ref"], "properties": { "app": { "type": "string", "minLength": 1, "maxLength": 60 }, "ref": { "$ref": "../creative/reference.schema.json#/$defs/referenceId" }, "note": { "description": "この元から何を取ったか", "type": "string", "maxLength": 160 } } }, "slot": { "type": "object", "additionalProperties": false, "required": ["name", "what", "required"], "properties": { "name": { "type": "string", "pattern": "^[a-z][a-zA-Z0-9]{1,40}$" }, "what": { "type": "string", "minLength": 1, "maxLength": 160 }, "required": { "type": "boolean" } } }, "caution": { "type": "object", "additionalProperties": false, "required": ["note"], "properties": { "check": { "enum": ["network", "price_text", "price_largest", "purchase", "close_area", "urgency", "countdown", "feature", "review", "contrast", "overflow", "review_only", "motion"] }, "note": { "type": "string", "minLength": 1, "maxLength": 200 } } }, "example": { "type": "object", "additionalProperties": false, "required": ["id", "fixture"], "properties": { "id": { "$ref": "../common.schema.json#/$defs/name" }, "fixture": { "$ref": "fixture.schema.json" } } } } },
127
+ "screens/screen.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/screen.schema.json", "title": "RemoteScreen", "description": "リモート画面の screen.json(アプリの repo の screens/<id>/screen.json)。見た目は同じフォルダの screen.tsx(React)が持ち、app-growth screens build が1つの HTML のバンドルに書き出す(docs/design/remote-screens.md 2節)。id はフォルダの名前", "type": "object", "additionalProperties": false, "required": ["kind", "pattern", "title", "refs", "min_host", "fallback", "facts"], "properties": { "kind": { "$ref": "#/$defs/kind" }, "pattern": { "description": "組んだ型の id(packages/screens-kit の目録)。型に無い物を作る時は、先に新しい型を目録に足す(docs/design/screen-patterns.md 5節)", "$ref": "pattern.schema.json#/$defs/patternId" }, "title": { "description": "人が読む1行(state と実験の一覧に出す)", "type": "string", "minLength": 1, "maxLength": 120 }, "refs": { "description": "R12 の参考の素材の id(真似る元)。0個なら check の警告", "type": "array", "uniqueItems": true, "maxItems": 10, "items": { "$ref": "../creative/reference.schema.json#/$defs/referenceId" } }, "min_host": { "$ref": "#/$defs/minHost" }, "fallback": { "$ref": "#/$defs/fallback" }, "facts": { "description": "バンドルが context() で読む本人の値。出すプレースメントの facts の中の物だけ", "type": "array", "uniqueItems": true, "maxItems": 20, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "dismiss": { "$ref": "#/$defs/dismiss" } }, "$defs": { "kind": { "title": "RemoteScreenKind", "description": "出し方。プレースメントの kinds に入る物だけを出せる。paywall と fullscreen はネイティブの×を必ず出す", "enum": ["paywall", "fullscreen", "sheet", "modal", "card", "banner"] }, "screenId": { "title": "RemoteScreenId", "description": "画面の id(screens/<id>/ のフォルダの名前)。英小文字・数字・_。実験の案は画面の id で数えるので、中身を変えた時は id を替える", "type": "string", "pattern": "^[a-z0-9_]{1,60}$" }, "hostVersion": { "title": "RemoteScreenHostVersion", "description": "ホスト(端末の SDK の screens)の版(x.y.z)", "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" }, "minHost": { "title": "RemoteScreenMinHost", "description": "OS ごとに、この画面を開けるホストの最小の版。足りない端末は fallback(screen_failed(host_too_old))", "type": "object", "additionalProperties": false, "required": ["ios", "android"], "properties": { "ios": { "$ref": "#/$defs/hostVersion" }, "android": { "$ref": "#/$defs/hostVersion" } } }, "fallback": { "title": "RemoteScreenFallback", "description": "開けない時に出す物。app(アプリの組み込みの画面)か、ほかの画面の id", "anyOf": [{ "const": "app" }, { "$ref": "#/$defs/screenId" }] }, "sha256": { "title": "BundleSha256", "description": "バンドル(HTML)の中身の sha256(小文字の16進64文字)。api のバンドルを返すパスと端末の保存の名前", "type": "string", "pattern": "^[0-9a-f]{64}$" }, "bundle": { "title": "RemoteScreenBundle", "description": "R4 の組の screens の1つ。screen.json と、書き出したバンドルの sha256・大きさ・中の script の sha256(ホストが CSP の script-src に入れる)", "type": "object", "additionalProperties": false, "required": ["kind", "min_host", "fallback", "facts", "sha256", "bytes", "script_sha256"], "properties": { "kind": { "$ref": "#/$defs/kind" }, "min_host": { "$ref": "#/$defs/minHost" }, "fallback": { "$ref": "#/$defs/fallback" }, "facts": { "type": "array", "uniqueItems": true, "maxItems": 20, "items": { "$ref": "../common.schema.json#/$defs/name" } }, "sha256": { "$ref": "#/$defs/sha256" }, "bytes": { "description": "バンドルの大きさ(バイト)。4MB まで", "type": "integer", "minimum": 1, "maximum": 4194304 }, "script_sha256": { "description": "バンドルの中の1つの <script> の中身の sha256 を base64 にした物。ホストは CSP を script-src 'sha256-<これ>' にする(インラインの script をほかに動かさない)", "type": "string", "pattern": "^[A-Za-z0-9+/]{43}=$" }, "dismiss": { "$ref": "#/$defs/dismiss" } } }, "dismiss": { "title": "RemoteScreenDismiss", "description": "閉じ方。swipe は下へのスワイプで閉じるか(書かなければ true。sheet・modal・card で効く)", "type": "object", "additionalProperties": false, "properties": { "swipe": { "type": "boolean" } } } } },
128
+ "screens/select-case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/select-case.schema.json", "title": "ScreenSelectCase", "description": "schema/cases/screens/select/*.json の1つ。キャンペーンが選んだ画面を開けるか(min_host → 保存 → sha256)と、開けない時の fallback のたどり方。TypeScript(packages/campaign-rules の selectBundle)・Swift・Kotlin が同じ答えを返す", "type": "object", "additionalProperties": false, "required": ["description", "screens", "show", "platform", "host_version", "stored", "expect"], "properties": { "description": { "type": "string", "minLength": 1 }, "screens": { "description": "組の screens", "type": "object", "additionalProperties": { "$ref": "screen.schema.json#/$defs/bundle" } }, "show": { "$ref": "screen.schema.json#/$defs/screenId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "host_version": { "$ref": "screen.schema.json#/$defs/hostVersion" }, "stored": { "description": "端末に保存してあるバンドル。組に書いた sha256 → 保存した中身から数えた sha256", "type": "object", "additionalProperties": { "$ref": "screen.schema.json#/$defs/sha256" } }, "expect": { "type": "object", "additionalProperties": false, "required": ["shown", "sha256", "failed"], "properties": { "shown": { "description": "出す画面の id か app", "type": "string" }, "sha256": { "anyOf": [{ "$ref": "screen.schema.json#/$defs/sha256" }, { "type": "null" }] }, "failed": { "description": "screen_failed をこの順に送る", "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["screen", "reason"], "properties": { "screen": { "$ref": "screen.schema.json#/$defs/screenId" }, "reason": { "$ref": "events.schema.json#/$defs/failureReason" } } } } } } } },
129
+ "screens/signing-case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/signing-case.schema.json", "title": "SetSigningCase", "description": "schema/cases/signing/*.json の1つ。組(R4・R9)→ 正規形 → Ed25519 の署名の例(docs/design/remote-screens.md 10.2節)。core・Swift・Kotlin が同じ canonical と signature を作る。秘密のキーは試しのためだけの物", "type": "object", "additionalProperties": false, "required": ["description", "set", "canonical", "canonical_utf8_hex", "key_id", "public_key", "private_key_pkcs8", "signature"], "properties": { "description": { "type": "string", "minLength": 1 }, "set": { "description": "組(signature と key_id の無い物)", "type": "object" }, "canonical": { "description": "署名する正規形の文字", "type": "string" }, "canonical_utf8_hex": { "description": "canonical の UTF-8 の16進", "type": "string", "pattern": "^([0-9a-f]{2})+$" }, "key_id": { "$ref": "../common.schema.json#/$defs/setKeyId" }, "public_key": { "description": "Ed25519 の公開キー(raw の32バイトの base64)", "type": "string", "pattern": "^[A-Za-z0-9+/]{43}=$" }, "private_key_pkcs8": { "description": "試しのためだけの秘密のキー(PKCS#8 の base64)", "type": "string" }, "signature": { "$ref": "../common.schema.json#/$defs/setSignature" } } },
130
+ "screens/theme.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/screens/theme.schema.json", "title": "ScreenTheme", "description": "アプリのブランドのトークン(アプリの repo の screens/theme.json)。app-growth screens build がバンドルの <style data-ags-theme> に CSS の変数として入れ、型はこの変数だけで色と字と角を描く。文字と地の組はコントラスト4.5以上(docs/design/screen-patterns.md 3節)", "type": "object", "additionalProperties": false, "required": ["name", "colors", "font", "radius", "haptics"], "properties": { "name": { "description": "人が読む名前(アプリ名)", "type": "string", "minLength": 1, "maxLength": 40 }, "colors": { "type": "object", "additionalProperties": false, "required": ["background", "surface", "text", "muted", "accent", "on_accent", "hero", "on_hero", "highlight", "border"], "properties": { "background": { "$ref": "#/$defs/color" }, "surface": { "description": "カードと板の地", "$ref": "#/$defs/color" }, "text": { "$ref": "#/$defs/color" }, "muted": { "description": "薄い文。background と surface の上で4.5以上", "$ref": "#/$defs/color" }, "accent": { "description": "購入のボタンと選んだプランの縁", "$ref": "#/$defs/color" }, "on_accent": { "$ref": "#/$defs/color" }, "hero": { "description": "上の帯と暗い地の型の地", "$ref": "#/$defs/color" }, "on_hero": { "$ref": "#/$defs/color" }, "highlight": { "description": "hero の上の2つ目の色(強調の1語・光り)", "$ref": "#/$defs/color" }, "border": { "$ref": "#/$defs/color" } } }, "font": { "type": "object", "additionalProperties": false, "required": ["family", "title_weight"], "properties": { "family": { "description": "system は端末の書体。rounded は丸い書体(iOS の SF Rounded・Android は端末の書体)", "enum": ["system", "rounded", "serif"] }, "title_weight": { "enum": [600, 700, 800] } } }, "radius": { "type": "object", "additionalProperties": false, "required": ["card", "button"], "properties": { "card": { "type": "integer", "minimum": 0, "maximum": 32 }, "button": { "type": "integer", "minimum": 0, "maximum": 32 } } }, "haptics": { "description": "触覚の強さ。none は鳴らさない・soft は買えた時だけ・normal はプランを選んだ時とボタンも", "enum": ["none", "soft", "normal"] } }, "$defs": { "color": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" } } },
131
+ "segments/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/segments/admin.schema.json", "title": "SegmentPushRequest", "description": "POST /v1/people/projects/:project/segments の本文。アプリの repo の segments/*.json の全部。送った一覧でその製品の群れを置き換え、無くなった群れは所属ごと消す", "type": "object", "additionalProperties": false, "required": ["segments", "published_by"], "properties": { "segments": { "type": "array", "maxItems": 50, "items": { "$ref": "segment.schema.json" } }, "published_by": { "description": "送った人か git の commit(CLI が入れる)", "type": "string", "minLength": 1, "maxLength": 200 } }, "$defs": { "pushResponse": { "title": "SegmentPushResponse", "type": "object", "additionalProperties": false, "required": ["version", "pushed_at", "segments"], "properties": { "version": { "description": "群れの定義の版(送るたびに1つ増える)", "type": "integer", "minimum": 1 }, "pushed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "segments": { "description": "送った群れと、送った直後に計算した人数", "type": "array", "items": { "$ref": "#/$defs/summary" } } } }, "summary": { "title": "SegmentSummary", "type": "object", "additionalProperties": false, "required": ["id", "kind", "description", "members", "expires_at"], "properties": { "id": { "$ref": "segment.schema.json#/$defs/segmentId" }, "kind": { "enum": ["rule", "named"] }, "description": { "type": "string" }, "members": { "description": "今入っている人の数", "type": "integer", "minimum": 0 }, "expires_at": { "description": "名指しの群れの期限。規則の群れは null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "list": { "title": "SegmentList", "type": "object", "additionalProperties": false, "required": ["version", "segments", "computed_at"], "properties": { "version": { "description": "今の群れの定義の版。送ったことが無ければ0", "type": "integer", "minimum": 0 }, "segments": { "type": "array", "items": { "$ref": "#/$defs/summary" } }, "computed_at": { "description": "最後に全員を計算した時刻。まだなら null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } }, "members": { "title": "SegmentMembers", "description": "GET /v1/people/projects/:project/segments/:segment/members の答え。入った時刻の新しい順", "type": "object", "additionalProperties": false, "required": ["segment", "members", "next_cursor"], "properties": { "segment": { "$ref": "segment.schema.json#/$defs/segmentId" }, "members": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["person_id", "entered_at"], "properties": { "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "entered_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } } }, "next_cursor": { "description": "続きがあれば次の要求の ?cursor=", "anyOf": [{ "type": "string" }, { "type": "null" }] } } }, "mine": { "title": "PersonSegments", "description": "GET /v1/people/me/segments の答え(端末)。端末は保存し、起動と前面に戻った時に、前の取得から1時間を過ぎていれば取り直す。起動の最初の判定は保存してある所属で行う", "type": "object", "additionalProperties": false, "required": ["segments", "price_tier", "price_experiment", "computed_at"], "properties": { "segments": { "description": "入っている群れの id(辞書順)。人がまだいなければ空", "type": "array", "items": { "$ref": "segment.schema.json#/$defs/segmentId" } }, "price_tier": { "description": "その人の値段の段階(pricing/ladder.json の id)。階段を送っていない製品は null。どのペイウォールもこの段階の Offering を出す", "anyOf": [{ "$ref": "../pricing/ladder.schema.json#/$defs/tierId" }, { "type": "null" }] }, "price_experiment": { "description": "price_tier を値段の実験で決めた時の割り当て。ほかは null", "anyOf": [{ "$ref": "../pricing/admin.schema.json#/$defs/priceExperiment" }, { "type": "null" }] }, "computed_at": { "description": "その人の所属を最後に計算した時刻。まだなら null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] } } } } },
132
+ "segments/case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/segments/case.schema.json", "title": "SegmentCase", "description": "schema/cases/segments/*.json の1つ。件の audience と R9 の規則の条件に書いた群れの条件(segment・not)が、端末の保存した所属で当たるか。TypeScript(packages/campaign-rules の Evaluator)・Swift・Kotlin が同じ答えを返す", "type": "object", "additionalProperties": false, "required": ["description", "condition", "segments", "facts", "expect"], "properties": { "description": { "type": "string" }, "condition": { "description": "件の audience と同じ形", "$ref": "../inapp/campaign.schema.json#/$defs/factCondition" }, "segments": { "description": "端末が保存した自分の群れの id", "type": "array", "items": { "$ref": "segment.schema.json#/$defs/segmentId" } }, "facts": { "description": "端末の値(群れと混ぜた条件のため)", "$ref": "../common.schema.json#/$defs/typedProps" }, "expect": { "type": "object", "additionalProperties": false, "required": ["match"], "properties": { "match": { "description": "当たるか", "type": "boolean" } } } } },
133
+ "segments/facts.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/segments/facts.schema.json", "title": "SegmentFacts", "description": "schema/segments/facts.json の形。規則の群れの条件に書ける人の値の一覧と型", "type": "object", "additionalProperties": false, "required": ["description", "facts"], "properties": { "description": { "type": "string" }, "facts": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/name" }, "additionalProperties": { "$ref": "#/$defs/fact" } } }, "$defs": { "fact": { "title": "SegmentFact", "type": "object", "additionalProperties": false, "required": ["type", "from", "description"], "properties": { "type": { "enum": ["string", "int", "bool"] }, "from": { "description": "どこから計算するか(表と列・出来事)", "type": "string" }, "description": { "type": "string" }, "values": { "description": "文字列の値が決まっている物の一覧", "type": "array", "items": { "type": "string" } } } } } },
134
+ "segments/segment.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/segments/segment.schema.json", "title": "Segment", "description": "群れ(docs/design/remote-screens.md 4節)。アプリの repo の segments/<id>.json の1つ。rule は人の値の条件で core が計算する群れ、named は人を名指しする期限つきの群れ。件の条件と R9 の規則に { \"segment\": \"<id>\" } で書く", "oneOf": [{ "$ref": "#/$defs/ruleSegment" }, { "$ref": "#/$defs/namedSegment" }], "$defs": { "segmentId": { "title": "SegmentId", "description": "群れの id。英小文字で始まり、英小文字・数字・_ の40文字まで。送ったことのある id の意味は変えない(変えるときは id を替える)", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$" }, "ruleSegment": { "title": "RuleSegment", "description": "人の値(schema/segments/facts.json と people_trait)の条件で決まる群れ。coreが日に1回(03:00 UTC)と課金の webhook を受けた時に計算する。利用者(audience が real)だけが入る", "type": "object", "additionalProperties": false, "required": ["id", "kind", "description", "where"], "properties": { "id": { "$ref": "#/$defs/segmentId" }, "kind": { "const": "rule" }, "description": { "type": "string", "minLength": 1, "maxLength": 200 }, "where": { "description": "人の値の条件。形は件の audience と同じ(fact と演算子・all・any)。facts.json に無い名前は people_trait の name として読む。群れの条件(segment)は書かない", "$ref": "../inapp/campaign.schema.json#/$defs/factCondition" } } }, "namedSegment": { "title": "NamedSegment", "description": "人を名指しする群れ。expires_at が必須で、送った時から90日まで。過ぎたら core が外す。本人・テスター・審査・ロボットの人も入る", "type": "object", "additionalProperties": false, "required": ["id", "kind", "description", "people", "expires_at"], "properties": { "id": { "$ref": "#/$defs/segmentId" }, "kind": { "const": "named" }, "description": { "type": "string", "minLength": 1, "maxLength": 200 }, "people": { "description": "人の id(R2 の person_id)。寄せた人の id は寄せた先に読み替える", "type": "array", "minItems": 1, "maxItems": 1000, "uniqueItems": true, "items": { "$ref": "../common.schema.json#/$defs/personId" } }, "expires_at": { "$ref": "../common.schema.json#/$defs/isoTime" } } } } },
135
+ "sessions/admin.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/sessions/admin.schema.json", "title": "SessionList", "description": "GET /v1/sessions/projects/:project/sessions?…(listSessions・core)の答え。新しい順(sort=new)か、つまずきの多い順(sort=friction。rage+dead+quick_backs+hangs の多い順)か、見るべき順(sort=attention。attention.score の高い順・同じなら新しい順)。既定はタップの無い閉じたセッション(裏の起動だけの物など)を入れない(min_taps=1。見るべき点のある物は入れる。min_taps=0 で全部)。next は次の頁のカーソルで、最後の頁は null。本人とテスターの端末のセッション(internal)も入る", "type": "object", "additionalProperties": false, "required": ["sessions", "next"], "properties": { "sessions": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/row" } }, "next": { "type": ["string", "null"], "maxLength": 512 } }, "$defs": { "replayState": { "title": "SessionReplayState", "description": "録画の扱い。none=撮らない・buffer=撮ったが送っていない・record=全部送った・priority=優先の条件で送った(全部の数と分けて数える)", "enum": ["none", "buffer", "record", "priority"] }, "summaryStatus": { "title": "SessionSummaryStatus", "enum": ["none", "queued", "done", "failed"] }, "row": { "title": "SessionRow", "description": "sessions_session の1行。終わっていないセッションは ended_at・end_reason・duration_ms・away_ms が無い。duration_ms は触っていた時間(前にいた時間の和。裏にいた間と、30分を超えて出来事の無い間を入れない)、away_ms は始まりから終わりまでのうちの残り(裏にいた時間)。数(screens・taps など)は閉じた時と、閉じた後に出来事が届いた時に数え直す", "type": "object", "additionalProperties": false, "required": ["id", "project", "person_id", "install_id", "platform", "app_version", "channel", "internal", "started_at", "last_at", "screens", "taps", "rage", "dead", "quick_backs", "hangs", "backs", "replay", "replay_bytes", "summary_status", "new_person", "marks", "attention", "issues"], "properties": { "id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "install_id": { "$ref": "../common.schema.json#/$defs/installId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "channel": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "internal": { "description": "本人とテスターの端末か、channel が debug・testflight。集計に足さない", "type": "boolean" }, "started_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "last_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "ended_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "end_reason": { "$ref": "batch.schema.json#/$defs/endReason" }, "duration_ms": { "type": "integer", "minimum": 0 }, "screens": { "description": "screen の出来事の数", "type": "integer", "minimum": 0 }, "taps": { "type": "integer", "minimum": 0 }, "rage": { "type": "integer", "minimum": 0 }, "dead": { "type": "integer", "minimum": 0 }, "quick_backs": { "type": "integer", "minimum": 0 }, "hangs": { "description": "固まった(hang の出来事)の数", "type": "integer", "minimum": 0 }, "backs": { "type": "integer", "minimum": 0 }, "entry_screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "exit_screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "replay": { "$ref": "#/$defs/replayState" }, "replay_bytes": { "type": "integer", "minimum": 0 }, "keep_until": { "$ref": "../common.schema.json#/$defs/epochMs" }, "summary_status": { "$ref": "#/$defs/summaryStatus" }, "away_ms": { "description": "裏にいた時間(background から foreground まで・30分を超えて出来事の無い間)。ended_at − started_at − duration_ms", "type": "integer", "minimum": 0 }, "new_person": { "description": "このセッションに出来事 first_open があり、kind が upgraded でない(アプリを新しく入れた人の最初のセッション)。SDK の start.first(SDK が初めて動いた)では決めない", "type": "boolean" }, "region": { "description": "端末の地域(start の端末の値 region)", "type": "string", "minLength": 1, "maxLength": 16 }, "lang": { "description": "端末の言語(start の端末の値 lang)", "type": "string", "minLength": 1, "maxLength": 16 }, "marks": { "description": "持つマークの種類(重ならない・markKind の順)", "type": "array", "uniqueItems": true, "items": { "$ref": "batch.schema.json#/$defs/markKind" } }, "attention": { "$ref": "#/$defs/attention" }, "summary_line": { "$ref": "#/$defs/summaryLine" }, "reviewed_at": { "description": "読んだ記録(POST …/review)の時刻。読んでいなければ無い", "$ref": "../common.schema.json#/$defs/epochMs" }, "review_note": { "description": "読んだ記録のメモ", "type": "string", "minLength": 1, "maxLength": 500 }, "issues": { "description": "結んだセッションの課題の key(key の順)。結んでいなければ空", "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/issueKey" } } } }, "attentionReason": { "title": "SessionAttentionReason", "description": "見るべき順の点の理由(点は docs/design/sessions.md 7.8節の表)。new_onboarding_left=新しい人がオンボーディングを終えずに終わり、24時間戻っていない・new_onboarding_untouched=新しい人が何も触らずに終わった・onboarding_resumed=途中で終わったが、同じ人が24時間以内に戻って続けた(0点)・ticket=問い合わせ・purchase=課金した・crashed=落ちたか固まって終わった・outcome_stuck/outcome_left=要約の結果・paywall_no_purchase=ペイウォールを見て買わなかった(前に出ていない間と、期間の始まりが続くオンボーディングの物を除く)・new_person=新しい人(オンボーディングを終えた)・trial_ended/trial_started=お試しの終わり・始まり・rage・hang・dead・quick_back=つまずきの数・friction=要約のつまずきの数(閉じる時の数と同じ種類とペイウォールを除く)", "enum": ["new_onboarding_left", "new_onboarding_untouched", "onboarding_resumed", "ticket", "purchase", "crashed", "outcome_stuck", "outcome_left", "paywall_no_purchase", "new_person", "trial_ended", "trial_started", "rage", "hang", "dead", "quick_back", "friction"] }, "attention": { "title": "SessionAttention", "description": "見るべき順の点。score は why の points の和。閉じた時・閉じた後に出来事が届いた時・要約ができた時に作り直す", "type": "object", "additionalProperties": false, "required": ["score", "why"], "properties": { "score": { "type": "integer", "minimum": 0 }, "why": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["reason", "points"], "properties": { "reason": { "$ref": "#/$defs/attentionReason" }, "points": { "type": "integer", "minimum": 0 } } } } } }, "summaryLine": { "title": "SessionSummaryLine", "description": "一覧に出す要約の1行。要約がある時だけ。friction は要約のつまずきの最初の1つ(ペイウォールを閉じただけの物を除く)の what", "type": "object", "additionalProperties": false, "required": ["goal", "outcome"], "properties": { "goal": { "type": "string", "minLength": 1, "maxLength": 200 }, "outcome": { "$ref": "#/$defs/outcome" }, "friction": { "type": "string", "minLength": 1, "maxLength": 200 } } }, "mark": { "title": "SessionMarkRow", "description": "sessions_mark の1行。at は時刻(epoch のミリ秒)", "type": "object", "additionalProperties": false, "required": ["kind", "ref", "at"], "properties": { "kind": { "$ref": "batch.schema.json#/$defs/markKind" }, "ref": { "type": "string", "minLength": 1, "maxLength": 80 }, "side": { "$ref": "../experiment/holdout.schema.json#/$defs/side" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "segmentRow": { "title": "SessionSegmentRow", "description": "sessions_segment の1行(R2 の1つの物)。r2_key は外に見せない", "type": "object", "additionalProperties": false, "required": ["kind", "seq", "bytes", "t_from", "t_to"], "properties": { "kind": { "enum": ["events", "replay"] }, "seq": { "type": "integer", "minimum": 0 }, "bytes": { "type": "integer", "minimum": 0 }, "t_from": { "type": "integer", "minimum": 0 }, "t_to": { "type": "integer", "minimum": 0 } } }, "detail": { "title": "SessionDetail", "description": "GET …/sessions/:session_id(getSession)。events は出来事のバッチを seq の順につないだ物(同じ seq は1回・end は seq の大きい方)。segments の replay の行は sessions.replay.read を持たない主体には入れない。issues は結んだセッションの課題の全部の項目(key の順)", "type": "object", "additionalProperties": false, "required": ["session", "device", "events", "marks", "segments", "summary", "issues"], "properties": { "session": { "$ref": "#/$defs/row" }, "device": { "$ref": "batch.schema.json#/$defs/session" }, "events": { "type": "array", "items": { "$ref": "batch.schema.json#/$defs/event" } }, "marks": { "type": "array", "items": { "$ref": "#/$defs/mark" } }, "segments": { "type": "array", "items": { "$ref": "#/$defs/segmentRow" } }, "summary": { "oneOf": [{ "$ref": "#/$defs/summary" }, { "type": "null" }] }, "issues": { "type": "array", "items": { "$ref": "#/$defs/issue" } } } }, "replayFrame": { "title": "SessionReplayFrame", "description": "再生の1コマ(塊の頭の frames の1つ)。seq と i で getSessionFrame の ?frame=<i> を引く。same は前のコマのまま・blank は撮らなかった(reason)", "type": "object", "additionalProperties": false, "required": ["seq", "i", "t", "kind", "w", "h", "masked"], "properties": { "seq": { "type": "integer", "minimum": 0 }, "i": { "type": "integer", "minimum": 0 }, "t": { "description": "セッションの始まりからのミリ秒", "type": "integer", "minimum": 0 }, "kind": { "enum": ["image", "same", "blank"] }, "w": { "type": "integer", "minimum": 0 }, "h": { "type": "integer", "minimum": 0 }, "masked": { "type": "boolean" }, "reason": { "$ref": "segment.schema.json#/$defs/blankReason" } } }, "replay": { "title": "SessionReplay", "description": "GET …/sessions/:session_id/replay(getSessionReplay)。録画の塊の頭だけを R2 の範囲の読みで集め、コマを時刻の順に並べた物(画像は入れない)。塊の読めなかった数は skipped", "type": "object", "additionalProperties": false, "required": ["session_id", "frames", "skipped"], "properties": { "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "frames": { "type": "array", "maxItems": 20000, "items": { "$ref": "#/$defs/replayFrame" } }, "skipped": { "type": "integer", "minimum": 0 } } }, "outcome": { "title": "SessionOutcome", "description": "done=したいことを終えた・left=途中でやめた・stuck=同じ所を何度も・crashed=落ちた・unclear=分からない", "enum": ["done", "left", "stuck", "crashed", "unclear"] }, "frictionKind": { "title": "SessionFrictionKind", "enum": ["rage", "dead", "slow", "loop", "confused", "error", "crash", "paywall", "other"] }, "confidence": { "title": "SessionSummaryConfidence", "description": "録画が無い・隠した所が多いと下がる", "enum": ["low", "mid", "high"] }, "friction": { "title": "SessionFriction", "description": "困った所の1つ。t はセッションの始まりからのミリ秒。evidence は根拠にした出来事の t とコマの t", "type": "object", "additionalProperties": false, "required": ["t", "screen", "kind", "what", "evidence"], "properties": { "t": { "type": "integer", "minimum": 0 }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "kind": { "$ref": "#/$defs/frictionKind" }, "what": { "type": "string", "minLength": 1, "maxLength": 200 }, "evidence": { "type": "object", "additionalProperties": false, "required": ["events", "frames"], "properties": { "events": { "type": "array", "maxItems": 20, "items": { "type": "integer", "minimum": 0 } }, "frames": { "type": "array", "maxItems": 8, "items": { "type": "integer", "minimum": 0 } } } } } }, "summaryOutput": { "title": "SessionSummaryOutput", "description": "Claude に返させる JSON の形(7.5節・出力の形を固定)。story は時刻を付けて400字まで", "type": "object", "additionalProperties": false, "required": ["goal", "outcome", "story", "friction", "confidence"], "properties": { "goal": { "description": "何をしようとしていたか(1文)", "type": "string", "minLength": 1, "maxLength": 200 }, "outcome": { "$ref": "#/$defs/outcome" }, "story": { "type": "string", "minLength": 1, "maxLength": 400 }, "friction": { "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/friction" } }, "confidence": { "$ref": "#/$defs/confidence" } } }, "summary": { "title": "SessionSummary", "description": "POST …/sessions/:session_id/summarize(summarizeSession)の答えと sessions_summary の1行。SessionSummaryOutput に、どのセッションか・モデル・作った時刻を足した物", "type": "object", "additionalProperties": false, "required": ["session_id", "model", "created_at", "goal", "outcome", "story", "friction", "confidence"], "properties": { "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "model": { "type": "string", "minLength": 1, "maxLength": 64 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "goal": { "type": "string", "minLength": 1, "maxLength": 200 }, "outcome": { "$ref": "#/$defs/outcome" }, "story": { "type": "string", "minLength": 1, "maxLength": 400 }, "friction": { "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/friction" } }, "confidence": { "$ref": "#/$defs/confidence" } } }, "keepRequest": { "title": "KeepSessionRequest", "description": "POST …/sessions/:session_id/keep(keepSession)の本文。days を書かなければ180日", "type": "object", "additionalProperties": false, "properties": { "days": { "type": "integer", "minimum": 1, "maximum": 180 } } }, "reviewRequest": { "title": "ReviewSessionRequest", "description": "POST …/sessions/:session_id/review(reviewSession)の本文。読んだ記録を付ける(同じセッションの2回目は上書き)。issues(20個まで)を書けば、このセッションに結ぶセッションの課題をその集まりに置き換える(空の配列で全部外す・書かなければ今の結び付きのまま)。無い key が1つでもあれば 404 で断り、何も変えない(綴りの誤りで課題を作らない。作るのは upsertSessionIssue)", "type": "object", "additionalProperties": false, "properties": { "note": { "type": "string", "minLength": 1, "maxLength": 500 }, "issues": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/issueKey" } } } }, "review": { "title": "SessionReview", "description": "読んだ記録。reviewed_by は記録した主体の id。issues は今このセッションに結んでいるセッションの課題の key(key の順)", "type": "object", "additionalProperties": false, "required": ["session_id", "reviewed_at", "reviewed_by", "issues"], "properties": { "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "reviewed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "reviewed_by": { "type": "string", "minLength": 1, "maxLength": 64 }, "note": { "type": "string", "minLength": 1, "maxLength": 500 }, "issues": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/issueKey" } } } }, "issueKey": { "title": "SessionIssueKey", "description": "セッションの課題の key。プロジェクトの中で1つ。小文字の英数字とハイフン(例 promise-long-press)", "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" }, "issueStatus": { "title": "SessionIssueStatus", "description": "open=まだ直していない・fixed=直した(fixed_in のバージョンで)・wontfix=直さないと決めた", "enum": ["open", "fixed", "wontfix"] }, "issue": { "title": "SessionIssue", "description": "セッションの課題(sessions_issue の1行)。セッションを読んで見つけた画面の上の困りごとで、何本ものセッションに結ぶ。分析の指摘(数の検知から作る物)とは別。updated_by は最後に書いた主体の id", "type": "object", "additionalProperties": false, "required": ["project", "key", "title", "status", "created_at", "updated_at", "updated_by"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "key": { "$ref": "#/$defs/issueKey" }, "title": { "description": "何に困っているかの1行", "type": "string", "minLength": 1, "maxLength": 200 }, "status": { "$ref": "#/$defs/issueStatus" }, "fixed_in": { "description": "直したバージョン。このバージョンから後(バージョンは数として比べる。3.3.10 は 3.3.2 より後)に結んだセッションを after_fix に数える", "$ref": "../common.schema.json#/$defs/appVersion" }, "ref": { "description": "直した PR か issue の URL", "$ref": "../common.schema.json#/$defs/httpsUrl" }, "note": { "type": "string", "minLength": 1, "maxLength": 500 }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_by": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "upsertIssueRequest": { "title": "UpsertSessionIssueRequest", "description": "PUT …/issues/:key(upsertSessionIssue)の本文。無ければ作り(作る時は title が要る・status の既定は open)、あれば書いた項目だけ変える。fixed_in・ref・note は null で消す", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "status": { "$ref": "#/$defs/issueStatus" }, "fixed_in": { "oneOf": [{ "$ref": "../common.schema.json#/$defs/appVersion" }, { "type": "null" }] }, "ref": { "oneOf": [{ "$ref": "../common.schema.json#/$defs/httpsUrl" }, { "type": "null" }] }, "note": { "oneOf": [{ "type": "string", "minLength": 1, "maxLength": 500 }, { "type": "null" }] } } }, "issueVersion": { "title": "SessionIssueVersion", "description": "セッションの課題に結んだセッションの、platform とバージョンごとの本数", "type": "object", "additionalProperties": false, "required": ["platform", "app_version", "sessions"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "sessions": { "type": "integer", "minimum": 1 } } }, "issueRow": { "title": "SessionIssueRow", "description": "セッションの課題の一覧の1行。課題に、結んだセッションの数を足した物。people は結んだセッションの人の数。first_seen_at・last_seen_at は結んだセッションの始まりの最初と最後(結んでいなければ無い)。versions は platform ごとに新しいバージョンから。after_fix は fixed_in がある時だけ、fixed_in 以上のバージョン(数として比べる)の結んだセッションの数(直したバージョンが出た後も同じ課題が出ているか)", "type": "object", "additionalProperties": false, "required": ["issue", "sessions", "people", "versions"], "properties": { "issue": { "$ref": "#/$defs/issue" }, "sessions": { "type": "integer", "minimum": 0 }, "people": { "type": "integer", "minimum": 0 }, "first_seen_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "last_seen_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "versions": { "type": "array", "items": { "$ref": "#/$defs/issueVersion" } }, "after_fix": { "type": "integer", "minimum": 0 } } }, "issueList": { "title": "SessionIssueList", "description": "GET …/issues?status=(listSessionIssues)の答え。status はカンマで並べる(open・fixed・wontfix。書かなければ全部)。並びは open → fixed → wontfix、同じ状態の中は最後に出た時刻の新しい順(結んだセッションの無い物は最後)", "type": "object", "additionalProperties": false, "required": ["issues"], "properties": { "issues": { "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/issueRow" } } } }, "personSessions": { "title": "PersonSessions", "description": "GET …/people/:person/sessions(listPersonSessions)の JSON の答え。1人のセッションを古い順に(since から limit まで)。?format=text なら同じ物を時刻表の文で返す", "type": "object", "additionalProperties": false, "required": ["person_id", "sessions"], "properties": { "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "sessions": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/row" } } } }, "rejudgeRequest": { "title": "RejudgeSessionsRequest", "description": "POST …/sessions/rejudge(rejudgeSessions)の本文。since 以後に始まった閉じたセッションを、閉じる Queue に積み直す(数え直し・新しい人・節目のマーク・優先の条件・見るべき点。当たった物は要約の待ちに入れる)", "type": "object", "additionalProperties": false, "required": ["since"], "properties": { "since": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "rejudgeAnswer": { "title": "RejudgeSessionsAnswer", "type": "object", "additionalProperties": false, "required": ["since", "queued"], "properties": { "since": { "$ref": "../common.schema.json#/$defs/epochMs" }, "queued": { "type": "integer", "minimum": 0 } } }, "keepResponse": { "title": "KeepSessionResponse", "type": "object", "additionalProperties": false, "required": ["keep_until"], "properties": { "keep_until": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "screenDelta": { "title": "ScreenStatsDelta", "description": "前の同じ長さの期間との差(今 − 前)。前の期間に行が無ければ答えに入れない", "type": "object", "additionalProperties": false, "required": ["views", "rage", "dead", "quick_backs", "exit_rate"], "properties": { "views": { "type": "integer" }, "rage": { "type": "integer" }, "dead": { "type": "integer" }, "quick_backs": { "type": "integer" }, "exit_rate": { "type": "integer", "minimum": -10000, "maximum": 10000 } } }, "screenStats": { "title": "ScreenStats", "description": "1つの画面の期間の数(sessions_screen_day を足した物)。exit_rate は exits / views を 0〜10000 にした物。ms_p50・ms_p90 は期間の日の dwell_hist_json(画面にいた時間の分布)を足し合わせた分布の中央と90%の点(箱の上の端)。people は日ごとの人の数の和(同じ人が別の日に来れば2と数える)", "type": "object", "additionalProperties": false, "required": ["screen", "views", "people", "exits", "exit_rate", "quick_backs", "backs", "rage", "dead", "taps"], "properties": { "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "views": { "type": "integer", "minimum": 0 }, "people": { "type": "integer", "minimum": 0 }, "exits": { "type": "integer", "minimum": 0 }, "exit_rate": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "quick_backs": { "type": "integer", "minimum": 0 }, "backs": { "type": "integer", "minimum": 0 }, "rage": { "type": "integer", "minimum": 0 }, "dead": { "type": "integer", "minimum": 0 }, "taps": { "type": "integer", "minimum": 0 }, "ms_p50": { "type": "integer", "minimum": 0 }, "ms_p90": { "type": "integer", "minimum": 0 }, "delta": { "$ref": "#/$defs/screenDelta" } } }, "period": { "title": "SessionPeriod", "description": "数えた期間(UTC の日・両端を含む)と platform(書かなければ両方)。internal_sessions は ?internal=include で、本人とテスターの端末の閉じたセッションをその場で数えて足した数(集計の表には入らない。読むのは sessions.person.read を持つ主体だけ)。足さなかった時は入れない", "type": "object", "additionalProperties": false, "required": ["from", "to"], "properties": { "from": { "$ref": "../common.schema.json#/$defs/day" }, "to": { "$ref": "../common.schema.json#/$defs/day" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "internal_sessions": { "type": "integer", "minimum": 0 } } }, "screenStatsList": { "title": "ScreenStatsList", "description": "GET …/screens?since=&platform=(listScreenStats)。つまずく所の表。並びは rage+dead+quick_backs の多い順", "type": "object", "additionalProperties": false, "required": ["period", "screens"], "properties": { "period": { "$ref": "#/$defs/period" }, "screens": { "type": "array", "items": { "$ref": "#/$defs/screenStats" } } } }, "tapCell": { "title": "ScreenMapCell", "description": "sessions_tap_cell を期間で足した物。cell は 0〜3199(行 × 40 + 列。cases/sessions の tap-normalize の式)", "type": "object", "additionalProperties": false, "required": ["orientation", "cell", "taps", "rage", "dead"], "properties": { "orientation": { "$ref": "batch.schema.json#/$defs/orientation" }, "cell": { "type": "integer", "minimum": 0, "maximum": 3199 }, "taps": { "type": "integer", "minimum": 0 }, "rage": { "type": "integer", "minimum": 0 }, "dead": { "type": "integer", "minimum": 0 } } }, "screenMap": { "title": "ScreenMap", "description": "GET …/screens/:screen/map?since=&platform=&kind=(getScreenMap)。升は幅を40・高さを80に分けた物。scroll_hist は max_ratio を1000ごとに10に分けた数(9 は 9000〜10000)。ref_frame(代表のコマ)は sessions.replay.read を持つ主体にだけ入れる", "type": "object", "additionalProperties": false, "required": ["screen", "period", "kind", "views", "exits", "cells", "scroll_hist", "end_reasons"], "properties": { "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "period": { "$ref": "#/$defs/period" }, "kind": { "enum": ["tap", "rage", "dead", "scroll"] }, "views": { "type": "integer", "minimum": 0 }, "exits": { "type": "integer", "minimum": 0 }, "cells": { "type": "array", "items": { "$ref": "#/$defs/tapCell" } }, "scroll_hist": { "type": "array", "minItems": 10, "maxItems": 10, "items": { "type": "integer", "minimum": 0 } }, "end_reasons": { "description": "その画面で終わったセッションの終わり方の数", "type": "object", "propertyNames": { "$ref": "batch.schema.json#/$defs/endReason" }, "additionalProperties": { "type": "integer", "minimum": 0 } }, "ref_frame": { "description": "代表のコマ。path は console が読む core の道", "type": "object", "additionalProperties": false, "required": ["path", "app_version", "w", "h"], "properties": { "path": { "type": "string", "pattern": "^/v1/sessions/", "maxLength": 512 }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "w": { "type": "integer", "minimum": 1 }, "h": { "type": "integer", "minimum": 1 } } } } }, "flowReport": { "title": "FlowReport", "description": "GET …/flows?since=&from=&depth=(getFlows)。paths は最初の画面から depth(既定5)画面までのよく通る道(sessions_path_top)、edges は前の画面 → 次の画面(sessions_path_day)、exits は画面ごとのそこで終わった数", "type": "object", "additionalProperties": false, "required": ["period", "depth", "paths", "edges", "exits"], "properties": { "period": { "$ref": "#/$defs/period" }, "from": { "$ref": "../common.schema.json#/$defs/screenName" }, "depth": { "type": "integer", "minimum": 1, "maximum": 5 }, "paths": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["screens", "count", "ended_here"], "properties": { "screens": { "type": "array", "minItems": 1, "maxItems": 5, "items": { "$ref": "../common.schema.json#/$defs/screenName" } }, "count": { "type": "integer", "minimum": 0 }, "ended_here": { "type": "integer", "minimum": 0 } } } }, "edges": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["from", "to", "count", "people"], "properties": { "from": { "$ref": "../common.schema.json#/$defs/screenName" }, "to": { "$ref": "../common.schema.json#/$defs/screenName" }, "count": { "type": "integer", "minimum": 0 }, "people": { "type": "integer", "minimum": 0 } } } }, "exits": { "type": "object", "propertyNames": { "$ref": "../common.schema.json#/$defs/screenName" }, "additionalProperties": { "type": "integer", "minimum": 0 } } } }, "funnelStep": { "title": "SessionFunnelStep", "description": "ファネルの1段。sessions はその段のマークを持つセッションの数、people はその人の数。sessions の段は期間に始まった全部のセッション", "type": "object", "additionalProperties": false, "required": ["step", "sessions", "people"], "properties": { "step": { "enum": ["sessions", "onboarding_started", "onboarding_completed", "paywall_shown", "purchase_completed"] }, "sessions": { "type": "integer", "minimum": 0 }, "people": { "type": "integer", "minimum": 0 } } }, "funnel": { "title": "SessionFunnel", "description": "GET …/funnel?since=&platform=&internal=(getSessionFunnel)。オンボーディングから購入までを、セッションのマーク(sessions_mark)で数える。段は sessions(全部)・onboarding_started(onboarding_step のマークがある)・onboarding_completed(onboarding_step の ref が completed)・paywall_shown・purchase_completed の順で、どれも期間に始まったセッションのうちそのマークを持つ物(前の段を持つかは問わない。ペイウォールはオンボーディングの後のセッションでも出るため)。onboarding_unfinished は onboarding_step があり ref が completed の物が無いセッション、paywall_no_purchase は paywall_shown があり purchase_completed が無いセッション。既定は本人とテスターの端末を入れない", "type": "object", "additionalProperties": false, "required": ["period", "steps", "onboarding_unfinished", "paywall_no_purchase"], "properties": { "period": { "$ref": "#/$defs/period" }, "steps": { "type": "array", "minItems": 5, "maxItems": 5, "items": { "$ref": "#/$defs/funnelStep" } }, "onboarding_unfinished": { "$ref": "#/$defs/funnelDrop" }, "paywall_no_purchase": { "$ref": "#/$defs/funnelDrop" } } }, "funnelDrop": { "title": "SessionFunnelDrop", "description": "ファネルの段で抜けたセッションの数と人の数", "type": "object", "additionalProperties": false, "required": ["sessions", "people"], "properties": { "sessions": { "type": "integer", "minimum": 0 }, "people": { "type": "integer", "minimum": 0 } } }, "digestItem": { "title": "SessionDigestItem", "description": "週のまとめの1つ。sessions は例のセッション3つまで。delta は前の週との人の数の差(前の週に無ければ入れない)", "type": "object", "additionalProperties": false, "required": ["kind", "screen", "what", "people", "sessions"], "properties": { "kind": { "$ref": "#/$defs/frictionKind" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "what": { "type": "string", "minLength": 1, "maxLength": 200 }, "people": { "type": "integer", "minimum": 0 }, "sessions": { "type": "array", "maxItems": 3, "items": { "$ref": "../common.schema.json#/$defs/sessionId" } }, "delta": { "type": "integer" } } }, "digest": { "title": "SessionDigest", "description": "GET …/digest?week=(getSessionDigest)と sessions_digest の json。月曜の Cron が前の週の要約の friction から作る。items は上位10まで", "type": "object", "additionalProperties": false, "required": ["week", "created_at", "summaries", "items"], "properties": { "week": { "description": "ISO の週(2026-W47)", "type": "string", "pattern": "^\\d{4}-W(0[1-9]|[1-4]\\d|5[0-3])$" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "model": { "type": "string", "minLength": 1, "maxLength": 64 }, "summaries": { "description": "材料にした要約の数", "type": "integer", "minimum": 0 }, "items": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/digestItem" } } } }, "watchLiveRequest": { "title": "WatchLiveRequest", "description": "POST …/live(watchLive)の本文。person を書けば、その人の一番新しい install_id を見る", "type": "object", "additionalProperties": false, "properties": { "person": { "$ref": "../common.schema.json#/$defs/personId" }, "install_id": { "$ref": "../common.schema.json#/$defs/installId" } }, "oneOf": [{ "required": ["person"] }, { "required": ["install_id"] }] }, "liveWatch": { "title": "LiveWatch", "description": "watchLive の答え(sessions_live_watch の行)。until は頼んだ時刻+30分。watch_path は見る人の WebSocket の core の道(console が Service Binding の fetch でそのまま渡す)。connected は端末が今つないでいるか", "type": "object", "additionalProperties": false, "required": ["project", "install_id", "requested_by", "until", "watch_path", "connected"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "install_id": { "$ref": "../common.schema.json#/$defs/installId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "requested_by": { "type": "string", "minLength": 1, "maxLength": 128 }, "until": { "$ref": "../common.schema.json#/$defs/epochMs" }, "watch_path": { "type": "string", "pattern": "^/v1/sessions/projects/[a-z0-9-]+/live/[a-z0-9-]+$" }, "connected": { "type": "boolean" } } } } },
136
+ "sessions/batch.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/sessions/batch.schema.json", "title": "SessionBatch", "description": "POST /v1/sessions/batches(api.appgrowstack.com・公開キー)の本文。端末の SDK が前にいる間は30秒ごと(新しい出来事があれば)・裏に行った時・次の起動で送る。gzip 可・1回 256KB・出来事500件まで。session は毎回付ける(サーバーはバッチの順に頼らない)。seq はセッションの中で0から1ずつ増やし、同じ seq の2回目は捨てる。同じ session_id の end が2回来たら seq の大きい方で上書きする(MetricKit が遅れて届いた時)", "type": "object", "additionalProperties": false, "required": ["session", "seq", "events"], "properties": { "session": { "$ref": "#/$defs/session" }, "seq": { "description": "セッションの中のバッチの番号。0 が始まりのバッチ(upload_token はこの答えにだけ入る)", "type": "integer", "minimum": 0 }, "events": { "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/event" } } }, "$defs": { "session": { "title": "SessionDevice", "description": "セッションと端末の値(3.1節)。start の時の値で、セッションの間は変えない", "type": "object", "additionalProperties": false, "required": ["session_id", "started_at", "install_id", "platform", "app_version", "build", "channel", "lang", "region", "time_zone", "os_version", "device_model", "screen", "sdk_version"], "properties": { "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "started_at": { "description": "セッションが始まった時刻。出来事の t はここからのミリ秒", "$ref": "../common.schema.json#/$defs/epochMs" }, "install_id": { "$ref": "../common.schema.json#/$defs/installId" }, "uid": { "description": "アプリのアカウントの id。あれば", "$ref": "../common.schema.json#/$defs/uid" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "type": "string", "minLength": 1, "maxLength": 32 }, "channel": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "region": { "description": "端末の地域(JP・US)", "type": "string", "pattern": "^[A-Z0-9]{2,3}$" }, "time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "os_version": { "description": "OS のバージョン(26.1・15)", "type": "string", "minLength": 1, "maxLength": 32 }, "device_model": { "description": "端末の型(iPhone17,1・Pixel 9)", "type": "string", "minLength": 1, "maxLength": 64 }, "screen": { "description": "画面の大きさ(pt・Android は dp)と倍率", "type": "object", "additionalProperties": false, "required": ["w", "h", "scale"], "properties": { "w": { "type": "number", "exclusiveMinimum": 0 }, "h": { "type": "number", "exclusiveMinimum": 0 }, "scale": { "type": "number", "exclusiveMinimum": 0, "maximum": 8 } } }, "sdk_version": { "description": "SDK(swift-app-sdk・kotlin-app-sdk)のバージョン", "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" } } }, "t": { "title": "SessionTime", "description": "セッションの始まりからのミリ秒", "type": "integer", "minimum": 0 }, "foregroundMs": { "title": "SessionForegroundMs", "description": "セッションの始まりからその時までに、アプリが前に出ていたミリ秒の合計(裏にいた間を除く)。古い SDK は送らない", "type": "integer", "minimum": 0 }, "endReason": { "title": "SessionEndReason", "description": "セッションの終わり方(3.1節の表)。background_timeout=裏に30分(終わりの時刻は裏に行った時刻)・user_closed=Android の REASON_USER_REQUESTED・crashed=動いているのフラグが残りクラッシュの診断がある・hung=フラグが残り最後が hang か REASON_ANR・killed=フラグが残りほかのどれでもない・unknown=前のセッションの記録が端末に無い", "enum": ["background_timeout", "user_closed", "crashed", "hung", "killed", "unknown"] }, "markKind": { "title": "SessionMarkKind", "description": "マークになる出来事の種類。SDK が event から作り、サーバーの索引(sessions_mark)になる。core も受けた event の名前から作る(notification_opened → notify_opened・trial_started と reverse_trial_started → trial_started・trial_ended と reverse_trial_ended → trial_ended。docs/design/sessions.md 3.5節)", "enum": ["campaign_shown", "campaign_eligible", "paywall_shown", "purchase_completed", "ticket", "notify_opened", "onboarding_step", "trial_started", "trial_ended"] }, "screenVia": { "title": "SessionScreenVia", "description": "画面にどう入ったか。直前の画面と戻る操作から決める。シートを閉じて下の画面に戻ったのは pop", "enum": ["launch", "push", "pop", "tab", "sheet", "unknown"] }, "backVia": { "title": "SessionBackVia", "description": "戻った操作。gesture=端から払う・button=戻るのボタンやシートの閉じる・system=Android の戻るのキーと払う操作", "enum": ["gesture", "button", "system"] }, "orientation": { "title": "SessionOrientation", "description": "窓の向き。窓の幅が高さより大きければ landscape(iPad の分割の窓も窓の形で決める)", "enum": ["portrait", "landscape"] }, "targetName": { "title": "SessionTargetName", "description": ".sessionTarget(\"…\") を付けた要素の名前", "type": "string", "pattern": "^[a-z][a-z0-9_]{0,47}$" }, "replayStopReason": { "title": "ReplayStopReason", "description": "録画を止めた理由。low_power=Low Power Mode・thermal=発熱が serious 以上・battery=電池20%未満で充電していない・degraded=撮るのが重い(p95 が33ミリ秒を超えた)・session_limit=1つのセッションの30分か20MB・disabled=方針で撮らない・storage=端末の溜めの上限", "enum": ["low_power", "thermal", "battery", "degraded", "session_limit", "disabled", "storage"] }, "eventProps": { "title": "SessionEventProps", "description": "残した props(9.4節)。値は48文字までの文字列・数・真偽だけ", "type": "object", "maxProperties": 32, "propertyNames": { "pattern": "^[a-z][a-z0-9_]{0,63}$" }, "additionalProperties": { "type": ["string", "number", "boolean"], "maxLength": 48 } }, "event": { "title": "SessionEvent", "description": "セッションの1つの出来事。k で形が分かれる(3.1節の表)", "oneOf": [{ "$ref": "#/$defs/startEvent" }, { "$ref": "#/$defs/screenEvent" }, { "$ref": "#/$defs/tapEvent" }, { "$ref": "#/$defs/rageEvent" }, { "$ref": "#/$defs/deadEvent" }, { "$ref": "#/$defs/backEvent" }, { "$ref": "#/$defs/quickBackEvent" }, { "$ref": "#/$defs/scrollEvent" }, { "$ref": "#/$defs/keyboardEvent" }, { "$ref": "#/$defs/appEvent" }, { "$ref": "#/$defs/markEvent" }, { "$ref": "#/$defs/hangEvent" }, { "$ref": "#/$defs/backgroundEvent" }, { "$ref": "#/$defs/foregroundEvent" }, { "$ref": "#/$defs/endEvent" }, { "$ref": "#/$defs/replayStatsEvent" }] }, "startEvent": { "title": "SessionStartEvent", "description": "セッションの始まり(t は0)。アプリが前に出た時に始まる(裏での起動では始めない)。previous_end は前のセッションの終わり方。前のセッションの記録が無ければ unknown。first は、この SDK がこの端末で記録する最初のセッション(入れ直した後も最初)。アプリの初回の起動ではない(SDK を入れたバージョンに上げた前からの利用者でも true)。新しい人かは first_open で決める(core が閉じる時に見る。docs/design/sessions.md 3.5節)", "type": "object", "additionalProperties": false, "required": ["k", "t", "previous_end", "first"], "properties": { "k": { "const": "start" }, "t": { "$ref": "#/$defs/t" }, "previous_end": { "$ref": "#/$defs/endReason" }, "previous_session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "first": { "type": "boolean" } } }, "screenEvent": { "title": "SessionScreenEvent", "description": "画面に入った。swift-analytics の screen_viewed から。w・h は窓の大きさ(pt・dp)", "type": "object", "additionalProperties": false, "required": ["k", "t", "screen", "via", "w", "h", "orientation"], "properties": { "k": { "const": "screen" }, "t": { "$ref": "#/$defs/t" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "via": { "$ref": "#/$defs/screenVia" }, "w": { "type": "number", "exclusiveMinimum": 0 }, "h": { "type": "number", "exclusiveMinimum": 0 }, "orientation": { "$ref": "#/$defs/orientation" } } }, "tapEvent": { "title": "SessionTapEvent", "description": "指を離した。x・y は窓の幅と高さに対する割合(0〜10000)", "type": "object", "additionalProperties": false, "required": ["k", "t", "x", "y", "screen"], "properties": { "k": { "const": "tap" }, "t": { "$ref": "#/$defs/t" }, "x": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "y": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "target": { "$ref": "#/$defs/targetName" } } }, "rageEvent": { "title": "SessionRageEvent", "description": "1秒以内に半径30pt に3回以上のタップ。t は3回目のタップの時刻、x・y は最初のタップの位置、count は塊の全部のタップの数", "type": "object", "additionalProperties": false, "required": ["k", "t", "x", "y", "count", "screen"], "properties": { "k": { "const": "rage" }, "t": { "$ref": "#/$defs/t" }, "x": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "y": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "count": { "type": "integer", "minimum": 3 }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" } } }, "deadEvent": { "title": "SessionDeadEvent", "description": "タップの後1.5秒、画面の遷移もアプリの出来事も無く、コマの指紋も変わらなかった。t はタップの時刻。録画を撮っていない時は出さない", "type": "object", "additionalProperties": false, "required": ["k", "t", "x", "y", "screen"], "properties": { "k": { "const": "dead" }, "t": { "$ref": "#/$defs/t" }, "x": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "y": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" } } }, "backEvent": { "title": "SessionBackEvent", "description": "戻った。screen は戻る前の画面。続けて戻った先の screen(via pop)が来る", "type": "object", "additionalProperties": false, "required": ["k", "t", "screen", "via"], "properties": { "k": { "const": "back" }, "t": { "$ref": "#/$defs/t" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "via": { "$ref": "#/$defs/backVia" } } }, "quickBackEvent": { "title": "SessionQuickBackEvent", "description": "画面に入って2秒以内(2000ミリ秒を含む)に戻った。ms は入ってから戻るまで", "type": "object", "additionalProperties": false, "required": ["k", "t", "screen", "ms"], "properties": { "k": { "const": "quick_back" }, "t": { "$ref": "#/$defs/t" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "ms": { "type": "integer", "minimum": 0, "maximum": 2000 } } }, "scrollEvent": { "title": "SessionScrollEvent", "description": "画面を離れるとき1回。max_ratio は見えた所の下の端の深さの最大(0〜10000)。list と max_row は .sessionScroll(\"名前\") を付けた一覧だけ", "type": "object", "additionalProperties": false, "required": ["k", "t", "screen", "max_ratio"], "properties": { "k": { "const": "scroll" }, "t": { "$ref": "#/$defs/t" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "list": { "$ref": "#/$defs/targetName" }, "max_ratio": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "max_row": { "type": "integer", "minimum": 0 } } }, "keyboardEvent": { "title": "SessionKeyboardEvent", "type": "object", "additionalProperties": false, "required": ["k", "t", "shown"], "properties": { "k": { "const": "keyboard" }, "t": { "$ref": "#/$defs/t" }, "shown": { "type": "boolean" } } }, "appEvent": { "title": "SessionAppEvent", "description": "アプリの出来事(swift-analytics の流れ)。props は 9.4節の決まりで残した物だけ。48文字を超える文字列を捨てた時は props_dropped: true", "type": "object", "additionalProperties": false, "required": ["k", "t", "name"], "properties": { "k": { "const": "event" }, "t": { "$ref": "#/$defs/t" }, "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "props": { "$ref": "#/$defs/eventProps" }, "props_dropped": { "const": true } } }, "markEvent": { "title": "SessionMarkEvent", "description": "マーク。ref は件の id(campaign_*)・ペイウォールの source(paywall_shown)・商品の id(purchase_completed)・問い合わせの id(ticket)・通知の id(notify_opened)・段の名前(onboarding_step。終えた時は completed)・出来事の名前(trial_started・trial_ended)。side は campaign_* だけ", "type": "object", "additionalProperties": false, "required": ["k", "t", "kind", "ref"], "properties": { "k": { "const": "mark" }, "t": { "$ref": "#/$defs/t" }, "kind": { "$ref": "#/$defs/markKind" }, "ref": { "type": "string", "minLength": 1, "maxLength": 80 }, "side": { "$ref": "../experiment/holdout.schema.json#/$defs/side" } } }, "hangEvent": { "title": "SessionHangEvent", "description": "メインスレッドが2秒以上返らなかった。t は止まり始めた時刻", "type": "object", "additionalProperties": false, "required": ["k", "t", "ms"], "properties": { "k": { "const": "hang" }, "t": { "$ref": "#/$defs/t" }, "ms": { "type": "integer", "minimum": 2000 } } }, "backgroundEvent": { "title": "SessionBackgroundEvent", "description": "裏へ行った。foreground_ms はここまでに前に出ていた時間の合計", "type": "object", "additionalProperties": false, "required": ["k", "t"], "properties": { "k": { "const": "background" }, "t": { "$ref": "#/$defs/t" }, "foreground_ms": { "$ref": "#/$defs/foregroundMs" } } }, "foregroundEvent": { "title": "SessionForegroundEvent", "description": "裏にいたのが30分より短く、同じセッションのまま前へ戻った", "type": "object", "additionalProperties": false, "required": ["k", "t"], "properties": { "k": { "const": "foreground" }, "t": { "$ref": "#/$defs/t" } } }, "endEvent": { "title": "SessionEndEvent", "description": "セッションが終わった。background_timeout の t は裏に行った時刻。次の起動で決めた終わり方の t は最後の出来事の時刻。foreground_ms は始まりから t までに前に出ていた時間の合計(セッションの長さ)", "type": "object", "additionalProperties": false, "required": ["k", "t", "reason"], "properties": { "k": { "const": "end" }, "t": { "$ref": "#/$defs/t" }, "reason": { "$ref": "#/$defs/endReason" }, "foreground_ms": { "$ref": "#/$defs/foregroundMs" } } }, "replayStatsEvent": { "title": "SessionReplayStatsEvent", "description": "送るバッチごとの録画の数(前のバッチからの分)。監視(7.6節)が読む", "type": "object", "additionalProperties": false, "required": ["k", "t", "captured", "dropped", "main_ms_p50", "main_ms_p95"], "properties": { "k": { "const": "replay_stats" }, "t": { "$ref": "#/$defs/t" }, "captured": { "description": "画像を入れたコマの数", "type": "integer", "minimum": 0 }, "dropped": { "description": "画像を入れなかったコマの数。same=前と同じ・masking_failed=隠す範囲を作れなかった・no_capture=撮らない画面・secure=FLAG_SECURE の窓", "type": "object", "additionalProperties": false, "required": ["same", "masking_failed", "no_capture", "secure"], "properties": { "same": { "type": "integer", "minimum": 0 }, "masking_failed": { "type": "integer", "minimum": 0 }, "no_capture": { "type": "integer", "minimum": 0 }, "secure": { "type": "integer", "minimum": 0 } } }, "main_ms_p50": { "description": "1回の撮影のメインスレッドの時間(ミリ秒)", "type": "number", "minimum": 0 }, "main_ms_p95": { "type": "number", "minimum": 0 }, "stopped": { "$ref": "#/$defs/replayStopReason" } } }, "answer": { "title": "SessionBatchAnswer", "description": "POST /v1/sessions/batches の 200 の答え。features.sessions が off か paused なら 204(本文なし・端末は溜めた物を消す)。replay は5節の4の判断(端末は答えが来るまで buffer として振る舞う)。方針の replay.enabled が false なら replay は buffer で、端末は撮らない", "type": "object", "additionalProperties": false, "required": ["replay"], "properties": { "replay": { "description": "record=録画を全部送る・buffer=直近60秒だけを残し、優先の条件に当たったら送る", "enum": ["record", "buffer"] }, "policy": { "description": "端末の持つバージョンと違う時だけ", "$ref": "manifest.schema.json#/$defs/policy" }, "upload_token": { "description": "始まりのバッチ(seq 0)の答えだけ。<until>.<hex>。until は Unix 秒(セッションの始まり+8日)、hex は HMAC-SHA256(SESSION_TOKEN_SECRET, \"upload:<project>:<session_id>:<install_id>:<until>\")。塊の PUT の X-Session-Upload に付け、X-Session-Install に同じ install_id を付ける。until を過ぎたら 403(packages/contract の sessions.ts)", "type": "string", "pattern": "^[0-9]{10}\\.[0-9a-f]{64}$" }, "live": { "$ref": "#/$defs/liveOffer" } } }, "liveOffer": { "title": "SessionLiveOffer", "description": "見る人がこの端末を待っている。端末は url を token(Sec-WebSocket-Protocol)付きで開き、つないでいる間はバッチの間隔を5秒にする", "type": "object", "additionalProperties": false, "required": ["token", "url"], "properties": { "token": { "description": "<until>.<hex>。until は見る人の待ちが切れる Unix 秒(10桁)、hex は HMAC-SHA256(SESSION_TOKEN_SECRET, \"live:<project>:<install_id>:<until>\")。端末は Sec-WebSocket-Protocol にそのまま入れ、X-Session-Install に install_id を付ける", "type": "string", "pattern": "^[0-9]{10}\\.[0-9a-f]{64}$" }, "url": { "description": "wss://api.appgrowstack.com/v1/sessions/live", "type": "string", "pattern": "^wss://[^\\s]+$", "maxLength": 2048 } } } } },
137
+ "sessions/case.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/sessions/case.schema.json", "title": "SessionCase", "description": "schema/cases/sessions/*.json の1つの判定の表(9.6節)。Swift(SessionsCore)・Kotlin(sessions-core)・TypeScript(packages/session-rules)が同じ答えで通す(aggregate は TypeScript だけ)。rule で input と expect の形が分かれる。表の名前は <rule の kebab-case>-<件>.json", "type": "object", "required": ["rule", "description", "input", "expect"], "oneOf": [{ "$ref": "#/$defs/split" }, { "$ref": "#/$defs/rage" }, { "$ref": "#/$defs/dead" }, { "$ref": "#/$defs/quickBack" }, { "$ref": "#/$defs/end" }, { "$ref": "#/$defs/scroll" }, { "$ref": "#/$defs/tapNormalize" }, { "$ref": "#/$defs/maskRects" }, { "$ref": "#/$defs/sampling" }, { "$ref": "#/$defs/keepProps" }, { "$ref": "#/$defs/segment" }, { "$ref": "#/$defs/aggregate" }], "$defs": { "rule": { "title": "SessionCaseRule", "enum": ["split", "rage", "dead", "quick_back", "end", "scroll", "tap_normalize", "mask_rects", "sampling", "keep_props", "segment", "aggregate"] }, "description": { "type": "string", "minLength": 1 }, "pt": { "type": "number" }, "rect": { "title": "SessionCaseRect", "description": "枠(x・y は左上)", "type": "object", "additionalProperties": false, "required": ["x", "y", "w", "h"], "properties": { "x": { "type": "number" }, "y": { "type": "number" }, "w": { "type": "number", "minimum": 0 }, "h": { "type": "number", "minimum": 0 } } }, "split": { "title": "SessionSplitCase", "description": "前に出た・裏に行った時刻の列 → セッションの区切り。launch はいつも新しいセッション。foreground は、直前の background から1800000ミリ秒(30分ちょうどを含む)以上たっていれば新しいセッション、それより短ければ同じセッション。裏に30分いて終わったセッションの end は裏に行った時刻で by は background_timeout。launch で終わったセッションの end は null(終わり方は次の起動の end の決まりで決める)で by は launch。最後のセッションは end も by も null。日付が変わっても区切らない", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "split" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["steps"], "properties": { "time_zone": { "$ref": "../common.schema.json#/$defs/timeZone" }, "steps": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["t", "k"], "properties": { "t": { "$ref": "../common.schema.json#/$defs/epochMs" }, "k": { "enum": ["launch", "background", "foreground"] } } } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["session_of_step", "sessions"], "properties": { "session_of_step": { "description": "steps の各行が何番目のセッション(0から)に入るか", "type": "array", "items": { "type": "integer", "minimum": 0 } }, "sessions": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["start", "end", "by"], "properties": { "start": { "$ref": "../common.schema.json#/$defs/epochMs" }, "end": { "oneOf": [{ "$ref": "../common.schema.json#/$defs/epochMs" }, { "type": "null" }] }, "by": { "enum": ["background_timeout", "launch", null] } } } } } } } }, "rage": { "title": "SessionRageCase", "description": "タップの列(時刻はミリ秒・位置は窓の中の pt)→ rage。最初のタップを起点にした塊を作り、次のタップが起点から1000ミリ秒以内(1000を含む)で起点から30pt 以内(ユークリッドの距離・30を含む)なら塊に入れる。入らないタップは今の塊を閉じて新しい塊の起点になる。閉じた塊(最後の塊も)のタップが3回以上なら rage を1つ: t は塊の3回目のタップの時刻、x・y は起点の位置を tap-normalize の式で 0〜10000 にした物、count は塊のタップの数", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "rage" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["window", "taps"], "properties": { "window": { "type": "object", "additionalProperties": false, "required": ["w", "h"], "properties": { "w": { "type": "number", "exclusiveMinimum": 0 }, "h": { "type": "number", "exclusiveMinimum": 0 } } }, "taps": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["t", "x", "y"], "properties": { "t": { "type": "integer", "minimum": 0 }, "x": { "$ref": "#/$defs/pt" }, "y": { "$ref": "#/$defs/pt" } } } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["rage"], "properties": { "rage": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["t", "x", "y", "count"], "properties": { "t": { "type": "integer", "minimum": 0 }, "x": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "y": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "count": { "type": "integer", "minimum": 3 } } } } } } } }, "dead": { "title": "SessionDeadCase", "description": "1つのタップ → dead を出すか。録画を撮っていない(capturing が false)なら出さない。タップの後 (t, t+1500](1500ミリ秒を含む)に screen か event が1つでもあれば出さない。その間に frame(image か same のコマ)が1つも無ければ確かめられないので出さない。frame の指紋が1つでも fingerprint_before と違えば出さない。それ以外は dead(t はタップの時刻)", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "dead" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["capturing", "tap", "fingerprint_before", "after"], "properties": { "capturing": { "type": "boolean" }, "tap": { "type": "object", "additionalProperties": false, "required": ["t", "x", "y", "screen"], "properties": { "t": { "type": "integer", "minimum": 0 }, "x": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "y": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" } } }, "fingerprint_before": { "description": "タップの前の最後のコマの指紋(16×32 の明るさの hex)", "type": "string", "pattern": "^[0-9a-f]+$" }, "after": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["t", "k"], "properties": { "t": { "type": "integer", "minimum": 0 }, "k": { "enum": ["screen", "event", "frame"] }, "fingerprint": { "type": "string", "pattern": "^[0-9a-f]+$" } } } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["dead"], "properties": { "dead": { "type": "boolean" } } } } }, "quickBack": { "title": "SessionQuickBackCase", "description": "画面の動きの列 → screen・back・quick_back の出来事。op: launch=起動の最初の画面(via launch)・push=進む(via push)・tab=タブを替えた(via tab・戻るではない)・sheet=シートを出した(via sheet)・pop=戻った・dismiss=シートを閉じた。pop と dismiss は戻る: 同じ t で back(screen は離れた画面・via は by。書かなければ button)、入ってから2000ミリ秒以内(2000を含む)なら quick_back(ms は入ってから戻るまで)、戻った先の screen(via pop)の順に出す", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "quick_back" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["nav"], "properties": { "nav": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["t", "op", "screen"], "properties": { "t": { "type": "integer", "minimum": 0 }, "op": { "enum": ["launch", "push", "tab", "sheet", "pop", "dismiss"] }, "screen": { "description": "動いた後に出ている画面", "$ref": "../common.schema.json#/$defs/screenName" }, "by": { "$ref": "batch.schema.json#/$defs/backVia" } } } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["events"], "properties": { "events": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["k", "t", "screen"], "properties": { "k": { "enum": ["screen", "back", "quick_back"] }, "t": { "type": "integer", "minimum": 0 }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "via": { "enum": ["launch", "push", "pop", "tab", "sheet", "unknown", "gesture", "button", "system"] }, "ms": { "type": "integer", "minimum": 0, "maximum": 2000 } } } } } } } }, "end": { "title": "SessionEndCase", "description": "次の起動で前のセッションの end.reason を決める。順に: 前のセッションの記録が無い → unknown。Android で exit_reason が REASON_USER_REQUESTED → user_closed。running_flag が無い(裏に行ってフラグを消した)→ background_timeout(裏で落ちても同じ)。フラグが残っていて: クラッシュの診断(iOS は metrickit_crash、Android の API 30 からは REASON_CRASH・REASON_CRASH_NATIVE、API 30 より前は crash_handler)→ crashed、最後の出来事が hang か REASON_ANR → hung、API 30 より前の Android でほかに分からない → unknown、それ以外 → killed。late_metrickit_crash は起動の後に遅れて届いた MetricKit のクラッシュの診断で、届いたら revised に直した終わり方を書く(SDK は end を直すバッチをもう1回送る)", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "end" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["platform", "previous_record", "running_flag"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "android_api": { "description": "Android だけ。書かなければ 30 以上", "type": "integer", "minimum": 26 }, "previous_record": { "description": "前のセッションの記録が端末にある", "type": "boolean" }, "running_flag": { "description": "「動いている」のフラグが残っている", "type": "boolean" }, "last_event": { "description": "前のセッションの最後の出来事の k", "type": "string", "pattern": "^[a-z_]+$" }, "metrickit_crash": { "description": "iOS。起動の時にもうクラッシュの診断が届いている", "type": "boolean" }, "late_metrickit_crash": { "description": "iOS。起動の後に遅れてクラッシュの診断が届いた", "type": "boolean" }, "exit_reason": { "description": "Android の ApplicationExitInfo の一番新しい理由(API 30 から)", "enum": ["REASON_USER_REQUESTED", "REASON_CRASH", "REASON_CRASH_NATIVE", "REASON_ANR", "REASON_LOW_MEMORY", "REASON_SIGNALED", "REASON_EXIT_SELF", "REASON_OTHER", "REASON_UNKNOWN"] }, "crash_handler": { "description": "Android の API 30 より前。SDK のクラッシュの受け手が前のセッションで記録を書いた", "type": "boolean" } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["reason"], "properties": { "reason": { "$ref": "batch.schema.json#/$defs/endReason" }, "revised": { "$ref": "batch.schema.json#/$defs/endReason" } } } } }, "scroll": { "title": "SessionScrollCase", "description": "コマを撮るたびのスクロールの形の列 → max_ratio・max_row。1つの形の深さは content_height が height 以下なら 10000、それ以外は floor((offset_y + height) × 10000 / content_height) を 0〜10000 に収めた物。max_ratio は全部の形の最大。max_row は row を書いた形の row の最大で、row が1つも無ければ書かない", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "scroll" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["samples"], "properties": { "samples": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["offset_y", "height", "content_height"], "properties": { "offset_y": { "type": "number" }, "height": { "type": "number", "exclusiveMinimum": 0 }, "content_height": { "type": "number", "minimum": 0 }, "row": { "type": "integer", "minimum": 0 } } } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["max_ratio"], "properties": { "max_ratio": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "max_row": { "type": "integer", "minimum": 0 } } } } }, "tapNormalize": { "title": "SessionTapNormalizeCase", "description": "画面の pt のタップと窓の枠(画面の pt)→ 0〜10000 と升の番号。窓の中の位置 lx = tap.x − window.x・ly = tap.y − window.y。x = round(lx × 10000 / window.w)、y = round(ly × 10000 / window.h)(round は .5 を上へ)を 0〜10000 に収める。orientation は window.w > window.h なら landscape、それ以外は portrait(iPad の分割の窓も窓の形で決める)。升は幅を40・高さを80に分けた物: col = min(39, floor(x × 40 / 10000))・row = min(79, floor(y × 80 / 10000))・cell = row × 40 + col(0〜3199)", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "tap_normalize" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["tap", "window"], "properties": { "tap": { "type": "object", "additionalProperties": false, "required": ["x", "y"], "properties": { "x": { "$ref": "#/$defs/pt" }, "y": { "$ref": "#/$defs/pt" } } }, "window": { "$ref": "#/$defs/rect" } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["x", "y", "orientation", "col", "row", "cell"], "properties": { "x": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "y": { "$ref": "../common.schema.json#/$defs/fraction10k" }, "orientation": { "$ref": "batch.schema.json#/$defs/orientation" }, "col": { "type": "integer", "minimum": 0, "maximum": 39 }, "row": { "type": "integer", "minimum": 0, "maximum": 79 }, "cell": { "type": "integer", "minimum": 0, "maximum": 3199 } } } } }, "maskRects": { "title": "SessionMaskRectsCase", "description": "隠す view の枠(窓の pt)と倍率 → 塗る画素の枠(縮める前の本来の倍率の画像)。外向きに丸める: x0 = floor(x × scale)・y0 = floor(y × scale)・x1 = ceil((x + w) × scale)・y1 = ceil((y + h) × scale)。画像の外 [0, image.w]×[0, image.h] を切り、幅か高さが0になった枠は捨てる。重なった枠はまとめず、入力の順のまま返す。rects に null(マークの位置が取れなかった)が1つでもあれば、コマを捨てる(drop: true・reason masking_failed・rects は空)", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "mask_rects" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["scale", "image", "rects"], "properties": { "scale": { "type": "number", "exclusiveMinimum": 0 }, "image": { "type": "object", "additionalProperties": false, "required": ["w", "h"], "properties": { "w": { "type": "integer", "minimum": 1 }, "h": { "type": "integer", "minimum": 1 } } }, "rects": { "type": "array", "items": { "oneOf": [{ "$ref": "#/$defs/rect" }, { "type": "null" }] } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["drop", "rects"], "properties": { "drop": { "type": "boolean" }, "reason": { "const": "masking_failed" }, "rects": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["x", "y", "w", "h"], "properties": { "x": { "type": "integer", "minimum": 0 }, "y": { "type": "integer", "minimum": 0 }, "w": { "type": "integer", "minimum": 1 }, "h": { "type": "integer", "minimum": 1 } } } } } } } }, "priorityReason": { "title": "SessionPriorityReason", "description": "優先の条件(5節)。rage=rage が1回以上・dead=dead が3回以上・hang=hang が1回以上・ticket=mark ticket・campaign_quick_end=campaign_shown の後60000ミリ秒以内(含む)に end・paywall_no_purchase=paywall_shown の後、purchase_completed が無いまま出来事 paywall_closed か end が来た・onboarding_unfinished=最初のセッション(start.first)で mark onboarding_step の ref completed が無いまま end", "enum": ["rage", "dead", "hang", "ticket", "campaign_quick_end", "paywall_no_purchase", "onboarding_unfinished"] }, "sampling": { "title": "SessionSamplingCase", "description": "送るかの判断(5節の順)。1: feature が off か paused → accept false(204)・ほかは全部 null か false。2: replay.enabled が false → answer buffer・capture false・upload none・session_replay none(優先の条件も見ない)。3: internal → answer record・upload all・session_replay record(数えない)。4: recorded_today < daily_cap で hash32(\"<project>:<session_id>:replay\") / 2^32 < sample → answer record・upload all・session_replay record。5: それ以外 → answer buffer。優先の条件に events の順で最初に当たった時刻を hit_t とし、upload buffered・upload_from_t = max(0, hit_t − 60000)・session_replay priority。当たらなければ upload none・session_replay buffer。priority は当たった条件の全部(enum の順)で、record の時も書く。hash は4で recorded_today < daily_cap だった時(式を計算した時)だけ書く。previous_session_upload は start.previous_end が crashed・hung・killed で、1・2 で止まっていない時に true(前のセッションの残った塊を送る)", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "sampling" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["project", "session_id", "feature", "replay", "internal", "recorded_today", "events"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "feature": { "description": "features.sessions とプロジェクトの状態", "enum": ["on", "off", "paused"] }, "replay": { "type": "object", "additionalProperties": false, "required": ["enabled", "sample", "daily_cap"], "properties": { "enabled": { "type": "boolean" }, "sample": { "type": "number", "minimum": 0, "maximum": 1 }, "daily_cap": { "type": "integer", "minimum": 0 } } }, "internal": { "description": "本人とテスターの端末", "type": "boolean" }, "recorded_today": { "description": "その日(UTC)に全部送ったセッションの数(sessions_daily.recorded)", "type": "integer", "minimum": 0 }, "events": { "description": "セッションの出来事の全部(start から)", "type": "array", "items": { "$ref": "batch.schema.json#/$defs/event" } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["accept", "answer", "capture", "upload", "priority", "previous_session_upload", "session_replay"], "properties": { "accept": { "type": "boolean" }, "answer": { "enum": ["record", "buffer", null] }, "capture": { "type": "boolean" }, "hash": { "type": "integer", "minimum": 0, "maximum": 4294967295 }, "upload": { "enum": ["none", "all", "buffered"] }, "upload_from_t": { "type": "integer", "minimum": 0 }, "priority": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/priorityReason" } }, "previous_session_upload": { "type": "boolean" }, "session_replay": { "oneOf": [{ "$ref": "admin.schema.json#/$defs/replayState" }, { "type": "null" }] } } } } }, "keepProps": { "title": "SessionKeepPropsCase", "description": "アプリの出来事 → 残す props(9.4節)。source common(swift-analytics の共通のカタログ)と、名前が campaign_・campaigns_ で始まる物は全部、keep_props に名前がある出来事は書いた名前だけ、それ以外は空。その後、残した値のうち48文字(UTF-16 の符号の数)を超える文字列は値ごと捨て、props_dropped を true にする。48文字ちょうどは残す。値は文字列・数・真偽だけを残し、ほかの型は捨てる(props_dropped にはしない)", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "keep_props" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["source", "name", "props", "keep_props"], "properties": { "source": { "enum": ["common", "app"] }, "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "props": { "type": "object" }, "keep_props": { "$ref": "manifest.schema.json#/$defs/events/properties/keep_props" } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["props", "props_dropped"], "properties": { "props": { "$ref": "batch.schema.json#/$defs/eventProps" }, "props_dropped": { "type": "boolean" } } } } }, "segment": { "title": "SessionSegmentCase", "description": "塊の2進(base64)を読む → 頭と画像(base64・frames の image の順)か、読めない理由。書く側は頭と画像から同じ形を作り、読み直して同じ頭と画像になること(頭の JSON のキーの順と空白は決めない)。読めない理由: bad_magic=最初の4バイトが AGSR でない・bad_version=バージョンが1でない・bad_length=頭の長さが本文に収まらない・bad_header=頭が JSON でないか ReplaySegmentHeader に合わない・bad_frame_range=image の offset と length が画像の所に収まらないか、frames の順に隙間なく並んでいない・too_large=1MB(1048576バイト)を超える", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "segment" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["bytes"], "properties": { "bytes": { "type": "string", "contentEncoding": "base64" } } }, "expect": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["header", "images"], "properties": { "header": { "$ref": "segment.schema.json" }, "images": { "type": "array", "items": { "type": "string", "contentEncoding": "base64" } } } }, { "type": "object", "additionalProperties": false, "required": ["error"], "properties": { "error": { "enum": ["bad_magic", "bad_version", "bad_length", "bad_header", "bad_frame_range", "too_large"] } } }] } } }, "aggregateScreenDay": { "title": "SessionAggregateScreenDay", "description": "sessions_screen_day に足す数。dwell_ms は画面に入ってから次の screen か end までの、裏にいた間を除いたミリ秒を views の順に並べた物(ms_p50・ms_p90 はこれから日の仕事が作る)。scroll_hist はその画面の scroll の max_ratio を floor(max_ratio / 1000)(10000 は 9)の10の箱に数えた物。end_reasons は exit の時だけ", "type": "object", "additionalProperties": false, "required": ["day", "platform", "screen", "views", "people", "exits", "end_reasons", "quick_backs", "backs", "rage", "dead", "taps", "dwell_ms", "scroll_hist"], "properties": { "day": { "$ref": "../common.schema.json#/$defs/day" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "views": { "type": "integer", "minimum": 0 }, "people": { "type": "integer", "minimum": 0, "maximum": 1 }, "exits": { "type": "integer", "minimum": 0, "maximum": 1 }, "end_reasons": { "type": "object", "propertyNames": { "$ref": "batch.schema.json#/$defs/endReason" }, "additionalProperties": { "type": "integer", "minimum": 1 } }, "quick_backs": { "type": "integer", "minimum": 0 }, "backs": { "type": "integer", "minimum": 0 }, "rage": { "type": "integer", "minimum": 0 }, "dead": { "type": "integer", "minimum": 0 }, "taps": { "type": "integer", "minimum": 0 }, "dwell_ms": { "type": "array", "items": { "type": "integer", "minimum": 0 } }, "scroll_hist": { "type": "array", "minItems": 10, "maxItems": 10, "items": { "type": "integer", "minimum": 0 } } } }, "aggregate": { "title": "SessionAggregateCase", "description": "TypeScript だけ(packages/session-rules の aggregate)。閉じる consumer が1セッションの出来事の列から作る物。already_closed(sessions_session.ended_at がある)なら skip true で何も足さない。internal は session の行だけを作り、*_day・tap_cell・path_* には足さない。day はセッションの始まりの UTC の日。screen の出来事の前の出来事の画面は unknown で、unknown もほかの画面と同じに数える。screens は screen の出来事の数。duration_ms は end の t(end が無ければ最後の出来事の t)から裏にいた間を引いた物。end が無ければ end_reason は unknown。exit_screen は最後の screen の画面。tap_cell の向きは直前の screen の orientation(無ければ portrait)で、升は tap-normalize の式。path_day は続く2つの screen の画面が違う時だけ1つ足す。path_top は続く同じ画面をまとめた最初の5画面を > でつないだ物で、画面が5つ以下で終わったら ended_here 1。people は person_today(この人がその日にもう数えた画面と道)に無い時だけ1。entry_screen と exit_screen は最初と最後の screen の出来事の画面(screen の出来事が無ければ null)。並びは screen_day が画面の名前の順、tap_cell が画面・向き・cell の順、path_day が from_screen・to_screen の順", "type": "object", "additionalProperties": false, "required": ["rule", "description", "input", "expect"], "properties": { "rule": { "const": "aggregate" }, "description": { "$ref": "#/$defs/description" }, "input": { "type": "object", "additionalProperties": false, "required": ["session", "already_closed", "person_today", "events"], "properties": { "session": { "type": "object", "additionalProperties": false, "required": ["id", "project", "person_id", "install_id", "platform", "app_version", "channel", "internal", "started_at", "last_at"], "properties": { "id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "install_id": { "$ref": "../common.schema.json#/$defs/installId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "channel": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "internal": { "type": "boolean" }, "started_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "last_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "already_closed": { "type": "boolean" }, "person_today": { "type": "object", "additionalProperties": false, "required": ["screens", "paths"], "properties": { "screens": { "type": "array", "items": { "$ref": "../common.schema.json#/$defs/screenName" } }, "paths": { "description": "<前の画面>><次の画面>", "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9_]*>[a-z][a-z0-9_]*$" } } } }, "events": { "type": "array", "items": { "$ref": "batch.schema.json#/$defs/event" } } } }, "expect": { "type": "object", "additionalProperties": false, "required": ["skip", "screen_day", "tap_cell", "path_day", "path_top"], "properties": { "skip": { "type": "boolean" }, "session": { "description": "sessions_session に書く値(skip の時は無い)", "type": "object", "additionalProperties": false, "required": ["ended_at", "end_reason", "duration_ms", "screens", "taps", "rage", "dead", "quick_backs", "hangs", "backs", "entry_screen", "exit_screen"], "properties": { "ended_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "end_reason": { "$ref": "batch.schema.json#/$defs/endReason" }, "duration_ms": { "type": "integer", "minimum": 0 }, "screens": { "type": "integer", "minimum": 0 }, "taps": { "type": "integer", "minimum": 0 }, "rage": { "type": "integer", "minimum": 0 }, "dead": { "type": "integer", "minimum": 0 }, "quick_backs": { "type": "integer", "minimum": 0 }, "hangs": { "type": "integer", "minimum": 0 }, "backs": { "type": "integer", "minimum": 0 }, "entry_screen": { "oneOf": [{ "$ref": "../common.schema.json#/$defs/screenName" }, { "type": "null" }] }, "exit_screen": { "oneOf": [{ "$ref": "../common.schema.json#/$defs/screenName" }, { "type": "null" }] } } }, "screen_day": { "type": "array", "items": { "$ref": "#/$defs/aggregateScreenDay" } }, "tap_cell": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["day", "platform", "screen", "orientation", "cell", "taps", "rage", "dead"], "properties": { "day": { "$ref": "../common.schema.json#/$defs/day" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "orientation": { "$ref": "batch.schema.json#/$defs/orientation" }, "cell": { "type": "integer", "minimum": 0, "maximum": 3199 }, "taps": { "type": "integer", "minimum": 0 }, "rage": { "type": "integer", "minimum": 0 }, "dead": { "type": "integer", "minimum": 0 } } } }, "path_day": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["day", "platform", "from_screen", "to_screen", "count", "people"], "properties": { "day": { "$ref": "../common.schema.json#/$defs/day" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "from_screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "to_screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "count": { "type": "integer", "minimum": 1 }, "people": { "type": "integer", "minimum": 0, "maximum": 1 } } } }, "path_top": { "type": "array", "maxItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["day", "path", "count", "ended_here"], "properties": { "day": { "$ref": "../common.schema.json#/$defs/day" }, "path": { "type": "string", "pattern": "^[a-z][a-z0-9_]*(>[a-z][a-z0-9_]*){0,4}$" }, "count": { "const": 1 }, "ended_here": { "enum": [0, 1] } } } } } } } } } },
138
+ "sessions/diagnostic.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/sessions/diagnostic.schema.json", "title": "SessionDiagnostic", "description": "POST /v1/sessions/diagnostics(api.appgrowstack.com・公開キー)の本文。iOS の MetricKit が後から届けた診断(固まった・CPU を使いすぎた・起動が遅かった)の1件と、その時のメインスレッドなどの呼び出しのツリー(callStackTree)。端末の SDK が診断の1件ごとに1回送る。1回 256KB まで(gzip 可)。id は端末が作り、同じ id の2回目は捨てる。session_id は端末が結べた時だけ付ける(結べなければ core が時刻の窓で探す)。記号化はしない(binaryUUID と offset のまま送り、手元の dSYM で読む)", "type": "object", "additionalProperties": false, "required": ["id", "kind", "install_id", "platform", "app_version", "build", "os_version", "device_model", "sdk_version", "period_from", "period_to", "stack", "stack_trim"], "properties": { "id": { "$ref": "#/$defs/diagnosticId" }, "kind": { "$ref": "#/$defs/diagnosticKind" }, "install_id": { "$ref": "../common.schema.json#/$defs/installId" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "description": "診断が起きた時のビルド番号(MXMetaData.applicationBuildVersion)", "type": "string", "minLength": 1, "maxLength": 32 }, "os_version": { "description": "診断が起きた時の OS(MXMetaData.osVersion のバージョンの数だけ。26.1)", "type": "string", "minLength": 1, "maxLength": 64 }, "device_model": { "description": "端末の型(MXMetaData.deviceType。iPhone17,1)", "type": "string", "minLength": 1, "maxLength": 64 }, "sdk_version": { "type": "string", "minLength": 1, "maxLength": 32 }, "app_binary": { "description": "アプリの本体の名前(CFBundleExecutable)。呼び出しのツリーの中でアプリの関数の行を見分けるのに使う", "type": "string", "minLength": 1, "maxLength": 128 }, "period_from": { "description": "診断の載っていた届け物の期間の始まり(MXDiagnosticPayload.timeStampBegin)", "$ref": "../common.schema.json#/$defs/epochMs" }, "period_to": { "description": "期間の終わり(timeStampEnd)。iOS 15 からは診断が起きた後の次の起動で届き、期間は短い", "$ref": "../common.schema.json#/$defs/epochMs" }, "duration_ms": { "description": "hang: 固まった長さ(hangDuration)・launch: 起動にかかった時間(launchDuration)・cpu_exception: 使った CPU の時間(totalCPUTime)", "type": "integer", "minimum": 0, "maximum": 86400000 }, "sampled_ms": { "description": "cpu_exception だけ。CPU を見ていた時間(totalSampledTime)", "type": "integer", "minimum": 0, "maximum": 86400000 }, "session_id": { "description": "端末が結べたセッション。hang は、端末が記録した hang の出来事のうち、期間に入り長さが一番近い物のセッション", "$ref": "../common.schema.json#/$defs/sessionId" }, "hang_t": { "description": "session_id のセッションの中の、結んだ hang の出来事の t(セッションの始まりからのミリ秒)", "type": "integer", "minimum": 0 }, "stack_trim": { "$ref": "#/$defs/stackTrim" }, "stack": { "$ref": "#/$defs/callStackTree" }, "meta": { "description": "MXMetaData のほかの値(platformArchitecture・regionFormat・lowPowerModeEnabled・isTestFlightApp・pid など)と、診断ごとの値(cpu_exception の exceptionType など)。文字・数・真偽だけ", "type": "object", "maxProperties": 32, "propertyNames": { "pattern": "^[A-Za-z][A-Za-z0-9_]{0,47}$" }, "additionalProperties": { "type": ["string", "number", "boolean"], "maxLength": 200 } } }, "$defs": { "diagnosticId": { "title": "SessionDiagnosticId", "description": "端末が作る診断の id。dgn_ +20文字", "type": "string", "pattern": "^dgn_[A-Za-z0-9]{20}$" }, "diagnosticKind": { "title": "SessionDiagnosticKind", "description": "hang(MXHangDiagnostic・メインスレッドが返らなかった)・cpu_exception(MXCPUExceptionDiagnostic・CPU を使いすぎた)・launch(MXAppLaunchDiagnostic・起動が遅かった)", "type": "string", "enum": ["hang", "cpu_exception", "launch"] }, "stackTrim": { "title": "SessionDiagnosticStackTrim", "description": "呼び出しのツリーをどう縮めたか。none: そのまま。attributed_thread: 大きすぎたので threadAttributed のスレッド(hang ならメインスレッド)だけを残した。dropped: それでも大きすぎたのでツリーを捨てた(callStacks は空)", "type": "string", "enum": ["none", "attributed_thread", "dropped"] }, "callStackTree": { "title": "SessionCallStackTree", "description": "MXCallStackTree の jsonRepresentation() をそのまま。callStackPerThread が true(hang など)はスレッドごとの1本の並びで、callStackRootFrames の頭がスタックの一番上(呼ばれた側)、subFrames が呼んだ側へ下る。false(cpu_exception)は抜き出しを重ねたツリーで、sampleCount が回数", "type": "object", "required": ["callStacks"], "properties": { "callStackPerThread": { "type": "boolean" }, "callStacks": { "type": "array", "maxItems": 512, "items": { "$ref": "#/$defs/callStack" } } } }, "callStack": { "title": "SessionCallStack", "type": "object", "properties": { "threadAttributed": { "description": "診断の起きたスレッド(hang ならメインスレッド)", "type": "boolean" }, "callStackRootFrames": { "type": "array", "items": { "$ref": "#/$defs/callStackFrame" } } } }, "callStackFrame": { "title": "SessionCallStackFrame", "description": "1つの関数の行。address − offsetIntoBinaryTextSegment がその binary の読み込まれた位置で、atos -l に渡す", "type": "object", "properties": { "binaryUUID": { "type": "string", "maxLength": 64 }, "binaryName": { "type": "string", "maxLength": 256 }, "offsetIntoBinaryTextSegment": { "type": "integer", "minimum": 0 }, "address": { "type": "integer", "minimum": 0 }, "sampleCount": { "type": "integer", "minimum": 0 }, "subFrames": { "type": "array", "items": { "$ref": "#/$defs/callStackFrame" } } } }, "topFrame": { "title": "SessionDiagnosticTopFrame", "description": "threadAttributed のスレッドの並びで、上から見て最初のアプリの本体(app_binary)の行。app_binary が無い・見つからない時は一番上の行", "type": "object", "additionalProperties": false, "required": ["binary_name", "binary_uuid", "offset"], "properties": { "binary_name": { "type": "string", "maxLength": 256 }, "binary_uuid": { "type": "string", "maxLength": 64 }, "offset": { "type": "integer", "minimum": 0 } } }, "diagnosticLink": { "title": "SessionDiagnosticLink", "description": "セッションとどう結んだか。device: 端末が結んだ(hang の出来事の時刻と長さ)。window: 端末が結べず、core が同じ端末の期間に重なるセッションを1本だけ見つけた。none: 結べなかった", "type": "string", "enum": ["device", "window", "none"] }, "diagnosticRow": { "title": "SessionDiagnosticRow", "description": "診断の一覧の1行(呼び出しのツリーは入れない)", "type": "object", "additionalProperties": false, "required": ["id", "project", "kind", "platform", "app_version", "build", "os_version", "device_model", "period_from", "period_to", "received_at", "link", "bytes", "stack_trim"], "properties": { "id": { "$ref": "#/$defs/diagnosticId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "kind": { "$ref": "#/$defs/diagnosticKind" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "type": "string", "maxLength": 32 }, "os_version": { "type": "string", "maxLength": 64 }, "device_model": { "type": "string", "maxLength": 64 }, "app_binary": { "type": "string", "maxLength": 128 }, "period_from": { "$ref": "../common.schema.json#/$defs/epochMs" }, "period_to": { "$ref": "../common.schema.json#/$defs/epochMs" }, "received_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "duration_ms": { "type": "integer", "minimum": 0 }, "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "hang_t": { "type": "integer", "minimum": 0 }, "link": { "$ref": "#/$defs/diagnosticLink" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "bytes": { "description": "R2 に置いた本文(gzip の前)の大きさ", "type": "integer", "minimum": 0 }, "stack_trim": { "$ref": "#/$defs/stackTrim" }, "top_frame": { "$ref": "#/$defs/topFrame" } } }, "diagnosticList": { "title": "SessionDiagnosticList", "description": "GET …/diagnostics?kind=&app_version=&since=&session=&limit=(listSessionDiagnostics)の答え。受けた時刻の新しい順。kind の既定は全部", "type": "object", "additionalProperties": false, "required": ["diagnostics"], "properties": { "diagnostics": { "type": "array", "maxItems": 200, "items": { "$ref": "#/$defs/diagnosticRow" } } } }, "diagnosticDetail": { "title": "SessionDiagnosticDetail", "description": "GET …/diagnostics/:id(getSessionDiagnostic)の答え。行と、端末が送った呼び出しのツリーとほかの値", "type": "object", "additionalProperties": false, "required": ["diagnostic", "stack"], "properties": { "diagnostic": { "$ref": "#/$defs/diagnosticRow" }, "stack": { "$ref": "#/$defs/callStackTree" }, "sampled_ms": { "type": "integer", "minimum": 0 }, "meta": { "type": "object", "additionalProperties": { "type": ["string", "number", "boolean"] } } } } } },
139
+ "sessions/live.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/sessions/live.schema.json", "title": "SessionLiveMessage", "description": "ライブの WebSocket の文字の通(7.4節)。端末 → DO は hello・event・frame、DO → 見る人は同じ物をそのまま、DO → 端末は stop・rate。frame の直後に、その画像の2進の通を1つ送る", "oneOf": [{ "$ref": "#/$defs/deviceMessage" }, { "$ref": "#/$defs/controlMessage" }], "$defs": { "deviceMessage": { "title": "SessionLiveDeviceMessage", "description": "端末 → DO(と見る人)", "oneOf": [{ "$ref": "#/$defs/hello" }, { "$ref": "#/$defs/event" }, { "$ref": "#/$defs/frame" }] }, "controlMessage": { "title": "SessionLiveControlMessage", "description": "DO → 端末", "oneOf": [{ "$ref": "#/$defs/stop" }, { "$ref": "#/$defs/rate" }] }, "hello": { "title": "SessionLiveHello", "description": "つないだ最初の通。w・h は窓の大きさ(pt・dp)", "type": "object", "additionalProperties": false, "required": ["type", "session_id", "screen", "w", "h"], "properties": { "type": { "const": "hello" }, "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "screen": { "$ref": "../common.schema.json#/$defs/screenName" }, "w": { "type": "number", "exclusiveMinimum": 0 }, "h": { "type": "number", "exclusiveMinimum": 0 } } }, "event": { "title": "SessionLiveEvent", "description": "3.1節の1件をすぐ送る", "type": "object", "additionalProperties": false, "required": ["type", "event"], "properties": { "type": { "const": "event" }, "event": { "$ref": "batch.schema.json#/$defs/event" } } }, "frame": { "title": "SessionLiveFrame", "description": "コマ(1秒に2枚まで・いつもの録画と同じ撮り方と隠し方)。この通の直後に画像の2進の通が来る。w・h は画像の画素", "type": "object", "additionalProperties": false, "required": ["type", "t", "mime", "w", "h", "masked"], "properties": { "type": { "const": "frame" }, "t": { "$ref": "batch.schema.json#/$defs/t" }, "mime": { "enum": ["image/jpeg", "image/webp"] }, "w": { "type": "integer", "minimum": 1, "maximum": 4096 }, "h": { "type": "integer", "minimum": 1, "maximum": 4096 }, "masked": { "type": "boolean" } } }, "stop": { "title": "SessionLiveStop", "description": "DO が閉じる前に送る。no_watcher=見る人がいなくなって60秒・expired=until を過ぎた・replaced=同じ端末が別の接続を開いた", "type": "object", "additionalProperties": false, "required": ["type", "reason"], "properties": { "type": { "const": "stop" }, "reason": { "enum": ["no_watcher", "expired", "replaced"] } } }, "rate": { "title": "SessionLiveRate", "description": "コマの上限を変える(見る人の回線が遅い時に下げる)", "type": "object", "additionalProperties": false, "required": ["type", "max_fps"], "properties": { "type": { "const": "rate" }, "max_fps": { "type": "number", "exclusiveMinimum": 0, "maximum": 2 } } } } },
140
+ "sessions/manifest.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/sessions/manifest.schema.json", "title": "SessionManifest", "description": "アプリの repo の sessions/manifest.json(9.2節)。app-growth sessions push が check して PUT /v1/sessions/projects/:project/policy で送る。screens に無い画面の名前は push が警告し、no_capture_screens の名前が screen_viewed の値に無ければエラーにする(ここでは形だけを見る)。retention は 6.5節の値より長くできない", "type": "object", "additionalProperties": false, "required": ["project", "mask", "no_capture_screens", "screens", "events", "replay", "retention"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "mask": { "$ref": "#/$defs/maskMode" }, "no_capture_screens": { "$ref": "#/$defs/noCaptureScreens" }, "screens": { "$ref": "#/$defs/screens" }, "names": { "$ref": "#/$defs/names" }, "events": { "$ref": "#/$defs/events" }, "replay": { "$ref": "#/$defs/replay" }, "retention": { "$ref": "#/$defs/retention" } }, "$defs": { "maskMode": { "title": "SessionMaskMode", "description": "marked=アプリがマークした所(iOS の .sessionMask()・Android の Modifier.sessionMask() と View の印)と、パスワードの欄(いつも・外せない)だけを隠す。ふつうの入力欄・ラベル・画像・Web の画面は見えたまま録る。値はこれだけ", "enum": ["marked"] }, "replay": { "title": "SessionReplayPolicy", "description": "録画を送るかの決め(5節)。enabled が false なら端末は撮らない。sample と daily_cap は5節の4、daily_bytes はプロジェクトの1日の受ける量(既定 5GB)", "type": "object", "additionalProperties": false, "required": ["enabled", "sample", "daily_cap", "daily_bytes"], "properties": { "enabled": { "type": "boolean" }, "sample": { "description": "hash32(\"<project>:<session_id>:replay\") / 2^32 がこれより小さいセッションを全部送る", "type": "number", "minimum": 0, "maximum": 1 }, "daily_cap": { "description": "1日(UTC)に全部送るセッションの数の上限。本人とテスターの端末は数えない", "type": "integer", "minimum": 0 }, "daily_bytes": { "type": "integer", "minimum": 0 } } }, "retention": { "title": "SessionRetention", "description": "寿命(日)。出来事の列は90日、録画は30日より長くできない", "type": "object", "additionalProperties": false, "required": ["events_days", "replay_days"], "properties": { "events_days": { "type": "integer", "minimum": 1, "maximum": 90 }, "replay_days": { "type": "integer", "minimum": 1, "maximum": 30 } } }, "noCaptureScreens": { "title": "SessionNoCaptureScreens", "description": "録画を撮らない画面の名前(screen_viewed の値)。その間のコマは blank(no_capture)", "type": "array", "uniqueItems": true, "maxItems": 200, "items": { "$ref": "../common.schema.json#/$defs/screenName" } }, "screens": { "title": "SessionScreenNotes", "description": "画面の名前 → 説明。AI の要約の材料。console に出す短い名前は names.screens", "type": "object", "maxProperties": 500, "propertyNames": { "$ref": "../common.schema.json#/$defs/screenName" }, "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 200 } }, "names": { "title": "SessionNames", "description": "console に出す画面と出来事の名前(screen_viewed の値・出来事の名前 → 人の読む短い名前)。無い名前は console が元の名前のまま出す。端末には送らない。GET …/names(getSessionNames)の答えもこの形", "type": "object", "additionalProperties": false, "properties": { "screens": { "type": "object", "maxProperties": 500, "propertyNames": { "$ref": "../common.schema.json#/$defs/screenName" }, "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 40 } }, "events": { "type": "object", "maxProperties": 500, "propertyNames": { "$ref": "../common.schema.json#/$defs/eventName" }, "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 40 } } } }, "events": { "title": "SessionEventsPolicy", "type": "object", "additionalProperties": false, "required": ["keep_props"], "properties": { "keep_props": { "description": "アプリの出来事の名前 → 残す props の名前(9.4節)。ここに無いアプリの出来事は名前だけを残す", "type": "object", "maxProperties": 500, "propertyNames": { "$ref": "../common.schema.json#/$defs/eventName" }, "additionalProperties": { "type": "array", "uniqueItems": true, "maxItems": 32, "items": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" } } } } }, "policy": { "title": "SessionPolicy", "description": "core が持つ製品の方針(sessions_policy)。マニフェストにバージョンと更新の時刻を付けた物。PUT …/policy の答えで、バッチの答えにも端末のバージョンと違う時だけ入る", "type": "object", "additionalProperties": false, "required": ["version", "updated_at", "project", "mask", "no_capture_screens", "screens", "events", "replay", "retention"], "properties": { "version": { "type": "integer", "minimum": 1 }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "mask": { "$ref": "#/$defs/maskMode" }, "no_capture_screens": { "$ref": "#/$defs/noCaptureScreens" }, "screens": { "$ref": "#/$defs/screens" }, "names": { "$ref": "#/$defs/names" }, "events": { "$ref": "#/$defs/events" }, "replay": { "$ref": "#/$defs/replay" }, "retention": { "$ref": "#/$defs/retention" } } } } },
141
+ "sessions/segment.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/sessions/segment.schema.json", "title": "ReplaySegmentHeader", "description": "録画の塊(.agsr・application/vnd.appgrowstack.replay-segment)の頭(9.3節)。塊の形は \"AGSR\"(4バイト)| バージョン 1(1バイト)| 頭の長さ(4バイト・ビッグエンディアン)| 頭(この JSON・UTF-8)| コマの画像を並べた物。offset は頭の終わりからのバイトで、画像は frames の順に隙間なく並べる。1つの塊は1MB まで。管理の道は R2 の Range で 9 + 頭の長さ + offset から length だけを読む", "type": "object", "additionalProperties": false, "required": ["session_id", "seq", "t_from", "t_to", "frames"], "properties": { "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "seq": { "description": "セッションの中の塊の番号(0から)。PUT …/segments/:seq と同じ", "type": "integer", "minimum": 0 }, "t_from": { "description": "最初のコマの t(セッションの始まりからのミリ秒)", "type": "integer", "minimum": 0 }, "t_to": { "description": "最後のコマの t", "type": "integer", "minimum": 0 }, "frames": { "type": "array", "minItems": 1, "maxItems": 600, "items": { "$ref": "#/$defs/frame" } } }, "$defs": { "frameKind": { "title": "ReplayFrameKind", "description": "image=画像あり・same=前のコマと同じ(画像なし)・blank=撮らなかった(画像なし・reason を付ける)", "enum": ["image", "same", "blank"] }, "blankReason": { "title": "ReplayBlankReason", "description": "no_capture=撮らない画面・secure=FLAG_SECURE の窓・masking_failed=隠す範囲を作れなかった・unsupported=写らない物(別のプロセスの画面など)", "enum": ["no_capture", "secure", "masking_failed", "unsupported"] }, "frame": { "title": "ReplayFrame", "description": "1つのコマ。image だけが mime・offset・length を持つ。w・h は画像の画素(1pt を1px)。masked は塗った所があるか", "type": "object", "additionalProperties": false, "required": ["t", "kind", "w", "h", "masked"], "properties": { "t": { "type": "integer", "minimum": 0 }, "kind": { "$ref": "#/$defs/frameKind" }, "mime": { "enum": ["image/jpeg", "image/webp"] }, "offset": { "type": "integer", "minimum": 0 }, "length": { "type": "integer", "minimum": 1 }, "w": { "type": "integer", "minimum": 1, "maximum": 4096 }, "h": { "type": "integer", "minimum": 1, "maximum": 4096 }, "masked": { "type": "boolean" }, "reason": { "$ref": "#/$defs/blankReason" } }, "oneOf": [{ "properties": { "kind": { "const": "image" } }, "required": ["mime", "offset", "length"], "not": { "required": ["reason"] } }, { "properties": { "kind": { "const": "same" } }, "allOf": [{ "not": { "required": ["mime"] } }, { "not": { "required": ["offset"] } }, { "not": { "required": ["length"] } }, { "not": { "required": ["reason"] } }] }, { "properties": { "kind": { "const": "blank" } }, "required": ["reason"], "allOf": [{ "not": { "required": ["mime"] } }, { "not": { "required": ["offset"] } }, { "not": { "required": ["length"] } }] }] } } },
142
+ "support/article.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/support/article.schema.json", "title": "HelpArticle", "description": "R7 のヘルプの記事の索引の1行。記事の本文は各製品の repo の Markdown で、各サイトの /help/<slug>/ に出す。ここには索引だけを置く(app-growth help push が全部を置き換える)。表は support_article", "type": "object", "additionalProperties": false, "required": ["slug", "lang", "title", "summary", "url", "tags", "updated_at"], "properties": { "slug": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,79}$" }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "summary": { "description": "AI の下書きと検索に使う1〜2文", "type": "string", "maxLength": 400 }, "url": { "$ref": "../common.schema.json#/$defs/httpsUrl" }, "tags": { "type": "array", "maxItems": 10, "items": { "type": "string", "pattern": "^[a-z0-9_-]{1,40}$" } }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" } }, "$defs": { "pushRequest": { "title": "PushArticlesRequest", "description": "PUT /v1/support/projects/:project/articles(admin)。その製品の索引を全部置き換える", "type": "object", "additionalProperties": false, "required": ["articles", "published_by"], "properties": { "articles": { "type": "array", "maxItems": 2000, "items": { "$ref": "#" } }, "published_by": { "description": "送った元の commit", "type": "string", "minLength": 1, "maxLength": 200 } } }, "listResponse": { "title": "ListArticlesResponse", "description": "GET /v1/support/articles?lang=<札>(api.appgrowstack.com・公開キー)。その言語が無い記事は en、それも無ければ project の最初の言語", "type": "object", "additionalProperties": false, "required": ["articles"], "properties": { "articles": { "type": "array", "items": { "$ref": "#" } } } } } },
143
+ "support/feedback.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/support/feedback.schema.json", "title": "CreateFeedbackRequest", "description": "POST /v1/support/feedback(api.appgrowstack.com・公開キー)の本文。アンケート(型 survey)で利用者が書いた文と、設定などから自分で送った声。返事はしない(問い合わせは tickets)。選んだだけの答えは送らず、アプリの計測の survey_answered で数える。core は AI に文を話題に分けさせ、話題ごとの数と例を数字の仕組みに返す。forget で消す", "type": "object", "additionalProperties": false, "required": ["install_id", "lang", "text", "context"], "properties": { "install_id": { "$ref": "../common.schema.json#/$defs/installId" }, "uid": { "$ref": "../common.schema.json#/$defs/uid" }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "campaign": { "description": "答えたアンケートの件の id。設定などアプリの画面から自分で送った声は書かない", "$ref": "../common.schema.json#/$defs/campaignId" }, "choice": { "description": "同じ件で選んだ答え(choice_1〜choice_6 の名前か、scale の件は 0〜10 の数の文字列)。campaign がある時だけ", "$ref": "#/$defs/choice" }, "text": { "description": "利用者が書いた文。AI には材料として渡し、指示として読まない", "type": "string", "minLength": 1, "maxLength": 2000 }, "context": { "$ref": "ticket.schema.json#/$defs/context" } }, "dependentRequired": { "choice": ["campaign"] }, "$defs": { "feedbackId": { "title": "FeedbackId", "type": "string", "pattern": "^fbk_[A-Za-z0-9]{16}$" }, "choice": { "title": "SurveyChoice", "description": "アンケートの答え。choice_1〜choice_6(選択肢の名前)か、scale の件は 0〜10 の数", "type": "string", "pattern": "^(choice_[1-6]|[0-9]|10)$" }, "topic": { "title": "FeedbackTopic", "description": "AI が付けた話題の札(英小文字と _。price・missing_feature・sync_bug のように2〜40文字)。同じプロジェクトの前の札を使い回す", "type": "string", "pattern": "^[a-z][a-z0-9_]{1,39}$" }, "createInput": { "title": "CreateFeedbackInput", "description": "AppGrowStackApiRpc.createFeedback。api が公開キーからプロジェクトを引いて渡す", "type": "object", "additionalProperties": false, "required": ["project", "request"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "request": { "$ref": "#" } } }, "createResponse": { "title": "CreateFeedbackResponse", "description": "201 で返す", "type": "object", "additionalProperties": false, "required": ["feedback_id", "created_at"], "properties": { "feedback_id": { "$ref": "#/$defs/feedbackId" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "summary": { "title": "FeedbackSummary", "description": "GET /v1/support/projects/:project/feedback/summary の答え。期間(?days= 既定28・1〜365)と件(?campaign=)で絞った、話題ごとの数と新しい例(3つまで)。人の id・install_id・端末の文脈は返さない。話題をまだ付けていない文は unclassified に数える", "type": "object", "additionalProperties": false, "required": ["project", "from", "to", "campaign", "total", "unclassified", "topics", "choices"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "from": { "$ref": "../common.schema.json#/$defs/epochMs" }, "to": { "$ref": "../common.schema.json#/$defs/epochMs" }, "campaign": { "description": "絞った件。絞らないときは null", "anyOf": [{ "$ref": "../common.schema.json#/$defs/campaignId" }, { "type": "null" }] }, "total": { "description": "期間の中の文の数", "type": "integer", "minimum": 0 }, "unclassified": { "description": "話題をまだ付けていない(下書きの上限で飛ばした・AI のキーが無い)文の数", "type": "integer", "minimum": 0 }, "topics": { "description": "話題ごと。数の多い順", "type": "array", "items": { "title": "FeedbackTopicCount", "type": "object", "additionalProperties": false, "required": ["topic", "count", "examples"], "properties": { "topic": { "$ref": "#/$defs/topic" }, "count": { "type": "integer", "minimum": 1 }, "examples": { "description": "新しい順に3つまで", "type": "array", "maxItems": 3, "items": { "$ref": "#/$defs/example" } } } } }, "choices": { "description": "文を添えた答えの、件と選んだ答えごとの数(選んだだけの答えは計測の survey_answered にあり、ここには無い)。数の多い順", "type": "array", "items": { "title": "FeedbackChoiceCount", "type": "object", "additionalProperties": false, "required": ["campaign", "choice", "count"], "properties": { "campaign": { "$ref": "../common.schema.json#/$defs/campaignId" }, "choice": { "$ref": "#/$defs/choice" }, "count": { "type": "integer", "minimum": 1 } } } } } }, "example": { "title": "FeedbackExample", "type": "object", "additionalProperties": false, "required": ["feedback_id", "campaign", "choice", "lang", "text", "platform", "app_version", "at"], "properties": { "feedback_id": { "$ref": "#/$defs/feedbackId" }, "campaign": { "anyOf": [{ "$ref": "../common.schema.json#/$defs/campaignId" }, { "type": "null" }] }, "choice": { "anyOf": [{ "$ref": "#/$defs/choice" }, { "type": "null" }] }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "text": { "type": "string" }, "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } } } },
144
+ "support/review.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/support/review.schema.json", "title": "StoreReview", "description": "R7 のストアのレビュー(K11-1)。core の Cron が1時間ごとに App Store Connect API(customerReviews)と Google Play Developer API(reviews.list)から取り、表 support_store_review に入れる。AI の下書き(support_review_draft)は本人の承認の後だけ customerReviewResponses・reviews.reply で送る(App Store Review Guidelines 5.6.1: 返事に宣伝を入れない)。body と title はストアで公開の利用者の文で、AI には材料として渡し、指示として読ませない。書いた人の名前は持たない", "type": "object", "additionalProperties": false, "required": ["id", "project", "store", "store_review_id", "rating", "title", "body", "territory", "lang", "app_version", "created_at", "status", "reply_limit", "response", "drafts"], "properties": { "id": { "$ref": "#/$defs/reviewId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "store": { "$ref": "#/$defs/store" }, "store_review_id": { "description": "ストアのレビューの id(App Store は customerReviews の id、Google Play は reviewId)", "type": "string", "minLength": 1, "maxLength": 200 }, "rating": { "type": "integer", "minimum": 1, "maximum": 5 }, "title": { "description": "App Store だけ。Google Play は null", "type": ["string", "null"], "maxLength": 300 }, "body": { "type": "string", "maxLength": 8000 }, "territory": { "description": "App Store の国(ISO 3166-1 alpha-3・JPN など)。Google Play は null", "type": ["string", "null"], "pattern": "^[A-Z]{3}$" }, "lang": { "description": "Google Play の reviewerLanguage(ja・en_US など)。App Store は null", "type": ["string", "null"], "maxLength": 16 }, "app_version": { "description": "Google Play の appVersionName。App Store のレビューには無いので null", "type": ["string", "null"], "maxLength": 64 }, "created_at": { "description": "App Store は createdDate、Google Play は利用者の文の lastModified(書き直すと進む)", "$ref": "../common.schema.json#/$defs/epochMs" }, "status": { "$ref": "#/$defs/status" }, "reply_limit": { "description": "そのストアの返事の字数の上限(Google Play 350・App Store 5970)。JavaScript の文字列の長さ(UTF-16 の単位)で数える", "type": "integer", "minimum": 1 }, "response": { "description": "ストアに出ている(か出る途中の)返事。無ければ null", "anyOf": [{ "$ref": "#/$defs/response" }, { "type": "null" }] }, "drafts": { "type": "array", "items": { "$ref": "#/$defs/draft" } } }, "$defs": { "reviewId": { "title": "StoreReviewId", "type": "string", "pattern": "^rvw_[A-Za-z0-9]{16}$" }, "draftId": { "title": "ReviewDraftId", "type": "string", "pattern": "^rdf_[A-Za-z0-9]{16}$" }, "store": { "title": "ReviewStore", "enum": ["app_store", "google_play"] }, "status": { "title": "StoreReviewStatus", "description": "received(返事が無く、下書きも無い)→ drafted(AI の下書きが本人の承認待ち)→ answered(返事がある。ここから送った物か、ストアの画面で書かれた物)。利用者がレビューを書き直すと received に戻り、待っている下書きは rejected にする", "enum": ["received", "drafted", "answered"] }, "response": { "title": "StoreReviewResponse", "type": "object", "additionalProperties": false, "required": ["body", "state", "at", "by"], "properties": { "body": { "type": "string", "minLength": 1, "maxLength": 5970 }, "state": { "description": "App Store は送ってから最大24時間 pending_publish。Google Play は送るとすぐ published", "enum": ["published", "pending_publish"] }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "by": { "description": "送った主体の id(usr_・agt_)。ストアの画面など外で書かれた返事は store", "type": "string", "maxLength": 64 } } }, "draft": { "title": "ReviewDraft", "description": "AI の下書き。本人が approve(直してもよい)か reject する。approve でストアに送る", "type": "object", "additionalProperties": false, "required": ["id", "review_id", "body", "model", "sources", "status", "created_at"], "properties": { "id": { "$ref": "#/$defs/draftId" }, "review_id": { "$ref": "#/$defs/reviewId" }, "body": { "type": "string", "minLength": 1, "maxLength": 5970 }, "model": { "type": "string", "maxLength": 64 }, "sources": { "description": "使ったヘルプの記事の slug", "type": "array", "items": { "type": "string", "maxLength": 200 } }, "status": { "enum": ["pending", "approved", "edited", "rejected"] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "list": { "title": "StoreReviewList", "description": "GET /v1/support/projects/:project/reviews?status=&store=(新しい順に200まで)。status の既定は received,drafted(本人の手を待っている物)、all で全部", "type": "object", "additionalProperties": false, "required": ["reviews"], "properties": { "reviews": { "type": "array", "maxItems": 200, "items": { "$ref": "#" } } } }, "approveRequest": { "title": "ApproveReviewDraftRequest", "description": "POST /v1/support/projects/:project/reviews/:review_id/drafts/:draft_id/approve。body を書けば直した文で送る(下書きは edited)。字数はそのストアの reply_limit まで(超えたら 400)。エージェントが呼ぶと 202 の承認の依頼になり、本人が承認した本文がそのまま送られる", "type": "object", "additionalProperties": false, "properties": { "body": { "type": "string", "minLength": 1, "maxLength": 5970 } } }, "redraftRequest": { "title": "RedraftReviewRequest", "description": "POST /v1/support/projects/:project/reviews/:review_id/drafts。AI にもう一度下書きさせる。note は本人の指示。待っている下書きは rejected にする", "type": "object", "additionalProperties": false, "properties": { "note": { "type": "string", "minLength": 1, "maxLength": 1000 } } } } },
145
+ "support/ticket.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://appgrowstack.com/schema/v1/support/ticket.schema.json", "title": "CreateTicketRequest", "description": "POST /v1/support/tickets(api.appgrowstack.com・公開キー)の本文。SDK(swift-app-sdk)の support のフォームが送る。owner_token は SDK が最初の問い合わせの前に作って keychain に置く32文字以上の乱数で、返事の一覧を読む鍵になる(サーバーは sha256 だけを持つ)。返事は最初は全部本人の確認の後に送る", "type": "object", "additionalProperties": false, "required": ["install_id", "owner_token", "lang", "body", "category", "context"], "properties": { "install_id": { "$ref": "../common.schema.json#/$defs/installId" }, "uid": { "$ref": "../common.schema.json#/$defs/uid" }, "owner_token": { "$ref": "#/$defs/ownerToken" }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "email": { "description": "返事をメールでも欲しい人だけ", "type": "string", "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$", "maxLength": 254 }, "category": { "$ref": "#/$defs/category" }, "subject": { "type": "string", "maxLength": 120 }, "body": { "type": "string", "minLength": 1, "maxLength": 4000 }, "context": { "$ref": "#/$defs/context" } }, "$defs": { "ownerToken": { "title": "SupportOwnerToken", "type": "string", "pattern": "^[A-Za-z0-9_-]{32,128}$" }, "ticketId": { "title": "TicketId", "type": "string", "pattern": "^tkt_[A-Za-z0-9]{16}$" }, "category": { "title": "TicketCategory", "enum": ["bug", "billing", "account", "question", "request", "other"] }, "context": { "title": "TicketContext", "description": "SDK が自動で添える文脈。利用者が書いた文(習慣の名前など)は入れない", "type": "object", "additionalProperties": false, "required": ["platform", "app_version", "build", "os_version", "device_model", "channel", "recent_events", "campaigns_shown"], "properties": { "platform": { "$ref": "../common.schema.json#/$defs/platform" }, "app_version": { "$ref": "../common.schema.json#/$defs/appVersion" }, "build": { "type": "string", "maxLength": 32 }, "os_version": { "type": "string", "maxLength": 32 }, "device_model": { "type": "string", "maxLength": 64 }, "channel": { "$ref": "../common.schema.json#/$defs/buildChannel" }, "is_premium": { "type": "boolean" }, "session_id": { "description": "問い合わせを書いたときの R8 のセッション(K3-9)。core はそのセッションにマーク ticket を付けて寿命を延ばし、要約とコマを下書きの材料にする", "$ref": "../common.schema.json#/$defs/sessionId" }, "screen": { "description": "フォームを開いた画面", "type": "string", "maxLength": 64 }, "recent_events": { "description": "直近の出来事(新しい順に20まで)", "type": "array", "maxItems": 20, "items": { "type": "object", "additionalProperties": false, "required": ["name", "at", "props"], "properties": { "name": { "$ref": "../common.schema.json#/$defs/eventName" }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "props": { "$ref": "../common.schema.json#/$defs/typedProps" } } } }, "campaigns_shown": { "description": "直近に出したキャンペーン(新しい順に10まで)", "type": "array", "maxItems": 10, "items": { "type": "object", "additionalProperties": false, "required": ["campaign", "set_version", "at"], "properties": { "campaign": { "$ref": "../common.schema.json#/$defs/campaignId" }, "set_version": { "type": "integer", "minimum": 0 }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } } } } }, "createResponse": { "title": "CreateTicketResponse", "description": "201 で返す", "type": "object", "additionalProperties": false, "required": ["ticket_id", "status", "created_at"], "properties": { "ticket_id": { "$ref": "#/$defs/ticketId" }, "status": { "$ref": "#/$defs/deviceStatus" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "deviceStatus": { "title": "TicketDeviceStatus", "description": "端末に見せる状態。waiting は返事を待っている(受けた・下書き・本人の確認待ちを含む)", "enum": ["waiting", "answered", "resolved"] }, "status": { "title": "TicketStatus", "description": "中の状態。received → drafted(AI の下書きが本人の確認待ち)→ answered(返事を送った)→ resolved。利用者が書き足すと answered から received に戻る", "enum": ["received", "drafted", "answered", "resolved"] }, "message": { "title": "TicketMessage", "type": "object", "additionalProperties": false, "required": ["id", "from", "body", "at"], "properties": { "id": { "type": "string", "pattern": "^msg_[A-Za-z0-9]{16}$" }, "from": { "enum": ["user", "support"] }, "body": { "type": "string", "minLength": 1, "maxLength": 8000 }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "deviceTicket": { "title": "DeviceTicket", "type": "object", "additionalProperties": false, "required": ["ticket_id", "status", "subject", "created_at", "updated_at", "messages"], "properties": { "ticket_id": { "$ref": "#/$defs/ticketId" }, "status": { "$ref": "#/$defs/deviceStatus" }, "subject": { "type": ["string", "null"] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "messages": { "type": "array", "items": { "$ref": "#/$defs/message" } } } }, "listResponse": { "title": "ListTicketsResponse", "description": "GET /v1/support/tickets(公開キー・X-Support-Token に owner_token)。その鍵の問い合わせを新しい順に", "type": "object", "additionalProperties": false, "required": ["tickets"], "properties": { "tickets": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/deviceTicket" } } } }, "postMessageRequest": { "title": "PostTicketMessageRequest", "description": "POST /v1/support/tickets/:ticket_id/messages(公開キー・X-Support-Token)。利用者の書き足し。返事は 201 の TicketMessage", "type": "object", "additionalProperties": false, "required": ["body"], "properties": { "body": { "type": "string", "minLength": 1, "maxLength": 4000 } } }, "createInput": { "title": "CreateTicketInput", "description": "RPC createTicket。アプリの Worker が自分の画面(Web のフォーム)で受けた問い合わせを渡す", "type": "object", "additionalProperties": false, "required": ["project", "request"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "request": { "$ref": "#" } } }, "draft": { "title": "TicketDraft", "description": "AI の下書き。本人が approve(直してもよい)か reject する。approve で返事を送り、R5 で知らせる", "type": "object", "additionalProperties": false, "required": ["id", "ticket_id", "body", "model", "sources", "status", "created_at"], "properties": { "id": { "type": "string", "pattern": "^dft_[A-Za-z0-9]{16}$" }, "ticket_id": { "$ref": "#/$defs/ticketId" }, "body": { "type": "string", "minLength": 1, "maxLength": 8000 }, "model": { "type": "string", "maxLength": 64 }, "sources": { "description": "使ったヘルプの記事の slug と knowledge の行", "type": "array", "items": { "type": "string", "maxLength": 200 } }, "status": { "enum": ["pending", "approved", "edited", "rejected"] }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "approveRequest": { "title": "ApproveDraftRequest", "description": "POST /v1/support/tickets/:ticket_id/drafts/:draft_id/approve(admin)。body を書けば直した文で送る(status は edited)", "type": "object", "additionalProperties": false, "properties": { "body": { "type": "string", "minLength": 1, "maxLength": 8000 } } }, "createdEvent": { "title": "SupportTicketCreatedEvent", "description": "support_ticket_created。core が R2 の track に入れる", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "support_ticket_created" }, "params": { "type": "object", "additionalProperties": false, "required": ["ticket_id", "category"], "properties": { "ticket_id": { "$ref": "#/$defs/ticketId" }, "category": { "$ref": "#/$defs/category" } } } } }, "answeredEvent": { "title": "SupportTicketAnsweredEvent", "description": "support_ticket_answered。返事を送ったとき。R5 の request のきっかけ(返事が来たと知らせる)にもなる", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "support_ticket_answered" }, "params": { "type": "object", "additionalProperties": false, "required": ["ticket_id", "by"], "properties": { "ticket_id": { "$ref": "#/$defs/ticketId" }, "by": { "enum": ["human", "ai_approved", "ai_auto"] } } } } }, "resolvedEvent": { "title": "SupportTicketResolvedEvent", "type": "object", "additionalProperties": false, "required": ["name", "params"], "properties": { "name": { "const": "support_ticket_resolved" }, "params": { "type": "object", "additionalProperties": false, "required": ["ticket_id"], "properties": { "ticket_id": { "$ref": "#/$defs/ticketId" } } } } }, "adminTicket": { "title": "AdminTicket", "description": "admin の一覧の1件(app-growth inbox)", "type": "object", "additionalProperties": false, "required": ["ticket_id", "project", "person_id", "status", "category", "subject", "lang", "email", "context", "created_at", "updated_at", "messages", "drafts", "attachments", "session"], "properties": { "session": { "description": "context.session_id のセッション(K3-9)。無ければ null。要約の有無だけで、出来事の列とコマは /v1/sessions の道で読む", "anyOf": [{ "type": "object", "additionalProperties": false, "required": ["session_id", "has_summary", "has_replay"], "properties": { "session_id": { "$ref": "../common.schema.json#/$defs/sessionId" }, "has_summary": { "type": "boolean" }, "has_replay": { "type": "boolean" } } }, { "type": "null" }] }, "ticket_id": { "$ref": "#/$defs/ticketId" }, "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "person_id": { "$ref": "../common.schema.json#/$defs/personId" }, "status": { "$ref": "#/$defs/status" }, "category": { "$ref": "#/$defs/category" }, "subject": { "type": ["string", "null"] }, "lang": { "$ref": "../common.schema.json#/$defs/langTag" }, "email": { "type": ["string", "null"] }, "context": { "$ref": "#/$defs/context" }, "created_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "updated_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "messages": { "type": "array", "items": { "$ref": "#/$defs/message" } }, "drafts": { "type": "array", "items": { "$ref": "#/$defs/draft" } }, "attachments": { "type": "array", "items": { "$ref": "#/$defs/attachment" } } } }, "summary": { "title": "SupportSummary", "description": "GET /v1/support/projects/:project/summary?since=(MG-5・getSupportSummary)。since(既定は28日前)から後に受けた問い合わせの数だけ(段階1・support.aggregate.read)。本文・題・端末の文脈・メールは返さない", "type": "object", "additionalProperties": false, "required": ["project", "since", "computed_at", "received", "answered", "resolved", "median_first_reply_ms", "without_article", "without_article_by_category"], "properties": { "project": { "$ref": "../common.schema.json#/$defs/projectId" }, "since": { "$ref": "../common.schema.json#/$defs/epochMs" }, "computed_at": { "$ref": "../common.schema.json#/$defs/epochMs" }, "received": { "description": "since から後に受けた問い合わせの数", "type": "integer", "minimum": 0 }, "answered": { "description": "received のうち、返事(support の message)を1つ以上送った数", "type": "integer", "minimum": 0 }, "resolved": { "description": "received のうち、今の状態が resolved の数", "type": "integer", "minimum": 0 }, "median_first_reply_ms": { "description": "answered の問い合わせの、受けてから最初の返事までの時間(ミリ秒)の中央値。answered が0なら null", "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }, "without_article": { "description": "ヘルプの記事が無かった話題の数。received のうち、AI の下書きが1つ以上あり、どの下書きも記事を使わなかった(sources が空)問い合わせの数。下書きの無い問い合わせは数えない", "type": "integer", "minimum": 0 }, "without_article_by_category": { "description": "without_article を問い合わせの種類(TicketCategory)ごとに分けた数。0の種類は入れない", "type": "object", "propertyNames": { "$ref": "#/$defs/category" }, "additionalProperties": { "type": "integer", "minimum": 1 } } } }, "adminListResponse": { "title": "AdminListTicketsResponse", "description": "GET /v1/support/projects/:project/tickets?status=(admin)", "type": "object", "additionalProperties": false, "required": ["tickets"], "properties": { "tickets": { "type": "array", "items": { "$ref": "#/$defs/adminTicket" } } } }, "attachmentContentType": { "title": "AttachmentContentType", "description": "添付の画像の形。端末はスクリーンショットを JPEG か PNG にして送る", "enum": ["image/jpeg", "image/png", "image/heic", "image/webp"] }, "attachment": { "title": "TicketAttachment", "description": "問い合わせに添えた画像。中身は R2(appgrowstack-core-attachments)に置き、D1 は support_attachment。端末は POST /v1/support/tickets/:ticket_id/attachments に画像の本文そのもの(Content-Type が形)を送る。1件の問い合わせに4枚・1枚5MBまで", "type": "object", "additionalProperties": false, "required": ["id", "content_type", "bytes", "at"], "properties": { "id": { "type": "string", "pattern": "^att_[A-Za-z0-9]{16}$" }, "content_type": { "$ref": "#/$defs/attachmentContentType" }, "bytes": { "type": "integer", "minimum": 1, "maximum": 5000000 }, "at": { "$ref": "../common.schema.json#/$defs/epochMs" } } }, "replyRequest": { "title": "ReplyTicketRequest", "description": "POST /v1/support/tickets/:ticket_id/messages(admin)。下書きを使わずに本人が書いた返事。送ると support_ticket_answered(by human)を track し、R5 で知らせる", "type": "object", "additionalProperties": false, "required": ["body"], "properties": { "body": { "type": "string", "minLength": 1, "maxLength": 8000 } } }, "redraftRequest": { "title": "RedraftTicketRequest", "description": "POST /v1/support/tickets/:ticket_id/drafts(admin)。AI にもう一度下書きさせる。note は本人の指示(もっと短く・返金の窓口を先に など)。待っている下書きは rejected にする", "type": "object", "additionalProperties": false, "properties": { "note": { "type": "string", "minLength": 1, "maxLength": 1000 } } } } },
146
+ };