Skip to content

Research: OpenTaint-style contract tests and engine-gap triage for method-effect models #425

Open

Description

@PhysShell

Classification

Motivation

OpenTaint's useful architectural lesson is not “port an IFDS taint engine into Own.NET.” It separates:

  1. the deterministic analyzer,
  2. reusable, explicit rules/models for unknown library behavior,
  3. independently runnable positive/negative tests for each model,
  4. escalation when a faithful model still fails because the engine cannot express or propagate the effect.

Own.NET already has MOS/effect-summary work, adversarial fixtures, and a semantic-mutation pilot (#405). But there is still an engineering question: how do we qualify a specific human- or agent-authored model of an opaque method before anyone relies on it to suppress or emit an ownership/lifetime finding?

A “model test passed” badge cannot constitute a soundness proof. In particular, trusting an over-broad harmless / no-write summary can silently hide real bugs.

Distinct scope

This issue is model-validation infrastructure and failure classification, not implementation of new summary semantics.

Pilot research question

Can one small, reviewable contract-test workflow distinguish:

  • valid model, correctly propagated;
  • incorrect/over-broad model;
  • incorrect/under-specified model;
  • representation/dispatch gap (input call or identity never reaches the core);
  • engine limitation (valid representable effect does not propagate);
  • unknown/unresolved;
  • test/oracle error;

without weakening the current fail-closed/unknown policy?

Bounded experiment

  1. Inventory before coding. Identify the current summary schema/loaders and 1–2 concrete model candidates already relevant to an existing issue. Start with a simple effect that existing semantics can express. Use Heap-effect summaries for external code (BCL / annotations) so calls like logging can be proven harmless inside a protocol region #394 as a motivating candidate, not evidence that arbitrary logging is harmless.
  2. Pin contract and provenance. For each candidate record exact assembly/package and method signature (including overload/generics where relevant), model version, source evidence/assumptions, which receiver/argument/resource is affected, and a trust level (derived / curated-external / annotation / unknown). These are research metadata until an existing production contract supports them.
  3. Write paired tests. At minimum, one positive, one negative, and one adversarial near-neighbor per modeled effect. Exercise receiver vs argument identity, aliases, indirect writes, a guarded effect, and unknown/virtual dispatch where semantically applicable. Compile all C# cases and inspect lowered facts; reject cases the frontend cannot represent rather than counting them as engine passes/fails.
  4. Independent adjudication. State expected behavior from C#/.NET/library semantics before running Own.NET. Tests created by an LLM must be reviewed independently. A test proving that a model agrees with itself is not validation.
  5. Run existing pipeline. Prefer a lightweight standalone fixture runner over schema/engine changes. Record baseline → explicit candidate model → observed findings and evidence, with reproducible command and pinned toolchain/commit. Unknown cases must stay unknown under the existing policy.
  6. Diagnose failures at the correct boundary. Separate model mistake, parser/Roslyn lowering loss, wrong binding/dispatch, engine transfer/summary failure, bad oracle, and inconclusive. Retain a minimal repro; if a faithful model cannot pass, do not broaden it just to turn the test green.

A useful first experiment may legitimately conclude that #382 or #394 must land before the intended case is expressible. That is a documented blocker, not permission to patch those issues through this spike.

Deliverables / acceptance

Explicit non-goals

  • No Java/Kotlin/OpenTaint engine port, new IFDS implementation, or generalized taint-analysis subsystem.
  • No AI-authored summaries auto-promoted to trusted production facts.
  • No new soundness claims merely because fixture tests pass.
  • No automatic false-positive suppression or weakening of Unknown.
  • No generic model DSL, marketplace, dependency crawler, or whole-OSS benchmark in this pilot.
  • No requirement to introduce concolic execution or mutation testing; those are separate experimental techniques.

Desired outcome: a cheap, falsifiable way to determine whether reusable method-effect knowledge is actually trustworthy enough to consider for an existing Own.NET rule, while making engine limitations visible instead of hiding them inside “fixed” models.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions