Skip to content

test(engine): port MAF review attack shapes into stream session tests - #32

Merged
MohammadHaroonAbuomar merged 1 commit into
mainfrom
mhabuomar/streaming-attack-tests
Aug 7, 2026
Merged

test(engine): port MAF review attack shapes into stream session tests#32
MohammadHaroonAbuomar merged 1 commit into
mainfrom
mhabuomar/streaming-attack-tests

Conversation

@MohammadHaroonAbuomar

Copy link
Copy Markdown
Contributor

Implements R9 from analysis/streaming-acs-vs-maf.md: the attack shapes the MAF agent-hooks review rounds surfaced, ported into end-to-end tests against the section 18.1 accounting. Test-only; no behavior change, so no CHANGELOG entry.

New file engine/tests/stream_session_attack_shapes.rs (--features streaming; a separate file so this branch does not contend with #30, whose resume-boundary straddle pair it complements):

  • Retry re-invocation across sessionsan_abandoned_attempt_settles_failed_and_its_retry_settles_clean: attempt 1 abandoned mid-stream settles Failed(UnclearedResidue) with its offsets kept for the audit record; the resumed attempt 2 settles Complete with no cross-session bleed. a_retry_cannot_inherit_the_abandoned_attempts_clearance_frontier: replaying attempt 1's clearance frontier into the retry fails closed with NonContiguousOutcome instead of releasing a gap nothing evaluated.
  • Success-then-discarda_fully_cleared_stream_the_host_never_emits_still_settles_complete: clearance is permission, not a delivery record, and the settled session offers no release point afterwards. settlement_records_clearance_not_delivery: an emitting host and a discarding host are indistinguishable to the accounting; the test pins the host-obligation boundary explicitly rather than pretending the session can audit delivery.
  • Streaming/whole-snapshot asymmetry probea_deny_lands_on_both_the_whole_snapshot_and_the_incremental_path: the same deny-bearing content refused via one section 18 whole snapshot and via section 18.1 cumulative segments, with the incremental path differing only in bounded exposure of the cleared prefix. a_clean_stream_settles_the_same_on_both_paths is the negative control.

Verified: cargo test --all-features green, cargo fmt --check clean, clippy warnings unchanged from main.

Three shapes from the MAF agent-hooks review rounds, pinned against the
section 18.1 accounting (analysis/streaming-acs-vs-maf.md, R9):

- Retry re-invocation across sessions: an abandoned attempt settles
  failed on its uncleared residue while the clean resumed retry settles
  clean, and a retry that replays the abandoned attempt's clearance
  frontier fails closed rather than releasing a gap nothing evaluated.
- Success-then-discard: a fully cleared, never emitted stream settles
  Complete, because clearance is permission and not a delivery record;
  the companion test pins that the accounting cannot distinguish an
  emitting host from a discarding one, which names the host obligation
  boundary instead of pretending to check it.
- Streaming versus whole-snapshot asymmetry probe: deny-bearing content
  reaches the same terminal outcome through one section 18 whole
  snapshot and through section 18.1 segments, with the incremental path
  differing only in the bounded exposure of the cleared prefix; a clean
  stream is the negative control and lands clean both ways.

Complements the resume-boundary straddle pair in PR #30; tests live in
a new file so the two branches do not contend.

Signed-off-by: MohammadHaroonAbuomar <40180927+MohammadHaroonAbuomar@users.noreply.github.com>
@MohammadHaroonAbuomar
MohammadHaroonAbuomar merged commit a010b1e into main Aug 7, 2026
13 checks passed
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