Skip to content

docs(api): say superseded_by is the older memory this one replaced - #1813

Merged
eldad-caura-ai merged 1 commit into
mainfrom
fix/contradictions-superseded-by-doc
Oct 4, 2026
Merged

eldad-caura-ai merged 1 commit into
mainfrom
fix/contradictions-superseded-by-doc

Conversation

@eldad-caura-ai

@eldad-caura-ai eldad-caura-ai commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Audit finding

M-101, from batch B20 (contradiction verdict correctness). The OpenAPI description of MemoryContradictionsResponse.superseded_by points the wrong way.

  • The description: "The newer memory that superseded this one; null when none is live."
  • What the route returns: GET /memories/{id}/contradictions builds the field from this memory's supersedes_id, the older row this memory replaced. The route's comment says so: "Despite the field name, memory.supersedes_id points at the OLDER memory". MCP caura_manage op=lineage returns the key the same way.
  • Where the newer rows are: in superseded_memories, and in contradictions[direction=superseded_by].
  • Why it matters: docs/public-api-stability.md makes OpenAPI response shapes part of the contract. A client built from the published schema walks the chain backwards: when superseded_by is set it marks this memory, the live winner, as stale, and treats the retired predecessor as its correction. This is the same class of bug as caura PR fix(api): align ConflictOut OpenAPI response with runtime schema fields #1536, on a different field.

Change

  • superseded_by: "The older memory this one superseded (via supersedes_id); null when there is none or it was deleted. The field name is kept for back-compat; newer memories that superseded this one are in superseded_memories and in contradictions with direction superseded_by."
  • superseded_memories: gains its own description: "Newer memories that superseded this one, each with supersedes_id pointing here."
  • No behaviour change.

The served MCP caura_manage description is unchanged. Rewording it would mean regenerating tests/fixtures/tools_list_baseline_v1.json and plugin/tools.json, and spending part of the token budget, which has 22 tokens of headroom. The MCP handler docstring already states the meaning.

Verification

  • tests/test_contradictions_superseded_by_contract.py reads both descriptions from app.openapi(). tests/test_api_contradictions.py already pins that the route returns the older row under superseded_by.
  • Tests first: the tests-only push 8755ffbe (run 37179852102) failed both new tests against main, with 8678 passing. The schema served the old "newer memory" text, and no description for superseded_memories. The fix is now amended into the same single commit.
  • No repository scripts, dependency installs, tests or builds were run on Eldad's Mac under its safety hold. CI runs the suites.

One signed-off commit. Do not merge or enable auto-merge; Eldad merges after review.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Claude Code Review — skipped: draft PR

@eldad-caura-ai
eldad-caura-ai force-pushed the fix/contradictions-superseded-by-doc branch from 8755ffb to e1db3ae Compare October 4, 2026 05:38
GET /memories/{id}/contradictions fills superseded_by from the memory's supersedes_id, which is the older row this memory replaced. The route's own comment says so, and MCP caura_manage op=lineage returns the key the same way. The OpenAPI description said the opposite, "the newer memory that superseded this one" (M-101). public-api-stability.md makes response shapes part of the contract, so a client built from the published schema walked the chain backwards: it read the live winner as stale and the retired row as its correction. The description now matches what the route returns, and points to superseded_memories for the newer rows, which now carries a description of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: eldad-caura <eldad@caura.ai>
@eldad-caura-ai
eldad-caura-ai force-pushed the fix/contradictions-superseded-by-doc branch from e1db3ae to 92c6562 Compare October 4, 2026 05:53
@eldad-caura-ai
eldad-caura-ai marked this pull request as ready for review October 4, 2026 05:54
@eldad-caura-ai
eldad-caura-ai requested a review from a team as a code owner October 4, 2026 05:54
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Review by Claude Code

Claude Code Review ✅ No issues found.


Reviewed by claude-sonnet-5-5 · cost $0.0658875

@eldad-caura-ai

Copy link
Copy Markdown
Member Author

@erni-a plear aprpove

@eldad-caura-ai
eldad-caura-ai merged commit ae56d23 into main Oct 4, 2026
18 checks passed
@eldad-caura-ai
eldad-caura-ai deleted the fix/contradictions-superseded-by-doc branch October 4, 2026 06:04
@caura-deploy-bot caura-deploy-bot Bot mentioned this pull request Oct 4, 2026
eldad-caura-ai pushed a commit that referenced this pull request Oct 4, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>backend: 3.21.8</summary>

##
[3.21.8](backend-v3.21.7...backend-v3.21.8)
(2026-10-04)


### Bug Fixes

* **contradiction:** keep Path C's judge fallback and leave RDF verdicts
to the RDF pass ([#1812](#1812))
([2b3770c](2b3770c))
* **contradiction:** record every loser no chain edge points at
([#1815](#1815))
([e7b779a](e7b779a))
* **plugin:** accept no server-pushed code or instructions over plain
HTTP ([#1808](#1808))
([6c4bc6b](6c4bc6b))


### Dependencies

* **actions:** bump the actions group across 1 directory with 2 updates
([#1754](#1754))
([d66b27d](d66b27d))
* update google-cloud-aiplatform requirement from &lt;3,&gt;=2.1.3 to
&gt;=2.2.0,&lt;3
([#1753](#1753))
([360ee02](360ee02))


### Documentation

* **api:** say superseded_by is the older memory this one replaced
([#1813](#1813))
([ae56d23](ae56d23))
</details>

<details><summary>plugin: 2.23.5</summary>

##
[2.23.5](plugin-v2.23.4...plugin-v2.23.5)
(2026-10-04)


### Bug Fixes

* **plugin:** accept no server-pushed code or instructions over plain
HTTP ([#1808](#1808))
([6c4bc6b](6c4bc6b))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Signed-off-by: release-please[bot] <release-please[bot]@users.noreply.github.com>
Co-authored-by: caura-deploy-bot[bot] <265395343+caura-deploy-bot[bot]@users.noreply.github.com>
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.

2 participants