Skip to content

fix(core): name the binding and variable when a granted env or secret is unset - #1064

Merged
jimhoyd merged 1 commit into
mainfrom
claude/env-binding-message-1062
Sep 30, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/env-binding-message-1062

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1062

What changed

  • packages/core/src/router.ts: a granted env binding with no default and an unset host variable now fails with Route /api/notes: Environment binding DATA_DIR reads URLCODE_DATA_DIR, which is not set. Set it in the host environment, or declare a default (was Missing required environment binding). The unset/empty secret refusal gets the same shape: Secret binding KEY reads API_KEY, which is not set or is empty. Set it in the host environment. Both carry code: missing-binding. Only alias and variable names appear, never a value.
  • packages/core/src/explain-error-rules.ts: the missing-binding rule matches the new text; guidance says to set the variable in the host environment (or .env.local under urlcode dev), or declare a default for an env binding (a secret has none).
  • docs/AI-AUTHORING.md lists missing-binding among error codes; llms-full.txt regenerated; proofs/native-storage/README.md quotes the new message.
  • Tests: test/env-bindings.test.ts pins the full message, code, route and explain match, and adds an unset/empty secret case; test/config.test.ts and test/native-storage.integration.ts updated from the old text.

Evidence

  • npm run verify passed locally (macOS).
  • node --test test/native-storage.integration.ts passed (7/7).

🤖 Generated with Claude Code

… is unset (#1062)

A granted environment binding with no default and an unset host variable
failed with "Missing required environment binding", naming only the route.
It now names the binding alias and the variable it reads, never a value:
"Environment binding DATA_DIR reads URLCODE_DATA_DIR, which is not set. Set
it in the host environment, or declare a default". The secret refusal gets
the same shape, and both carry code missing-binding. The explain rule
matches the new text and says how to set the variable or declare a default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 30, 2026 16:02
@jimhoyd
jimhoyd merged commit 12dca52 into main Sep 30, 2026
25 checks passed
@jimhoyd
jimhoyd deleted the claude/env-binding-message-1062 branch September 30, 2026 16:13
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.

Missing environment binding error names the route but not the variable

1 participant