feat(engine): T-1131 browse data proxy — six entity kinds, index+detail, one wire envelope (D-254 SS4)
browse_reader.rs: BrowseReader on the CityContextReader::open() pattern
— six index + six detail reads against systems.db (bodies filterable by
containing system; system/corporation/commodity details fold their join
partners). browse_proxy.rs: BrowseRequest{browse, kind, query} /
BrowseResponse{kind, status, index, detail} wire types + dispatcher;
BrowseIndexRow{id, primary, secondary} generic across kinds;
BrowseDetail a per-kind enum of field-exhaustive structs.
Demux: Inbound::BrowseRequest is the FIFTH map shape — deliberately the
last; the doc's four-shape ceiling is re-pinned at five with rationale
(six kinds x two forms folded into ONE envelope whose internal enums
pick sub-behavior, the AtlasLayerRequest.up_to precedent, instead of
twelve top-level shapes) and a hard rule that a sixth shape must
migrate to the D-225 tagged-envelope framing. Served for BOTH roles,
connection-tagged 1:1 in-order like atlas/starmap/citynames.
serve_browse_requests pub so integration tests drive the true
end-to-end pipeline. Wire-only per D-254 (T-949 precedent); v1
exclusions (cascade geometry, event logs) respected.
30 unit tests + 7 bridge_tcp integration tests (six-kind round-trip
over real TCP, reader-can-browse, no crossed responses between two
readers, unknown-id NotFound, empty-table Ready); 2 pre-existing tests
updated for the new receive_bridge_inputs parameter.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -253,6 +253,25 @@ fn main() {
|
||||
),
|
||||
}
|
||||
|
||||
// Data browser reader (D-254 §4, T-1131): read-only access to the six v1
|
||||
// registry-tier entity kinds (star systems, bodies, stations,
|
||||
// corporations, commodities, trait templates) for the companion app's
|
||||
// browse UI. Absent -> BrowseRequests are answered with an Error status
|
||||
// per request rather than a hard failure (matches every other reader's
|
||||
// "unavailable, log + degrade" convention below).
|
||||
match settled_reach_server::atlas::browse_reader::BrowseReader::open(&systems_db_path) {
|
||||
Ok(reader) => {
|
||||
tracing::info!("Browse reader opened: {:?}", systems_db_path);
|
||||
app.insert_resource(
|
||||
settled_reach_server::atlas::browse_reader::BrowseReaderResource(reader),
|
||||
);
|
||||
}
|
||||
Err(e) => tracing::warn!(
|
||||
"Browse reader unavailable ({}). Browse requests will error.",
|
||||
e
|
||||
),
|
||||
}
|
||||
|
||||
// Body physical params reader for DistrictProfile carrier layer (T-1032, D-239 §1, D-240):
|
||||
// reads hydrosphere / atmosphere / planet_class on a cache miss so the Rayon
|
||||
// cascade work item stays DB-free (D-225 pattern).
|
||||
|
||||
Reference in New Issue
Block a user