desk: Bifrost half of the Fork Desk answer binding (ports, routes, per-call deciders) #40
Loading…
Reference in a new issue
No description provided.
Delete branch "heimdall/desk-bifrost-half"
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?
Bifrost's half of the Fork Desk answer binding (follow-ups chat-s5852-5853, s5910-5911, s5939-5940, s5951-5951). Do not merge or deploy before Eureka's door cut exists. Huginn #31 is merged (664be6e).
What it is
/api/desk/{mind}/forks,/forks/{fork_id}and/answersbehind one pipeline: bearer, audiencebifrost-desk, scope, Active member (before the body is read), body shape,{mind}lookup, door call, outcome mapping. Auth and the door are ports (IDeskCredential,IDeskDoor). No production implementation of either is registered, and the routes are mapped only when theDeskconfig section exists; with it configured but no ports registered, startup fails loudly. Production is unchanged.DeskDoorContext(Mind, Authority, Subject, Deciders)travels with every answer, read and list; admin-set in configuration, 1..64 unique ids (CultLib #80), checked at startup and again before every door call; no HTTP field, header, query or body key can alter it (a body namingdecidersisbody_unknown_field).stale_forkattaches the current card fromReadAsync; any door fault or out-of-contract outcome is 503unavailable.Verification
Desk filter 124/124. Full
Bifrost.Web.Tests: 730 pass / 38 fail on the branch before round 2; the same 38 fail on origin/main73c6f50(21 BridgeCliTestswhere.exe, 8 ConceptTallyExport, 6 OidcIssuer, 2 ProviderAdvertisement, 1 ConceptVoteRateLimit; environmental under net8-on-net10 roll-forward). Branch-only failures: none.Soul verdict (one pass, sonnet): Holds
About 70 hostile probes (auth order, forbidden keys including
answerer, BOM/invalid UTF-8/%00/double encoding/5000-char Mind, query/header/cookie never reaching the door context, 503 Retry-After, 405s, CORS preflight): none breached. 12 of about 30 hand mutants survived; round 2 closed them with tests (wrong-Mind deciders, exact MaxBodyBytes boundary, retryAfterSeconds from config, case-sensitive audience, no-store, NotFound card read, shared socket, throwing port → 503) and Hands re-killed 20 hand mutations. The second Soul pass on the fixes was skipped by the quota rule.Survivors and deviations
/api/desk/x/answers/gets 404fork_unknown, not 401 (leaks route grammar only; contract says bearer first).limit=007andlimit=1%32are accepted.AllowedOrigin(required),MaxBodyBytes,RetryAfterSecondsadded to Desk config; empty Minds list fails startup; a list query withoutlimitdefaults to 50; an unparseable target is 404fork_unknownwith no auth check; repeated JSON keys, invalid UTF-8 and over-cap bodies arebody_invalid.a530aaa,f03027d,ef862f2).Gaps for the wire (Huginn / Eureka / Libby)
Door framing and encoding (Bifrost has no MessagePack package); the read request must return the card with
options_hashcomputed by Huginn;MindRefusalcollapsed at the door to an unavailable-class answer; one socket per Mind, SO_PEERCRED check on Huginn's side; contract prose says 200 for stored Refused while vectors give 4xx (CultLib #77 may have fixed it); norate_limitedcode, so no rate limit; the bearer, audience and scopes are Bifrost PR #37's cut (blocked).🤖 Generated with Claude Code
POST /api/desk/{mind}/answers behind one pipeline: raw target, bearer, audience, scope, Active membership, body shape, {mind} lookup, door. Mapped only when the Desk section exists; a configured desk without its credential and door ports stops startup. Stale_fork answers carry the current card read through the door. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>GET /api/desk/{mind}/forks and /forks/{fork_id}; the query is judged as request_invalid before the Mind lookup. Every door call (answer, read, list) carries the configured deciders; the vectors' 22 auth cases and 57 route cases now replay for all three routes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>