Skip to content

fix(code-review): keep all six default lenses when a profile is written, and agree lenses before drafting - #65

Merged
colinhallett merged 3 commits into
mainfrom
fix/code-review-lens-skill-defaults
Nov 2, 2026
Merged

colinhallett merged 3 commits into
mainfrom
fix/code-review-lens-skill-defaults

Conversation

@colinhallett

@colinhallett colinhallett commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

An agent following create-code-review-lens to write or extend .tessl-code-review.yml could quietly lose review coverage. The skill said to keep the defaults by listing "the four tessl/code-review lenses" at @0.2.0. A repository with no profile runs six lenses, and a profile routes only by globs, so a profile written that way dropped Markdown and plugin review and sent those files to the code lenses. The same stale @0.2.0 pin appeared in the router skill, the profile reference and the README.

The plugin also stops naming a version of its own lenses anywhere. A version written into the plugin goes stale with every release, which is how @0.2.0 survived. It now explains the choice instead: an unversioned ref follows the newest lenses, and a pinned one should use a version looked up at the time, such as the installed plugin's.

What changes

  • create-code-review-lens
    • A new first step: read the existing profile and every local lens it references, or note that the six defaults run. Then propose the lenses, with their evidence and the closest existing lens, and agree them before drafting. A request that already names the lens counts as agreement, so the existing eval tasks still run straight through.
    • Step 1 distinguishes a profile on disk from the set reviews actually run: the App uses it once it is on the default branch, the CLI only with --profile.
    • Keeping the defaults now means all six lenses with the content routing from the profile reference's "Plugins and Markdown" section, either unversioned or pinned to a version the agent looked up, never one copied from an example.
    • Editing an existing profile keeps its other keys and each lens's globs and effort, including keys the skill does not describe.
    • A lens built only to restate rules in the AGENTS.md or CLAUDE.md chain duplicates review-maintainability-and-code-quality when that lens runs on the governed files. When the set leaves it out, the rule has no other enforcement and a lens for it is not a duplicate.
    • Before running a lens, the skill now says that every run needs a signed-in CLI and spends credits, and asks the agent to agree the number of runs. A lens measured on only a few backtest runs is reported as provisional.
  • validation.md: fetch a backtest's original head by its SHA. pull/<n>/head is only the latest head, which differs after a rebase or force-push, and a pull request whose reviewed commit is gone is left out of the set.
  • repository-profile.md: documents reviewMode and profile-level effort: adaptive, both of which the CLI accepts. Says to leave unrecognised keys in an existing profile alone. Uses unversioned refs and an @<version> placeholder in the examples, and says that the "Plugins and Markdown" routing is what a repository without a profile gets automatically.
  • Router skill and README: the default set is six lenses, routed automatically by content, and a plain run uses the lens version the CLI pins. Examples use unversioned refs.
  • Evals: fork-default-lens, route-lens and route-ad-hoc-review accept a registry ref with or without a version, and the two that ask for the complete default set now expect six lenses. Their task text no longer says "four default lenses".

Runs

Claude Code (Opus) was given the prompt the web app hands out under "Set up with your agent", with this branch's plugin installed from a local path in two scratch repositories:

  • No profile, with exported review notes describing repeated partial writes.

    • Turn 1 wrote nothing. It named the six defaults and their routing, proposed one lens for the repeated problem with its evidence and the closest existing lens, and declined to make a lens from a one-off style comment. It stated the credit cost and asked before writing.
    • Turn 2, after agreement, wrote a profile with all six lenses (at @0.5.0, from the text before the switch to unversioned refs) routed so each file has one owner, plus the new local lens on src/**. tessl code review --profile accepts that profile: it gets past validation, while the same file with an unknown key fails at the invalid-profile-file validation stage.
  • Existing profile with reviewMode: relaxed, requestChangesAt: minor, effort: adaptive, an ignore list, a per-lens effort: high and a local lens.

    • Turn 1 listed every setting it would keep and asked whether the four omitted defaults were dropped on purpose.
    • Turn 2 added one lens entry and changed nothing else in the file.
  • Unversioned refs, rerun. A single request naming the lens to write, in the no-profile repository, produced a profile listing all six defaults as tessl/code-review#... with the same one-owner routing. The CLI accepts it.

Every run skipped the lens review runs and backtests by instruction, to keep the test cost down. The five agent turns cost about USD 4.70 together.

…en, and agree lenses before drafting

Co-Authored-By: Claude <noreply@anthropic.com>
@colinhallett colinhallett self-assigned this Nov 2, 2026
tessl-reviewer[bot]
tessl-reviewer Bot previously approved these changes Nov 2, 2026

@tessl-reviewer tessl-reviewer Bot 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.

Tessl Reviewer

Changes approved

4 optional suggestions. Nothing blocking.

The change corrects the six-lens defaults and adds useful agreement, configuration-preservation, and validation guidance. Four documentation issues remain: profile existence is mistaken for active selection, written-rule coverage is assumed even when its lens is absent, the historical-head fetch recipe is incomplete, and the README retains its older four-lens description.

Severity Requires changes Advisory
Minor 0 4

Advisory (4)

  • Minor · Advisory in Standard mode · The discovery step treats an unselected profile as the active lens set
    code-review/skills/create-code-review-lens/SKILL.md:33
  • Minor · Advisory in Standard mode · The written-rule exclusion assumes maintainability coverage that profiles need not provide
    code-review/skills/create-code-review-lens/SKILL.md:43
  • Minor · Advisory in Standard mode · Fetching the current PR head does not ensure the historical review head is available
    code-review/skills/create-code-review-lens/references/validation.md:69
  • Minor · Advisory · Pre-existing · The README still describes four defaults and profile-only prose review
    code-review/README.md:65
Working with this review

Verify before acting. These findings are AI-generated and not authoritative. Check each one against the code, yourself or with an agent, before acting on it.

Answer each finding on its thread:

  • Addressed: you changed the code. Say what changed.
  • Refuted: the finding is wrong about the code.
  • Declined: the finding is right, and you are not changing it. Say why.

Reviews are incremental. The first review shows every valid optional and required finding. A later round checks the latest changes and earlier findings, and adds a fresh finding only when it requires changes. It never repeats one you refuted or declined. The configured request-changes severity sets the consequence baseline, and review mode sets the strength required to block. Ask for a full review to inspect the whole change and show optional findings again.

Lenses are configurable. Add your own and scope them to paths with globs. Keep the set small so findings stay distinct. See https://docs.tessl.io/tutorials/setting-up-agentic-code-review#route-reviews-with-yaml

Mention @tessl-reviewer to run another review.

Comment thread code-review/README.md Resolved
…address review findings

Co-Authored-By: Claude <noreply@anthropic.com>
@colinhallett

Copy link
Copy Markdown
Contributor Author

@tessl-reviewer

tessl-reviewer[bot]
tessl-reviewer Bot previously approved these changes Nov 2, 2026

@tessl-reviewer tessl-reviewer Bot 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.

Tessl Reviewer

Changes approved

No findings to surface.

Earlier findings: 4 addressed

About this review

These findings are AI-generated and not authoritative. Check each one against the code before acting on it. See the guidance on working with this review.

Mention @tessl-reviewer to run another review.

…sion

Co-Authored-By: Claude <noreply@anthropic.com>
@colinhallett

Copy link
Copy Markdown
Contributor Author

@tessl-reviewer

@colinhallett
colinhallett enabled auto-merge (squash) November 2, 2026 16:08

@tessl-reviewer tessl-reviewer Bot 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.

Tessl Reviewer

Changes approved

The current guidance distinguishes configured profiles from active review selection, preserves written-rule coverage when maintainability is absent, fetches historical review heads by SHA, and consistently describes all six automatically routed defaults. The four earlier concerns are addressed; no unresolved findings remain.

Earlier findings: 4 addressed

About this review

These findings are AI-generated and not authoritative. Check each one against the code before acting on it. See the guidance on working with this review.

Mention @tessl-reviewer to run another review.

@colinhallett
colinhallett merged commit 84360a8 into main Nov 2, 2026
2 checks passed
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