Skip to content

warn on filtered user traces#1347

Open
knoal wants to merge 2 commits into
aiken-lang:mainfrom
knoal:fix/1326-filtered-user-trace-warning
Open

warn on filtered user traces#1347
knoal wants to merge 2 commits into
aiken-lang:mainfrom
knoal:fix/1326-filtered-user-trace-warning

Conversation

@knoal

@knoal knoal commented Jun 8, 2026

Copy link
Copy Markdown

Summary

  • warn when --trace-filter compiler-generated removes a user-defined trace
  • explain that this filter can change evaluation behavior, not just emitted trace messages
  • add regression coverage for the warning behavior

Fixes #1326.

Context

The current behavior reported in #1326 still reproduces on main: a user trace wrapped around a helper call can change the observable result under --trace-filter compiler-generated.

A maintainer comment on the issue notes that this is arguably the intended behavior of the filter, but also that it deserves at least a warning from the compiler.

This PR takes that narrower path.

What changed

  • add a new type warning for user-defined traces compiled under Tracing::CompilerGenerated(..)
  • emit the warning at trace-inference time on the trace @"...": ... expression itself
  • document in the warning help text that compiler-generated trace filtering may alter evaluation semantics, not only which traces are displayed
  • add tests proving:
    • the warning appears under Tracing::CompilerGenerated(..)
    • it does not appear under Tracing::All(..) or Tracing::UserDefined(..)

Validation

  • cargo test -p aiken-lang compiler_generated_filter_warns_for_user_trace -- --nocapture
  • cargo test -p aiken-lang no_filtered_user_trace_warning_without_compiler_generated_filter -- --nocapture
  • manual repro via:
    • cargo run -q -p aiken -- check /tmp/aiken-1326-repro --seed 1 --max-success 1 --trace-level verbose --trace-filter compiler-generated

The manual repro now still shows the existing pass/fail behavior, but also surfaces a warning directly on the filtered trace @"user trace": ... expression.

@knoal knoal requested a review from a team as a code owner June 8, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Trace filter erases typed expect inside traced helper

1 participant