Consume DataServer instrument geometry to build and cross-check the vetted InstrumentSpec table #143
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The provider metadata that
#124anticipated as its recorded dataset-metadatatier (tier 2 of the resolution hierarchy) now physically exists. The data
path's export now writes one per-symbol geometry sidecar
<SYMBOL>.meta.jsonbeside the bars — verified: 30 files in
/mnt/tickdata/Pepperstone, allschemaVersion2 (digits,pipSize,tickSize,lotSize,baseAsset,quoteAsset).#124's Mechanics section assumed "the Pepperstone NFS files todayare bars-only ... no instrument-structural metadata is carried" — that premise is
now superseded.
This issue is the concrete consumer realization of that tier at the
aura-ingestedge, gated on the upstream reader in data-server issuehttp://192.168.178.103:3000/Brummel/data-server/issues/3, which parses thesidecars into neutral
InstrumentGeometry.aura-ingestconsumes that neutralgeometry — never the raw cTrader JSON — so the broker-agnostic core is preserved.
It does not re-decide
#124's precedence hierarchy or thequote_currencytype fork (a distinct
ResolvedInstrumentSpecvs. widening toCow) raised in#124's comment thread; those remain#124's to settle. This is the wiring andthe two field extensions the sidecars now enable.
Work
Tier-2 wiring.
aura-ingestconsumes the neutralInstrumentGeometryfrom the data-server reader and slots it as tier 2 under
#124's precedence:explicit authored override > recorded dataset metadata (this) > vetted
instrument_spec()floor (#113) > refuse-don't-guess (exit 2). The rawJSON never enters this repo.
Cross-check arm (high value, low cost). The sidecar's
lotSize * pipSizereproduces the invariant
pip_value_per_lot = contract_size * pip_sizethatInstrumentSpecalready asserts and tests (crates/aura-ingest/src/lib.rs,the C10 contract —
pip_value_per_lotcomment + the test at ~lib.rs:474–486).A build/test-time cross-check of the hand-authored vetted table against
provider geometry is one multiplication and catches a typo in the table
against broker truth. Directly relevant to the hand-registration in
#140(NAS100, USDJPY pip
0.01, USDCHF, NZDUSD): the sidecars carry, verified,USDJPYpip0.01/ lot100000,NAS100pip1/ lot1,USDCHF&NZDUSDpip0.0001/ lot100000.Two new fields. Add
tick_sizeanddigitstoInstrumentSpec— the twofields it deliberately deferred (current floor is six fields:
instrument_id,pip_size,contract_size,pip_value_per_lot,min_lot,lot_step,quote_currency). A provider source now supplies them; they arethe deploy-grade price/tick rounding inputs.
quote_currencybeyond FX. The field is currently FX-only and typed&'static str. The sidecars carry clean ISO quote currency for every assetclass (indices
EUR/HKD/JPY/GBP, metalsUSD). This runtime-sourcedcurrency is exactly the case
#124's comment flagged the&'static strfloorcannot hold — so this consumes that fork's outcome rather than pre-empting it.
Invariants preserved
2; the sidecar feedsthe authoring/cross-check of the vetted floor, never a silent runtime fallback.
generatorand can emitnullfor non-finite broker values; it is an input the authored overridesupersedes (the spread case in
#124), not trusted truth.beside the hot path (C15), keyed by symbol — never a streamed scalar. The
Sourceseam keeps carrying only(Timestamp, Scalar)(
crates/aura-engine/src/harness.rs);data-serverenters only throughaura-ingest(M1FieldSource), not the engine core.Field mapping (verified against the 30 sidecars)
InstrumentSpecpipSizepip_sizelotSizecontract_sizelotSize * pipSizepip_value_per_lot(inquoteAsset)quoteAssetquote_currency(extends past FX)digits,tickSizemin_lot,lot_step(provider doc: current order limits, not geometry — stay authored)instrument_id(a registry choice — stays aura's, C18)References
http://192.168.178.103:3000/Brummel/data-server/issues/3(upstream neutral-geometry reader)
#124(resolution hierarchy and the tier-2 home; this realizes itstier 2),
#113(the authored vetted floor),#71(DataServer / Source seam),#140(the hand-registration the cross-check covers)Design reconciliation (specify) — cycle 0073
Spec:
docs/specs/0073-instrument-geometry-crosscheck.md. The fork below is aderived orchestrator decision on an autonomous
/bossrun (not a minuteduser decision); it carries its rationale and is vetoable.
Fork: scope boundary — how much of #143 lands now vs. defers to #124.
→ #143 delivers geometry consumption + cross-check + two additive fields;
it builds no runtime resolver and does not change
InstrumentSpec.quote_currency's type.Basis: derived. This issue's body is internally in tension — its preamble
twice defers #124's precedence resolver and the
quote_currencytype-fork(ResolvedInstrumentSpec vs. Cow widening) to #124, while work-items 1 and 4
read as if a runtime resolver and a widened currency field were in scope here.
The deferral language is authoritative, and the code confirms it: there is no
resolver or broker consumer yet (#116 / #120–123 open, unimplemented), and a
four-tier resolver producing a runtime currency is exactly #124's reserved
type-fork. So the internally-consistent reading — and the title's own framing,
"consume … to build and cross-check the vetted InstrumentSpec table" — is:
InstrumentGeometry+ a thin accessor overDataServer::symbol_meta,mirroring the existing
pub use data_server::{DataServer, DEFAULT_DATA_PATH}discipline so a consumer builds from
aura-ingestalone and never namesdata_server. The geometry data becomes available; the tier-composingresolver stays #124.
InstrumentSpecfieldstick_size: f64,digits: u32(keeps
Copy, C15-additive), authored for the 5 vetted symbols from theverified sidecars (GER40/FRA40: digits 1, tick 0.1; EURUSD/GBPUSD/USDCAD:
digits 5, tick 1e-5).
provider geometry (
pip_size,contract_size == lot_size,pip_value_per_lot == lot_size * pip_size,tick_size,digits),iterating the vetted set so #140's future additions are covered for free;
skip-if-archive-absent per the existing real-data test pattern.
(
InstrumentGeometry.quote: Stringcarries every asset class), not bymutating
InstrumentSpec's field type — that transition is #124's.The
Cargo.lockbump to the data-server commit carrying the reader (#3,closed) is part of this cycle.
Impact on related issues
resolver, the
quote_currencytype-fork, and the spread/commission tier-2channel all remain #124's (the sidecar is geometry-only, no cost models).
USDJPY (pip 0.01) / USDCHF / NZDUSD there will be validated against provider
geometry for free.
against broker truth.
(C15); the Source seam still carries only
(Timestamp, Scalar)— the accessoris not a
Source.Done — cycle 0073 (autonomous /boss run)
Shipped (local commits above the pushed anchor
fceba07, unpushed — the user pushes):8d99397spec (boss-signed) ·d5e9c27data-server lock-bump to the geometry-reader commit ·5b7cd5efeat ·dda20abaudit/close.What landed
pub use data_server::meta::InstrumentGeometry+ a thininstrument_geometry(server, symbol) -> Option<InstrumentGeometry>accessor overDataServer::symbol_meta. A consumer builds fromaura-ingestalone; the raw provider JSON never enters this repo.InstrumentSpecfieldstick_size: f64,digits: u32(struct staysCopy; C15-additive), authored for the 5 vetted symbols from the verified sidecars.tests/instrument_geometry_crosscheck.rs): the authored floor vs provider geometry —pip_size,contract_size == lot_size, the C10pip_value_per_lot == lot_size * pip_sizeinvariant,tick_size,digits,quote_currency— iteratingVETTED_SYMBOLS, skip-if-archive-absent.Extras (reviewed, kept): a hoisted
pub const VETTED_SYMBOLScollapsing the prior duplicated lists (so #140 extends one constant); atick_size == 10^(-digits)consistency guard (verified to hold across all 30 provider sidecars, so it will not false-trip #140); a re-export-nameable seam test.Scope held (per the reconciliation comment above): no runtime resolver, and
quote_currencyis still&'static str— both remain #124's. "quote_currency beyond FX" is satisfied at the geometry tier (InstrumentGeometry.quote: String).Verification:
cargo test --workspaceall green;cargo clippy --workspace --all-targets -- -D warningsclean. The cross-check ran against the live Pepperstone archive (not skipped) — all 5 vetted sidecars match the authored table. Durable rationale lifted into the C15 realization note indocs/design/INDEX.md; the cycle spec/plan dropped per the lifecycle convention.Closing.
closes #143.