Skip to content

humanitarian_verification response shape parity between OpenAI / Groq / Test #269

Closed

Description

@kilodesodiq-arch

Problem Statement. humanitarian_verification.py::_get_deterministic_response builds
the response out-of-band; OpenAI / Groq responses are parsed from raw JSON. The test
provider path serialises its own dict via json.dumps(separators=(",",":")) whereas
OpenAI / Groq responses come from data["choices"][0]["message"]["content"] and can be
mid-edit-token truncated.

Why it matters. Stable output is required by callers of the verification endpoint.

Technical Context.
app/ai-service/services/humanitarian_verification.py.

Expected Outcome. A parse_verification_response(provider_name, raw_content) function
unifies parsing; deterministic stamp on every response (provider, model,
prompt_variant).

Acceptance Criteria.

  • E2E tests against all three providers produce identical-shape responses.
  • A snapshot test pins the JSON schema.

Files or modules likely to be affected.
app/ai-service/services/humanitarian_verification.py,
new app/ai-service/schemas/humanitarian_verification_v2.py.

Difficulty. Medium
Estimated effort. M



Backlog item #61 from `docs/maintainer-issue-backlog.md.

Activity

  1. Opulencechuks commented on Jul 15, 2026

    @Opulencechuks
    Contributor

    I am confident that i can work on this issue having worked on similar issues in the past

  2. grantfox-oss commented on Jul 16, 2026

    @grantfox-oss

    🦊 GrantFox — @Opulencechuks has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #269)
    2. Your PR will be reviewed by the ChainForgee maintainers

    Good luck! Track your progress on GrantFox.

  3. grantfox-oss commented on Jul 17, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign | FWC26 campaign!

    @Opulencechuks's PR #375 was approved and merged by @kilodesodiq-arch.

    🏆 @Opulencechuks: You earned 40 FoxPoints for this contribution! Your current tier: Builder (2,254 total points). Track your full progress on GrantFox.

    👏 Great work, @Opulencechuks! Keep contributing to ChainForgee.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions