Skip to content

Escalate chained classification when the derived output carries no verdict - #7667

Draft
EthanHealy01 wants to merge 1 commit into
mainfrom
fix/chained-classification-confidence
Draft

Escalate chained classification when the derived output carries no verdict#7667
EthanHealy01 wants to merge 1 commit into
mainfrom
fix/chained-classification-confidence

Conversation

@EthanHealy01

Copy link
Copy Markdown
Contributor

Follow-up to #7580 (reviewed just after it merged, so this lands separately).

The gap

shouldDispatchToAi treats a missing classificationConfidence as "local pass still coming, wait". That's right for uploads, but a tool-derived file never gets a local pass (useClientSideClassification skips derivedFromTool), and the chain continuation marks the run in chained before the output loop - one shot, never revisited. So a chained classification whose output stub has no verdict is skipped permanently, and quietly: the inherited labels make the file look classified.

Two ways to get there:

  • new_file output mode ahead of classification. Delivery adds fresh stubs (labels read from the PDF, never a confidence), so the chained classification always skips. Before Run classification locally first and only escalate an unsure verdict to the AI #7580 it always dispatched.
  • The verdict raced the import. new_version outputs inherit the parent's verdict via createChildStub, so the default path is fine - but only if the local heuristic finished before the run imported. If not, the child has no confidence and the one-shot skip is permanent.

The fix

  • shouldDispatchToAi: no verdict on a derived file escalates instead of waiting - there is no report to wait for. An inherited verdict still decides exactly as before (high stands, anything less escalates). Uploads unchanged.
  • CONSUME_FILES inherits classificationConfidence together with the labels, so the verdict survives the version boundary for outputs that don't come through createChildStub (matches the assumption the batch test's replaceInWorkspace mock already makes). An output carrying its own labels keeps its own confidence - no bleed from the input.
  • The chain-effect comment said the effect "re-runs when the verdict lands"; for a derived file it never lands, so the comment now says what actually happens.

Tests

  • Chain tests with the output stub present in the workspace - the existing test's empty workspace meant the outputStub && guard always fell through, so the found-stub path was untested. Cases: no verdict (escalates - red before this fix), inherited low (escalates), inherited high (stands, no engine call).
  • shouldDispatchToAi: derived stub with no verdict escalates; derived verdicts decide like an upload's own.
  • Reducer: confidence rides with the labels; an output's own verdict wins.
  • task frontend:check green: 253 files / 2192 tests, lint, typecheck, format.

…rdict

A tool-derived file never gets a local heuristic pass, so a chained
classification that waits for its verdict waits forever - and the chain
continuation is one-shot, so the file silently keeps its inherited labels
and is never AI-classified. Hit by new_file-mode deliveries (fresh stubs,
no confidence) and by versions made before the upload's verdict landed.

- shouldDispatchToAi: an absent verdict on a derived file escalates
  instead of waiting; an inherited verdict decides as before.
- CONSUME_FILES: inherit classificationConfidence together with the
  labels, so the escalation decision survives the version boundary for
  outputs that don't come through createChildStub.
- Chain-effect comment no longer claims a deferral that cannot happen.
- Tests: chain cases with the output stub present in the workspace (the
  existing test's empty workspace always fell through the outputStub
  guard), derived-stub cases for shouldDispatchToAi, and reducer
  confidence inheritance incl. no-bleed onto an output's own verdict.
@EthanHealy01
EthanHealy01 requested review from a team and balazs-szucs as code owners August 24, 2026 15:26
@dosubot dosubot Bot added size:M This PR changes 30-99 lines ignoring generated files. Bugfix Pull requests that fix bugs labels Aug 24, 2026
@github-actions github-actions Bot added Front End Issues or pull requests related to front-end development and removed Bugfix Pull requests that fix bugs labels Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 V2 Auto-Deployment Complete!

🔗 Direct Test URL (non-SSL) http://54.175.155.236:7667

🧩 Admin portal included - try it at http://54.175.155.236:7667/portal.

This deployment will be automatically cleaned up when the PR is closed.

🔄 Auto-deployed for approved V2 contributors.

@EthanHealy01
EthanHealy01 marked this pull request as draft August 24, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Front End Issues or pull requests related to front-end development size:M This PR changes 30-99 lines ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant