Skip to content

feat(handlers): mutation writes routed through DaemonProxy (Phase 2c-6c)#516

Closed
jinhongkuan wants to merge 1 commit into
devfrom
feat/daemon-02c-6c-mutation-writes-via-daemon
Closed

feat(handlers): mutation writes routed through DaemonProxy (Phase 2c-6c)#516
jinhongkuan wants to merge 1 commit into
devfrom
feat/daemon-02c-6c-mutation-writes-via-daemon

Conversation

@jinhongkuan

Copy link
Copy Markdown
Contributor

Summary

Phase 2c-6c — third write-migration layer. Adds protocol surface + dispatcher + proxy methods for the four mutation handlers (ratify, resolve_compliance, resolve_collision, judge_gaps). Each gets the standard facade/_impl split.

Plan refs

Test plan

  • `pytest tests/test_mutation_writes_via_daemon.py` — 5 passed, 3 skipped (~51s)
  • `ruff format --check . && ruff check .` clean
  • CI green on dev (merging on lint-only per @jinhongkuan directive)

Skipped tests

Three end-to-end ratify boundary tests (`test_ratify_through_daemon`, `test_ratify_idempotent_through_daemon`, `test_concurrent_ratify_serializes_through_daemon`) are intentionally skipped — they require seeding a decision in a ledger shared between the test process and the daemon subprocess, which is unblocked once Phase 2c-6b lands `write.ingest`. Skip-reasons cite the dependency explicitly.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6b38ca0d-b44f-4231-93c5-2df619e48c2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/daemon-02c-6c-mutation-writes-via-daemon

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@silongtan

Copy link
Copy Markdown
Collaborator

@jinhongkuan — the three skipped ratify boundary tests (test_ratify_through_daemon, test_ratify_idempotent_through_daemon, test_concurrent_ratify_serializes_through_daemon) cite "unblocked once 2c-6b lands write.ingest" as the skip reason. 2c-6b merged Sunday in #517, so those tests should be unskippable now — worth re-enabling before this lands.

Also: only Schema Persistence + CodeRabbit ran on this PR. Full MCP Regression / lint / perf gate didn't fire. PR body mentions "merging on lint-only" — confirming that's still the intent here?

Adds RatifyRequest/Result, ResolveComplianceRequest/Result,
ResolveCollisionRequest/Result, JudgeGapsRequest/Result protocol
contracts. Wires write.ratify, write.resolve_compliance,
write.resolve_collision, write.judge_gaps server-side dispatchers in
protocol/handlers/writes.py. Adds matching DaemonProxy methods.

Migrates four handlers/*.py call-sites (ratify, resolve_compliance,
resolve_collision, gap_judge) to the facade/_impl pattern with daemon
routing when ctx.daemon is reachable.

Boundary tests cover dispatcher registration, missing-descriptor error,
empty/error paths for each method. Three end-to-end ratify tests
(seed-then-ratify, idempotent, concurrent) are skipped with a clear
"requires Phase 2c-6b" reason — they need shared ledger state between
the test process and the daemon subprocess, which is unblocked once
write.ingest can seed through the daemon.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jinhongkuan

Copy link
Copy Markdown
Contributor Author

Closing during PR hygiene because this branch is stale/conflicting and should not be merged as a lint-only daemon migration. The daemon write-routing direction can continue only behind an explicit experimental or disabled-by-default path until the end-to-end ratify/write boundary is testable. Re-cut from current dev if needed, link the daemon epic, and include deterministic coverage proving production mutation writes cannot be affected accidentally.

@jinhongkuan jinhongkuan closed this Jun 7, 2026
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.

3 participants