Skip to content

feat(backend): add AIGC generation job API skeleton#10

Merged
ActiveInAI merged 1 commit into
mainfrom
feat/backend-aigc-generation-api
Apr 30, 2026
Merged

feat(backend): add AIGC generation job API skeleton#10
ActiveInAI merged 1 commit into
mainfrom
feat/backend-aigc-generation-api

Conversation

@ActiveInAI

Copy link
Copy Markdown
Owner

Summary

This PR adds the backend skeleton for ArchIToken AI-native AIGC multimodal generation and conversion jobs.

Scope

  • Adds Generation API endpoints:

    • POST /v1/generation/jobs
    • GET /v1/generation/jobs
    • GET /v1/generation/jobs/{job_id}
    • POST /v1/generation/jobs/{job_id}/plan
    • POST /v1/generation/jobs/{job_id}/run
    • POST /v1/generation/jobs/{job_id}/review
    • POST /v1/generation/jobs/{job_id}/approve
    • POST /v1/generation/jobs/{job_id}/reject
    • GET /v1/generation/jobs/{job_id}/artifacts
  • Adds in-memory module_generation service.

  • Covers 29 AIGC conversion modes:

    • text/image/video/CAD/PDF/drawing/model to document, table, PDF, PPT, CAD, BIM, digital twin, point cloud, image and drawing outputs.
  • Implements deterministic mock pipeline:

    • Planner -> Generator -> Evaluator -> RuleChecker -> SchemaValidator -> Approver.
  • Emits audit events for generation stages.

  • Adds OpenAPI schemas for:

    • GenerationJob
    • GenerationInput
    • GenerationOutput
    • GenerationMode
    • Artifact
    • ArtifactKind
    • SkillSpec
    • McpToolSpec
    • ModelRoute
    • GenerationStage
    • GenerationReview
    • GenerationTrace
    • GenerationJobStatus

Boundaries

  • Does not call real model APIs.
  • Does not connect to a database.
  • Does not modify frontend UI.
  • Does not modify Python agent.
  • Does not modify Docker/K8s/infra.
  • This is an API and Rust service skeleton for future frontend, third-party and Agent integration.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-targets --all-features
  • cargo build --release --bin insomeos-gateway
  • npx --yes @redocly/cli@2.30.0 lint 04-backend/openapi.yaml
  • npx --yes @openapitools/openapi-generator-cli@2.23.0 generate -i 04-backend/openapi.yaml -g typescript-fetch -o /tmp/architoken-sdk-ts
  • git diff --check

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1363a59a8e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +820 to +824
job.status = match req.decision {
GenerationReviewDecision::Approved => GenerationJobStatus::PendingApproval,
GenerationReviewDecision::NeedsChanges => GenerationJobStatus::PendingReview,
GenerationReviewDecision::Rejected => GenerationJobStatus::Rejected,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mark artifacts rejected when review rejects a job

In review_job, a GenerationReviewDecision::Rejected moves the job to GenerationJobStatus::Rejected but never updates generated artifact statuses, so artifacts can remain draft/preview after rejection. This creates an inconsistent state for callers of /v1/generation/jobs/{job_id}/artifacts and can let downstream consumers treat outputs as still usable, unlike the /reject path which does call set_generated_artifact_status.

Useful? React with 👍 / 👎.

Comment on lines +962 to +963
target_type: "generation_job".to_owned(),
target_id: job.id.to_string(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Emit artifact/stage audit events with matching target types

The shared audit_job helper hardcodes target_type to generation_job for all generation audit events, including GenerationArtifactCreated and GenerationStageCompleted. This prevents consumers from retrieving those events via target_type=generation_artifact or target_type=generation_stage, even though the API now advertises those filters, so audit filtering by target type is effectively broken for non-job generation events.

Useful? React with 👍 / 👎.

@ActiveInAI ActiveInAI merged commit a1eab19 into main Apr 30, 2026
6 checks passed
@ActiveInAI ActiveInAI deleted the feat/backend-aigc-generation-api branch April 30, 2026 02:27
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.

1 participant