Skip to content

ci(controller): wake on the issue label and edit events - #1211

Draft
HugoXK wants to merge 5 commits into
mainfrom
agent/controller-issue-events
Draft

HugoXK wants to merge 5 commits into
mainfrom
agent/controller-issue-events

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1209.

What changed

The controller's demotion half — removing agent-ready/agent-working when a non-maintainer labels an issue or edits it after the approval — had no event trigger, so it was read only at the next cron tick.

  • .github/workflows/controller.yml adds issues: types: [labeled, unlabeled, edited] next to the existing pull_request (opened/ready_for_review/reopened), schedule and workflow_dispatch. The comment above on: states why, with the measured gap.
  • AGENTS.md (Controller section) names the new events beside the pull_request ones, so the documented trigger set matches the file.
  • tests/test_process_controller.py: test_workflow_shape now pins all four trigger names and each types list, with the measurement in the failure message, so deleting any one goes red.
  • changelog.d/1209-controller-issue-events.md records the change.

Loop safety: the controller never labels an issue itself, and a run with an empty op list does not go live, so the run its own removal triggers plans nothing.

Unchanged: top-level permissions: {}; plan stays read-only (contents: read, issues: read, pull-requests: read); apply stays exactly contents: read, issues: write, pull-requests: write; both jobs pin ref: ${{ github.event.repository.default_branch }}; no pull_request_target, no secrets. The fork guard is untouched, so a pull_request run from a fork head is still skipped in both jobs.

Why it matters

controller workflow (389438252) schedule runs, read from the Actions API on 2026-11-21 (Date: Sat, 21 Nov 2026 17:29:45 GMT):

44585017192 2026-11-19T18:10:45Z -> 44702560012 2026-11-20T08:26:34Z   14 h 15 m 49 s
44781238123 2026-11-20T17:13:41Z -> 44879547993 2026-11-21T07:17:23Z   14 h 03 m 42 s

A voided approval stayed usable for that whole window. This change reads the voiding event in the same minute.

Verification at the tip

Red at 1aa816e0 (live main) with only this tip's tests/test_process_controller.py copied in:

pytest -o addopts="" -q tests/test_process_controller.py
-> 1 failed, 32 passed
FAILED tests/test_process_controller.py::test_workflow_shape
AssertionError: assert {'pull_request', 'schedule', 'workflow_dispatch'} == {..., 'issues', ...}

At this tip:

pytest -o addopts="" -q tests/test_process_controller.py   -> 33 passed
pytest -o addopts="" -q tests/test_process_*.py            -> 88 passed
python -m tools.changelog_fragments check                  -> 15 changelog fragment(s) OK

Full pytest -q here: not run. tests/test_docs_links.py:11 imports Python-Markdown
(markdown_it is installed, Python-Markdown is not), so collection stops before the suite;
no docker in this box either. CI is the line for the full matrix.

Not run: mkdocs build --strict -- no page or nav change (AGENTS.md is repository-root, outside the docs tree).

Tip SHA: 334e4d6

HugoXK and others added 5 commits November 21, 2026 01:40
The demotion half of the controller had no event trigger: a label set by a
non-maintainer, or an edit after the approval, was only read at the next cron
tick. Measured on this repository: the schedule skipped 14 h 16 min once
(19 Nov 18:10 -> 20 Nov 08:26 UTC), so an approval someone had just voided
stayed usable for that window.

Adding issues labeled/unlabeled/edited cannot loop: the controller never labels
an issue itself, and the run its own removal triggers plans nothing.
@HugoXK HugoXK changed the title ci(controller): wake on the issue label and edit events (#1209) ci(controller): wake on the issue label and edit events Nov 21, 2026

This branch has not been deployed

No deployments
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.

fix(controller): a voided approval waits for the next cron tick

1 participant