fix(train): do not refuse publication for below-floor labels - #78
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Reviewer's GuideThe report gate now allows publication when labels have fewer rows than the train/evaluate floor: they still train and are reported as unmeasured, while empty or genuinely missing training data continues to block publication. Flow diagram for training report publication gatingflowchart TD
A[Training report evaluates label status] --> B{Row status}
B -->|BELOW_FLOOR| C[Train label]
C --> D[Report as unmeasured]
D --> E[Allow publication]
B -->|NO_UTTERANCES or MISSING| F[Block publication]
B -->|Other advisory status| G[Report finding]
G --> E
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="fastworkflow/train/training_report.py" line_range="194" />
<code_context>
+#: evaluation row. FELL_BACK is reported loudly but does not fail when rows remain.
BLOCKING_STATUSES: frozenset[RowStatus] = frozenset(
{
- RowStatus.BELOW_FLOOR,
RowStatus.NO_UTTERANCES,
RowStatus.MISSING,
</code_context>
<issue_to_address>
**issue (broader_impact):** Removing `BELOW_FLOOR` from the publication blockers does not make a context containing only below-floor labels trainable: the unchanged `split_training_data` raises `TrainingDataError` when no label has enough rows to form an evaluation set. `train_workflow` therefore aborts before reaching the publication gate, so a single-label or otherwise all-one-row workflow still fails instead of training and publishing.
**Triggers:** When a training context has no label with at least two rows, such as a single-command context whose command has one utterance.
**Suggested fix:** Update the training path to support an all-below-floor context with an explicitly unmeasured/no-threshold model, or retain a blocking status for contexts where no evaluable label exists.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and labels with fewer than the train-and-evaluate floor will now be published despite having no evaluation coverage, so an incorrect floor policy could put poorly validated routing behavior into a published model. Reverting stops future publications, but any already-published model would need rollback or retraining to repair.
Blocking findings: fastworkflow/train/training_report.py:194
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary
BELOW_FLOORremained inBLOCKING_STATUSES, so publication was still refused at the report gate (Training data is structurally incomplete; refusing to publish models for: initialize_defect_info).BELOW_FLOORfrom the publication blockers. A 1-row command still trains, is reported as unmeasured, and does not fail the run.NO_UTTERANCESand trueMISSING(trainer never reached the command) still block.Test plan
pytest tests/test_training_report.py tests/test_heldout_evaluation.py(88 passed)talk_to_ido/initialize_defect_info) publishes after trainMade with Cursor
Summary by Sourcery
Allow below-floor labels to publish while continuing to block runs with missing or empty training data.
Bug Fixes:
Enhancements:
Tests: