Skip to content

Conformance doubles: Cognee recall shape makes upstream coverage vacuous; upload double swallows malformed multipart #67

Description

@YellowSnnowmann

Found while vendoring the conformance doubles into opencompany (tinyhumansai/opencompany#1273, review discussion) and diffing them against adapters/remote/src/conformance_test.rs @ 38a34d2. Three defects in the Cognee double, one of which silently voids real coverage today:

1. cg_recall returns the wrong shape — Cognee recall coverage is vacuously green.
The adapter (adapters/remote/src/cognee.rs:362) iterates the response as a bare top-level array (response.as_array()), but the double at conformance_test.rs:482 returns Json(json!({"results": hits})). The adapter parses that as zero hits, and the recall assertions accept empty-tolerant outcomes — so the Cognee recall leg of the conformance suite passes against a double whose shape the adapter cannot read. Either the double is wrong about Cognee's wire shape or the adapter is; whichever way it resolves, today's green proves nothing. (Our vendored copy carries a corrected double as a deliberate divergence; happy to PR it upstream once you confirm which side matches the real API.)

2. multipart_parts swallows field-decode errors.
while let Ok(Some(field)) ends the loop on the first malformed field instead of failing the request, so cg_remember stores a partial or empty record and still answers {"status": "ok"} — a broken upload path in an adapter would conform. Fail the request on a decode error instead.

3. Empty-filename key collapse.
The stored key is the part's filename; an adapter that stops sending one files every record under "", each upload overwriting the last. retains_writes-style guards still see one retained record, so the collapse is invisible. Reject a missing/empty filename (or key by dataset+filename).

Happy to send the PR for all three if the maintainers confirm the intended Cognee wire shape for (1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions