From 7f9bc86f7cdce2c5cf99971ad95a1fb49d73b94f Mon Sep 17 00:00:00 2001 From: Jim Freeman Date: Wed, 2 Dec 2026 00:38:31 +0000 Subject: [PATCH 1/2] chore: release v0.9.0 --- CHANGELOG.md | 2 ++ install.sh | 2 +- plugin/.claude-plugin/plugin.json | 2 +- pyproject.toml | 2 +- src/oo_ratchet/__init__.py | 2 +- uv.lock | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfe49f7..64550b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [0.9.0] - 2026-12-02 + ### Added - `oo-ratchet doctor` has an `install` line: `editable install of ` for diff --git a/install.sh b/install.sh index a334d88..a0ce263 100755 --- a/install.sh +++ b/install.sh @@ -16,7 +16,7 @@ warn() { printf ' %b!%b %s\n' "$YELLOW" "$NC" "$1"; } fail() { printf ' %b✗%b %s\n' "$YELLOW" "$NC" "$1"; exit 1; } PACKAGE="punt-oo-ratchet" -VERSION="0.8.0" +VERSION="0.9.0" BINARY="oo-ratchet" PLUGIN="oo-ratchet@punt-labs" diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json index 218c1f5..8f8f0aa 100644 --- a/plugin/.claude-plugin/plugin.json +++ b/plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "oo-ratchet-dev", "description": "Improve a Python package's architecture toward its oo-ratchet goal: /oo-ratchet:improve", - "version": "0.8.0", + "version": "0.9.0", "author": { "name": "Punt Labs", "email": "hello@punt-labs.com" diff --git a/pyproject.toml b/pyproject.toml index e7ca997..78e1200 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "punt-oo-ratchet" -version = "0.8.0" +version = "0.9.0" description = "Must-improve OO quality ratchet for Python repos: OO metrics, coupling/cohesion, and lint-suppression count gates." readme = "README.md" license = "MIT" diff --git a/src/oo_ratchet/__init__.py b/src/oo_ratchet/__init__.py index 8fb1b17..ff44f05 100644 --- a/src/oo_ratchet/__init__.py +++ b/src/oo_ratchet/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -__version__ = "0.8.0" +__version__ = "0.9.0" diff --git a/uv.lock b/uv.lock index b0fc336..6064517 100644 --- a/uv.lock +++ b/uv.lock @@ -506,7 +506,7 @@ wheels = [ [[package]] name = "punt-oo-ratchet" -version = "0.8.0" +version = "0.9.0" source = { editable = "." } dependencies = [ { name = "openai" }, From 76a473834aba901c6de506904b5c81f204b606ae Mon Sep 17 00:00:00 2001 From: Jim Freeman Date: Wed, 2 Dec 2026 00:38:33 +0000 Subject: [PATCH 2/2] chore: prepare plugin for release --- plugin/.claude-plugin/plugin.json | 2 +- plugin/commands/advise-dev.md | 52 ----------------------- plugin/commands/check-dev.md | 64 ----------------------------- plugin/commands/goal-dev.md | 51 ----------------------- plugin/commands/improve-dev.md | 54 ------------------------ plugin/commands/setup-dev.md | 68 ------------------------------- plugin/commands/status-dev.md | 46 --------------------- plugin/commands/summary-dev.md | 50 ----------------------- plugin/commands/update-dev.md | 55 ------------------------- 9 files changed, 1 insertion(+), 441 deletions(-) delete mode 100644 plugin/commands/advise-dev.md delete mode 100644 plugin/commands/check-dev.md delete mode 100644 plugin/commands/goal-dev.md delete mode 100644 plugin/commands/improve-dev.md delete mode 100644 plugin/commands/setup-dev.md delete mode 100644 plugin/commands/status-dev.md delete mode 100644 plugin/commands/summary-dev.md delete mode 100644 plugin/commands/update-dev.md diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json index 8f8f0aa..deab434 100644 --- a/plugin/.claude-plugin/plugin.json +++ b/plugin/.claude-plugin/plugin.json @@ -1,5 +1,5 @@ { - "name": "oo-ratchet-dev", + "name": "oo-ratchet", "description": "Improve a Python package's architecture toward its oo-ratchet goal: /oo-ratchet:improve", "version": "0.9.0", "author": { diff --git a/plugin/commands/advise-dev.md b/plugin/commands/advise-dev.md deleted file mode 100644 index 68426e0..0000000 --- a/plugin/commands/advise-dev.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -description: "[dev] Ask the advisor what to do next about the goal; changes nothing" -argument-hint: "[SRC] [--cause ID] [--dry-run-prompt]" -allowed-tools: Bash(oo-ratchet goal propose:*), Bash(git rev-parse:*), Read, Glob, Grep ---- - - -## Input - -Arguments: $ARGUMENTS - -`SRC` is the package directory, for example `src/shop/`. If the arguments name -no source directory, use the one the repository already names: the roots and -namespace under `[tool.oo-ratchet]` in `pyproject.toml`, or the directory its -`Makefile` passes to `oo-ratchet`. If neither names one, ask the person. - -## Task - -Run `oo-ratchet goal propose $ARGUMENTS` from the repository root. The person -typed this command, so do not ask first: the verb is the consent to send the -findings, and then the source of the modules involved, to the configured model. -The key variable (`OPENAI_API_KEY` unless `api-key-env` says otherwise in -`[tool.oo-ratchet.goal.llm]`) is the other half; the command does not set it. - -With no `--cause`, the advisor chooses the next step, or at most three, from the -large structure down to the details, and plans them. With `--cause ID` it plans -that one cause. `--dry-run-prompt` prints the first request and sends nothing; -use it when the person wants to see what would be sent. - -Show the plan exactly as printed: the numbered steps with their file, change and -reason, and the summary. The summary ends with "Predicted impact on the score:". -Say plainly that this is the model's guess, not a measurement, and that nothing -has checked it. - -Exit 2 means a refused request before any network use: the key variable is not -set, the advisor is switched off by `enabled = false`, or a setting is invalid. -Quote the message and name the setting. Exit 1 means no usable plan came back: -quote the message and say that running the command again asks again. - -Change no file. The advisor only plans. `/oo-ratchet-dev:improve-dev` is the command that -makes changes. - -If `oo-ratchet` is not on the PATH, tell the person to install it with -`uv tool install punt-oo-ratchet` and stop. - -This is the dev command: it must exercise the working tree. Before anything -else, run `oo-ratchet doctor` (the person approves it when prompted) and read -its `install` line. It must say `editable install of` followed by this -repository's root. If it says `not editable`, or names another directory, tell -the person to run `uv tool install --editable .` from the repository root and -stop. Do not take `oo-ratchet goal guide` as proof of the install: a release -prints the same guide. diff --git a/plugin/commands/check-dev.md b/plugin/commands/check-dev.md deleted file mode 100644 index 18f2395..0000000 --- a/plugin/commands/check-dev.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -description: "[dev] Run the ratchet gates exactly as CI runs them" -argument-hint: "[SRC]" -allowed-tools: Bash(oo-ratchet oo --check:*), Bash(oo-ratchet coupling --check:*), Bash(oo-ratchet suppressions --check:*), Bash(oo-ratchet layers --check:*), Bash(oo-ratchet design --base-ref:*), Bash(git merge-base:*), Bash(git rev-parse:*), Read, Glob ---- - - -## Input - -Arguments: $ARGUMENTS - -`SRC` is the package directory, for example `src/shop/`. If the arguments name -no source directory, use the one the repository already names: the roots and -namespace under `[tool.oo-ratchet]` in `pyproject.toml`, or the directory its -`Makefile` passes to `oo-ratchet`. If neither names one, ask the person. - -## Task - -CI compares your branch with the commit where it left `main`, not with the tip -of `main`, so find that commit first. Run `git merge-base origin/main HEAD` and -keep the SHA it prints. If it fails because `origin/main` is missing, tell the -person to run `git fetch origin main` and stop. - -Find the branch with `git rev-parse --abbrev-ref HEAD`. On a `release/*` or -`post-release/*` branch CI passes `--allow-no-improvement` to the OO gate, so a -release branch need not improve a metric. On such a branch, add -`--allow-no-improvement` to the `oo` gate and nowhere else; on any other branch -run it without the flag. If it prints `HEAD`, the checkout is detached and the -branch name is unknown: ask the person which branch is being checked and decide -by that name; do not treat `HEAD` as a branch that is not a release. - -Run each gate from the repository root, in this order, with that SHA in place of -`SHA`: - -1. `oo-ratchet oo --check --base-ref SHA --require-base SRC` -2. `oo-ratchet coupling --check --base-ref SHA --require-base SRC` -3. `oo-ratchet suppressions --check --base-ref SHA --require-base SRC` -4. `oo-ratchet layers --check --base-ref SHA --require-base SRC` -5. `oo-ratchet design --base-ref SHA --enforce SRC` - -Skip `layers` if `pyproject.toml` has no `[tool.oo-ratchet.layers]` table, and -say that you skipped it. A gate whose baseline does not exist yet passes as the -first-adoption bootstrap; say so rather than reporting it as checked. - -Report one line per gate: pass or fail. For a failure, quote the failing rows and -the `FAIL:` lines verbatim. Exit 0 is a pass, exit 1 is a failure, and exit 2 -means the input was bad (a missing source directory, an unresolvable base, an -invalid layer table): quote the message. - -Change no file. Apart from that one flag, do not retry with a flag that waives a -rule. If a gate fails, -say that `/oo-ratchet-dev:improve-dev` works the fixes, and that `/oo-ratchet-dev:update-dev` -refreshes the baselines once the code is right. - -If `oo-ratchet` is not on the PATH, tell the person to install it with -`uv tool install punt-oo-ratchet` and stop. - -This is the dev command: it must exercise the working tree. Before anything -else, run `oo-ratchet doctor` (the person approves it when prompted) and read -its `install` line. It must say `editable install of` followed by this -repository's root. If it says `not editable`, or names another directory, tell -the person to run `uv tool install --editable .` from the repository root and -stop. Do not take `oo-ratchet goal guide` as proof of the install: a release -prints the same guide. diff --git a/plugin/commands/goal-dev.md b/plugin/commands/goal-dev.md deleted file mode 100644 index 77522f3..0000000 --- a/plugin/commands/goal-dev.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -description: "[dev] Show the goal targets, or tighten one in pyproject.toml" -argument-hint: "[SRC] [CHECK allow N | CHECK mode enforce]" -allowed-tools: Bash(oo-ratchet goal show:*), Bash(git rev-parse:*), Bash(git diff:*), Read, Edit, Glob, Grep ---- - - -## Input - -Arguments: $ARGUMENTS - -`SRC` is the package directory, for example `src/shop/`. If the arguments name -no source directory, use the one the repository already names: the roots and -namespace under `[tool.oo-ratchet]` in `pyproject.toml`, or the directory its -`Makefile` passes to `oo-ratchet`. If neither names one, ask the person. - -The goal is one table per check in `pyproject.toml`: -`[tool.oo-ratchet.goal.CHECK]` with a `mode` (`advise` or `enforce`) and an -`allow` count, where `CHECK` is `layers`, `design`, `oo`, `coupling` or -`suppressions`; `[tool.oo-ratchet.goal.design-advisory]` holds only `allow`. -A check is met when its gaps are at or under `allow`. - -## Task - -With no `CHECK` arguments, read those tables from `pyproject.toml`, run -`oo-ratchet goal show SRC`, and report each check: its mode, its allowance, its -current gap count and whether it is met. - -With `CHECK allow N`, set that table's `allow` to N. With `CHECK mode enforce`, -set its `mode` to `enforce`. Edit only that one table in `pyproject.toml` and -nothing else. - -Never raise an allowance and never change `enforce` back to `advise`: a goal only -tightens. If the person asks for a higher `allow` than the current one, refuse and -say why. If N is higher than the check's current gap count, say that the check -would be met with room to spare and offer to set `allow` to the gap count instead. - -After an edit, run `oo-ratchet goal show --base-ref HEAD SRC`. It warns if the -goal loosened since `HEAD`; there must be no such warning. Then run -`git diff pyproject.toml` and show the person the change. Do not commit it. - -If `oo-ratchet` is not on the PATH, tell the person to install it with -`uv tool install punt-oo-ratchet` and stop. - -This is the dev command: it must exercise the working tree. Before anything -else, run `oo-ratchet doctor` (the person approves it when prompted) and read -its `install` line. It must say `editable install of` followed by this -repository's root. If it says `not editable`, or names another directory, tell -the person to run `uv tool install --editable .` from the repository root and -stop. Do not take `oo-ratchet goal guide` as proof of the install: a release -prints the same guide. diff --git a/plugin/commands/improve-dev.md b/plugin/commands/improve-dev.md deleted file mode 100644 index 8c13820..0000000 --- a/plugin/commands/improve-dev.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -description: "[dev] Improve the package toward its oo-ratchet goal, one fix per round" -argument-hint: "[SRC] [--rounds N]" -allowed-tools: Bash(oo-ratchet goal:*), Bash(git rev-parse:*), Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git add:*), Bash(git commit:*), Bash(git restore --:*), Bash(make check), Bash(make lint), Bash(make test), Bash(make type), Read, Edit, Write, Glob, Grep ---- - - -## Input - -Arguments: $ARGUMENTS - -`--rounds N` caps how many causes get worked. One round fixes one cause and -ends in one commit. If `--rounds` is missing, is not a whole number, or is less -than 1, ask the person how many rounds (a positive whole number) before doing -anything else. - -`SRC` is the package directory, for example `src/shop/`; it replaces -`SOURCE_DIR` everywhere in the guide. If the arguments name no source directory, -use the one the repository already names: the roots and namespace under -`[tool.oo-ratchet]` in `pyproject.toml`, or the directory its `Makefile` passes -to `oo-ratchet`. If neither names one, ask the person. - -## Task - -Run `oo-ratchet goal guide` and read its output in full. It is the -instructions for this session, written by the installed version of the tool. -Follow it exactly, with N set to the number of rounds above. Its clean-tree rule -comes first: if `git status --porcelain --untracked-files=no` prints anything, -stop without changing any file. - -If `oo-ratchet goal guide` fails because `goal` is not a known command, the -installed CLI is older than this plugin needs. Tell the person to run -`uv tool upgrade punt-oo-ratchet` and stop. - -The command pre-approves only the exact commands `make check`, `make lint`, -`make test` and `make type` as the repository's own checks. If the repository -runs its checks another way, the person approves that command when prompted. - -Stage only the files the kept round changed, by explicit path: `git add PATH` -for each one. To discard a round's uncommitted edits to a file, run -`git restore -- PATH`. To discard a file the round created, delete it with -`rm PATH`; the person approves that when prompted, since it is not -pre-approved. - -If `oo-ratchet` is not on the PATH, tell the person to install it with -`uv tool install punt-oo-ratchet` and stop. - -This is the dev command: it must exercise the working tree. Before anything -else, run `oo-ratchet doctor` (the person approves it when prompted) and read -its `install` line. It must say `editable install of` followed by this -repository's root. If it says `not editable`, or names another directory, tell -the person to run `uv tool install --editable .` from the repository root and -stop. Do not take `oo-ratchet goal guide` as proof of the install: a release -prints the same guide. diff --git a/plugin/commands/setup-dev.md b/plugin/commands/setup-dev.md deleted file mode 100644 index 98cb36f..0000000 --- a/plugin/commands/setup-dev.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -description: "[dev] Set a repository up for oo-ratchet: layers, baselines and goal" -argument-hint: "[SRC]" -allowed-tools: Bash(oo-ratchet layers --suggest:*), Bash(oo-ratchet oo --update:*), Bash(oo-ratchet coupling --update:*), Bash(oo-ratchet suppressions --update:*), Bash(oo-ratchet layers --update:*), Bash(oo-ratchet goal show:*), Bash(git rev-parse:*), Bash(git status:*), Read, Edit, Write, Glob, Grep ---- - - -## Input - -Arguments: $ARGUMENTS - -`SRC` is the package directory, for example `src/shop/`. If the arguments name -none, find the package: look for `src/*/__init__.py` and the `[project]` name in -`pyproject.toml`. If exactly one candidate exists use it; if several do, ask the -person which. The person typed this command, so the files below are written -without asking first, and each decision is reported at the end. - -## Task - -Work from the repository root. If `pyproject.toml` already has a -`[tool.oo-ratchet.layers]` table or any `[tool.oo-ratchet.goal.` table, keep it: -say what exists and do only the steps still missing. - -1. **Layers table.** Run `oo-ratchet layers --suggest SRC` and show its output. - It writes nothing. Copy the suggested `[tool.oo-ratchet.layers]` table into - `pyproject.toml`. A conflict stays out of the table, so keep each conflicting - module unassigned and list it with its reason for the person to decide. A - module under `# Unclassified:` stays unassigned, whatever its evidence says, - even `reaches no IO`: the suggester leaves a module with no declared or named - intent unclassified on purpose, and an IO-free module can belong to any ring. - List each one with its reason for the person to classify. A wrong ring - silently passes forbidden imports, so report every assignment the suggester - made and its reason. - -2. **Baselines.** Run these in this order. Each writes the first baseline for its - gate into `.punt-labs/oo-ratchet/`: - `oo-ratchet suppressions --update SRC`, then `oo-ratchet oo --update SRC`, - then `oo-ratchet coupling --update SRC`, then `oo-ratchet layers --update SRC`. - Skip the last if step 1 left modules unassigned, and say why: the layers gate - refuses a table that does not cover the package. - -3. **Goal.** Add one `[tool.oo-ratchet.goal.CHECK]` table to `pyproject.toml` for - each of `layers`, `design`, `oo`, `coupling` and `suppressions`, each with - `mode = "advise"` and `allow = 0`, and `[tool.oo-ratchet.goal.design-advisory]` - with `allow = 0`. Run `oo-ratchet goal show SRC` and read the gap count of each - check. Set each `allow` to that count, except `layers` when step 1 left - modules unassigned: leave its `allow` at 0, because an unassigned module is a - gap to resolve, not an allowance. Today's gaps are the starting allowances, - and `/oo-ratchet-dev:goal-dev` tightens them from there. Run `oo-ratchet goal show SRC` - again and confirm that every other check is met. If `layers` is not met, say - so, list the unassigned modules, and say that setup is not complete until the - person classifies them. - -4. **Report.** Run `git status` and list what changed: `pyproject.toml` and the - files in `.punt-labs/oo-ratchet/`. Tell the person to commit them, and that - `/oo-ratchet-dev:check-dev` runs the gates as CI does, `/oo-ratchet-dev:status-dev` shows the - goal, and `/oo-ratchet-dev:improve-dev` works the fixes. Do not commit. - -If `oo-ratchet` is not on the PATH, tell the person to install it with -`uv tool install punt-oo-ratchet` and stop. - -This is the dev command: it must exercise the working tree. Before anything -else, run `oo-ratchet doctor` (the person approves it when prompted) and read -its `install` line. It must say `editable install of` followed by this -repository's root. If it says `not editable`, or names another directory, tell -the person to run `uv tool install --editable .` from the repository root and -stop. Do not take `oo-ratchet goal guide` as proof of the install: a release -prints the same guide. diff --git a/plugin/commands/status-dev.md b/plugin/commands/status-dev.md deleted file mode 100644 index 4df07b7..0000000 --- a/plugin/commands/status-dev.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -description: "[dev] Show how far the package is from its oo-ratchet goal" -argument-hint: "[SRC] [--all | --next N | --cause ID]" -allowed-tools: Bash(oo-ratchet goal show:*), Read, Glob, Grep ---- - - -## Input - -Arguments: $ARGUMENTS - -`SRC` is the package directory, for example `src/shop/`. If the arguments name -no source directory, use the one the repository already names: the roots and -namespace under `[tool.oo-ratchet]` in `pyproject.toml`, or the directory its -`Makefile` passes to `oo-ratchet`. If neither names one, ask the person. - -## Task - -Run `oo-ratchet goal show $ARGUMENTS` from the repository root and show its -output in full. Then say, in plain words: - -- which checks are met and which are not, with the gap count and the allowance - of each; -- the next fixes it lists, largest first. - -`--all` lists every cause, `--next N` lists N fixes (the default is 3), and -`--cause ID` gives the status and advice for one cause. - -Exit 0 means the table was printed. Exit 1 means a check in enforce mode is not -met: report that as the status, not as an error. Exit 2 means no answer was -possible (no goal table in `pyproject.toml`, a missing source directory, an -unparseable file): quote the message and tell the person that `/oo-ratchet-dev:setup-dev` -creates the goal tables. - -Change no file. This command only reports. - -If `oo-ratchet` is not on the PATH, tell the person to install it with -`uv tool install punt-oo-ratchet` and stop. - -This is the dev command: it must exercise the working tree. Before anything -else, run `oo-ratchet doctor` (the person approves it when prompted) and read -its `install` line. It must say `editable install of` followed by this -repository's root. If it says `not editable`, or names another directory, tell -the person to run `uv tool install --editable .` from the repository root and -stop. Do not take `oo-ratchet goal guide` as proof of the install: a release -prints the same guide. diff --git a/plugin/commands/summary-dev.md b/plugin/commands/summary-dev.md deleted file mode 100644 index d416747..0000000 --- a/plugin/commands/summary-dev.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -description: "[dev] Summarize what changed against the goal since a commit" -argument-hint: "[SRC] [--since SHA]" -allowed-tools: Bash(oo-ratchet goal summary:*), Bash(git merge-base:*), Bash(git rev-parse:*), Bash(git log:*), Read ---- - - -## Input - -Arguments: $ARGUMENTS - -`SRC` is the package directory, for example `src/shop/`. If the arguments name -no source directory, use the one the repository already names: the roots and -namespace under `[tool.oo-ratchet]` in `pyproject.toml`, or the directory its -`Makefile` passes to `oo-ratchet`. If neither names one, ask the person. - -`--since SHA` names the commit to measure from. If it is missing, use the commit -where the branch left `main`: run `git merge-base origin/main HEAD` and keep the -SHA it prints. If that fails because `origin/main` is missing, tell the person to -run `git fetch origin main` and stop. - -## Task - -Run `oo-ratchet goal summary SRC --since SHA` from the repository root and show -its table in full. It measures that commit and each later commit on the -first-parent path to `HEAD`. Then say, in plain words, which checks moved, in -which direction, and by how many gaps, since that commit. - -Only committed work is measured: uncommitted edits, including edits to the goal -tables, do not appear. If the person has uncommitted changes they care about, -say so. - -Exit 0 means the table was printed. Exit 1 means a check in enforce mode is not -met at the last commit: report that as the status. Exit 2 means no answer was -possible (a SHA that is not a commit or not on the first-parent path to `HEAD`, -no goal table, a source directory missing at some commit): quote the message. - -Change no file. `--json` prints the same measurements as one JSON object if the -person asks for it. - -If `oo-ratchet` is not on the PATH, tell the person to install it with -`uv tool install punt-oo-ratchet` and stop. - -This is the dev command: it must exercise the working tree. Before anything -else, run `oo-ratchet doctor` (the person approves it when prompted) and read -its `install` line. It must say `editable install of` followed by this -repository's root. If it says `not editable`, or names another directory, tell -the person to run `uv tool install --editable .` from the repository root and -stop. Do not take `oo-ratchet goal guide` as proof of the install: a release -prints the same guide. diff --git a/plugin/commands/update-dev.md b/plugin/commands/update-dev.md deleted file mode 100644 index b674dcb..0000000 --- a/plugin/commands/update-dev.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -description: "[dev] Refresh the ratchet baselines after a change; only tightens" -argument-hint: "[SRC]" -allowed-tools: Bash(oo-ratchet oo --update:*), Bash(oo-ratchet coupling --update:*), Bash(oo-ratchet suppressions --update:*), Bash(oo-ratchet layers --update:*), Bash(git merge-base:*), Bash(git rev-parse:*), Bash(git status:*), Bash(git diff:*), Read ---- - - -## Input - -Arguments: $ARGUMENTS - -`SRC` is the package directory, for example `src/shop/`. If the arguments name -no source directory, use the one the repository already names: the roots and -namespace under `[tool.oo-ratchet]` in `pyproject.toml`, or the directory its -`Makefile` passes to `oo-ratchet`. If neither names one, ask the person. - -## Task - -An update rewrites the recorded scores of the files the change touched, so the -next check compares against the new code. It never loosens a recorded score: a -gate that sees a regression refuses, and the code is what has to change. - -Find the commit where the branch left `main`. Run `git merge-base origin/main HEAD` -and keep the SHA it prints. If that fails because `origin/main` is missing, tell -the person to run `git fetch origin main` and stop. - -Run these from the repository root, in this order, with that SHA in place of -`SHA`: - -1. `oo-ratchet suppressions --update SRC` -2. `oo-ratchet oo --update --base-ref SHA SRC` -3. `oo-ratchet coupling --update --base-ref SHA SRC` -4. `oo-ratchet layers --update SRC` - -Skip `layers` if `pyproject.toml` has no `[tool.oo-ratchet.layers]` table, and say -that you skipped it. Report one line per gate: what it wrote, or its refusal -quoted verbatim. If a gate refuses, stop there, say which file and metric got -worse, and say that `/oo-ratchet-dev:improve-dev` works the fixes. Do not look for a way -around the refusal. - -When all four finish, run `git status` and list the files that changed in -`.punt-labs/oo-ratchet/`. Tell the person to commit them with the source change, -because CI requires the committed baseline to equal the current scores. Do not -commit them. - -If `oo-ratchet` is not on the PATH, tell the person to install it with -`uv tool install punt-oo-ratchet` and stop. - -This is the dev command: it must exercise the working tree. Before anything -else, run `oo-ratchet doctor` (the person approves it when prompted) and read -its `install` line. It must say `editable install of` followed by this -repository's root. If it says `not editable`, or names another directory, tell -the person to run `uv tool install --editable .` from the repository root and -stop. Do not take `oo-ratchet goal guide` as proof of the install: a release -prints the same guide.