Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code-review/.tessl-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tessl/code-review",
"version": "0.3.0",
"description": "Tessl Code Review in one plugin. Install it on a GitHub repository with the Tessl Review GitHub App, run the default review lenses from the CLI, tune what a review catches by authoring your own lens, and answer a review's findings. Start with the code-review skill, which routes to the right one.",
"version": "0.4.2",
"description": "Tessl Code Review in one plugin. Install it on a GitHub repository with the Tessl Review GitHub App, run the default review lenses from the CLI, create or update a repository-owned review package, tune an individual lens, and answer a review's findings. Start with the code-review skill, which routes to the right one.",
"private": false,
"skills": "./skills/"
}
22 changes: 20 additions & 2 deletions code-review/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tessl/code-review

Tessl Code Review in one plugin: set it up on a repository, run it, tune what it catches, and answer what it finds.
Tessl Code Review in one plugin: set it up on a repository, run it, create or improve a repository-owned review package, tune one lens, and answer what it finds.

Tessl Code Review reviews a change with several reviewers in parallel, one per lens, then merges and grades their findings into one review. It runs from the CLI as `tessl code review`, and on GitHub as the Tessl Review GitHub App.

Expand All @@ -20,7 +20,9 @@ Tell your agent what you want. The `code-review` skill works out which job it is
| --- | --- | --- |
| Add Code Review to a repository | the Tessl Review GitHub App, below | "Set up Tessl Code Review on this repo" |
| Review a change right now | `tessl code review` | "Review this branch against main" |
| Make reviews catch something they miss, or stop flagging something they should not | `create-code-review-lens` | "Our reviews keep missing N+1 queries" |
| Create a complete local review package | `create-code-review-package` | "Create custom review lenses for this repository" |
| Improve the current local review package | `update-code-review-package` | "Improve our review package from recent feedback" |
| Write or tune one lens | `create-code-review-lens` | "Our reviews keep missing N+1 queries" |
| Deal with a review that has arrived on your pull request | `respond-to-code-review` | "Address the Tessl review on PR 42" |

## Set it up
Expand Down Expand Up @@ -69,6 +71,20 @@ An automated review runs the same defaults unless its lens selection names a com

## Tune it

`create-code-review-package` creates a complete repository-owned package at
`review-lenses/`. It copies the four current defaults into the package, authors
a repository-specific lens, and actively references all four defaults and the
bespoke lens through `.tessl-code-review.yml`. Every existing default entry
keeps its scope and effort; an absent default is added once with broad coverage.
Existing profile settings, local lenses, and unrelated coverage are preserved.
If the active profile already uses a local package, the creation workflow leaves
it untouched and points to the updating workflow.

`update-code-review-package` treats the current local package as its only
baseline. It uses bounded, attributed review feedback and repository changes to
make small lens or routing improvements, or reports that no change is justified.
It does not compare with or synchronize registry defaults.

`create-code-review-lens` turns a review concern into a lens that has been run, tuned, and pinned. It settles the review question and the bar a finding has to clear, drafts the lens, runs it against a change that should trip it and one that should not, backtests it against changes that already carry review feedback, and pins the reference a review can select.

The default lenses are meant to be forked. Copy one into your repository, tune it, and reference it by local path. A skill needs `name` and `description` frontmatter; past that, the shape most lenses use is Scope, Method, Threshold, Reporting. Keep a lens short and carry only what makes it distinct.
Expand All @@ -83,6 +99,8 @@ The default lenses are meant to be forked. Copy one into your repository, tune i
| --- | --- |
| `code-review` | Start here. Routes a request to the right job below, and runs a review from the CLI. |
| `setup-code-review` | Unsupported. Detect, interview, propose, write, verify, and explain a GitHub Action caller workflow. |
| `create-code-review-package` | Create the first complete local package from the four defaults and one repository lens, then wire the active profile. |
| `update-code-review-package` | Improve the active local package from bounded review evidence without upstream comparison. |
| `create-code-review-lens` | Settle the review question and threshold, draft the lens, run and backtest it, then pin it. |
| `respond-to-code-review` | Adjudicate each finding on your pull request, reply, and keep the pull request on its goal. |
| `review-correctness-and-data-integrity` | Default lens. Functional defects, data loss, duplicate writes, ordering, integration contracts. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"context":"The existing explicit profile activates only a loose custom lens. A successful creation must copy and actively reference all four defaults, add a bespoke lens, and preserve the custom entry and profile settings.",
"type":"weighted_checklist",
"checklist":[
{"name":"Private package manifest","description":"review-lenses/.tessl-plugin/plugin.json exists, is valid JSON, names local/code-review, uses version 0.1.0, sets private true, and points skills at ./skills/","max_score":10},
{"name":"All defaults copied","description":"The four default lens SKILL.md files exist under review-lenses/skills with their original names and substantive instructions","max_score":15},
{"name":"All defaults activated","description":".tessl-code-review.yml actively references each of the four copied defaults by a resolving local path, with no registry default refs left behind","max_score":22},
{"name":"Defaults have broad coverage","description":"None of the four copied default entries has globs, so none remains dormant or restricted to a newly invented scope","max_score":12},
{"name":"Custom coverage preserved","description":"The existing review-compliance ref, globs, and effort remain semantically unchanged","max_score":12},
{"name":"Profile settings preserved","description":"schemaVersion, effort, reviewMode, requestChangesAt, and ignore remain semantically unchanged","max_score":10},
{"name":"Bespoke lens added","description":"A fifth package lens addresses the checkpoint compatibility rule from AGENTS.md and is activated with justified focused globs","max_score":12},
{"name":"Refs and behavior checked","description":"result-notes.md confirms local refs resolve, checks applicable-lens limits and glob behavior, and reports positive, negative, and unavailable behavioral checks honestly","max_score":7}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
schemaVersion: 1
effort: adaptive
reviewMode: relaxed
requestChangesAt: minor
ignore:
- generated/**
lenses:
- ref: ./review-lenses/review-compliance/SKILL.md
effort: high
globs:
- policies/**
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Repository rules

Changes under `workers/` must preserve checkpoint compatibility across restarts.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: review-compliance
description: Review policy records for missing ownership and expiry dates. Use as one lens in a code review run.
---

# Review lens: Policy records

Report a policy record that has no accountable owner or review date.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"description":"Create a complete local review package when an explicit profile omits all four defaults","include":["./inputs"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Complete a custom-only review profile

Use `create-code-review-package`. This repository has an explicit profile with
one custom lens and no default lenses. Create the complete local package while
preserving the existing profile entry and settings. Activate all four copied
defaults with broad coverage.

Write `result-notes.md` with the decisions and checks.
14 changes: 14 additions & 0 deletions code-review/evals/create-review-package-fresh/criteria.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"context": "This is a first creation with no review history. The complete local package must contain copied defaults plus one useful repository lens, and the new profile must activate all five without relying on registry refs.",
"type": "weighted_checklist",
"checklist": [
{"name":"Private package manifest","description":"review-lenses/.tessl-plugin/plugin.json exists, is valid JSON, names local/code-review, uses version 0.1.0, sets private true, and points skills at ./skills/","max_score":10},
{"name":"All defaults copied","description":"The four default lens SKILL.md files exist under review-lenses/skills with their original names and substantive instructions","max_score":18},
{"name":"Bespoke lens added","description":"A fifth lens addresses the repository-specific boundary rule in AGENTS.md, has valid matching frontmatter, a consequence threshold, an exclusion, and justified scope","max_score":18},
{"name":"Complete active profile","description":".tessl-code-review.yml is valid block YAML and references all four copied defaults and the bespoke lens by resolving local paths","max_score":16},
{"name":"Defaults remain broad","description":"The four copied defaults have no globs in this fresh profile; the bespoke lens has focused globs for the relevant source area","max_score":12},
{"name":"No history invented","description":"The package, profile, and notes do not claim to have inspected pull requests or review feedback","max_score":8},
{"name":"Honest validation","description":"result-notes.md distinguishes static/profile checks from behavioral checks, includes a positive and negative lens case, and names the unavailable historical backtest","max_score":14},
{"name":"No publication","description":"The result does not add a workflow, commit instructions, registry publication, or pull-request automation","max_score":4}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Repository rules

Every handler under `src/tenant/` must derive the tenant from authenticated
request context. A request field may never select the tenant for a read or write.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export async function getAccount(context: { tenantId: string }, id: string) {
return database.accounts.find({ tenantId: context.tenantId, id });
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"description":"Create a complete local review package on a repository with no review history","include":["./inputs"]}
8 changes: 8 additions & 0 deletions code-review/evals/create-review-package-fresh/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create our first repository review package

Use `create-code-review-package` to create a complete local review package for
this repository. We have no pull request history or previous review feedback.
Use the current code and `AGENTS.md`; do not invent historical evidence.

Leave the package and active `.tessl-code-review.yml` in the workspace. Write
`result-notes.md` with the validation performed and its limitations.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"context":"The existing profile selects two defaults with path scopes, one loose local lens, and one lens inside a different local plugin. Creation copies all four defaults into the package, replaces the two selected default refs, activates the two omitted defaults broadly, and adds a scoped bespoke lens without discarding existing settings or entries. The other plugin must not be mistaken for an existing local/code-review package.",
"type":"weighted_checklist",
"checklist":[
{"name":"Complete package copied","description":"The private review-lenses package contains all four default lenses plus a new bespoke lens","max_score":15},
{"name":"Selected defaults localized","description":"Every selected correctness and security entry is replaced in place by its resolving local package ref","max_score":12},
{"name":"Existing globs preserved","description":"Correctness remains scoped to src/** and security remains scoped to infra/**; neither scope is widened or discarded","max_score":15},
{"name":"Omitted defaults activated","description":"The profile adds one local maintainability lens and one local scale lens without globs, giving both broad coverage without duplicate entries","max_score":12},
{"name":"Other local coverage preserved","description":"The loose ./review-lenses/review-compliance/SKILL.md and the lens inside acme/policy both remain unchanged and selected with their original globs; neither prevents package creation","max_score":12},
{"name":"Profile settings preserved","description":"effort, reviewMode, requestChangesAt, and ignore remain semantically unchanged","max_score":12},
{"name":"Bespoke scope justified","description":"The new repository lens is distinct from existing coverage and has focused positive globs","max_score":12},
{"name":"Refs and limits checked","description":"result-notes.md confirms local refs resolve and checks the eight-applicable-lens limit and glob behavior","max_score":10}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
schemaVersion: 1
effort: adaptive
reviewMode: relaxed
requestChangesAt: minor
ignore:
- generated/**
lenses:
- ref: tessl/code-review@0.3.0#review-correctness-and-data-integrity
globs:
- src/**
- ref: tessl/code-review@0.3.0#review-security-and-privacy
effort: high
globs:
- infra/**
- ref: ./review-lenses/review-compliance/SKILL.md
globs:
- policies/**
- ref: ./policy-plugin/skills/review-release/SKILL.md
globs:
- release/**
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Repository rules

Changes under `workers/` must preserve checkpoint compatibility across restarts.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"acme/policy","version":"1.0.0","private":true,"skills":"./skills/"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: review-release
description: Review release records for missing rollback ownership. Use as one lens in a code review run.
---

# Review lens: Release records

Report a release record that has no named owner for rollback decisions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: review-compliance
description: Review changes to policy records for missing ownership and expiry dates. Use as one lens in a code review run.
---

# Review lens: Policy records

Report a policy record that has no accountable owner or review date.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"description":"Copy all defaults while preserving an explicit profile's intentional coverage choices and loose local lens","include":["./inputs"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Package our lenses without changing review coverage

Use `create-code-review-package`. This repository already has an explicit
profile and one loose local lens, but it does not have a local plugin package.
Create the complete package while preserving every deliberate profile setting
and existing lens. Activate every copied default; give any default omitted from
the existing profile broad coverage.

Write `result-notes.md` with the decisions and checks.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"context":"The active profile references a local/code-review package at a non-default path. Creation must discover it from the active ref and must not overwrite it or create a second review-lenses package.",
"type":"weighted_checklist",
"checklist":[
{"name":"Active package discovered","description":"The result recognizes custom-review as the active package because the profile references a skill under the local/code-review manifest's declared skills directory","max_score":25},
{"name":"Existing files untouched","description":"The profile, manifest, and existing lens remain unchanged","max_score":25},
{"name":"No second package","description":"No review-lenses/.tessl-plugin/plugin.json or copied default lenses are created","max_score":20},
{"name":"Update direction","description":"result-notes.md explicitly directs the user to update-code-review-package","max_score":20},
{"name":"No install detour","description":"The result does not route to GitHub App installation or an Action workflow","max_score":10}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
schemaVersion: 1
lenses:
- ref: ./custom-review/skills/review-domain/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"local/code-review","version":"0.4.2","private":true,"skills":"./skills/"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: review-domain
description: Review domain changes for invalid state transitions. Use as one lens in a code review run.
---

# Review lens: Domain transitions

Report a transition that bypasses the aggregate's allowed state graph.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"description":"Protect an active package at a non-default path and direct creation to updating","include":["./inputs"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Create a custom review package

Use `create-code-review-package`. If the active profile already uses a complete
local package, follow the workflow's existing-package behavior. Write
`result-notes.md` with the outcome.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"context":"The active profile uses registry defaults, but an unreferenced local/code-review package already occupies review-lenses. Creation must not overwrite or modify it. The result should be blocked and direct package maintenance to updating.",
"type":"weighted_checklist",
"checklist":[
{"name":"Destination package detected","description":"The result recognizes review-lenses/.tessl-plugin/plugin.json even though no active profile ref points into it","max_score":25},
{"name":"Existing package untouched","description":"The manifest and hand-written review-domain lens remain byte-for-byte unchanged","max_score":25},
{"name":"Profile untouched","description":"The registry-based active profile is not rewritten and no new lens is activated","max_score":15},
{"name":"Blocked outcome","description":"result-notes.md reports a blocked creation rather than success or no-change","max_score":15},
{"name":"Update direction","description":"The notes direct the user to update-code-review-package and do not route to installation","max_score":15},
{"name":"No partial package","description":"No copied defaults, bespoke lens, or other exploratory edit is left behind","max_score":5}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
schemaVersion: 1
lenses:
- ref: tessl/code-review@0.3.0#review-correctness-and-data-integrity
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"local/code-review","version":"0.2.0","private":true,"skills":"./skills/"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: review-domain
description: Review domain changes for invalid state transitions. Use as one lens in a code review run.
---

# Review lens: Domain transitions

Maintainer wording: transitions are valid only through the aggregate command.

Report a changed path that writes state without the aggregate command.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"description":"Protect an existing package at the default destination even when the active profile has not adopted it","include":["./inputs"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Create a custom review package

Use `create-code-review-package`. A package may already exist at the workflow's
default destination even when the active profile does not reference it. Follow
the workflow's protection behavior and write `result-notes.md` with the outcome.
Loading