A definition whose source answered with no buckets is invisible: neither a result nor a refusal

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Start by tracing ComputeReport and the public contracts in Data\ResultSet and Data\RunReport, then compare how selected definitions, empty readings, refusals, requested, and computed are represented. Done means a surface can distinguish an empty answer from a definition not selected for the run without treating the empty answer as a refusal; the payload does not name a test file.

Written by the indexing model from the issue text.

Description

Found while building module-ecommerce-reporting-api.

ComputeReport records a refusal only when it could not obtain a definition. A source that answers
successfully with an empty list<Reading> produces no result row, no refusal, and no increment to
$computed:

$readings = $this->read($definition, $run->tenant_id, $window);   // []
if ($readings instanceof RefusalReason) { ... }                   // not taken
foreach ($readings as $reading) { ... }                           // no iterations

Neither published shape closes the gap afterwards. Data\ResultSet carries lines and refusals
and does not say which definitions the run requested. Data\RunReport carries requested as a
count, and computed counts buckets rather than definitions, so the counts cannot be
differenced to recover the names either.

So a surface cannot distinguish "the source answered, and there was nothing in that window" from
"that definition was not part of this run at all". Both are silence, which is the shape the module
exists to remove — §4.2 of the wave brief is that a run must never make an unanswered question look
like an answered one, and this is the one path where it still can.

The run-level version of the same distinction is answerable and the API package answers it: no run
at all is a 404 no_run, and a run with zero results and zero refusals is a 200 with two empty
arrays.

Smallest fix that would close it: have ComputeReport record the definition names it selected — on
the run, beside refusals, or in RunReport — so a surface can subtract. An empty-answer refusal
reason would be wrong: the source did answer, and "nothing happened in this window" is a legitimate
result rather than a failure to obtain one.

Dominant language
PHP
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from liberusoftware/module-ecommerce-reporting

All issues in liberusoftware/module-ecommerce-reporting

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.