Files
openprose__prose/.github/workflows/ci-examples-gate.yml
Jose Montes de Oca 9248d949e7 chore: ship skill examples as copyable scaffolding (#123)
The open-prose skill ships as a plain folder, so everything under
skills/open-prose/examples/ reaches every install. Each runtime example
shipped a committed replay/ state-dir (around 480 binary world-model files), a
generator, and a test suite wired to the workspace through a dist alias with no
local package.json. That machinery is internal validation, not the template a
user lifts: it cannot run from a copied folder, and it shipped generated
artifacts nobody should copy.

Keep the shipped examples to what a user actually adapts, and move the
validation into the repo's test tree:

- Move each example's tests, generator, and committed replay/ into
  tests/open-prose/examples/<name>/. The shipped example is now its .prose
  contracts under src/, a README, and a .gitignore.
- Re-point the vitest include and the test scripts; the byte-deterministic
  offline coverage runs unchanged, just rooted under tests/.
- Rewrite the example READMEs to point at the reactor CLI for producing and
  replaying a run, and drop the stale committed-fixture sections.
- Update the examples-gate workflow description to match the new layout.

No language, CLI, or runtime behavior changes, and the example contracts are
untouched. Verified with the offline gate (REACTOR_OFFLINE=1): the conformance
suite, the relocated example tests, and the eval harness all pass.
2026-06-05 19:44:15 -04:00

73 lines
2.2 KiB
YAML

name: CI - OpenProse Examples Gate
# Runs the DETERMINISTIC, OFFLINE example suite on every PR that touches the
# shipped learning examples, their conformance tests, the eval harness, or the
# shared gate wiring. All at zero model spend (REACTOR_OFFLINE=1):
#
# - the vitest example suites (tests/open-prose/examples/**): doc-conformance
# corpus checks plus the deterministic ledger-replay tests that drive the
# reactor over a committed replay state-dir
# - eval-harness deterministic checker (tools/eval-harness/eval-harness.test.mjs)
#
# The key-gated LLM judge panel is NEVER run here: REACTOR_OFFLINE=1 forces
# hasOpenRouterKey() to false, and no OPENROUTER_API_KEY secret is wired into
# this workflow, so the judge path stays a passing-skipped no-op.
on:
pull_request:
paths:
- "skills/open-prose/examples/**"
- "tests/open-prose/examples/**"
- "tools/eval-harness/**"
- "vitest.config.ts"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "packages/reactor/**"
- "packages/reactor-devtools/**"
- ".github/workflows/ci-examples-gate.yml"
push:
branches: [main]
concurrency:
group: ci-examples-gate-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
examples:
name: CI - Examples Gate (offline)
runs-on: ubuntu-latest
timeout-minutes: 15
env:
# Force the offline path everywhere: no network, no model spend, and the
# LLM judge panel stays a passing-skipped no-op (no key resolvable).
REACTOR_OFFLINE: "1"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: "pnpm-lock.yaml"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build reactor + devtools (the example tests replay their dist)
run: |
pnpm --filter @openprose/reactor build
pnpm --filter @openprose/reactor-devtools build
- name: Example suites + eval-harness (offline)
run: pnpm test:examples