Skip to content

Make each policy independently executable through XMD #257

Open

Description

@taras

Parent Quest: #254

Story

As an effectionx contributor, I want to run any policy document through XMD and see how it reached its verdict, so policy validation is explicit, inspectable, and independently reproducible.

The common path for one policy is:

xmd run .policies/<policy>.md#Validate

Current gap

Policy documents currently explain requirements to the Policy Officer agent but do not expose executable validation entrypoints. They also do not state whether a lint rule or AI procedure is authoritative, leaving validator selection and required evidence implicit.

Contract

Every active policy listed by .policies/index.md provides a standard XMD Validate entrypoint while remaining useful as human-readable documentation.

Each policy declares:

  • the invariant it protects and the files or changes to which it applies;
  • whether validation delegates to an @effectionx/lint rule or performs an AI review;
  • the exact lint rule invocation or AI instructions;
  • the repository context and comparison inputs required;
  • the evidence that supports the verdict; and
  • a consistent pass or failure result consumable by a parent XMD workflow.

A lint-backed policy executes its named Oxlint rule rather than asking an agent to reinterpret the same syntax. An AI-backed policy contains the contextual review procedure in the document and may not rely on an undisclosed agent prompt or validator-selection heuristic.

Running one policy does not require the README aggregator. The policy index remains the authoritative inventory used to discover active policies.

Acceptance

  • Every policy in .policies/index.md has a runnable #Validate entrypoint.
  • Running a lint-backed policy executes its exact @effectionx/lint rule and propagates the rule’s exit status and diagnostics.
  • Running an AI-backed policy supplies the declared context and returns its required verdict and evidence shape.
  • A policy with missing inputs or unavailable validation prerequisites fails visibly instead of being silently skipped.
  • Repeated runs use the same declared validator, inputs, and output contract.
  • Adding a policy to the active index without a valid entrypoint causes a repository check to fail.
  • Existing policy explanations and links remain readable outside XMD.

Evidence

Verification runs every active policy independently and includes:

  • a lint-backed violation and compliant control;
  • an AI-backed relevant change and irrelevant control; and
  • a policy-index entry with a missing validator as the negative discovery case.

Dependencies

Out of scope

  • The README aggregate entrypoint
  • CI policy execution
  • Deno lint compatibility
  • Policies outside the effectionx repository
  • Requiring byte-identical prose from AI validators
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions