8000 T106 — Audit a refused ambiguous request head on the live path and show it in min box audit by minimal-foundry[bot] · Pull Request #2809 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T106 — Audit a refused ambiguous request head on the live path and show it in min box audit - #2809

Merged
norrietaylor merged 3 commits into
mainfrom
agent/2435-audit-a-refused-ambiguous-request-head-on-the-li
Nov 1, 2026
Merged

norrietaylor merged 3 commits into
mainfrom
agent/2435-audit-a-refused-ambiguous-request-head-on-the-li

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T106 — Audit a refused ambiguous request head on the live path and show it in min box audit

slice: S15
kind: task
covers: BEP-039
size: S
est: 30 code, 120 tests
executor: agent
difficulty: routine
model: light
diagnostics: min box audit <box> lists a request head the proxy refused for ambiguous framing as a refuse line with the marker framing_ambiguous, pinned by box_audit_lists_a_refused_ambiguous_head
observability: the proxy's log line for the refused head names the box and the framing rule; the audit record carries the marker, since BEP-039's record has no field for the rule
layers:
- proxy:
- crates/bep/src/forward.rs: a test sends an ambiguous head through forward::forward_requests and reads one framing_ambiguous record for the box from the audit log; the refusal's log line names the rule (#2435)
- crates/bep/src/http.rs: the AuditSink doc says the live path writes through Flow::record, and that the trait serves this module's own tests
test: cargo nextest run -p bep live_path_audits_a_framing_ambiguous_head
- audit:
- crates/minimal/src/cmd/box_audit.rs: a test renders a framing_ambiguous record that bep serve wrote, in the proxy's id spelling
test: cargo nextest run -p minimal box_audit_lists_a_refused_ambiguous_head
produces: none
consumes: none
proof: After the proxy refuses a box's request head for ambiguous framing, min box audit <box> lists the refusal with the marker framing_ambiguous.
depends on:
- blocked by #2462
- blocked by #2782

Original issue text

Residual of #2362 (T8, epic #1501). Named by minimal-arch condition C1 on 08ed473.

crates/bep/src/http.rs records a framing_ambiguous audit event through the AuditSink trait when the proxy refuses a request head for ambiguous framing (BEP-077). Today the only AuditSink is the test Vec<AuditEvent>. The production sink has to append that record to the min/v1 audit log so that min box audit <box> shows it (BEP-039).

Blocked on #2361 (T9), which builds the audit record writer this sink appends through.

Done when: a production AuditSink in the proxy's connection loop appends the framing_ambiguous record with the box id and the rule name, and min box audit <box> lists it after a refused head.


Generated by Claude Code

Proof

When the proxy refuses a box's request head for ambiguous framing, the live path writes one refuse record with the marker framing_ambiguous for that box to the audit log. min box audit <box> then lists it as decision refuse github.com:443 none module_unmapped module_unmapped framing_ambiguous. The proxy log has an info line for the refusal that names box_id, marker and rule.

Notes from the agent: The live path already wrote the framing_ambiguous record through Flow::record. The new bep test pins that against a real AuditLog read back with LogReader. The code change in forward.rs moves the log line for a refused head from debug to info, so that it shows at the default bep serve log level. That line is now 'a request head was refused' and has box_id, marker and rule. Other closes stay at debug. The minimal test writes the record in the same field shape that Flow::record uses, because Validated::unchecked is test-only in bep and minimal cannot build a Flow. No file outside the layers was touched. I did not run clippy-strict.

Tests

line exit tail
cargo nextest run -p bep live_path_audits_a_framing_ambiguous_head 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-5653... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
cargo nextest run -p minimal box_audit_lists_a_refused_ambiguous_head 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-078f... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo

Verify

min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

        closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "170408471a0ee6c9",
                "span_id": "618da3226c311552",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetNetSwitch",
                "parent_span_id": "170408471a0ee6c9",
                "span_id": "da830e26e6600726",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetDenyAllOptOut",
                "parent_span_id": "170408471a0ee6c9",
                "span_id": "e04205dd9235650d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "170408471a0ee6c9",
                "span_id": "06f3bdb6838838f7",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "170408471a0ee6c9",
                "queued_behind": "0",
                "span_id": "8bf2fedcd25cea07",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "170408471a0ee6c9",
                "queued_behind": "0",
                "span_id": "9e49ae39215fc418",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "9e49ae39215fc418",
                "span_id": "fd5aaa6be7ae480c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  36.994s] 1066 tests run: 1065 passed, 1 failed, 2 skipped
        FAIL [   2.913s] (1066/1066) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Base

The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:

  • crates/minimal/src/cmd/box_audit.rs

Closes #2435

A test reads the live path's framing_ambiguous record for the box from
the audit log that min box audit reads. The AuditSink doc says the live
path writes through Flow::record.
The record carries the box id in the hex spelling bep serve writes, and
renders as a refuse line with the framing_ambiguous marker.
…fused-ambiguous-request-head-on-the-li

# Conflicts:
#	crates/minimal/src/cmd/box_audit.rs
@coderabbitai
coderabbitai Bot commented Oct 31, 2026
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a317ada1-a47d-473a-bbc3-4bc6d7f85142

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8000

arch-review: PASS · the full ruling

The change conforms to the design. The proxy already writes an audited close for an ambiguous head, as §5.7 line 216 requires. This PR proves that record in the audit log and in min box audit, with the field set that architecture.md line 505 gives. The framing rule goes to the info log line because the record has no field for it. The doc on CloseReason::rule still says "debug log line". Update it when you next edit that file.

Ruled at 168c027 against gominimal/arch@8640f85e193d by claude-opus-5-5.

@minimal-foundry
minimal-foundry Bot commented Oct 31, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at 168c0272c0bb.

Nothing to do.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 31, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 168c027. forward_requests logs one info line for a refused head, naming the box, the marker and the framing rule, with no request content. live_path_audits_a_framing_ambiguous_head drives a CL+TE head through the live request half. It asserts that no byte goes upstream, that exactly one framing_ambiguous refuse record is written for the box, and the log line. box_audit_lists_a_refused_ambiguous_head pins the min box audit line for the record under the hex box id. The AuditSink doc now says the live path does not use it. BEP-039.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 1, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 36d7c62 Nov 1, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the agent/2435-audit-a-refused-ambiguous-request-head-on-the-li branch November 1, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T106 — Audit a refused ambiguous request head on the live path and show it in min box audit

1 participant

0