Skip to content

Describe the Pipeline's Evidence, and read Evidence keys in any case - #139

Merged
jwrosewell merged 3 commits into
rcfrom
fix/evidence-conformance
Nov 15, 2026
Merged

jwrosewell merged 3 commits into
rcfrom
fix/evidence-conformance

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The Pipeline could not describe the Evidence it accepts, and usage sharing and on-premise Device Detection treated an Evidence key spelled in other letters as a different key. The Pipeline now gives its accepted Evidence, and both read keys in any letters.

Problem

  1. Pipeline (pipeline.py at 6ad5ae2d) had no way to give the Evidence keys it can use, though each Flow Element can.
  2. Usage sharing hashed the values for its repeat check under the keys as spelled, so the same values under keys in other letters were shared again, and it named each record element by the key's prefix as spelled.
  3. On-premise Device Detection gave the native evidence each key as spelled, and the native evidence matches a key's prefix with case, so Header.User-Agent was ignored.

What the specification says

advertize-accepted-evidence.md line 5 at 706de1f0: "All Flow Elements and Pipelines MUST be capable of programmatically describing the Evidence keys that they can make use of."

evidence.md line 10 at 706de1f0: "Keys MUST be case-insensitive and will usually be split into <prefix>.<field>."

What changed

  1. c62ef9f9 adds the tests: test_pipeline_evidence_key_filter.py in fiftyone_pipeline_core (the Pipeline accepts what any element accepts, reads its elements' filters when asked, and filters Evidence to what it accepts), two tests in test_share_usage_record_fields.py (a repeat with keys in other letters is shared once, and Evidence is recorded under its prefix in lower case), and test_evidence_key_case.py in on-premise Device Detection.

  2. 34dcb7a2 adds Pipeline.get_evidence_key_filter(), whose filter accepts a key when any element's filter does, reading each element's filter when a key is checked, as an element's keys can change once its data or the cloud service's answer arrives. Usage sharing hashes lower case keys for its repeat check and names each record element by the prefix in lower case. On-premise Device Detection gives the native evidence each key with its prefix in lower case.

  3. 0c514e76 closes each flow data the Evidence key case test makes.

Before you upgrade

  • A usage sharing record names each element by the Evidence key's prefix in lower case, so Header.X is recorded under header, where it was recorded under Header.
  • On-premise Device Detection uses Evidence whose key's prefix is in other letters, such as Header.User-Agent, where it ignored it.

How it was verified

  • Red, full build 43617993890 on c62ef9f, the tests alone. In all ten jobs the three Pipeline Evidence tests failed in the core tests ("3 failed, 481 passed") and the two usage sharing record tests in fiftyone_pipeline_engines_fiftyone ("2 failed, 95 passed"). In on-premise Device Detection, test_a_key_in_any_case_reaches_the_native_engine in test_evidence_key_case.py failed for Header.User-Agent, HEADER.USER-AGENT and Query.User-Agent at line 61 ("3 failed, 77 passed"), so this run is that test's red too.
  • Green, full build 43658210022 on the head 0c514e7, from rc 28e5bf2, is green. Its ten Build and Test jobs, Python 3.10 to 3.14 on Ubuntu and Windows, each passed, with test_pipeline_evidence_key_filter.py (3 tests), test_share_usage_record_fields.py (9) and test_evidence_key_case.py passing in each. The 11 Setting 'PullRequestSha' lines all name 0c514e7, and Configure printed "Left out 5 macOS entries". macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
  • An earlier green build, 43654951393 on 34dcb7a, failed in all ten jobs only at the teardown of test_evidence_key_case.py, whose flow data stayed open ("6 native object(s) still alive"). 0c514e76 reads each value inside a with block.

What it releases

fiftyone_pipeline_core, fiftyone_pipeline_engines_fiftyone and fiftyone_devicedetection_onpremise and their dependants, which Monday's release plan releases already.

What remains

Nothing.

advertize-accepted-evidence.md line 5 says every Pipeline MUST be able to
describe the Evidence keys it can use, and evidence.md line 10 says keys
MUST be case-insensitive. The tests ask a Pipeline which keys it accepts,
change an element's filter after the build, and filter Flow Data's
Evidence through the Pipeline. They send usage sharing the same values
under keys in two letter cases, expecting one record, record a key whose
prefix is not in lower case, expecting it under the lower case element,
and give on-premise Device Detection its usual keys in other letter cases
against a real data file.
The Pipeline had no way to give the Evidence it accepts. It now has
get_evidence_key_filter, which accepts a key when any of its elements
does, reading each element's filter when asked, as
advertize-accepted-evidence.md line 5 asks.

evidence.md line 10 says keys are case-insensitive. Usage sharing hashed
the values for its repeat check under keys as spelled, so the same values
under keys in another case were shared again, and it named each record
element by the key's prefix as spelled. On-premise Device Detection gave
the native evidence each key as spelled, where the native evidence matches
the prefix with case, so Header.User-Agent was ignored. The repeat check
now hashes lower case keys, the record element is the prefix in lower
case, and the engine gives the native evidence each prefix in lower case.
@jwrosewell
jwrosewell marked this pull request as ready for review November 15, 2026 02:01
@jwrosewell
jwrosewell merged commit cf520fe into rc Nov 15, 2026
3 checks passed
@jwrosewell
jwrosewell deleted the fix/evidence-conformance branch November 15, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant