Skip to content

feat(protocol): rename ingest.* + grounding.* to match categorized namespace (Phase 2c-2c)#505

Merged
jinhongkuan merged 1 commit into
devfrom
feat/daemon-02c-2c-namespace-migration
May 23, 2026
Merged

feat(protocol): rename ingest.* + grounding.* to match categorized namespace (Phase 2c-2c)#505
jinhongkuan merged 1 commit into
devfrom
feat/daemon-02c-2c-namespace-migration

Conversation

@jinhongkuan

Copy link
Copy Markdown
Contributor

Summary

Third in the daemon-as-process arc (plan). Aligns wire method names on ProtocolClient and daemon.runtime with the categorized prefixes that Phase 2c-1 (#500) locked in.

Without this, the facade quietly drifts from the namespace it's supposed to enforce — call sites in 2c-4+ would either inherit the drift or ship two renames in one PR. Better to do it now while the surface is small.

Renames

Old wire name New wire name
ingest.ingest write.ingest
ingest.link_commit write.link_commit
grounding.validate_symbols grounding.lookup.validate_symbols
grounding.extract_symbols grounding.lookup.extract_symbols
grounding.get_neighbors grounding.lookup.get_neighbors
grounding.analyze_region grounding.analyze.region
grounding.batch_analyze_regions grounding.analyze.batch

Files touched

  • protocol/client.py — 7 facade method strings
  • daemon/runtime.py — 2 server-side registrations
  • tests/test_protocol_versioning.py — test stub registration
  • tests/test_protocol_transport_uds.py — test stub registration
  • tests/test_protocol_namespace_invariant.py (new) — 3 invariants:
    1. Every method-name string in ProtocolClient matches a categorized prefix or the explicit allowlist (AST-walked).
    2. Every register(...) call in daemon.runtime matches the same.
    3. WIRE_METHOD_ALLOWLIST entries are still referenced somewhere (catches dead entries).

Open question — please weigh in

egress.deliver is NOT renamed in this PR. It sits on the explicit allowlist with a comment. The 2c-1 categorization committed to five prefixes (read.*, write.*, grounding.lookup.*, grounding.analyze.*, system.*); egress is implicit in the parent plan but not explicit. Three options for follow-up:

  1. Add EGRESS_PREFIX = "egress." to the categorization — egress is conceptually distinct (outbound delivery, not ledger mutation). Adds a sixth category + @egress_tool decorator. Symmetric with IngestAdapter/EgressAdapter Protocols.
  2. Rename egress.deliverwrite.deliver — conflates ledger mutation with delivery semantics; I'd push back on this, but it keeps the namespace at 5.
  3. Keep the allowlist — cleanest until egress.* actually grows beyond deliver (today it's a single method).

My recommendation: Option 1, do it in 2c-3. The daemon supervisor PR is the natural time to expand the categorization since it's also when egress dispatch first runs for real.

Compatibility

Breaking at the wire level if anything outside this repo speaks the protocol — but nothing does yet. The protocol is in-tree pre-extraction; only ProtocolClient (which this PR updates) and daemon.runtime (which this PR updates) reference the names.

Test plan

  • pytest tests/test_protocol_namespace_invariant.py — 3 passing
  • pytest tests/test_protocol_*.py tests/test_mcp_adapter_bootstrap.py — 36 passing (no regressions)
  • ruff format --check . && ruff check . clean
  • mypy protocol/ daemon/ clean
  • CI green on dev

Known limitation

Bicameral preflight unavailable this session (MCP server disconnected). Will validate against the ledger before opening 2c-3 (daemon supervisor).

Plan refs

🤖 Generated with Claude Code

…mespace (Phase 2c-2c)

Third in the daemon-as-process arc (plan: thoughts/shared/plans/
2026-05-22-daemon-as-process-arc.md). Aligns the wire method names on
ProtocolClient and daemon.runtime with the categorized prefixes that
Phase 2c-1 (#500) locked in.

Without this, the facade quietly drifts from the namespace it's supposed
to enforce — call sites in Phase 2c-4+ would either inherit the drift or
ship two renames in one PR.

Renames:
- ingest.ingest             → write.ingest
- ingest.link_commit        → write.link_commit
- grounding.validate_symbols → grounding.lookup.validate_symbols
- grounding.extract_symbols  → grounding.lookup.extract_symbols
- grounding.get_neighbors    → grounding.lookup.get_neighbors
- grounding.analyze_region   → grounding.analyze.region
- grounding.batch_analyze_regions → grounding.analyze.batch

Updated:
- protocol/client.py — 7 facade method strings
- daemon/runtime.py — 2 server-side registrations
- tests/test_protocol_versioning.py — test stub
- tests/test_protocol_transport_uds.py — test stub

New: tests/test_protocol_namespace_invariant.py — 3 invariants:
- ProtocolClient method-name strings match a categorized prefix (AST-walk)
- daemon.runtime registrations match a categorized prefix
- WIRE_METHOD_ALLOWLIST stays fresh (no dead entries)

Open question deferred: egress.deliver still lives under egress.*. The
2c-1 categorization didn't include EGRESS_PREFIX; adding one vs renaming
egress.deliver → write.deliver is its own design call. Added to the
allowlist with a comment explaining the gap. Will surface in PR body.

Bicameral preflight UNAVAILABLE this session (MCP server disconnected) —
will validate against ledger before 2c-3.

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

coderabbitai Bot commented May 23, 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: 84932e91-2f4d-4c01-887d-170f75532f37

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-2c-namespace-migration

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.

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.

1 participant