Unit
crates/cli/src/meta/types/authoring/v2.rs — AuthoringMetaV2::fetch_for_contract (AMT group g3-graphql-query-processing).
Intent oracle
fetch_for_contract returns Result<_, FetchAuthoringMetaV2WordError>; every failure mode in the pipeline is expressed as a wrapped error variant, so callers reasonably assume the function does not panic on remote data.
Violated property
Two unchecked indexings rely on non-emptiness guarantees that live elsewhere:
RainMetaDocumentV1Item::cbor_decode(metas[0].as_slice()).map_err(...)?[0].clone()
metas[0] is panic-free only because MetaboardSubgraphClient::get_metabytes_by_hash (a different crate, rain-metaboard-subgraph) returns Err(Empty) for an empty result set.
...?[0] is panic-free only because cbor_decode rejects zero-item decodes with CorruptMeta.
Both are true today (verified by reading both call targets), so this is a latent hazard, not a current panic: any future relaxation of either invariant — or a new caller path — turns a remote-data condition into an index-out-of-bounds panic instead of a FetchAuthoringMetaV2WordError.
Verified repro
None reachable through the current dependency behaviour; this is a fragility finding backed by the cross-crate invariant trace above, flagged from the AMT survey note that marked these indexings for adversarial attention.
Triage framing
metas.first() / .get(0) with an explicit error (or documenting the invariants at the call site) would make panic-freedom local. Possibly acceptable as-is; flagging so the reliance is a recorded decision. Not adjudicating here.
Unit
crates/cli/src/meta/types/authoring/v2.rs—AuthoringMetaV2::fetch_for_contract(AMT group g3-graphql-query-processing).Intent oracle
fetch_for_contractreturnsResult<_, FetchAuthoringMetaV2WordError>; every failure mode in the pipeline is expressed as a wrapped error variant, so callers reasonably assume the function does not panic on remote data.Violated property
Two unchecked indexings rely on non-emptiness guarantees that live elsewhere:
metas[0]is panic-free only becauseMetaboardSubgraphClient::get_metabytes_by_hash(a different crate,rain-metaboard-subgraph) returnsErr(Empty)for an empty result set....?[0]is panic-free only becausecbor_decoderejects zero-item decodes withCorruptMeta.Both are true today (verified by reading both call targets), so this is a latent hazard, not a current panic: any future relaxation of either invariant — or a new caller path — turns a remote-data condition into an index-out-of-bounds panic instead of a
FetchAuthoringMetaV2WordError.Verified repro
None reachable through the current dependency behaviour; this is a fragility finding backed by the cross-crate invariant trace above, flagged from the AMT survey note that marked these indexings for adversarial attention.
Triage framing
metas.first()/.get(0)with an explicit error (or documenting the invariants at the call site) would make panic-freedom local. Possibly acceptable as-is; flagging so the reliance is a recorded decision. Not adjudicating here.