Skip to content

feat(generator): wire production AI image runtime - #67

Open
JuhaoChen666 wants to merge 6 commits into
1024XEngineer:mainfrom
JuhaoChen666:feat/generator-runtime
Open

feat(generator): wire production AI image runtime#67
JuhaoChen666 wants to merge 6 commits into
1024XEngineer:mainfrom
JuhaoChen666:feat/generator-runtime

Conversation

@JuhaoChen666

@JuhaoChen666 JuhaoChen666 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Feature Description

  • Wire the existing task-backed image generation workflows into the production server runtime.
  • Initialize PostgreSQL asset and project repositories, River workers, the QNA image provider, and the upload manager from application configuration.
  • Use config.yaml as the local default while allowing HOLONIC_ASSET_CONFIG to select another configuration file.
  • Correct the example qiniu nesting so strict configuration decoding succeeds.

Implementation Approach

  • Run River schema migrations after the application database tables are initialized.
  • Compose QNA generation, the Generator executor, persistent asset operations, and Task/Outbox dispatch in InitServerFromConfig while keeping main minimal.
  • Cover QNA generation/edit HTTP contracts and checked-in example configuration decoding.

Testing

  • go test ./... -count=1
  • go test -tags=integration ./internal/router -run 'TestProject.*PostgreSQL' -count=1
  • /Users/lx/go/bin/gopls check $(rg --files core-api -g '*.go' | sort)
  • Lefthook backend format and lint checks passed for every new commit.

Follow-ups

  • Generation run list persistence still requires a production RunReader.
  • Tileset and regenerate handlers remain stage-one placeholders.

issue

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

@JuhaoChen666 is attempting to deploy a commit to the KurodaKayn's projects Team on Vercel.

A member of the Team first needs to authorize it.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary: I found one startup wiring issue in the changed River queue initialization.

Verification: go test ./... from core-api passed, and git diff --check 1e1578880a751a16263123ee5a9a725bf08358de...76fa56ff9f4d20e17a3daa771215aa5f51eefa8d passed.

Comment thread core-api/database.go
_ = sqlDB.Close()
return nil, fmt.Errorf("app: initialize database tables: %w", err)
}
if err := InitRiver(ctx, cfg.DSN); err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

River migrations are run against cfg.DB.DSN here, but the River client is configured from cfg.Queue.DatabaseURL in InitTask/newQueue. If queue.databaseURL points at a separate Postgres database, startup migrates the app DB and then starts the queue against an unmigrated DB, leaving the river_* tables missing where River actually runs. Please migrate the queue database URL, or enforce that both DSNs must be the same.

The example placed qiniu under qna, which strict configuration decoding rejects.

Move qiniu to the top level and cover loading the checked-in example configuration.

This makes the startup template usable and resolves the reported configuration failure.
The configured QNA transport needs regression coverage for both generation modes.

Verify endpoint selection, authorization, model parameters, references, and response decoding.

This protects text-to-image and reference-image request compatibility.
The task queue requires River tables before workers and outbox dispatch can run.

Create a temporary pgx pool and apply pending River migrations after application tables.

Startup now prepares the complete database schema for queued generation jobs.
Generation routes need configured queue, image provider, and asset dependencies in production.

Build the PostgreSQL workspace, QNA executor, task manager, and upload manager from application config.

The thin server entry point now starts a usable asynchronous image generation pipeline.
@JuhaoChen666
JuhaoChen666 force-pushed the feat/generator-runtime branch from 7e8e089 to 39e5f79 Compare August 3, 2026 09:14
@JuhaoChen666
JuhaoChen666 requested a review from KurodaKayn August 3, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] config.example.yaml: qiniu indentation errors caused configuration loading to fail

1 participant