問題メタデータリファレンス Stable
パック内の各問題は metadata.json を持ちます。以下のフィールドは、
@tenkacloud/problem-sdk の ProblemMetadata コントラクトと
validateProblemMetadata バリデーターから導出された規範的リファレンスです。
SDK は id、runtime、scoring フィールドを所有し、SDK 自身が解釈しない追加の
カタログ表示用フィールドに対しては前方互換です。
フィールド
| Field | Type | Presence | Description |
|---|---|---|---|
id | string | Required | Stable, non-empty problem identifier. Validated by the SDK. |
runtime | object | composite | Optional | Runtime descriptor ({ provider, engine, entry }) or a composite { kind: 'composite', targets }. Defaults to aws/cloudformation when absent. |
cfnTemplate | string | Optional | Legacy single deploy-body filename. Defaults to 'template.yaml' when neither runtime.entry nor cfnTemplate is set. |
scoring | ProblemScoringMetadata | Optional | One of the six built-in scoring kinds (flag, multi-flag, uptime-flat, uptime-multi, phased-polling, attack-detection) plus composite-probe. |
endpoints | unknown | Optional | Optional endpoint declarations validated by the metadata-section validators. |
phases | unknown | Optional | Optional phase declarations for phased-polling problems. |
disruptions | unknown | Optional | Optional disruption declarations for resilience problems. |
ランタイム宣言
問題のランタイムは、単一の { provider, engine, entry } ディスクリプタか、
複合の { kind: "composite", targets } のいずれかです。複合ランタイムには
2 個以上 8 個以下のターゲットが必要です。認識される provider/engine の組み合わせは
ランタイム機能マトリクスに記載されています。
例
以下の例は説明用であり、規範ではありません。
{
"id": "com.example.starter.intro",
"runtime": { "provider": "aws", "engine": "cloudformation", "entry": "template.yaml" },
"scoring": { "kind": "flag", "flagOutputKey": "Flag", "points": 100 }
}
関連: パックマニフェストリファレンス、 およびバリデーションエラーリファレンス。