Skip to content

fix(delegation): proof doors take a list of public origins; rust_decimal drops rkyv - #474

Merged
TAIPANBOX merged 6 commits into
mainfrom
fix/wave3-door-origins
Oct 19, 2026
Merged

TAIPANBOX merged 6 commits into
mainfrom
fix/wave3-door-origins

Conversation

@TAIPANBOX

Copy link
Copy Markdown
Owner

Wave 3 (2026-10-19), T3. Measured on a stack-single 1.3.1 box: an agent on the agents network calling http://tokenfuse-gateway:4100 is refused 401 because the door checks htu against one configured origin, while the same token from the host is admitted.

  • TOKENFUSE_DELEGATION_ORIGINS and TOKENFUSE_MCP_PROOF_ORIGINS: comma lists of public origins, normalised and validated (no userinfo, path, query, fragment, port 0); the single-origin variables still work; the Host header is never read. A proof htu with a fragment is now refused at every door (RFC 9449).
  • rust_decimal 1.43.0 in crates/cluster removes rkyv 0.7 (RUSTSEC-2026-0235) from the lockfile.

This draft starts at the red-first commit 18e7f93 so CI shows the new tests red; the fix follows. CI is the first compile of this branch; pushed by the supervisor after a clean secretscan diff.

🤖 Generated with Claude Code

TAIPANBOX and others added 6 commits October 19, 2026 20:38
…rst)

Scaffold and tests for CLAUDE.md invariant 138. The delegation door, the
agent-token door and the MCP broker's proof door take a list of public
origins; a proof is accepted when its htu is one of them at the route's path.

The product code keeps today's behaviour in this commit: the single origin
is the only one used, and the list stubs (origin::normalize_origin,
origin::expected_url, origin::parse_origin_list, chainproof::origins_from_values)
return what the single-origin code returned. The tests name the behaviour the
fix must reach and fail on the assertions, not on compilation.

Red on this commit (run by CI, not locally): a proof addressed to a second
configured origin is refused; the first origin spelled with its default port
is refused; a fragment in the htu is admitted; a list with a trailing comma,
a path or user information is accepted at startup.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A gateway reached at more than one address (a public name and an internal
one) now accepts a delegation or broker proof addressed to any configured
origin at the route's path (CLAUDE.md invariant 141).

- TOKENFUSE_DELEGATION_ORIGINS and TOKENFUSE_MCP_PROOF_ORIGINS take a
  comma-separated list, read beside the single-origin variables. Each entry
  is normalised as wardryx's normalizeOrigin does and must be
  scheme://host[:port] with nothing after the port; a bad entry or an empty
  list refuses to start, naming its variable.
- dpop::origin::expected_url chooses the configured origin the proof names,
  reading the htu before the signature. The verifier then checks the
  signature over that same claim, so nothing can change it after the choice.
  Never a Host header.
- dpop::verify_proof refuses a fragment in the htu (RFC 9449 section 4.3).
  This changes every door, not only the new list.
- The delegation door, the agent-token door and the MCP broker's proof door
  use the same rule. The Proving struct carries origins: Vec<String>.

Release notes under docs/releases/UNRELEASED.md, invariant 141 in CLAUDE.md,
the README paragraph and the docs/25 table row.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
RUSTSEC-2026-0235 (rkyv 0.7.46, patched only in 0.8.17) reached
crates/cluster/Cargo.lock through openraft, byte-unit and rust_decimal 1.42.1,
which requires rkyv ^0.7.46 behind an optional feature. rust_decimal 1.43.0
drops that dependency, and byte-unit's requirement (^1.15) admits it.

The bump is lockfile-only: `cargo update -p rust_decimal --precise 1.43.0`
in crates/cluster removes rkyv, rkyv_derive and the crates only rkyv used,
also adds rand 0.9.5 with rand_chacha and rand_core 0.9, which rust_decimal 1.43.0 names as an optional dependency
in the manifests. The root Cargo.lock never contained rkyv.

The ignore entry in .cargo/audit.toml now matches nothing. Its comment says so,
and its removal is left for a follow-up, because the teeth cases that edit the
entry must be re-pointed first and CI has not run them against the new config.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Four test names were used both in mcp_door and in delegation_origins. Renamed the
mcp_door ones with the door's name; no assertion changed.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
… new tests

Clippy with -D warnings refused the test module's `use base64::Engine as _`,
which the module-level import already brings in through `use super::*`, so
the lib test target did not compile and the stated-numbers baseline in the
teeth shards read red on a clean tree (UNJUDGEABLE, CI run 39315890343).
The badge and PROGRESS.md now count the 23 tests this branch adds: 6 in
dpop::origin, 1 in gateway::chainproof, 16 in tests/it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… so under Upgrade

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TAIPANBOX
TAIPANBOX marked this pull request as ready for review October 19, 2026 21:21
@TAIPANBOX
TAIPANBOX merged commit 3b0e598 into main Oct 19, 2026
16 checks passed
@TAIPANBOX
TAIPANBOX deleted the fix/wave3-door-origins branch October 19, 2026 21:21
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