Repository navigation
feat(bin): add the free-tier routing guard, pilot config, and provider survey - #1
Merged
Merged
Conversation
* fix: publish promote and Relay meta rewrites through contained replace Bare mv still rewrote live task records in place, so a symlink meta could be followed to a target outside state/. Route those field rewrites through the shared publisher and drop the unused library aliases. Co-authored-by: Cursor <[email protected]> * no-mistakes(review): Refuse dangling symlinks during X metadata clear * no-mistakes(review): Refuse unsafe metadata before follow-up and promotion side effects * no-mistakes(review): Exercise dangling symlink refusal through clear helper --------- Co-authored-by: Cursor <[email protected]>
* fix(watch): absorb a turn-end whose pane churned since the previous poll The watcher's "absorb a benign turn-end when the crew is provably working" triage was structurally unreachable for any harness whose semantic busy state has no verified source. crew_absorb_class only reports working for an actively running no-mistakes step or an exact busy verdict, and bin/fm-crew-state.sh can only answer unknown for such an adapter, so codex crewmates surfaced a signal wake at every turn boundary with nothing to act on - a full supervisor drain, inspect and acknowledge turn per worker turn, scaling with the number of workers in flight and drowning the wakes that matter in identical noise. Widen the proof rather than bound the wake rate. A wake carrying only bare turn-ended markers is now also benign when the task's pane content changed since the previous poll, compared against the same state/.hash-* marker the staleness backbone already records and already trusts as liveness. That evidence claims no harness semantics, so it fabricates no busy verdict an adapter has not earned, and it needs no adapter cooperation. Absorb stays evidence-driven in both directions. A wake naming any status file keeps the strict proof, every captain-relevant verb still surfaces immediately, and an unresolvable task, a missing prior hash, a failed or empty capture, or an unchanged pane all surface exactly as before. The absorb defers rather than swallows: a crew that has stopped renders nothing further, so its now-static pane surfaces through the staleness backbone within a poll or two. Bounding the surfacing rate instead would have suppressed genuinely stopped workers. The derivation lives with the .hash-* marker format in bin/fm-watch.sh, which owns it, and costs one bounded capture reached only for a no-verb turn-end whose crew is not already provably working. * no-mistakes(review): Captain, guard pane-churn absorption from collisions and secondmates * no-mistakes(review): Captain, make watcher marker identities injective * no-mistakes(review): Captain, isolate ambiguous legacy markers and restore Herdr sourcing * no-mistakes(review): Captain, localize pane-churn collision guard * no-mistakes(review): Captain, reject malformed pane-churn hashes * no-mistakes(document): Document pane-churn turn-end evidence * no-mistakes: apply CI fixes * fix(watch): gate and bound the pane-churn turn-end absorb Make the pane-churn form of positive work evidence opt-in per home and bound how long it may defer one endpoint's bare turn-ends. Absorbing a bare turn-end on pane churn is now reached only when the home creates config/turnend-churn-absorb. The other two proofs read a verdict the harness itself vouches for, while this one infers execution from rendered bytes, so widening the absorb is a home's choice rather than a default every fleet inherits. With the flag absent the predicate returns on its first line and triage is unchanged. Churn and pane staleness read the same pane, so neither can be the other's only backstop. A pane that renders continuously never presents the two consecutive identical hashes the staleness backbone needs, so an unbounded churn absorb left a worker that had genuinely stopped behind such a renderer with no path to surface at all. One endpoint's turn-ends may now ride churn evidence for at most FM_TURNEND_CHURN_ABSORB_SECS, tracked in state/.churn-since-*, after which the wake surfaces and the window restarts. The bound is evaluated before any .stale- state is touched, so a wake that surfaces there leaves the staleness backbone's own classification alone. Covers both with behavioral tests: the same churning fixture that absorbs with the flag surfaces and queues without it, and a spent deferral window surfaces and restarts. The four existing safety guards now run with the flag enabled so they keep proving their specific guard. * no-mistakes(review): Fail closed on invalid churn deferral state * no-mistakes(review): Validate persisted churn deadlines before arithmetic * no-mistakes(review): Make churn deadlines transactional and bounds safe * no-mistakes(review): Compose turn-end evidence per task from one snapshot * no-mistakes(review): Restore strict turn-end fallback guards * no-mistakes(document): Clarify pane-churn supervision documentation * no-mistakes(lint): Fix watcher arithmetic lint issues * no-mistakes: apply CI fixes * no-mistakes(document): Clarify pane-churn fail-closed documentation * fix(bin): prioritize active pipeline-owned crew runs (#3194) * fix(bin): bind the live pipeline-owned run instead of a superseded failed row fm-crew-state.sh bound a superseded FAILED no-mistakes run to a task instead of the LIVE replacement run: the live run's pipeline-owned lane head is not a git object in the task worktree, so head-equality attribution rejected it and the coarse runs-list fallback silently continued past the RUNNING row onto an older failed row whose head equalled the stale worktree HEAD. The home summary then flipped invalid and Bearings hid the home's live work (F10). Attribution precedence now follows the daemon's own identity: - An ACTIVE run for the task's branch binds without head equality while branch_sync.state is pipeline_owned (fm_nm_run_is_pipeline_owned_active); the pipeline owning the branch is itself the attribution. - A genuinely failed run with no later run on the branch still reports failed through the unchanged head-equality path - real failures are not hidden. - In the coarse runs scan, an unresolvable head is unknown attribution and stops the scan (fm_nm_head_resolvable) instead of falling through to an older row; a resolvable-but-mismatched head keeps the historical reused-branch skip. The exemption never applies to a terminal run and requires pipeline_owned specifically, both pinned by negative-control tests. Fixture shape verified against the live incident run's real axi status output. * no-mistakes(document): Updated run-attribution documentation ownership * no-mistakes(review): Captain, make watcher marker identities injective * no-mistakes(review): Captain, localize pane-churn collision guard * no-mistakes(review): Compose turn-end evidence per task from one snapshot * no-mistakes(review): Restore strict turn-end fallback guards * no-mistakes(document): Align pane-churn watcher documentation * no-mistakes(ci): Captain, fixed the flaky cooldown boundary test by freezing its executable clock. The failure reproduced before the fix and passed five consecutive full-suite runs afterward. Extended ShellCheck passed; full lint stopped because actionlint 1.7.12 is not installed --------- Co-authored-by: Kun Chen <[email protected]>
* fix(bin): add a safe owner for custom-check retirement Agents were improvising rm of check files with unset STATE/ID, which wedges headless panes. Unregister validates the id and state directory first. Co-authored-by: Cursor <[email protected]> * no-mistakes(review): Refuse explicitly empty custom-check state overrides * no-mistakes(document): Document custom-check retirement safety contract --------- Co-authored-by: Cursor <[email protected]>
…r survey Adds the pilot from the fm-free-tier-routing scout design plus the wider multi-provider survey it asked for. bin/fm-free-tier-guard.sh is the enforcement point: it refuses unless the target repo is named in a home-local config/free-tier-repos allowlist and the brief text matches no deny term (credential, secret, token, candidate, PII, Article 9, Bull, strategy). An absent allowlist refuses everything, so free-tier routing stays off until a home opts a repo in by name. docs/free-tier-routing.md carries the operator procedure: the Groq provider entries for opencode and pi, the crew-dispatch rule JSON to install into the home-local gitignored config, the guard's contract, the paid-vs-free comparison procedure, and the ranked keys the owner must create. docs/free-tier-providers.md is the evidence survey across 24 vendors, each either quoted from its own terms or marked unverified. It closes the scout report's open Cerebras question from the actual Inference Terms PDF, and records rejected sources with the reason rather than wiring them in.
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.
What this adds
The free-tier routing pilot from the
fm-free-tier-routingscout design, plus the wider multi-provider survey it asked for.bin/fm-free-tier-guard.shis the enforcement point, run at brief-writing time.It exits 0 (
eligible) only when the target repo is named in a home-localconfig/free-tier-reposallowlist AND the brief text matches no deny term.Everything else refuses.
An absent, empty, or unreadable allowlist refuses every repo, so free-tier routing stays off until a home opts a repo in by name.
The guard is deliberately fail-closed and deliberately over-refuses: a false refusal costs one fallback to the paid tier, while a miss publishes content to an external vendor.
It is documented as a mechanical backstop for obvious mis-scoping, not a classifier - firstmate's judgement at intake remains the real gate.
docs/free-tier-routing.mdis the operator procedure: Groq provider entries for opencode and pi, the crew-dispatch rule JSON to install into the home-local gitignored config, the guard's contract, the paid-vs-free comparison procedure, and the ranked keys the owner must create.docs/free-tier-providers.mdis the evidence survey across 24 vendors, each either quoted from its own terms or explicitly marked unverified.The dispatch rule (not shippable as a file)
config/crew-dispatch.jsonis home-local and gitignored, so this PR ships the rule text rather than the file.Add this object to the
rulesarray of the home's own config, ahead of the general cheap-model rule:{ "when": "Boilerplate test generation in a registered non-core repo: fixtures, mocks, or assertion scaffolding with no design judgement, in a project where free-tier routing has been enabled and bin/fm-free-tier-guard.sh returns eligible for this repo and brief.", "use": { "harness": "opencode", "model": "groq/openai/gpt-oss-120b", "effort": "low" }, "why": "Free-tier relief for the highest-volume, lowest-judgement task class, on the vendor whose terms forbid training on inputs regardless of tier. Never select this profile without a passing bin/fm-free-tier-guard.sh check; see docs/free-tier-routing.md." }The repo allowlist file
config/free-tier-reposis one repo name per line, blank lines and#comments ignored, and is covered by the existing gitignoredconfig/directory.Survey findings that correct the prior scout report
Vendors that state in their own terms that they train on free-tier input are recorded as rejected with the quote, not omitted: NVIDIA NIM (API Trial ToS §3.3, which also restricts the trial to non-production use), GitHub Copilot Free (training on by default since 2026-04-24), Google Gemini free tier, Z.ai, Agnes AI, and Cohere.
Sources that cannot be verified, or that are not dispatchable at all, are likewise recorded with the reason rather than wired in: b.ai, Puter AI (browser-JS only, no server key), Grok (no free API tier), GitHub Models (retired 2026-07-30).
Keys the owner must create
Account creation is deliberately the owner's step; no accounts were created.
GROQ_API_KEYCEREBRAS_API_KEYSCW_SECRET_KEYCLOUDFLARE_API_TOKENOPENROUTER_API_KEYValidation
Validated through the no-mistakes pipeline, run
01M1C1T61KE993PS1B64FVDAWN.Review, Test, Document and Lint all completed.
Review took seven fix rounds, every one of them closing a way the guard said "eligible" when it should have refused, each proved by running the script rather than by reading it:
--repovalue carrying a listed namegreperror reading as a clean scan--helpexiting 0, the same code that means eligiblecandidateProfile,secretKey,apiTokenAPIKey,DBConnection,PIIRedacttests/fm-free-tier-guard.test.shpins all of them, plus the innocent words that must keep passing (bulletin,tokenizer,secretary).Two honest notes on that run:
bin/fm-lint.shexits 0 with ShellCheck 0.11.0 and actionlint 1.7.12, verified both inside the pipeline's own worktree and again locally on this exact head. The step was approved on that evidence.main. CI checks therefore run only if the fork has Actions enabled; if it does not, this PR carries no automated checks and the validation evidence above is the record.Not done, and why
AGENTS.mdtrigger line was added. Per the coding guidelines' size discipline, an optional opt-in home-local pilot does not earn per-session token cost in the always-loaded file; discoverability is carried bydocs/scripts.md, the docs page, and the dispatch rule's ownwhytext.