Skip to content

Package the validator as the installable okgf command - #1

Merged
welsbach merged 3 commits into
mainfrom
feat/one-line-install
Oct 22, 2026
Merged

welsbach merged 3 commits into
mainfrom
feat/one-line-install

Conversation

@welsbach

@welsbach welsbach commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What and why

The reference validator could only be run by cloning the repo and invoking python tools/okgf_validate.py. This packages it as an installable okgf command so anyone can validate OKGF bundles with a one-line install.

Install (after the first PyPI release)

curl -fsSL https://raw.githubusercontent.com/OneHillAI/okgf/main/install.sh | sh   # uv-based, no system Python
brew install OneHillAI/tap/okgf
pipx install okgf      # or: uv tool install okgf, or: pip install okgf

Changes

  • okgf package (okgf/validate.py, __main__, okgf console entry point, --version). tools/okgf_validate.py becomes a thin back-compat shim that re-exports the package, so existing invocations and imports keep working.
  • pyproject.toml (hatchling): PyYAML is the only runtime dependency; cryptography stays optional behind the verify extra, so the default install and the Homebrew formula are pure-Python. The wheel ships only the okgf package.
  • One-line install: install.sh (curl | sh via uv; OKGF_VERIFY=1 adds signature verification) and a Homebrew formula under packaging/homebrew/okgf.rb.
  • release.yml: on a vX.Y.Z tag, builds, smoke-tests the wheel, and publishes to PyPI via Trusted Publishing (OIDC) - no stored token.
  • Conformance CI: installs the package and exercises the okgf command (and the shim) on Python 3.9 and 3.12. The matrix runs as the test job behind a single validate gate, so the required status context stays stable; the workflow's GITHUB_TOKEN is scoped read-only.
  • Docs: one-line install at the top of the README, a new docs/INSTALL.md, and updated SPEC / CONFORMANCE / CONTRIBUTING / SECURITY / examples references.

Verification

  • okgf, python -m okgf, and the tools/okgf_validate.py shim all validate the example bundles, including Ed25519 signature verification on examples/governed.
  • Without cryptography, --pubkey degrades gracefully (exit 2, clear message) rather than crashing.
  • Wheel + sdist build; the wheel contains only okgf/ plus the entry point; it installs and runs in a throwaway env.
  • 40/40 tests pass, green on CI across 3.9 and 3.12.

Maintainer follow-ups (human-only, not blocking this PR)

  1. PyPI: claim the okgf name and register this repo's release.yml (environment pypi) as its Trusted Publisher. Until then, a tag build will fail only at the publish step.
  2. Homebrew: create OneHillAI/homebrew-tap with Formula/okgf.rb from packaging/homebrew/okgf.rb (the url/sha256 placeholders are filled from the PyPI release / brew bump-formula-pr).

The curl/brew/pipx one-liners above go live once v0.1.0 is published to PyPI.

Make the reference validator installable so users can validate bundles without
cloning the repo and running `python tools/okgf_validate.py`.

- Move the validator into an installable `okgf` package (okgf/validate.py, a
  console entry point, `python -m okgf`, and `--version`). tools/okgf_validate.py
  stays as a back-compat shim that re-exports the package API.
- Add pyproject.toml (hatchling): PyYAML is the only runtime dependency, with
  `cryptography` optional behind the `verify` extra; the wheel ships only okgf.
- One-line install: install.sh (curl | sh via uv) and a Homebrew formula.
- release.yml publishes to PyPI on a version tag via Trusted Publishing (OIDC).
- conformance CI installs the package and runs the `okgf` command (and the shim)
  on Python 3.9 and 3.12.
- Docs: install section atop the README, docs/INSTALL.md, and updated references.

Signed-off-by: Onehill <[email protected]>
Agent: Claude Opus 4.8 (instructed by awchristoph)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
@welsbach
welsbach force-pushed the feat/one-line-install branch from 378f41d to fb53a5e Compare October 21, 2026 21:18
The previous commit put the conformance job behind a build matrix, which made
GitHub report the status contexts as `validate (3.9)` and `validate (3.12)`. The
branch protection on `main` requires a check named exactly `validate`, so that
context was never produced and the PR stayed blocked on a missing required check
even though every matrix leg passed.

Rename the matrix job to `test` and add a lightweight `validate` gate job that
`needs: test`, so the required `validate` context is emitted again and turns
green only when both the 3.9 and 3.12 legs pass. No change to what is tested.

Signed-off-by: Onehill <[email protected]>
Agent: Claude Opus 4.8 (instructed by awchristoph)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Comment thread .github/workflows/conformance.yml Fixed
CodeQL (code scanning) flagged the conformance workflow for not restricting the
GITHUB_TOKEN permissions. The workflow only checks out and validates code and
never writes to the repository, so add a top-level `permissions: contents: read`
block (the recommended minimal default). No change to what runs.

Signed-off-by: Onehill <[email protected]>
Agent: Claude Opus 4.8 (instructed by awchristoph)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
@welsbach
welsbach merged commit 92b1816 into main Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants