add coding-ethos submodule and minor fixes - #65
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the "coding-ethos" framework, incorporating agent skill documentation, standardized linter configurations, and automated git hooks. It also updates PostgreSQL Docker settings and adds a network guard script. Feedback identifies critical portability issues caused by hardcoded absolute paths in configuration files and a violation of the "Fail Fast" principle in the network guard script, which hangs in an infinite loop when dependencies are missing. Additionally, the duplication of documentation files across directories was flagged as a maintenance risk.
| { matcher = "Bash|bash|exec_command|functions\\.exec_command|run_command|run_shell|run_shell_command|shell|shell_command|write_stdin|functions\\.write_stdin|multi_tool_use\\.parallel", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "Write|create_file|write_file", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "Edit|apply_patch|functions\\.apply_patch|edit_file", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "MultiEdit", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.update_plan", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "update_plan", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.request_user_input", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "request_user_input", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.view_image", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "view_image", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.list_mcp_resources", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.list_mcp_resource_templates", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.read_mcp_resource", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| ] | ||
| PostToolUse = [ | ||
| { matcher = "Bash|bash|exec_command|functions\\.exec_command|run_command|run_shell|run_shell_command|shell|shell_command|write_stdin|functions\\.write_stdin|multi_tool_use\\.parallel", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "Write|create_file|write_file", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "Edit|apply_patch|functions\\.apply_patch|edit_file", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "MultiEdit", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.update_plan", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "update_plan", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.request_user_input", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "request_user_input", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.view_image", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "view_image", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.list_mcp_resources", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.list_mcp_resource_templates", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| { matcher = "functions\\.read_mcp_resource", hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| ] | ||
| SessionStart = [ | ||
| { hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| ] | ||
| UserPromptSubmit = [ | ||
| { hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| ] | ||
| Stop = [ | ||
| { hooks = [{ type = "command", command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run agent-hook", statusMessage = "coding-ethos policy", timeout = 30 }] }, | ||
| ] | ||
| # END coding-ethos managed hooks | ||
|
|
||
| # BEGIN coding-ethos managed mcp | ||
| # Generated by coding-ethos. Edit coding_ethos.yml/config.yaml inputs, not this block. | ||
| [mcp_servers.coding-ethos] | ||
| command = "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run" |
There was a problem hiding this comment.
The configuration file contains multiple hardcoded absolute paths to a specific user's home directory (/home/paudley/...). This makes the setup non-portable and will cause all hooks and MCP servers to fail on any other machine. Please use relative paths (e.g., ./coding-ethos/bin/...) or environment variables to resolve the coding-ethos-run binary.
| "args": [ | ||
| "mcp" | ||
| ], | ||
| "command": "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run", |
There was a problem hiding this comment.
| while true; do | ||
| sleep "${CHECK_INTERVAL}" | ||
| done |
There was a problem hiding this comment.
Hanging the script in an infinite loop when a dependency is missing violates the 'Fail Fast' principle. If the network guard is not required, the script should log the warning and exit 0. If it is required, it should exit 1. Hanging makes the service appear 'running' while it is actually failing to provide any protection, which is a form of silent degradation.
| while true; do | |
| sleep "${CHECK_INTERVAL}" | |
| done | |
| exit 0 |
References
- Crash early on ambiguous startup and configuration states instead of degrading silently.
| while true; do | ||
| sleep "${CHECK_INTERVAL}" | ||
| done |
There was a problem hiding this comment.
Similar to the previous check, avoid hanging the script. Exit gracefully if the capability is optional, or fail hard if it is required.
| while true; do | |
| sleep "${CHECK_INTERVAL}" | |
| done | |
| exit 0 |
References
- Crash early on ambiguous startup and configuration states instead of degrading silently.
| @@ -0,0 +1,538 @@ | |||
| --- | |||
There was a problem hiding this comment.
This pull request introduces two new ETHOS-grounded skills for code remediation and adds a security scanning configuration, further enforcing code quality and security standards across the codebase. Additionally, it updates the tool configuration hash registry to reflect the new security config. The main themes are the codification of remediation practices and the integration of security tooling.
ETHOS Skills Documentation:
.agents/skills/lint-remediation/SKILL.md, providing detailed, principle-driven guidance on how to address lint and static analysis findings structurally, rather than via suppressions or config weakening. This document outlines workflows, anti-patterns, and output discipline for handling findings from tools like Ruff, mypy, Bandit, and more..agents/skills/conditional-imports/SKILL.md, which describes ETHOS policies and workflows for remediating conditional imports, local imports, and cyclic dependencies in Python. It emphasizes protocol-first design, SOLID principles, and strict handling of dependencies.Security Tooling Integration:
.bandit.yml, a configuration file for the Bandit Python security scanner, explicitly grounded in the "static-analysis-is-the-first-line-of-defense" principle. The config excludes test, build, and dependency directories from scans.Tooling Registry Update:
.code-ethos/tool-config-hashes.jsonto include the new.bandit.ymlfile and its hash, ensuring the tool registry remains consistent and up-to-date with the enforced config files.