Skip to content

v2.5.5 Phase 3 follow-ups: JitContext consolidation + test-data lexer + block-comment markers #116

Description

@hyperpolymath

Context

PR #102 / #105 / #106 / #107 landed the v2.5.5 context-awareness foundation modules. PR #110 wired test_context + comment_marker + ffi_kind into assail::apply_v255_context_suppression. Three follow-ups remain.

Phase 3a — JitContext analyzer consolidation

src/assail/analyzer.rs:1117..1129 has an inline Cranelift detection that downgrades mem::transmute-to-fn-ptr findings from Critical to High. PR #107 factored this into reusable src/jit_context.rs (Cranelift / Llvm / Wasm / Javascript classifier + transmute_targets_fn_ptr recogniser) but the inline check still works correctly.

Consolidation: replace the inline check with calls to classify_rust(content) + transmute_targets_fn_ptr(content). Behaviour is identical for the Cranelift case; LLVM/Wasm/JS contexts pick up the same severity downgrade automatically.

This is code cleanup, not an FP reducer. Low priority.

Phase 3b — Test-data fixture lexer (test-specific suppression patterns)

ROADMAP test_context item: 'Create test-specific suppression patterns for HTTP URLs and other test data.'

Scope: a sub-lexer that recognises example/test data (example.com / test@test.com / AAAA…AAAA placeholder strings / Bearer test headers / etc.) inside files whose test_context is TestOnly or Doc. When found, flips WeakPoint.suppressed = true for findings whose location-span overlaps the test-data region.

This needs to integrate with the existing apply_v255_context_suppression pass — likely adding a (4) condition after the three existing checks.

Phase 3c — Block-comment markers

src/comment_marker.rs currently recognises markers only in LINE comments (//, #, --, ;, %). Add block-comment forms:

  • /* panic-attack: accepted - reason */ (C-family)
  • {- panic-attack: accepted - reason -} (Haskell / Idris)
  • (* panic-attack: accepted - reason *) (OCaml / SML)

Same scope rule applies (same line OR immediately preceding line). The parser needs to handle the closing */ / -} / *) properly.

Low priority — line comments cover the common case. File for tracking only.

Acceptance

Three separate PRs, one per phase. Tests + ROADMAP [~][x] per delivered item.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtKnown shortcut, drift, or hygiene owed - includes cleanup

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions