Skip to content

test: make the runner-up floor check pass on jq 1.6 - #8304

Merged
kunchenguid merged 1 commit into
kunchenguid:mainfrom
lockhartheavyindustries:fm/firstmate-jq-floor-upstream
Nov 13, 2026
Merged

kunchenguid merged 1 commit into
kunchenguid:mainfrom
lockhartheavyindustries:fm/firstmate-jq-floor-upstream

Conversation

@lockhartheavyindustries

@lockhartheavyindustries lockhartheavyindustries commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Intent

tests/fm-dispatch-resolve.test.sh 'the runner-up clears the same floor it would need as the pick' fails on jq 1.6, which prints the JSON literal 0.30 as 0.3. The resolver logic is correct (probability 0.3 clears floor 0.3 with >=). The change is a small test-only fix accepting either spelling (fixes issue #8303). Maintainer asked for the PR to be raised through no-mistakes so the attestation binds the current head. Nothing beyond that test change is wanted.

What Changed

  • In tests/fm-dispatch-resolve.test.sh, the "runner-up clears the same floor it would need as the pick" case now feeds the runner-up probability as 0.3 instead of 0.30. It also expects probability 0.3 clears its floor 0.3 in the fallback line.
  • Added a comment explaining the change. jq 1.6 prints the JSON literal 0.30 as 0.3, so the old expected string failed there. The value 0.3 prints the same on jq 1.6 through 1.8. (Fixes #8303.)
  • This is a test-only change. Resolver behavior and every other assertion stay the same.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: Test-only change swaps the fixture probability 0.30 for 0.3 (same double, so the >= floor-equality boundary at bin/fm-dispatch-resolve.sh:766 is still exercised) and updates the expected fallback line to the spelling every jq version prints, matching the stated intent with no source changes.

Testing

I ran the changed test file against the real bin/fm-dispatch-resolve.sh with two jq versions. The first was the system jq 1.8.2. The second was jq 1.6, built locally from its release tarball in a throwaway temp dir. At the base commit, jq 1.6 reproduces issue #8303: the runner-up assertion is missing 'probability 0.30'. At head, the file passes on jq 1.6 and on jq 1.8.2. The transcripts are saved as evidence. The temp build was removed and the worktree is clean.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
On jq 1.6, the dispatch resolver test file passes, including 'the runner-up clears the same floor it would need as the pick' ✅ pass live jq-1.6-head-run.txt: jq-1.6 first on PATH, all fm-dispatch-resolve tests passed, exit 0
Regression reproduction: the base-commit test fails on jq 1.6 at the 0.30 spelling ✅ pass live jq-1.6-base-run.txt: 'not ok - the runner-up clears the same floor ... probability 0.30 ...', exit 1
On current jq 1.8.2, the dispatch resolver test file still passes ✅ pass live jq-1.8.2-run.txt: all fm-dispatch-resolve tests passed, exit 0
The boundary is still tested: the resolver accepts a runner-up whose probability equals its floor (0.3 >= 0.3) ✅ pass live On both jq versions, the resolver output contains 'fallback: rule_4 ... probability 0.3 clears its floor 0.3' (asserted in both head runs)
Evidence: Base test fails on jq 1.6 (reproduces #8303)

Source: Base test fails on jq 1.6 (reproduces #8303)

not ok - the runner-up clears the same floor it would need as the pick (missing: ' fallback: rule_4 (A simple bug fix with a stated root cause.) probability 0.30 clears its floor 0.3; rule_2 probability 0.55 is below its floor 0.9') base_exit=1

jq on PATH: /var/folders/s1/snlgw2717m5b9n40n4z1pt9r0000gn/T/jq16.FNJtdP/jq-1.6/jq jq-1.6
ok - invalid preferred_provider: null
ok - invalid preferred_provider: false
ok - invalid preferred_provider: 42
ok - invalid preferred_provider: []
ok - invalid preferred_provider: {}
ok - invalid preferred_provider: ""
ok - invalid preferred_provider: "Codex"
ok - invalid preferred_provider: "codex\\n"
ok - invalid preferred_provider: " codex"
ok - preferred provider: astra-82-claude-26
ok - preferred provider: work-account
ok - preferred provider: exhausted
ok - preferred provider: unknown
ok - preferred provider: unknown-one-known-one
ok - preferred provider: claude-only
ok - preferred provider: config-override
ok - preferred provider: prose-why
ok - preferred provider: absent
ok - preferred provider: approval
ok - preferred provider: tie
ok - preferred provider: floor
ok - absent key is off: one stderr line, exit 0, no network call
ok - TYPESAFE_API_KEY= in .env activates the tool; environment and config overrides work
ok - clear: one rule Choice request, key on the fd header only, spendPriority argmax over every candidate
ok - TypeSafe base supports environment and .env overrides and rejects unsafe URLs before sending
ok - OpenRouter clear uses the same output contract and keeps its key out of argv and child environments
ok - OpenRouter ambiguous, malformed, HTTP, and missing-model paths are handled
ok - mapping: a declared macos-keychain service and optional account become the lookup, and the key rides the fd header
ok - precedence: environment, then .env, then the declared source, which is read only when needed
ok - provider isolation: each provider reads only its own declared service, and a declaration never selects a provider
ok - effective-home isolation: only the effective config directory's declaration is consulted
ok - failure distinctions: off, a configuration error, and an unavailable source each read differently and send nothing
ok - secret containment: the declared key is on no argv, in no output, environment, or file, and only on the fd header
ok - capability probe: supported or unsupported, with no declaration read and no credential tool run
ok - with no provider set, other providers' settings leave the original off line unchanged
ok - systemone posts the unchanged request to its base URL with an optional fd-3 key
ok - systemone configuration errors, never-send base URL, partial response, and transport failure are handled
ok - openai maps the Choice request to the Decisions API and its answer back, key on fd 3 only
ok - the never-send check runs on the final openai request body
ok - openai malformed, partial, refused, ambiguous, HTTP, and transport paths return to normal intake
ok - never-send list withholds the request on a match or a bad list, and never prints the value
ok - rules snapshots and shell quoting preserve the profile protocol
ok - quota_scope binds an agy candidate to its declared tier row
ok - no-rule fallback, Agy, Gemini, and documented configurations resolve
ok - ambiguous: confidence below the fixed floor hands the decision back
ok - task record: every exit-0 outcome records its decision for data/<id>/brief.md, and exit 2 records none
ok - task record: the configured data root, including FM_DATA_OVERRIDE, decides where the record goes
not ok - the runner-up clears the same floor it would need as the pick (missing: '  fallback: rule_4 (A simple bug fix with a stated root cause.) probability 0.30 clears its floor 0.3; rule_2 probability 0.55 is below its floor 0.9')
--- output ---
dispatch-resolve:
  status: clear
  model: jev-1.13.0   latency_ms: 21   tokens: 812/60
  rule: rule_2 (The task generates images.)   confidence: 0.95
  probabilities: rule_1=0.05 rule_2=0.55 rule_3=0.05 rule_4=0.3 default=0.05
  fallback: rule_4 (A simple bug fix with a stated root cause.) probability 0.3 clears its floor 0.3; rule_2 probability 0.55 is below its floor 0.9
  note: rule matched
  note: 1 eligible candidate(s) unranked (kimi)
  candidate: claude:sonnet  provider=claude  scope=all_models  remaining=79%  spendPriority=-0.4627  runway=projected_exhaustion  -> eligible
  candidate: cursor:cursor-grok-4.6-medium  provider=cursor  scope=all_models  remaining=91%  spendPriority=0.7597  runway=through_reset  -> eligible
  candidate: kimi:kimi-code/k3  provider=kimi  -> eligible, unranked: provider kimi unmeasured (unknown): disclosed uncertainty
  profile: --harness 'cursor' --model 'cursor-grok-4.6-medium'
base_exit=1
Evidence: Head test passes on jq 1.6

Source: Head test passes on jq 1.6

jq on PATH: .../jq-1.6/jq jq-1.6 ok - per-rule confidence floors fall to the most probable runner-up that clears its own floor # all fm-dispatch-resolve tests passed head_exit=0

jq on PATH: /var/folders/s1/snlgw2717m5b9n40n4z1pt9r0000gn/T/jq16.FNJtdP/jq-1.6/jq jq-1.6
ok - invalid preferred_provider: null
ok - invalid preferred_provider: false
ok - invalid preferred_provider: 42
ok - invalid preferred_provider: []
ok - invalid preferred_provider: {}
ok - invalid preferred_provider: ""
ok - invalid preferred_provider: "Codex"
ok - invalid preferred_provider: "codex\\n"
ok - invalid preferred_provider: " codex"
ok - preferred provider: astra-82-claude-26
ok - preferred provider: work-account
ok - preferred provider: exhausted
ok - preferred provider: unknown
ok - preferred provider: unknown-one-known-one
ok - preferred provider: claude-only
ok - preferred provider: config-override
ok - preferred provider: prose-why
ok - preferred provider: absent
ok - preferred provider: approval
ok - preferred provider: tie
ok - preferred provider: floor
ok - absent key is off: one stderr line, exit 0, no network call
ok - TYPESAFE_API_KEY= in .env activates the tool; environment and config overrides work
ok - clear: one rule Choice request, key on the fd header only, spendPriority argmax over every candidate
ok - TypeSafe base supports environment and .env overrides and rejects unsafe URLs before sending
ok - OpenRouter clear uses the same output contract and keeps its key out of argv and child environments
ok - OpenRouter ambiguous, malformed, HTTP, and missing-model paths are handled
ok - mapping: a declared macos-keychain service and optional account become the lookup, and the key rides the fd header
ok - precedence: environment, then .env, then the declared source, which is read only when needed
ok - provider isolation: each provider reads only its own declared service, and a declaration never selects a provider
ok - effective-home isolation: only the effective config directory's declaration is consulted
ok - failure distinctions: off, a configuration error, and an unavailable source each read differently and send nothing
ok - secret containment: the declared key is on no argv, in no output, environment, or file, and only on the fd header
ok - capability probe: supported or unsupported, with no declaration read and no credential tool run
ok - with no provider set, other providers' settings leave the original off line unchanged
ok - systemone posts the unchanged request to its base URL with an optional fd-3 key
ok - systemone configuration errors, never-send base URL, partial response, and transport failure are handled
ok - openai maps the Choice request to the Decisions API and its answer back, key on fd 3 only
ok - the never-send check runs on the final openai request body
ok - openai malformed, partial, refused, ambiguous, HTTP, and transport paths return to normal intake
ok - never-send list withholds the request on a match or a bad list, and never prints the value
ok - rules snapshots and shell quoting preserve the profile protocol
ok - quota_scope binds an agy candidate to its declared tier row
ok - no-rule fallback, Agy, Gemini, and documented configurations resolve
ok - ambiguous: confidence below the fixed floor hands the decision back
ok - task record: every exit-0 outcome records its decision for data/<id>/brief.md, and exit 2 records none
ok - task record: the configured data root, including FM_DATA_OVERRIDE, decides where the record goes
ok - per-rule confidence floors fall to the most probable runner-up that clears its own floor
ok - only the brief's task sections and scout tag reach the model, with a whole-brief fallback
ok - escalate: a rule declared approval: captain never yields a profile
ok - rule floor: known shortfall falls through while unavailable evidence escalates
ok - declared provider and profile floor evidence are applied in code
ok - nonnumeric spendPriority evidence is never ranked
ok - partial and missing quota evidence remain eligible but unranked
ok - provider-wide and exact quota rows combine into one limiting candidate
ok - default: no rule matched resolves among the default profiles
ok - tie: equal spendPriority never breaks by array order
ok - no rankable candidate: the tool escalates instead of guessing
ok - native Codex binds to codex-home before default, independently of Pi accounts and row order
ok - Pi native adapters bind to codex-home with existing fallbacks and schema 5 compatibility
ok - schema 6: each candidate binds to its account row; schema 5 is unchanged
ok - quota evidence comes from one quota-axi --json read, and its failure is an error outcome
ok - API, transport, and response failures are error outcomes with exit 0
ok - configuration errors exit 2 before any network call
ok - shared-quota opt-out: no quota snapshot, deterministic declared-order pick, opt-out stated on every candidate
ok - shared-quota bypasses an unmet rule-level floor: the rule's own profile wins with no quota call
ok - shared-quota bypasses an unmet profile-level floor: the first declared profile wins with no quota call
ok - shared-quota keeps preferred_provider narrowing: the preferred family wins in declared order with no quota call
ok - shared_quota false keeps the unchanged quota-ranked behavior
# all fm-dispatch-resolve tests passed
head_exit=0
Evidence: Head test passes on jq 1.8.2

Source: Head test passes on jq 1.8.2

ok - invalid preferred_provider: null
ok - invalid preferred_provider: false
ok - invalid preferred_provider: 42
ok - invalid preferred_provider: []
ok - invalid preferred_provider: {}
ok - invalid preferred_provider: ""
ok - invalid preferred_provider: "Codex"
ok - invalid preferred_provider: "codex\\n"
ok - invalid preferred_provider: " codex"
ok - preferred provider: astra-82-claude-26
ok - preferred provider: work-account
ok - preferred provider: exhausted
ok - preferred provider: unknown
ok - preferred provider: unknown-one-known-one
ok - preferred provider: claude-only
ok - preferred provider: config-override
ok - preferred provider: prose-why
ok - preferred provider: absent
ok - preferred provider: approval
ok - preferred provider: tie
ok - preferred provider: floor
ok - absent key is off: one stderr line, exit 0, no network call
ok - TYPESAFE_API_KEY= in .env activates the tool; environment and config overrides work
ok - clear: one rule Choice request, key on the fd header only, spendPriority argmax over every candidate
ok - TypeSafe base supports environment and .env overrides and rejects unsafe URLs before sending
ok - OpenRouter clear uses the same output contract and keeps its key out of argv and child environments
ok - OpenRouter ambiguous, malformed, HTTP, and missing-model paths are handled
ok - mapping: a declared macos-keychain service and optional account become the lookup, and the key rides the fd header
ok - precedence: environment, then .env, then the declared source, which is read only when needed
ok - provider isolation: each provider reads only its own declared service, and a declaration never selects a provider
ok - effective-home isolation: only the effective config directory's declaration is consulted
ok - failure distinctions: off, a configuration error, and an unavailable source each read differently and send nothing
ok - secret containment: the declared key is on no argv, in no output, environment, or file, and only on the fd header
ok - capability probe: supported or unsupported, with no declaration read and no credential tool run
ok - with no provider set, other providers' settings leave the original off line unchanged
ok - systemone posts the unchanged request to its base URL with an optional fd-3 key
ok - systemone configuration errors, never-send base URL, partial response, and transport failure are handled
ok - openai maps the Choice request to the Decisions API and its answer back, key on fd 3 only
ok - the never-send check runs on the final openai request body
ok - openai malformed, partial, refused, ambiguous, HTTP, and transport paths return to normal intake
ok - never-send list withholds the request on a match or a bad list, and never prints the value
ok - rules snapshots and shell quoting preserve the profile protocol
ok - quota_scope binds an agy candidate to its declared tier row
ok - no-rule fallback, Agy, Gemini, and documented configurations resolve
ok - ambiguous: confidence below the fixed floor hands the decision back
ok - task record: every exit-0 outcome records its decision for data/<id>/brief.md, and exit 2 records none
ok - task record: the configured data root, including FM_DATA_OVERRIDE, decides where the record goes
ok - per-rule confidence floors fall to the most probable runner-up that clears its own floor
ok - only the brief's task sections and scout tag reach the model, with a whole-brief fallback
ok - escalate: a rule declared approval: captain never yields a profile
ok - rule floor: known shortfall falls through while unavailable evidence escalates
ok - declared provider and profile floor evidence are applied in code
ok - nonnumeric spendPriority evidence is never ranked
ok - partial and missing quota evidence remain eligible but unranked
ok - provider-wide and exact quota rows combine into one limiting candidate
ok - default: no rule matched resolves among the default profiles
ok - tie: equal spendPriority never breaks by array order
ok - no rankable candidate: the tool escalates instead of guessing
ok - native Codex binds to codex-home before default, independently of Pi accounts and row order
ok - Pi native adapters bind to codex-home with existing fallbacks and schema 5 compatibility
ok - schema 6: each candidate binds to its account row; schema 5 is unchanged
ok - quota evidence comes from one quota-axi --json read, and its failure is an error outcome
ok - API, transport, and response failures are error outcomes with exit 0
ok - configuration errors exit 2 before any network call
ok - shared-quota opt-out: no quota snapshot, deterministic declared-order pick, opt-out stated on every candidate
ok - shared-quota bypasses an unmet rule-level floor: the rule's own profile wins with no quota call
ok - shared-quota bypasses an unmet profile-level floor: the first declared profile wins with no quota call
ok - shared-quota keeps preferred_provider narrowing: the preferred family wins in declared order with no quota call
ok - shared_quota false keeps the unchanged quota-ranked behavior
# all fm-dispatch-resolve tests passed
bash tests/fm-dispatch-resolve.test.sh  13.92s user 19.01s system 69% cpu 47.373 total

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
On jq 1.6, the dispatch resolver test file passes, including 'the runner-up clears the same floor it would need as the pick' ✅ pass live jq-1.6-head-run.txt: jq-1.6 first on PATH, all fm-dispatch-resolve tests passed, exit 0
Regression reproduction: the base-commit test fails on jq 1.6 at the 0.30 spelling ✅ pass live jq-1.6-base-run.txt: 'not ok - the runner-up clears the same floor ... probability 0.30 ...', exit 1
On current jq 1.8.2, the dispatch resolver test file still passes ✅ pass live jq-1.8.2-run.txt: all fm-dispatch-resolve tests passed, exit 0
The boundary is still tested: the resolver accepts a runner-up whose probability equals its floor (0.3 >= 0.3) ✅ pass live On both jq versions, the resolver output contains 'fallback: rule_4 ... probability 0.3 clears its floor 0.3' (asserted in both head runs)
  • bash tests/fm-dispatch-resolve.test.sh with system jq-1.8.2 at head (exit 0)
  • Built jq-1.6 from the official release tarball with oniguruma in a throwaway temp dir; confirmed echo &#39;{&#34;p&#34;:0.30}&#39; | jq -r .p prints 0.3 on 1.6 and 0.30 on 1.8.2
  • PATH=&lt;jq-1.6&gt;:$PATH bash tests/fm-dispatch-resolve.test.sh at head (exit 0, all tests passed)
  • PATH=&lt;jq-1.6&gt;:$PATH bash &lt;base a9ae3c0c copy of tests/fm-dispatch-resolve.test.sh&gt; (exit 1: 'not ok - the runner-up clears the same floor it would need as the pick (missing ... probability 0.30 ...)')
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Issues

Closes #8303

@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Reviews (2) · Last reviewed commit: "test: accept jq's shortest spelling of t..." · Reviewed by Greptile

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @lockhartheavyindustries. The fix is right. I checked it with the official jq 1.6 binary, which prints 0.30 as 0.3, while jq 1.7 keeps 0.30. A canned 0.3 reads the same on every version and still tests the >= boundary against floor 0.3. I read the whole diff at head 12d1af15 against main 14d06b04. It only touches tests/fm-dispatch-resolve.test.sh (+3/-2), with no workflow, credential or network changes. I've approved the first-time-fork CI runs. Greptile scores it 5/5 with no open threads, it merges cleanly, and Fixes #8303 is the right link.

Contract-class (my own read): restore. It's test-only, and the suite now passes on jq 1.6 the way it already should. VISION: aligns on every rule.

This is waiting on you for one thing: the PR body has no no-mistakes attestation. Please raise it through git push no-mistakes so the pipeline attestation binds the current head with no skipped steps. Once that's in, it's ready for the full suite.

The runner-up floor check already treats a probability of 0.3 as
clearing a declared floor of 0.3. jq 1.6 prints the JSON literal 0.30
as 0.3, while jq 1.7 and 1.8 keep the trailing zero, so the assertion
failed only on that spelling. The canned probability is now 0.3, which
jq 1.6, 1.7, and 1.8 all print the same way.
@lockhartheavyindustries
lockhartheavyindustries force-pushed the fm/firstmate-jq-floor-upstream branch from 12d1af1 to f00b829 Compare November 12, 2026 19:29
@lockhartheavyindustries lockhartheavyindustries changed the title test: accept jq's shortest spelling of the runner-up floor test: make the runner-up floor check pass on jq 1.6 Nov 12, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @lockhartheavyindustries. The no-mistakes raise answers my only ask.

What I checked on head f00b829c against main bf0f3468: the change is still test-only. In tests/fm-dispatch-resolve.test.sh, the runner-up fixture is now 0.3 instead of 0.30, and the expected fallback line matches. The >= floor boundary is still exercised. Main still has the 0.30 spelling, so this is still needed for #8303. Your evidence reproduces the failure on jq 1.6 at the base and shows a pass on jq 1.6 and jq 1.8.2 at head.

Gates: the attestation binds this head with every step completed, and the "PR must be raised via no-mistakes" check passes. Coverage guard and repo invariants pass. Greptile is 5/5 with no threads. It merges cleanly.

Contract class (my read): restore (test-only, no product behavior change). I've queued the full suite (full-ci). Nothing more is needed from you right now.

@kunchenguid kunchenguid added the full-ci Maintainer go-ahead: run the full CI suite on this outside pull request label Nov 12, 2026
@kunchenguid
kunchenguid merged commit 33809d3 into kunchenguid:main Nov 13, 2026
35 of 36 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @lockhartheavyindustries — really appreciate you taking the time on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Maintainer go-ahead: run the full CI suite on this outside pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dispatch runner-up floor test fails on jq 1.6

2 participants