Skip to content

feat(moderator-gate): deviation detection and user warning hooks#4510

Closed
herjarsa wants to merge 11 commits into
code-yeongyu:devfrom
herjarsa:feat/moderator-gate
Closed

feat(moderator-gate): deviation detection and user warning hooks#4510
herjarsa wants to merge 11 commits into
code-yeongyu:devfrom
herjarsa:feat/moderator-gate

Conversation

@herjarsa

@herjarsa herjarsa commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

ModeratorGate hook system that detects when agents deviate from user instructions and warns the user.

Features

  • Real-time deviation detection during tool execution
  • User-facing warnings when deviation is detected
  • Configurable deviation thresholds
  • Seamless integration with existing hook pipeline

Testing

All existing tests pass, typecheck clean.


Summary by cubic

Adds a ModeratorGate hook that detects deviations during tool runs, warns the user inline, and records decisions. Also fixes duplicate parent wake prompts by suppressing redundant wakes during the gate hold.

  • New Features

    • ModeratorGate hook: real-time deviation detection, warning injection into tool output, and JSONL audit at .omo/moderator-decisions.jsonl.
    • Heuristics include protected-area/config writes, dangerous bash patterns, error-y tool output, and writes with zero plan progress; severities: leve, media, grave.
    • Integrated via create-tool-guard-hooks, tool.execute.after, and src/hooks export; hook name added to the hook schema.
    • Docs: require GPT-5.2 xhigh PR review, treat ambiguous Cubic as not a pass, enforce merge commits; add opencode-session-debugging skill.
  • Bug Fixes

    • Background agent: suppress redundant parent wakes during promptAsync post-dispatch hold to avoid duplicate assistant streams.
    • Resolve merge conflicts with dev, adopt upstream refactor in parent-wake-notifier, and add a test for dispatched-wake tracking after hold expiry.
    • Update bun.lock: bump optional oh-my-opencode-* dependencies to 4.5.1.

Written for commit 898195f. Summary will update on new commits. Review in cubic

YeonGyu-Kim and others added 10 commits May 23, 2026 18:45
…-parent-wake-live-session-20260523

fix(background-agent): suppress redundant parent wakes during gate hold
…ow-opencode-session-skill-20260523

docs(skills): tighten PR workflow and add session debugging
…and user warnings

Phase 1-4 implementation:
- Fase 1: Hook tool.execute.after con logging de ejecuciones
- Fase 2: Deviation detection (writes, bash, outputs, plan context)
- Fase 3: Decision engine + warning injection en outputs
- Fase 4: Persistencia durable en .omo/moderator-decisions.jsonl

Tres niveles de severidad: leve (log), media (aviso), grave (warning)
- Accept upstream refactor of private methods to standalone functions in parent-wake-notifier.ts
- Accept upstream new test case for dispatched wake tracking after hold expiry
@herjarsa herjarsa closed this May 26, 2026
@herjarsa herjarsa reopened this May 26, 2026

@code-yeongyu code-yeongyu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can’t approve this PR while it introduces forbidden deprecated model references.

The PR diff adds multiple GPT-5.2 xhigh PR review / GPT-5.2 reviewer requirements in the work-with-pr skill docs. Repository policy now forbids GPT-5.2/GPT-5.3 usage. Please migrate every new GPT-5.2/GPT-5.3 reference in this PR to GPT-5.5, then rerun the relevant documentation/skill checks before requesting review again.

@herjarsa

herjarsa commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #4405 (moderator-gate, clean version). Also has CHANGES_REQUESTED, addressed in #4405.

@herjarsa herjarsa closed this Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants