Skip to content

feat(assessment): Callback Metadata typed result files - #1214

Merged
vprashrex merged 4 commits into
mainfrom
feat/assessment-callback-files-metadata
Sep 29, 2026
Merged

vprashrex merged 4 commits into
mainfrom
feat/assessment-callback-files-metadata

Conversation

@vprashrex

@vprashrex vprashrex commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Closes #1213

Summary

  • Before: The flow used an untyped metadata.result_files envelope and included synthetic results/*_results kind mapping.
  • Now: It utilizes a typed AssessmentResultFiles model keyed by stage and uploads errors.jsonl only when necessary.
  • Required a new typing for the result files metadata.
  • Required changes to conditional uploading of error reports.

Example

{
  "success": true,
  "data": { "...": "AssessmentCallback envelope..." },
  "error": null,
  "metadata": {
    "files": {
      "topic_relevance": "https://s3.amazonaws.com/bucket/.../topic_relevance.jsonl?X-Amz-...",
      "assessment": "https://s3.amazonaws.com/bucket/.../assessment.jsonl?X-Amz-...",
      "errors": null
    }
  }
}

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

Please add here if any other information is required for the reviewer.

Replace the untyped `metadata.result_files` envelope with a typed
`AssessmentResultFiles` model keyed by stage, and drop the synthetic
`results`/`*_results` kind mapping in favour of the stage name itself.
`errors.jsonl` is now uploaded only when there is something to report,
so a clean run leaves no empty object behind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: ProjectTech4DevAI/kaapi-backend/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d3ddf9ea-9f34-4ce6-b8b4-199f8a329b37

📥 Commits

Reviewing files that changed from the base of the PR and between 8456652 and 1a43781.

📒 Files selected for processing (7)
  • backend/app/models/assessment/__init__.py
  • backend/app/models/assessment/assessment_api.py
  • backend/app/services/assessment/api/callbacks.py
  • backend/app/services/assessment/api/result_files.py
  • backend/app/tests/assessment/test_callbacks.py
  • backend/app/tests/assessment/test_result_files.py
  • docs/wiki/modules/assessment.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title feat(assessment): Deliver presigned result files in callback metadata feat(assessment): Add typed result files Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

OpenAPI changes   🔴 4 breaking changes

Caution

Downstream consumers may need an update before merging.

Breaking changes  ·  4
Method Path Change
🔴 POST /api/v1/assessment/runs removed subschema #1, subschema #2 from the input_binding/attachments/items/type request property anyOf list
🔴 POST /api/v1/assessment/runs request property input_binding/attachments/items/type was restricted to a list of enum values
🔴 POST /api/v1/assessment/runs removed the enum value video of the request property input_binding/attachments/items/type_value_map/anyOf[subschema #1]/additionalProperties/
🔴 POST /api/v1/assessment/runs the input_binding/attachments/items/type request property type changed from any to string
Full changelog  ·  8
Method Path Change
🔴 POST /api/v1/assessment/runs removed subschema #1, subschema #2 from the input_binding/attachments/items/type request property anyOf list
🔴 POST /api/v1/assessment/runs request property input_binding/attachments/items/type was restricted to a list of enum values
🔴 POST /api/v1/assessment/runs removed the enum value video of the request property input_binding/attachments/items/type_value_map/anyOf[subschema #1]/additionalProperties/
🔴 POST /api/v1/assessment/runs the input_binding/attachments/items/type request property type changed from any to string
🟢 — — a breaking change was detected but the version is still 0.5.0
🟢 POST /api/v1/assessment/runs added the new image enum value to the request property input_binding/attachments/items/type
🟢 POST /api/v1/assessment/runs added the new mixed enum value to the request property input_binding/attachments/items/type
🟢 POST /api/v1/assessment/runs added the new pdf enum value to the request property input_binding/attachments/items/type

main ↔ 0198d78b · generated by oasdiff

@vprashrex vprashrex changed the title feat(assessment): Add typed result files feat(assessment): Callback Metadata typed result files Sep 29, 2026
@vprashrex vprashrex self-assigned this Sep 29, 2026
@vprashrex vprashrex added enhancement New feature or request ready-for-review labels Sep 29, 2026
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vprashrex
vprashrex enabled auto-merge (squash) September 29, 2026 14:32
@vprashrex
vprashrex merged commit 0198d78 into main Sep 29, 2026
5 checks passed
@vprashrex
vprashrex deleted the feat/assessment-callback-files-metadata branch September 29, 2026 14:33
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.7.0-main.11 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assessment: Metadata Callback Add typed model for results

3 participants