Skip to content

fix(agents): apply harness review findings - #149

Open
furedea wants to merge 12 commits into
mainfrom
fix/agent-harness-review-findings
Open

furedea wants to merge 12 commits into
mainfrom
fix/agent-harness-review-findings

Conversation

@furedea

@furedea furedea commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Applies the agents/ harness review findings tracked in #148, apart from the items listed under Departures.

Hook adapters

  • Moved the logic shared by the Codex, Devin, pi, and Hermes adapters into agents/hooks/lib/provider_adapter.py. Each adapter now only declares a Profile.
  • Made the Devin adapter executable. It was mode 100644, so its hooks could not run.
  • Fixed where the adapters had drifted apart:
    • All four now pass normalized payloads.
    • The secret-path label is renamed to guard_secret_paths.sh.
    • Hermes no longer mutates its input.
    • Devin and Hermes log session-start compaction only for compact/resume sources.
    • pi compaction events are now recorded.
  • The Claude file guard and lint now cover NotebookEdit. The read guard covers Grep when its path is a single file.

Sandbox and permissions

  • Claude: sandbox.allowUnsandboxedCommands is now false.
    • The sandbox write allowance used $HOME/.cache/nix, which Claude does not expand, so it never applied. It is now ~/.cache/nix, and ~/.cache/uv is added.
    • gh runs outside the sandbox because it needs hosts.yml. herdr also runs outside because its socket is denied.
    • herdr commands that drive other panes now ask first. The earlier send rules did not match send-text or send-keys, and agent prompt had no rule, so another agent's approval dialog could be answered without asking.
    • ~/.local/state/agent-harness (verification records) and the dprint cache are writable, so verify runs inside the sandbox.
    • lefthook moves to 2.x (nixpkgs-unstable). 1.13.6 always ran hook commands under a pty, and the sandbox denies that. Verified inside the sandbox: pre-commit and commitlint run under lefthook 2.1.10.
  • The secret read denials **/*key* and **/*token* also matched source files such as .venv/.../pygments/token.py, so pytest could not start in the sandbox. They are now limited to credential-shaped names (*.key, *_token, *token*.json, *.pem, and so on).
  • docker build moves from allow to ask.
  • Codex:
    • Removed the unknown remote_connections feature.
    • Kept external_migration, because codex 0.155.1 still reads it.
    • Enabled multi_agent_v2 so its wait timeouts take effect.
  • Added git to the manifest runtime_commands.

Nix

  • git cc: codex exec --full-auto became -s read-only, because the flag was removed.
  • Removed the unguarded opencode package.
  • New contracts check both changes.

Skills

  • project-setup can now be loaded implicitly.
  • PRs are created with an explicit body.
  • adr's triggers are now in its description.
  • The Issue body, glossary, and completion rules each have a single owner.
  • Removed generic or drifted content from tsdd, nix-dotfiles, python-style, rust-style, bash-style, and github-actions-style.
  • verify_page.py now detects SVG image/use, embed, track, input type=image, and meta refresh loads.
  • test_workflow_skill_layout.py was tied to past changes. It now runs contract tests over every skill: frontmatter, links and anchors, and handoff targets.

Verification selection

  • If every changed source of a language is explicitly mapped to another language's tests, that language is no longer planned. For example, agent-harness hook_bridge.ts is embedded with include_str! and tested by Rust. Unmapped sources still require their own runner and fail closed.

Refs #148

Verification

  • verification_session.py verify: pytest 1490 passed (full suite), bats 13 passed.
  • nix build of the home activation package plus the home-configuration and host-configuration checks succeeded.
  • lefthook pre-commit passed on every commit.

Departures

  • The AGENTS.md function-size rule was reviewed with the user before it was changed, as a separate step. The 2-4 line and one-level nesting quotas become an intent-based extraction rule, with nesting kept to about two levels.
  • Protecting provider files other than Claude/Codex, and isolating the pi bridge interpreter, are handled in fix: protect every rendered provider file and isolate the pi hook bridge agent-harness#140. flake.lock needs a bump after that PR merges.
  • herdr-delegation was not split into references/. That item was optional.

🤖 Generated with Claude Code

furedea and others added 5 commits September 23, 2026 18:59
Move shared Codex, Devin, pi, and Hermes adapter logic into hooks/lib/provider_adapter.py.

Make the Devin adapter executable and pass normalized payloads from every provider.

Stop mutating Hermes input; log session-start compaction only for compact/resume.

Cover NotebookEdit in the file guard and lint, and single-file Grep in the read guard.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Disallow unsandboxed commands in Claude; allow the uv cache and run gh outside the sandbox.

Narrow key and token read denials to credential-shaped names so source files stay readable.

Require approval for docker build, drop removed Codex features, and declare git as a runtime.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
codex exec no longer accepts --full-auto; the alias only needs a read-only sandbox.

Remove opencode, which had no harness hooks or permissions, and check both contracts.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… loads

Flag srcset only for non-data candidates and meta refresh or image inputs only when they load.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Let models load project-setup, which other skills name as the setup owner.

Create PRs with an explicit body and move adr triggers into its description.

Give Issue body, glossary, and completion rules a single owning skill.

Drop generic or drifted content; align python, rust, bash, and actions guidance with tools.

Replace history-bound skill layout tests with contracts over every skill.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 23, 2026 10:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

… rule

The 2-4 line and one-level nesting quotas contradicted the intent-based extraction rule.

They pushed agents toward over-splitting functions.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
furedea and others added 6 commits September 23, 2026 20:37
Embedded assets such as TypeScript bridge files tested by Rust no longer demand a JS runner.

Unmapped sources of that language still require their own runner and fail closed.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Keep parse-once boundaries, failures as values, exhaustive sum types, and the limit of types.

These were lost when the tsdd Type-Driven Design section was removed.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
external_migration is still read by codex 0.155.1, so restore it instead of dropping it.

Enable multi_agent_v2 so its wait timeouts take effect; remote_connections stays removed.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude does not expand $HOME in sandbox paths, so the nix and uv cache allowances never applied.

Run herdr outside the sandbox like gh, since its socket is denied and escaping is now disabled.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Allow the verification state directory and dprint cache so verify runs without escaping.

Ask before herdr commands that drive other panes; send-text, send-keys, and prompt were not covered.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
lefthook 1.13.6 always ran hook commands under a pty, which the Claude and Codex sandboxes deny.

Take lefthook from nixpkgs-unstable in home and the devShell, and check the minimum version.

Refs #148

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

2 participants