clutchwork 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. clutchwork-0.2.1/LICENSE +8 -0
  2. clutchwork-0.2.1/PKG-INFO +118 -0
  3. clutchwork-0.2.1/README.md +106 -0
  4. clutchwork-0.2.1/clutch/__init__.py +1 -0
  5. clutchwork-0.2.1/clutch/__main__.py +1096 -0
  6. clutchwork-0.2.1/clutch/artifacts.py +400 -0
  7. clutchwork-0.2.1/clutch/ask.py +41 -0
  8. clutchwork-0.2.1/clutch/audit.py +143 -0
  9. clutchwork-0.2.1/clutch/author.py +367 -0
  10. clutchwork-0.2.1/clutch/baseline.py +76 -0
  11. clutchwork-0.2.1/clutch/box.py +435 -0
  12. clutchwork-0.2.1/clutch/caps.py +108 -0
  13. clutchwork-0.2.1/clutch/checkpoint.py +141 -0
  14. clutchwork-0.2.1/clutch/config.py +484 -0
  15. clutchwork-0.2.1/clutch/control.py +303 -0
  16. clutchwork-0.2.1/clutch/covgate.py +163 -0
  17. clutchwork-0.2.1/clutch/covmap.py +39 -0
  18. clutchwork-0.2.1/clutch/daemon.py +588 -0
  19. clutchwork-0.2.1/clutch/docs/host-authoring.md +120 -0
  20. clutchwork-0.2.1/clutch/docs/host-contract.md +448 -0
  21. clutchwork-0.2.1/clutch/docs/host-qwen.md +80 -0
  22. clutchwork-0.2.1/clutch/docs/host-running.md +47 -0
  23. clutchwork-0.2.1/clutch/doctor.py +78 -0
  24. clutchwork-0.2.1/clutch/drain.py +747 -0
  25. clutchwork-0.2.1/clutch/driver.py +588 -0
  26. clutchwork-0.2.1/clutch/effects.py +71 -0
  27. clutchwork-0.2.1/clutch/enginelog.py +39 -0
  28. clutchwork-0.2.1/clutch/flake.py +200 -0
  29. clutchwork-0.2.1/clutch/gates.py +174 -0
  30. clutchwork-0.2.1/clutch/git.py +193 -0
  31. clutchwork-0.2.1/clutch/graph.py +99 -0
  32. clutchwork-0.2.1/clutch/heartbeat.py +28 -0
  33. clutchwork-0.2.1/clutch/help.py +239 -0
  34. clutchwork-0.2.1/clutch/hostfiles.py +225 -0
  35. clutchwork-0.2.1/clutch/inbox.py +141 -0
  36. clutchwork-0.2.1/clutch/journal.py +317 -0
  37. clutchwork-0.2.1/clutch/llm.py +94 -0
  38. clutchwork-0.2.1/clutch/llmeffect.py +37 -0
  39. clutchwork-0.2.1/clutch/lockfile.py +144 -0
  40. clutchwork-0.2.1/clutch/merge.py +400 -0
  41. clutchwork-0.2.1/clutch/mergequeue.py +379 -0
  42. clutchwork-0.2.1/clutch/notify.py +145 -0
  43. clutchwork-0.2.1/clutch/observe.py +884 -0
  44. clutchwork-0.2.1/clutch/policy.py +70 -0
  45. clutchwork-0.2.1/clutch/providers.py +831 -0
  46. clutchwork-0.2.1/clutch/qwen-settings.json +1 -0
  47. clutchwork-0.2.1/clutch/reconcile.py +59 -0
  48. clutchwork-0.2.1/clutch/redact.py +30 -0
  49. clutchwork-0.2.1/clutch/requisition.py +307 -0
  50. clutchwork-0.2.1/clutch/restart.py +57 -0
  51. clutchwork-0.2.1/clutch/retro.py +467 -0
  52. clutchwork-0.2.1/clutch/rework.py +277 -0
  53. clutchwork-0.2.1/clutch/runner.py +719 -0
  54. clutchwork-0.2.1/clutch/scheduler.py +88 -0
  55. clutchwork-0.2.1/clutch/scorecard.py +98 -0
  56. clutchwork-0.2.1/clutch/seams.py +267 -0
  57. clutchwork-0.2.1/clutch/serve.py +676 -0
  58. clutchwork-0.2.1/clutch/specs/__init__.py +209 -0
  59. clutchwork-0.2.1/clutch/specs/ask/box.md +4 -0
  60. clutchwork-0.2.1/clutch/specs/ask/diagnose.md +1 -0
  61. clutchwork-0.2.1/clutch/specs/ask/drafts.md +8 -0
  62. clutchwork-0.2.1/clutch/specs/ask/drain-loop.md +32 -0
  63. clutchwork-0.2.1/clutch/specs/ask/review.md +1 -0
  64. clutchwork-0.2.1/clutch/specs/ask/running.md +1 -0
  65. clutchwork-0.2.1/clutch/specs/author.md +63 -0
  66. clutchwork-0.2.1/clutch/specs/diagnose.md +73 -0
  67. clutchwork-0.2.1/clutch/specs/implement.md +142 -0
  68. clutchwork-0.2.1/clutch/specs/requisition_review.md +109 -0
  69. clutchwork-0.2.1/clutch/specs/retro.md +64 -0
  70. clutchwork-0.2.1/clutch/specs/review.md +118 -0
  71. clutchwork-0.2.1/clutch/specs/rework.md +90 -0
  72. clutchwork-0.2.1/clutch/specs/triage.md +65 -0
  73. clutchwork-0.2.1/clutch/stages.py +1606 -0
  74. clutchwork-0.2.1/clutch/stats.py +218 -0
  75. clutchwork-0.2.1/clutch/status.py +284 -0
  76. clutchwork-0.2.1/clutch/storm.py +188 -0
  77. clutchwork-0.2.1/clutch/testguard.py +96 -0
  78. clutchwork-0.2.1/clutch/testreport.py +84 -0
  79. clutchwork-0.2.1/clutch/thresh.py +258 -0
  80. clutchwork-0.2.1/clutch/tickets.py +826 -0
  81. clutchwork-0.2.1/clutch/timers.py +125 -0
  82. clutchwork-0.2.1/clutch/triage.py +372 -0
  83. clutchwork-0.2.1/clutch/watchdog.py +262 -0
  84. clutchwork-0.2.1/clutch/watcher.py +87 -0
  85. clutchwork-0.2.1/pyproject.toml +66 -0
@@ -0,0 +1,8 @@
1
+ Copyright (c) 2026 Richard Protus. All rights reserved.
2
+
3
+ You may install and use this software. You may not copy, modify,
4
+ redistribute, or sublicense it.
5
+
6
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. IN NO
7
+ EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
8
+ LIABILITY ARISING FROM ITS USE.
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: clutchwork
3
+ Version: 0.2.1
4
+ Summary: Continuously running orchestration engine that authors and runs tickets against host repos.
5
+ License-Expression: LicenseRef-Proprietary
6
+ License-File: LICENSE
7
+ Requires-Dist: pydantic>=2.13.5
8
+ Requires-Dist: pyyaml>=6.0.3
9
+ Requires-Python: >=3.14
10
+ Project-URL: Repository, https://github.com/protus75/clutchwork
11
+ Description-Content-Type: text/markdown
12
+
13
+ # ClutchWork
14
+
15
+ *CLI Lifecycle for Unattended Ticket-Chewing Hatchlings*
16
+
17
+ ClutchWork is an engine that runs CLI coding agents through the ticket lifecycle against a git repository. Each ticket lives in `tickets/<stem>/`; its markdown and JSON files, including `ticket.md`, `run.md`, `review.md`, `diagnosis.json`, and others, pass work between stages. Reviewed work merges to local `main`. See the [ticket lifecycle diagram](https://github.com/protus75/clutchwork/blob/main/vscode-clutchwork/media/ticket-lifecycle.svg).
18
+
19
+ [GitHub repository](https://github.com/protus75/clutchwork)
20
+
21
+ ## Install
22
+
23
+ Add clutch to your host project and sync its environment:
24
+
25
+ ```sh
26
+ uv add --dev clutch
27
+ uv sync
28
+ ```
29
+
30
+ Install the provider CLIs you route with `uv run clutch install claude codex` (pnpm dev dependencies under `node_modules/.bin`; a CLI already on `PATH` works without it).
31
+
32
+ Run its verbs as `uv run clutch <verb>`. Your host also needs `config.yaml`; start with the [copyable configuration](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-contract.md), or create one with `uv run clutch init-config --write` from the CLIs you installed.
33
+
34
+ ## Set up a host
35
+
36
+ Run `uv run clutch doctor`, then `uv run clutch core` to write the managed conduct block into `CLAUDE.md` for Claude and Qwen Code or `AGENTS.md` for other CLIs. Commit the files. The block gives a chat agent rules for authoring and editing tickets with `clutch new`, `clutch lint`, and `clutch review`, and for supervising a drain. Re-run `core` after upgrading clutch: `drain`, `serve`, and `run` refuse to start while the block is stale.
37
+
38
+ ## The working loop
39
+
40
+ 1. Open Claude Code or Codex in the host checkout, often with auto permissions.
41
+ 2. Work out a plan with the chat agent.
42
+ 3. Ask it to turn the plan into tickets. It runs `clutch new`, fills each ticket, and repeats `clutch lint` and `clutch review` until each is clean.
43
+ 4. Ask it to drain the queue with `uv run clutch drain`, or leave `uv run clutch serve` running to pick up new tickets live. clutch coordinates CLI agents through authoring, implementation, checking, review, and merge.
44
+ 5. Ask the chat agent to supervise: watch `clutch status` and `clutch watch`, diagnose rejected or blocked tickets from their `tickets/<stem>/` artifacts, fix small ticket problems, and stop with `clutch stop` or `clutch kill` and restart the drain as needed.
45
+ 6. Use the Suggestion Box as an escape valve. An implementing agent reports second problems in its `second_problems` reply, and the engine files them to the box so the ticket can complete its own goal. Runs that exhaust attempt caps, retros, and `clutch suggest` from a chat session also file there. Triage resolves each message as `declined`, `tombstone` (already covered), or authored into a ticket; an authored ticket can start as a `draft` awaiting a person.
46
+ 7. Keep the judgment calls: ask the chat agent for a plain-English summary of each draft or held ticket, then run `clutch confirm` or `clutch reject` on each.
47
+
48
+ In clutch's own repository history, measured on 2026-11-09 from `.clutch/state/box/` and the journal, 32 of 389 Suggestion Box messages (about 8%) became tickets, all as drafts. Of the 31 drafts decided, 24 were confirmed (about 77%) and 7 rejected.
49
+
50
+ One unattended drain ran about 30 tickets in about 4 hours, many of them triage-authored bug fixes and small features. The practical limit is how fast a person can plan enough work to fill the queue, so planning sessions with the chat agent are where the person spends their time.
51
+
52
+ For example, ask your chat agent:
53
+
54
+ - “Help me plan this feature and turn the plan into clutch tickets.”
55
+ - “Drain the queue and supervise any held tickets.”
56
+ - “Summarize the drafts in plain English so I can decide which to confirm.”
57
+
58
+ ## Commands
59
+
60
+ ```sh
61
+ # Setup
62
+ uv run clutch init-config # print a suggested config.yaml
63
+ uv run clutch install # install provider CLIs into the host
64
+ uv run clutch update-config # list current model names per provider
65
+ uv run clutch doctor # inspect host setup
66
+ uv run clutch core # refresh managed conduct files
67
+ # Authoring
68
+ uv run clutch new # create and lint a ticket skeleton
69
+ uv run clutch lint # validate tickets without writing
70
+ uv run clutch review # review a committed ticket
71
+ uv run clutch order # edit ticket priority or ordering
72
+ uv run clutch suggest # file an idea into the Suggestion Box
73
+ # Running
74
+ uv run clutch drain # run eligible tickets to quiescence
75
+ uv run clutch serve # run the continuous daemon
76
+ uv run clutch run # run one ticket through the pipeline
77
+ uv run clutch stop # finish active work and exit
78
+ uv run clutch kill # stop the engine at a safe point
79
+ uv run clutch pause # ask the engine to pause admission
80
+ uv run clutch resume # ask the engine to release its current hold
81
+ # Observing
82
+ uv run clutch status # show the journal projection
83
+ uv run clutch watch # show the live text view
84
+ uv run clutch stats # show health and efficiency figures
85
+ # Decisions
86
+ uv run clutch confirm # confirm a draft or Reject item
87
+ uv run clutch reject # reject a draft or Reject item
88
+ ```
89
+
90
+ Stop `serve` before `drain` or `run`: each takes the writer lock. See the [host run guide](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-running.md) for every verb.
91
+
92
+ ## VS Code extension
93
+
94
+ The [clutch tickets extension](https://marketplace.visualstudio.com/items?itemName=chunkydragon.vscode-clutchwork) (`chunkydragon.vscode-clutchwork`) shows the ticket graph, details, recent steps, Suggestion Box, and stats. Set `clutch.command` when the engine command differs from the default host `.venv/bin/clutch`.
95
+
96
+ ## Docs
97
+
98
+ - [Host run guide](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-running.md): invocation and operation on a host.
99
+ - [Host ticket authoring](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-authoring.md): what to write in a ticket.
100
+ - [Host contract](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-contract.md): the config schema and host-facing contract.
101
+ - [How clutch works](https://github.com/protus75/clutchwork/blob/main/docs/how-clutch-works.md): how clutch behaves today. Tickets keep it current.
102
+
103
+ ## Developing clutch
104
+
105
+ This section is for working on clutch itself. In this repo, run engine verbs with `uv run clutch` and tests with `./dev.py`:
106
+
107
+ uv run clutch new STEM [--kind feature|bug|chore] [--evidence FILE...] # write a ticket skeleton
108
+ uv run clutch lint [STEM...] # check tickets
109
+ uv run clutch review STEM... # review tickets against merged code
110
+ uv run clutch drain # run every eligible ticket to quiescence
111
+ uv run clutch status # what ran, what is held, total spend
112
+ uv run clutch confirm STEM / uv run clutch reject STEM # keep or kill a held ticket
113
+ uv run clutch kill # stop a running drain
114
+ ./dev.py test [args] # run the test suite
115
+
116
+ `CLUTCH_PLAN.md` is the frozen record of how clutch was first built. It is history, not a reference.
117
+
118
+ Every clutch verb is listed in [how clutch works, section 2](https://github.com/protus75/clutchwork/blob/main/docs/how-clutch-works.md#2-commands).
@@ -0,0 +1,106 @@
1
+ # ClutchWork
2
+
3
+ *CLI Lifecycle for Unattended Ticket-Chewing Hatchlings*
4
+
5
+ ClutchWork is an engine that runs CLI coding agents through the ticket lifecycle against a git repository. Each ticket lives in `tickets/<stem>/`; its markdown and JSON files, including `ticket.md`, `run.md`, `review.md`, `diagnosis.json`, and others, pass work between stages. Reviewed work merges to local `main`. See the [ticket lifecycle diagram](https://github.com/protus75/clutchwork/blob/main/vscode-clutchwork/media/ticket-lifecycle.svg).
6
+
7
+ [GitHub repository](https://github.com/protus75/clutchwork)
8
+
9
+ ## Install
10
+
11
+ Add clutch to your host project and sync its environment:
12
+
13
+ ```sh
14
+ uv add --dev clutch
15
+ uv sync
16
+ ```
17
+
18
+ Install the provider CLIs you route with `uv run clutch install claude codex` (pnpm dev dependencies under `node_modules/.bin`; a CLI already on `PATH` works without it).
19
+
20
+ Run its verbs as `uv run clutch <verb>`. Your host also needs `config.yaml`; start with the [copyable configuration](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-contract.md), or create one with `uv run clutch init-config --write` from the CLIs you installed.
21
+
22
+ ## Set up a host
23
+
24
+ Run `uv run clutch doctor`, then `uv run clutch core` to write the managed conduct block into `CLAUDE.md` for Claude and Qwen Code or `AGENTS.md` for other CLIs. Commit the files. The block gives a chat agent rules for authoring and editing tickets with `clutch new`, `clutch lint`, and `clutch review`, and for supervising a drain. Re-run `core` after upgrading clutch: `drain`, `serve`, and `run` refuse to start while the block is stale.
25
+
26
+ ## The working loop
27
+
28
+ 1. Open Claude Code or Codex in the host checkout, often with auto permissions.
29
+ 2. Work out a plan with the chat agent.
30
+ 3. Ask it to turn the plan into tickets. It runs `clutch new`, fills each ticket, and repeats `clutch lint` and `clutch review` until each is clean.
31
+ 4. Ask it to drain the queue with `uv run clutch drain`, or leave `uv run clutch serve` running to pick up new tickets live. clutch coordinates CLI agents through authoring, implementation, checking, review, and merge.
32
+ 5. Ask the chat agent to supervise: watch `clutch status` and `clutch watch`, diagnose rejected or blocked tickets from their `tickets/<stem>/` artifacts, fix small ticket problems, and stop with `clutch stop` or `clutch kill` and restart the drain as needed.
33
+ 6. Use the Suggestion Box as an escape valve. An implementing agent reports second problems in its `second_problems` reply, and the engine files them to the box so the ticket can complete its own goal. Runs that exhaust attempt caps, retros, and `clutch suggest` from a chat session also file there. Triage resolves each message as `declined`, `tombstone` (already covered), or authored into a ticket; an authored ticket can start as a `draft` awaiting a person.
34
+ 7. Keep the judgment calls: ask the chat agent for a plain-English summary of each draft or held ticket, then run `clutch confirm` or `clutch reject` on each.
35
+
36
+ In clutch's own repository history, measured on 2026-11-09 from `.clutch/state/box/` and the journal, 32 of 389 Suggestion Box messages (about 8%) became tickets, all as drafts. Of the 31 drafts decided, 24 were confirmed (about 77%) and 7 rejected.
37
+
38
+ One unattended drain ran about 30 tickets in about 4 hours, many of them triage-authored bug fixes and small features. The practical limit is how fast a person can plan enough work to fill the queue, so planning sessions with the chat agent are where the person spends their time.
39
+
40
+ For example, ask your chat agent:
41
+
42
+ - “Help me plan this feature and turn the plan into clutch tickets.”
43
+ - “Drain the queue and supervise any held tickets.”
44
+ - “Summarize the drafts in plain English so I can decide which to confirm.”
45
+
46
+ ## Commands
47
+
48
+ ```sh
49
+ # Setup
50
+ uv run clutch init-config # print a suggested config.yaml
51
+ uv run clutch install # install provider CLIs into the host
52
+ uv run clutch update-config # list current model names per provider
53
+ uv run clutch doctor # inspect host setup
54
+ uv run clutch core # refresh managed conduct files
55
+ # Authoring
56
+ uv run clutch new # create and lint a ticket skeleton
57
+ uv run clutch lint # validate tickets without writing
58
+ uv run clutch review # review a committed ticket
59
+ uv run clutch order # edit ticket priority or ordering
60
+ uv run clutch suggest # file an idea into the Suggestion Box
61
+ # Running
62
+ uv run clutch drain # run eligible tickets to quiescence
63
+ uv run clutch serve # run the continuous daemon
64
+ uv run clutch run # run one ticket through the pipeline
65
+ uv run clutch stop # finish active work and exit
66
+ uv run clutch kill # stop the engine at a safe point
67
+ uv run clutch pause # ask the engine to pause admission
68
+ uv run clutch resume # ask the engine to release its current hold
69
+ # Observing
70
+ uv run clutch status # show the journal projection
71
+ uv run clutch watch # show the live text view
72
+ uv run clutch stats # show health and efficiency figures
73
+ # Decisions
74
+ uv run clutch confirm # confirm a draft or Reject item
75
+ uv run clutch reject # reject a draft or Reject item
76
+ ```
77
+
78
+ Stop `serve` before `drain` or `run`: each takes the writer lock. See the [host run guide](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-running.md) for every verb.
79
+
80
+ ## VS Code extension
81
+
82
+ The [clutch tickets extension](https://marketplace.visualstudio.com/items?itemName=chunkydragon.vscode-clutchwork) (`chunkydragon.vscode-clutchwork`) shows the ticket graph, details, recent steps, Suggestion Box, and stats. Set `clutch.command` when the engine command differs from the default host `.venv/bin/clutch`.
83
+
84
+ ## Docs
85
+
86
+ - [Host run guide](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-running.md): invocation and operation on a host.
87
+ - [Host ticket authoring](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-authoring.md): what to write in a ticket.
88
+ - [Host contract](https://github.com/protus75/clutchwork/blob/main/clutch/docs/host-contract.md): the config schema and host-facing contract.
89
+ - [How clutch works](https://github.com/protus75/clutchwork/blob/main/docs/how-clutch-works.md): how clutch behaves today. Tickets keep it current.
90
+
91
+ ## Developing clutch
92
+
93
+ This section is for working on clutch itself. In this repo, run engine verbs with `uv run clutch` and tests with `./dev.py`:
94
+
95
+ uv run clutch new STEM [--kind feature|bug|chore] [--evidence FILE...] # write a ticket skeleton
96
+ uv run clutch lint [STEM...] # check tickets
97
+ uv run clutch review STEM... # review tickets against merged code
98
+ uv run clutch drain # run every eligible ticket to quiescence
99
+ uv run clutch status # what ran, what is held, total spend
100
+ uv run clutch confirm STEM / uv run clutch reject STEM # keep or kill a held ticket
101
+ uv run clutch kill # stop a running drain
102
+ ./dev.py test [args] # run the test suite
103
+
104
+ `CLUTCH_PLAN.md` is the frozen record of how clutch was first built. It is history, not a reference.
105
+
106
+ Every clutch verb is listed in [how clutch works, section 2](https://github.com/protus75/clutchwork/blob/main/docs/how-clutch-works.md#2-commands).
@@ -0,0 +1 @@
1
+ """clutch: orchestration engine that authors and runs tickets against host repos."""