Skip to content

[Bug]: spec/schema JSON (cedar_advice, manifest) is not shipped in the agent-control-specification wheel, so hosts copy the advice contract by hand and drift #4043

Description

@david-long1

Package

policy-engine

Description

policy-engine/spec/schema/cedar_advice.schema.json and manifest.schema.json are not part of the installed package. policy-engine/sdk/python/pyproject.toml (maturin, python-source = ".") has no include for them, and the 0.3.1b1 wheel on PyPI contains no .json at all:

$ unzip -l agent_control_specification-0.3.1b1-cp311-abi3-manylinux_2_28_x86_64.whl | grep -c '\.json'
0

The sdist carries core/schema/manifest.schema.json but not cedar_advice.schema.json. Neither Python binding exposes translate_advice or advice validation through _native (only parse_manifest, validate_manifest, validate_manifest_overlay, validate_manifest_artifact, validate_artifacts).

A host that writes its own Cedar dispatcher (a type: custom policy) has to reproduce the advice rules from the JSON schema by hand, and there is nothing installed to check against. The contract has already moved under such a copy: the transform root in cedar_advice.schema.json changed from $policy_target to $target in #3939, and manifest.schema.json dropped bundle_url.

Proposed fix

Two shapes, and I would rather ask than guess:

  1. Ship policy-engine/spec/schema/*.json in the wheel (maturin include, or copy them into the package directory at build time) and expose them via importlib.resources.
  2. Expose native advice validation / translate_advice through _native, so hosts call the engine's own implementation instead of a copy.

Since the engine now comes from the agent-control-spec crate, the schema may belong there instead; happy to move this request if so. I can send a PR once a shape is chosen.

How does this impact your work?

My dispatcher's advice validation is a hand port of the schema, pinned to a commit hash with a drift check that points at a path that no longer exists on main (core/src/cedar.rs moved to the external agent-control-spec crate).

Timeline

Not blocking.

Steps to Reproduce

  1. pip install agent-control-specification==0.3.1b1 (or build main).
  2. python -c "import importlib.resources as r, agent_control_specification as m; print([p.name for p in r.files(m).iterdir() if p.name.endswith('.json')])" prints [].
  3. Try to validate an advice payload against the shipped contract: nothing installed provides it.

Environment

agent-control-specification 0.3.1b1 (PyPI) and main e7f5d2b, Python 3.12, macOS.

Logs / Error Output

Not applicable.

Code of Conduct

  • I agree to follow the Microsoft Open Source Code of Conduct

Activity

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

    bugSomething isn't workingneeds-review:MEDIUMContributor check flagged MEDIUM risktriageNeeds triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions