You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: Runtime override for declared env values #258
Tried: point the app at a data file per environment/test. Expected: a declared env binding with a host override. Got:env values are fixed literals. Run 2 copied the whole project to a temp dir per test; run 1 read process.env inside the function instead, bypassing the declared-binding model the docs recommend. Suggestion:env: {NAME: {value: default, from: host}} (default with runtime override), and a documented data-directory pattern. Evidence: an A/B benchmark on URLCode 0.4.1 with Sonnet 5 agents building the same Todo app from the repo docs. Run 1 (benchmark Agent B, no authoring skill, no browser check) and run 2 (session "Todo application with URLCode", authoring skill loaded, tightened prompt) hit this independently. n=1 each; single small app, so treat frequency as anecdotal. The Agent A control (no URLCode) needed 2 shell calls and 0 dependencies for the same app.
Decision: do not add {value: default, from: host}.
A default that a host can silently replace changes what a reviewed urlcode.yaml means, and readiness/audit currently treats literals as reviewable.
Preferred shape if evidence holds: an optional default on the existing operator-resolved {env: NAME} reference. The override stays an operator-policy grant, is listed by audit, and a missing policy still fails closed unless a default is declared.
Now, docs only: document a data-directory pattern (an {env: DATA_DIR} binding read by the function) that needs no new semantics.
Evidence is anecdotal (n=1 each), so the default change waits for more runs.
Docs part shipped in #300 (examples/data-dir and the guide note). The optional default on {env: NAME} stays deferred pending more evidence, so this issue stays open.
Checked the current implementation before proposing a shape: env already supports two shapes today — {value: "literal"} and {env: "HOST_VAR_NAME"} (host pass-through), resolved at compile time, with host pass-through gated by an explicit per-route operator allowlist (permissions.routes[pattern].env). So the "secrets leaking" concern is already handled by that existing gate — no new trust boundary needs designing.
Proposed schema: extend the existing env field instead of introducing new vocabulary (like a from key). Let value and env both be optional on the same object, with at least one required:
env:
NAME:
value: "default-literal"# optional fallbackenv: "HOST_VAR_NAME"# optional: prefer this host var when set
Resolution: if the named host var is set, use it; otherwise fall back to value. The existing per-route permission check still applies only when env is set — unchanged.
Code to touch: the env schema (merge the two current mutually-exclusive branches into one object with anyOf requiring ≥1 of value/env), the corresponding TS type, and the small resolution block in router.ts. Small, contained change — no new security surface.
Data-directory-per-environment: this part needs no code at all — startServer({dataDir}) / URLCODE_DATA_DIR auto-grant / the env: {DIR: {env: 'URLCODE_DATA_DIR'}} pattern already exist and are documented in docs/READINESS.md. It just isn't surfaced anywhere an author would think to look — recommend a short callout in the YAML reference or recipes doc pointing at that section, rather than new capability.
Activity
Record recommendation on host override of declared env values (#258)
Record recommendation on host override of declared env values (#258) (#…
jimhoyd commentedon Sep 20, 2026
Decision: do not add
{value: default, from: host}.urlcode.yamlmeans, and readiness/audit currently treats literals as reviewable.defaulton the existing operator-resolved{env: NAME}reference. The override stays an operator-policy grant, is listed byaudit, and a missing policy still fails closed unless a default is declared.{env: DATA_DIR}binding read by the function) that needs no new semantics.defaultchange waits for more runs.jimhoyd commentedon Sep 20, 2026
Progress: implementation started by an agent against the maintainer decision on this issue; a PR will be linked here when it opens.
Record decisions for eight benchmark-driven authoring requests (#297)
jimhoyd commentedon Sep 20, 2026
Progress: PR #300 opened:
examples/data-dirand guide note for the{env: DATA_DIR}pattern; the deferreddefaultstays on the decisions list.Document the {env: DATA_DIR} data-directory pattern with a runnable e…
Document the {env: DATA_DIR} data-directory pattern with a runnable e…
jimhoyd commentedon Sep 20, 2026
Docs part shipped in #300 (examples/data-dir and the guide note). The optional default on {env: NAME} stays deferred pending more evidence, so this issue stays open.
jimhoyd commentedon Sep 22, 2026
Checked the current implementation before proposing a shape:
envalready supports two shapes today —{value: "literal"}and{env: "HOST_VAR_NAME"}(host pass-through), resolved at compile time, with host pass-through gated by an explicit per-route operator allowlist (permissions.routes[pattern].env). So the "secrets leaking" concern is already handled by that existing gate — no new trust boundary needs designing.Proposed schema: extend the existing
envfield instead of introducing new vocabulary (like afromkey). Letvalueandenvboth be optional on the same object, with at least one required:Resolution: if the named host var is set, use it; otherwise fall back to
value. The existing per-route permission check still applies only whenenvis set — unchanged.Code to touch: the
envschema (merge the two current mutually-exclusive branches into one object withanyOfrequiring ≥1 ofvalue/env), the corresponding TS type, and the small resolution block inrouter.ts. Small, contained change — no new security surface.Data-directory-per-environment: this part needs no code at all —
startServer({dataDir})/URLCODE_DATA_DIRauto-grant / theenv: {DIR: {env: 'URLCODE_DATA_DIR'}}pattern already exist and are documented indocs/READINESS.md. It just isn't surfaced anywhere an author would think to look — recommend a short callout in the YAML reference or recipes doc pointing at that section, rather than new capability.chore: raise root package size budget by 2 KiB for env-override content
fix(#258): keep the env-override shape and permission semantics jimho…
Fix issues #440, #439, #258: git-install docs, llms.txt links, env ho…