Skip to content

feat: configurable base URL, model, and token file for the Jev dispatch resolver - #6

Merged
pc-agents-lstutzman[bot] merged 8 commits into
mainfrom
fm/fm-jev-resolver-url
Oct 12, 2026
Merged

pc-agents-lstutzman[bot] merged 8 commits into
mainfrom
fm/fm-jev-resolver-url

Conversation

@pc-agents-lstutzman

Copy link
Copy Markdown
Contributor

Intent

Lee asked to check whether this fork of firstmate is behind upstream (https://github.com/kunchenguid/firstmate), check forks for anything worth leveraging, and check the documentation to make sure the setup is optimal; he then approved all five recommended actions: "All 5 please. The Jev powered stuff should allow for a URL in config so we can point to our local Jev is we are going to adopt it". This task is action 3: let firstmate's Jev-powered dispatch resolver point at our own local Jev.

What Changed

  • bin/fm-dispatch-resolve.sh now posts to a configurable <base URL>/v1/systemone. The URL comes from TYPESAFE_BASE_URL, then config/typesafe-base-url, then the default https://api.typesafe.ai. The model comes from config/typesafe-model and defaults to jev-latest. A bearer token can come from the file named in config/typesafe-token-file; when set, it is used instead of TYPESAFE_API_KEY. TYPESAFE_API_KEY is only sent to the default URL, so a custom URL with no token file sends no Authorization header. A non-default URL or a configured token file also turns the resolver on without a key. An invalid URL, or a token file that can't be read or is empty, exits with code 2 before any network call.
  • New helpers in bin/fm-env-lib.sh (fm_typesafe_config_line, fm_typesafe_base_url, fm_typesafe_token) do the resolution, so the resolver and the bootstrap rule check in bin/fm-bootstrap.sh agree on when typed resolution is active. Bootstrap also reports CREW_DISPATCH: invalid typesafe base URL and invalid typesafe token file errors. The three new config files are added to the inheritable set for secondmate homes in bin/fm-config-inherit-lib.sh.
  • docs/configuration.md and the operational-home-layout skill document the new settings and the on-switch rules. New cases in tests/fm-dispatch-resolve.test.sh and tests/fm-bootstrap.test.sh cover them.

🤖 Generated with Claude Code

Risk Assessment

⚠️ Medium: The URL feature and the round-1 bootstrap fix are correct and consistent with each other. But the later model and token-file addition goes beyond the intent and has a credential-precedence flaw: the hosted key is sent to a local or plain-http host, and the local token is ignored. The author should settle that before merge or soon after.

Testing

I ran the focused resolver test suite. Then I ran the real resolver, real bootstrap and real config inheritance against disposable lab homes and a throwaway local Jev HTTP server, with real curl and quota-axi. Results: a configured URL sends the POST to &lt;url&gt;/v1/systemone with no key and trims trailing slashes. The env override beats config. config/typesafe-model sets the model. A token file becomes the bearer and wins over the hosted key. The hosted key is never sent to a custom URL. http:///, ftp:// and a missing token file all exit 2 with no request sent. With nothing configured the resolver stays off. If the local Jev is down the run reports an error and exits 0. Bootstrap runs the typed checks when a URL or token file is configured, reports a bad URL or token file, and never prints the token. Inherited config lets a secondmate reach the same local Jev. All scenarios passed. The evidence is CLI transcripts plus the stand-in server script; there is no UI surface.

  • Live validation: ✅ go - 10 of 11 scenarios driven live against the product
Scenario Result Live Evidence
S1: operator sets config/typesafe-base-url to a local Jev with no key; the resolver POSTs to <url>/v1/systemone with no Authorization header and parses the answer ✅ pass live resolver-local-jev-transcript.txt S1: path /v1/systemone (trailing slash trimmed), authorization null, model jev-latest, rule_1 at confidence 0.95
S2 (adversarial): hosted TYPESAFE_API_KEY in env and .env with a custom URL; the key is not sent to the local host ✅ pass live resolver-local-jev-transcript.txt S2: authorization null at local Jev
S3: a token file and config/typesafe-model are configured while a hosted key is present; the request carries Bearer <token-file contents> and the configured model ✅ pass live resolver-local-jev-transcript.txt S3: authorization 'Bearer LOCAL-JEV-TOKEN-abc123', model jev-local-test
S4: TYPESAFE_BASE_URL env overrides a config URL that points at a dead port ✅ pass live resolver-local-jev-transcript.txt S4: request reached the live server, not the dead port
S5 (adversarial): malformed base URLs (http:///, ftp://) exit 2 before any network call ✅ pass live resolver-local-jev-transcript.txt S5a/S5b: exit=2 with 'has no host' and 'must be an http:// or https:// URL'; zero requests
S6 (adversarial): a configured token file that does not exist is an exit 2 config error that names the path only ✅ pass live resolver-local-jev-transcript.txt S6: exit=2 'typesafe token file is not a readable file: <path>'; zero requests
S7: with no key, URL or token file, the resolver stays off (exit 0, one off line, no call) ✅ pass live resolver-local-jev-transcript.txt S7
S8: local Jev unreachable; the resolver reports status error and exits 0 so intake is not blocked ✅ pass live resolver-local-jev-transcript.txt S8: status error, http 000, exit=0
B1–B5: bootstrap runs the typed crew-dispatch checks when a base URL (config or env) or a token file is configured, reports a host-less URL and a missing token file, and never prints the token ✅ pass live bootstrap-typed-gate-transcript.txt: B1 silent when nothing configured; B2/B2b/B5 report 'approval must be "captain"'; B3 invalid base URL; B4 invalid token file; token grep count 0
I1: the primary's typesafe-base-url, typesafe-model and typesafe-token-file propagate to a secondmate home, and the secondmate's resolver reaches the same local Jev with the token ✅ pass live secondmate-inherit-transcript.txt
Hosted path: TYPESAFE_API_KEY with the default https://api.typesafe.ai base URL is still sent as the bearer ⏸️ untested no Driving this live means sending a real request to api.typesafe.ai with a real hosted key. Using the operator's production credential is out of bounds for this gate, and a fake key would only get an au…
Evidence: Resolver against local Jev: request path, Authorization header and model as seen by the server, for S1–S8

Source: Resolver against local Jev: request path, Authorization header and model as seen by the server, for S1–S8

=== S1: config/typesafe-base-url -> local Jev, no key
exit=0
--- stdout
dispatch-resolve:
  status: escalate
  model: -   latency_ms: 0   tokens: 10/1
  rule: rule_1 (A simple bug fix with a stated root cause.)   confidence: 0.95
  probabilities: default=0.05 rule_1=0.95
  reason: no rankable eligible candidate
  note: rule matched
  candidate: claude:sonnet  provider=claude  -> eligible, unranked: provider claude unmeasured (unknown): disclosed uncertainty
--- stderr
--- requests received by local Jev:
{"path": "/v1/systemone", "authorization": null, "model": "jev-latest", "options": ["default", "rule_1"]}
=== S2: hosted key in .env and env + custom URL
exit=0
--- stdout
dispatch-resolve:
  status: escalate
  model: -   latency_ms: 0   tokens: 10/1
  rule: rule_1 (A simple bug fix with a stated root cause.)   confidence: 0.95
  probabilities: default=0.05 rule_1=0.95
  reason: no rankable eligible candidate
  note: rule matched
  candidate: claude:sonnet  provider=claude  -> eligible, unranked: provider claude unmeasured (unknown): disclosed uncertainty
--- stderr
--- requests received by local Jev:
{"path": "/v1/systemone", "authorization": null, "model": "jev-latest", "options": ["default", "rule_1"]}
=== S3: token file + custom model + hosted key present
exit=0
--- stdout
dispatch-resolve:
  status: escalate
  model: -   latency_ms: 0   tokens: 10/1
  rule: rule_1 (A simple bug fix with a stated root cause.)   confidence: 0.95
  probabilities: default=0.05 rule_1=0.95
  reason: no rankable eligible candidate
  note: rule matched
  candidate: claude:sonnet  provider=claude  -> eligible, unranked: provider claude unmeasured (unknown): disclosed uncertainty
--- stderr
--- requests received by local Jev:
{"path": "/v1/systemone", "authorization": "Bearer LOCAL-JEV-TOKEN-abc123", "model": "jev-local-test", "options": ["default", "rule_1"]}
=== S4: TYPESAFE_BASE_URL env overrides config (config points to dead port 1)
exit=0
--- stdout
dispatch-resolve:
  status: escalate
  model: -   latency_ms: 0   tokens: 10/1
  rule: rule_1 (A simple bug fix with a stated root cause.)   confidence: 0.95
  probabilities: default=0.05 rule_1=0.95
  reason: no rankable eligible candidate
  note: rule matched
  candidate: claude:sonnet  provider=claude  -> eligible, unranked: provider claude unmeasured (unknown): disclosed uncertainty
--- stderr
--- requests received by local Jev:
{"path": "/v1/systemone", "authorization": null, "model": "jev-latest", "options": ["default", "rule_1"]}
=== S5a: http:/// rejected
exit=2
--- stdout
--- stderr
error: typesafe base URL has no host: http:
--- requests received by local Jev:
=== S5b: ftp:// rejected
exit=2
--- stdout
--- stderr
error: typesafe base URL must be an http:// or https:// URL: ftp://jev.local:8800
--- requests received by local Jev:
=== S6: configured token file missing
exit=2
--- stdout
--- stderr
error: typesafe token file is not a readable file: /var/folders/w7/_1vd8cbs0hd3vx7cndzrjzf40000gn/T//fm-jev-srv.rsehw4/does-not-exist
--- requests received by local Jev:
=== S7: nothing configured -> off
exit=0
--- stdout
--- stderr
dispatch-resolve: off (TYPESAFE_API_KEY absent from the environment and /var/folders/w7/_1vd8cbs0hd3vx7cndzrjzf40000gn/T//fm-lab.BgiIq2/.env, and no custom base URL or token file configured)
--- requests received by local Jev:
=== S8: local Jev down -> status error, exit 0
exit=0
--- stdout
dispatch-resolve:
  status: error
  reason: http 000 after 0 ms: 
--- stderr
dispatch-resolve: error (http 000 after 0 ms: )
--- requests received by local Jev:
Evidence: Bootstrap typed gate on lab home (B1–B5)

Source: Bootstrap typed gate on lab home (B1–B5)

=== B1: nothing configured, rule has typed-only defect (approval: firstmate) -> untyped check, silent
exit=0
(no CREW_DISPATCH line)
=== B2: config/typesafe-base-url set, no key -> typed checks run and report the defect
exit=0
CREW_DISPATCH: invalid config/crew-dispatch.json - approval must be "captain" when present
=== B2b: TYPESAFE_BASE_URL env set, no key -> typed checks run
exit=0
CREW_DISPATCH: invalid config/crew-dispatch.json - approval must be "captain" when present
=== B3: host-less base URL reported by bootstrap
exit=0
CREW_DISPATCH: invalid typesafe base URL - typesafe base URL has no host: http:
=== B4: missing token file reported by bootstrap
exit=0
CREW_DISPATCH: invalid typesafe token file - typesafe token file is not a readable file: /var/folders/w7/_1vd8cbs0hd3vx7cndzrjzf40000gn/T//fm-jev-srv.rsehw4/missing-token
=== B5: valid token file alone -> typed checks run, token never printed
exit=0
CREW_DISPATCH: invalid config/crew-dispatch.json - approval must be "captain" when present
0
Evidence: Secondmate inheritance and the secondmate's resolver reaching the local Jev

Source: Secondmate inheritance and the secondmate's resolver reaching the local Jev

=== I1: primary home config propagated to a secondmate home
propagate exit=0
typesafe-base-url: http://127.0.0.1:18831
typesafe-model: jev-local-test
typesafe-token-file: /var/folders/w7/_1vd8cbs0hd3vx7cndzrjzf40000gn/T//fm-jev-srv.rsehw4/jev-token
secondmate resolver exit=0
--- request seen by local Jev from secondmate:
{"path": "/v1/systemone", "authorization": "Bearer LOCAL-JEV-TOKEN-abc123", "model": "jev-local-test", "options": ["default", "rule_1"]}
Evidence: Disposable local Jev stand-in server used for the live runs

Source: Disposable local Jev stand-in server used for the live runs

import http.server, json, sys
log = sys.argv[2]
class H(http.server.BaseHTTPRequestHandler):
    def do_POST(self):
        body = self.rfile.read(int(self.headers.get('Content-Length', 0)))
        req = json.loads(body)
        rec = {"path": self.path, "authorization": self.headers.get("Authorization"), "model": req.get("model"), "options": sorted(req["questions"]["rule"]["criteria"].keys())}
        open(log, "a").write(json.dumps(rec) + "\n")
        opts = rec["options"]
        probs = {o: 0.0 for o in opts}; probs["rule_1"] = 0.95; probs["default"] = 0.05
        out = {"answers": {"rule": {"choice": "rule_1", "confidence": 0.95, "probabilities": probs}}, "usage": {"input_tokens": 10, "output_tokens": 1}}
        b = json.dumps(out).encode()
        self.send_response(200); self.send_header("Content-Type", "application/json"); self.send_header("Content-Length", str(len(b))); self.end_headers(); self.wfile.write(b)
    def log_message(self, *a): pass
s = http.server.HTTPServer(("127.0.0.1", int(sys.argv[1])), H)
s.serve_forever()

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 warning
  • ⚠️ bin/fm-dispatch-resolve.sh:147 - Credential precedence from commit a6e3c56. TYPESAFE_API_KEY (env or .env) always wins over config/typesafe-token-file, and it is sent to whatever base URL is set. Concrete case: the operator keeps the hosted key in .env and adopts a local Jev with config/typesafe-base-url=http://host:8800 plus a token file. The resolver sends Authorization: Bearer &lt;hosted typesafe.ai key&gt; to the local host, over plain http (lines 147-148, 352-356). The configured local token is ignored, so the local Jev rejects the request (http 401 -> escalate) and the hosted secret leaves for a third host. The token file can only matter when no hosted key exists, and that is the opposite of the 'adopt local Jev alongside hosted' setup. tests/fm-dispatch-resolve.test.sh asserts 'TYPESAFE_API_KEY wins over the token file' while a local URL is configured, so the test locks in this behavior. docs/configuration.md says the same ('so hosted typesafe.ai use is unchanged'). The reverse sibling also exists: a token file with the default base URL sends the local token to api.typesafe.ai. Suggested rule: the token file wins whenever it is configured, or the hosted key is sent only to FM_TYPESAFE_DEFAULT_BASE. This changes the documented contract, so it needs the author's decision.
  • ⚠️ bin/fm-env-lib.sh:76 - Simplification: commit a6e3c56 adds components beyond the stated intent ('allow for a URL in config so we can point to our local Jev'). They are: config/typesafe-model (bin/fm-dispatch-resolve.sh:114-115); config/typesafe-token-file with fm_typesafe_token (bin/fm-env-lib.sh:70-95, resolver :146-148); the token file as an extra on switch (bin/fm-bootstrap.sh:1069); inheritance of both into secondmate homes (bin/fm-config-inherit-lib.sh:85); and the docs and tests for them. The recorded decisions approved only the env override and keyless mode. Neither the model name nor a token file is required to point the resolver at a local Jev. Remove them unless the local Jev actually needs a different model name or bearer auth. If it does, the precedence defect in hosted-key-overrides-local-token is inside this component.
  • ℹ️ docs/configuration.md:1221 - The docs example and tests (tests/fm-dispatch-resolve.test.sh LOCAL_JEV) use a real-looking private Tailscale hostname, slartibartfast.tail299042.ts.net. The tailnet ID also shows up elsewhere in the operator's environment. A committed fork repo would publish the internal host name. A neutral placeholder such as http://jev.local:8800 would do the same job. Whether to keep it is the author's call.
  • ℹ️ bin/fm-env-lib.sh:62 - The validation accepts a URL with no host. 'http:///' matches http://?*. The slash trim then removes every trailing slash, including the scheme's '//', and leaves 'http:'. That value does not match the http://|https:// no-host check, so it is returned as a valid base URL. The request then goes to 'http:/v1/systemone' and fails as an http 000 escalate, not as the documented exit 2 configuration error. Fix: check for an empty host after stripping the scheme, for example [ -n &#34;${url#*://}&#34; ] after the trim, or trim only slashes beyond the authority.

🔧 Fix applied.
3 issues (1 warning, 2 infos) still open:

  • ⚠️ bin/fm-env-lib.sh:76 - Simplification: commit a6e3c56 adds components beyond the stated intent ('allow for a URL in config so we can point to our local Jev'). They are: config/typesafe-model (bin/fm-dispatch-resolve.sh:114-115); config/typesafe-token-file with fm_typesafe_token (bin/fm-env-lib.sh:70-95, resolver :146-148); the token file as an extra on switch (bin/fm-bootstrap.sh:1069); inheritance of both into secondmate homes (bin/fm-config-inherit-lib.sh:85); and the docs and tests for them. The recorded decisions approved only the env override and keyless mode. Neither the model name nor a token file is required to point the resolver at a local Jev. Remove them unless the local Jev actually needs a different model name or bearer auth. If it does, the precedence defect in hosted-key-overrides-local-token is inside this component.
  • ℹ️ bin/fm-bootstrap.sh:1069 - Bootstrap reports a bad base URL (CREW_DISPATCH: invalid typesafe base URL) but not a bad token file. It only checks that the config/typesafe-token-file line is non-empty and treats that as the on switch. The resolver checks more: through fm_typesafe_token (bin/fm-env-lib.sh:80-95, called at bin/fm-dispatch-resolve.sh:147) it exits 2 when that path is missing, unreadable or empty. Concrete case: config/typesafe-token-file names ~/jev-token, but the file was never created. Bootstrap stays silent, and every dispatch then fails with exit 2 'typesafe token file is not a readable file'. Fix: in crew_dispatch_validate, call fm_typesafe_token "$CONFIG" the same way fm_typesafe_base_url is called and print 'CREW_DISPATCH: invalid typesafe token file - <reason>' (the reason names the path, never the contents). Then both resolver config errors go through the same shared helper.
  • ℹ️ .agents/skills/operational-home-layout/SKILL.md:22 - The updated .env line says a key or a non-default base URL gates bin/fm-dispatch-resolve.sh. A configured config/typesafe-token-file is a third on switch, both in the resolver (bin/fm-dispatch-resolve.sh:147-149) and in bootstrap (bin/fm-bootstrap.sh:1069), as docs/configuration.md says. So the gate description is still incomplete. Add 'or config/typesafe-token-file'.

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ⚠️ bin/fm-env-lib.sh:76 - Simplification: commit a6e3c56 adds components beyond the stated intent ('allow for a URL in config so we can point to our local Jev'). They are: config/typesafe-model (bin/fm-dispatch-resolve.sh:114-115); config/typesafe-token-file with fm_typesafe_token (bin/fm-env-lib.sh:70-95, resolver :146-148); the token file as an extra on switch (bin/fm-bootstrap.sh:1069); inheritance of both into secondmate homes (bin/fm-config-inherit-lib.sh:85); and the docs and tests for them. The recorded decisions approved only the env override and keyless mode. Neither the model name nor a token file is required to point the resolver at a local Jev. Remove them unless the local Jev actually needs a different model name or bearer auth. If it does, the precedence defect in hosted-key-overrides-local-token is inside this component.
  • ℹ️ docs/configuration.md:1155 - Round 2 added config/typesafe-token-file as an on switch to the layout skill. It left out two other places that describe the same gate, and the token file is a third on switch in both the resolver (bin/fm-dispatch-resolve.sh:147-149) and bootstrap (bin/fm-bootstrap.sh:1069-1073). (1) docs/configuration.md:1155 says typed resolution is active with "a key or a configured non-default base URL". (2) docs/configuration.md:1202 says only the base URL is "also an on switch". (3) The bin/fm-dispatch-resolve.sh:13 header says "Neither a key nor a custom URL: ... off", which contradicts its own lines 11-12. Example: an operator who reads :1155 and configures only a token file would expect bootstrap to skip the typed checks, but it runs them. To fix, add "or a configured config/typesafe-token-file" at each of these three places.

🔧 Fix applied.
1 warning still open:

  • ⚠️ bin/fm-env-lib.sh:76 - Simplification: commit a6e3c56 adds components beyond the stated intent ('allow for a URL in config so we can point to our local Jev'). They are: config/typesafe-model (bin/fm-dispatch-resolve.sh:114-115); config/typesafe-token-file with fm_typesafe_token (bin/fm-env-lib.sh:70-95, resolver :146-148); the token file as an extra on switch (bin/fm-bootstrap.sh:1069); inheritance of both into secondmate homes (bin/fm-config-inherit-lib.sh:85); and the docs and tests for them. The recorded decisions approved only the env override and keyless mode. Neither the model name nor a token file is required to point the resolver at a local Jev. Remove them unless the local Jev actually needs a different model name or bearer auth. If it does, the precedence defect in hosted-key-overrides-local-token is inside this component.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 10 of 11 scenarios driven live against the product
Scenario Result Live Evidence
S1: operator sets config/typesafe-base-url to a local Jev with no key; the resolver POSTs to <url>/v1/systemone with no Authorization header and parses the answer ✅ pass live resolver-local-jev-transcript.txt S1: path /v1/systemone (trailing slash trimmed), authorization null, model jev-latest, rule_1 at confidence 0.95
S2 (adversarial): hosted TYPESAFE_API_KEY in env and .env with a custom URL; the key is not sent to the local host ✅ pass live resolver-local-jev-transcript.txt S2: authorization null at local Jev
S3: a token file and config/typesafe-model are configured while a hosted key is present; the request carries Bearer <token-file contents> and the configured model ✅ pass live resolver-local-jev-transcript.txt S3: authorization 'Bearer LOCAL-JEV-TOKEN-abc123', model jev-local-test
S4: TYPESAFE_BASE_URL env overrides a config URL that points at a dead port ✅ pass live resolver-local-jev-transcript.txt S4: request reached the live server, not the dead port
S5 (adversarial): malformed base URLs (http:///, ftp://) exit 2 before any network call ✅ pass live resolver-local-jev-transcript.txt S5a/S5b: exit=2 with 'has no host' and 'must be an http:// or https:// URL'; zero requests
S6 (adversarial): a configured token file that does not exist is an exit 2 config error that names the path only ✅ pass live resolver-local-jev-transcript.txt S6: exit=2 'typesafe token file is not a readable file: <path>'; zero requests
S7: with no key, URL or token file, the resolver stays off (exit 0, one off line, no call) ✅ pass live resolver-local-jev-transcript.txt S7
S8: local Jev unreachable; the resolver reports status error and exits 0 so intake is not blocked ✅ pass live resolver-local-jev-transcript.txt S8: status error, http 000, exit=0
B1–B5: bootstrap runs the typed crew-dispatch checks when a base URL (config or env) or a token file is configured, reports a host-less URL and a missing token file, and never prints the token ✅ pass live bootstrap-typed-gate-transcript.txt: B1 silent when nothing configured; B2/B2b/B5 report 'approval must be "captain"'; B3 invalid base URL; B4 invalid token file; token grep count 0
I1: the primary's typesafe-base-url, typesafe-model and typesafe-token-file propagate to a secondmate home, and the secondmate's resolver reaches the same local Jev with the token ✅ pass live secondmate-inherit-transcript.txt
Hosted path: TYPESAFE_API_KEY with the default https://api.typesafe.ai base URL is still sent as the bearer ⏸️ untested no Driving this live means sending a real request to api.typesafe.ai with a real hosted key. Using the operator's production credential is out of bounds for this gate, and a fake key would only get an au…
  • bash tests/fm-dispatch-resolve.test.sh (focused resolver suite, all passed)
  • Disposable local Jev stand-in (python3 -I fakejev.py 18831) that records the request path, Authorization header and model, and returns a valid Choice answer
  • Disposable lab home via bin/fm-lab-home.sh create, then the real bin/fm-dispatch-resolve.sh brief.md --project demo run under env -i with real curl and real quota-axi, for scenarios S1–S8
  • Real bin/fm-bootstrap.sh against the lab home with a rule that has a typed-only defect (approval: firstmate), for scenarios B1–B5
  • propagate_secondmate_inheritance &lt;primary-lab&gt; &lt;secondmate-lab&gt; followed by the resolver run in the secondmate home (I1)
  • Teardown: killed the server and moved the lab homes and scratch dir to the Trash; git status clean
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed → no changes applied ✅
  • ⚠️ linter found issues (exit code 1)

🔧 Fix applied.
1 warning still open:

  • ⚠️ linter found issues (exit code 1)

🔧 No changes applied.
✅ Re-checked - no issues remain.

✅ **Push** - passed

✅ No issues found.

Lee Stutzman added 8 commits October 12, 2026 18:32
…-base-url or TYPESAFE_BASE_URL

A configured non-default base URL turns the resolver on without an API key and sends no Authorization header when no key is set. The file is inherited by second mates.
…a local Jev

config/typesafe-model sets the request model (default jev-latest). config/typesafe-token-file names a file read at call time as the bearer; TYPESAFE_API_KEY still wins. Both are inherited by second mates and a token file activates the bootstrap rule check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants