Skip to content

πŸ› Flaky prompt-safety linear-time guard: single-sample timing assertionΒ #3985

Description

@PierreBrisorgueil

What β€” The prompt-safety linear-time regression guard intermittently fails on loaded runners (three hits in 24h across unrelated PRs).
Why β€” It asserts a single-sample timing ratio (e.g. expected >= 96.35ms, got 94.76ms β€” a 1.6% miss); at that granularity CI measures the scheduler, not the algorithm.

Scope

  • modules/ai/tests/ai.prompt-safety.helper.unit.tests.js REGRESSION GUARD "tag matching stays linear...": replace the single-run threshold with a robust form β€” repeat runs and compare medians, assert the linear/quadratic growth RATIO with a generous margin, or grow the input until the sample is >>1ms. The guard's intent (no quadratic blowup) stays; the flake goes.
  • Evidence: failed on unrelated diffs (a downstream absorption and a config-only change) with deltas within scheduler noise.

Scope: validated 2026-07-25
Created via /dev:issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions