Skip to content

add coding-ethos submodule and minor fixes - #65

Merged
paudley merged 1 commit into
mainfrom
small_fixes
May 23, 2026
Merged

add coding-ethos submodule and minor fixes#65
paudley merged 1 commit into
mainfrom
small_fixes

Conversation

@paudley

@paudley paudley commented May 23, 2026

Copy link
Copy Markdown
Owner

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:

  • Added .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.
  • Added .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:

  • Introduced .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:

  • Updated .code-ethos/tool-config-hashes.json to include the new .bandit.yml file and its hash, ensuring the tool registry remains consistent and up-to-date with the enforced config files.

Copilot AI review requested due to automatic review settings May 23, 2026 19:22
@paudley
paudley merged commit 1c2a471 into main May 23, 2026
3 of 4 checks passed
@paudley
paudley deleted the small_fixes branch May 23, 2026 19:23

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread .codex/config.toml
Comment on lines +8 to +51
{ 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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

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.

Comment thread .mcp.json
"args": [
"mcp"
],
"command": "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

Hardcoded absolute path detected. This configuration is not portable. Use a relative path to the submodule binary instead.

Suggested change
"command": "/home/paudley/Active.running/core_data/coding-ethos/bin/coding-ethos-run",
"command": "./coding-ethos/bin/coding-ethos-run",

Comment thread scripts/network_guard.sh
Comment on lines +32 to +34
while true; do
sleep "${CHECK_INTERVAL}"
done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
while true; do
sleep "${CHECK_INTERVAL}"
done
exit 0
References
  1. Crash early on ambiguous startup and configuration states instead of degrading silently.

Comment thread scripts/network_guard.sh
Comment on lines +42 to +44
while true; do
sleep "${CHECK_INTERVAL}"
done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Similar to the previous check, avoid hanging the script. Exit gracefully if the capability is optional, or fail hard if it is required.

Suggested change
while true; do
sleep "${CHECK_INTERVAL}"
done
exit 0
References
  1. Crash early on ambiguous startup and configuration states instead of degrading silently.

@@ -0,0 +1,538 @@
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This directory (.codex/skills/) contains an exact duplicate of the skills documentation found in .agents/skills/. Duplicating documentation increases maintenance overhead and the risk of information divergence. Consider using a single location for these files.

@paudley
paudley removed the request for review from Copilot May 23, 2026 19:44
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