feat(lookup)!: return null for not-found, v0.2.1 (AGG-113)#5
Merged
Conversation
Contract change (AGG-113): - GET /single?iin=X&phone=Y found → object, not found → null - GET /single?iin=X found → array of rows, not found → null - POST /multi per-item: object | array | null | error - OpenAPI: response schema is `oneOf: [object, array, null]` - Not-found is a valid 200 response — the API no longer conflates "no data" with "empty result" and no longer risks a 408 on empty CH-lookups (that path was already returning [] but the shape was ambiguous with a legitimate iin-only lookup that happens to have zero rows). 408 remains reserved for real slowness in vaultee-pipelines / DDM, not for "the pair does not exist on the replica". Bump: 0.2.0 → 0.2.1 (contract widen — old callers that already tolerated empty [] must now also handle null). Not in scope of this PR: - Pipeline fast-path on 0-row CH-lookup: separate saga. Existing lookup_by_beeline*.yaml.tmpl publish_to_session uses `type: file` which DDM does not support (io_operation/publish_to_session.rs errors "Publish file in session is not supported"), and per AGG-112 Stage 6 the DDM Beeline executor is not polling tasks at all, so no lookup pipeline actually runs today. Pipeline-side fast-path is worth landing only after the executor is back and the publish_to_session shape is redesigned. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AGG-113 API contract fix —
/singleand/multinow returnnullfor pairsthat don't exist on the PKB replica, and status codes are cleaned up so a
missing pair no longer risks a 408 timeout.
Before:
/singlereturned[]on not-found, which was ambiguous with aniin-only lookup that happens to have zero rows, and
/multihad no way toexpress «one item was not found» distinct from «one item's lookup failed».
After:
GET /single?iin=X&phone=Y— found → object, not found →null.GET /single?iin=X(no phone) — found → array, not found →null.POST /multi— per-item:object | array | null | error, same order as input.responses.200.schemaisoneOf: [object, array, null]for/singleand array-of-that-plus-error for
/multi.408stays reserved for real slowness in vaultee-pipelines / DDM; asuccessful pipeline run that returns an empty payload is now a plain
200 null.Bump:
0.2.0→0.2.1— contract widen. Old callers that alreadytolerated
[]must now also handlenull.Not in this PR
The AGG-113 description also asks for a pipeline-side fast-path on 0-row
ClickHouse lookups. Skipped here because:
lookup_by_beeline*.yaml.tmplusespublish_to_session { type: file }which DDM does not support (
Publish file in session is not supported—
ddm/crates/task_executors/io_operation/src/publish_to_session.rs).at all right now, so no lookup pipeline actually runs — the 30s client
timeouts observed in prod are «tasks stuck in
PENDING», not «0-rowhang in
pull → decrypt → publish».is back and (b)
publish_to_sessionfor lookup results is redesignedto fit DDM's supported shapes (JSON via
extract, not file). Both areout of scope for this PR and belong in a follow-up saga.
Test plan
pytest -q— 50 passedruff check src tests— all checks passedv0.2.1inkartel-deploy/argo/overlays/vaultee/kz-scoring-api.yamlafter CIpublishes the image.
/single//multihandlesnull(previously[]) — coordinate with Beeline-API team before rollout.🤖 Generated with Claude Code