lx-tooling 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 (34) hide show
  1. lx_tooling-0.1.0/.github/pull_request_template.md +27 -0
  2. lx_tooling-0.1.0/.github/workflows/ci.yml +34 -0
  3. lx_tooling-0.1.0/.github/workflows/pypi.yml +50 -0
  4. lx_tooling-0.1.0/.gitignore +24 -0
  5. lx_tooling-0.1.0/.labinetix/repo.toml +14 -0
  6. lx_tooling-0.1.0/.python-version +1 -0
  7. lx_tooling-0.1.0/AGENTS.md +179 -0
  8. lx_tooling-0.1.0/LICENSE +21 -0
  9. lx_tooling-0.1.0/PKG-INFO +115 -0
  10. lx_tooling-0.1.0/README.md +101 -0
  11. lx_tooling-0.1.0/docs/design/lx-tooling.md +300 -0
  12. lx_tooling-0.1.0/docs/examples/repo-inspect.md +29 -0
  13. lx_tooling-0.1.0/justfile +14 -0
  14. lx_tooling-0.1.0/pyproject.toml +49 -0
  15. lx_tooling-0.1.0/src/lx_tooling/__init__.py +3 -0
  16. lx_tooling-0.1.0/src/lx_tooling/checks/__init__.py +0 -0
  17. lx_tooling-0.1.0/src/lx_tooling/checks/agents.py +15 -0
  18. lx_tooling-0.1.0/src/lx_tooling/checks/docs.py +15 -0
  19. lx_tooling-0.1.0/src/lx_tooling/checks/workflow.py +74 -0
  20. lx_tooling-0.1.0/src/lx_tooling/cli.py +185 -0
  21. lx_tooling-0.1.0/src/lx_tooling/git.py +80 -0
  22. lx_tooling-0.1.0/src/lx_tooling/github.py +50 -0
  23. lx_tooling-0.1.0/src/lx_tooling/policy.py +60 -0
  24. lx_tooling-0.1.0/src/lx_tooling/repo.py +186 -0
  25. lx_tooling-0.1.0/src/lx_tooling/status.py +35 -0
  26. lx_tooling-0.1.0/src/lx_tooling/templates.py +31 -0
  27. lx_tooling-0.1.0/tests/conftest.py +47 -0
  28. lx_tooling-0.1.0/tests/fixtures/gh/issue_ready.json +11 -0
  29. lx_tooling-0.1.0/tests/unit/test_cli.py +51 -0
  30. lx_tooling-0.1.0/tests/unit/test_policy.py +36 -0
  31. lx_tooling-0.1.0/tests/unit/test_repo.py +37 -0
  32. lx_tooling-0.1.0/tests/unit/test_status.py +15 -0
  33. lx_tooling-0.1.0/tests/unit/test_workflow_checks.py +32 -0
  34. lx_tooling-0.1.0/uv.lock +179 -0
@@ -0,0 +1,27 @@
1
+ ## Summary
2
+
3
+ -
4
+
5
+ ## Scope
6
+
7
+ - In scope:
8
+ - Out of scope:
9
+
10
+ ## Verification
11
+
12
+ - [ ] Local checks:
13
+ - [ ] CI:
14
+ - [ ] Docs/examples:
15
+ - [ ] Contract drift check:
16
+
17
+ ## Release Impact
18
+
19
+ - Version impact:
20
+ - Artifact impact:
21
+ - Deploy impact:
22
+
23
+ ## Links
24
+
25
+ - Issue:
26
+ - ADR:
27
+ - Related PRs:
@@ -0,0 +1,34 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ci-${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: astral-sh/setup-uv@v5
20
+ with:
21
+ enable-cache: true
22
+ python-version: "3.11"
23
+
24
+ - name: Sync environment
25
+ run: uv sync --all-groups
26
+
27
+ - name: Ruff check
28
+ run: uv run ruff check .
29
+
30
+ - name: Ruff format (check only)
31
+ run: uv run ruff format --check .
32
+
33
+ - name: Pytest
34
+ run: uv run pytest
@@ -0,0 +1,50 @@
1
+ name: PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v[0-9]+.[0-9]+.[0-9]+"
7
+ - "v[0-9]+.[0-9]+.[0-9]+.*"
8
+
9
+ permissions:
10
+ contents: write
11
+ id-token: write
12
+
13
+ jobs:
14
+ build-and-publish:
15
+ runs-on: ubuntu-latest
16
+ environment:
17
+ name: pypi
18
+ url: https://pypi.org/project/lx-tooling/
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - uses: astral-sh/setup-uv@v5
23
+ with:
24
+ enable-cache: true
25
+ python-version: "3.11"
26
+
27
+ - name: Sync environment
28
+ run: uv sync --all-groups
29
+
30
+ - name: Build sdist and wheel
31
+ run: uv build
32
+
33
+ - name: Upload build artefacts
34
+ uses: actions/upload-artifact@v4
35
+ with:
36
+ name: dist-${{ github.ref_name }}
37
+ path: dist/
38
+
39
+ - name: Create GitHub Release with assets
40
+ uses: softprops/action-gh-release@v2
41
+ with:
42
+ files: dist/*
43
+ generate_release_notes: true
44
+ env:
45
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46
+
47
+ - name: Publish to PyPI
48
+ uses: pypa/gh-action-pypi-publish@release/v1
49
+ with:
50
+ packages-dir: dist/
@@ -0,0 +1,24 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+ .venv/
9
+ .pytest_cache/
10
+ .ruff_cache/
11
+ .mypy_cache/
12
+ .coverage
13
+ htmlcov/
14
+
15
+ # uv
16
+ # uv.lock is committed; the environment is not.
17
+
18
+ # MkDocs (local build; add when docs site lands)
19
+ site/
20
+
21
+ # Editor / OS
22
+ .DS_Store
23
+ .idea/
24
+ .vscode/
@@ -0,0 +1,14 @@
1
+ [repo]
2
+ name = "lx-tooling"
3
+ type = "python-tool"
4
+ release = true
5
+ artifacts = true
6
+
7
+ [workflow]
8
+ local_check = "just check"
9
+ docs_check = ""
10
+ pr_base = "main"
11
+
12
+ [github]
13
+ ready_labels = ["status:ready-for-agent", "agent:allowed"]
14
+ release_labels = ["release:patch", "release:minor", "release:major"]
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,179 @@
1
+ # lx-tooling Agent Guidelines
2
+
3
+ This file defines repository-local guidance for humans and AI coding agents working on `lx-tooling`.
4
+
5
+ Read these first:
6
+
7
+ - [`../AGENTS.md`](../AGENTS.md) — company-wide Labinetix agent rules
8
+ - [`../.VAULT/adr_and_concepts/everyday-development-workflow.md`](../.VAULT/adr_and_concepts/everyday-development-workflow.md) — everyday development workflow
9
+ - [`../.VAULT/adr_and_concepts/gh-workflows.md`](../.VAULT/adr_and_concepts/gh-workflows.md) — GitHub CI/CD workflow
10
+ - [`../.VAULT/adr_and_concepts/programming-language-specific/python-codebase-agents.md`](../.VAULT/adr_and_concepts/programming-language-specific/python-codebase-agents.md) — Python repository manifesto
11
+ - [`docs/design/lx-tooling.md`](docs/design/lx-tooling.md) — authoritative initial design for this repository
12
+
13
+ ## What This Repository Is
14
+
15
+ `lx-tooling` is the Labinetix workflow CLI for humans and AI agents. It orchestrates issue start, workflow checks, pull request preparation, release planning, and repository policy checks.
16
+
17
+ It should make the correct Labinetix workflow easy to follow by wrapping `git`, `gh`, repository metadata, templates, and local policy checks.
18
+
19
+ ## What This Repository Is Not
20
+
21
+ `lx-tooling` does not own:
22
+
23
+ - build implementation details, owned by `lx-toolchains`
24
+ - deployment implementation details, owned by `lx-deploy`
25
+ - hardware validation, owned by `lx-testbench`
26
+ - contract schemas, owned by `lx-contracts`, `lx-interface`, or `lx-parser`
27
+ - runtime behavior, owned by runtime repositories
28
+ - GitHub repository administration as an accidental side effect
29
+
30
+ Do not expand scope without updating `docs/design/lx-tooling.md` and adding an ADR or explicit design note.
31
+
32
+ ## Language and Tooling
33
+
34
+ Start with **Python via `uv`**.
35
+
36
+ - **PyPI distribution:** `lx-tooling`
37
+ - **Import package:** `lx_tooling`
38
+ - **CLI command:** `lx`
39
+ - **Supported Python:** 3.11+
40
+
41
+ Use `uv` for all Python environment, dependency, and run operations:
42
+
43
+ ```bash
44
+ uv sync --all-groups
45
+ uv add <package>
46
+ uv add --dev <package>
47
+ uv remove <package>
48
+ uv run <command>
49
+ uv build
50
+ ```
51
+
52
+ Do not hand-edit dependency sections in `pyproject.toml` when `uv add` or `uv remove` can perform the change. It is acceptable to edit project metadata, CLI entry points, and tool configuration directly.
53
+
54
+ Local checks (must match CI):
55
+
56
+ ```bash
57
+ uv sync --all-groups
58
+ uv run ruff check .
59
+ uv run ruff format --check .
60
+ uv run pytest
61
+ ```
62
+
63
+ Equivalent shortcut:
64
+
65
+ ```bash
66
+ just check
67
+ ```
68
+
69
+ ## Initial Implementation Direction
70
+
71
+ Follow `docs/design/lx-tooling.md`.
72
+
73
+ Milestone 0 should stay read-only and low risk:
74
+
75
+ - Python project with `uv`
76
+ - CLI entry point `lx`
77
+ - `lx repo inspect`
78
+ - `lx workflow check`
79
+ - read-only `lx issue view <number>` wrapper around `gh issue view`
80
+ - tests for policy checks
81
+ - documentation for local development
82
+
83
+ Do not add branch creation, PR creation, tag creation, release creation, or deployment triggers in the first milestone.
84
+
85
+ ## Architecture Rules
86
+
87
+ - Keep pure policy checks separate from filesystem, subprocess, GitHub, and CLI I/O.
88
+ - Wrap `git` and `gh` through small adapter modules.
89
+ - Default risky workflows to dry-run or explanation.
90
+ - Print actionable errors and missing prerequisites.
91
+ - Keep command output deterministic where agents or CI may parse it.
92
+ - Prefer clear policy checks over hidden automation.
93
+
94
+ Suggested package shape:
95
+
96
+ ```text
97
+ src/lx_tooling/
98
+ ├── cli.py
99
+ ├── git.py
100
+ ├── github.py
101
+ ├── policy.py
102
+ ├── repo.py
103
+ ├── templates.py
104
+ └── checks/
105
+ ```
106
+
107
+ ## GitHub CLI Policy
108
+
109
+ `lx-tooling` should use `gh` as the GitHub transport.
110
+
111
+ Allowed early behavior:
112
+
113
+ - read issues
114
+ - read pull requests
115
+ - inspect labels and checks
116
+ - prepare summaries and PR bodies
117
+
118
+ Risky behavior must wait for later milestones and explicit confirmation:
119
+
120
+ - branch creation
121
+ - PR creation
122
+ - tag creation
123
+ - release creation
124
+ - label or milestone edits
125
+ - workflow dispatch
126
+
127
+ Never bypass GitHub branch protection, review requirements, status checks, or environment approvals.
128
+
129
+ ## Testing
130
+
131
+ Use `pytest`.
132
+
133
+ Prioritize:
134
+
135
+ - unit tests for policy checks
136
+ - tests for repository inspection
137
+ - tests for branch-name and label rules
138
+ - tests for command rendering and dry-run behavior
139
+ - CLI smoke tests once the CLI framework is selected
140
+
141
+ Normal PR tests must not require live GitHub calls. Mock `gh` output or use small fixture JSON files.
142
+
143
+ ## Documentation
144
+
145
+ Update `docs/design/lx-tooling.md` when CLI semantics, milestones, or scope change.
146
+
147
+ Add user-facing docs and examples as commands become real:
148
+
149
+ - install and setup
150
+ - authentication expectations for `gh`
151
+ - command examples
152
+ - dry-run examples
153
+ - expected labels and repository metadata
154
+
155
+ ## Release Policy
156
+
157
+ When `lx-tooling` becomes a package, publish installable artifacts to PyPI or a dedicated private PyPI-compatible registry through CI/CD.
158
+
159
+ Release artifacts should be built by CI from protected refs, not by developer machines.
160
+
161
+ ## Agent Safety Rules
162
+
163
+ Agents must not:
164
+
165
+ - publish packages
166
+ - create tags or releases
167
+ - trigger deployment workflows
168
+ - edit GitHub settings
169
+ - store GitHub tokens
170
+ - store device credentials
171
+ - weaken policy checks to make a workflow pass
172
+
173
+ Agents should:
174
+
175
+ - keep work in small slices
176
+ - update tests and docs with behavior changes
177
+ - explain release impact
178
+ - run local checks with `uv run` when practical
179
+ - ask for explicit approval before any mutating GitHub workflow
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Labinetix
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,115 @@
1
+ Metadata-Version: 2.4
2
+ Name: lx-tooling
3
+ Version: 0.1.0
4
+ Summary: Labinetix workflow CLI for humans and AI agents
5
+ Project-URL: Homepage, https://github.com/labinetix/lx-tooling
6
+ Project-URL: Repository, https://github.com/labinetix/lx-tooling
7
+ Project-URL: Documentation, https://github.com/labinetix/lx-tooling/blob/main/docs/design/lx-tooling.md
8
+ Author-email: Fabian Müller <fabianmueller100295@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Requires-Python: >=3.11
12
+ Requires-Dist: typer>=0.26.8
13
+ Description-Content-Type: text/markdown
14
+
15
+ # lx-tooling
16
+
17
+ **Tag:** Org and orchestration
18
+
19
+ **Labinetix workflow CLI** for humans and AI agents. `lx-tooling` orchestrates GitHub issues, branches, pull requests, releases, local verification, and repository policy checks without owning domain logic.
20
+
21
+ **Non-goals:** model semantics, ABI schema ownership, runtime algorithms, or protocol implementations.
22
+
23
+ ## Stability
24
+
25
+ Milestone 0 — read-only commands only. Branch creation, PR creation, tags, and releases come in later milestones.
26
+
27
+ ## Quickstart
28
+
29
+ Prerequisites:
30
+
31
+ - Python 3.11+
32
+ - [`uv`](https://docs.astral.sh/uv/)
33
+ - [`gh`](https://cli.github.com/) for `lx issue view`
34
+
35
+ Local development:
36
+
37
+ ```bash
38
+ git clone git@github.com:labinetix/lx-tooling.git
39
+ cd lx-tooling
40
+ uv sync --all-groups
41
+ uv run lx --version
42
+ ```
43
+
44
+ Local checks (same as CI):
45
+
46
+ ```bash
47
+ just check
48
+ ```
49
+
50
+ Or explicitly:
51
+
52
+ ```bash
53
+ uv sync --all-groups
54
+ uv run ruff check .
55
+ uv run ruff format --check .
56
+ uv run pytest
57
+ ```
58
+
59
+ ## Install
60
+
61
+ From PyPI after release:
62
+
63
+ ```bash
64
+ uv tool install lx-tooling
65
+ lx --version
66
+ ```
67
+
68
+ From a checkout:
69
+
70
+ ```bash
71
+ uv sync --all-groups
72
+ uv run lx --help
73
+ ```
74
+
75
+ ## Commands (Milestone 0)
76
+
77
+ Inspect the current repository:
78
+
79
+ ```bash
80
+ lx repo inspect
81
+ lx repo inspect --json
82
+ ```
83
+
84
+ Run conservative pre-PR checks:
85
+
86
+ ```bash
87
+ lx workflow check
88
+ ```
89
+
90
+ Read a GitHub issue with Labinetix readiness hints:
91
+
92
+ ```bash
93
+ gh auth login
94
+ lx issue view 123
95
+ ```
96
+
97
+ See [`docs/examples/repo-inspect.md`](docs/examples/repo-inspect.md) for sample output.
98
+
99
+ ## Design and Agent Rules
100
+
101
+ - Design: [`docs/design/lx-tooling.md`](docs/design/lx-tooling.md)
102
+ - Agent rules: [`AGENTS.md`](AGENTS.md)
103
+
104
+ ## Releases and Artifacts
105
+
106
+ - Package name on PyPI: `lx-tooling`
107
+ - CLI command: `lx`
108
+ - Latest release: see [GitHub Releases](https://github.com/labinetix/lx-tooling/releases)
109
+ - Release artifacts: built by CI on protected SemVer tags (`v*`), published to PyPI via trusted publishing (`pypi.yml`, environment `pypi`)
110
+
111
+ Release checklist for maintainers:
112
+
113
+ 1. Merge changes to `main`
114
+ 2. Tag `v0.y.z` on `main`
115
+ 3. CI builds wheel/sdist, creates GitHub Release, publishes to PyPI
@@ -0,0 +1,101 @@
1
+ # lx-tooling
2
+
3
+ **Tag:** Org and orchestration
4
+
5
+ **Labinetix workflow CLI** for humans and AI agents. `lx-tooling` orchestrates GitHub issues, branches, pull requests, releases, local verification, and repository policy checks without owning domain logic.
6
+
7
+ **Non-goals:** model semantics, ABI schema ownership, runtime algorithms, or protocol implementations.
8
+
9
+ ## Stability
10
+
11
+ Milestone 0 — read-only commands only. Branch creation, PR creation, tags, and releases come in later milestones.
12
+
13
+ ## Quickstart
14
+
15
+ Prerequisites:
16
+
17
+ - Python 3.11+
18
+ - [`uv`](https://docs.astral.sh/uv/)
19
+ - [`gh`](https://cli.github.com/) for `lx issue view`
20
+
21
+ Local development:
22
+
23
+ ```bash
24
+ git clone git@github.com:labinetix/lx-tooling.git
25
+ cd lx-tooling
26
+ uv sync --all-groups
27
+ uv run lx --version
28
+ ```
29
+
30
+ Local checks (same as CI):
31
+
32
+ ```bash
33
+ just check
34
+ ```
35
+
36
+ Or explicitly:
37
+
38
+ ```bash
39
+ uv sync --all-groups
40
+ uv run ruff check .
41
+ uv run ruff format --check .
42
+ uv run pytest
43
+ ```
44
+
45
+ ## Install
46
+
47
+ From PyPI after release:
48
+
49
+ ```bash
50
+ uv tool install lx-tooling
51
+ lx --version
52
+ ```
53
+
54
+ From a checkout:
55
+
56
+ ```bash
57
+ uv sync --all-groups
58
+ uv run lx --help
59
+ ```
60
+
61
+ ## Commands (Milestone 0)
62
+
63
+ Inspect the current repository:
64
+
65
+ ```bash
66
+ lx repo inspect
67
+ lx repo inspect --json
68
+ ```
69
+
70
+ Run conservative pre-PR checks:
71
+
72
+ ```bash
73
+ lx workflow check
74
+ ```
75
+
76
+ Read a GitHub issue with Labinetix readiness hints:
77
+
78
+ ```bash
79
+ gh auth login
80
+ lx issue view 123
81
+ ```
82
+
83
+ See [`docs/examples/repo-inspect.md`](docs/examples/repo-inspect.md) for sample output.
84
+
85
+ ## Design and Agent Rules
86
+
87
+ - Design: [`docs/design/lx-tooling.md`](docs/design/lx-tooling.md)
88
+ - Agent rules: [`AGENTS.md`](AGENTS.md)
89
+
90
+ ## Releases and Artifacts
91
+
92
+ - Package name on PyPI: `lx-tooling`
93
+ - CLI command: `lx`
94
+ - Latest release: see [GitHub Releases](https://github.com/labinetix/lx-tooling/releases)
95
+ - Release artifacts: built by CI on protected SemVer tags (`v*`), published to PyPI via trusted publishing (`pypi.yml`, environment `pypi`)
96
+
97
+ Release checklist for maintainers:
98
+
99
+ 1. Merge changes to `main`
100
+ 2. Tag `v0.y.z` on `main`
101
+ 3. CI builds wheel/sdist, creates GitHub Release, publishes to PyPI