Skip to content

Commit 5cd2fc8

Browse files
author
Sungin Kim
committed
Merge fm/fm-pi-auth-surface-unresolved (upstream PR 1491)
2 parents e45fb62 + 2aca111 commit 5cd2fc8

4 files changed

Lines changed: 123 additions & 11 deletions

File tree

‎.agents/skills/quota-array-dispatch/SKILL.md‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Name the evidence for each relation you assert so the conclusion is inspectable.
4444

4545
1. Confirm the catalog lists the candidate's model and record the provider family it reports.
4646
A model the authoritative catalog does not list is concrete contradictory evidence: block that candidate and quote the catalog result.
47+
Carry that row forward: on an auth-gated catalog it also resolves the candidate's authentication surface, per "Authentication is scoped to the selected surface" below.
4748
2. Apply quota at the granularity the vendor actually supplies.
4849
A provider-level or `all_models`/`all_products` scope bounds every model you established in that family, including one with no window of its own.
4950
A named-model or named-product scope is an additional bound for that model alone and is irrelevant to every other model in the family.
@@ -57,9 +58,21 @@ A candidate authenticates through its own tuple's surface; another harness's CLI
5758
A provider can carry a healthy source beside a missing or expired one; the unused source's state is not the candidate's state.
5859
A Pi-hosted family may authenticate through the vendor's own store with no `pi:`-prefixed source at all, which is normal and never evidence against the candidate.
5960

61+
`quota-axi` is not the only surface evidence, and it is not the surface's owner.
62+
The candidate's own harness catalog resolves the surface positively when that harness lists a model only once its auth is configured; `docs/verification/dispatch-auth.md` verifies that rule for Pi, and it must be established from the harness's own documentation before being relied on for another harness.
63+
So a family that `quota-axi` does not model at all can still have a fully resolved surface, established from the catalog row alone.
64+
Never read a provider's absence from `quota-axi` as an unresolved or missing surface; `quota-axi` bounds quota, and coverage it never claimed is not a finding about credentials.
65+
66+
Keep the two questions separate for every candidate, because collapsing them is what silently retires a whole lane:
67+
68+
- Is the surface resolved? Answer from the candidate's own tuple - its harness catalog and the credential source it actually selects.
69+
- Is the applicable quota known? Answer from `quota-axi`, which may legitimately have no coverage for that vendor.
70+
71+
When an auth-gated catalog supplies that positive evidence, an unmodeled vendor is a quota unknown on a resolved surface, never an unresolved surface.
72+
6073
Uncertainty and ineligibility are different findings:
6174

62-
- No model-level window, no matching auth source, an absent `state.authStatus`, an unmeasurable or `unknown` scope, or a surface quota-axi does not model at all is disclosed uncertainty.
75+
- No model-level window, no matching auth source, an absent `state.authStatus`, or an unmeasurable or `unknown` scope is disclosed uncertainty.
6376
Keep the candidate eligible, state the unknown, and prefer known sustainable evidence when otherwise comparable.
6477
- An expired credential is a short-lived session token the owning vendor renews on next use, not a sign-out.
6578
- Only concrete contradictory evidence blocks: an authoritative catalog proving the model unsupported, or proof that the credential the candidate actually selects is unusable.
@@ -85,7 +98,7 @@ Apply only among candidates satisfying required fit and strongest reasoning clas
8598
Never use headroom, runway, pace, or reserve to silently replace that reasoning class.
8699

87100
1. Concrete contradictory evidence or malformed configuration: stop and report the tuple and that evidence.
88-
Unmeasurable quota, a missing model-level window, an absent runway field, and a credential surface quota-axi does not model are uncertainty, never this rule.
101+
Unmeasurable quota, a missing model-level window, an absent runway field, and a provider family quota-axi does not model are uncertainty, never this rule.
89102
2. Honor any explicit captain instruction that sets a floor for that candidate before the generic comparison.
90103
Do not invent a generic percentage floor or treat a low percentage as an automatic failure.
91104
3. Keep the strongest-reasoning class when every candidate is tight or completion evidence is poor.

‎docs/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ When X mode is opted in, bootstrap also requires `curl` and `jq` before arming t
303303
`tasks-axi` and `quota-axi` are required bootstrap tools in every profile, the same class as `lavish-axi`.
304304
An absent or incompatible `tasks-axi` reports `MISSING: tasks-axi (install: npm install -g tasks-axi)`; when `config/backlog-backend` is not `manual` and compatible `tasks-axi` is on `PATH`, bootstrap stays silent and firstmate uses its verbs for routine backlog mutations, otherwise it hand-edits `data/backlog.md` until installation is approved and completed.
305305
An absent or too-old `quota-axi` reports `MISSING: quota-axi (install: npm install -g quota-axi)`; firstmate cannot resolve a profile array without a compatible binary.
306-
That floor exists because it is the first build reporting per-credential auth sources, without which a candidate cannot be judged against the authentication surface it actually uses.
306+
That floor exists because it is the first build reporting per-credential auth sources, which Firstmate uses when the candidate's authoritative catalog does not itself establish the selected authentication surface.
307307
Bootstrap also reports a `TANGLE:` line when `FM_ROOT` is on a named non-default branch; follow the printed checkout remediation rather than treating it as an installable tool problem.
308308
In a read-only session that did not get the fleet lock, the same line is advisory and omits the checkout command.
309309
The locked session-start bootstrap step also runs a best-effort project clone refresh through `fm-fleet-sync.sh`.

‎docs/verification/dispatch-auth.md‎

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,68 @@ No models matching "gpt-9.9-nonexistent"
114114

115115
A listing that reaches the account and returns no row is the authoritative negative that does block a candidate.
116116

117+
## The Pi catalog is itself positive authentication-surface evidence
118+
119+
Verified 2026-08-02 on Pi 0.82.1.
120+
121+
Pi's installed `docs/models.md` states the availability rule for its own catalog:
122+
123+
```text
124+
apiKey is not required to load the file: models become available when auth is
125+
configured through /login/auth.json, CLI --api-key, or provider apiKey. If no
126+
auth is configured, the models load but stay unavailable in /model and
127+
--list-models.
128+
```
129+
130+
A row in `pi --list-models` therefore proves Pi holds configured auth for that provider family.
131+
The catalog resolves the surface positively; it is not merely support evidence.
132+
This matters because it is the only surface evidence available for a family that `quota-axi` does not model, and without it such a family looks indistinguishable from one with no surface at all.
133+
134+
## Provider family that quota-axi does not model at all
135+
136+
Verified 2026-08-02 on Pi 0.82.1 and quota-axi 0.1.16.
137+
138+
```sh
139+
quota-axi --json | jq -r '.providers[].provider'
140+
quota-axi auth --json | jq -r '.auth[].provider'
141+
```
142+
143+
Both commands return the same six names, and `minimax` is absent from each:
144+
145+
```text
146+
claude
147+
codex
148+
cursor
149+
copilot
150+
grok
151+
kimi
152+
```
153+
154+
```sh
155+
pi --list-models minimax
156+
```
157+
158+
```text
159+
provider model context max-out thinking images
160+
minimax MiniMax-M2.7 204.8K 131.1K yes no
161+
minimax MiniMax-M2.7-highspeed 204.8K 131.1K yes no
162+
minimax MiniMax-M3 1M 128K yes yes
163+
opencode-go minimax-m2.7 204.8K 131.1K yes no
164+
opencode-go minimax-m3 1M 131.1K yes yes
165+
```
166+
167+
For `harness=pi`, `model=minimax/MiniMax-M3` the catalog establishes the model is supported, places it in the `minimax` family, and by the availability rule above proves Pi holds configured `minimax` auth.
168+
The surface is Pi's own credential store for that family, and `quota-axi` models no `minimax` provider, so it supplies no window and no auth entry for it.
169+
170+
Two distinct findings must not be collapsed here:
171+
172+
- The authentication surface is resolved, by the catalog, not by `quota-axi`.
173+
- The applicable quota is unknown, because the vendor is outside `quota-axi`'s coverage.
174+
175+
Unknown quota is disclosed uncertainty and keeps the candidate eligible.
176+
A family's absence from `quota-axi` is never absence of a surface, and never a credential fault.
177+
This is the shape of the whole flat-subscription lane in `config/crew-dispatch.json`, so reading it as unresolved silently retires that lane to the premium default.
178+
117179
## Credential sources are independent per provider
118180

119181
Verified 2026-07-30 against quota-axi 0.1.16.
@@ -175,4 +237,4 @@ It asserts that the script accepts no harness, model, or provider input, never c
175237
`tests/fm-spawn-dispatch-profile.test.sh` owns spawn's deterministic profile and harness refusals.
176238
`tests/fm-bootstrap.test.sh` owns the quota-axi version-floor diagnostic.
177239
`tests/fm-quota-array-dispatch-live-e2e.test.sh` drives the public Pi skill-loading interface against one fake `quota-axi --json` snapshot per case.
178-
It covers the Claude 1 percent versus Codex 55 percent reserve regression, explicit accounting for unmeasurable runway, and the strongest-reasoning constraint.
240+
It covers the Claude 1 percent versus Codex 55 percent reserve regression, explicit accounting for unmeasurable runway, the strongest-reasoning constraint, and a provider family absent from the snapshot that must stay eligible on its catalog-resolved surface.

‎tests/fm-quota-array-dispatch-live-e2e.test.sh‎

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ LAB=$(mktemp -d "${TMPDIR:-/tmp}/fm-quota-array-dispatch-live.XXXXXX")
2626
PROJECT="$LAB/project"
2727
FAKEBIN="$LAB/fakebin"
2828
FIXTURE="$LAB/quota.json"
29+
AUTH_FIXTURE="$LAB/quota-auth.json"
2930
CALLS="$LAB/quota-axi.calls"
3031

3132
cleanup() {
@@ -39,33 +40,53 @@ cp "$OWNER" "$PROJECT/.agents/skills/quota-array-dispatch/SKILL.md"
3940
cat > "$FAKEBIN/quota-axi" <<'SH'
4041
#!/usr/bin/env bash
4142
set -u
42-
if [ "${1:-}" != --json ] || [ "$#" -ne 1 ]; then
43-
printf 'unexpected quota-axi invocation: %s\n' "$*" >&2
44-
exit 64
45-
fi
4643
printf '%s\n' "$*" >> "${QUOTA_AXI_CALLS:?}"
47-
cat "${QUOTA_AXI_FIXTURE:?}"
44+
if [ "${1:-}" = --json ] && [ "$#" -eq 1 ]; then
45+
cat "${QUOTA_AXI_FIXTURE:?}"
46+
exit 0
47+
fi
48+
# `quota-axi auth --json` is the credential-surface read the skill is allowed to
49+
# take when a candidate's surface is in question. It is served only when the case
50+
# supplied an auth fixture, so a case that never intended one still fails loudly.
51+
if [ "${1:-}" = auth ] && [ "${2:-}" = --json ] && [ "$#" -eq 2 ] \
52+
&& [ -s "${QUOTA_AXI_AUTH_FIXTURE:-/nonexistent}" ]; then
53+
cat "$QUOTA_AXI_AUTH_FIXTURE"
54+
exit 0
55+
fi
56+
printf 'unexpected quota-axi invocation: %s\n' "$*" >&2
57+
exit 64
4858
SH
4959
chmod +x "$FAKEBIN/quota-axi"
5060

5161
write_fixture() {
5262
cat > "$FIXTURE"
5363
}
5464

65+
write_auth_fixture() {
66+
cat > "$AUTH_FIXTURE"
67+
}
68+
5569
run_case() {
56-
local label=$1 expected=$2 prompt=$3 out calls required
70+
local label=$1 expected=$2 prompt=$3 out calls required snapshots stray
5771
shift 3
5872
: > "$CALLS"
5973
out=$(
6074
cd "$PROJECT" &&
6175
PATH="$FAKEBIN:$PATH" QUOTA_AXI_CALLS="$CALLS" QUOTA_AXI_FIXTURE="$FIXTURE" \
76+
QUOTA_AXI_AUTH_FIXTURE="$AUTH_FIXTURE" \
6277
pi --print --approve --no-session --no-context-files --no-extensions \
6378
--no-skills --skill .agents/skills --tools bash \
6479
--model openai-codex/gpt-5.6-sol --thinking high \
6580
"$prompt"
6681
) || fail "$label: Pi skill run failed: $out"
6782
calls=$(cat "$CALLS")
68-
[ "$calls" = "--json" ] || fail "$label: skill did not use one quota-axi --json snapshot: $calls"
83+
# The one-snapshot rule binds the quota read. A credential-surface read is a
84+
# separate, explicitly permitted command, so it is allowed but nothing else is.
85+
snapshots=$(grep -Fxc -- "--json" "$CALLS" || true)
86+
[ "$snapshots" = 1 ] \
87+
|| fail "$label: skill did not use exactly one quota-axi --json snapshot: $calls"
88+
stray=$(grep -Fxv -- "--json" "$CALLS" | grep -Fxv -- "auth --json" || true)
89+
[ -z "$stray" ] || fail "$label: unexpected quota-axi invocation(s): $stray"
6990
printf '%s\n' "$out" | grep -Fxq "$expected" \
7091
|| fail "$label: expected final line $expected, got: $out"
7192
for required in "$@"; do
@@ -106,4 +127,20 @@ run_case \
106127
"FACT=claude|reasoning=required|headroom=1|runway_seconds=10800" \
107128
"FACT=codex|reasoning=weaker|headroom=80|runway_seconds=28800"
108129

130+
# An auth-gated catalog row can resolve a candidate's surface even when
131+
# quota-axi does not model that provider family; this pins the distinction
132+
# between positive surface evidence and unknown quota.
133+
write_fixture <<'JSON'
134+
{"schemaVersion":3,"providers":[{"provider":"claude","quotaSemantics":{"description":"The all_models scope bounds every Claude model.","effectiveAvailability":[{"scope":"all_models","status":"known","effectivePercentRemaining":60,"boundedBy":["weekly"],"runway":{"status":"projected_exhaustion","usableRunwaySeconds":14400,"projectedExhaustedAt":"2030-01-01T04:00:00Z","limitingWindowId":"weekly","projectionConfidence":"established","projectionBasis":"cycle_average"}}]}}]}
135+
JSON
136+
write_auth_fixture <<'JSON'
137+
{"schemaVersion":1,"auth":[{"provider":"claude","sources":[{"source":"oauth-file","status":"available"}]}]}
138+
JSON
139+
run_case \
140+
"a provider family quota-axi does not model keeps a catalog-resolved surface" \
141+
"ELIGIBLE=BOTH" \
142+
"Resolve this matched dispatch profile array now. Load quota-array-dispatch and run quota-axi --json exactly once; you may also run quota-axi auth --json. Candidate A is harness=claude model=opus. Candidate B is harness=pi model=minimax/MiniMax-M3. Take this raw observation as given and draw your own conclusions from it: running the authoritative Pi catalog command printed the row 'minimax MiniMax-M3 1M 128K yes yes'. That is the entire catalog evidence available; no other command may be run to gather more. Both candidates have comparable required task fit and the same reasoning class for this work. For each candidate decide whether its authentication surface is resolved or unresolved, whether its applicable quota is known or unmodeled, and whether it is eligible. Return exact lines FACT=claude|eligible=<yes|no>|surface=<resolved|unresolved>|quota=<known|unmodeled> and FACT=minimax|eligible=<yes|no>|surface=<resolved|unresolved>|quota=<known|unmodeled>, then an exact final line ELIGIBLE=<BOTH|CLAUDE_ONLY>. Do not use other vendor or model commands and do not modify files." \
143+
"FACT=claude|eligible=yes|surface=resolved|quota=known" \
144+
"FACT=minimax|eligible=yes|surface=resolved|quota=unmodeled"
145+
109146
echo "# all quota-array-dispatch live behavior tests passed"

0 commit comments

Comments
 (0)