stewardkit 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 (50) hide show
  1. stewardkit-0.1.0/.claude-plugin/marketplace.json +34 -0
  2. stewardkit-0.1.0/.claude-plugin/plugin.json +20 -0
  3. stewardkit-0.1.0/.gitattributes +3 -0
  4. stewardkit-0.1.0/.github/copilot-instructions.md +35 -0
  5. stewardkit-0.1.0/.github/dependabot.yml +21 -0
  6. stewardkit-0.1.0/.github/instructions/stewardkit.instructions.md +40 -0
  7. stewardkit-0.1.0/.github/workflows/ci.yml +194 -0
  8. stewardkit-0.1.0/.github/workflows/release.yml +148 -0
  9. stewardkit-0.1.0/.gitignore +18 -0
  10. stewardkit-0.1.0/.pre-commit-hooks.yaml +23 -0
  11. stewardkit-0.1.0/.stewardkit.toml +45 -0
  12. stewardkit-0.1.0/AGENTS.md +39 -0
  13. stewardkit-0.1.0/CHANGELOG.md +31 -0
  14. stewardkit-0.1.0/CLAUDE.md +35 -0
  15. stewardkit-0.1.0/CONTRIBUTING.md +58 -0
  16. stewardkit-0.1.0/LICENSE +21 -0
  17. stewardkit-0.1.0/PKG-INFO +300 -0
  18. stewardkit-0.1.0/README.md +276 -0
  19. stewardkit-0.1.0/SECURITY.md +23 -0
  20. stewardkit-0.1.0/docs/configuration.md +508 -0
  21. stewardkit-0.1.0/docs/findings.md +31 -0
  22. stewardkit-0.1.0/docs/how-it-works.md +230 -0
  23. stewardkit-0.1.0/docs/intent.md +19 -0
  24. stewardkit-0.1.0/docs/nits/README.md +22 -0
  25. stewardkit-0.1.0/docs/nits/ergonomics.md +7 -0
  26. stewardkit-0.1.0/docs/nits/refactor.md +7 -0
  27. stewardkit-0.1.0/docs/tests.md +171 -0
  28. stewardkit-0.1.0/plugin.json +13 -0
  29. stewardkit-0.1.0/pyproject.toml +60 -0
  30. stewardkit-0.1.0/rules/AGENTS.md +20 -0
  31. stewardkit-0.1.0/skills/steward-init/SKILL.md +83 -0
  32. stewardkit-0.1.0/skills/steward-intent-bar/SKILL.md +73 -0
  33. stewardkit-0.1.0/skills/steward-orchestrate/SKILL.md +68 -0
  34. stewardkit-0.1.0/skills/steward-sweep/SKILL.md +89 -0
  35. stewardkit-0.1.0/src/stewardkit/__init__.py +7 -0
  36. stewardkit-0.1.0/src/stewardkit/cli.py +1110 -0
  37. stewardkit-0.1.0/src/stewardkit/config.py +2784 -0
  38. stewardkit-0.1.0/src/stewardkit/doctor.py +947 -0
  39. stewardkit-0.1.0/src/stewardkit/harnesses.py +351 -0
  40. stewardkit-0.1.0/src/stewardkit/installer.py +1223 -0
  41. stewardkit-0.1.0/src/stewardkit/markers.py +283 -0
  42. stewardkit-0.1.0/src/stewardkit/templates.py +201 -0
  43. stewardkit-0.1.0/src/stewardkit/test_parity.py +1479 -0
  44. stewardkit-0.1.0/tests/test_cli_init_sync.py +1455 -0
  45. stewardkit-0.1.0/tests/test_doctor.py +1348 -0
  46. stewardkit-0.1.0/tests/test_harnesses.py +2178 -0
  47. stewardkit-0.1.0/tests/test_install_global.py +1135 -0
  48. stewardkit-0.1.0/tests/test_markers.py +188 -0
  49. stewardkit-0.1.0/tests/test_test_parity.py +1030 -0
  50. stewardkit-0.1.0/uv.lock +92 -0
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "stewardkit",
4
+ "owner": {
5
+ "name": "Mitchell Abbott"
6
+ },
7
+ "metadata": {
8
+ "description": "Multi-harness specialist orchestration, intent-first quality bar, frozen read-only review sweeps, and findings tracking for software repositories.",
9
+ "version": "0.1.0"
10
+ },
11
+ "plugins": [
12
+ {
13
+ "name": "stewardkit",
14
+ "source": "./",
15
+ "description": "Multi-harness specialist orchestration, intent-first quality bar, frozen read-only review sweeps, and findings tracking for software repositories.",
16
+ "version": "0.1.0",
17
+ "author": {
18
+ "name": "Mitchell Abbott"
19
+ },
20
+ "homepage": "https://github.com/mitchell-abbott/stewardkit",
21
+ "repository": "https://github.com/mitchell-abbott/stewardkit",
22
+ "license": "MIT",
23
+ "keywords": [
24
+ "workflow",
25
+ "code-review",
26
+ "orchestration",
27
+ "multi-agent",
28
+ "skills",
29
+ "quality-bar",
30
+ "triage"
31
+ ]
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "stewardkit",
3
+ "version": "0.1.0",
4
+ "description": "Multi-harness specialist orchestration, intent-first quality bar, frozen read-only review sweeps, and findings tracking for software repositories.",
5
+ "author": {
6
+ "name": "Mitchell Abbott"
7
+ },
8
+ "repository": "https://github.com/mitchell-abbott/stewardkit",
9
+ "license": "MIT",
10
+ "keywords": [
11
+ "workflow",
12
+ "code-review",
13
+ "orchestration",
14
+ "multi-agent",
15
+ "skills",
16
+ "quality-bar",
17
+ "triage"
18
+ ],
19
+ "skills": "./skills"
20
+ }
@@ -0,0 +1,3 @@
1
+ * text=auto eol=lf
2
+ *.bat text eol=crlf
3
+ *.ps1 text eol=crlf
@@ -0,0 +1,35 @@
1
+ <!-- stewardkit:start -->
2
+ ## Workflow Contract (`stewardkit`)
3
+
4
+ Read `.stewardkit.toml` (`[stewardkit]` `profile`, `git`, `hygiene`, `bar`, `docs`, `tests`) first; honor gitignored `.stewardkit.local.toml` overrides (never shared rules). Light profile streamlines review/findings/nits ceremony. Keep unmanaged repo rules in one canonical file (e.g., `AGENTS.md`); point secondary harness files to it.
5
+
6
+ ### Specialists Do the Work
7
+ - Per `orchestration_mode`: delegate code, tests, docs, checks, git, research, triage, and cleanup to specialists (lead orchestrates; state rare exceptions), or switch hats per phase with an isolated clean-diff review pass.
8
+ - Follow `skills_mode` (global only; never copy into repos). If none exist and `recommended_specialist_catalog` is set, suggest optionally.
9
+
10
+ ### Branches & Clean Sweep Gate
11
+ - Put new code on its own branch, never `git.default_branch`; after a clean sweep (if no sweep skill exists, ask owner), deliver per `git.delivery_mode` with `git.merge_strategy`.
12
+ - Reviews cover only the branch diff and interaction surface (callers, readers, UI, data, docs), never whole-repo re-reads.
13
+
14
+ ### Intent First, The Bar & Real Cases
15
+ - `docs.intent` is source of truth (`steward-init` onboards repos). Gaps vs it are findings; propagate owner decisions (`docs.intent`, `docs.how_it_works`, README) in the same turn. Format timestamps per `docs.timezone` (`local` = local TZ, fallback UTC) and `docs.clock_format`.
16
+ - **Only findings:** bugs; noisy/wrong alerts; bypassed safety rules; wrong docs; doc-reading tests (`tests.check_doc_readers`); `docs.tests` parity gaps (when `bar.require_tests_doc_parity = true`); avoidable manual owner steps.
17
+ - Everything else (wording, style, coverage edges, refactors) is **not** a finding: if `docs.nits_dir` is set, log by category in `<nits_dir>/<category>.md` (sweep-exempt; owner's schedule).
18
+ - When `bar.real_cases_only = true`, handle domain edge cases only with a verified real instance (entity, dates, primary source) cited beside its test in `docs.tests` (or test docstring/comment when `bar.require_tests_doc_parity = false`); drop hypotheticals, never safety/intent guards.
19
+
20
+ ### Fix by Class, Fresh Re-Reviewers & Coherence
21
+ - Reviewers/repeat checkers are read-only; never edit while one runs.
22
+ - Enumerate each failure class as failing tests under `tests.roots` (`tests.ignore_globs`); fix the whole class in one round.
23
+ - Re-reviews use a fresh same-specialty reviewer with prior report and tests; fix re-review findings in the same round.
24
+ - On same-spot conflicts, run a coherence check, pass both test sets, and log under "Same-spot choices" in `docs.how_it_works`.
25
+
26
+ ### Tests, Parity & Findings Hygiene
27
+ - When `bar.require_tests_doc_parity = true`, map `docs.tests` 1:1 by category and `### <file>` (`stewardkit check-tests`).
28
+ - When `bar.no_test_figures_in_docs = true`, keep test figures only in unit tests, never `.md`; never hand-validate figures.
29
+ - `docs.findings` tracks branch status, findings, and follow-ups; `bar.exempt_review_files` are never flagged; dropped items stay `Dropped` with reason. Zero-code/test-line rounds never re-trigger sweeps.
30
+
31
+ ### Anti-Loop, Owner Lock & Hygiene
32
+ - Follow `hygiene.allow_overnight_loops` (`false` = stop at clean checkpoint). Pause on non-convergence or > `hygiene.max_followups_before_checkin` new follow-ups (`> 0`).
33
+ - Owner lock: never narrow rules, edit `bar.protected_files` unapproved, or weaken safety guards.
34
+ - If `hygiene.min_free_disk_gb > 0`, check free disk at `hygiene.disk_check_path` (default: repo root) before sweeps/fixes; use scratchpad `--basetemp` and clean temps. Never force-push or stage `git.blocked_staged_globs`.
35
+ <!-- stewardkit:end -->
@@ -0,0 +1,21 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
7
+ open-pull-requests-limit: 1
8
+ groups:
9
+ github-actions:
10
+ patterns:
11
+ - "*"
12
+
13
+ - package-ecosystem: "uv"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "monthly"
17
+ open-pull-requests-limit: 1
18
+ groups:
19
+ python-dependencies:
20
+ patterns:
21
+ - "*"
@@ -0,0 +1,40 @@
1
+ ---
2
+ applyTo: "**"
3
+ description: "Project workflow rules managed by stewardkit (specialists, branch-and-sweep, intent-first bar, test parity)."
4
+ ---
5
+
6
+ <!-- stewardkit:start -->
7
+ ## Workflow Contract (`stewardkit`)
8
+
9
+ Read `.stewardkit.toml` (`[stewardkit]` `profile`, `git`, `hygiene`, `bar`, `docs`, `tests`) first; honor gitignored `.stewardkit.local.toml` overrides (never shared rules). Light profile streamlines review/findings/nits ceremony. Keep unmanaged repo rules in one canonical file (e.g., `AGENTS.md`); point secondary harness files to it.
10
+
11
+ ### Specialists Do the Work
12
+ - Per `orchestration_mode`: delegate code, tests, docs, checks, git, research, triage, and cleanup to specialists (lead orchestrates; state rare exceptions), or switch hats per phase with an isolated clean-diff review pass.
13
+ - Follow `skills_mode` (global only; never copy into repos). If none exist and `recommended_specialist_catalog` is set, suggest optionally.
14
+
15
+ ### Branches & Clean Sweep Gate
16
+ - Put new code on its own branch, never `git.default_branch`; after a clean sweep (if no sweep skill exists, ask owner), deliver per `git.delivery_mode` with `git.merge_strategy`.
17
+ - Reviews cover only the branch diff and interaction surface (callers, readers, UI, data, docs), never whole-repo re-reads.
18
+
19
+ ### Intent First, The Bar & Real Cases
20
+ - `docs.intent` is source of truth (`steward-init` onboards repos). Gaps vs it are findings; propagate owner decisions (`docs.intent`, `docs.how_it_works`, README) in the same turn. Format timestamps per `docs.timezone` (`local` = local TZ, fallback UTC) and `docs.clock_format`.
21
+ - **Only findings:** bugs; noisy/wrong alerts; bypassed safety rules; wrong docs; doc-reading tests (`tests.check_doc_readers`); `docs.tests` parity gaps (when `bar.require_tests_doc_parity = true`); avoidable manual owner steps.
22
+ - Everything else (wording, style, coverage edges, refactors) is **not** a finding: if `docs.nits_dir` is set, log by category in `<nits_dir>/<category>.md` (sweep-exempt; owner's schedule).
23
+ - When `bar.real_cases_only = true`, handle domain edge cases only with a verified real instance (entity, dates, primary source) cited beside its test in `docs.tests` (or test docstring/comment when `bar.require_tests_doc_parity = false`); drop hypotheticals, never safety/intent guards.
24
+
25
+ ### Fix by Class, Fresh Re-Reviewers & Coherence
26
+ - Reviewers/repeat checkers are read-only; never edit while one runs.
27
+ - Enumerate each failure class as failing tests under `tests.roots` (`tests.ignore_globs`); fix the whole class in one round.
28
+ - Re-reviews use a fresh same-specialty reviewer with prior report and tests; fix re-review findings in the same round.
29
+ - On same-spot conflicts, run a coherence check, pass both test sets, and log under "Same-spot choices" in `docs.how_it_works`.
30
+
31
+ ### Tests, Parity & Findings Hygiene
32
+ - When `bar.require_tests_doc_parity = true`, map `docs.tests` 1:1 by category and `### <file>` (`stewardkit check-tests`).
33
+ - When `bar.no_test_figures_in_docs = true`, keep test figures only in unit tests, never `.md`; never hand-validate figures.
34
+ - `docs.findings` tracks branch status, findings, and follow-ups; `bar.exempt_review_files` are never flagged; dropped items stay `Dropped` with reason. Zero-code/test-line rounds never re-trigger sweeps.
35
+
36
+ ### Anti-Loop, Owner Lock & Hygiene
37
+ - Follow `hygiene.allow_overnight_loops` (`false` = stop at clean checkpoint). Pause on non-convergence or > `hygiene.max_followups_before_checkin` new follow-ups (`> 0`).
38
+ - Owner lock: never narrow rules, edit `bar.protected_files` unapproved, or weaken safety guards.
39
+ - If `hygiene.min_free_disk_gb > 0`, check free disk at `hygiene.disk_check_path` (default: repo root) before sweeps/fixes; use scratchpad `--basetemp` and clean temps. Never force-push or stage `git.blocked_staged_globs`.
40
+ <!-- stewardkit:end -->
@@ -0,0 +1,194 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
15
+
16
+ jobs:
17
+ linux-fast:
18
+ runs-on: ubuntu-latest
19
+ timeout-minutes: 10
20
+ env:
21
+ UV_PYTHON: "3.11"
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
25
+
26
+ - name: Set up uv
27
+ uses: astral-sh/setup-uv@2a39bcff78b189a5800d31cfcf0205c7a3e8381e # v10.4.1
28
+ with:
29
+ enable-cache: true
30
+
31
+ - name: Install Python 3.11
32
+ run: uv python install 3.11
33
+
34
+ - name: Sync dependencies
35
+ run: uv sync --frozen --dev
36
+
37
+ - name: Run unit tests
38
+ run: uv run pytest
39
+
40
+ - name: Check test-doc parity
41
+ run: uv run stewardkit check-tests --json
42
+
43
+ - name: Check managed harness sync
44
+ run: uv run stewardkit sync --check --json
45
+
46
+ - name: Run doctor diagnostics
47
+ run: uv run stewardkit doctor --json
48
+
49
+ - name: Wheel build smoke check
50
+ run: |
51
+ uv build --wheel --out-dir dist-ci
52
+ uv run python -c "
53
+ import json, os, pathlib, shutil, subprocess, sys, tempfile, zipfile
54
+ dist_dir = pathlib.Path('dist-ci').resolve()
55
+ tmp_root = pathlib.Path(tempfile.mkdtemp(prefix='sk-wheel-smoke-'))
56
+ try:
57
+ wheels = sorted(dist_dir.glob('*.whl'))
58
+ assert len(wheels) == 1, wheels
59
+ wheel = wheels[0]
60
+ with zipfile.ZipFile(wheel) as zf:
61
+ names = set(zf.namelist())
62
+ assert 'stewardkit/_kit_data/plugin.json' in names
63
+ assert 'stewardkit/_kit_data/.claude-plugin/plugin.json' in names
64
+ assert 'stewardkit/_kit_data/rules/AGENTS.md' in names
65
+ assert any(n.startswith('stewardkit/_kit_data/skills/') and n.endswith('/SKILL.md') for n in names)
66
+ assert any(n.endswith('.dist-info/licenses/LICENSE') for n in names)
67
+
68
+ venv_dir = tmp_root / 'venv'
69
+ workdir = tmp_root / 'outside'
70
+ home_dir = tmp_root / 'home'
71
+ workdir.mkdir()
72
+ home_dir.mkdir()
73
+
74
+ subprocess.run(['uv', 'venv', '--python', sys.executable, str(venv_dir)], check=True)
75
+ venv_python = venv_dir / ('Scripts/python.exe' if sys.platform == 'win32' else 'bin/python')
76
+ subprocess.run(
77
+ ['uv', 'pip', 'install', '--python', str(venv_python), '--no-deps', str(wheel)],
78
+ check=True,
79
+ )
80
+
81
+ env = os.environ.copy()
82
+ env.pop('STEWARDKIT_ROOT', None)
83
+ venv_cli = venv_dir / (
84
+ 'Scripts/stewardkit.exe' if sys.platform == 'win32' else 'bin/stewardkit'
85
+ )
86
+ proc = subprocess.run(
87
+ [str(venv_cli), 'config', '--home', str(home_dir), '--json'],
88
+ cwd=str(workdir),
89
+ env=env,
90
+ capture_output=True,
91
+ text=True,
92
+ check=True,
93
+ )
94
+ payload = json.loads(proc.stdout)
95
+ assert payload['mode'] == 'global', payload
96
+ assert payload['profile'] == 'standard', payload
97
+ finally:
98
+ shutil.rmtree(tmp_root, ignore_errors=True)
99
+ shutil.rmtree(dist_dir, ignore_errors=True)
100
+ "
101
+
102
+ matrix:
103
+ needs: linux-fast
104
+ timeout-minutes: 10
105
+ strategy:
106
+ fail-fast: false
107
+ matrix:
108
+ os: [ubuntu-latest, macos-latest, windows-latest]
109
+ python-version: ["3.11", "3.12", "3.13"]
110
+ exclude:
111
+ - os: ubuntu-latest
112
+ python-version: "3.11"
113
+ runs-on: ${{ matrix.os }}
114
+ env:
115
+ UV_PYTHON: ${{ matrix.python-version }}
116
+ steps:
117
+ - name: Checkout repository
118
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
119
+
120
+ - name: Set up uv
121
+ uses: astral-sh/setup-uv@2a39bcff78b189a5800d31cfcf0205c7a3e8381e # v10.4.1
122
+ with:
123
+ enable-cache: true
124
+
125
+ - name: Install Python ${{ matrix.python-version }}
126
+ run: uv python install ${{ matrix.python-version }}
127
+
128
+ - name: Sync dependencies
129
+ run: uv sync --frozen --dev
130
+
131
+ - name: Run unit tests
132
+ run: uv run pytest
133
+
134
+ - name: Check test-doc parity
135
+ run: uv run stewardkit check-tests --json
136
+
137
+ - name: Check managed harness sync
138
+ run: uv run stewardkit sync --check --json
139
+
140
+ - name: Run doctor diagnostics
141
+ run: uv run stewardkit doctor --json
142
+
143
+ - name: Wheel build smoke check
144
+ run: |
145
+ uv build --wheel --out-dir dist-ci
146
+ uv run python -c "
147
+ import json, os, pathlib, shutil, subprocess, sys, tempfile, zipfile
148
+ dist_dir = pathlib.Path('dist-ci').resolve()
149
+ tmp_root = pathlib.Path(tempfile.mkdtemp(prefix='sk-wheel-smoke-'))
150
+ try:
151
+ wheels = sorted(dist_dir.glob('*.whl'))
152
+ assert len(wheels) == 1, wheels
153
+ wheel = wheels[0]
154
+ with zipfile.ZipFile(wheel) as zf:
155
+ names = set(zf.namelist())
156
+ assert 'stewardkit/_kit_data/plugin.json' in names
157
+ assert 'stewardkit/_kit_data/.claude-plugin/plugin.json' in names
158
+ assert 'stewardkit/_kit_data/rules/AGENTS.md' in names
159
+ assert any(n.startswith('stewardkit/_kit_data/skills/') and n.endswith('/SKILL.md') for n in names)
160
+ assert any(n.endswith('.dist-info/licenses/LICENSE') for n in names)
161
+
162
+ venv_dir = tmp_root / 'venv'
163
+ workdir = tmp_root / 'outside'
164
+ home_dir = tmp_root / 'home'
165
+ workdir.mkdir()
166
+ home_dir.mkdir()
167
+
168
+ subprocess.run(['uv', 'venv', '--python', sys.executable, str(venv_dir)], check=True)
169
+ venv_python = venv_dir / ('Scripts/python.exe' if sys.platform == 'win32' else 'bin/python')
170
+ subprocess.run(
171
+ ['uv', 'pip', 'install', '--python', str(venv_python), '--no-deps', str(wheel)],
172
+ check=True,
173
+ )
174
+
175
+ env = os.environ.copy()
176
+ env.pop('STEWARDKIT_ROOT', None)
177
+ venv_cli = venv_dir / (
178
+ 'Scripts/stewardkit.exe' if sys.platform == 'win32' else 'bin/stewardkit'
179
+ )
180
+ proc = subprocess.run(
181
+ [str(venv_cli), 'config', '--home', str(home_dir), '--json'],
182
+ cwd=str(workdir),
183
+ env=env,
184
+ capture_output=True,
185
+ text=True,
186
+ check=True,
187
+ )
188
+ payload = json.loads(proc.stdout)
189
+ assert payload['mode'] == 'global', payload
190
+ assert payload['profile'] == 'standard', payload
191
+ finally:
192
+ shutil.rmtree(tmp_root, ignore_errors=True)
193
+ shutil.rmtree(dist_dir, ignore_errors=True)
194
+ "
@@ -0,0 +1,148 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ timeout-minutes: 10
15
+ env:
16
+ UV_PYTHON: "3.12"
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
+
21
+ - name: Set up uv
22
+ uses: astral-sh/setup-uv@2a39bcff78b189a5800d31cfcf0205c7a3e8381e # v10.4.1
23
+ with:
24
+ enable-cache: true
25
+
26
+ - name: Install Python 3.12
27
+ run: uv python install 3.12
28
+
29
+ - name: Sync dependencies
30
+ run: uv sync --frozen --dev
31
+
32
+ - name: Verify tag matches pyproject.toml version
33
+ run: |
34
+ TAG_VERSION="${GITHUB_REF_NAME#v}" uv run python -c "
35
+ import os, pathlib, tomllib
36
+ tag_version = os.environ['TAG_VERSION']
37
+ pkg_version = tomllib.loads(pathlib.Path('pyproject.toml').read_text(encoding='utf-8'))['project']['version']
38
+ assert tag_version == pkg_version, f'Tag version {tag_version!r} != pyproject.toml version {pkg_version!r}'
39
+ "
40
+
41
+ - name: Run unit tests
42
+ run: uv run pytest
43
+
44
+ - name: Check test-doc parity
45
+ run: uv run stewardkit check-tests --json
46
+
47
+ - name: Check managed harness sync
48
+ run: uv run stewardkit sync --check --json
49
+
50
+ - name: Run doctor diagnostics
51
+ run: uv run stewardkit doctor --json
52
+
53
+ - name: Build sdist and wheel
54
+ run: uv build
55
+
56
+ - name: Wheel build smoke check
57
+ run: |
58
+ uv run python -c "
59
+ import json, os, pathlib, shutil, subprocess, sys, tempfile, zipfile
60
+ dist_dir = pathlib.Path('dist').resolve()
61
+ tmp_root = pathlib.Path(tempfile.mkdtemp(prefix='sk-release-smoke-'))
62
+ try:
63
+ wheels = sorted(dist_dir.glob('*.whl'))
64
+ assert len(wheels) == 1, wheels
65
+ wheel = wheels[0]
66
+ with zipfile.ZipFile(wheel) as zf:
67
+ names = set(zf.namelist())
68
+ assert 'stewardkit/_kit_data/plugin.json' in names
69
+ assert 'stewardkit/_kit_data/.claude-plugin/plugin.json' in names
70
+ assert 'stewardkit/_kit_data/rules/AGENTS.md' in names
71
+ assert any(n.startswith('stewardkit/_kit_data/skills/') and n.endswith('/SKILL.md') for n in names)
72
+ assert any(n.endswith('.dist-info/licenses/LICENSE') for n in names)
73
+
74
+ venv_dir = tmp_root / 'venv'
75
+ workdir = tmp_root / 'outside'
76
+ home_dir = tmp_root / 'home'
77
+ workdir.mkdir()
78
+ home_dir.mkdir()
79
+
80
+ subprocess.run(['uv', 'venv', '--python', sys.executable, str(venv_dir)], check=True)
81
+ venv_python = venv_dir / ('Scripts/python.exe' if sys.platform == 'win32' else 'bin/python')
82
+ subprocess.run(
83
+ ['uv', 'pip', 'install', '--python', str(venv_python), '--no-deps', str(wheel)],
84
+ check=True,
85
+ )
86
+
87
+ env = os.environ.copy()
88
+ env.pop('STEWARDKIT_ROOT', None)
89
+ venv_cli = venv_dir / (
90
+ 'Scripts/stewardkit.exe' if sys.platform == 'win32' else 'bin/stewardkit'
91
+ )
92
+ proc = subprocess.run(
93
+ [str(venv_cli), 'config', '--home', str(home_dir), '--json'],
94
+ cwd=str(workdir),
95
+ env=env,
96
+ capture_output=True,
97
+ text=True,
98
+ check=True,
99
+ )
100
+ payload = json.loads(proc.stdout)
101
+ assert payload['mode'] == 'global', payload
102
+ assert payload['profile'] == 'standard', payload
103
+ finally:
104
+ shutil.rmtree(tmp_root, ignore_errors=True)
105
+ "
106
+
107
+ - name: Upload release distributions
108
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
109
+ with:
110
+ name: release-dists
111
+ path: dist/
112
+
113
+ publish-pypi:
114
+ needs: build
115
+ runs-on: ubuntu-latest
116
+ timeout-minutes: 10
117
+ environment:
118
+ name: pypi
119
+ url: https://pypi.org/p/stewardkit
120
+ permissions:
121
+ id-token: write
122
+ steps:
123
+ - name: Download release distributions
124
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
125
+ with:
126
+ name: release-dists
127
+ path: dist/
128
+
129
+ - name: Publish distributions to PyPI
130
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
131
+
132
+ github-release:
133
+ needs: publish-pypi
134
+ runs-on: ubuntu-latest
135
+ timeout-minutes: 10
136
+ permissions:
137
+ contents: write
138
+ steps:
139
+ - name: Download release distributions
140
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
141
+ with:
142
+ name: release-dists
143
+ path: dist/
144
+
145
+ - name: Create GitHub Release
146
+ env:
147
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148
+ run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --generate-notes --title "stewardkit $GITHUB_REF_NAME"
@@ -0,0 +1,18 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .pytest_cache/
4
+ .venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .env
9
+ .stewardkit.local.toml
10
+ .DS_Store
11
+ Thumbs.db
12
+ *.db
13
+ .idea/
14
+ .junie/plans/
15
+ .coverage
16
+ htmlcov/
17
+ .mypy_cache/
18
+ .ruff_cache/
@@ -0,0 +1,23 @@
1
+ - id: stewardkit-sync-check
2
+ name: stewardkit sync --check
3
+ description: Verify managed workflow blocks across configured harness rule files have zero drift.
4
+ entry: stewardkit sync --check
5
+ language: python
6
+ pass_filenames: false
7
+ always_run: true
8
+
9
+ - id: stewardkit-check-tests
10
+ name: stewardkit check-tests
11
+ description: Verify 1:1 parity between test files and the configured tests doc plus doc-reader checks.
12
+ entry: stewardkit check-tests
13
+ language: python
14
+ pass_filenames: false
15
+ always_run: true
16
+
17
+ - id: stewardkit-doctor
18
+ name: stewardkit doctor
19
+ description: Run stewardkit environment, manifest, sync, git hygiene, and test-parity diagnostics.
20
+ entry: stewardkit doctor
21
+ language: python
22
+ pass_filenames: false
23
+ always_run: true
@@ -0,0 +1,45 @@
1
+ # Managed by stewardkit. Edit settings here and run `stewardkit sync`.
2
+
3
+ [stewardkit]
4
+ schema_version = 1
5
+ profile = "strict"
6
+ orchestration_mode = "auto"
7
+ harnesses = ["antigravity", "claude", "codex", "copilot", "junie", "opencode", "pi", "qwen", "deepseek", "goose"]
8
+ antigravity_file = "AGENTS.md"
9
+ junie_legacy_guidelines = false
10
+ copilot_apply_to = "**"
11
+ skills_mode = "global"
12
+ recommended_specialist_catalog = "https://github.com/msitarzewski/agency-agents"
13
+
14
+ [stewardkit.git]
15
+ default_branch = "main"
16
+ delivery_mode = "pull-request"
17
+ merge_strategy = "squash"
18
+ blocked_staged_globs = [".env", ".env.*", ".stewardkit.local.toml", "*.db", "*.sqlite", "*.sqlite3", "*.pem", "*.key"]
19
+
20
+ [stewardkit.hygiene]
21
+ min_free_disk_gb = 5.0
22
+ disk_check_path = ""
23
+ max_followups_before_checkin = 2
24
+ allow_overnight_loops = false
25
+
26
+ [stewardkit.bar]
27
+ real_cases_only = false
28
+ no_test_figures_in_docs = true
29
+ require_tests_doc_parity = true
30
+ protected_files = ["docs/intent.md"]
31
+ exempt_review_files = ["docs/findings.md", "docs/nits"]
32
+
33
+ [stewardkit.docs]
34
+ intent = "docs/intent.md"
35
+ how_it_works = "docs/how-it-works.md"
36
+ tests = "docs/tests.md"
37
+ findings = "docs/findings.md"
38
+ nits_dir = "docs/nits"
39
+ timezone = "local"
40
+ clock_format = "12h"
41
+
42
+ [stewardkit.tests]
43
+ roots = ["tests"]
44
+ check_doc_readers = true
45
+ ignore_globs = []
@@ -0,0 +1,39 @@
1
+ # StewardKit (`stewardkit`)
2
+
3
+ This repository dogfoods `stewardkit` itself: Python `>=3.11` stdlib-only on macOS/Linux (`tzdata` on Windows) and a dual-native Antigravity (`plugin.json`) + Claude Code (`.claude-plugin/plugin.json`) plugin root.
4
+
5
+ <!-- stewardkit:start -->
6
+ ## Workflow Contract (`stewardkit`)
7
+
8
+ Read `.stewardkit.toml` (`[stewardkit]` `profile`, `git`, `hygiene`, `bar`, `docs`, `tests`) first; honor gitignored `.stewardkit.local.toml` overrides (never shared rules). Light profile streamlines review/findings/nits ceremony. Keep unmanaged repo rules in one canonical file (e.g., `AGENTS.md`); point secondary harness files to it.
9
+
10
+ ### Specialists Do the Work
11
+ - Per `orchestration_mode`: delegate code, tests, docs, checks, git, research, triage, and cleanup to specialists (lead orchestrates; state rare exceptions), or switch hats per phase with an isolated clean-diff review pass.
12
+ - Follow `skills_mode` (global only; never copy into repos). If none exist and `recommended_specialist_catalog` is set, suggest optionally.
13
+
14
+ ### Branches & Clean Sweep Gate
15
+ - Put new code on its own branch, never `git.default_branch`; after a clean sweep (if no sweep skill exists, ask owner), deliver per `git.delivery_mode` with `git.merge_strategy`.
16
+ - Reviews cover only the branch diff and interaction surface (callers, readers, UI, data, docs), never whole-repo re-reads.
17
+
18
+ ### Intent First, The Bar & Real Cases
19
+ - `docs.intent` is source of truth (`steward-init` onboards repos). Gaps vs it are findings; propagate owner decisions (`docs.intent`, `docs.how_it_works`, README) in the same turn. Format timestamps per `docs.timezone` (`local` = local TZ, fallback UTC) and `docs.clock_format`.
20
+ - **Only findings:** bugs; noisy/wrong alerts; bypassed safety rules; wrong docs; doc-reading tests (`tests.check_doc_readers`); `docs.tests` parity gaps (when `bar.require_tests_doc_parity = true`); avoidable manual owner steps.
21
+ - Everything else (wording, style, coverage edges, refactors) is **not** a finding: if `docs.nits_dir` is set, log by category in `<nits_dir>/<category>.md` (sweep-exempt; owner's schedule).
22
+ - When `bar.real_cases_only = true`, handle domain edge cases only with a verified real instance (entity, dates, primary source) cited beside its test in `docs.tests` (or test docstring/comment when `bar.require_tests_doc_parity = false`); drop hypotheticals, never safety/intent guards.
23
+
24
+ ### Fix by Class, Fresh Re-Reviewers & Coherence
25
+ - Reviewers/repeat checkers are read-only; never edit while one runs.
26
+ - Enumerate each failure class as failing tests under `tests.roots` (`tests.ignore_globs`); fix the whole class in one round.
27
+ - Re-reviews use a fresh same-specialty reviewer with prior report and tests; fix re-review findings in the same round.
28
+ - On same-spot conflicts, run a coherence check, pass both test sets, and log under "Same-spot choices" in `docs.how_it_works`.
29
+
30
+ ### Tests, Parity & Findings Hygiene
31
+ - When `bar.require_tests_doc_parity = true`, map `docs.tests` 1:1 by category and `### <file>` (`stewardkit check-tests`).
32
+ - When `bar.no_test_figures_in_docs = true`, keep test figures only in unit tests, never `.md`; never hand-validate figures.
33
+ - `docs.findings` tracks branch status, findings, and follow-ups; `bar.exempt_review_files` are never flagged; dropped items stay `Dropped` with reason. Zero-code/test-line rounds never re-trigger sweeps.
34
+
35
+ ### Anti-Loop, Owner Lock & Hygiene
36
+ - Follow `hygiene.allow_overnight_loops` (`false` = stop at clean checkpoint). Pause on non-convergence or > `hygiene.max_followups_before_checkin` new follow-ups (`> 0`).
37
+ - Owner lock: never narrow rules, edit `bar.protected_files` unapproved, or weaken safety guards.
38
+ - If `hygiene.min_free_disk_gb > 0`, check free disk at `hygiene.disk_check_path` (default: repo root) before sweeps/fixes; use scratchpad `--basetemp` and clean temps. Never force-push or stage `git.blocked_staged_globs`.
39
+ <!-- stewardkit:end -->