Skip to content

chock plugin build: add --out and --policy flags #12

Description

@open-coder-ai

What

chock plugin build packages policies as Agent Plugins 1.0.0 directories. Today it is all-or-nothing and always writes in place. Two flags are missing, and the plumbing for one of them already exists.

--out <dir> — write packages to a directory instead of into the policy folders. build_plugin() in src/chock/plugin/build.py already takes an out_dir parameter and handles it correctly; cli.py simply never passes one. Useful for producing a publishable plugin tree without touching the source repo.

--policy <id> — package a single policy. Currently every run rebuilds all of them, which is noise in a repo with many.

Where

src/chock/plugin/cli.py — argument parsing and the loop in main().

How

  1. Add both arguments to the parser.
  2. --policy filters the list from resolve_policy_dirs(). Match on the manifest id or the directory name, the way _find_policy_manifest in cli.py does — do not write a third matching rule.
  3. An unknown --policy id must exit non-zero with a clear message. Printing Packaged 0 policies and exiting 0 on a typo is a false success on the command whose whole job is producing output.
  4. --check should respect both flags.
  5. Add tests to tests/test_agent_plugin.py. There are fixtures there for a gate policy and a rule policy already.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions