agcoord 0.1.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.
Files changed (37) hide show
  1. agcoord-0.1.0/AGENTS.md +59 -0
  2. agcoord-0.1.0/CHANGELOG.md +28 -0
  3. agcoord-0.1.0/LICENSE +21 -0
  4. agcoord-0.1.0/MANIFEST.in +4 -0
  5. agcoord-0.1.0/PKG-INFO +144 -0
  6. agcoord-0.1.0/README.md +111 -0
  7. agcoord-0.1.0/docs/assets/README.md +6 -0
  8. agcoord-0.1.0/docs/assets/agcoord-gourd-mascot.png +0 -0
  9. agcoord-0.1.0/docs/coordinator.md +322 -0
  10. agcoord-0.1.0/docs/index.md +18 -0
  11. agcoord-0.1.0/docs/releasing.md +58 -0
  12. agcoord-0.1.0/pyproject.toml +61 -0
  13. agcoord-0.1.0/setup.cfg +4 -0
  14. agcoord-0.1.0/src/agcoord/__init__.py +19 -0
  15. agcoord-0.1.0/src/agcoord/__main__.py +6 -0
  16. agcoord-0.1.0/src/agcoord/cli.py +244 -0
  17. agcoord-0.1.0/src/agcoord/frame.py +35 -0
  18. agcoord-0.1.0/src/agcoord/github.py +847 -0
  19. agcoord-0.1.0/src/agcoord/land.py +276 -0
  20. agcoord-0.1.0/src/agcoord/merge.py +31 -0
  21. agcoord-0.1.0/src/agcoord/py.typed +1 -0
  22. agcoord-0.1.0/src/agcoord/queue.py +2740 -0
  23. agcoord-0.1.0/src/agcoord/tui.py +636 -0
  24. agcoord-0.1.0/src/agcoord.egg-info/PKG-INFO +144 -0
  25. agcoord-0.1.0/src/agcoord.egg-info/SOURCES.txt +35 -0
  26. agcoord-0.1.0/src/agcoord.egg-info/dependency_links.txt +1 -0
  27. agcoord-0.1.0/src/agcoord.egg-info/entry_points.txt +2 -0
  28. agcoord-0.1.0/src/agcoord.egg-info/requires.txt +7 -0
  29. agcoord-0.1.0/src/agcoord.egg-info/top_level.txt +1 -0
  30. agcoord-0.1.0/tests/conftest.py +101 -0
  31. agcoord-0.1.0/tests/test_cli.py +455 -0
  32. agcoord-0.1.0/tests/test_distribution.py +119 -0
  33. agcoord-0.1.0/tests/test_github_adapter.py +260 -0
  34. agcoord-0.1.0/tests/test_merge.py +923 -0
  35. agcoord-0.1.0/tests/test_queue.py +1602 -0
  36. agcoord-0.1.0/tests/test_release_workflow.py +67 -0
  37. agcoord-0.1.0/tests/test_tui.py +459 -0
@@ -0,0 +1,59 @@
1
+ # AGCoord contributor instructions
2
+
3
+ Keep this file compact and broadly applicable. Component contracts and procedures belong in
4
+ the canonical documents listed by [docs/index.md](docs/index.md).
5
+
6
+ ## Track and isolate changes
7
+
8
+ - Create a descriptive issue before changing code, tests, documentation, packaging, or live
9
+ state. Pair every issue number with a sentence explaining the work it tracks.
10
+ - Make and validate the change in a ticket-specific Git worktree branched from `main`.
11
+ Preserve unrelated edits and do not develop in the primary checkout.
12
+ - Keep the core coordinator forge-neutral. Forge-specific metadata and publication behavior
13
+ belongs in an optional adapter.
14
+
15
+ ## Test behavior and document contracts
16
+
17
+ - Reproduce a bug with a failing behavioral test before changing runtime code. Exercise
18
+ public APIs, commands, subprocesses, Git repositories, and the real TUI; do not inspect
19
+ source or documentation text to prove behavior.
20
+ - Every runtime change includes focused tests and updates affected canonical documentation.
21
+ Register new documents in `docs/index.md` and record published user-facing changes in
22
+ `CHANGELOG.md`.
23
+ - Tests own and stop every broker, worker, repository, and temporary state they start. Never
24
+ inspect or clean another agent's state.
25
+
26
+ ## Coordinate checks and publication
27
+
28
+ Once AGCoord is installed, every check and publication uses the local coordinator:
29
+
30
+ ```bash
31
+ agcoord run --label "focused tests" --resource cpu=1 -- python -m pytest -q tests/test_area.py
32
+ agcoord full --label "standalone full validation" --resource cpu=4 -- python -m pytest -q
33
+ agcoord land <request> --label "gate and publish" --resource cpu=4 -- python -m pytest -q
34
+ ```
35
+
36
+ - Declare every scarce resource a command consumes. A full gate is a barrier for its
37
+ repository, not an undeclared machine-global lock.
38
+ - Use `agcoord full` from a clean checkout when an exact-head validation is useful without
39
+ publication. It remains a repository barrier, but a separate full row followed by a merge
40
+ is not the normal landing workflow.
41
+ - Push/open the publication request, then use one `agcoord land` request whose gate command
42
+ validates that exact clean 40-character head and publishes it without releasing the lane
43
+ or declared resources. Do not use direct target-branch pushes, forge merge commands, a
44
+ full-plus-merge gap, or an equivalent path that separates the landing verdict from its
45
+ publication.
46
+ - A stale-target or changed-head refusal hands the work back to the agent: update the branch
47
+ explicitly, push, and submit a fresh `agcoord land` request. AGCoord never refreshes,
48
+ rebases, or rewrites the worktree for you, and never reuses the previous gate result after
49
+ either reference moves.
50
+ - Do not invoke `agcoord`, a gate wrapper, or publication from inside an admitted AGCoord
51
+ job; nested submissions are rejected to prevent self-deadlock.
52
+ - Remove the merged ticket worktree and branch only after publication succeeds.
53
+
54
+ Bootstrap exception: before AGCoord is installed in a fresh AGCoord development environment,
55
+ direct package installation and focused tests are allowed only long enough to make
56
+ `agcoord run` available; direct full gates and publication are never bootstrap shortcuts.
57
+
58
+ See [docs/coordinator.md](docs/coordinator.md) for scheduling, receipts, recovery, cleanup,
59
+ TUI, and migration details, and [docs/releasing.md](docs/releasing.md) for the release gate.
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ All notable user-facing changes to AGCoord are recorded here. Versions follow semantic
4
+ versioning; dates use ISO 8601.
5
+
6
+ ## 0.1.0 — 2026-08-30
7
+
8
+ - Publish the standalone `agcoord` distribution, import package, module entry point, and
9
+ console command for Python 3.10 and newer.
10
+ - Coordinate multiple agents, Git worktrees, and repositories through one detached,
11
+ user-scoped broker with durable job IDs, logs, resource capacities, repository barriers,
12
+ cancellation, history clearing, recovery, and private scratch reclamation.
13
+ - Add `land`, one durable repository-barrier request that preflights an exact clean head,
14
+ runs its captured gate, and immediately publishes a green result without releasing its
15
+ lane or resources; red gates and stale target/head observations publish nothing.
16
+ - Expose land phases, gate exit status, one combined transcript, safe cancellation
17
+ boundaries, and crash recovery that never reruns a gate. Keep `full` as a standalone
18
+ exact-head validation command instead of a full-plus-publication landing sequence.
19
+ - Provide GitHub metadata and exact ref-publication adapters without making `gh` a core
20
+ import dependency.
21
+ - Add `run`, `full`, `land`, `list`, `show`, `log`, `cancel`, `tui`, `migrate`, and `clear`
22
+ workflows, including a compact live multi-repository terminal view.
23
+ - Give admitted workers immutable run ID, exact kind, and resolved state-directory context
24
+ so internal repository gate wrappers can verify the correct full or land admission even
25
+ with an explicit state directory, without exposing environment values or credentials in
26
+ public job rows.
27
+ - Promote the exact successful TestPyPI wheel and source archive from the tagged commit to
28
+ PyPI instead of rebuilding production artifacts after the release-candidate smoke.
agcoord-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AGCoord contributors
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,4 @@
1
+ include AGENTS.md
2
+ include CHANGELOG.md
3
+ recursive-include docs *.md *.png
4
+ recursive-include tests *.py
agcoord-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: agcoord
3
+ Version: 0.1.0
4
+ Summary: Machine-local gate and publication coordinator for development agents
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/xu-hao/agcoord
7
+ Project-URL: Changelog, https://github.com/xu-hao/agcoord/blob/main/CHANGELOG.md
8
+ Project-URL: Documentation, https://github.com/xu-hao/agcoord/tree/main/docs
9
+ Project-URL: Issues, https://github.com/xu-hao/agcoord/issues
10
+ Project-URL: Repository, https://github.com/xu-hao/agcoord
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Build Tools
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: textual>=1
27
+ Provides-Extra: test
28
+ Requires-Dist: build>=1.2; extra == "test"
29
+ Requires-Dist: pytest>=8; extra == "test"
30
+ Requires-Dist: pytest-asyncio>=0.24; extra == "test"
31
+ Requires-Dist: twine>=5; extra == "test"
32
+ Dynamic: license-file
33
+
34
+ # AGCoord
35
+
36
+ ![AGCoord gourd mascot](https://raw.githubusercontent.com/xu-hao/agcoord/main/docs/assets/agcoord-gourd-mascot.png)
37
+
38
+ AGCoord is a machine-local coordinator for developers and coding agents that share a
39
+ workstation. It gives every check, standalone full gate, and atomic gate-and-publication
40
+ request one durable job ID, then schedules compatible work across repositories without
41
+ letting two agents accidentally publish stale or untested code.
42
+
43
+ The coordinator is local infrastructure: one detached broker per OS user, a private durable
44
+ spool, per-job logs, and an optional terminal UI. It does not require a hosted service. The
45
+ core package is forge-neutral; GitHub support is an optional adapter.
46
+
47
+ ## Install and start
48
+
49
+ Install the published package in a tool environment:
50
+
51
+ ```bash
52
+ python -m pip install agcoord
53
+ ```
54
+
55
+ There is no separate service-install step. The first command starts the detached broker on
56
+ demand; later shells and repositories join the same user-scoped coordinator:
57
+
58
+ ```bash
59
+ agcoord list
60
+ agcoord tui
61
+ ```
62
+
63
+ State defaults to `${XDG_STATE_HOME:-~/.local/state}/agcoord`. Set
64
+ `AGCOORD_STATE_DIR` or pass `--state-dir` to use a deliberate alternate spool.
65
+ Machine capacity defaults to two concurrent job slots. Configure named resources before the
66
+ broker starts with either `AGCOORD_CAPACITIES='jobs=4,cpu=8,browser=1'` or an equivalent JSON
67
+ object.
68
+
69
+ ## Run work
70
+
71
+ Submit focused checks with the resources they consume:
72
+
73
+ ```bash
74
+ agcoord run --label "unit tests" --resource cpu=2 -- python -m pytest -q
75
+ ```
76
+
77
+ Every job implicitly holds one `jobs` slot. Repeatable `--resource` options add only named,
78
+ configured resources; unknown or impossible requests fail instead of waiting forever.
79
+
80
+ Run a standalone full validation for an exact clean Git head when publication is not part of
81
+ the request:
82
+
83
+ ```bash
84
+ agcoord full --label "release gate" --resource cpu=4 -- ./scripts/test.sh
85
+ ```
86
+
87
+ `full` records the checkout's full 40-character `HEAD`, checks that the worktree is clean,
88
+ and establishes a barrier in that repository's lane. It remains useful for validation and
89
+ release preparation, but normal landing does not compose a full row with a later publication
90
+ row. It is not a machine-global lock: compatible work in other repositories can overlap when
91
+ configured resource capacities allow it.
92
+
93
+ After pushing the exact clean head and opening a pull request, gate and publish it as one
94
+ indivisible request:
95
+
96
+ ```bash
97
+ agcoord land 123 \
98
+ --label "gate and publish PR 123" \
99
+ --resource cpu=4 \
100
+ -- ./scripts/test.sh
101
+ # GitHub is the convenience default and may also be named explicitly.
102
+ agcoord land 123 --adapter github -- ./scripts/test.sh
103
+ ```
104
+
105
+ `land` stores the adapter, request, exact checkout/head, gate command, caller environment,
106
+ and resource claim in one durable repository barrier. The core record keeps adapter and
107
+ request separate even though the current installed adapter uses GitHub pull-request numbers.
108
+ It rejects a stale target before the gate, runs the gate once, and publishes immediately
109
+ after a green result without releasing the lane or resources. A red gate publishes nothing.
110
+ `--adapter github` is the default when the option is omitted; the core request remains
111
+ forge-neutral.
112
+
113
+ AGCoord never refreshes, rebases, or rewrites the checkout. If the source head or target
114
+ branch moves before or during the gate, the same job ends with a named handback and does not
115
+ publish. Update the branch yourself, push it, and submit a fresh `agcoord land` request; a
116
+ separate full-plus-merge sequence is not a landing substitute.
117
+
118
+ Inspect or manage jobs from any terminal:
119
+
120
+ ```bash
121
+ agcoord list
122
+ agcoord show land-0123456789ab
123
+ agcoord log land-0123456789ab --follow
124
+ agcoord cancel land-0123456789ab
125
+ agcoord clear
126
+ ```
127
+
128
+ `clear` removes terminal history and its logs only. It refuses while queued or running work
129
+ exists and never removes the spool, broker ownership, or migration history.
130
+
131
+ The full operating contract, recovery behavior, TUI keys, and resource model are in
132
+ [the coordinator guide](docs/coordinator.md). Package maintainers should also read
133
+ [the release guide](docs/releasing.md), and published user-facing changes are recorded in
134
+ [the changelog](CHANGELOG.md). Contributors follow the repository workflow in
135
+ [AGENTS.md](AGENTS.md).
136
+
137
+ ## Project status
138
+
139
+ AGCoord targets distribution as the `agcoord` project on PyPI, with import package `agcoord`
140
+ and both `agcoord` and `python -m agcoord` command forms. Until a release is published, build
141
+ and install the checkout into an isolated environment rather than copying modules into
142
+ another project.
143
+
144
+ The gourd mascot and its asset notes live under [docs/assets](docs/assets/README.md).
@@ -0,0 +1,111 @@
1
+ # AGCoord
2
+
3
+ ![AGCoord gourd mascot](https://raw.githubusercontent.com/xu-hao/agcoord/main/docs/assets/agcoord-gourd-mascot.png)
4
+
5
+ AGCoord is a machine-local coordinator for developers and coding agents that share a
6
+ workstation. It gives every check, standalone full gate, and atomic gate-and-publication
7
+ request one durable job ID, then schedules compatible work across repositories without
8
+ letting two agents accidentally publish stale or untested code.
9
+
10
+ The coordinator is local infrastructure: one detached broker per OS user, a private durable
11
+ spool, per-job logs, and an optional terminal UI. It does not require a hosted service. The
12
+ core package is forge-neutral; GitHub support is an optional adapter.
13
+
14
+ ## Install and start
15
+
16
+ Install the published package in a tool environment:
17
+
18
+ ```bash
19
+ python -m pip install agcoord
20
+ ```
21
+
22
+ There is no separate service-install step. The first command starts the detached broker on
23
+ demand; later shells and repositories join the same user-scoped coordinator:
24
+
25
+ ```bash
26
+ agcoord list
27
+ agcoord tui
28
+ ```
29
+
30
+ State defaults to `${XDG_STATE_HOME:-~/.local/state}/agcoord`. Set
31
+ `AGCOORD_STATE_DIR` or pass `--state-dir` to use a deliberate alternate spool.
32
+ Machine capacity defaults to two concurrent job slots. Configure named resources before the
33
+ broker starts with either `AGCOORD_CAPACITIES='jobs=4,cpu=8,browser=1'` or an equivalent JSON
34
+ object.
35
+
36
+ ## Run work
37
+
38
+ Submit focused checks with the resources they consume:
39
+
40
+ ```bash
41
+ agcoord run --label "unit tests" --resource cpu=2 -- python -m pytest -q
42
+ ```
43
+
44
+ Every job implicitly holds one `jobs` slot. Repeatable `--resource` options add only named,
45
+ configured resources; unknown or impossible requests fail instead of waiting forever.
46
+
47
+ Run a standalone full validation for an exact clean Git head when publication is not part of
48
+ the request:
49
+
50
+ ```bash
51
+ agcoord full --label "release gate" --resource cpu=4 -- ./scripts/test.sh
52
+ ```
53
+
54
+ `full` records the checkout's full 40-character `HEAD`, checks that the worktree is clean,
55
+ and establishes a barrier in that repository's lane. It remains useful for validation and
56
+ release preparation, but normal landing does not compose a full row with a later publication
57
+ row. It is not a machine-global lock: compatible work in other repositories can overlap when
58
+ configured resource capacities allow it.
59
+
60
+ After pushing the exact clean head and opening a pull request, gate and publish it as one
61
+ indivisible request:
62
+
63
+ ```bash
64
+ agcoord land 123 \
65
+ --label "gate and publish PR 123" \
66
+ --resource cpu=4 \
67
+ -- ./scripts/test.sh
68
+ # GitHub is the convenience default and may also be named explicitly.
69
+ agcoord land 123 --adapter github -- ./scripts/test.sh
70
+ ```
71
+
72
+ `land` stores the adapter, request, exact checkout/head, gate command, caller environment,
73
+ and resource claim in one durable repository barrier. The core record keeps adapter and
74
+ request separate even though the current installed adapter uses GitHub pull-request numbers.
75
+ It rejects a stale target before the gate, runs the gate once, and publishes immediately
76
+ after a green result without releasing the lane or resources. A red gate publishes nothing.
77
+ `--adapter github` is the default when the option is omitted; the core request remains
78
+ forge-neutral.
79
+
80
+ AGCoord never refreshes, rebases, or rewrites the checkout. If the source head or target
81
+ branch moves before or during the gate, the same job ends with a named handback and does not
82
+ publish. Update the branch yourself, push it, and submit a fresh `agcoord land` request; a
83
+ separate full-plus-merge sequence is not a landing substitute.
84
+
85
+ Inspect or manage jobs from any terminal:
86
+
87
+ ```bash
88
+ agcoord list
89
+ agcoord show land-0123456789ab
90
+ agcoord log land-0123456789ab --follow
91
+ agcoord cancel land-0123456789ab
92
+ agcoord clear
93
+ ```
94
+
95
+ `clear` removes terminal history and its logs only. It refuses while queued or running work
96
+ exists and never removes the spool, broker ownership, or migration history.
97
+
98
+ The full operating contract, recovery behavior, TUI keys, and resource model are in
99
+ [the coordinator guide](docs/coordinator.md). Package maintainers should also read
100
+ [the release guide](docs/releasing.md), and published user-facing changes are recorded in
101
+ [the changelog](CHANGELOG.md). Contributors follow the repository workflow in
102
+ [AGENTS.md](AGENTS.md).
103
+
104
+ ## Project status
105
+
106
+ AGCoord targets distribution as the `agcoord` project on PyPI, with import package `agcoord`
107
+ and both `agcoord` and `python -m agcoord` command forms. Until a release is published, build
108
+ and install the checkout into an isolated environment rather than copying modules into
109
+ another project.
110
+
111
+ The gourd mascot and its asset notes live under [docs/assets](docs/assets/README.md).
@@ -0,0 +1,6 @@
1
+ # Asset sources
2
+
3
+ [`agcoord-gourd-mascot.png`](agcoord-gourd-mascot.png) is the selected transparent RGBA gourd
4
+ mascot used by the root README. Keep that canonical path stable. Any replacement must retain
5
+ its editable source or generation record, license/provenance, and accessible description
6
+ here rather than silently overwriting the published identity.