Repository navigation
feat(bin): add opt-in typed dispatch resolution - #4692
Merged
kunchenguid merged 23 commits intoSep 17, 2026
Merged
Conversation
Add bin/fm-dispatch-resolve.sh, which resolves one concrete crewmate or scout profile from a written brief with typesafe.ai's System One model: one Choice question over the rules' `when` texts, then the confidence floor, the rule's `approval` and `floor`, each profile's `provider` and `floor`, one quota-axi snapshot, and the spendPriority argmax all in code. It is off unless TYPESAFE_API_KEY is in the environment or the home's gitignored .env; off means one stderr line, exit 0, and no network call, so firstmate dispatches exactly as before. The key reaches curl on a file descriptor, never argv. Extract fmx_env_get into bin/fm-env-lib.sh as the one .env accessor and the harness-to-provider table into bin/fm-quota-axi-lib.sh so the new tool and bin/fm-quota-choose.sh share one owner each. Bootstrap validates the four new optional dispatch fields. Document the schema, the operator contract, the AGENTS.md intake step, and the live and benchmark evidence.
…xplicit providers
kunchenguid
deleted the
fm/typesafe-ai-firstmate-applicability-scout-r1
branch
September 17, 2026 05:32
jorguez96
added a commit
to jorguez96/firstmate
that reference
Intent
I just got access to typesafe.ai (docs start at https://docs.typesafe.ai/introduction). Study it and propose how I could apply it inside firstmate. One concrete idea to evaluate: crew dispatch routing might potentially be done by typesafe.ai instead of by the firstmate agent session deciding it. Anything we introduce in firstmate must be opt-in, gated on an env var TYPESAFE_API_KEY, because not every user has access - firstmate must keep working exactly as today when that key is absent. I have TYPESAFE_API_KEY stored in my Automic (av) vault; use it for live testing if you need to.
The deliverable is a proposal report, not a code change. If it turns out to be worth building, I will decide separately and this task can be promoted to ship.
ok i ONLY want resolve mode. so it should simply be the default behavior without the "--resolve" argument. and let's make sure to support the ".env" file in firstmate repo - if the api key is found there, we should activate this. oh but before starting implementation, can you figure out a way to benchmark baseline vs using jev for this dispatch step - how much time and money do we save?
alright time to get it implemented!
Resolve mode, as proposed in the scout report and approved above: a tool bin/fm-dispatch-resolve.sh that takes the written task brief, asks typesafe.ai's System One model (Jev) one Choice question over the natural-language dispatch rules already in config/crew-dispatch.json (which rule's "when" matches this brief, or none), and then in code applies a confidence floor, the matched rule's declared captain-approval gate and quota floor, each profile's declared provider and quota floor, and one quota-axi snapshot's spendPriority ranking to pick the concrete profile, printing the --harness/--model/--effort line for fm-spawn together with every candidate's evidence. Firstmate runs it in the same turn after writing the brief and uses today's routing whenever the result is ambiguous, escalated, an error, or the key is absent. The key comes from the environment or from a TYPESAFE_API_KEY line in the firstmate home's gitignored .env, is never printed or placed on a command line, and when absent the tool does nothing and firstmate dispatches exactly as today. The benchmark measured from real dispatches that today's routing costs a median of about $0.90 and 28.6 seconds per dispatch against about $0.24 and 2.75 seconds with the tool.
What Changed
TYPESAFE_API_KEYfrom the environment or the firstmate home’s.env, preserving existing routing for absent keys and all non-clear outcomes.Risk Assessment
✅ Low: The opt-in resolver is well-bounded, preserves existing routing on non-clear outcomes, isolates the API key, and the reviewed quota-veto fixes maintain the documented invariants.
Verification record (worker-authored; complements the pipeline's Testing section)
The pipeline's test step could not run its own authenticated scenario because its attended vault prompt timed out; the captain approved the test step on the evidence below (
docs/verification/dispatch-resolve.mdholds the full record).tests/fm-dispatch-resolve.test.shandtests/fm-bootstrap.test.shdrive the executable interface with a fixture API and fixture quota: exhausted and unknown bounds, profile and rule floors, captain approval, low confidence, argument-boundary quoting, the absent, broken-symlink, and malformed rules-file cases, and child-environment probes provingTYPESAFE_API_KEYis absent from thecurlandquota-axichild environments (the tool unsets the exported variable before any child starts, and the key reachescurlonly as a header read from file descriptor 3).dispatch-resolve: off, exit 0, routing unchanged; key present with no rules file ->escalate/no rules to match, exit 0 (the round-20 fix); real endpoint with an invalid credential -> HTTP 401 becomesstatus: error, exit 0.03c7fffbwith the captain's approved vault prompt, the real endpoint, and the real key on 25 real briefs (fixture rules file, one fixture quota snapshot): 17 clear / 2 ambiguous / 6 escalate / 0 errors; rule match 20 of 25; hand-labeled profile 18 of 25; median API latency 220 ms. The one clear result that differed from the hand label is analyzed in the verification record (a synthetic tweak whose exemption text belongs in the captain's rule 4when).03c7fffband the final head the resolver's request, Choice question, response validation, and confidence handling are unchanged (verified by diff). The later fix commits changed candidate ordering inevaluate()(exhaustion and floor vetoes before uncertainty), output quoting, key hygiene, and the absent-rules-file fallback; all are fixture-covered and two of them were verified live above.mainafter merge, if desired.Testing
Targeted resolver and bootstrap behavior tests passed, the real CLI preserved no-key and missing-rules fallback behavior, and the real endpoint produced a nonblocking structured 401 error. Authenticated Jev routing could not run because Automic’s attended approval was not granted. Unsafe-selection protections were exercised only with controlled fixtures, not against the live product.
av inject +TYPESAFE_API_KEY -- ...prompt and…Evidence: Live fallback and real-endpoint failure transcript
Source: Live fallback and real-endpoint failure transcript
Evidence: Automic attended-approval blocker
Source: Automic attended-approval blocker
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 7 issues found → auto-fixed (21) ✅
bin/fm-dispatch-resolve.sh:248- Aclearresult bypasses the repository's required catalog/authentication, reasoning-class, and completion-runway gates.evaluateconsiders only quota status, positive headroom, optional configured floors, and spendPriority. For example, a difficult rule containing a weaker high-priority model and a stronger lower-priority model selects the weaker model; likewise, aprojected_exhaustioncandidate with 900 seconds of runway can win a two-hour task. The quota-array-dispatch contract explicitly rejects both sequences. Remedy needs user authorization because adding catalog/auth/horizon machinery extends the stated inputs, while restricting these cases to escalation changes the intended savings and clear-result behavior.bin/fm-dispatch-resolve.sh:248- Selectingexact(...) // wide(...)treats a model/product row as a replacement for its provider-wide row, although the dispatch contract defines named scopes as additional bounds. Withall_modelsexhausted andmodel:foohealthy, this code uses onlymodel:fooand can emit a clear profile for an exhausted account. Evaluate every applicable wide and exact row, vetoing on any exhausted/zero bound and using the effective limiting evidence for ranking.bin/fm-dispatch-resolve.sh:235- When a profile omitsprovider, the resolver substitutes a harness-to-primary-family map. A concrete{harness:"opencode", model:"anthropic/..."}profile is therefore ranked against Codex quota and may produce a clear route from unrelated evidence. This conflicts with the existing rule that authoritative multi-provider routing establish the family from the harness catalog rather than infer it. Decide whether typed resolution should require explicit providers for multi-provider harnesses or add catalog discovery; that schema/behavior choice needs user approval.bin/fm-dispatch-resolve.sh:139- The resolver's private schema validation only requires a nonempty harness string and does not enforce the verified harness or effort rules that bootstrap applies. If a human-edited rule uses{harness:"spaceship", provider:"codex"}, Jev can match it and this tool can print a clear--harness spaceshipresult;fm-spawnthen refuses instead of the resolver returning the required actionable configuration error/fallback. Reuse equivalent harness and effort validation at the resolver boundary.bin/fm-dispatch-resolve.sh:262- A malformed API choice ofrule_0is converted to index-1, which jq interprets as the final rule, so the resolver can silently route using the last rule rather than return an error. Validate that the numeric suffix is within1..rules.lengthbefore indexing.bin/fm-dispatch-resolve.sh:124- The shell globs accept values outside the documented 0–1 range:1.01matches1.0*, and0.6junkmatches0.[0-9]*. The former makes every normal response ambiguous; the latter performs the paid API and quota calls before jq fails resolution. Parse the value numerically and enforce0 <= floor <= 1before the network call.bin/fm-dispatch-resolve.sh:186- The newdefault_whenschema branch adds a second configurable matching criterion for the already-required “or none” choice, together with fallback and validation paths. The stated intent requires only choosing a matching rule or none and does not require users to redefine what none means. Consider removingdefault_whenand exposing one fixed none option; retaining this additional behavior requires user approval.🔧 Fix applied.
2 warnings still open:
bin/fm-dispatch-resolve.sh:290- The resolver checks only thatselection.spendPriorityis non-null, while the shared snapshot validator does not validate this field. A documented--quotasnapshot containing a string or object spendPriority therefore passes validation and reachesmin_by/max_by; jq orders mixed JSON types and can emit a clear but incorrect profile. Require a numeric spendPriority at the resolver boundary, otherwise mark the row unrankable or reject the snapshot.bin/fm-dispatch-resolve.sh:287- The change accepts an undocumented second provider insideprofile.floorand uses it instead of the profile's declared provider. No intent requirement needs this override: for example, a Codex profile withfloor.provider: "claude"is admitted or rejected using Claude quota even though the documented profile floor belongs to that candidate. Remove provider support from profile floors and always evaluate their scope against the profile provider.🔧 Fix applied.
3 warnings still open:
bin/fm-dispatch-resolve.sh:232- Response validation accepts any numeric confidence rather than the documented 0–1 probability range. A malformed response withconfidence: 2and a valid choice therefore produces aclearprofile instead of the promised malformed-response error. Validate0 <= confidence <= 1before resolving.bin/fm-dispatch-resolve.sh:290- When a profile floor fails, the reported top-level scope, percentage, and runway come from the lowest-percent applicable row rather than the floor's named scope. For example, anall_modelsfloor failing at 79% beside amodel:sonnetrow at 10% reportsscope=model:sonnet remaining=10%while claiming theall_modelsfloor failed. Select and report the actual matching floor row, while retaining all bounds separately.bin/fm-dispatch-resolve.sh:91- The new--statusexecution mode exceeds the authoritative request for “ONLY ... resolve mode.” The resolver already no-ops safely when the key is absent, so firstmate can invoke the normal resolve path after writing the brief without a separate preflight mode. Remove--statusand its duplicated AGENTS/docs path unless the author explicitly wants this additional mode.🔧 Fix applied.
2 issues (1 error, 1 warning) still open:
bin/fm-dispatch-resolve.sh:80- The required “or none” option is not generic: it excludes simple root-cause bug fixes even when the configured rules contain no bug-fix rule. For example, with only a fresh-news rule, a simple root-cause bug matches neither option as written, encouraging Jev to select an unrelated rule and potentially produce a clear wrong profile. The appended task taxonomy is also an unnecessary second definition of matching policy; narrow this to a fixed statement that no listed rule applies.bin/fm-dispatch-resolve.sh:149- The canonical crew-dispatch schema and bootstrap accept a default-only configuration orrules: [], but the resolver labels it malformed and exits 2. Once the API key is enabled, such an existing valid configuration can no longer return to normal routing. Decide whether default-only files should resolve the default directly or produce a normal non-clear fallback instead of a configuration error.🔧 Fix applied.
1 error still open:
bin/fm-bootstrap.sh:1175- This contradicts the required guarantee that “firstmate must keep working exactly as today when that key is absent.” Bootstrap now rejects every existing Pi, Pi-signed, OMP, or OpenCode profile lackingprovider, even without TYPESAFE_API_KEY. Such profiles were previously valid—including the prior shipped example—and repository instructions treat the resulting malformed configuration as blocking dispatch. Preserve the old schema when the feature is off; enforce the provider requirement only at the opted-in resolver boundary, unless this breaking migration is explicitly approved.🔧 Fix applied.
2 warnings still open:
bin/fm-dispatch-resolve.sh:227- Response validation ignoresusage, although text rendering indexes.tokens.input_tokens. A response with a valid choice/confidence but"usage":"bad"passes validation, then jq rendering fails; the unconditional finalexit 0leaves no structured error outcome. Validate the optional usage shape or render it defensively and convert rendering failures intostatus: error.bin/fm-dispatch-resolve.sh:332- Duplicate concrete profiles are accepted and counted as separate equal-priority candidates. A rule containing the same profile twice therefore returnsescalate: genuine spendPriority tie, even though repository dispatch policy says duplicate profiles are configuration errors. Reject duplicate concrete profiles at the opted-in resolver validation boundary before requesting or ranking.🔧 Fix applied.
2 warnings still open:
bin/fm-dispatch-resolve.sh:322- A rule floor with unavailable evidence is treated as a confirmed below-floor result. For example, if the named scope is absent or hasstatus: unknown,floor_okreturns false and the matched rule silently falls through to the default, which can produce aclearprofile. Distinguish a known percentage below the floor from missing/unknown evidence; the latter should produce a non-clear outcome rather than authorize default routing.bin/fm-dispatch-resolve.sh:235- Response validation checks only thatprobabilitiesis an object. A response such as"probabilities": {}or one containing string/out-of-range values is accepted and can yieldclear, or anambiguousresult whose advertised fallback evidence is unusable. Validate that every offered choice has a numeric probability in 0–1 and reject malformed probability evidence as a structured error.🔧 Fix applied.
2 warnings still open:
bin/fm-dispatch-resolve.sh:235- The response accepts values that cannot be probabilities because it checks only individual bounds, not that the distribution totals approximately 1. For example, the test fixture's all-zero map passes and can produce aclearroute despite supplying no probability mass. Reject distributions whose sum is not approximately 1 before resolving a profile.bin/fm-dispatch-resolve.sh:306-floor_statedistinguishesunknownfrombelow, but the profile path merges both states and reports an absent or unknown floor row as a confirmed shortfall. A profile whose named scope is missing therefore emitsprofile floor ... below ...%with null evidence and may be excluded while another candidate clears. Preserve the distinction and report unverifiable evidence rather than a false below-floor result.🔧 Fix applied.
4 issues (1 error, 3 warnings) still open:
bin/fm-dispatch-resolve.sh:208- With TYPESAFE_API_KEY present and at least one rule, a missing curl exits 2 instead of producingstatus: error. The authoritative intent requires firstmate to use today's routing whenever resolution is an error, while AGENTS.md only defines fallback for structured error/off outcomes. Return the normal structured error outcome here so this reachable dependency failure preserves existing routing.bin/fm-dispatch-resolve.sh:97- The new--jsonoutput mode is not required by the approved intent, which specifies the fm-spawn profile line and candidate evidence output. It adds a second public serialization contract; remove this option unless the additional interface is explicitly desired.bin/fm-dispatch-resolve.sh:95- The new--rulesoption adds a parallel rules source beyond the required firstmate-homeconfig/crew-dispatch.jsonpath. No stated requirement needs arbitrary rule files; remove this option and retain the canonical configuration source unless this extension is explicitly approved.bin/fm-dispatch-resolve.sh:96- The new--quotaoption permits externally supplied quota evidence instead of the required singlequota-axisnapshot. This alternate acceptance path is not required by the stated runtime intent; remove it from the public tool and keep fixture injection inside the test harness unless explicitly approved.🔧 Fix applied.
2 warnings still open:
bin/fm-dispatch-resolve.sh:259-measuredaccepts only provider-level statusknown, although the validated quota schema also permitspartial. A valid partial provider with a known applicableall_modelsrow is therefore rejected before that row is evaluated, causing an unnecessary escalation instead of the required spendPriority ranking. Evaluate applicable row statuses rather than rejecting the whole provider-level partial state.bin/fm-dispatch-resolve.sh:69- The four new environment overrides for confidence floor, model, base URL, and timeout add public operating modes not required by the approved intent; notably the endpoint and model overrides can stop the tool from using typesafe.ai's Jev as specified. Remove these overrides and retain fixed implementation constants unless this tuning surface is explicitly desired.🔧 Fix applied.
1 warning still open:
bin/fm-dispatch-resolve.sh:127- The resolver requires an explicit provider only for four multi-provider harnesses, but the shared provider map has no entry for validagyorrovoprofiles. For example, a default-only{ "harness": "agy" }profile passes validation, thenprovider_ofreturns null and the sole candidate escalates as unrankable. Decide whether these harnesses need authoritative mappings or must declareprovider, and align validation and the documented optional-provider contract accordingly.🔧 Fix applied.
1 warning still open:
docs/configuration.md:451- The resolver now requires an explicit provider for every Pi profile, but the linked starting configuration at docs/examples/crew-dispatch.json:24 still has a provider-less Pi default. Copying that documented example and enabling TYPESAFE_API_KEY therefore exits 2 with a configuration error before resolution. Add the Pi profile's established provider to the example so the advertised starting configuration works with this feature.🔧 Fix applied.
2 warnings still open:
bin/fm-dispatch-resolve.sh:109- The resolver's verified-harness list omits the repository-supportedgeminiadapter. A profile such as{"harness":"gemini","provider":"google"}is rejected as malformed before resolution, despite the explicit-provider rule being intended to cover unmapped Gemini profiles. Addgeminihere and align bootstrap's equivalent validator.bin/fm-dispatch-resolve.sh:135- Provider declarations are checked only for being non-empty, while quota snapshots require provider IDs matching^[a-z0-9]+(-[a-z0-9]+)*$. Thus a typo such asprovider: " claude"passes configuration validation, triggers the external request, and later escalates as a missing provider instead of producing the promised actionable configuration error. Apply the quota provider-ID invariant to profile and rule-floor providers in both resolver and bootstrap validation.🔧 Fix applied.
1 warning still open:
bin/fm-quota-axi-lib.sh:13- The provider-ID regex uses$, which can match before a final newline. A JSON provider such as"claude\n"therefore passes both bootstrap and resolver validation; with a nonempty rules array the resolver sends the brief to typesafe.ai before later treating that provider as absent from the quota snapshot, contrary to the promised configuration error before any request. Use a strict end-of-string anchor such as\zin the shared regex.🔧 Fix applied.
2 warnings still open:
bin/fm-dispatch-resolve.sh:149- Runtime validation omits the existingselectschema checks enforced by bootstrap. If an inherited or human-edited config changes mid-session toselect: "mystery", the resolver sends the brief externally and silently applies quota-balanced selection instead of returning the required actionable configuration error. Validate that presentselectis a non-empty string equal toquota-balancedbefore any request.bin/fm-dispatch-resolve.sh:340- Low-confidence and approval-gated outcomes bypassevaluate, with approval explicitly returningcandidates: []. For example, a 0.41 response selecting a two-profile rule prints no candidate lines despite already taking the quota snapshot. This contradicts the required and documented promise to print every candidate's evidence, including before escalation. Evaluate and render the applicable profiles for evidence without emitting a chosen profile on non-clear outcomes.🔧 Fix applied.
3 issues (1 error, 2 warnings) still open:
bin/fm-bootstrap.sh:1147- The intent requires everything introduced here to be opt-in and says that withoutTYPESAFE_API_KEYFirstmate must work exactly as today. Bootstrap nevertheless validates the newprovider,floor, andapprovalfields unconditionally. For example, a previously accepted profile containing"provider":"Anthropic"now emits an actionableCREW_DISPATCHdiagnostic even when the key is absent. Gate resolver-only validation on the same environment/.env activation condition, or ask whether changing non-opted-in bootstrap behavior is intended.bin/fm-dispatch-resolve.sh:213- The mutable rules file is reread for request construction, response validation, and final resolution. If its rule text/profile changes during the API call while the rule count remains the same, Jev can answerrule_1for the old condition and the resolver can silently dispatch the new rule_1 profile. Snapshot the file once before validation and use that immutable copy for every subsequent read.bin/fm-dispatch-resolve.sh:369- Configuration and quota strings are interpolated directly into the line-oriented output. A valid multilinewhenor model value can inject additional lines—including a second apparentprofile:line—so the Firstmate instruction to pass the profile line becomes ambiguous. Escape or flatten control characters in all dynamic fields during rendering while preserving the actual chosen profile data.🔧 Fix applied.
5 issues (3 errors, 2 warnings) still open:
bin/fm-quota-axi-lib.sh:103- This adds anagy -> agymapping to the shared provider table used by the pre-existingfm-quota-choose.sh. Consequently, with noTYPESAFE_API_KEY, an Agy candidate that previously failed as an unknown harness can now be selected. This contradicts the required constraint that everything introduced be opt-in and that Firstmate work exactly as before when the key is absent. Keep the new mapping resolver-local or ask the user to authorize changing the existing helper.bin/fm-bootstrap.sh:1123- Bootstrap now derives its baseline verified-harness set fromfm_control_harnesses, which includesgemini; before this change its dispatch validator rejected Gemini. A providerless Gemini profile is therefore accepted even when typed resolution is inactive, changing no-key behavior contrary to the explicit opt-in requirement. Preserve the former baseline set whentyped_activeis false, or obtain approval for this unrelated behavior change.bin/fm-dispatch-resolve.sh:389- Dynamic profile values are flattened but not shell-escaped. A valid configuration with modelfoo --harness grokemits--harness claude --model foo --harness grok; passing the promised profile line tofm-spawnsilently overwrites the selected harness. Shell metacharacters can also alter the command. Render every emitted value as one safely quoted shell argument rather than merely replacing control characters.bin/fm-dispatch-resolve.sh:300- Candidates with no applicable quota row or an applicable row whose status is unknown still receive neithereligiblenorunranked. For example, a partial provider with known account evidence and an unknown exact-model row printsnot eligibleand is omitted from the clear-result unranked note. This contradicts the repository invariant that missing or unmeasurable quota remains disclosed uncertainty while the candidate stays eligible. Mark these paths eligible-unranked so the note and evidence accurately preserve that uncertainty.bin/fm-dispatch-resolve.sh:211- The change introduces a separate default-only mode that skips Jev and can emit a clear profile whenrulesis absent or empty. The stated intent requires one Choice over the natural-language rules and does not require the resolver to replace existing default routing when there are no rule options. Remove this extra branch and return such configurations to the existing intake unless the user explicitly wants direct default-only resolution.🔧 Fix applied.
1 warning still open:
bin/fm-dispatch-resolve.sh:296- Unverifiable profile floors and unknown applicable rows are classified as eligible-unranked before checking concrete exhaustion. For example, a candidate with a known exhaustedall_modelsrow plus an unknown exact-model row is reported eligible-unranked rather than ineligible, contradicting the documented rule that any exhausted applicable bound vetoes the candidate. Apply theexhausted_nowand known-zero checks before uncertainty branches while retaining all evidence.🔧 Fix applied.
3 issues (1 error, 2 warnings) still open:
bin/fm-dispatch-resolve.sh:94- WhenTYPESAFE_API_KEYarrives through the environment, Bash preserves its exported attribute, so every subsequently launchedjq,curl, andquota-axiprocess inherits the secret. The key therefore crosses intoquota-axieven though it only needs to reach curl through fd 3. Copy it into a non-exported private variable and unsetTYPESAFE_API_KEYbefore launching child processes.bin/fm-bootstrap.sh:1186- The required absent-key behavior is “exactly as today,” but malformed legacy model/effort configurations now report an expanded provider-related diagnostic even when typed resolution is inactive. For example, a numeric profile model previously produceduse profile model and effort must be non-empty strings when present; it now appends the inert provider constraint. Preserve the original diagnostic on the no-key branch and use the expanded message only when$typedis true.docs/verification/dispatch-resolve.md:18- The change originally recorded the intent's benchmark—83 dispatches, median $0.90/28.6s today versus about $0.24/2.75s with the tool—but a fixer commit removed that entire verification section. The authoritative intent still states these measured figures; restore the benchmark table and its measurement context unless the user approves dropping this evidence.🔧 Fix applied.
1 warning still open:
bin/fm-dispatch-resolve.sh:107- With TYPESAFE_API_KEY set but the optional config/crew-dispatch.json absent, every instructed intake exits 2 at the readability check. AGENTS.md only routesambiguous,escalate,error, or off back through today's intake, while configuration errors are explicitly not selected around, so merely enabling the key can block dispatch instead of falling back as required. Confirm whether an absent optional rules file should behave like zero rules (escalate: no rules to match); if so, reserve exit 2 for an existing but unreadable/malformed file.🔧 Fix applied.
4 issues (2 errors, 2 warnings) still open:
bin/fm-dispatch-resolve.sh:299- The claimed exhaustion fix remains bypassable: an accepted quota snapshot may havequotaSemantics.status: "unknown"with an applicable unknown row whoserunway.statusisexhausted_now, butevaluatereturns eligible-unranked before inspecting rows. This contradicts the documented invariant that any exhausted applicable bound makes the candidate ineligible. Check applicableexhausted_nowevidence before provider-status uncertainty.bin/fm-dispatch-resolve.sh:314- A known failed profile floor is ignored when another applicable row is unknown. For example,floor: {scope:"all_models",min_percent:50}with a known 10% all-models row and an unknown exact-model row becomes eligible-unranked at line 314 instead of ineligible for the declared floor. Handleprofile_floor_state == "below"before unrelated unknown-row uncertainty.bin/fm-bootstrap.sh:1120- When bootstrap is launched with an exportedTYPESAFE_API_KEY, the newly added typed validation reads it but leaves the original exported variable intact, sojqand every other bootstrap child inherit the credential. Copy it into a non-exported private variable and unsetTYPESAFE_API_KEYbefore bootstrap launches child processes, then use the private value for activation detection.bin/fm-dispatch-resolve.sh:113- The absent-file fallback uses-e, which is false for a broken symlink. Thus an existing but unreadableconfig/crew-dispatch.jsonsymlink silently returnsno rules to matchinstead of the required actionable exit 2. Distinguish a genuinely absent directory entry from an existing symlink, such as by also checking-L.🔧 Fix applied.
✅ Re-checked - no issues remain.
av inject +TYPESAFE_API_KEY -- ...and rerun the live resolver scenario to verify real rule matching and profile selection.av inject +TYPESAFE_API_KEY -- ...prompt and…bash tests/fm-dispatch-resolve.test.shbash tests/fm-bootstrap.test.shquota-axi --json | jq '{schemaVersion, providers: [...]}'Live no-key invocation usingenv -u TYPESAFE_API_KEY ... bin/fm-dispatch-resolve.shLive missing-rules invocation with a nonempty activation sentinelLive request to the real Typesafe endpoint with an intentionally invalid credentialAttempted authenticated invocation withav inject +TYPESAFE_API_KEY -- ...✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.