From 3ad361b11c38aaaefdb2850aa838a4c07cb92d0e Mon Sep 17 00:00:00 2001 From: Cycle Five Date: Fri, 20 Nov 2026 07:25:39 -0500 Subject: [PATCH 01/12] docs: design and plan for work handed over by label Co-Authored-By: Claude & Lothrop (cycle.five@proton.me) --- .../plans/2026-11-20-label-claims.md | 233 ++++++++++++++++++ .../specs/2026-11-20-label-claims-design.md | 172 +++++++++++++ 2 files changed, 405 insertions(+) create mode 100644 docs/superpowers/plans/2026-11-20-label-claims.md create mode 100644 docs/superpowers/specs/2026-11-20-label-claims-design.md diff --git a/docs/superpowers/plans/2026-11-20-label-claims.md b/docs/superpowers/plans/2026-11-20-label-claims.md new file mode 100644 index 0000000..5d35497 --- /dev/null +++ b/docs/superpowers/plans/2026-11-20-label-claims.md @@ -0,0 +1,233 @@ +# Label Claims Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** A GitHub source with a `labels` block mails an agent once when a trusted person labels an item `assigned:` or `review:` anywhere in an organisation, follows that item while the label stays, and writes one closing note when it goes. + +**Architecture:** A new poll target per source, `github::labels:`, handled by a new pure module `crates/logic/src/claims.rs` (`poll_claims`), which searches the organisation, keeps a `ClaimsState` of tracked items, and builds activity records with the same builders the per-repo poll uses. The per-repo poll learns which item numbers are claimed and tags their activity. The worker crate only dispatches. + +**Tech Stack:** Rust (workspace: `crates/logic` pure logic with `pollster` tests and `FakeFeed`; `crates/worker` on `workers-rs`), serde, the existing `FeedClient` trait. + +**Spec:** `docs/superpowers/specs/2026-11-20-label-claims-design.md` + +## Global Constraints + +- Typed serde only: every request and stored shape is a struct or enum deriving `Serialize`/`Deserialize`; no `serde_json::json!`, no `serde_json::Value`. +- Label names are exactly `assigned:` and `review:`. An item counts when it is open and carries `assigned:`, or carries `review:` and is a pull request. +- Trusted labeler: `permission` is `admin` or `write`, or `role_name` is `admin`, `maintain`, `write` or `triage`. A login containing any character outside `A-Z a-z 0-9 -` (every `[bot]` login) is untrusted without a lookup. A 404 from the lookup is untrusted. Any other lookup failure fails the poll. +- Tags, exactly: `routed:assigned`, `routed:review`, `untrusted-label`, `claimed`, `released`. Record ids, exactly: claim `gh::claim:`; closing note `gh::release::`; activity uses the per-repo poll's ids unchanged. +- Titles, exactly: `labeled