compound-engineering-plugin icon indicating copy to clipboard operation
compound-engineering-plugin copied to clipboard

feat(omp): add native oh-my-pi harness support

Open caelaxie opened this issue 3 months ago • 0 comments

Summary

Implements the boundary proposed in #1224: native oh-my-pi (omp) support with no converter, no writer, no new manifest, no .omp-plugin/ metadata, and no separate release component. omp already installs this repository natively via the existing package.json#pi package metadata and the Claude marketplace catalog (verified empirically against omp 17.2.7, re-checked from the issue's 17.0.5 pin); the gap was CE's own harness-specific instructions, and this PR closes it.

Closes #1224.

What changed

CLI — detection, not conversion

  • src/utils/detect-tools.ts: new detection-only omp entry (~/.omp, project .omp/), same class as copilot/droid/qwen. --to all now prints - omp — native plugin install; skipped instead of silently ignoring the host.
  • install/convert "no installable tools" guidance now names oh-my-pi (omp).
  • Explicit --to omp rejects as an unknown target, exactly like the other native-install-only hosts.

Docs

  • New docs/specs/omp.md target spec (kimi.md shape), verified 2026-08-05 against omp 17.2.7: plugin loading via package.json#pi + .claude-plugin/marketplace.json fallback, install commands (omp install, omp plugin link, marketplace flow), runtime contracts CE skills rely on (/skill:<name>, built-in ask/task/todo, native MCP, skill:// URLs), and session-storage layout including the profile and env-override chain.
  • README.md: omp added to the supported-host enumeration, a new ### oh-my-pi (omp) subsection under More Install Options, a contributor local-dev block (omp plugin link "$PWD"), and the Limitations native-loading sentence.

Skill prose — the compatibility pass

  • Blocking-question tool lists across ~40 files now include omp's built-in ask (adjacent to the Pi ask_user item; the negative pin in ce-code-review includes it too).
  • Closed subagent-primitive enumerations (ce-work execution-engines matrix, ce-plan, ce-simplify-code) now name omp's built-in task. Open "or the equivalent" phrasings were deliberately left alone — they already cover omp.
  • User-facing invocation rendering: omp's form is /skill:<name> (not /skill-name, not $skill-name). The centralized rule in AGENTS.md, the authoring guide, README's invocation note, and all 13 per-skill rendering-rule copies carry the new clause; the parity tests were generalized from a two-form to a three-form contract.

Session history (ce-compound)

  • discover-sessions.sh: new discover_omp() + --platform omp arm. Scans ${PI_CODING_AGENT_DIR:-$HOME/${PI_CONFIG_DIR:-.omp}/agent}/sessions and named-profile roots ~/.omp/profiles/*/agent/sessions, and honors a flat PI_CODING_AGENT_SESSION_DIR override. Exact repo attribution comes from the downstream header cwd filter (hashed buckets embed only basename + sha256, so no bucket-name probe is reimplemented).
  • extract-metadata.py: try_omp runs before try_pi — omp session files physically begin with a 256-byte {"type":"title",...} slot line before the pi-shaped type:"session" header, which distinguishes them from pi files. Platform identity is omp.
  • extract-skeleton.py / extract-errors.py: omp files reuse pi extraction (title-slot line skipped; title_change entries are unaffected).
  • Prose: ce-compound SKILL.md session-root list, session-historian.md, and docs/skills/ce-compound.md platform enumerations updated.

Tests

  • tests/cli.test.ts: --to all prints the omp native-skip line; --to omp rejects like other native-only targets.
  • tests/detect-tools.test.ts: tool count 7 → 8; omp detection asserted.
  • tests/session-history-scripts.test.ts + new tests/fixtures/session-history/omp-session.jsonl: omp auto-detection (not pi), discovery across default profile / named profile / both env overrides, --platform omp restriction, skeleton + errors extraction.
  • tests/omp-native-install.test.ts (new): guarded on the omp binary — dry-run install recognizes this repo (omp install --dry-run --json) and every skills/<name>/SKILL.md carries the name + description frontmatter omp requires for discovery. Skips cleanly when omp is absent.

Verification

  • bun run test (full suite, same as CI): 2885 pass, 0 fail on the committed tree. Note: tests/skills/ce-code-review-cross-model-routes.test.ts fails if run against a dirty tree because the script under test diffs HEAD against the worktree and this PR's own uncommitted diff trips its large-diff path — it passes once committed.
  • bun run release:validate: in sync (0 agents, 32 skills, 0 MCP servers — counts unchanged).
  • bun run plugin:validate: not runnable locally (claude CLI not installed on this machine); no plugin manifests were touched.
  • End-to-end smoke: discover-sessions.sh omp-support 7 --platform omp against a real ~/.omp/agent/sessions/ root finds this repo's live session; extract-metadata.py reports platform: "omp" with the correct cwd and 0 parse errors.
  • omp install --dry-run --json . on omp 17.2.7: recognizes the repo (name, version, extensions, skills) — covered by the new smoke test.

Deliberately not done (per the issue's boundary)

  • No --to omp converter or pi-writer reuse; no .omp-plugin/ metadata; no release component.
  • XDG-relocated omp roots ($XDG_DATA_HOME/omp) are not scanned by session discovery — documented as a known gap in docs/specs/omp.md.
  • Representative skill evals (behavioral) were not run here; happy to add skill-creator eval evidence if maintainers want it before merge.

Security Disclosure

One shell change in a skill: skills/ce-compound/scripts/session-history/discover-sessions.sh gains discover_omp(), which reads omp session JSONL from $HOME/${PI_CONFIG_DIR:-.omp}-rooted paths (plus the existing PI_CODING_AGENT_SESSION_DIR / PI_CODING_AGENT_DIR overrides, same trust model as the pre-existing discover_pi()). All globs are guarded and no user-controlled input is interpolated beyond the established REPO_NAME/--cwd parameters. The Python extractors gain read-only omp branches (title-slot skip, try_omp detection). No new network access, credential handling, permissions, or dependencies. Residual risk: none identified beyond the existing pi path's.

Agent Disclosure

  • Model: Oh My Pi (omp) · kimi-code/k3

Research, decomposition, delegation, review, and verification by the agent; the five implementation slices were executed by delegated subagents under the same harness, and their diffs were reviewed before commit.

caelaxie avatar Aug 04 '26 17:08 caelaxie