Skip to content

A14-32: TaxonInfluence(): dwMean assumes an undocumented TreeDist matrix orientation that varies by call path (latent, not currently firing) #117

Description

@ms609

R/TaxonInfluence.R:183,190matrix(Distance(tree, result), length(result)) assumes a fixed (length(result), length(tree)) dimension ordering from TreeDist::Distance. The opus finder found TreeDist's orientation actually differs by code path: (3,2) for matched leaf labels vs (2,3) for mismatched. TaxonInfluence's real use case is always the mismatched-labels path, so this is currently correct by luck, not by contract — a future call with matched labels, or a user-supplied Distance function, would silently transpose the matrix while outer(resWeights, refWeights) does not, misaligning the weights.

Verified REAL as a latent fragility (haiku verifier, code-read) — not currently reachable via the documented usage path.

Fix: assert or normalize the dimension ordering explicitly rather than relying on an undocumented upstream convention.

Filed by /red-team area 14 (opus finder, 2026-08-05).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:14Red-team focus area 14in-progressBeing fixed; claiming comment names the branchred-teamFiled by the /red-team rotationsev:lowP3: robustness / polish

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions