You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Driven adapters stop calling application; layering test - #136
Stacked on #135. Plan: docs/superpowers/plans/2026-11-03-adapter-application-inversions.md.
Driven adapters no longer call into application, and a test now enforces the layering:
Tag backfill is a provided MetadataPort::backfill_tag_keys method; the free backfill_tag_metadata is gone.
StageTimer moves to crate::telemetry.
columnar_timestamps_ns moves to domain/columnar_batch.rs.
SyncClient is replaced by application/cluster/catch_up.rs (CatchUpService):
It fetches through new PeerRpc methods: join, sync_metadata_snapshot, sync_wal and ping. The existing sync_manifest and shard_map methods are reused.
Timeouts (300 s per request), the WAL query, the cluster credential and the call order are unchanged.
The unused PeerClient::fetch_map_version is removed.
tests/architecture.rs scans src/ and fails on a forbidden import. Grouped use crate::{…} imports are checked too. The rules:
domain imports no other layer;
ports imports neither adapters nor application;
application does not import adapters;
adapters imports application only from adapters/http/ and the Raft state machine.
The allowlist is empty: there are no violations today.
One change in error mapping: a peer's 2xx sync reply that fails to parse now reports PeerUnreachable instead of SyncFailed. Both callers handle every sync error the same way, so only the log text changes.
Gate: fmt, clippy -D warnings, unit, integration 375 and CLI 54 tests all pass.
Medium Risk
Touches cluster join/WAL catch-up and metadata tag backfill on ingest paths; behavior is largely preserved but sync error labeling and layering moves affect operational debugging.
Overview
This PR inverts adapter→application dependencies and adds a CI guard so they stay fixed.
Metadata / domain moves: Tag key backfill is now MetadataPort::backfill_tag_keys (default on the port); the free backfill_tag_metadata in application is removed. Call sites use the port method directly. columnar_timestamps_ns lives in domain/columnar_batch. StageTimer and spawn_scheduling_probe move to crate::telemetry.
Cluster sync refactor: The adapter sync_client module is deleted. CatchUpService in application/cluster/catch_up.rs replaces SyncClient, driving catch-up through SharedPeerRpc instead of a raw reqwest::Client. HttpPeerRpc implements new PeerRpc methods (join, sync_metadata_snapshot, sync_wal, ping) plus a shared decode helper. Bootstrap and peer HTTP handlers wire HttpPeerRpc into CatchUpService. PeerClient::fetch_map_version is dropped.
Enforcement:tests/architecture.rs scans src/ for forbidden cross-layer imports (including grouped use crate::{…}), with an empty allowlist.
Behavior note: A successful HTTP sync response that fails JSON parse is now classified as PeerUnreachable (was SyncFailed); callers treat sync errors uniformly, so impact is mainly log text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #135. Plan:
docs/superpowers/plans/2026-11-03-adapter-application-inversions.md.Driven adapters no longer call into
application, and a test now enforces the layering:Tag backfill is a provided
MetadataPort::backfill_tag_keysmethod; the freebackfill_tag_metadatais gone.StageTimermoves tocrate::telemetry.columnar_timestamps_nsmoves todomain/columnar_batch.rs.SyncClientis replaced byapplication/cluster/catch_up.rs(CatchUpService):PeerRpcmethods:join,sync_metadata_snapshot,sync_walandping. The existingsync_manifestandshard_mapmethods are reused.PeerClient::fetch_map_versionis removed.tests/architecture.rsscanssrc/and fails on a forbidden import. Groupeduse crate::{…}imports are checked too. The rules:domainimports no other layer;portsimports neitheradaptersnorapplication;applicationdoes not importadapters;adaptersimportsapplicationonly fromadapters/http/and the Raft state machine.The allowlist is empty: there are no violations today.
One change in error mapping: a peer's 2xx sync reply that fails to parse now reports
PeerUnreachableinstead ofSyncFailed. Both callers handle every sync error the same way, so only the log text changes.Gate: fmt, clippy
-D warnings, unit, integration 375 and CLI 54 tests all pass.