Skip to content

File a creation-allowance tracker per refusal spell, outside the cap - #1716

Merged
max-sixty merged 2 commits into
mainfrom
ci-failure-issue-per-incident
Nov 21, 2026
Merged

max-sixty merged 2 commits into
mainfrom
ci-failure-issue-per-incident

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The creation limiter kept one Creation allowance exhausted tracker for all time and reopened it on every refusal, so its thread grew without bound; leaf's max-sixty/leaf#3560 holds 69 comments. A refusal now comments on the open tracker, or files a new one when none is open, the same lifecycle #1715 gave CI failure reports. The newest tracker filed in the past 24 hours is left out of the creation count, since it is the limiter's own notice of the spell.

To weigh: a tracker is recognised by its title and label, which the agent can edit, so two bounds keep that from being abused. Only one tracker is exempt from the count, so forged trackers gain at most one creation a day. And no tracker is filed once creations reach twice the limit, so an agent that closes or relabels trackers and retries makes the limiter file at most about one allowance of them a day; before this change, removing the label had the same effect with no bound. Approvals are now read from the trackers updated in the past 24 hours, taken from the history read the limiter already makes, rather than from a list of every tracker ever filed, which would have failed past 100. A failed tracker read now still returns the refusal with its usage. Transferring an issue to another repository removes it from the count; that applies to every creation, predates this change, and docs/security-model.md now says so.

Max asked for this. Three rounds of independent Codex review found the loops above, which are now bounded. uv run pytest and pre-commit pass, and each new test fails with its mechanism disabled.

This was written by Claude Code on behalf of max-sixty

The creation limiter kept one `Creation allowance exhausted` tracker for all
time, reopening it on every refusal, so its thread grew without bound (leaf's
holds 69 comments). A refusal now comments on the open tracker, or files a new
one when none is open, as CI failure reports and outage issues already do.

## How it works

- One read of the bot's issues over the 8-day window gives both the creation
  count and the trackers updated in the past 24 hours, whose closes are read as
  approvals. The old approval read listed every tracker ever filed and would
  have failed once per-spell trackers passed 100.
- The newest tracker filed in the past 24 hours is left out of the count: it
  is the limiter's own notice of a spell. Only one, because a tracker is known
  by its title and label, which an agent can give its own issues.
- No tracker is filed once creations reach twice the limit. The agent can close
  a tracker or edit away its title and label so that the next refusal files
  another; each such tracker then counts, so this bounds the trusted path to
  about one allowance of trackers a day. Before, editing the label off the
  tracker had the same effect with no bound.
- A failed read of the open tracker still returns the refusal with its usage
  and expiry, instead of a generic error, and files nothing.
- `_issue.matching` and `canonical` read open records only, since both
  callers now want just that.
- `AGENTS.md` "Issues Tend files" drops the tracker's exception and adds the
  bound for issues an agent can both close and re-trigger.

## Validation

`uv run pytest` passes; new tests cover the count exemption, filing after a
closed tracker, the filing bound and a failed tracker read, and each fails
with its mechanism disabled. An independent Codex review across three rounds
found the close-retry, edit-retry and forged-tracker loops, which the filing
bound now stops. It also found that transferring an issue to another
repository removes it from the count; that holds for every creation, predates
this change, and `docs/security-model.md` now says so.

> _This was written by Claude Code on behalf of max-sixty_

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module docstring in generator/src/tend/runtime/shared/report_failure.py still ends its closed-issue paragraph with "The rate-limit issue takes the opposite policy, for reasons in _issue.py." After this change both callers file a fresh issue once the old one closes, and _issue.py now says so, so that sentence contradicts it. It sits outside the diff, so it can't be an inline suggestion. Dropping it, or rewording it to say the creation limiter shares this lifecycle and also stops filing at twice its limit, would fix it. I can push that if you'd like.

Both callers now file a fresh issue once the old one closes, as _issue.py says.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit a7e7866 into main Nov 21, 2026
13 checks passed
@max-sixty
max-sixty deleted the ci-failure-issue-per-incident branch November 21, 2026 00:53
@max-sixty max-sixty mentioned this pull request Nov 21, 2026
max-sixty added a commit that referenced this pull request Nov 21, 2026
Bumps the generator to 0.3.28, syncs the lockfile, and adds the 0.3.28
changelog section. It ships the 13 commits since 0.3.27, chiefly #1715
and #1716 (a CI failure report and a creation-allowance tracker each
cover one incident and are no longer reopened), #1651 (review approves
only a PR worth merging), #1646 (a wider review duplication check) and
#1713 (poll-pr-checks no longer approves a conflicting head where no CI
ran).

`wt test` and `pre-commit run --all-files` pass on the cut-from commit
a7e7866; #1651 landed after it and is covered in the changelog.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 21, 2026
The creation limiter exists to stop a runaway process creating issues
and PRs by accident. An agent working to get past it would have worse
ways to do harm than filing issues. So this removes the parts that only
stop such an agent, and states that scope in the docs. All `Creation
allowance exhausted` trackers now stay out of the creation count;
before, only the newest filed in the past 24 hours did. A tracker is
filed whenever none is open, with no cap at twice the limit. A
maintainer's close approves more whenever it was made; before, it had to
come after the issue last gained the tracker's title or label.

To weigh: bot and GitHub App closes still approve nothing. That guards
against an accident too, since the refusal used to tell the agent that
"closing it approves more". The refusal now says a maintainer's close
approves more. `docs/security-model.md`, the limiter's docstring,
`_issue.py` and `AGENTS.md`'s "Issues Tend files" section drop the
reasoning about agents forging, editing, closing or transferring
trackers.

Max asked for this after #1716 added those bounds. `uv run pytest` and
pre-commit pass. The three tests of the removed bounds are deleted, and
the tracker-count test now checks that every tracker is left out.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Nov 21, 2026
Regenerates the Tend workflows for tend 0.3.28 (from 0.3.27). The
workflow files change only in their version pins and one header comment
in `tend-ci-failures.yaml`; the behavior changes ship in the bundled
skills and runtime those pins load.

What changes for this repo once merged:

- **Reviews approve only a PR worth merging, not merely a correct one**
(max-sixty/tend#1651). This is the proportionality rule #4869 proposes
dropping from `running-tend` because Tend's review now owns it.
- **No green verdict on a conflicting head with no CI**
(max-sixty/tend#1713). `poll-pr-checks` no longer approves or reports
green when the PR head conflicts with its base and so no checks ran.
- **CI failure reports:** after triage closes a report, the next failure
on that lane files a new report instead of reopening the closed one
(max-sixty/tend#1715). The regenerated header comment in
`tend-ci-failures.yaml` describes this.
- **Creation-allowance trackers:** one tracker per spell of refused
issue/PR creation, and the tracker itself doesn't count against the cap
(max-sixty/tend#1716).
- **Nested instruction files:** sessions read the `AGENTS.md` nearest
the code they edit or review, such as `tests/AGENTS.md`,
`docs/AGENTS.md`, and `plugins/worktrunk/AGENTS.md` here
(max-sixty/tend#1712).
- **Duplication checks:** review now looks wider for duplicated code,
and the nightly survey pairs copies across files (max-sixty/tend#1646).
- **CI waits** stay off `gh event listen`, which newer `gh` suggests to
agents (max-sixty/tend#1708).

Full upstream diff:
[0.3.27...0.3.28](max-sixty/tend@0.3.27...0.3.28)

Co-authored-by: worktrunk-bot <[email protected]>
leaf-agent added a commit to max-sixty/leaf that referenced this pull request Nov 21, 2026
Regenerates the Tend workflows with tend 0.3.28 (from 0.3.27). The YAML
change is only the version pins on the `setup-runtime`, `claude` and
`land` actions and the generated header, plus a reworded comment in
`tend-ci-failures.yaml`. The behavior changes come with the new action
and skill versions:

- **CI failure reports:** after triage closes a report, the next failure
on that lane files a new report instead of reopening the closed one
(max-sixty/tend#1715).
- **Creation allowance:** when the proxy refuses an issue or PR
creation, Tend files one tracker per spell of refusals, and that tracker
doesn't count against the cap (max-sixty/tend#1716).
- **Reviews:** a review approves only a PR worth merging, not one that
is merely correct (max-sixty/tend#1651). The duplication check now looks
wider, and the nightly survey pairs copies across files
(max-sixty/tend#1646).
- **CI polling:** `poll-pr-checks` no longer reports green, or approves,
on a conflicting PR head where no CI ran (max-sixty/tend#1713). CI waits
stay off `gh event listen` (max-sixty/tend#1708).
- **Instructions:** sessions read the nested instruction files
(`AGENTS.md`) for the code they edit or review (max-sixty/tend#1712).

`.config/tend.yaml` pins no model, so no model default changes here.

Full upstream diff:
max-sixty/tend@0.3.27...0.3.28

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants