refactor: DCP migration, naming cleanup, and CI workflow fixes - #28
Merged
Conversation
…momus, sisyphus) - Rename hook prometheus-md-only → oracle-md-only (dir, schema, constants, tests, CI, docs) - Rename file prometheus-agent-config-builder → oracle-agent-config-builder - Rename system directive PROMETHEUS_READ_ONLY → ORACLE_READ_ONLY - Rename constants PROMETHEUS_WORKFLOW_REMINDER → ORACLE_WORKFLOW_REMINDER - Update ASCII art table: METIS CONSULTATION → SERAPH CONSULTATION, MOMUS REVIEW → SMITH REVIEW - Remove legacy agent names (hephaestus, metis, momus) from delegate-agent ALLOWED_AGENTS - Rename hephaestus* variables to keymaker* in keymaker-agent.ts - Rename import aliases: createLibrarianAgent → createOperatorAgent, createExploreAgent → createTrinityAgent, createMultimodalLookerAgent → createConstructAgent - Rename SISYPHUS_SPINNER → MORPHEUS_SPINNER - Update comments referencing old names in keyword-detector, delegate-task, oracle agent - Add prometheus-md-only → oracle-md-only migration mapping for backward compat - Regenerate JSON schema
- Add mock.restore() to 24 test files using mock.module() without cleanup
- Replace mock.module('node:fs') with spyOn in bdd-create-contract and
bdd-pipeline tests to prevent process-wide module mocking
- Extend test-setup.ts global beforeEach with all 11 _reset*ForTesting()
functions for complete module-state isolation
- Harmonize publish.yml with ci.yml: switch from explicit whitelist to
auto-discovery (find | grep -v | xargs) — restores 7 previously
excluded test categories
- Add lsp-process.test.ts and bdd-parse-gherkin to CI isolation lists
- Update run-ci.sh to match ci.yml exclusion lists
- Update package.json test script to match CI scope (excludes demos/)
CI simulation: 10/10 steps, 0 failures across 3139 tests
Matrixx's auto-slash-command hook and slashcommand tool only scanned builtin commands + .opencode/command/ files + skills, missing commands registered programmatically by other OpenCode plugins (e.g., /dcp-compress). Now queries client.command.list() from the OpenCode SDK to discover plugin-registered commands and merges them into the command registry. Also removes misleading 'Marketplace plugin commands are not supported' error messages.
… files - Forward browserProvider parameter to createBuiltinSkills() in agent-builder.ts and skill-resolver.ts — fixes agent-browser and playwright-cli skill resolution - Remove stale opencode-skill-loader imports/tests from deleted module (tests/features/opencode-skill-loader/, config-handler.test.ts) - Clean up clearSkillCache references, SkillMcpManager references, and mockSetupFactory related dead tests
…file tool - Create src/tools/dcp-switch-profile/ with dcp_switch_profile tool that reads, merges, and applies DCP profile config natively in Matrixx - Remove dependency on external ~/.myopencode/dcp/switch-profile.sh script - Register tool in tool registry (dcp_switch_profile) - Rewrite /dcp-profile command template to use built-in tool instead of external script - Remove switch_script from DCP config schema (no longer needed) - Add tests for dcp_switch_profile tool - Redesign DCP profile parameters for more aggressive/effective compression: * nudgeForce: strong (was soft) across all profiles * iterationNudgeThreshold: 2-7 (was 15) depending on profile * showCompression: true (was false) * Lower minContextLimit thresholds for earlier nudging
Cover factory, metadata, all 4 built-in profile values, output structure, base config overrides, profile override merging, and error handling (invalid profile + DCP not installed). Uses mock.module for fs isolation.
…fig schema - Expand DcpConfigSchema with full profile parameter definitions (DcpCompressOverrideSchema, DcpStrategiesOverrideSchema, DcpTurnProtectionSchema, DcpExperimentalSchema, DcpProfileDefinitionSchema) and 4 built-in profile defaults - Rewrite dcp_switch_profile tool: config-driven, full inline output, no more extend key or external file reads - Remove stripJsoncComments(), deepMerge(), readJsoncConfig() helpers - Wire MatrixxConfig into tool factory via assembly pattern - Update DCP slash command template to reflect config-driven architecture - Add 48 comprehensive tests (up from 3) covering all profiles, output structure, base overrides, and error handling - Regenerate assets/matrixx.schema.json with new DCP profile fields - Remove deprecated modules: agent-loader, opencode-skill-loader, skill-mcp-manager, mcp-oauth, command-loader/loader.ts
4 deleted test files referenced in both ci.yml and publish.yml: - tests/features/opencode-skill-loader/loader.test.ts - tests/features/opencode-skill-loader/agents-skills-global.test.ts - tests/hooks/prometheus-md-only/index.test.ts - tests/features/skill-mcp-manager/manager.test.ts Removed from both mock-heavy run sections and grep -v exclude lists.
…port
The getMessageDir cached after first call test used spyOn on its own
fs reference, which doesn't intercept calls from message-dir.ts's
own import binding for node:fs. The test also relied on
mock.module('node:fs') from the B2 test, but B2's mock is set up
inside the test body — never active during getMessageDir's execution.
Fix: give the test its own mock.module('node:fs', ...) setup with
local call counters, following the same pattern as the B2 regression
test. Revert B2's existsSync/readdirSync wrappers to simple pass-
through since the shared mockCalls object is no longer needed.
The previous test used mock.module("node:fs") to intercept fs calls and
count them. This works on Bun 1.3.9 but fails on 1.3.14 (CI node image),
likely due to differences in how mock.module handles built-in modules.
New approach uses behavioral verification: mock opencode-storage-paths
(same proven pattern as the B2 test) to redirect MESSAGE_STORAGE to a
tmpdir, then verify caching by creating the session dir AFTER the first
call — a working cache returns null (cached from first call), while a
broken cache would find the new dir and return its path.
Verified: 103/103 pass manager.test.ts, 105/105 other mock-heavy tests,
typecheck + lint clean.
Add 6 new entries to mock-heavy isolation in ci.yml and publish.yml to eliminate 51 remaining-test failures: Directories (all test files within run together): - tests/features/mission-state/ (was: individual plan-storage.test.ts) - tests/features/handoff/ - tests/features/task-storage/ - tests/hooks/session-recovery/ Individual files: - tests/plugin/session-agent-resolver.test.ts - tests/hooks/auto-update-checker/checker/pinned-version-updater.test.ts Verified locally on Bun 1.3.9 + 1.3.14: - Mock-heavy isolated: 177 pass / 0 fail - Remaining batch: 2373 pass / 0 fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates cleanup work on the
fix/cleanup_bbranch: DCP profile migration, stale test references removal, CI workflow harmonization, naming refactoring, plugin integration fixes, and flaky test isolation.Changes
DCP Profiles — Inline Config Migration
feat(dcp): Migrated DCP profile definitions from external shell scripts to inline Zod config schema within the plugin configuration. Profiles (economy,balanced,performance,ultimate) are now defined inmatrixx.jsoncand applied viadcp_switch_profiletool without external file dependencies.test: Added 48 comprehensive tests covering all DCP profile switching scenarios, edge cases, error handling, and profile parameter validation.feat: Replaced externaldcp-switch.shscript with the built-indcp_switch_profiletool.CI Workflow Fixes
fix: Removed 4 stale test file references from both.github/workflows/ci.ymland.github/workflows/publish.yml:tests/features/opencode-skill-loader/loader.test.tstests/features/opencode-skill-loader/agents-skills-global.test.tstests/hooks/prometheus-md-only/index.test.tstests/features/skill-mcp-manager/manager.test.tsfix: Eliminated cross-test pollution from mock.module() usage and harmonized CI workflow patterns betweenci.ymlandpublish.yml.fix: Isolated 6 new flaky test groups in mock-heavy section (both workflows), eliminating all 51 remaining-test failures:tests/features/mission-state/(was: individualplan-storage.test.ts)tests/features/handoff/tests/features/task-storage/tests/hooks/session-recovery/tests/plugin/session-agent-resolver.test.tstests/hooks/auto-update-checker/checker/pinned-version-updater.test.tsNaming & Refactoring
refactor: Removed old upstream naming conventions (prometheus,hephaestus,metis,momus,sisyphus) across the codebase.Plugin Integration Fixes
fix: ForwardedbrowserProvidertocreateBuiltinSkills, resolving skill initialization issues.fix: Discovered plugin-registered slash commands via OpenCode SDK, ensuring custom commands are properly recognized.Files Modified
src/features/dcp/config.tssrc/tools/dcp-switch-profile/src/features/builtin-skills/src/features/slash-command/.github/workflows/ci.yml.github/workflows/publish.ymlAGENTS.mdsrc/filesTest Fixes
fix: RewrotegetMessageDircache test to avoidmock.module("node:fs")— inconsistent across Bun versions. Uses behavioral verification: mockopencode-storage-paths(same proven pattern as B2) and verify caching by creating session dir after first call — cache hit returns null, broken cache would find the new dir.Verification
bun run typecheck✅bun run lint✅actlocally ✅