coding-agent-toolchain 1.0.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.
- coding_agent_toolchain-1.0.0/.python-version +1 -0
- coding_agent_toolchain-1.0.0/CHANGELOG.md +12 -0
- coding_agent_toolchain-1.0.0/CONTRIBUTING.md +33 -0
- coding_agent_toolchain-1.0.0/LICENSE +201 -0
- coding_agent_toolchain-1.0.0/PKG-INFO +103 -0
- coding_agent_toolchain-1.0.0/README.md +92 -0
- coding_agent_toolchain-1.0.0/SECURITY.md +31 -0
- coding_agent_toolchain-1.0.0/justfile +14 -0
- coding_agent_toolchain-1.0.0/manifests/context-loader/tool_skill_manifest.json +31 -0
- coding_agent_toolchain-1.0.0/manifests/git-finalizer/tool_skill_manifest.json +35 -0
- coding_agent_toolchain-1.0.0/manifests/snapshot-runner/tool_skill_manifest.json +31 -0
- coding_agent_toolchain-1.0.0/pyproject.toml +66 -0
- coding_agent_toolchain-1.0.0/pyproject.toml.orig +55 -0
- coding_agent_toolchain-1.0.0/src/agent_toolchain/__init__.py +8 -0
- coding_agent_toolchain-1.0.0/src/agent_toolchain/errors.py +108 -0
- coding_agent_toolchain-1.0.0/src/agent_toolchain/git_io.py +284 -0
- coding_agent_toolchain-1.0.0/src/agent_toolchain/json_io.py +55 -0
- coding_agent_toolchain-1.0.0/src/agent_toolchain/tool_skill_sync.py +3050 -0
- coding_agent_toolchain-1.0.0/src/agent_toolchain/tool_temp_dir.py +1057 -0
- coding_agent_toolchain-1.0.0/src/agent_toolchain/workflow_health.py +501 -0
- coding_agent_toolchain-1.0.0/tests/test_package_contract.py +242 -0
- coding_agent_toolchain-1.0.0/tests/test_tool_skill_sync.py +1642 -0
- coding_agent_toolchain-1.0.0/tests/test_tool_temp_dir.py +879 -0
- coding_agent_toolchain-1.0.0/tests/test_workflow_health.py +528 -0
- coding_agent_toolchain-1.0.0/tool-skill-sync +19 -0
- coding_agent_toolchain-1.0.0/tool-temp-dir +19 -0
- coding_agent_toolchain-1.0.0/toolchain_compatibility.json +95 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `agent-toolchain` are documented in this file.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 1.0.0 - 2026-11-20
|
|
8
|
+
|
|
9
|
+
- Added: standalone zero-dependency pure-Python `agent-toolchain` package (PyPI distribution `coding-agent-toolchain`, module `agent_toolchain`, `pyproject.toml` with `uv_build`, `requires-python = ">=3.12,<3.15"`, Apache-2.0) exposing `tool-skill-sync` and `tool-temp-dir` console scripts and thin executable root wrappers.
|
|
10
|
+
- Changed: extracted `errors`, `git_io`, `json_io`, `tool_skill_sync`, `tool_temp_dir`, and `workflow_health` under `src/agent_toolchain/`, cleanly decoupled from `git_finalizer.delivery` while preserving full CLI, bundle, and `toolchain_compatibility.json` v6 schema compatibility.
|
|
11
|
+
- Added: root `toolchain_compatibility.json` (`toolchain_contract_version` 6) and `manifests/{context-loader,snapshot-runner,git-finalizer}/tool_skill_manifest.json` aligned with `context-loader` `1.4.0` (contract 4), `snapshot-runner` `2.6.0` (contract 4), `git-finalizer` `2.0.0` (contract 10), and `worktree-controller` CLI `37..62` / storage `4..5`.
|
|
12
|
+
- Added: migrated unit/integration test suites (`tests/test_tool_skill_sync.py`, `tests/test_tool_temp_dir.py`, `tests/test_workflow_health.py`, `tests/test_package_contract.py`) and GitHub Actions CI, release, and OIDC PyPI publishing workflows.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions to `agent-toolchain` are welcome under the [Apache-2.0 license](LICENSE).
|
|
4
|
+
|
|
5
|
+
## Ground Rules
|
|
6
|
+
|
|
7
|
+
- **Zero runtime dependencies.** Production modules under `src/agent_toolchain/` must use only the
|
|
8
|
+
Python standard library (`requires-python = ">=3.12,<3.15"`).
|
|
9
|
+
- **Fail closed.** Missing manifests, hash mismatches, unsafe symlinks, mount points, active
|
|
10
|
+
sockets, drifted production trees, and invalid schemas must return explicit errors without partial
|
|
11
|
+
mutation or silent fallbacks.
|
|
12
|
+
- **Preserve CLI and schema contracts.** Keep `tool-skill-sync` and `tool-temp-dir` flags, exit
|
|
13
|
+
codes, JSON output schemas, and `toolchain_compatibility.json` v6 compatibility intact.
|
|
14
|
+
- **No private markers or host coupling.** Keep tests self-contained in disposable temporary
|
|
15
|
+
directories (`tempfile.TemporaryDirectory` or `tool-temp-dir`) with isolated `GIT_*` and `HOME`
|
|
16
|
+
environments.
|
|
17
|
+
|
|
18
|
+
## Local Verification
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
ruff check src tests
|
|
22
|
+
python3 -B -m unittest discover -s tests -p 'test_*.py' -v
|
|
23
|
+
python3 -B -m pytest -q
|
|
24
|
+
just check
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Contract & Manifest Updates
|
|
28
|
+
|
|
29
|
+
When updating `toolchain_compatibility.json` or any `manifests/<tool>/tool_skill_manifest.json`,
|
|
30
|
+
ensure deterministic canonical JSON formatting (`sort_keys=True, indent=2`, trailing newline) and
|
|
31
|
+
verify `tests/test_package_contract.py` passes alongside the full suite.
|
|
32
|
+
|
|
33
|
+
Please follow [SECURITY.md](SECURITY.md) for reporting security issues.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to source code, documentation source, and
|
|
28
|
+
configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the
|
|
44
|
+
purposes of this License, Derivative Works shall not include works
|
|
45
|
+
that remain separable from, or merely link (or bind by name) to the
|
|
46
|
+
interfaces of, the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright
|
|
52
|
+
owner or by an individual or Legal Entity authorized to submit on
|
|
53
|
+
behalf of the copyright owner. For the purposes of this definition,
|
|
54
|
+
"submitted" means any form of electronic, verbal, or written
|
|
55
|
+
communication sent to the Licensor or its representatives, including
|
|
56
|
+
but not limited to communication on electronic mailing lists, source
|
|
57
|
+
code control systems, and issue tracking systems that are managed by,
|
|
58
|
+
or on behalf of, the Licensor for the purpose of discussing and
|
|
59
|
+
improving the Work, but excluding communication that is conspicuously
|
|
60
|
+
marked or otherwise designated in writing by the copyright owner as
|
|
61
|
+
"Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and do
|
|
118
|
+
not modify the License. You may add Your own attribution notices
|
|
119
|
+
within Derivative Works that you distribute, alongside or as an
|
|
120
|
+
addendum to the NOTICE text from the Work, provided that such
|
|
121
|
+
additional attribution notices cannot be construed as modifying
|
|
122
|
+
the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT
|
|
147
|
+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
|
148
|
+
including, without limitation, any warranties or conditions of
|
|
149
|
+
TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor has
|
|
164
|
+
been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf of
|
|
172
|
+
any other Contributor, and only if You agree to indemnify, defend,
|
|
173
|
+
and hold each Contributor harmless for any liability incurred by,
|
|
174
|
+
or claims asserted against, such Contributor by reason of your
|
|
175
|
+
accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a file
|
|
186
|
+
or class name and description of purpose be included on the same
|
|
187
|
+
"printed page" as the copyright notice for easier identification.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: coding-agent-toolchain
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Standalone toolchain compatibility, skill synchronization, and safe task temp-directory CLIs for coding agents
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.12, <3.15
|
|
8
|
+
Project-URL: Repository, https://github.com/xuanheng-tech/agent-toolchain
|
|
9
|
+
Project-URL: Issues, https://github.com/xuanheng-tech/agent-toolchain/issues
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# Agent Toolchain
|
|
13
|
+
|
|
14
|
+
Standalone, zero-dependency pure-Python CLI suite for coding-agent toolchain compatibility verification, Skill synchronization, deployment diagnostics, and safe `/tmp` task directory management.
|
|
15
|
+
|
|
16
|
+
Current source version: **1.0.0**.
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
`agent-toolchain` extracts the shared toolchain governance and workspace utilities into an independent package (`agent_toolchain`, published on PyPI as `coding-agent-toolchain`) decoupled from Git Finalizer's delivery engine while preserving full CLI and schema compatibility:
|
|
21
|
+
|
|
22
|
+
- **`tool-skill-sync`**: Validates `toolchain_compatibility.json` (contract v6) and `ToolSkillManifest` v2 pins across `context-loader`, `snapshot-runner`, and `git-finalizer`; manages atomic `ToolReleaseBundle` staging, production activation/rollback, multi-client Skill exposure (`codex`, `claude`, `gemini`, `cursor`, `qoder`, `qoder-cn`), and read-only `doctor` deployment/instruction diagnostics (including external `worktree-controller` runtime checks).
|
|
23
|
+
- **`tool-temp-dir`**: Creates and safely cleans up user-owned, registered `/tmp/tool-task-<prefix>-<hex>` task directories with strict symlink, device/inode, mount-point, active Unix socket, and explicit pytest basetemp guards.
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- **Python**: `>=3.12,<3.15` (pure Python standard library only; zero runtime dependencies).
|
|
28
|
+
- **OS & Tools**: POSIX/Linux environment with `git` on `PATH` (for repository checks). Verified on Ubuntu 24.04 LTS with Python 3.12.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
Install from a built wheel or source checkout:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
uv tool install 'coding-agent-toolchain==1.0.0'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or using `pip`:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install 'coding-agent-toolchain==1.0.0'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
From a local source checkout, thin executable wrappers are available directly at the repository root:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
./tool-skill-sync --version
|
|
48
|
+
./tool-temp-dir --version
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
### Toolchain status, contract verification, and read-only diagnostics
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Inspect source contracts vs. active installed tools
|
|
57
|
+
tool-skill-sync status
|
|
58
|
+
|
|
59
|
+
# Read-only deployment & instruction freshness check
|
|
60
|
+
tool-skill-sync doctor --repo /path/to/checkout --summary
|
|
61
|
+
|
|
62
|
+
# Source-only contract validation for a tool
|
|
63
|
+
tool-skill-sync check --source-only git-finalizer
|
|
64
|
+
|
|
65
|
+
# Check or sync multi-client shared Skill links
|
|
66
|
+
tool-skill-sync skill-check
|
|
67
|
+
tool-skill-sync skill-install
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Safe registered temporary task directories
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Create a registered /tmp/tool-task-<prefix>-<16hex> directory (0700)
|
|
74
|
+
tool-temp-dir create my-task
|
|
75
|
+
|
|
76
|
+
# Dry-run and cleanup an owned registered directory
|
|
77
|
+
tool-temp-dir dry-run-cleanup /tmp/tool-task-my-task-0123456789abcdef
|
|
78
|
+
tool-temp-dir cleanup /tmp/tool-task-my-task-0123456789abcdef
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Pinned Compatibility Baseline (`toolchain_compatibility.json` v6)
|
|
82
|
+
|
|
83
|
+
The repository carries `toolchain_compatibility.json` (`toolchain_contract_version: 6`) and manifest pins under `manifests/`:
|
|
84
|
+
|
|
85
|
+
| Tool | Pinned Version | Contract Version |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `context-loader` | `1.4.0` | `4` |
|
|
88
|
+
| `snapshot-runner` | `2.6.0` | `4` |
|
|
89
|
+
| `git-finalizer` | `2.0.0` | `10` |
|
|
90
|
+
| `worktree-controller` | external runtime | CLI `37..62`, storage `4..5`, adapter `3` |
|
|
91
|
+
|
|
92
|
+
## Development
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
just lint
|
|
96
|
+
just test
|
|
97
|
+
ruff check src tests
|
|
98
|
+
python3 -B -m unittest discover -s tests -p 'test_*.py' -v
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
Licensed under the [Apache License 2.0](LICENSE).
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Agent Toolchain
|
|
2
|
+
|
|
3
|
+
Standalone, zero-dependency pure-Python CLI suite for coding-agent toolchain compatibility verification, Skill synchronization, deployment diagnostics, and safe `/tmp` task directory management.
|
|
4
|
+
|
|
5
|
+
Current source version: **1.0.0**.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
`agent-toolchain` extracts the shared toolchain governance and workspace utilities into an independent package (`agent_toolchain`, published on PyPI as `coding-agent-toolchain`) decoupled from Git Finalizer's delivery engine while preserving full CLI and schema compatibility:
|
|
10
|
+
|
|
11
|
+
- **`tool-skill-sync`**: Validates `toolchain_compatibility.json` (contract v6) and `ToolSkillManifest` v2 pins across `context-loader`, `snapshot-runner`, and `git-finalizer`; manages atomic `ToolReleaseBundle` staging, production activation/rollback, multi-client Skill exposure (`codex`, `claude`, `gemini`, `cursor`, `qoder`, `qoder-cn`), and read-only `doctor` deployment/instruction diagnostics (including external `worktree-controller` runtime checks).
|
|
12
|
+
- **`tool-temp-dir`**: Creates and safely cleans up user-owned, registered `/tmp/tool-task-<prefix>-<hex>` task directories with strict symlink, device/inode, mount-point, active Unix socket, and explicit pytest basetemp guards.
|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
|
|
16
|
+
- **Python**: `>=3.12,<3.15` (pure Python standard library only; zero runtime dependencies).
|
|
17
|
+
- **OS & Tools**: POSIX/Linux environment with `git` on `PATH` (for repository checks). Verified on Ubuntu 24.04 LTS with Python 3.12.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Install from a built wheel or source checkout:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uv tool install 'coding-agent-toolchain==1.0.0'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or using `pip`:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install 'coding-agent-toolchain==1.0.0'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
From a local source checkout, thin executable wrappers are available directly at the repository root:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
./tool-skill-sync --version
|
|
37
|
+
./tool-temp-dir --version
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
### Toolchain status, contract verification, and read-only diagnostics
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Inspect source contracts vs. active installed tools
|
|
46
|
+
tool-skill-sync status
|
|
47
|
+
|
|
48
|
+
# Read-only deployment & instruction freshness check
|
|
49
|
+
tool-skill-sync doctor --repo /path/to/checkout --summary
|
|
50
|
+
|
|
51
|
+
# Source-only contract validation for a tool
|
|
52
|
+
tool-skill-sync check --source-only git-finalizer
|
|
53
|
+
|
|
54
|
+
# Check or sync multi-client shared Skill links
|
|
55
|
+
tool-skill-sync skill-check
|
|
56
|
+
tool-skill-sync skill-install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Safe registered temporary task directories
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Create a registered /tmp/tool-task-<prefix>-<16hex> directory (0700)
|
|
63
|
+
tool-temp-dir create my-task
|
|
64
|
+
|
|
65
|
+
# Dry-run and cleanup an owned registered directory
|
|
66
|
+
tool-temp-dir dry-run-cleanup /tmp/tool-task-my-task-0123456789abcdef
|
|
67
|
+
tool-temp-dir cleanup /tmp/tool-task-my-task-0123456789abcdef
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Pinned Compatibility Baseline (`toolchain_compatibility.json` v6)
|
|
71
|
+
|
|
72
|
+
The repository carries `toolchain_compatibility.json` (`toolchain_contract_version: 6`) and manifest pins under `manifests/`:
|
|
73
|
+
|
|
74
|
+
| Tool | Pinned Version | Contract Version |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| `context-loader` | `1.4.0` | `4` |
|
|
77
|
+
| `snapshot-runner` | `2.6.0` | `4` |
|
|
78
|
+
| `git-finalizer` | `2.0.0` | `10` |
|
|
79
|
+
| `worktree-controller` | external runtime | CLI `37..62`, storage `4..5`, adapter `3` |
|
|
80
|
+
|
|
81
|
+
## Development
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
just lint
|
|
85
|
+
just test
|
|
86
|
+
ruff check src tests
|
|
87
|
+
python3 -B -m unittest discover -s tests -p 'test_*.py' -v
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
Licensed under the [Apache License 2.0](LICENSE).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a Vulnerability
|
|
4
|
+
|
|
5
|
+
Please report security issues through a **private security advisory** on the repository's GitHub
|
|
6
|
+
Security tab rather than a public issue. Include the installed versions (`tool-skill-sync --version`
|
|
7
|
+
and `tool-temp-dir --version`), the affected command, and a minimal reproduction using synthetic
|
|
8
|
+
data in a disposable directory (never include real credentials or private paths).
|
|
9
|
+
|
|
10
|
+
Only the latest stable release is supported. Fixes are shipped in a new release; released tags and
|
|
11
|
+
published artifacts are never rewritten.
|
|
12
|
+
|
|
13
|
+
## Security Properties and Fail-Closed Design
|
|
14
|
+
|
|
15
|
+
- **Trusted Skill lineage gate.** `tool-skill-sync` verifies canonical Skill payload SHA-256 trees,
|
|
16
|
+
`ToolSkillManifest` v2 pins, and `uv` wheel `RECORD` digests before production activation or
|
|
17
|
+
rollback, refusing unknown content drift without overwriting live files.
|
|
18
|
+
- **Read-only diagnostics.** `tool-skill-sync doctor` and `check` observe installed entrypoints,
|
|
19
|
+
frozen contracts, runtime manifests, and instruction discovery budgets without mutating
|
|
20
|
+
repositories or activating candidates.
|
|
21
|
+
- **Strict `/tmp` ownership and traversal guards.** `tool-temp-dir` cleans only paths created and
|
|
22
|
+
registered by itself under `/tmp`, validating UID, device/inode identity, permissions (`0700` /
|
|
23
|
+
`0600`), mount points, symlinks, inactive Unix sockets, and explicit pytest basetemp scopes via
|
|
24
|
+
`dir_fd` operations before unlinking any entry.
|
|
25
|
+
|
|
26
|
+
## Trust Boundaries
|
|
27
|
+
|
|
28
|
+
- Tools execute as the invoking user with that user's permissions and do not provide isolation from
|
|
29
|
+
malicious processes running under the same UID.
|
|
30
|
+
- Repository manifests, contracts, and instruction files are treated as untrusted inputs and parsed
|
|
31
|
+
strictly without code execution.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
default:
|
|
2
|
+
just --list
|
|
3
|
+
|
|
4
|
+
lint:
|
|
5
|
+
if command -v ruff >/dev/null 2>&1; then ruff check src tests; else uv tool run ruff check src tests; fi
|
|
6
|
+
|
|
7
|
+
test:
|
|
8
|
+
python3 -B -m unittest discover -s tests -p 'test_*.py' -v
|
|
9
|
+
|
|
10
|
+
check:
|
|
11
|
+
just lint
|
|
12
|
+
just test
|
|
13
|
+
./tool-skill-sync --version
|
|
14
|
+
./tool-temp-dir --version
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"canonical_skill": {
|
|
3
|
+
"owner": "git-finalizer",
|
|
4
|
+
"path": "skills/git-change-delivery/SKILL.md"
|
|
5
|
+
},
|
|
6
|
+
"canonical_skill_sha256": "d1525f9aeb9dcdda18fc9a5e8914ba3ba7c7ed26d9ec5463ca1359b428940bf1",
|
|
7
|
+
"compatibility_skill": {
|
|
8
|
+
"name": "three-tool-git-workflow",
|
|
9
|
+
"path": "skills/three-tool-git-workflow/SKILL.md",
|
|
10
|
+
"sha256": "68503da0ffb2e94e487afc8bbc8320390da9bdf7a8e6e7e902f6f6ab426dd8cd"
|
|
11
|
+
},
|
|
12
|
+
"compatible_toolchain_contract_version": 6,
|
|
13
|
+
"executable": {
|
|
14
|
+
"entrypoints": [
|
|
15
|
+
"project-context"
|
|
16
|
+
],
|
|
17
|
+
"kind": "python_console_scripts"
|
|
18
|
+
},
|
|
19
|
+
"install_targets": {
|
|
20
|
+
"skill_directory": "git-change-delivery",
|
|
21
|
+
"stable_entries": [
|
|
22
|
+
"project-context"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"public_cli_contract_sha256": "2c9c5ed2060c81c1f2d1db372c9205e89da4c43c373e2372ada1d1a4fc6a6449",
|
|
26
|
+
"schema_version": 2,
|
|
27
|
+
"skill_contract_version": 2,
|
|
28
|
+
"tool_commit": "@release",
|
|
29
|
+
"tool_name": "context-loader",
|
|
30
|
+
"tool_version": "1.4.0"
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"canonical_skill": {
|
|
3
|
+
"owner": "git-finalizer",
|
|
4
|
+
"path": "skills/git-change-delivery/SKILL.md"
|
|
5
|
+
},
|
|
6
|
+
"canonical_skill_sha256": "d1525f9aeb9dcdda18fc9a5e8914ba3ba7c7ed26d9ec5463ca1359b428940bf1",
|
|
7
|
+
"compatibility_skill": {
|
|
8
|
+
"name": "three-tool-git-workflow",
|
|
9
|
+
"path": "skills/three-tool-git-workflow/SKILL.md",
|
|
10
|
+
"sha256": "68503da0ffb2e94e487afc8bbc8320390da9bdf7a8e6e7e902f6f6ab426dd8cd"
|
|
11
|
+
},
|
|
12
|
+
"compatible_toolchain_contract_version": 6,
|
|
13
|
+
"executable": {
|
|
14
|
+
"entrypoints": [
|
|
15
|
+
"git-finalize",
|
|
16
|
+
"tool-skill-sync",
|
|
17
|
+
"tool-temp-dir"
|
|
18
|
+
],
|
|
19
|
+
"kind": "python_console_scripts"
|
|
20
|
+
},
|
|
21
|
+
"install_targets": {
|
|
22
|
+
"skill_directory": "git-change-delivery",
|
|
23
|
+
"stable_entries": [
|
|
24
|
+
"git-finalize",
|
|
25
|
+
"tool-skill-sync",
|
|
26
|
+
"tool-temp-dir"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"public_cli_contract_sha256": "20c9a33eeeb47d80a1b83ccf878b906e13bda4465e044cbe525894e3bf5f36a5",
|
|
30
|
+
"schema_version": 2,
|
|
31
|
+
"skill_contract_version": 2,
|
|
32
|
+
"tool_commit": "@release",
|
|
33
|
+
"tool_name": "git-finalizer",
|
|
34
|
+
"tool_version": "2.0.0"
|
|
35
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"canonical_skill": {
|
|
3
|
+
"owner": "git-finalizer",
|
|
4
|
+
"path": "skills/git-change-delivery/SKILL.md"
|
|
5
|
+
},
|
|
6
|
+
"canonical_skill_sha256": "d1525f9aeb9dcdda18fc9a5e8914ba3ba7c7ed26d9ec5463ca1359b428940bf1",
|
|
7
|
+
"compatibility_skill": {
|
|
8
|
+
"name": "three-tool-git-workflow",
|
|
9
|
+
"path": "skills/three-tool-git-workflow/SKILL.md",
|
|
10
|
+
"sha256": "68503da0ffb2e94e487afc8bbc8320390da9bdf7a8e6e7e902f6f6ab426dd8cd"
|
|
11
|
+
},
|
|
12
|
+
"compatible_toolchain_contract_version": 6,
|
|
13
|
+
"executable": {
|
|
14
|
+
"entrypoints": [
|
|
15
|
+
"snapshot-runner"
|
|
16
|
+
],
|
|
17
|
+
"kind": "python_console_scripts"
|
|
18
|
+
},
|
|
19
|
+
"install_targets": {
|
|
20
|
+
"skill_directory": "git-change-delivery",
|
|
21
|
+
"stable_entries": [
|
|
22
|
+
"snapshot-runner"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"public_cli_contract_sha256": "378c3634f92f94415dcb30f62078649275b3f27e8a4cc63be37f35aaf835ee4c",
|
|
26
|
+
"schema_version": 2,
|
|
27
|
+
"skill_contract_version": 2,
|
|
28
|
+
"tool_commit": "@release",
|
|
29
|
+
"tool_name": "snapshot-runner",
|
|
30
|
+
"tool_version": "2.6.0"
|
|
31
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv_build>=0.12.1,<0.13"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "coding-agent-toolchain"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Standalone toolchain compatibility, skill synchronization, and safe task temp-directory CLIs for coding agents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.12,<3.15"
|
|
13
|
+
dependencies = []
|
|
14
|
+
|
|
15
|
+
[project.scripts]
|
|
16
|
+
tool-skill-sync = "agent_toolchain.tool_skill_sync:main"
|
|
17
|
+
tool-temp-dir = "agent_toolchain.tool_temp_dir:main"
|
|
18
|
+
|
|
19
|
+
[project.urls]
|
|
20
|
+
Repository = "https://github.com/xuanheng-tech/agent-toolchain"
|
|
21
|
+
Issues = "https://github.com/xuanheng-tech/agent-toolchain/issues"
|
|
22
|
+
|
|
23
|
+
[tool.uv.build-backend]
|
|
24
|
+
module-name = "agent_toolchain"
|
|
25
|
+
module-root = "src"
|
|
26
|
+
source-include = [
|
|
27
|
+
"toolchain_compatibility.json",
|
|
28
|
+
"manifests/**",
|
|
29
|
+
"CHANGELOG.md",
|
|
30
|
+
"CONTRIBUTING.md",
|
|
31
|
+
"SECURITY.md",
|
|
32
|
+
"justfile",
|
|
33
|
+
".python-version",
|
|
34
|
+
"tool-skill-sync",
|
|
35
|
+
"tool-temp-dir",
|
|
36
|
+
"tests/**",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[tool.ruff]
|
|
40
|
+
line-length = 100
|
|
41
|
+
target-version = "py312"
|
|
42
|
+
|
|
43
|
+
[tool.ruff.lint]
|
|
44
|
+
select = [
|
|
45
|
+
"E",
|
|
46
|
+
"F",
|
|
47
|
+
"W",
|
|
48
|
+
"I",
|
|
49
|
+
"UP",
|
|
50
|
+
"B",
|
|
51
|
+
"SIM",
|
|
52
|
+
]
|
|
53
|
+
ignore = ["E501"]
|
|
54
|
+
|
|
55
|
+
[tool.ruff.lint.isort]
|
|
56
|
+
force-sort-within-sections = true
|
|
57
|
+
|
|
58
|
+
[tool.ruff.lint.per-file-ignores]
|
|
59
|
+
"tests/*.py" = ["E402"]
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
testpaths = ["tests"]
|
|
63
|
+
pythonpath = [
|
|
64
|
+
"src",
|
|
65
|
+
"tests",
|
|
66
|
+
]
|