Conversation
…est fixes, subagent enforcement
1. State persistence path fix
- StateManager default was '.opencode/state' (directory), causing
writeFileSync to create a file named 'state' instead of writing
to state.json. Changed to '.opencode/state/state.json'.
- Added resolveStateFilePath() helper to config-paths.ts.
2. Enforcer blocked logic cleanup
- Blocked was only set if error contained 'required' or 'violation'
strings, letting real errors (e.g. 'missing semicolon') slip through.
Simplified to: any error = blocked.
- codexEnforcement now explicitly sets blocked based on combined errors
instead of relying on spread of validationResult (which had its own
inconsistent blocked calc).
- contextAnalysisValidation was double-blocking (|| contextIssues.errors)
when ruleValidation already covered it. Removed redundant check.
3. Console.* bleed-through elimination
- Replaced all console.log/warn/error in framework runtime code with
frameworkLogger.log() across 30+ files: core, security, processors,
postprocessor, performance, mcps (connections + 15 knowledge-skills
servers), integrations, utils, validation.
- frameworkLogger writes to file only (.opencode/logs/framework/),
never outputs to console, preventing noise in OpenCode agent UI.
- .catch(console.error) patterns replaced with .catch(() => {}) for
process-level handlers where frameworkLogger may not be available.
- .opencode/plugins/strray-codex-injection.js: replaced console.warn
with frameworkLogger for config-paths and system-prompt-generator
load failures.
4. Test fixes
- 6 tests were asserting console.log/warn calls that no longer fire
after the console.* cleanup. Updated to spy on frameworkLogger.log()
instead: EscalationEngine (1), SuccessHandler (4), security-headers (1).
5. Subagent (delegate_task) enforcement in Hermes plugin
- Subagents bypass all StringRay hooks since they run in isolated
contexts. Added post-hoc enforcement via snapshot-and-diff:
- pre_tool_call: snapshots git diff --name-only HEAD
- post_tool_call: re-diffs, validates all new source changes
through the bridge quality gate
- Blocked files logged as [subagent-validate] BLOCKED in activity.log
- Stats tracked: dispatches, validations, blocks (visible via /strray stats)
- Plugin v2.1 → v2.2. Canonical source: src/integrations/hermes-agent/.
All 127 test files (2399 tests) pass. All 5 pipelines pass. Zero TS errors.
htafolla
added a commit
that referenced
this pull request
Apr 2, 2026
- Add validators for terms #12, #19, #16, #3, #13 (early returns, small functions, DRY, over-engineering, error boundaries) - Wire processor-pipeline MCP to use CodexLoader for richer validation - Fix orchestrator config loading and conflict resolution wiring - Total 16 active validators now (was 11)
htafolla
added a commit
that referenced
this pull request
Apr 2, 2026
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.
Changes
1. State persistence path fix
StateManagerdefault was.opencode/state(directory), causingwriteFileSyncto create a file namedstateinstead of writing tostate.json. Changed to.opencode/state/state.json.resolveStateFilePath()helper toconfig-paths.ts.2. Enforcer blocked logic cleanup
blockedwas only set if error contained"required"or"violation"strings, letting real errors slip through. Simplified to: any error = blocked.codexEnforcementnow explicitly setsblockedbased on combined errors instead of relying on spread ofvalidationResult.contextAnalysisValidationwas double-blocking — removed redundant check.3. Console.* bleed-through elimination
console.log/warn/errorin framework runtime code withframeworkLogger.log()across 30+ files.frameworkLoggerwrites to file only (.opencode/logs/framework/), never outputs to console..catch(console.error)→.catch(() => {})for process-level handlers.strray-codex-injection.jsupdated.4. Test fixes
console.*calls updated to spy onframeworkLogger.log()instead.5. Subagent (delegate_task) enforcement — Hermes plugin v2.2
pre_tool_call: snapshotsgit diff --name-only HEADpost_tool_call: re-diffs, validates all new source changes through bridge quality gate/strray stats)Verification