Commit Graph

16 Commits

Author SHA1 Message Date
YeonGyu-Kim 8c6e8e4986 refactor(omo-codex): rename ultragoal component to ulw-loop
Fully rename the ultragoal component to ulw-loop so the identifier
matches the ulw-loop skill it powers. Renames the component directory,
nested skill, TS identifiers (UlwLoop / ULW_LOOP_* / ulwLoop*), the
omo ulw-loop CLI subcommand, the .omo/ulw-loop state directory, the
OMO_ULW_LOOP_STEER directive token, and the @code-yeongyu/codex-ulw-loop
package. Also threads Atlas-style right-sized parallel worker delegation
and a Prometheus-style QA + maximum-parallelism plan into the ulw-loop
skill, with a critical post-subagent QA gate.

Updates aggregate wiring (plugin package components, hooks.json,
sync-skills), the install-codex agent-link test fixture, and user docs.
2026-05-29 12:38:22 +09:00
YeonGyu-Kim 4bf9095456 feat(codex-lsp): lazy-start mcp backend 2026-05-29 12:18:24 +09:00
YeonGyu-Kim 5030a116f3 feat(omo-codex): rework skill set around ulw-loop and planner agents
Rename ultragoal skill to ulw-loop with a CLI bootstrap fallback and
openai.yaml hint metadata, while keeping ultragoal as a discoverable
alias. Drop the metis and momus skills in favor of bundled ultrawork
planner agents and rewrite the planing-prometheustic skill. Update
aggregate and sync-skills tests to match.
2026-05-29 11:19:00 +09:00
YeonGyu-Kim 58871c4301 feat(shared-skills): move init-deep to shared skill 2026-05-28 17:03:33 +09:00
YeonGyu-Kim 5662144283 feat(omo-codex): add start-work skill markdown
Ports the OpenCode /start-work flow onto Codex as a discoverable skill.
The skill drives plan selection, Boulder state with codex:<session_id>
prefixed ids, worktree binding, parallel spawn_agent sub-tasks with
6-section prompts, 4-channel Manual-QA evidence (HTTP / tmux / browser /
computer use), ledger append at .omo/start-work/ledger.jsonl, and a
4-phase verification gate. Pairs with the start-work-continuation Codex
Stop / SubagentStop hook component that re-injects continuation while
boulder.json shows incomplete work for the active codex: session.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-28 17:03:33 +09:00
YeonGyu-Kim 4f75a56ce5 feat(omo-codex): embed ast-grep MCP for Codex 2026-05-28 15:26:18 +09:00
YeonGyu-Kim 091550b94d refactor(omo-codex): port ultrawork hook to typescript 2026-05-28 15:07:51 +09:00
YeonGyu-Kim 1d3847a6d3 feat(omo-codex): block budgeted create_goal calls 2026-05-28 14:19:14 +09:00
YeonGyu-Kim a3567056c0 test(omo-codex): allow rules resource manifest
The aggregate plugin test originally asserted that every component lacked .codex-plugin/plugin.json. That was correct when omo was only an aggregate Codex namespace: the root manifest owned plugin identity and components were implementation details.

PLUGIN_BUNDLED changes the invariant for rules. The rules component now ships bundled-rules/hephaestus.md and uses a plugin-root marker to resolve bundled resources when it runs as a component package, while Codex still sees the aggregate omo manifest as the installable plugin.

Chose Path A and touched only packages/omo-codex/plugin/test/aggregate.test.mjs. The test now allowlists the rules manifest and still asserts every other component has no plugin manifest, preventing accidental sprawl.

Verified npm test from packages/omo-codex/plugin, bun run test:codex, and bun test src/cli/install-codex/. bun run test:codex exits 0 and covers the Linux, macOS, and Windows Codex adapter code paths.
2026-05-28 13:58:12 +09:00
YeonGyu-Kim 0d7c16a042 refactor(omo-codex): install agent TOMLs via symlinks at install time, drop sync-agents.py
The Python SessionStart hook (sync-agents.py) was a runtime side-effect
that copied agent TOMLs into CODEX_HOME/agents on every session start.
That design had three problems:

1. It was a Python script invoked via 'python3 ${PLUGIN_ROOT}/...' which
   is fragile on Windows where the binary may be 'python', and is the
   wrong layer for a one-shot install task.
2. Agent TOMLs landed as regular file copies, with no provenance link to
   the plugin cache and no tracking for clean uninstall.
3. An older release shipped TOMLs without the required 'name' field;
   because the current bundle no longer ships them, the hook never had
   a chance to overwrite the broken copies on disk, leaving Codex
   permanently warning at session start.

Replace the runtime hook with an install-time linker:
linkCachedPluginAgents() (src/cli/install-codex/link-cached-plugin-agents.ts).
The omo-codex CLI now calls it right after linkCachedPluginBins(). For
each 'components/*/agents/*.toml' in the plugin cache, it:

  - Linux / macOS: creates a symlink at ${CODEX_HOME}/agents/<basename>
    pointing at the cache TOML. The cache directory is the single source
    of truth; removing the cache cleanly breaks the link.
  - Windows: copies the file (symlinks require admin or Developer Mode).
  - Both platforms: writes a '.installed-agents.json' manifest under the
    plugin cache listing the installed absolute paths, so a future
    'omo uninstall --platform=codex' can remove them deterministically.

Stale regular-file copies (from the old sync-agents.py) are removed and
replaced on Unix. On Windows the existing copy is overwritten.

Tests (src/cli/install-codex/link-cached-plugin-agents.test.ts):
9 cross-platform tests that mock the 'platform' parameter to exercise
the Linux, macOS, and Windows code paths in a single 'bun test' run,
matching the existing pattern from linkCachedPluginBins. Covers symlink
creation, Windows copy, stale-file replacement, manifest writing,
idempotency, multi-component discovery, and the empty-bundle edge case.

Removed:
  - packages/omo-codex/plugin/components/ultrawork/hooks/sync-agents.py
  - packages/omo-codex/plugin/test/bundled-agents.test.mjs
    (it tested the Python hook; behaviour is now covered by the TS tests)
  - SessionStart hook entry in both ultrawork and aggregate hooks.json
  - 2 sync-agents tests + 1 manifest assertion in ultrawork-hooks.test.mjs
  - 'hooks/sync-agents.py' in ultrawork/package.json files list
  - sync-agents.py reference from aggregate.test.mjs component markers

Updated:
  - components/ultrawork/README.md, AGENTS.md: describe the install-time
    linker as the source of truth, no more SessionStart agent sync.

Verified end-to-end:
  bun run src/cli/index.ts install --no-tui --platform=codex
  ls -la ~/.codex/agents/  # all 4 TOMLs are symlinks pointing to cache
  cat ~/.codex/plugins/cache/.../omo/0.1.0/.installed-agents.json  # manifest present
2026-05-28 13:58:12 +09:00
YeonGyu-Kim 2b4e094982 fix(omo-codex): bundle explorer/librarian/plan agent TOMLs for spawn_agent
The synced Codex skills (refactor, review-work, remove-ai-slops) emit
`spawn_agent(agent_type="explorer"/"librarian"/"plan", ...)` guidance
that sync-skills.mjs injects into every skill containing OpenCode-only
orchestration calls. Only codex-ultrawork-reviewer.toml was bundled, so
Codex had no matching agent role to dispatch.

An older omo-codex release shipped explorer/librarian/plan TOMLs but
without the required top-level `name` field, leaving Codex to warn:

  Ignoring malformed agent role definition: agent role file at
  ~/.codex/agents/<name>.toml must define a non-empty `name`

This commit bundles three correctly-formed TOMLs into
components/ultrawork/agents/. Each has the full schema Codex parses:
`name`, `description`, `nickname_candidates`, `model`,
`model_reasoning_effort`, `service_tier`, `developer_instructions`.
The existing sync-agents.py SessionStart hook installs them via rglob
into CODEX_HOME/agents/.

Models match the original design: explorer + librarian on gpt-5.4-mini
low effort (fast contextual + external research); plan on gpt-5.5
xhigh effort (deep reasoning + interview-style planning).

Tests:
- test/bundled-agents.test.mjs: locks the sync-hook contract by
  running sync-agents.py against a temp CODEX_HOME and verifying each
  TOML lands with the expected name + schema.
- test/aggregate.test.mjs: locks the schema keys on every bundled
  TOML and the spawn_agent contract (every in-scope agent_type
  referenced by a synced skill has a matching bundle).

Follow-up: the sync-skills.mjs compatibility table also references
`spawn_agent(agent_type="worker", ...)`. No worker.toml is present
in CODEX_HOME and Codex does not warn about its absence, suggesting
worker is a built-in Codex role. Confirm and ship worker.toml if not.
2026-05-28 13:58:12 +09:00
YeonGyu-Kim d18c2c078d fix(omo-codex): adapt synced skills for Codex tools 2026-05-28 13:58:12 +09:00
YeonGyu-Kim 22c91629b3 feat(omo-codex): sync shared skills into plugin 2026-05-28 13:58:12 +09:00
YeonGyu-Kim f77338b4a2 refactor(omo-codex): sync telemetry component sources 2026-05-28 13:58:11 +09:00
YeonGyu-Kim bd867019f9 feat(omo-codex): wire Codex SessionStart telemetry for DAU/WAU/MAU
Adds a new Codex plugin component `telemetry` that emits a single
omo_codex_daily_active event (reason: session_start) from every Codex
SessionStart hook, with the same UTC-day deduplication, hashed
installation identifier, and four-flag opt-out as the install-time
event. Previously omo-codex telemetry only fired on install_completed,
so DAU/WAU/MAU under-reported real Codex usage.

- New plugin component packages/omo-codex/plugin/components/telemetry/
  mirrors the rules/comment-checker/lsp pattern: own src/, tsc build,
  vitest tests, package.json (posthog-node dep), hooks/hooks.json.
- src/codex-hook.ts wraps createPluginPostHog().trackActive(..., "session_start")
  with safeShutdown so Codex session startup never blocks on telemetry.
- Plugin root hooks.json + workspaces register the new component
  alongside rules and ultrawork on SessionStart.
- Aggregate test expectations updated to include the telemetry directory.
- cross-package-equivalence.test.ts pins product-identity constants and
  shouldDisablePostHog behavior to stay byte-equivalent between the CLI
  installer (src/telemetry/) and the plugin runtime
  (plugin/components/telemetry/src/), so the two PostHog sources never
  drift on event name, distinct_id base, dedup file path, or opt-out
  flags.
- PostHogActivityReason union in the CLI-side posthog.ts gains
  "session_start" so future CLI paths can emit the same reason without
  a type break.
2026-05-28 13:58:11 +09:00
YeonGyu-Kim 2415f37bc0 vendor: import codex-plugins as packages/omo-codex/{plugin,scripts,marketplace.json,MARKETPLACE.md} 2026-05-28 13:58:11 +09:00