Repository navigation
feat: add typed recall-pack target evidence - #1054
Conversation
Problem: recall packs still stored opaque payloads and only exposed daemon endpoints after the durable reader-state work. That left #867 without explicit degraded-target evidence and without CLI/MCP parity for recall-pack operations. What changed: normalize recall-pack saves through the Polylogue facade into schema-versioned item payloads with resolved/degraded counts, add conversation/message/mark/annotation target resolution, preserve unsupported future targets as degraded items, and expose recall-pack list/save/delete through CLI and MCP with updated witness coverage. Verification: pytest -q -n0 tests/unit/storage/test_user_state_contracts.py tests/unit/daemon/test_web_reader.py::TestReaderUserState::test_recall_packs_roundtrip_cited_conversations tests/unit/cli/test_user_state_command.py tests/unit/mcp/test_user_state_tools.py; pytest -q -n0 tests/unit/mcp/test_tool_schema_witness.py tests/unit/mcp/test_envelope_contracts.py tests/unit/cli/test_click_app.py::TestCliMetadata::test_all_subcommands_registered tests/unit/mcp/test_user_state_tools.py tests/unit/cli/test_user_state_command.py; devtools render-all --check; devtools verify --quick.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dc6a58b5f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for key, value in payload.items(): | ||
| if key not in {"items", "summary", "reason"}: | ||
| normalized_payload[key] = value |
There was a problem hiding this comment.
Block caller payload from overriding normalized recall fields
After building a normalized recall-pack payload (schema_version, items, resolved_count, degraded_count), the loop copies every key from the caller payload except items/summary/reason, which lets clients overwrite those normalized fields by sending keys like schema_version, resolved_count, or degraded_count in payload_json. In that case the stored pack can claim incompatible counts/version relative to its resolved items, breaking the typed-evidence contract this change introduces.
Useful? React with 👍 / 👎.
Summary
Add the next #867 recall-pack slice: recall packs now store typed target evidence with explicit resolved/degraded item states, and recall-pack operations have CLI and MCP parity.
Problem
After target-aware marks, annotations, and saved views landed, recall packs still accepted an opaque payload and only exposed daemon endpoints. That left recall packs unable to cite message, mark, and annotation targets with auditable degraded states, and left operator/agent surfaces without parity.
Solution
Polyloguefacade intoschema_version: 1payloads.conversation_idsinput while converting it to typed conversation items.statusanddisabled_reasoninstead of dropping them.polylogue user-state recall-packs list/save/delete.list_recall_packs,save_recall_pack, anddelete_recall_pack, with envelope classification and regenerated tool-schema witness.docs/plans/mk3-execution-log.md.Ref #867
Verification
pytest -q -n0 tests/unit/storage/test_user_state_contracts.py tests/unit/daemon/test_web_reader.py::TestReaderUserState::test_recall_packs_roundtrip_cited_conversations tests/unit/cli/test_user_state_command.py tests/unit/mcp/test_user_state_tools.py-> 24 passedpytest -q -n0 tests/unit/mcp/test_tool_schema_witness.py tests/unit/mcp/test_envelope_contracts.py tests/unit/cli/test_click_app.py::TestCliMetadata::test_all_subcommands_registered tests/unit/mcp/test_user_state_tools.py tests/unit/cli/test_user_state_command.py-> 46 passedruff check polylogue/api/archive.py polylogue/cli/commands/user_state.py polylogue/mcp/payloads.py polylogue/mcp/server_mutation_tools.py tests/unit/storage/test_user_state_contracts.py tests/unit/daemon/test_web_reader.py tests/unit/cli/test_user_state_command.py tests/unit/mcp/test_user_state_tools.py-> passedpython -m mypy polylogue/api/archive.py polylogue/cli/commands/user_state.py polylogue/mcp/payloads.py polylogue/mcp/server_mutation_tools.py-> passeddevtools render-all --check-> passeddevtools verify --quick-> exit_code 0, total_duration_s 27.19 before commit; pre-push quick gate at9dc6a58b-> exit_code 0, total_duration_s 17.8