Repository navigation
feat(bin): trim dispatch briefs and add per-rule confidence floors - #198
Merged
Merged
Conversation
…d per-rule confidence floors Port of upstream kunchenguid#5478, adapted to this fork's brief scaffold, which has no "## Captain's intent" / "## Firstmate spec" subsections: the resolver now sends Jev the top-level "# Task" and "# Acceptance criteria" sections instead, prefixed with "Brief kind: scout (report only)" on scout briefs, and still sends the whole brief when neither section exists. Ship delivery mode is not sent, matching upstream's measured over-routing finding. Rules may declare min_confidence (0 through 1), a confidence floor on that rule's own probability, distinct from the existing quota "floor" fields: a picked rule below its floor falls to the most probable other option that clears its own floor (global 0.6 when undeclared) with a fallback: line, else ambiguous. Files with no declared floors keep the global 0.6 check on the answer confidence exactly, and bootstrap plus the resolver reject malformed values before any network call. The heading parser lives in new bin/fm-brief-heading-lib.sh as the single owner of brief-section reading, sourced by the resolver; fm-test-run.sh maps it to the dispatch-resolve test lane.
…allback probability/floor formatting, resolving the portable serial 1 failure (`0.30` vs `0.3`). Verified with bash syntax checks and the targeted dispatch test (fallback case passes). Portable serial 4’s `fm-send --key` mismatch reproduces in an unchanged backend conformance test and is unrelated to this PR; no out-of-scope changes were made
…back probability/floor diagnostics deterministically (e.g. `0.30` → `0.3`) across all emitted fields. Portable serial 1’s failure is addressed; portable serial 4’s `fm-send --key` failure is unrelated to this PR’s changed code, so no out-of-scope change was made
dnth
force-pushed
the
fm/fm-port-upstream-5478-dispatch-sections
branch
from
October 3, 2026 17:41
582860d to
7bc718e
Compare
…t markers to lowercase in the shared formatter for all four fallback diagnostic fields. Expanded executable regression coverage for e/E notation and trailing mantissa zeros. Dispatch tests, bash syntax checks, and git diff --check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Port upstream kunchenguid/firstmate PR kunchenguid#5478 ('feat(bin): send dispatch router only the brief's task sections and add per-rule confidence floors', merged 2026-09-24) into this fork, captain-approved 2026-10-03. Requirements: (1) fm-dispatch-resolve.sh sends the typed-dispatch router (Jev) only the brief's task-describing sections, adapted to this fork's scaffold which uses top-level '# Task' and '# Acceptance criteria' - upstream's '## Captain's intent'/'## Firstmate spec' headings do not exist here; scout briefs get 'Brief kind: scout (report only)'; ship delivery mode is deliberately not sent; a brief with neither heading is sent whole as the fail-safe. (2) Rules may declare optional min_confidence (number 0 through 1), a confidence floor on that rule's own probability checked whether the rule is the pick or a runner-up; a picked rule below its own floor falls to the most probable other option clearing its own floor with a fallback: line; ties or no qualifying runner-up yield ambiguous; rules without the field keep the existing global 0.6 check on answer confidence; malformed values are a config error exiting 2 before any network call; the model never sees confidence floors. (3) min_confidence is a confidence floor intentionally named distinct from the existing per-rule quota 'floor' fields (scope/min_percent/provider); quota floor, quota-axi ranking, approval, prewalk_into, and the clear/ambiguous/escalate/error/off contract are unchanged, and a rule may carry both fields independently. (4) docs/configuration.md and the script header document the new behavior and field. Adaptation decisions: bin/fm-brief-heading-lib.sh owns the dispatch router's task-section extraction (bin/fm-receipt-check.sh keeps its own acceptance parser with the same trailing-whitespace heading tolerance); upstream's nested fm_brief_task_heading_* helpers, the parser stdin input mode, and fm-dod-lib.sh were intentionally not ported; bin/fm-test-run.sh maps the new lib to the dispatch-resolve test lane. Firstmate-Validation-Generation: 9ef8c77ff62039f3a5d1cdc917b0754c
What Changed
# Taskand# Acceptance criteriasections, adding a scout tag and omitting ship delivery mode; send the whole brief when neither heading exists.min_confidencefloors checked against rule probabilities, with a reported fallback to the highest qualifying runner-up and ambiguous results for ties or no qualifying option. Validate malformed floors before network requests.Risk Assessment
✅ Low: The change is bounded, conforms to the accepted intent and prior decisions, and introduces no substantiated material defects.
Testing
Dispatch and bootstrap tests passed; live opt-out, no-rule, malformed-floor, and test-selection checks passed with CLI evidence captured. Jev-backed scenarios remain untested live because authentication is unavailable. Disposable files were removed; this change has no rendered UI requiring screenshots.
Evidence: Live CLI behavior and zero network attempts
Evidence: Changed-file test selection
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
TMPDIR="$PWD/.test-dispatch-phase/tmp" bash tests/fm-dispatch-resolve.test.shTMPDIR="$PWD/.test-dispatch-phase/tmp" bash tests/fm-bootstrap.test.shpython3 .test-dispatch-phase/live-check.py— isolated real CLI checks with a local HTTPS proxy monitoring network attempts; driver preserved in the evidence directory.bash bin/fm-test-run.sh --list --changed --base fcaaf143fa70e4d00079e7d4e789fcb1a3513917— initial attempt rejected transient test files; passed after cleanup.git status --short— confirmed disposable worktree files were removed.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.