Skip to content

fix(harness): feed architecture violations back to the agent - #2511

Merged
likaiaki merged 1 commit into
feat/2.5.0-sgfrom
feat-2.5.0-sg-lkk-1010
Oct 21, 2026
Merged

likaiaki merged 1 commit into
feat/2.5.0-sgfrom
feat-2.5.0-sg-lkk-1010

Conversation

@likaiaki

Copy link
Copy Markdown
Collaborator

Summary

  • scripts/arch-guard.sh 的分层违规现在以退出码 1 结束,并把说明打回给模型。警告规则仍是退出码 0。
  • 新增行才会检查禁用的数据库写法和直接 import axios,以及 Platform 与 Client 互引。存量文件不会因为被碰到就失败。
  • Cursor 和 Claude Code 都调用 scripts/agent_hooks.py。git push --force、git reset --hard、--no-verify 会被拒绝,新建分支会先询问。
  • CLAUDE.md 不再是 AGENTS.md 的符号链接,只保留指向全文的短指针。

Test plan

  • bash scripts/harness-guard-selftest.sh 通过
  • 同一任务对照:旧脚本退出码 0 并留下 sqlalchemy.JSON;当前脚本退出码 1,文件改为 dialect_helpers.JsonType,git checkout -b 返回 ask 且未执行
  • 在 Cursor Hooks 面板确认 postToolUse、stop、beforeShellExecution 已加载
  • 打开本 PR 后确认 harness-guard 工作流跑的是本次变更文件

Made with Cursor

arch-guard exited 0 on real violations, and the Claude hook pointed at another machine. Fail those violations, check new lines for banned database and axios imports, and point Cursor and Claude at the same script.

Co-authored-by: Cursor <cursoragent@cursor.com>
@likaiaki
likaiaki merged commit 742a1cb into feat/2.5.0-sg Oct 21, 2026
1 check passed
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.

1 participant