Skip to content

row 155 B2: the protocol seam names no http type; head fields and u16 statuses, the kernel converts at its edges (TODO 34c (a)) - #974

Open
MattJackson wants to merge 2 commits into
predevfrom
lane-p3-llm-b2-head-seam
Open

MattJackson wants to merge 2 commits into
predevfrom
lane-p3-llm-b2-head-seam

Conversation

@MattJackson

Copy link
Copy Markdown
Collaborator

What

Row 155 "B2", TODO row 34c drain (a): crates/busbar-contract/src/protocol.rs names no http type. BUSBAR-1.6.0.md Part 2 #49 ("core names zero plane types") and Part 4 (every ABI shape lives in busbar-contract and is neutral). Design approved by the ARCHITECT as briefed.

The seam

Before After
ClaimsFn = fn(&http::HeaderMap, &str) fn(HeadFields<'_>, &str); claims fns read through the new protocol::head_field (first field whose value is a legal header value, name matched in any case), which is what the struck header_map + HeaderMap::get/contains_key read
DialectCodec::attach_error_response_headers(&mut http::HeaderMap, ..) plus a defaulted error_response_fields attach_error_response_headers struck; error_response_fields is the required method
EgressAuthHeaders -> Vec<(HeaderName, HeaderValue)> -> Vec<(String, Vec<u8>)>
quota_exceeded_status: http::StatusCode, auth_failure_status_and_kind: (http::StatusCode, &str) u16, (u16, &str)
private header_map (HeadFields -> HeaderMap) struck

codec.rs's WireBody and the pub use http re-export stay.

Callers moved (the kernel converts at its edges)

  • busbar-kernel/src/proto/installed.rs detect_protocol: the HeaderMap goes to the claims fold as field pairs, in the map's order (a name's first value first), through ProtocolDecl::claim_over.
  • busbar-kernel/src/proxy/mod.rs: ingress_error inserts error_response_fields pairs (the writers insert unique names, so order and multiplicity are the same); auth_failure_status_and_kind converts the u16 (same 401 fallback).
  • busbar-kernel/src/ingress/mod.rs limit_refusal: the two quota_exceeded_status reads convert the u16 (same 429 fallback).
  • busbar-kernel/src/bound_credential.rs DeclaredBuilder::headers_for: converts the plane's pairs to headers.
  • busbar-plane-llm/src/codec/proto_codec.rs DialectRef::error_response_fields: builds its writer's header map on the plane side. ProtocolWriter::attach_error_response_headers and the writers are untouched.
  • busbar-plane-llm/src/codec/{anthropic,bedrock,cohere,gemini,openai_chat,openai_responses}/mod.rs: claims signatures and bodies, and the two status fields as .as_u16(). Bedrock's SigV4 sniff keeps to_str's visible-ASCII condition (is_ascii on a legal value).
  • busbar-plane-llm/src/exchange/reply/failure.rs: reads the u16 directly.
  • busbar-voice/src/lib.rs (decl statuses, voice_egress_auth_headers) and tests/egress_tests.rs.
  • Kernel test decls: src/tests/proto.rs, src/proto/tests/neutral_protocols.rs.

Customer-visible behaviour is identical to 1.5.5: header order, multiplicity, case and statuses are unchanged.

RED

crates/busbar-contract/tests/protocol_names_no_plane_type.rs, committed first (e2b7051): a source scan of protocol.rs for http:: / use http. Against predev it lists the use http::{..} line, ClaimsFn, attach_error_response_headers, EgressAuthHeaders, both status fields and the two named() status values. The fix commit adds a_head_field_is_the_first_legal_value_under_its_name_in_any_case (case-insensitive name, a control-byte value passed over, tab legal, DEL illegal).

Overlap check (queue rule 20, widened)

git merge-tree --write-tree of this head against origin/predev 41fd7c5 and each overlapping PR head:

None of those PRs adds a new use of the moved shapes (their diffs were scanned for the seam names).

Not run locally

cargo build/test/clippy and xtask were not run on the laptop (queue rule 3). cargo fmt was run on the four touched crates. ModernCI is the proof.

…2, TODO 34c; BUSBAR-1.6.0.md Part 2 #49)

protocol.rs names http::HeaderMap (ClaimsFn, attach_error_response_headers),
http::HeaderName/HeaderValue (EgressAuthHeaders, header_map) and
http::StatusCode (quota_exceeded_status, auth_failure_status_and_kind). This
source scan fails on each of those lines until the seam drains.
…he kernel converts at its edges (TODO 34c drain (a))

BUSBAR-1.6.0.md Part 2 #49 (core names zero plane types) and Part 4 (every ABI
shape in busbar-contract is neutral): protocol.rs names no http type.

- ClaimsFn takes HeadFields; claims fns read a field through the new
  protocol::head_field (first legal value, name in any case), which is what the
  struck header_map + HeaderMap::get/contains_key read. Bedrock's SigV4 sniff
  keeps to_str's visible-ASCII condition (is_ascii on a legal value).
- DialectCodec::attach_error_response_headers is struck; error_response_fields
  is the required method. busbar-plane-llm's DialectRef builds its writer's
  header map on its own side; proxy::ingress_error inserts the pairs.
- quota_exceeded_status and auth_failure_status_and_kind are u16; the kernel
  converts in ingress::limit_refusal and proxy::auth_failure_status_and_kind
  (same fallbacks).
- EgressAuthHeaders returns (String, Vec<u8>) pairs; bound_credential's
  DeclaredBuilder converts them.
- detect_protocol (proto/installed.rs) hands the claims fold its HeaderMap as
  field pairs, in the map's order.

codec.rs's WireBody and the `pub use http` re-export stay. Header order,
multiplicity, case and statuses are unchanged from 1.5.5.
@MattJackson

Copy link
Copy Markdown
Collaborator Author

#1028 (row 155, codec host services) is stacked on this PR: it threads host: &dyn CodecHost through the DialectCodec::error_response_fields hunk in crates/busbar-contract/src/protocol.rs, plus kernel proxy/mod.rs ingress_error, neutral_protocols.rs and proto_codec.rs DialectRef. It stays DRAFT until this lands.

@MattJackson

Copy link
Copy Markdown
Collaborator Author

Rule 20 note from #1030 (row 155): disjoint hunk in crates/busbar-kernel/src/proto/installed.rs (arm_host_services drops the two usage-tap installs and its doc). A test merge is clean.

@MattJackson

Copy link
Copy Markdown
Collaborator Author

Rule 20 note from #1031 (row 155, draft): disjoint hunks in installed.rs (arm_host_services drops the cap reader), gemini/mod.rs, openai_responses/mod.rs and proto_codec.rs (the writer's translate_cap). A test merge is clean.

This branch has not been deployed

No deployments
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