Skip to content

Actionable missing context: env fallback, one runnable command; plan_feature list queries (#834) - #905

Merged
jimhoyd merged 2 commits into
mainfrom
claude/validation-context-finish
Sep 29, 2026
Merged

jimhoyd merged 2 commits into
mainfrom
claude/validation-context-finish

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Closes the remaining #834 gaps found by the audit.

1. Missing context gives one runnable command

  • Env fallback: if --origin is absent the CLI reads URLCODE_ORIGIN; if --policy is absent it reads URLCODE_POLICY, on the commands that accept it. A flag always wins. The MCP server uses the same fallbacks and forwards them to its runners.
  • Generated npm scripts are unchanged on purpose: npm runs scripts under sh on POSIX and cmd on Windows, so no variable syntax works on both. The CLI reads the variables itself instead, so URLCODE_ORIGIN=… URLCODE_POLICY=… npm run validate works.
  • Refusals: a missing origin is now origin-required, and a missing revision pin revision-pin-required. The message rebuilds the actual invocation with <https://your.site> / <operator/policy.json> placeholders for only what's missing, after "Run:", and it is also returned as a command field.
  • Approval stays explicit: nothing creates or repins a policy.

2. Acceptance test

In test/addons.integration.ts, a packed site runs extensions add auth (the same as init --with auth, split so the core is the packed build):

  • npm run validate with no context → one command with both placeholders;
  • after saving the policy, with only URLCODE_POLICY → one command naming only --origin;
  • with both set → passes;
  • the installed urlcode mcp --allow-authoring with the same env → run_validate exits 0.

3. plan_feature list queries

  • List, filter, sort, paginate and query goals now select the store-crud recipe with the parameters capability, and outline filterable, sortable and limit/cursor. Owner vocabulary adds auth.
  • The tag fallback needs at least two matching terms, so "filter by status" no longer returns health-page.

Evidence (macOS, Node 26)

Limits:

  • Only the two context refusals print a command.
  • Windows is untested locally.

🤖 Generated with Claude Code

… list-query plan (#834)

- The CLI reads an absent --origin/--policy from URLCODE_ORIGIN/URLCODE_POLICY,
  so the generated npm scripts (unchanged: no variable syntax is portable
  across npm's sh and cmd shells) run with operator context from the
  environment; the MCP server forwards the resolved values to its runners.
- The origin and revision-pin refusals carry codes (origin-required,
  revision-pin-required) and the CLI answers them with one complete command:
  the actual invocation plus explicit placeholders for exactly what is
  missing, also in the error's command field. Nothing creates or repins a policy.
- plan_feature maps list/filter/sort/paginate vocabulary to the store-crud
  recipe, store filterable/sortable, route query parameters and a declarative
  list-query outline (auth too for owner lists); the tag fallback now needs two
  shared tags, so a single generic word such as "status" no longer selects
  health-page.
- Packed acceptance test: an auth site's npm run validate names one command
  without context and passes with it; MCP run_validate passes with it.
- Docs: TOOLING operator-context section and planner vocabulary, AI-AUTHORING,
  starter README, llms-full. Package budget raised for main's existing
  overage plus this change (measurements in package-audit.ts).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 29, 2026 12:45
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.

1 participant