Skip to content

config(#3532): validate custom_harness registrations against parsed Cargo target metadata #3608

Closed

Description

@EffortlessSteven

Finding

TestHarnessRegistration::file_wide_harness_evidence grants file-wide evidence role from the repository's own kind = \"custom_harness\" declaration alone. The claim is typed and fail-closed at parse time (exact target, identity participation, provenance recorded), but nothing validates it against the workspace's actual Cargo target metadata: a target that is not declared harness = false in Cargo.toml, is stale, or does not exist still receives file-wide evidence role — suppressing production probing for that file on an unverified premise (#3593 review round five, coderabbit, raised at head 3faa554).

  • repository: EffortlessMetrics/ripr-swarm; branch feat/analysis-test-harness-modeling-3532; inspected head 3faa5542f (2026-08-31); not present on main (535138c)
  • classification: verified_current (mechanics by reading; the normal registered-repo case behaves as declared)
  • concurrent PRs: analysis(rust): model custom test harnesses and registered test-producers #3593 only
  • confidence: high on mechanics; real-world impact requires a misdeclared registration

Acceptance

  • surface parsed Cargo [[test]] target metadata (target path + harness flag) into the registry validation path (reusing the existing workspace/package manifest loading rather than a new discovery walk)
  • a registration whose target is missing from Cargo metadata, or whose Cargo target still has harness = true, produces a typed limitation (or is demoted to per-function behavior) instead of file-wide evidence role
  • discriminating fixture: a misdeclared custom_harness target keeps seeding production seams and records the conflict

Activity

  1. EffortlessSteven commented on Sep 4, 2026

    @EffortlessSteven
    MemberAuthor

    Reconciliation: harness registration validation delivered — PR #3632 (merge 1941b1d)

    Landed. PR #3632 merged to main at 1941b1d5 (2026-09-04), Linux CI green on the final head after 8 review rounds (devin, codex, coderabbit; every substantive finding fixed with pinning tests, every thread replied and resolved).

    Delivered:

    • custom_harness registrations validated against parsed Cargo target metadata: declaration map with lexical path resolution (CurDir/ParentDir collapse), workspace-membership gating (root + members globs + excludes + path-dep closure; recursive **; absent members fail closed), edition-2015 autotest-discovery default, name-only declarations crediting only tests/<name>.rs, malformed manifests → ManifestUnavailable.
    • Failure semantics: the libtest-mimic adapter runs only on HarnessDisabled; every other verdict records a typed limitation (harness_flag_conflict / target_not_declared / manifest_unavailable) with no demotion and no subjects; all seven role-consumption surfaces share one validated grant.
    • Cache generations bumped (1.3→1.4, 0.9→0.10, 0.10→0.11) with warm-cache regressions.
    • CHANGELOG Unreleased entry; spec 0153 ownership contract updated; traceability wired.

    Residual (tracked): exotic workspace edge cases consolidated in #3634 — workspace-inherited path deps, exclude wildcard nesting boundaries, ambiguous exclude×path-dep precedence (documented exclude-wins), and a cargo-metadata-backed validation rework as the principled endgame. All residual gaps fail in the under-credit direction.

    Claim boundary: valid registrations on conventional layouts behave byte-identically to pre-#3608 (zero golden drift); misconfigurations now degrade with named typed limitations instead of silently granting harness authority.

    Claim boundary note: the emulation's residual edge cases fail in the under-credit direction; #3634 owns the cargo-metadata-backed rework.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions