fix(vault-sync): surface deleted-citation as VaultSyncError - #564
fix(vault-sync): surface deleted-citation as VaultSyncError#564wondercreatemaster wants to merge 2 commits into
Conversation
propose_page converts missing claim/entity/source ids to ProposalError, so the except ArtifactNotFoundError handler was dead and the error escaped as a traceback past the CLI renderer. catch ProposalError when its cause is ArtifactNotFoundError; other proposal failures get a neutral vault-edit-rejected message so they are not mislabelled.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughForward vault synchronization now wraps ChangesVault sync error handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_vault_sync.py`:
- Around line 343-367: Strengthen test_cli_sync_deleted_citation_is_clean_error
by asserting the CLI error rendering is exactly one line, not merely
traceback-free. Normalize result.output as needed and compare it against the
documented expected Error: message while preserving the existing unknown
artifact and unknown claim id checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 815951f9-f772-4ea8-978b-1f3adf88bcfb
📒 Files selected for processing (3)
CHANGELOG.mdsrc/vouch/vault_sync.pytests/test_vault_sync.py
strengthen the CLI regression to the documented Error: contract from vouchdev#547 so a multiline non-traceback rendering can no longer pass.
What changed
sync_vault's forward-pass handler now catches theProposalErrorthatpropose_pageraises for a deleted citation (missing claim/entity/source id, withArtifactNotFoundErroras__cause__), and converts it to the documentedVaultSyncError. other proposal failures get a neutralvault edit rejectedmessage so they are not mislabelled as unknown artifacts.Why
Fixes #547.
propose_pageconverts lookup misses toProposalError, so the oldexcept ArtifactNotFoundErrorhandler was dead andvouch syncprinted an uncaught traceback instead of the CLI's one-lineError:renderer. prior attempt #548 was closed after CodeRabbit requested changes (changelog under the wrong section; everyProposalErrorlabelled as unknown artifact; comment casing) — this addresses all three.What might break
nothing on disk. existing
.vouch/layouts andkb.*methods are unchanged. only the exception type surfaced bysync_vault/vouch sync --direction forwardfor these failure modes changes (traceback → cleanVaultSyncError).VEP
n/a — bugfix, no surface change.
Tests
make checkpasses locally (lint + mypy + pytest) — 1766 passed, 50 skippedCHANGELOG.mdupdated under## [Unreleased]regression coverage:
VaultSyncErrormatchingunknown artifactProposalError→vault edit rejected, notunknown artifactError:with no tracebackSummary by CodeRabbit
Summary by CodeRabbit
Bug Fixes
Error:message without tracebacks, with clearer “unknown artifact” details.Tests