| event_payload |
{"ref":"refs/heads/main","befo {"ref":"refs/heads/main","before":"9f02b16c4968771143aee412b6f58291cbbe9dfb","after":"13fe1037486e5d393f986446219e457190ec1863","compare_url":"https://gitea.g-hi.com/luoanwu/image-generation/compare/9f02b16c4968771143aee412b6f58291cbbe9dfb...13fe1037486e5d393f986446219e457190ec1863","commits":[{"id":"13fe1037486e5d393f986446219e457190ec1863","message":"fix(cost): record and cap online image generation invocations\n\nAdversarial acceptance found that generateConnectedImage — the online\nimage path for DASHSCOPE_WAN and OpenAI-compatible connections — called\nthe provider directly via postJson without withRecordedModelCall, the\none place that both writes a ModelInvocation and enforces the per-task\nbudget cap before dispatch. A real Wan 2.7 Pro custom-image generation\n(kind IMAGE / DESIGN_MASTER) therefore produced a genuine paid image\n(providerRequestId, ~28s, real PNG) but left no cost record, and the\nbrand's maxCostMicrosPerTask never applied. Every recorded wan2.7-image\ninvocation in the live DB came from ROLE/STILL (sidecar path); none from\nIMAGE — matching the gap. Video (sidecar) and text (connector) were\nalready wrapped and unaffected.\n\nWrap the online image call in withRecordedModelCall via a new\nconnectorImageCallPlan (modality IMAGE, connector-direct, external), map\nModelCostLimitError to the same COST_LIMIT_BLOCKED channel the text path\nuses, and report usage.images = 1 so the realized cost is ESTIMATED at\nthe catalog price, matching ROLE/STILL. Without an invocation context the\nwrapper passes through unchanged, so bare unit calls are unaffected.\n\nRegression in model-connector.client.test.ts: with a scope the online\nWan call records one IMAGE invocation (RUNNING -\u003e SUCCEEDED, 500000\nmicros, ESTIMATED); a per-task cap below the catalog price blocks before\ndispatch (COST_LIMIT_BLOCKED), the request never leaves the host, and one\nBLOCKED row is written.\n\nEvidence: acceptance-artifacts/adversarial-acceptance-2026-09-13/.\n\nCo-Authored-By: Claude Opus 4.8 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/image-generation/commit/13fe1037486e5d393f986446219e457190ec1863","author":{"name":"juhailaoluo pro","email":"hillao@juhailaoluodeMacBook-Pro.local","username":""},"committer":{"name":"juhailaoluo pro","email":"hillao@juhailaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-09-14T10:01:08-07:00","added":[],"removed":[],"modified":["apps/api-nestjs/src/material-factory/model-connector.client.ts","apps/api-nestjs/test/model-connector.client.test.ts","reports/admin-brands.desktop.png","reports/admin-brands.mobile.png","reports/admin-desktop.png","reports/admin-mobile.png","reports/content-detail.check-report-desktop.png","reports/content-detail.description-candidates-desktop.png","reports/content-detail.output-desktop.png","reports/content-detail.plans-desktop.png","reports/contract-consumers.latest.json","reports/creative-history-hidden.desktop.png","reports/creative-history-restore.mobile.png","reports/creative-quality.desktop.png","reports/dependency-audit.latest.json","reports/governance-docs.latest.json","reports/governance.latest.json","reports/image-creation-1135.png","reports/image-creation-1440.png","reports/image-edit-1135.png","reports/image-edit-1440.png","reports/image-edit-390.png","reports/image-edit-768.png","reports/image-edit-result.png","reports/inference-acceptance.latest.json","reports/material-review-concurrency-guard.latest.json","reports/migrations.latest.json","reports/model-api-key-saved.png","reports/model-credential-error.desktop.png","reports/module-boundary.latest.json","reports/naming.latest.json","reports/order-concurrency-guard.latest.json","reports/prd-retry.mobile.png","reports/prd-review.desktop.png","reports/production-acceptance.latest.json","reports/production-delivery-released.desktop.png","reports/production-delivery-revoked.mobile.png","reports/production-pagination.desktop.png","reports/production-pagination.mobile.png","reports/production-review-preview.desktop.png","reports/production-security.latest.json","reports/production-single-tenant-create.desktop.png","reports/production-single-tenant-separation.desktop.png","reports/public-file-acceptance.latest.json","reports/public-file-integration.latest.json","reports/render-job-drainability.latest.json","reports/runtime-acceptance.latest.json","reports/runtime-governance.latest.json","reports/schema-sync.latest.json","reports/script-acceptance.latest.json","reports/script-generation-queue.png","reports/shijie-acceptance.latest.json","reports/sidecar-tests.latest.json","reports/storyboard-asset-dialog.desktop.png","reports/storyboard-director-guard.latest.json","reports/storyboard-frame-dialog.desktop.first.png","reports/storyboard-frame-dialog.desktop.last.png","reports/storyboard-frame-dialog.mobile.last.png","reports/storyboard-frame-dialog.mobile.saved.png","reports/template-making.1135.png","reports/template-making.1280.png","reports/template-making.1440.png","reports/template-saved-master.APPLICATION.png","reports/template-saved-master.GENERAL.png","reports/template-saved-master.SCENE.png","reports/template-types.desktop.png","reports/template-types.mobile.png","reports/toolchain.latest.json","reports/ui-acceptance.desktop.png","reports/ui-acceptance.draft-import.png","reports/ui-acceptance.latest.json","reports/ui-acceptance.mobile.png","reports/ui-acceptance.production.png","reports/ux-edit.desktop.png","reports/ux-home.desktop.png","reports/ux-home.mobile.png","reports/ux-intake.desktop.png","reports/validation-source.latest.json","reports/video-batch-paused.mobile.png","reports/video-regenerate-2026-09-08/desktop.png","reports/video-regenerate-2026-09-08/mobile.png"]}],"total_commits":0,"head_commit":{"id":"13fe1037486e5d393f986446219e457190ec1863","message":"fix(cost): record and cap online image generation invocations\n\nAdversarial acceptance found that generateConnectedImage — the online\nimage path for DASHSCOPE_WAN and OpenAI-compatible connections — called\nthe provider directly via postJson without withRecordedModelCall, the\none place that both writes a ModelInvocation and enforces the per-task\nbudget cap before dispatch. A real Wan 2.7 Pro custom-image generation\n(kind IMAGE / DESIGN_MASTER) therefore produced a genuine paid image\n(providerRequestId, ~28s, real PNG) but left no cost record, and the\nbrand's maxCostMicrosPerTask never applied. Every recorded wan2.7-image\ninvocation in the live DB came from ROLE/STILL (sidecar path); none from\nIMAGE — matching the gap. Video (sidecar) and text (connector) were\nalready wrapped and unaffected.\n\nWrap the online image call in withRecordedModelCall via a new\nconnectorImageCallPlan (modality IMAGE, connector-direct, external), map\nModelCostLimitError to the same COST_LIMIT_BLOCKED channel the text path\nuses, and report usage.images = 1 so the realized cost is ESTIMATED at\nthe catalog price, matching ROLE/STILL. Without an invocation context the\nwrapper passes through unchanged, so bare unit calls are unaffected.\n\nRegression in model-connector.client.test.ts: with a scope the online\nWan call records one IMAGE invocation (RUNNING -\u003e SUCCEEDED, 500000\nmicros, ESTIMATED); a per-task cap below the catalog price blocks before\ndispatch (COST_LIMIT_BLOCKED), the request never leaves the host, and one\nBLOCKED row is written.\n\nEvidence: acceptance-artifacts/adversarial-acceptance-2026-09-13/.\n\nCo-Authored-By: Claude Opus 4.8 \u003cnoreply@anthropic.com\u003e\n","url":"https://gitea.g-hi.com/luoanwu/image-generation/commit/13fe1037486e5d393f986446219e457190ec1863","author":{"name":"juhailaoluo pro","email":"hillao@juhailaoluodeMacBook-Pro.local","username":""},"committer":{"name":"juhailaoluo pro","email":"hillao@juhailaoluodeMacBook-Pro.local","username":""},"verification":null,"timestamp":"2026-09-14T10:01:08-07:00","added":[],"removed":[],"modified":["apps/api-nestjs/src/material-factory/model-connector.client.ts","apps/api-nestjs/test/model-connector.client.test.ts","reports/admin-brands.desktop.png","reports/admin-brands.mobile.png","reports/admin-desktop.png","reports/admin-mobile.png","reports/content-detail.check-report-desktop.png","reports/content-detail.description-candidates-desktop.png","reports/content-detail.output-desktop.png","reports/content-detail.plans-desktop.png","reports/contract-consumers.latest.json","reports/creative-history-hidden.desktop.png","reports/creative-history-restore.mobile.png","reports/creative-quality.desktop.png","reports/dependency-audit.latest.json","reports/governance-docs.latest.json","reports/governance.latest.json","reports/image-creation-1135.png","reports/image-creation-1440.png","reports/image-edit-1135.png","reports/image-edit-1440.png","reports/image-edit-390.png","reports/image-edit-768.png","reports/image-edit-result.png","reports/inference-acceptance.latest.json","reports/material-review-concurrency-guard.latest.json","reports/migrations.latest.json","reports/model-api-key-saved.png","reports/model-credential-error.desktop.png","reports/module-boundary.latest.json","reports/naming.latest.json","reports/order-concurrency-guard.latest.json","reports/prd-retry.mobile.png","reports/prd-review.desktop.png","reports/production-acceptance.latest.json","reports/production-delivery-released.desktop.png","reports/production-delivery-revoked.mobile.png","reports/production-pagination.desktop.png","reports/production-pagination.mobile.png","reports/production-review-preview.desktop.png","reports/production-security.latest.json","reports/production-single-tenant-create.desktop.png","reports/production-single-tenant-separation.desktop.png","reports/public-file-acceptance.latest.json","reports/public-file-integration.latest.json","reports/render-job-drainability.latest.json","reports/runtime-acceptance.latest.json","reports/runtime-governance.latest.json","reports/schema-sync.latest.json","reports/script-acceptance.latest.json","reports/script-generation-queue.png","reports/shijie-acceptance.latest.json","reports/sidecar-tests.latest.json","reports/storyboard-asset-dialog.desktop.png","reports/storyboard-director-guard.latest.json","reports/storyboard-frame-dialog.desktop.first.png","reports/storyboard-frame-dialog.desktop.last.png","reports/storyboard-frame-dialog.mobile.last.png","reports/storyboard-frame-dialog.mobile.saved.png","reports/template-making.1135.png","reports/template-making.1280.png","reports/template-making.1440.png","reports/template-saved-master.APPLICATION.png","reports/template-saved-master.GENERAL.png","reports/template-saved-master.SCENE.png","reports/template-types.desktop.png","reports/template-types.mobile.png","reports/toolchain.latest.json","reports/ui-acceptance.desktop.png","reports/ui-acceptance.draft-import.png","reports/ui-acceptance.latest.json","reports/ui-acceptance.mobile.png","reports/ui-acceptance.production.png","reports/ux-edit.desktop.png","reports/ux-home.desktop.png","reports/ux-home.mobile.png","reports/ux-intake.desktop.png","reports/validation-source.latest.json","reports/video-batch-paused.mobile.png","reports/video-regenerate-2026-09-08/desktop.png","reports/video-regenerate-2026-09-08/mobile.png"]},"repository":{"id":57,"owner":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"law@g-hi.com","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"name":"image-generation","full_name":"luoanwu/image-generation","description":"","empty":false,"private":false,"fork":false,"template":false,"mirror":false,"size":969533,"language":"","languages_url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/image-generation/languages","html_url":"https://gitea.g-hi.com/luoanwu/image-generation","url":"https://gitea.g-hi.com/api/v1/repos/luoanwu/image-generation","link":"","ssh_url":"git@gitea.g-hi.com:luoanwu/image-generation.git","clone_url":"https://gitea.g-hi.com/luoanwu/image-generation.git","original_url":"","website":"","stars_count":0,"forks_count":0,"watchers_count":1,"branch_count":15,"open_issues_count":0,"open_pr_counter":1,"release_counter":0,"default_branch":"main","archived":false,"created_at":"2026-07-06T17:04:22+08:00","updated_at":"2026-09-14T21:54:13+08:00","archived_at":"1970-01-01T08:00:00+08:00","permissions":{"admin":true,"push":true,"pull":true},"has_code":true,"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"all","has_releases":true,"has_packages":true,"has_actions":true,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":true,"allow_rebase_update":true,"allow_manual_merge":false,"autodetect_manual_merge":false,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":true,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","topics":[],"licenses":[]},"pusher":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"},"sender":{"id":5,"login":"luoanwu","login_name":"","source_id":0,"full_name":"","email":"5+luoanwu@noreply.localhost","avatar_url":"https://gitea.g-hi.com/avatar/627574a890388a2aadc80ab38d22f3a0","html_url":"https://gitea.g-hi.com/luoanwu","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2026-01-30T16:28:30+08:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"luoanwu"}}... |