Skip to content

fix: localize alignment conflicts by stable error code - #837

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/stage2-conflict-codes
Sep 20, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/stage2-conflict-codes

Conversation

@Maya-Kid

Copy link
Copy Markdown
Contributor

A human kind-word review can return 409 after its bounded lock wait, but the UI currently labels every 409 as busy. As noted in the review of #828, a second conflict would show the wrong recovery advice.

Add a coded conflict variant alongside the legacy variant, emit alignment_busy from the existing lock-timeout branch, and select the Review message by code. Unknown, uncoded and other conflicts use a localized generic conflict message. The lock, rollback, HTTP status and worker wait policy are unchanged. This follows ADR 0004's existing stable-code localization contract; it does not redesign the error envelope or migrate unrelated callers.

Audit: legacy conflicts also represent document lifecycle/duplicates, ontology key/deletion conflicts, entity merges/reverts, governed decisions, duplicate mappings, account registration and RSS generation races. Several ingestion/governance callers match the old variant internally. They remain unchanged for separate domain-specific migrations; no existing match is silently broadened. The only producer of the new variant is the human alignment entry point.

Validation on Linux with required PostgreSQL tests: workspace 958 passed, zero failed, one existing live-HTTPS test ignored; fmt, Clippy with warnings denied and workspace build passed. Frontend 99 tests, style/type checks and production build passed. API error-envelope tests cover a second coded conflict, legacy 409, permissions, validation and redacted 500. The three authenticated contention scenarios now assert the stable code and all existing lock/rollback/pool regressions pass. English/Chinese UI tests vary the message independently of the code and verify unknown-conflict fallback. The first full run on a fresh unmigrated database failed two existing tests; after running migrations, the complete rerun above passed.

No migration. Reverting returns Review to the prior status-only message; clients receiving an unknown code already have a fallback.

Refs #798 and #828 (comment)

@WaylandYang
WaylandYang merged commit 9546ba3 into deeplethe:dev Sep 20, 2026
4 checks passed
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