oh-my-opencode 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/command/get-unpublished-changes.md +148 -0
- package/.agents/command/omomomo.md +37 -0
- package/.agents/command/publish.md +376 -0
- package/.agents/command/remove-deadcode.md +221 -0
- package/.agents/command/security-research.md +16 -0
- package/.agents/skills/get-unpublished-changes/SKILL.md +24 -0
- package/.agents/skills/github-triage/SKILL.md +587 -0
- package/.agents/skills/github-triage/scripts/gh_fetch.py +398 -0
- package/.agents/skills/hyperplan/SKILL.md +450 -0
- package/.agents/skills/omomomo/SKILL.md +36 -0
- package/.agents/skills/pre-publish-review/SKILL.md +407 -0
- package/.agents/skills/publish/SKILL.md +428 -0
- package/.agents/skills/remove-deadcode/SKILL.md +216 -0
- package/.agents/skills/security-research/SKILL.md +204 -0
- package/.agents/skills/work-with-pr/SKILL.md +360 -0
- package/.agents/skills/work-with-pr-workspace/evals/evals.json +76 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/benchmark.json +138 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/benchmark.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/eval_metadata.json +57 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/grading.json +15 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/code-changes.md +454 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/execution-plan.md +136 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/pr-description.md +47 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/verification-strategy.md +163 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/grading.json +15 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/code-changes.md +615 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/execution-plan.md +99 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/pr-description.md +50 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/verification-strategy.md +111 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/eval_metadata.json +37 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/grading.json +11 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/code-changes.md +205 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/execution-plan.md +78 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/pr-description.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/verification-strategy.md +87 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/grading.json +11 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/code-changes.md +334 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/execution-plan.md +86 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/pr-description.md +23 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/verification-strategy.md +119 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/code-changes.md +221 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/execution-plan.md +104 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/pr-description.md +41 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/verification-strategy.md +84 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/code-changes.md +342 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/execution-plan.md +131 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/pr-description.md +39 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/verification-strategy.md +128 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/code-changes.md +143 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/execution-plan.md +82 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/pr-description.md +51 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/verification-strategy.md +69 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/code-changes.md +252 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/execution-plan.md +83 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/pr-description.md +33 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/verification-strategy.md +101 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/code-changes.md +387 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +112 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/pr-description.md +51 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/verification-strategy.md +75 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/code-changes.md +529 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/execution-plan.md +127 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/pr-description.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/verification-strategy.md +120 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/review.html +1326 -0
- package/.opencode/command/get-unpublished-changes.md +148 -0
- package/.opencode/command/omomomo.md +37 -0
- package/.opencode/command/publish.md +376 -0
- package/.opencode/command/remove-deadcode.md +221 -0
- package/.opencode/command/security-research.md +16 -0
- package/.opencode/skills/github-triage/SKILL.md +587 -0
- package/.opencode/skills/github-triage/scripts/gh_fetch.py +398 -0
- package/.opencode/skills/hyperplan/SKILL.md +450 -0
- package/.opencode/skills/pre-publish-review/SKILL.md +407 -0
- package/.opencode/skills/work-with-pr/SKILL.md +360 -0
- package/.opencode/skills/work-with-pr-workspace/evals/evals.json +76 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/benchmark.json +138 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/benchmark.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/eval_metadata.json +57 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/grading.json +15 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/code-changes.md +454 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/execution-plan.md +136 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/pr-description.md +47 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/verification-strategy.md +163 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/grading.json +15 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/code-changes.md +615 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/execution-plan.md +99 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/pr-description.md +50 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/verification-strategy.md +111 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/eval_metadata.json +37 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/grading.json +11 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/code-changes.md +205 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/execution-plan.md +78 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/pr-description.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/verification-strategy.md +87 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/grading.json +11 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/code-changes.md +334 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/execution-plan.md +86 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/pr-description.md +23 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/verification-strategy.md +119 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/code-changes.md +221 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/execution-plan.md +104 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/pr-description.md +41 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/verification-strategy.md +84 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/code-changes.md +342 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/execution-plan.md +131 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/pr-description.md +39 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/verification-strategy.md +128 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/code-changes.md +143 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/execution-plan.md +82 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/pr-description.md +51 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/verification-strategy.md +69 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/code-changes.md +252 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/execution-plan.md +83 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/pr-description.md +33 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/verification-strategy.md +101 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/code-changes.md +387 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +112 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/pr-description.md +51 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/verification-strategy.md +75 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/code-changes.md +529 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/execution-plan.md +127 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/pr-description.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/verification-strategy.md +120 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/review.html +1326 -0
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/README.ru.md +1 -1
- package/README.zh-cn.md +1 -1
- package/dist/agents/atlas/agent.d.ts +6 -6
- package/dist/agents/prometheus/gemini.d.ts +0 -11
- package/dist/agents/prometheus/gpt.d.ts +0 -10
- package/dist/agents/prometheus/system-prompt.d.ts +2 -20
- package/dist/agents/types.d.ts +1 -16
- package/dist/cli/index.js +50 -17
- package/dist/config/schema/agent-names.d.ts +3 -3
- package/dist/config/schema/agent-overrides.d.ts +208 -208
- package/dist/config/schema/categories.d.ts +28 -28
- package/dist/config/schema/fallback-models.d.ts +20 -20
- package/dist/config/schema/oh-my-opencode-config.d.ts +208 -208
- package/dist/features/background-agent/parent-wake-notifier.d.ts +8 -1
- package/dist/help/schema/acp.d.ts +95 -0
- package/dist/help/schema/doctor.d.ts +147 -0
- package/dist/help/schema/sandbox.d.ts +74 -0
- package/dist/help/schema/status.d.ts +139 -0
- package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/hyperplan/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/team/default.d.ts +2 -7
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -9
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -16
- package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +1 -10
- package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +1 -5
- package/dist/hooks/ralph-loop/no-progress-turn-detector.d.ts +7 -0
- package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +1 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/hooks/runtime-fallback/error-classifier.d.ts +1 -0
- package/dist/index.js +51910 -50310
- package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +1 -0
- package/dist/shared/prompt-async-gate/types.d.ts +4 -3
- package/package.json +19 -13
- package/dist/agents/atlas/default-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/default.d.ts +0 -2
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/gemini.d.ts +0 -2
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/gpt.d.ts +0 -2
- package/dist/agents/atlas/kimi-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/kimi.d.ts +0 -2
- package/dist/agents/atlas/opus-4-7-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/opus-4-7.d.ts +0 -2
- package/dist/agents/atlas/shared-prompt.d.ts +0 -9
- package/dist/agents/prometheus/behavioral-summary.d.ts +0 -6
- package/dist/agents/prometheus/high-accuracy-mode.d.ts +0 -6
- package/dist/agents/prometheus/identity-constraints.d.ts +0 -7
- package/dist/agents/prometheus/interview-mode.d.ts +0 -7
- package/dist/agents/prometheus/plan-generation.d.ts +0 -7
- package/dist/agents/prometheus/plan-template.d.ts +0 -7
- package/dist/agents/prometheus/spec-driven-mode.d.ts +0 -7
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Execution Plan: Relax comment-checker hook false positives
|
|
2
|
+
|
|
3
|
+
## Problem Analysis
|
|
4
|
+
|
|
5
|
+
The comment-checker hook delegates to an external Go binary (`code-yeongyu/go-claude-code-comment-checker`). The binary:
|
|
6
|
+
1. Detects ALL comments in written/edited code using tree-sitter
|
|
7
|
+
2. Filters out only BDD markers, linter directives, and shebangs
|
|
8
|
+
3. Flags every remaining comment as problematic (exit code 2)
|
|
9
|
+
4. In the output formatter (`formatter.go`), uses `AgentMemoFilter` to categorize comments for display
|
|
10
|
+
|
|
11
|
+
The `AgentMemoFilter` in `pkg/filters/agent_memo.go` contains the overly aggressive regex:
|
|
12
|
+
```go
|
|
13
|
+
regexp.MustCompile(`(?i)^[\s#/*-]*note:\s*\w`),
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This matches ANY comment starting with `Note:` (case-insensitive) followed by a word character, causing legitimate comments like `// Note: Thread-safe implementation` or `// NOTE: See RFC 7231` to be classified as "AGENT MEMO" AI slop with an aggressive warning banner.
|
|
17
|
+
|
|
18
|
+
Additionally, the binary flags ALL non-filtered comments (not just agent memos), so even without the `Note:` regex, `// Note: ...` comments would still be flagged as generic "COMMENT DETECTED."
|
|
19
|
+
|
|
20
|
+
## Architecture Understanding
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
TypeScript (oh-my-opencode) Go Binary (go-claude-code-comment-checker)
|
|
24
|
+
───────────────────────────── ──────────────────────────────────────────
|
|
25
|
+
hook.ts main.go
|
|
26
|
+
├─ tool.execute.before ├─ Read JSON from stdin
|
|
27
|
+
│ └─ registerPendingCall() ├─ Detect comments (tree-sitter)
|
|
28
|
+
└─ tool.execute.after ├─ applyFilters (BDD, Directive, Shebang)
|
|
29
|
+
└─ processWithCli() ├─ FormatHookMessage (uses AgentMemoFilter for display)
|
|
30
|
+
└─ runCommentChecker() └─ exit 0 (clean) or exit 2 (comments found, message on stderr)
|
|
31
|
+
└─ spawn binary, pipe JSON
|
|
32
|
+
└─ read stderr → message
|
|
33
|
+
└─ append to output
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Key files in oh-my-opencode:
|
|
37
|
+
- `src/hooks/comment-checker/hook.ts` - Hook factory, registers before/after handlers
|
|
38
|
+
- `src/hooks/comment-checker/cli-runner.ts` - Orchestrates CLI invocation, semaphore
|
|
39
|
+
- `src/hooks/comment-checker/cli.ts` - Binary resolution, process spawning, timeout handling
|
|
40
|
+
- `src/hooks/comment-checker/types.ts` - PendingCall, CommentInfo types
|
|
41
|
+
- `src/config/schema/comment-checker.ts` - Config schema (currently only `custom_prompt`)
|
|
42
|
+
|
|
43
|
+
Key files in Go binary:
|
|
44
|
+
- `pkg/filters/agent_memo.go` - Contains the aggressive `note:\s*\w` regex (line 20)
|
|
45
|
+
- `pkg/output/formatter.go` - Uses AgentMemoFilter to add "AGENT MEMO" warnings
|
|
46
|
+
- `cmd/comment-checker/main.go` - Filter pipeline (BDD + Directive + Shebang only)
|
|
47
|
+
|
|
48
|
+
## Step-by-Step Plan
|
|
49
|
+
|
|
50
|
+
### Step 1: Create feature branch
|
|
51
|
+
```bash
|
|
52
|
+
git checkout dev
|
|
53
|
+
git pull origin dev
|
|
54
|
+
git checkout -b fix/comment-checker-note-false-positive
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Step 2: Extend CommentCheckerConfigSchema
|
|
58
|
+
**File: `src/config/schema/comment-checker.ts`**
|
|
59
|
+
|
|
60
|
+
Add `allowed_comment_prefixes` field with sensible defaults. This lets users configure which comment prefixes should be treated as legitimate (not AI slop).
|
|
61
|
+
|
|
62
|
+
### Step 3: Add a post-processing filter in cli-runner.ts
|
|
63
|
+
**File: `src/hooks/comment-checker/cli-runner.ts`**
|
|
64
|
+
|
|
65
|
+
After the Go binary returns its result, parse the stderr message to identify and suppress comments that match allowed prefixes. The binary's output contains XML like:
|
|
66
|
+
```xml
|
|
67
|
+
<comments file="/path/to/file.ts">
|
|
68
|
+
<comment line-number="5">// Note: Thread-safe</comment>
|
|
69
|
+
</comments>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Add a function `filterAllowedComments()` that:
|
|
73
|
+
1. Extracts `<comment>` elements from the message
|
|
74
|
+
2. Checks if the comment text matches any allowed prefix pattern
|
|
75
|
+
3. If ALL flagged comments match allowed patterns, suppress the entire warning
|
|
76
|
+
4. If some comments are legitimate and some aren't, rebuild the message without the legitimate ones
|
|
77
|
+
|
|
78
|
+
### Step 4: Create dedicated filter module
|
|
79
|
+
**File: `src/hooks/comment-checker/allowed-prefix-filter.ts`** (new)
|
|
80
|
+
|
|
81
|
+
Extract the filtering logic into its own module per the 200 LOC / single-responsibility rule.
|
|
82
|
+
|
|
83
|
+
### Step 5: Pass allowed_comment_prefixes through the hook chain
|
|
84
|
+
**File: `src/hooks/comment-checker/hook.ts`**
|
|
85
|
+
|
|
86
|
+
Thread the `allowed_comment_prefixes` config from `createCommentCheckerHooks()` down to `processWithCli()` and `processApplyPatchEditsWithCli()`.
|
|
87
|
+
|
|
88
|
+
### Step 6: Add test cases
|
|
89
|
+
**File: `src/hooks/comment-checker/allowed-prefix-filter.test.ts`** (new)
|
|
90
|
+
|
|
91
|
+
Test cases covering:
|
|
92
|
+
- `// Note: Thread-safe implementation` - should NOT be flagged (false positive)
|
|
93
|
+
- `// NOTE: See RFC 7231 for details` - should NOT be flagged
|
|
94
|
+
- `// Note: changed from X to Y` - SHOULD still be flagged (genuine AI slop)
|
|
95
|
+
- `// TODO: implement caching` - should NOT be flagged
|
|
96
|
+
- `// FIXME: race condition` - should NOT be flagged
|
|
97
|
+
- `// HACK: workaround for upstream bug` - should NOT be flagged
|
|
98
|
+
- `// Added new validation logic` - SHOULD be flagged
|
|
99
|
+
- Custom allowed patterns from config
|
|
100
|
+
|
|
101
|
+
**File: `src/hooks/comment-checker/cli-runner.test.ts`** (new or extend cli.test.ts)
|
|
102
|
+
|
|
103
|
+
Integration-level tests for the post-processing pipeline.
|
|
104
|
+
|
|
105
|
+
### Step 7: Verify
|
|
106
|
+
```bash
|
|
107
|
+
bun test src/hooks/comment-checker/
|
|
108
|
+
bun run typecheck
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Step 8: Commit and push
|
|
112
|
+
```bash
|
|
113
|
+
git add -A
|
|
114
|
+
git commit -m "fix(comment-checker): add allowed-prefix filter to reduce false positives on Note: comments"
|
|
115
|
+
git push -u origin fix/comment-checker-note-false-positive
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Step 9: Create PR
|
|
119
|
+
```bash
|
|
120
|
+
gh pr create --title "fix(comment-checker): reduce false positives for legitimate Note: comments" --body-file /tmp/pr-body.md --base dev
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Step 10 (Follow-up): Upstream Go binary fix
|
|
124
|
+
File an issue or PR on `code-yeongyu/go-claude-code-comment-checker` to:
|
|
125
|
+
1. Relax `(?i)^[\s#/*-]*note:\s*\w` to be more specific (e.g., `note:\s*(changed|modified|updated|added|removed|implemented|refactored)`)
|
|
126
|
+
2. Add a dedicated `LegitimateCommentFilter` to the filter pipeline in `main.go`
|
|
127
|
+
3. Support `--allow-prefix` CLI flag for external configuration
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
- Add `allowed_comment_prefixes` config to `CommentCheckerConfigSchema` with sensible defaults (Note:, TODO:, FIXME:, HACK:, WARNING:, etc.)
|
|
4
|
+
- Add post-processing filter in `allowed-prefix-filter.ts` that suppresses false positives from the Go binary's output before appending to tool output
|
|
5
|
+
- Add 11 test cases covering false positive scenarios (Note:, TODO:, FIXME:, case-insensitivity, mixed comments, agent memo header suppression)
|
|
6
|
+
|
|
7
|
+
## Problem
|
|
8
|
+
|
|
9
|
+
The comment-checker hook's upstream Go binary (`go-claude-code-comment-checker`) flags ALL non-filtered comments as problematic. Its `AgentMemoFilter` regex `(?i)^[\s#/*-]*note:\s*\w` classifies any `Note:` comment as AI-generated "agent memo" slop, triggering an aggressive warning banner.
|
|
10
|
+
|
|
11
|
+
This causes false positives for legitimate, widely-used comment patterns:
|
|
12
|
+
```typescript
|
|
13
|
+
// Note: Thread-safe implementation required due to concurrent access
|
|
14
|
+
// NOTE: See RFC 7231 section 6.5.4 for 404 semantics
|
|
15
|
+
// Note: This timeout matches the upstream service SLA
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
These are standard engineering documentation patterns, not AI slop.
|
|
19
|
+
|
|
20
|
+
## Solution
|
|
21
|
+
|
|
22
|
+
Rather than waiting for an upstream binary fix, this PR adds a configurable **post-processing filter** on the TypeScript side:
|
|
23
|
+
|
|
24
|
+
1. **Config**: `comment_checker.allowed_comment_prefixes` - array of case-insensitive prefixes (defaults: `note:`, `todo:`, `fixme:`, `hack:`, `warning:`, `important:`, `bug:`, etc.)
|
|
25
|
+
2. **Filter**: After the Go binary returns flagged comments, `filterAllowedComments()` parses the XML output and suppresses comments matching allowed prefixes
|
|
26
|
+
3. **Behavior**: If ALL flagged comments are legitimate → suppress entire warning. If mixed → remove only the legitimate entries from the XML, keep the warning for actual slop.
|
|
27
|
+
|
|
28
|
+
Users can customize via config:
|
|
29
|
+
```jsonc
|
|
30
|
+
{
|
|
31
|
+
"comment_checker": {
|
|
32
|
+
"allowed_comment_prefixes": ["note:", "todo:", "fixme:", "custom-prefix:"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Test Plan
|
|
38
|
+
|
|
39
|
+
- 11 new test cases in `allowed-prefix-filter.test.ts`
|
|
40
|
+
- Updated assertion in `hook.apply-patch.test.ts` for new parameter
|
|
41
|
+
- `bun test src/hooks/comment-checker/` passes
|
|
42
|
+
- `bun run typecheck` clean
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Verification Strategy
|
|
2
|
+
|
|
3
|
+
## 1. Unit Tests
|
|
4
|
+
|
|
5
|
+
### New test file: `allowed-prefix-filter.test.ts`
|
|
6
|
+
Run: `bun test src/hooks/comment-checker/allowed-prefix-filter.test.ts`
|
|
7
|
+
|
|
8
|
+
| # | Scenario | Input | Expected |
|
|
9
|
+
|---|----------|-------|----------|
|
|
10
|
+
| 1 | Only Note: comments (default prefixes) | `// Note: Thread-safe`, `// NOTE: See RFC` | `hasRemainingComments: false`, empty message |
|
|
11
|
+
| 2 | Only TODO/FIXME/HACK (default prefixes) | `// TODO: impl`, `// FIXME: race`, `# HACK: workaround` | Suppressed |
|
|
12
|
+
| 3 | Only AI slop comments | `// Added validation`, `// Refactored for perf` | Full message preserved |
|
|
13
|
+
| 4 | Mixed legitimate + slop | `// Note: Thread-safe`, `// Changed from old to new` | Message kept, Note: entry removed from XML |
|
|
14
|
+
| 5 | Case-insensitive Note: | `// note: lowercase test` | Suppressed |
|
|
15
|
+
| 6 | Hash-prefixed comments | `# Note: Python`, `# TODO: something` | Suppressed (prefix stripped before matching) |
|
|
16
|
+
| 7 | Security: prefix | `// Security: validate input` | Suppressed |
|
|
17
|
+
| 8 | Warning: prefix | `// WARNING: mutates input` | Suppressed |
|
|
18
|
+
| 9 | Empty allowed prefixes | `// Note: should pass through` | Full message preserved (no filtering) |
|
|
19
|
+
| 10 | Custom prefix | `// PERF: O(n log n)` with `["perf:"]` | Suppressed |
|
|
20
|
+
| 11 | Agent memo header + Note: | Full agent memo banner + `// Note: Thread-safe` | Entire message suppressed including banner |
|
|
21
|
+
|
|
22
|
+
### Existing test: `hook.apply-patch.test.ts`
|
|
23
|
+
Run: `bun test src/hooks/comment-checker/hook.apply-patch.test.ts`
|
|
24
|
+
|
|
25
|
+
Verify the updated mock assertion accepts the new `allowedPrefixes` array parameter.
|
|
26
|
+
|
|
27
|
+
### Existing test: `cli.test.ts`
|
|
28
|
+
Run: `bun test src/hooks/comment-checker/cli.test.ts`
|
|
29
|
+
|
|
30
|
+
Verify no regressions in binary spawning, timeout, and semaphore logic.
|
|
31
|
+
|
|
32
|
+
## 2. Type Checking
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bun run typecheck
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Verify:
|
|
39
|
+
- `CommentCheckerConfigSchema` change propagates correctly to `CommentCheckerConfig` type
|
|
40
|
+
- All call sites in `hook.ts` and `cli-runner.ts` pass the new parameter
|
|
41
|
+
- `filterAllowedComments` return type matches usage in `cli-runner.ts`
|
|
42
|
+
- No new type errors introduced
|
|
43
|
+
|
|
44
|
+
## 3. LSP Diagnostics
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Check all changed files for errors
|
|
48
|
+
lsp_diagnostics src/config/schema/comment-checker.ts
|
|
49
|
+
lsp_diagnostics src/hooks/comment-checker/allowed-prefix-filter.ts
|
|
50
|
+
lsp_diagnostics src/hooks/comment-checker/cli-runner.ts
|
|
51
|
+
lsp_diagnostics src/hooks/comment-checker/hook.ts
|
|
52
|
+
lsp_diagnostics src/hooks/comment-checker/allowed-prefix-filter.test.ts
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 4. Full Test Suite
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
bun test src/hooks/comment-checker/
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
All 4 test files should pass:
|
|
62
|
+
- `cli.test.ts` (existing - no regressions)
|
|
63
|
+
- `pending-calls.test.ts` (existing - no regressions)
|
|
64
|
+
- `hook.apply-patch.test.ts` (modified assertion)
|
|
65
|
+
- `allowed-prefix-filter.test.ts` (new - all 11 cases)
|
|
66
|
+
|
|
67
|
+
## 5. Build Verification
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bun run build
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Ensure the new module is properly bundled and exported.
|
|
74
|
+
|
|
75
|
+
## 6. Integration Verification (Manual)
|
|
76
|
+
|
|
77
|
+
If binary is available locally:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Test with a file containing Note: comment
|
|
81
|
+
echo '{"session_id":"test","tool_name":"Write","transcript_path":"","cwd":"/tmp","hook_event_name":"PostToolUse","tool_input":{"file_path":"/tmp/test.ts","content":"// Note: Thread-safe implementation\nconst x = 1"}}' | ~/.cache/oh-my-opencode/bin/comment-checker check
|
|
82
|
+
echo "Exit code: $?"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Expected: Binary returns exit 2 (comment detected), but the TypeScript post-filter should suppress it.
|
|
86
|
+
|
|
87
|
+
## 7. Config Validation
|
|
88
|
+
|
|
89
|
+
Test that config changes work:
|
|
90
|
+
|
|
91
|
+
```jsonc
|
|
92
|
+
// .opencode/oh-my-opencode.jsonc
|
|
93
|
+
{
|
|
94
|
+
"comment_checker": {
|
|
95
|
+
// Override: only allow Note: and TODO:
|
|
96
|
+
"allowed_comment_prefixes": ["note:", "todo:"]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Verify Zod schema accepts the config and defaults are applied when field is omitted.
|
|
102
|
+
|
|
103
|
+
## 8. Regression Checks
|
|
104
|
+
|
|
105
|
+
Verify the following still work correctly:
|
|
106
|
+
- AI slop comments (`// Added new feature`, `// Refactored for performance`) are still flagged
|
|
107
|
+
- BDD comments (`// given`, `// when`, `// then`) are still allowed (binary-side filter)
|
|
108
|
+
- Linter directives (`// eslint-disable`, `// @ts-ignore`) are still allowed (binary-side filter)
|
|
109
|
+
- Shebangs (`#!/usr/bin/env node`) are still allowed (binary-side filter)
|
|
110
|
+
- `custom_prompt` config still works
|
|
111
|
+
- Semaphore prevents concurrent comment-checker runs
|
|
112
|
+
- Timeout handling (30s) still works
|
|
113
|
+
|
|
114
|
+
## 9. Edge Cases to Watch
|
|
115
|
+
|
|
116
|
+
- Empty message from binary (exit code 0) - filter should be no-op
|
|
117
|
+
- Binary not available - hook gracefully degrades (existing behavior)
|
|
118
|
+
- Message with no `<comment>` XML elements - filter passes through
|
|
119
|
+
- Very long messages with many comments - regex performance
|
|
120
|
+
- Comments containing XML-special characters (`<`, `>`, `&`) in text
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"total_tokens": null, "duration_ms": 399000, "total_duration_seconds": 399}
|