Skip to content

[Request]: remove the manual PROJECT_SHA256 bridge between operator policy and extension host #723

Closed

Description

@jimhoyd

Problem or use case

An extension host must register the exact project revision it was reviewed for. Today composeHost() reads that pin only from PROJECT_SHA256, while URLCode separately reads projectSha256 from the external --policy document. A production URLCode consumer (urlcode-ai) therefore needs custom deployment and local-development glue that parses the policy JSON and exports its projectSha256 before every dev, validate, test, and serve invocation.

The two values describe the same operator-reviewed revision, but can drift or be omitted independently. The runtime fails closed, which is safe, but the setup makes every extension-using site reproduce a policy-parsing script and adds a configuration failure mode unrelated to its app behavior.

Proposed behavior and alternatives

  • When a CLI command receives both --policy and --host-file, make the verified policy revision available to composeHost() as the host revision pin, without exposing policy contents or allowing YAML to choose a pin. Keep the host registration equality check.
  • If automatic propagation is too implicit, provide one official operator-controlled flag or helper that derives the pin from the policy file, so sites do not parse policy JSON themselves.

The design must preserve the existing trust boundary: the application project never supplies the pin, and an absent/mismatched reviewed policy remains a refusal.

Evidence

The urlcode-ai MCP-extension migration uses scripts/policy-revision.mjs locally and equivalent container entrypoint logic solely to bridge URLCODE_OPERATOR_POLICY.projectSha256 into PROJECT_SHA256 for host.mjs.

Activity

  1. added
    enhancement
    extension
    on Sep 25, 2026
  2. jimhoyd commented on Sep 25, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision (owner, 2026-09-25): automatic. When a CLI command receives both --policy and --host-file, core passes the verified policy's projectSha256 to composeHost() as the host revision pin. No new flag, and never from project YAML.

    • PROJECT_SHA256 keeps working. If it is set as well, it must equal the policy revision, otherwise the command refuses.
    • The host registration equality check stays, and an absent or mismatched reviewed policy is still refused.
    • Policy contents other than the revision are not exposed to the host.

    Generated by Claude Code

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

    enhancementextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions