chewcw-work-queue 0.3.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 chew cw
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,138 @@
1
+ Metadata-Version: 2.4
2
+ Name: chewcw-work-queue
3
+ Version: 0.3.0
4
+ Summary: One script that owns every GitHub label write for the agent work queue
5
+ Author: chew cw
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/chewcw/skills/tree/main/dev-tools/work-queue
8
+ Project-URL: Repository, https://github.com/chewcw/skills
9
+ Project-URL: Issues, https://github.com/chewcw/skills/issues
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Environment :: Console
12
+ Classifier: Topic :: Software Development :: Bug Tracking
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Dynamic: license-file
17
+
18
+ # work-queue
19
+
20
+ The one place that writes a GitHub label for the agent queue. Python 3, standard library only,
21
+ `gh` as the transport, no third-party dependency.
22
+
23
+ ## Install
24
+
25
+ From a checkout, without installing anything:
26
+
27
+ bin/work-queue --version
28
+
29
+ As a command on `PATH`, editable, so a checkout edit takes effect immediately:
30
+
31
+ uv tool install --editable ./work-queue
32
+
33
+ From a private or public remote, with no release needed:
34
+
35
+ uv tool install "git+ssh://git@github.com/<owner>/dev-tools.git#subdirectory=work-queue"
36
+
37
+ Pin a tag or a commit when you need a fixed version. The ref goes after the repository and
38
+ before the fragment:
39
+
40
+ uv tool install "git+ssh://git@github.com/<owner>/dev-tools.git@work-queue-v0.2.0#subdirectory=work-queue"
41
+
42
+ `pipx install .` works the same way if you prefer pipx.
43
+
44
+ `uv tool install` writes its shim to `~/.local/bin`. If a non-interactive shell cannot find
45
+ `work-queue`, that directory is the reason — it has to be on `PATH`.
46
+
47
+ ### Without installing anything
48
+
49
+ `uvx` runs the tool in a throwaway environment, the way `npx` does:
50
+
51
+ uvx --from "git+ssh://git@github.com/<owner>/dev-tools.git@work-queue-v0.2.0#subdirectory=work-queue" work-queue docs
52
+
53
+ It is the right form for a one-off. It is the wrong form for the queue itself, which is called
54
+ dozens of times per session and whose gates must not change between two calls: an unpinned `uvx`
55
+ gives you whatever the machine cached, so the gate that refuses a move may not be the one the
56
+ skill described.
57
+
58
+ The tool drives `gh`, so `gh` must be installed and authenticated. Every command that writes exits
59
+ 2 with the reason when it is not.
60
+
61
+ ## Commands
62
+
63
+ work-queue docs print the pipeline reference: labels, rules, gates
64
+ work-queue init create or repair the label vocabulary
65
+ work-queue list --stage LABEL open issues at that rung, frontier only
66
+ work-queue claim --stage LABEL take one item, print its artefact
67
+ work-queue record --issue N --artefact PATH name the file a claim produced
68
+ work-queue kind --issue N --to kind:bug|kind:feature|kind:task
69
+ work-queue move --issue N --to LABEL
70
+ work-queue park --issue N --to human:triage|human:info --reason TEXT
71
+ work-queue close --issue N --reason done|wontfix|dup|deferred
72
+ work-queue reopen --issue N --reason TEXT
73
+ work-queue icebox deferred work, one line per issue
74
+ work-queue verify drift, one line per finding
75
+ work-queue reconcile repair drift from the artefacts
76
+ work-queue triage --issue N context for the router; decides nothing
77
+ work-queue promote --file F turn an inbox capture into an issue
78
+ work-queue migrate --map FILE one-shot old->new label mapping
79
+
80
+ Exit codes: 0 ok, 1 refused (gate or lost claim), 2 gh missing, not authenticated, or no repo
81
+ resolved, 3 a label did not land or drift was found.
82
+
83
+ The vocabulary is not repeated here. `work-queue docs` is the single description of it, and it
84
+ ships inside the package so an installed copy can print it.
85
+
86
+ ## Installing into a repo
87
+
88
+ Once per target repo:
89
+
90
+ work-queue init
91
+
92
+ Then copy `assets/triage-label.yml` to `.github/workflows/triage-label.yml` in the target repo.
93
+ It is the fail-closed step: every issue opened without an `agent:` or `human:` label gets
94
+ `human:triage`, so nothing unvetted can be built. Issues created already labelled are left alone.
95
+
96
+ ## Configuration
97
+
98
+ | Variable | Default | What it changes |
99
+ |---|---|---|
100
+ | `GH_REPO` | the repo `gh` resolves | which repo is operated on |
101
+ | `QUEUE_MAX_ISSUES` | `800` | page size, and when the truncation warning fires |
102
+ | `QUEUE_SPECS_DIR` | `.ai/specs` | where spec files live |
103
+ | `QUEUE_PLANS_DIR` | `.ai/plans` | where plan directories live |
104
+ | `QUEUE_PLAN_INDEX` | `00-index.md` | the plan index filename |
105
+ | `QUEUE_SEAL_FILE` | `SEAL.sha256` | the seal filename |
106
+ | `QUEUE_SEAL_TOOL` | detected | override the sha tool used to verify a seal |
107
+ | `QUEUE_INBOX_DIR` | `.ai/inbox` | where un-tracked captures wait |
108
+ | `QUEUE_EXTRA_LABELS` | empty | comma-separated labels the repo already uses |
109
+
110
+ The seal check uses `sha256sum` when it exists and `shasum -a 256` otherwise, so a macOS machine
111
+ can verify a plan.
112
+
113
+ ## Drift
114
+
115
+ `verify` reports V1–V12; `reconcile` repairs what needs no human judgement. A missing `kind:` is
116
+ reported and never guessed, because deciding what the work is takes a person.
117
+
118
+ ## Testing
119
+
120
+ tests/test.sh
121
+
122
+ Self-contained: it builds a scratch repo and a fake `gh`, asserts on printed output and exit codes,
123
+ and touches no network. Needs `bash`, `python3` and `jq`.
124
+
125
+ ## Releasing
126
+
127
+ 1. Bump `__version__` in `work_queue/__init__.py`. That is the only place the version lives;
128
+ `pyproject.toml` reads it from there.
129
+ 2. Commit, then tag that commit with the tool's name in front:
130
+ `git tag work-queue-v<version> && git push origin work-queue-v<version>`.
131
+ 3. No release artifact is needed:
132
+ `pipx install "git+https://…/dev-tools.git@work-queue-v<version>#subdirectory=work-queue"`
133
+ resolves the tag.
134
+
135
+ Tags are per tool, never per repo: a second tool at its own `0.1.0` gets `other-tool-v0.1.0`, and
136
+ neither tag blocks the other. The prefix must match the tool's directory name, and the version in
137
+ the tag must match `__version__` — a tag is also the integrity check, because a commit cannot
138
+ change.
@@ -0,0 +1,121 @@
1
+ # work-queue
2
+
3
+ The one place that writes a GitHub label for the agent queue. Python 3, standard library only,
4
+ `gh` as the transport, no third-party dependency.
5
+
6
+ ## Install
7
+
8
+ From a checkout, without installing anything:
9
+
10
+ bin/work-queue --version
11
+
12
+ As a command on `PATH`, editable, so a checkout edit takes effect immediately:
13
+
14
+ uv tool install --editable ./work-queue
15
+
16
+ From a private or public remote, with no release needed:
17
+
18
+ uv tool install "git+ssh://git@github.com/<owner>/dev-tools.git#subdirectory=work-queue"
19
+
20
+ Pin a tag or a commit when you need a fixed version. The ref goes after the repository and
21
+ before the fragment:
22
+
23
+ uv tool install "git+ssh://git@github.com/<owner>/dev-tools.git@work-queue-v0.2.0#subdirectory=work-queue"
24
+
25
+ `pipx install .` works the same way if you prefer pipx.
26
+
27
+ `uv tool install` writes its shim to `~/.local/bin`. If a non-interactive shell cannot find
28
+ `work-queue`, that directory is the reason — it has to be on `PATH`.
29
+
30
+ ### Without installing anything
31
+
32
+ `uvx` runs the tool in a throwaway environment, the way `npx` does:
33
+
34
+ uvx --from "git+ssh://git@github.com/<owner>/dev-tools.git@work-queue-v0.2.0#subdirectory=work-queue" work-queue docs
35
+
36
+ It is the right form for a one-off. It is the wrong form for the queue itself, which is called
37
+ dozens of times per session and whose gates must not change between two calls: an unpinned `uvx`
38
+ gives you whatever the machine cached, so the gate that refuses a move may not be the one the
39
+ skill described.
40
+
41
+ The tool drives `gh`, so `gh` must be installed and authenticated. Every command that writes exits
42
+ 2 with the reason when it is not.
43
+
44
+ ## Commands
45
+
46
+ work-queue docs print the pipeline reference: labels, rules, gates
47
+ work-queue init create or repair the label vocabulary
48
+ work-queue list --stage LABEL open issues at that rung, frontier only
49
+ work-queue claim --stage LABEL take one item, print its artefact
50
+ work-queue record --issue N --artefact PATH name the file a claim produced
51
+ work-queue kind --issue N --to kind:bug|kind:feature|kind:task
52
+ work-queue move --issue N --to LABEL
53
+ work-queue park --issue N --to human:triage|human:info --reason TEXT
54
+ work-queue close --issue N --reason done|wontfix|dup|deferred
55
+ work-queue reopen --issue N --reason TEXT
56
+ work-queue icebox deferred work, one line per issue
57
+ work-queue verify drift, one line per finding
58
+ work-queue reconcile repair drift from the artefacts
59
+ work-queue triage --issue N context for the router; decides nothing
60
+ work-queue promote --file F turn an inbox capture into an issue
61
+ work-queue migrate --map FILE one-shot old->new label mapping
62
+
63
+ Exit codes: 0 ok, 1 refused (gate or lost claim), 2 gh missing, not authenticated, or no repo
64
+ resolved, 3 a label did not land or drift was found.
65
+
66
+ The vocabulary is not repeated here. `work-queue docs` is the single description of it, and it
67
+ ships inside the package so an installed copy can print it.
68
+
69
+ ## Installing into a repo
70
+
71
+ Once per target repo:
72
+
73
+ work-queue init
74
+
75
+ Then copy `assets/triage-label.yml` to `.github/workflows/triage-label.yml` in the target repo.
76
+ It is the fail-closed step: every issue opened without an `agent:` or `human:` label gets
77
+ `human:triage`, so nothing unvetted can be built. Issues created already labelled are left alone.
78
+
79
+ ## Configuration
80
+
81
+ | Variable | Default | What it changes |
82
+ |---|---|---|
83
+ | `GH_REPO` | the repo `gh` resolves | which repo is operated on |
84
+ | `QUEUE_MAX_ISSUES` | `800` | page size, and when the truncation warning fires |
85
+ | `QUEUE_SPECS_DIR` | `.ai/specs` | where spec files live |
86
+ | `QUEUE_PLANS_DIR` | `.ai/plans` | where plan directories live |
87
+ | `QUEUE_PLAN_INDEX` | `00-index.md` | the plan index filename |
88
+ | `QUEUE_SEAL_FILE` | `SEAL.sha256` | the seal filename |
89
+ | `QUEUE_SEAL_TOOL` | detected | override the sha tool used to verify a seal |
90
+ | `QUEUE_INBOX_DIR` | `.ai/inbox` | where un-tracked captures wait |
91
+ | `QUEUE_EXTRA_LABELS` | empty | comma-separated labels the repo already uses |
92
+
93
+ The seal check uses `sha256sum` when it exists and `shasum -a 256` otherwise, so a macOS machine
94
+ can verify a plan.
95
+
96
+ ## Drift
97
+
98
+ `verify` reports V1–V12; `reconcile` repairs what needs no human judgement. A missing `kind:` is
99
+ reported and never guessed, because deciding what the work is takes a person.
100
+
101
+ ## Testing
102
+
103
+ tests/test.sh
104
+
105
+ Self-contained: it builds a scratch repo and a fake `gh`, asserts on printed output and exit codes,
106
+ and touches no network. Needs `bash`, `python3` and `jq`.
107
+
108
+ ## Releasing
109
+
110
+ 1. Bump `__version__` in `work_queue/__init__.py`. That is the only place the version lives;
111
+ `pyproject.toml` reads it from there.
112
+ 2. Commit, then tag that commit with the tool's name in front:
113
+ `git tag work-queue-v<version> && git push origin work-queue-v<version>`.
114
+ 3. No release artifact is needed:
115
+ `pipx install "git+https://…/dev-tools.git@work-queue-v<version>#subdirectory=work-queue"`
116
+ resolves the tag.
117
+
118
+ Tags are per tool, never per repo: a second tool at its own `0.1.0` gets `other-tool-v0.1.0`, and
119
+ neither tag blocks the other. The prefix must match the tool's directory name, and the version in
120
+ the tag must match `__version__` — a tag is also the integrity check, because a commit cannot
121
+ change.
@@ -0,0 +1,138 @@
1
+ Metadata-Version: 2.4
2
+ Name: chewcw-work-queue
3
+ Version: 0.3.0
4
+ Summary: One script that owns every GitHub label write for the agent work queue
5
+ Author: chew cw
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/chewcw/skills/tree/main/dev-tools/work-queue
8
+ Project-URL: Repository, https://github.com/chewcw/skills
9
+ Project-URL: Issues, https://github.com/chewcw/skills/issues
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Environment :: Console
12
+ Classifier: Topic :: Software Development :: Bug Tracking
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Dynamic: license-file
17
+
18
+ # work-queue
19
+
20
+ The one place that writes a GitHub label for the agent queue. Python 3, standard library only,
21
+ `gh` as the transport, no third-party dependency.
22
+
23
+ ## Install
24
+
25
+ From a checkout, without installing anything:
26
+
27
+ bin/work-queue --version
28
+
29
+ As a command on `PATH`, editable, so a checkout edit takes effect immediately:
30
+
31
+ uv tool install --editable ./work-queue
32
+
33
+ From a private or public remote, with no release needed:
34
+
35
+ uv tool install "git+ssh://git@github.com/<owner>/dev-tools.git#subdirectory=work-queue"
36
+
37
+ Pin a tag or a commit when you need a fixed version. The ref goes after the repository and
38
+ before the fragment:
39
+
40
+ uv tool install "git+ssh://git@github.com/<owner>/dev-tools.git@work-queue-v0.2.0#subdirectory=work-queue"
41
+
42
+ `pipx install .` works the same way if you prefer pipx.
43
+
44
+ `uv tool install` writes its shim to `~/.local/bin`. If a non-interactive shell cannot find
45
+ `work-queue`, that directory is the reason — it has to be on `PATH`.
46
+
47
+ ### Without installing anything
48
+
49
+ `uvx` runs the tool in a throwaway environment, the way `npx` does:
50
+
51
+ uvx --from "git+ssh://git@github.com/<owner>/dev-tools.git@work-queue-v0.2.0#subdirectory=work-queue" work-queue docs
52
+
53
+ It is the right form for a one-off. It is the wrong form for the queue itself, which is called
54
+ dozens of times per session and whose gates must not change between two calls: an unpinned `uvx`
55
+ gives you whatever the machine cached, so the gate that refuses a move may not be the one the
56
+ skill described.
57
+
58
+ The tool drives `gh`, so `gh` must be installed and authenticated. Every command that writes exits
59
+ 2 with the reason when it is not.
60
+
61
+ ## Commands
62
+
63
+ work-queue docs print the pipeline reference: labels, rules, gates
64
+ work-queue init create or repair the label vocabulary
65
+ work-queue list --stage LABEL open issues at that rung, frontier only
66
+ work-queue claim --stage LABEL take one item, print its artefact
67
+ work-queue record --issue N --artefact PATH name the file a claim produced
68
+ work-queue kind --issue N --to kind:bug|kind:feature|kind:task
69
+ work-queue move --issue N --to LABEL
70
+ work-queue park --issue N --to human:triage|human:info --reason TEXT
71
+ work-queue close --issue N --reason done|wontfix|dup|deferred
72
+ work-queue reopen --issue N --reason TEXT
73
+ work-queue icebox deferred work, one line per issue
74
+ work-queue verify drift, one line per finding
75
+ work-queue reconcile repair drift from the artefacts
76
+ work-queue triage --issue N context for the router; decides nothing
77
+ work-queue promote --file F turn an inbox capture into an issue
78
+ work-queue migrate --map FILE one-shot old->new label mapping
79
+
80
+ Exit codes: 0 ok, 1 refused (gate or lost claim), 2 gh missing, not authenticated, or no repo
81
+ resolved, 3 a label did not land or drift was found.
82
+
83
+ The vocabulary is not repeated here. `work-queue docs` is the single description of it, and it
84
+ ships inside the package so an installed copy can print it.
85
+
86
+ ## Installing into a repo
87
+
88
+ Once per target repo:
89
+
90
+ work-queue init
91
+
92
+ Then copy `assets/triage-label.yml` to `.github/workflows/triage-label.yml` in the target repo.
93
+ It is the fail-closed step: every issue opened without an `agent:` or `human:` label gets
94
+ `human:triage`, so nothing unvetted can be built. Issues created already labelled are left alone.
95
+
96
+ ## Configuration
97
+
98
+ | Variable | Default | What it changes |
99
+ |---|---|---|
100
+ | `GH_REPO` | the repo `gh` resolves | which repo is operated on |
101
+ | `QUEUE_MAX_ISSUES` | `800` | page size, and when the truncation warning fires |
102
+ | `QUEUE_SPECS_DIR` | `.ai/specs` | where spec files live |
103
+ | `QUEUE_PLANS_DIR` | `.ai/plans` | where plan directories live |
104
+ | `QUEUE_PLAN_INDEX` | `00-index.md` | the plan index filename |
105
+ | `QUEUE_SEAL_FILE` | `SEAL.sha256` | the seal filename |
106
+ | `QUEUE_SEAL_TOOL` | detected | override the sha tool used to verify a seal |
107
+ | `QUEUE_INBOX_DIR` | `.ai/inbox` | where un-tracked captures wait |
108
+ | `QUEUE_EXTRA_LABELS` | empty | comma-separated labels the repo already uses |
109
+
110
+ The seal check uses `sha256sum` when it exists and `shasum -a 256` otherwise, so a macOS machine
111
+ can verify a plan.
112
+
113
+ ## Drift
114
+
115
+ `verify` reports V1–V12; `reconcile` repairs what needs no human judgement. A missing `kind:` is
116
+ reported and never guessed, because deciding what the work is takes a person.
117
+
118
+ ## Testing
119
+
120
+ tests/test.sh
121
+
122
+ Self-contained: it builds a scratch repo and a fake `gh`, asserts on printed output and exit codes,
123
+ and touches no network. Needs `bash`, `python3` and `jq`.
124
+
125
+ ## Releasing
126
+
127
+ 1. Bump `__version__` in `work_queue/__init__.py`. That is the only place the version lives;
128
+ `pyproject.toml` reads it from there.
129
+ 2. Commit, then tag that commit with the tool's name in front:
130
+ `git tag work-queue-v<version> && git push origin work-queue-v<version>`.
131
+ 3. No release artifact is needed:
132
+ `pipx install "git+https://…/dev-tools.git@work-queue-v<version>#subdirectory=work-queue"`
133
+ resolves the tag.
134
+
135
+ Tags are per tool, never per repo: a second tool at its own `0.1.0` gets `other-tool-v0.1.0`, and
136
+ neither tag blocks the other. The prefix must match the tool's directory name, and the version in
137
+ the tag must match `__version__` — a tag is also the integrity check, because a commit cannot
138
+ change.
@@ -0,0 +1,18 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ chewcw_work_queue.egg-info/PKG-INFO
5
+ chewcw_work_queue.egg-info/SOURCES.txt
6
+ chewcw_work_queue.egg-info/dependency_links.txt
7
+ chewcw_work_queue.egg-info/entry_points.txt
8
+ chewcw_work_queue.egg-info/top_level.txt
9
+ work_queue/__init__.py
10
+ work_queue/__main__.py
11
+ work_queue/artefacts.py
12
+ work_queue/cli.py
13
+ work_queue/commands.py
14
+ work_queue/gates.py
15
+ work_queue/gh.py
16
+ work_queue/labels.py
17
+ work_queue/verify.py
18
+ work_queue/docs/pipeline.md
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ work-queue = work_queue.cli:main
@@ -0,0 +1,35 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "chewcw-work-queue"
7
+ dynamic = ["version"]
8
+ description = "One script that owns every GitHub label write for the agent work queue"
9
+ requires-python = ">=3.9"
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{name = "chew cw"}]
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "Environment :: Console",
17
+ "Topic :: Software Development :: Bug Tracking",
18
+ ]
19
+
20
+ [project.urls]
21
+ Homepage = "https://github.com/chewcw/skills/tree/main/dev-tools/work-queue"
22
+ Repository = "https://github.com/chewcw/skills"
23
+ Issues = "https://github.com/chewcw/skills/issues"
24
+
25
+ [project.scripts]
26
+ work-queue = "work_queue.cli:main"
27
+
28
+ [tool.setuptools]
29
+ packages = ["work_queue"]
30
+
31
+ [tool.setuptools.dynamic]
32
+ version = {attr = "work_queue.__version__"}
33
+
34
+ [tool.setuptools.package-data]
35
+ work_queue = ["docs/*.md"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ __version__ = "0.3.0"
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ sys.exit(main())