Code2WF Result取得
Method
この計画APIは、検証済みの完全な不変Code2WF worker resultを返します。ResultにはFigma pluginがmaterializeする既存WF2Des DesignSpecModel が含まれます。
HTTP Method
GET: 完了済みCode2WF resultを取得
Naming Convention
このdata-plane responseは snake_case を使用し、不変worker resultのfieldをrename、drop、projectせず維持します。
Request and Response
Headers
メタ情報はレスポンスボディではなく、HTTPヘッダーに設定されます。
Request Headers
AuthorizationContent-TypeAcceptAccept-language
Response Headers
Content-Type
Code2WF Result取得
URI
Path Parameters
| Name | 型 | 必須 | 説明 |
|---|---|---|---|
| organization_id | integer | 必須 | Organization ID |
| project_id | integer | 必須 | Project ID |
| code2wf_id | string | 必須 | Code2WF UUID |
Request Body
なし。
Response
{
"job_id": "019ffa90-7900-75a3-8123-456789abcdf1",
"attempt": 1,
"organization_id": 1,
"project_id": 7,
"screen_id": "AUTORACE_DATABASE",
"status": "success",
"generated_at": "2026-08-13T10:01:00Z",
"inputs": {
"page_import_id": "0195f16e-6f11-7ea8-b45c-f6712ed9d8a3",
"page_result_url": "s3://bucket/1/7/page-import/0195f16e-6f11-7ea8-b45c-f6712ed9d8a3/normalized/manifest.json",
"page_result_hash": "sha256:44a7f61a6f90f476c349b264c0cbd824ce45ecad0d9985f0750f8a251aa9592a",
"capture_hash": "sha256:90e54d8b9cf4ff0fdc2b927b4453d59f4c3e219c236bb398e660aca50a62ae27"
},
"spec": {
"spec_version": "1.0",
"parse_confirmed": true,
"style_bindings": {},
"root": {
"node": "layout_frame",
"layer_path": "root",
"auto_layout": {
"direction": "vertical",
"gap": 16.0,
"padding": 24.0,
"sizing": "fixed",
"gaps": [],
"primary_align": "",
"counter_align": "",
"wrap": "",
"counter_gap": 0.0
},
"fill": "#ffffff",
"corner_radius": 0.0,
"bbox": { "x": 0.0, "y": 0.0, "w": 1440.0, "h": 1860.0 },
"lineage_wf_node_ids": [],
"children": []
}
}
}
Response Fields
| Name | 型 | 説明 |
|---|---|---|
| job_id | string | 不変worker artifact内のCode2WF row UUID。 |
| attempt | integer | MVPでは常に 1。 |
| organization_id / project_id | integer | Code2WF rowと照合したtenantとproject scope。 |
| screen_id | string | Code2WF rowに保存されたcaller-confirmed screen IDの正確な値。 |
| status | string | 完了済みresult artifactではliteral success。 |
| generated_at | string | UTC ISO 8601 terminal-write time。 |
| inputs | object | Workerが使用した正確な不変Page Import lineage pin。 |
| inputs.page_import_id | string | Code2WF rowと一致するPage Import UUID。 |
| inputs.page_result_url | string | Generationに使用したcanonicalな不変normalized-manifest S3 URL。 |
| inputs.page_result_hash / capture_hash | string | Normalized manifestの正確なbyte hashとrendered-evidence identity。 |
| spec | object | Plugin AssemblySpec として直接利用できる、検証済みの不変な既存WF2Des DesignSpecModel。 |
完全なcontractとlimitはCode2WF I/O定義に記載します。Response bodyは検証済みの完全なworker artifactです。Endpointはwrapperを追加せず、job_id を code2wf_id へrenameせず、lineage fieldをdropせず、specをtranslateせず、Code2WF専用node、asset、annotation、warning collectionを追加しません。
Pluginは返却されたartifactを直接consumeし、outer identityとlineage fieldを保持して、nested spec をcurrent WF2Des planner/materializerに渡します。計画中のplugin作業はCode2WF discovery、このendpoint call、placement reportingに加えて、canonical Pydantic outputが使う定義済みtext fallback、layout sizing/wrap、nullable source fieldの共有builder/typeサポートを完了します。
Result取得ではFigma nodeを作らず、materialized_at も変更しません。
Authentication
Amazon Cognito JWTで認証します。Callerにはprojectへの Read accessが必要です。
Error Handling
| 説明 | Status Code | Status Name |
|---|---|---|
| Authentication credentialなし | 401 | Unauthorized |
| Jobがunauthorized、unknown、未completed、またはresultなし | 404 | Not Found |
| Result schema、identity、lineage validation失敗 | 500 | Internal Server Error |
Processing Flow
- AuthenticateしRead accessを確認する。
- Scopedかつ未削除rowを取得し、
status="1"、attempt=1、client向けresult_urlを要求する。 row.result_urlを不変なclient向けresult.jsonkeyとして解決し、terminal-manifest keyとして扱わない。まずS3 metadataを確認し、宣言sizeが10 MiBを超える場合はrejectする。次に10 MiB bounded readerでstreamし、actual bytesが同じlimitを超えたらabortする。Unbounded full-object bufferは使用しない。- WF2Desに揃えたouter
job_id、tenant、attempt、screen、status、generated timeをrowと照合し、inputsのPage Import identity/hashを検証してから、nested objectを既存WF2DesDesignSpecModelで検証する。 - Originalの
job_id、attempt、tenant/project、screen、status、generated time、Page Importinputs、nestedspecを含む検証済みの完全な不変worker artifactを返し、fieldをrename、drop、wrap、projectしない。
該当columnが存在しないため、backendはCode2WF rowに保存されたPage Import hashと比較しません。不変result artifactが inputs に正確なPage Import pinを保持し検証します。Endpointはその完全なartifactを返し、pluginがそのnested existing specをmaterializeします。Terminal manifestはcallback専用であり、このendpointは読みません。