Repository navigation
feat(bin): route declared deployment-configuration paths to the careful rule - #5
Merged
Merged
Conversation
…ul rule Typed dispatch resolution decided every rule from Jev's reading of the brief, so deployment-configuration work rode on rule wording alone. Measurement of six candidate rewordings found none that beat the current text overall, while the current text still sends vercel.json rewrites, ArgoCD application manifests, CloudFormation templates, Kubernetes and ingress manifests, and deploy scripts to the cheap tier. Add a path fact ahead of the model call. A brief may state the paths it changes or targets on a "Target paths:" line; when one of them matches the resolver's deployment-configuration list, the rule declaring the new "path_force": "deployment-config" field is selected in code with no request to Jev. The rule is found by that declaration rather than by index, so a home whose rules sit in another order routes identically. Approval, rule and profile floors, quota evidence, and the spendPriority argmax run exactly as they do for a model-chosen rule. Paths come only from that explicit line, never from prose, and a brief with no line, no matching path, or a home declaring no path_force keeps the existing Jev call and output unchanged. A forced result reports decided_by: path-forced with the matched path and pattern in place of the model, confidence, and probability lines.
…ent opt-in inertness
… verification doc
max-metaplanet
force-pushed
the
fm/dispatch-path-force
branch
from
September 23, 2026 22:16
ca8a0d8 to
9b357c2
Compare
max-metaplanet
added a commit
that referenced
this pull request
Oct 6, 2026
…ul rule Carried from fork commit 02a1e91 (#5). Path forcing and upstream's newer resolver work are orthogonal features, so the conflicts are merged rather than decided between. bin/fm-dispatch-resolve.sh now carries both. Upstream's per-rule `min_confidence` floors and its runner-up fallback still govern a model-decided answer, and a path-forced choice bypasses them because no model answered: there is no confidence or probability to hold to a floor and no runner-up to fall to, which the fold states explicitly rather than leaving to a reader to infer from a null. The request body keeps upstream's task-sections-only brief rather than this commit's whole-brief send, so forcing does not widen what leaves the machine. The evidence block and the rendered output carry upstream's `fallback:` line on a model-decided result and this commit's `decided_by: path-forced` shape on a forced one. docs/configuration.md keeps upstream's restructured field tables and labelled subsections, with `path_force` folded into the resolver-only field list, the bootstrap validation list, and the diagnostics list, and the pre-model path check added as its own subsection ahead of what the model receives, because the check runs before the model call. This commit's older sentence saying the resolver sends the whole brief is dropped in favour of upstream's task-sections-only statement, which is what the code now does. tests/fm-dispatch-resolve.test.sh keeps both sets of malformed-rule cases; the `min_confidence` and `path_force` validations are independent.
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
Change bin/fm-dispatch-resolve.sh so that deployment-configuration work is routed to the careful tier by a path fact rather than by rule wording.
The measured problem: the current rule_3 wording sends three deployment-config cases to the cheap tier. That is the only measured routing loss in the current text, and rewording cannot fix it: six candidate rewordings were measured and none beat the current text overall. Evidence: ~/.treehouse/firstmate-7bab20/3/firstmate/data/jev-staging-clause/report.md, section "The ambiguous region, case by case" and the current text's missed cases - vercel.json rewrites, ArgoCD application manifests, CloudFormation templates, Kubernetes and ingress manifests, and deploy scripts are the cases a classifier is genuinely unsure about.
Spec: BEFORE the Jev call, if the task's changed or target paths match vercel.json, *.tf or .tfvars, CloudFormation templates, Kubernetes or Helm manifests (including ArgoCD Application CRs and ingress configs), or deploy/release scripts (scripts/deploy, deploy.sh or .ps1, release workflows), force the careful tier and record 'path-forced'.
Stated limitation, to be preserved rather than designed around: this needs the brief to carry target paths, and only some briefs do. Where no paths are present it must fall through to Jev unchanged. Paths must not be inferred from prose to make the check fire more often - that reintroduces the exact ambiguity the path rule exists to avoid.
Required in the change: 'path-forced' must be distinguishable in the output from a Jev-decided result. A forced route and a classified route are different facts, and a reader must not have to guess which happened.
What Changed
bin/fm-dispatch-resolve.shnow checks paths before the Jev call. It reads only explicitTarget paths: <path> ...lines in the brief and never scans prose. If a declared path matches the deployment-configuration list, the rule declaring"path_force": "deployment-config"is selected in code and no Jev request is sent. The list coversvercel.json,*.tf/*.tfvars, CloudFormation templates, Kubernetes/ingress/Helm/ArgoCD manifests, deploy scripts, and deploy, release, or publish workflows. Approval, floors, the quota snapshot, andspendPriorityranking run the same as before. If there is noTarget paths:line, no match, or no rule declaringpath_force, the Jev path runs unchanged.decided_by: path-forced, the rule and itswhenexcerpt, andforced_path/forced_pattern. A result with nodecided_by:line was decided by Jev. The resolver rejects apath_forcevalue other than"deployment-config"or more than one rule declaring it (exit 2).fm-bootstrap.shapplies the same checks while typed resolution is active.Target paths:line form are documented indocs/configuration.md,AGENTS.md,bin/fm-brief.sh, the examplecrew-dispatch.json, and the verification doc. New tests intests/fm-dispatch-resolve.test.shandtests/fm-bootstrap.test.shcover each path class, forcing by declaration rather than rule order, fall-through for near-miss paths, prose mentions, and non-canonical lines, and the malformed-config cases.Follow-ups (not done here)
config/crew-dispatch.jsondeclarespath_forceon no rule today, so path forcing is inert here: the measured misroutes -vercel.jsonrewrites, ArgoCD application manifests, CloudFormation templates, Kubernetes and ingress manifests, and deploy scripts - keep routing through Jev exactly as they do now until that file's careful rule carries the declaration. This change deliberately edits no home config; adding the declaration is a follow-up for the main home, which owns that file.scripts/release.shorbin/release.ps1match no pattern. The fact list covers deploy-named scripts (scripts/deploy*,*deploy*.sh,*deploy*.ps1) and deploy, release, or publish workflows under.github/workflows/, which is what the spec enumerates; widening it to release-named scripts is a separate decision.Risk Assessment
✅ Low: The fix round narrows the Target paths parser to exactly the documented form, as the user instructed. Anything not in that form falls through to the unchanged Jev path, which is the safe direction. The docs and tests were updated to match, and I found no new defect or intent conflict.
Testing
I ran the real resolver CLI against the live Jev API and the real quota-axi, using throwaway FM_HOMEs in /tmp that were removed afterwards. All 12 declared deployment-config paths were path-forced to the careful rule without a model call, and the output clearly marks them. All fall-through, near-miss, non-documented-spelling and inert-home cases reached a live Jev call and printed the normal model, confidence and probability lines. A forced route succeeded with curl absent from PATH, so it makes no network call. Invalid path_force configs exit 2. The focused test file passes. The byte-for-byte check on the fall-through request was only done in the test suite, not live. Midway through the run, quota-axi started reporting the claude provider as unmeasured, so later results show status escalate; that comes from the live quota source and does not change which rule was selected. The overall result is go.
Target paths: vercel.jsonin a home that declares path_force routes to the careful rule, shown as decided_by: path-forced with no model lineEvidence: Live resolver transcript: forced vs Jev-decided routes across all path classes and fall-through cases
Source: Live resolver transcript: forced vs Jev-decided routes across all path classes and fall-through cases
Evidence: No-network proof (curl removed from PATH) and path_force config guards
Source: No-network proof (curl removed from PATH) and path_force config guards
Evidence: Forced vs classified output side by side
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-dispatch-resolve.sh:279- Simplification: the change adds a component the intent doesn't ask for.fm_dispatch_target_pathsaccepts several spellings of the declaration: an optional-Markdown bullet prefix, paths wrapped in backticks, and trailing commas stripped both before and after the backtick strip. The intent only needs the brief to carry target paths on an explicit line, and bin/fm-brief.sh documents that line asTarget paths: <path> [<path>...]. The narrower form, one exactTarget paths:line with whitespace-separated paths, meets the intent and removes the extra ways a declared token gets rewritten. Recommend narrowing to that form, unless the bullet, backtick and comma spellings are deliberately supported for briefs written by hand.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Target paths: vercel.jsonin a home that declares path_force routes to the careful rule, shown as decided_by: path-forced with no model lineFM_HOME=<lab>/forced bash bin/fm-dispatch-resolve.sh <brief> --project labon 12 declared-path briefs: vercel.json, infra/main.tf, env/prod.tfvars, template.yaml, stacks/api.template.json, deploy/web-ingress.yaml, argo/app.yaml, charts/web/values-prod.yaml, scripts/deploy-web.sh, tools/deploy.ps1, .github/workflows/release.yml, and a multi-path line ending in vercel.json (real Jev key, real quota-axi)Same command on fall-through briefs: prose mentioning vercel.json and k8s ingress with no Target paths line, src/pager.ts, src/application.yaml + docs/template-guide.md,- Target paths: vercel.json, backtickedvercel.json,vercel.json, src/a.tsFM_HOME=<lab>/inert(unmodified copy of the operator config, no path_force) with Target paths: vercel.jsonPATH with curl removed: the forced vercel.json brief vs the non-forced src/pager.ts briefConfig guards: path_force="careful", and path_force declared on two rulesenv -u TYPESAFE_API_KEY bash tests/fm-dispatch-resolve.test.sh(focused file, including byte-for-byte fall-through request assertions)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.