AI Code2Des — I/O 定義
SQS input
Input は code2des_id、page_import_id、literal attempt 1、nonce、positive organization/project ID、S3 capture_url、sha256: capture hash を持ち、unknown field を拒否します。Worker は capture bytes の hash と capture 内の Page Import/tenant identity を検証します。PostgreSQL/DocumentDB は読みません。
Deterministic spec
Code2DesSpec は spec_version: "1.0"、mode: "exact"、source viewport/URL/screenshot evidence、root frame、warning を持ちます。Node union は frame、text、image、vector、unmatched です。
- Frame: bbox、solid/linear-gradient fill、border、corner radius、shadow、clip、blend mode、layout hint、children。
- Text: content、font、size/weight、line height、letter spacing、color、alignment、decoration、single-line behavior。
- Image: content-addressed asset、object fit、任意の saturation filter。
- Vector: inline SVG。
- Unmatched: source evidence と決定的な reason。
Artifact と webhook
Artifact は {organization_id}/{project_id}/code2des/{code2des_id}/ 配下の result.json → manifest.json、または failed.json → failed-manifest.json です。Manifest は job_type: "code2des" と row_effects.code2des を持ち、成功 status "1" では result URL/warning count、失敗 status "2" では安全な failure pointer を返します。
Webhook は type、job ID、attempt、nonce、terminal status、manifest URL、schema version を送り、backend が tenant prefix/identity を検証して attempt/status guarded PostgreSQL update を行います。
Plugin hydration
Public result API は image asset が Page Import の tenant/job asset prefix 内にあることを検証し、plugin 用に data_base64 を注入します。Plugin は S3 credential を受け取りません。