🐛 fix(hooks): the finish check projects only the files in scope

Merged
MI
1mo ago
+78-9

User description

Why

On platform-images S-0002, T-0003's attempts 1 and 2 were convicted by scope. The implement finish check correctly owed only the drifted AGENTS.md files inside the contract's scope. Its instruction, though, was a bare torve spec project, which rewrites every drifted projection in the tree. The agent ran it and committed 19 projections, and the ones outside the scope convicted the attempt (commit dd1b579 on torve/S-0002).

What

  • torve spec project gains --only <file>, repeatable. Files not named are neither written nor removed, and --check reports drift only for the named files.
  • finish_check.drift_owed names the command file by file: torve spec project --only <owed>….
  • The engine does not regenerate projections itself, so the instruction stays and is narrowed rather than dropped.

Tests

  • tests/test_colocation.py: --only writes the named file and nothing else, and removal honours it too.
  • tests/test_equipment.py: the owed-drift block names torve spec project --only pages/AGENTS.md.
  • Full suite: 2851 tests, 0 failed, 18 skipped. ruff check, ruff format --check and mypy are clean on the touched files.

No CHANGELOG entry here; it goes into the 0.6.2 release cut.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X5XatXv3dQLan6TyQoHFyF


Summary by cubic

Fixes the implement finish check so it only projects the drifted files inside the contract's scope, preventing out-of-scope projections from convicting the attempt.

  • torve spec project gains --only <file>, repeatable; files not named are neither written, removed, opened, nor reported as drift in --check mode.
  • The finish check now names each owed file explicitly (torve spec project --only <file> instead of a bare torve spec project).

CodeAnt-AI Description

Keep projection fixes within the attempt’s scope

What Changed

  • Projection commands can now write, check, or remove only the named files, leaving other projected files untouched.
  • Finish checks now tell attempts to update only drifted files within their scope.

Impact

✅ Fewer out-of-scope projection changes
✅ In-scope drift fixes avoid scope violations

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.