Skip to content

[Request]: Make installed authoring validation context executable and discoverable #834

Closed

Description

@jimhoyd

Problem or use case

In the precommitted camera authoring trial using the unreleased authenticated-handler candidate f17b724 (#833), the agent preserved native auth and explicit function routes but timed out after 600 seconds. Its transcript shows repeated schema/CLI inspection and a concrete validation detour:

  • It searched installed CLI/source files to discover the project revision command.
  • It ran the generated npm run validate script with PROJECT_SHA256 supplied. The script includes --host-file host.mjs but no origin, so activation correctly refused with Extensions require an explicit operator origin; pass --origin https://your.site.
  • Its subsequent command supplied --origin https://handler.example.test, but the trial ended before a completed delivery.

This is an observed usability gap, not a claim that validation caused the entire timeout or that the runtime's refusal is wrong. The starter already included the recipe README and a task guide. No deployed urlcode.ai or MCP assistance was used. One trial is not a general performance result.

Proposed behavior and alternatives

Provide a small, executable authoring/validation context path that tells an agent exactly which project, host, canonical origin and operator-reviewed revision are needed, and prints a complete runnable command when any are missing. Consider aligning generated npm scripts and the existing agent/context output around that path rather than adding another large guide.

Keep approval explicit: inspecting a revision must never automatically authorize it, silently update grants, or repin at server startup (see #784). Do not put provider configuration into route YAML or infer a production origin from untrusted requests. A static validation mode could clearly distinguish schema checks from host activation if that is useful.

Acceptance should use a clean installed init --with auth consumer, generated scripts, and supplied operator context. Test that missing context yields one actionable command and that explicit context reaches validation without source-code searching. Preserve host/origin propagation fixes from #778/#791.

Related: #832/#833 (native session identity), #822 (extension references). This request concerns the operational handoff to validation, not syntax coverage or more business recipes.

Activity

  1. jimhoyd commented on Sep 28, 2026

    @jimhoyd
    CollaboratorAuthor

    Scope alignment with #841: this remains the authoritative executable-validation-context issue. Prove the installed project/host/origin/reviewed-revision commands through #843, both CLI-only and connected authoring MCP. Coordinate provider discovery with #844 and SDK replacement with #846. Human revision approval stays explicit; no compatibility path for historical tooling is required. This is not blocked on completing the whole ecosystem program.

  2. jimhoyd commented on Sep 28, 2026

    @jimhoyd
    CollaboratorAuthor

    Evidence from the #843 proof (PR: #848). One agent run on a packed checkout of a996f0d8; observations, not a benchmark.

    The proof site uses --host-file host.mjs, an explicit --origin, and an operator --policy that grants the routes' APP_DATABASE binding and pins the reviewed revision. With all three, CLI validate, test, audit --expect-routes 8 (ready: true, via signed-in steps fixtures) and serve work, and an unreviewed edit is refused with a clear revision-pin-mismatch until the evaluator regenerates the policy. That approval step stayed manual.

    Gaps an agent hits on the way, all on the path this issue owns:

    1. urlcode bootstrap --json commands.validate/test/start include --host-file but neither --policy nor --origin, so none of them run as printed for this site.
    2. bootstrap's paths.outsideProject suggests, for operator/ and data/, "To serve it, build or copy it into app/operator". Those directories hold the Better Auth secret and SQLite databases. The hint should not invite serving operator-only directories.
    3. urlcode context, explain and review accept --host-file but not --policy. The agent has to discover and export PROJECT_SHA256 separately, although the policy file already carries the reviewed revision.
    4. The authoring MCP server takes no --policy (its tool descriptions say so), so run_validate, run_test and run_audit fail with binding-denied on any site whose routes need an operator-granted binding. Its read-only tools (get_extensions, summarize_yaml_change, validate, plan_feature) worked and saw the host registration. The proof did not change this boundary; deciding whether and how an MCP server may be handed an operator policy is this issue's call.
    5. plan_feature for "let an owner filter their request list by status" suggested headless-auth-profile and health-page recipes (legacy auth, a word match on "status"), not a query parameters declaration.
  3. jimhoyd commented on Sep 28, 2026

    @jimhoyd
    CollaboratorAuthor

    Correction to my earlier comment: bootstrap did name --origin and --policy under prerequisites; the gap was that neither it nor context/explain/review/plan-feature/mcp could accept a policy, so the commands never became complete and hosts needed PROJECT_SHA256 by hand.

    Implementation: #849 (stacked on #848). The reviewed policy pins those commands' hosts and appears in emitted commands; the MCP server verifies it at startup and its runners forward it. On the packed Better Auth proof, MCP run_validate, run_test (34/34) and run_audit now pass with no PROJECT_SHA256. Human approval is unchanged: nothing creates or repins a policy, and a project edit still invalidates it. The PR calls out that this reverses the documented "mcp accepts no --policy" choice, for the maintainer to accept or veto.

  4. jimhoyd commented on Sep 29, 2026

    @jimhoyd
    CollaboratorAuthor

    Done:

    Approval stays explicit: nothing creates or repins a policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions