Skip to content

test(cli): source-guard hardening against real agent behavior (Roadmap Phase 3) #67

Open

Description

@jyotir-aditya

From ROADMAP.md Phase 3:

Source guard hardening: it's the feature nobody else has — make sure it survives real agent behavior (partial commits, formatter runs, config edits) without false positives.

Context

The source guard (cli/src/source-guard.ts) detects project-source edits made during a verify→fix loop and gives agents a typed signal instead of relying on prompt discipline. Baseline is snapshotted per verify-cycle in .verfix/verify-baseline.json, cleared on a passing run or new commit.

Task

Build a test matrix of real agent behaviors and verify the guard classifies each correctly (legitimate vs. flagged), fixing false positives/negatives found:

  • Formatter/linter runs (prettier, eslint --fix) touching source mid-loop — whitespace-only vs. substantive rewrites
  • Partial commits — agent commits some files mid-loop (baseline clears on new commit: is that the right behavior when the commit contains the source edit the guard should have flagged?)
  • Config + source in one edit batch — legitimate verfix.config.json/selector edits interleaved with app-source edits
  • Generated/build output changes (dist/, lockfiles) — should never trip the guard
  • Branch switches / rebases mid-loop
  • New untracked source files (agent adds a component rather than editing one)

Acceptance criteria

  • Standalone test script covering the matrix above (temp git repo fixtures, same pattern as existing cli/test/*.test.ts)
  • Documented decision per ambiguous case (e.g. mid-loop commits) in code comments or docs
  • Zero false positives across the matrix; known limitations stated

Activity

  1. added
    enhancement
    on Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions