Skip to content

chore(protocol): route header keys through constants, not string literals - #1259

Merged
joelteply merged 1 commit into
canaryfrom
chore/header-key-constants
Jun 20, 2026
Merged

joelteply merged 1 commit into
canaryfrom
chore/header-key-constants

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

headers_keys.rs's own doc says "reference these by constant, not stringly-typed lookup" — but several production sites bypassed it with raw "airc.*" / "forge.*" literals, and airc.media had no constant at all.

  • add HEADER_AIRC_MEDIA (the Envelope.media header projection, mirroring HEADER_AIRC_REPLY_TO) + re-export at the crate root
  • transcript_conv.rs: use HEADER_AIRC_REPLY_TO / HEADER_AIRC_MEDIA instead of "airc.reply_to" / "airc.media" (incl. the round-trip test lookup)
  • route_proof_commands.rs: use HEADER_FORGE_BODY_HINT / HEADER_AIRC_COMMAND_KIND instead of "forge.body_hint" / "airc.command_kind"

Why

Tidiness toward the substrate's "headers route, body forwarded opaque" model: the routing keys are now a single typed source, so a rename is a compile error, not a silent wire break. No behavior change. airc-protocol 66 tests green; airc-cli compiles.

🤖 Generated with Claude Code

…rals

headers_keys.rs's own doc says "reference these by constant, not stringly-
typed lookup" — but several production sites bypassed it with raw "airc.*" /
"forge.*" literals, and airc.media had no constant at all.

- add HEADER_AIRC_MEDIA (the Envelope.media header projection, mirroring
  HEADER_AIRC_REPLY_TO) + re-export it at the crate root
- transcript_conv.rs: use HEADER_AIRC_REPLY_TO / HEADER_AIRC_MEDIA instead of
  "airc.reply_to" / "airc.media" (incl. the round-trip test lookup)
- route_proof_commands.rs: use HEADER_FORGE_BODY_HINT / HEADER_AIRC_COMMAND_KIND
  instead of "forge.body_hint" / "airc.command_kind"

Tidiness toward the substrate's "headers route, body forwarded opaque" model:
the routing keys are now a single typed source so a rename is a compile error,
not a silent wire break. No behavior change. airc-protocol 66 tests green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply merged commit 18c88f6 into canary Jun 20, 2026
11 of 12 checks passed
@joelteply
joelteply deleted the chore/header-key-constants branch June 20, 2026 18:38
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