Skip to content

feat(guardrails): high-priority quality enforcement hooks #125

Closed

Description

@terisuke

概要

guardrail.ts に未実装の高優先度品質フック5本を追加。

実装対象

1. enforce-domain-naming (tool.execute.before for edit/write)

  • ファイル名・変数名のドメイン命名規約チェック
  • 新規ファイル作成時のパス妥当性検証

2. enforce-endpoint-dataflow (tool.execute.after for edit/write)

  • エンドポイント変更時の4点データフロー検証
  • クライアント送信→APIルート→バックエンドaction→レスポンス形式の一致確認

3. task-completion-gate (tool.execute.before for task:complete系)

  • タスク完了宣言前の検証
  • テスト通過・ドキュメント更新・ユーザー視点検証の確認

4. tool-failure-recovery (tool.execute.after)

  • ツール失敗時の自動リカバリー提案
  • 連続失敗の検出とエスカレーション

5. verify-agent-output (tool.execute.after for task)

  • エージェント出力の事後検証
  • 空/無意味な応答の検出

フック型

フック名 イベント 型
enforce-domain-naming tool.execute.before advisory
enforce-endpoint-dataflow tool.execute.after advisory
task-completion-gate tool.execute.after hard block
tool-failure-recovery tool.execute.after advisory
verify-agent-output tool.execute.after advisory

受入基準

  • guardrail.ts に 5 フック追加
  • 各フックの発火確認(ログ or advisory 出力)
  • state.json に関連追跡フィールド追加

関連

Activity

  1. terisuke commented on Apr 6, 2026

    @terisuke
    Author

    Implementation Status: PR #128

    All 5 quality hooks implemented in guardrail.ts:

    • enforce-domain-naming (tool.execute.before) — PascalCase/camelCase per directory
    • enforce-endpoint-dataflow (tool.execute.after) — router/app method detection advisory
    • task-completion-gate (tool.execute.after) — reviewed + factchecked check before issue close
    • tool-failure-recovery (tool.execute.after) — exit code based detection (not regex)
    • verify-agent-output (tool.execute.after) — shared with feat(guardrails): multi-model delegation gates — OpenCode competitive advantage #124

    Review fix: failure detection narrowed from broad regex to structured signals (metadata.exitCode, title="Error")

    Verification:

    • Scenario test: domain_naming.mismatch in events.jsonl ✅
    • Scenario test: endpoint advisory output ✅
    • Scenario test: 3 consecutive failures detected via exitCode ✅

    Remaining:

  2. terisuke commented on Apr 6, 2026

    @terisuke
    Author

    All review fixes applied + new quality hooks (verify-state-file-integrity, audit-docker-build-args, pr-guard). PR #128 updated with Wave 8.

  3. terisuke commented on Apr 6, 2026

    @terisuke
    Author

    Closed by PR #128 — all quality hooks implemented + review fixes applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions