magoo-pr 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.
- magoo_pr-0.1.0/.github/workflows/auto-version.yml +87 -0
- magoo_pr-0.1.0/.github/workflows/ci.yml +86 -0
- magoo_pr-0.1.0/.github/workflows/pr-title-lint.yml +31 -0
- magoo_pr-0.1.0/.github/workflows/publish.yml +72 -0
- magoo_pr-0.1.0/.github/workflows/release.yml +51 -0
- magoo_pr-0.1.0/.gitignore +14 -0
- magoo_pr-0.1.0/.pre-commit-config.yaml +29 -0
- magoo_pr-0.1.0/CONTRIBUTING.md +130 -0
- magoo_pr-0.1.0/LICENSE +21 -0
- magoo_pr-0.1.0/PKG-INFO +149 -0
- magoo_pr-0.1.0/README.md +112 -0
- magoo_pr-0.1.0/docs/artifacts-and-exit-codes.md +85 -0
- magoo_pr-0.1.0/docs/comment-delivery.md +41 -0
- magoo_pr-0.1.0/docs/configuration.md +165 -0
- magoo_pr-0.1.0/docs/trust-and-isolation.md +66 -0
- magoo_pr-0.1.0/pyproject.toml +106 -0
- magoo_pr-0.1.0/scripts/auto_version.py +352 -0
- magoo_pr-0.1.0/scripts/check-all.sh +5 -0
- magoo_pr-0.1.0/scripts/check-package.sh +31 -0
- magoo_pr-0.1.0/scripts/check.sh +27 -0
- magoo_pr-0.1.0/scripts/check_distribution.py +162 -0
- magoo_pr-0.1.0/scripts/fmt.sh +5 -0
- magoo_pr-0.1.0/scripts/release_preflight.py +107 -0
- magoo_pr-0.1.0/scripts/test.sh +4 -0
- magoo_pr-0.1.0/src/magoo/__init__.py +3 -0
- magoo_pr-0.1.0/src/magoo/cli/__init__.py +0 -0
- magoo_pr-0.1.0/src/magoo/cli/check.py +534 -0
- magoo_pr-0.1.0/src/magoo/cli/explain.py +260 -0
- magoo_pr-0.1.0/src/magoo/cli/main.py +77 -0
- magoo_pr-0.1.0/src/magoo/cli/manage.py +464 -0
- magoo_pr-0.1.0/src/magoo/cli/options.py +267 -0
- magoo_pr-0.1.0/src/magoo/cli/recipe_wizard.py +281 -0
- magoo_pr-0.1.0/src/magoo/cli/review.py +688 -0
- magoo_pr-0.1.0/src/magoo/cli/start.py +835 -0
- magoo_pr-0.1.0/src/magoo/engine/__init__.py +3 -0
- magoo_pr-0.1.0/src/magoo/engine/catalog.py +86 -0
- magoo_pr-0.1.0/src/magoo/engine/pipeline.py +1830 -0
- magoo_pr-0.1.0/src/magoo/engine/plan.py +664 -0
- magoo_pr-0.1.0/src/magoo/engine/receipts.py +450 -0
- magoo_pr-0.1.0/src/magoo/engine/routes.py +225 -0
- magoo_pr-0.1.0/src/magoo/engine/runner.py +433 -0
- magoo_pr-0.1.0/src/magoo/findings/__init__.py +3 -0
- magoo_pr-0.1.0/src/magoo/findings/evidence.py +178 -0
- magoo_pr-0.1.0/src/magoo/findings/models.py +173 -0
- magoo_pr-0.1.0/src/magoo/findings/policy.py +95 -0
- magoo_pr-0.1.0/src/magoo/git/__init__.py +0 -0
- magoo_pr-0.1.0/src/magoo/git/repo.py +149 -0
- magoo_pr-0.1.0/src/magoo/git/trusted.py +142 -0
- magoo_pr-0.1.0/src/magoo/logging_setup.py +32 -0
- magoo_pr-0.1.0/src/magoo/method/__init__.py +5 -0
- magoo_pr-0.1.0/src/magoo/method/artifacts.py +262 -0
- magoo_pr-0.1.0/src/magoo/method/lenses.py +122 -0
- magoo_pr-0.1.0/src/magoo/method/prompts.py +802 -0
- magoo_pr-0.1.0/src/magoo/method/rubric.py +98 -0
- magoo_pr-0.1.0/src/magoo/method/schemas.py +348 -0
- magoo_pr-0.1.0/src/magoo/recipes/__init__.py +3 -0
- magoo_pr-0.1.0/src/magoo/recipes/loader.py +943 -0
- magoo_pr-0.1.0/src/magoo/recipes/models.py +284 -0
- magoo_pr-0.1.0/src/magoo/recipes/related.py +96 -0
- magoo_pr-0.1.0/src/magoo/recipes/starters/ci.yml +20 -0
- magoo_pr-0.1.0/src/magoo/recipes/starters/deep.yml +45 -0
- magoo_pr-0.1.0/src/magoo/recipes/starters/paranoid.yml +45 -0
- magoo_pr-0.1.0/src/magoo/recipes/starters/quick.yml +17 -0
- magoo_pr-0.1.0/src/magoo/recipes/starters/standard.yml +19 -0
- magoo_pr-0.1.0/src/magoo/report/__init__.py +0 -0
- magoo_pr-0.1.0/src/magoo/report/diff.py +253 -0
- magoo_pr-0.1.0/src/magoo/report/html.py +394 -0
- magoo_pr-0.1.0/src/magoo/report/post.py +475 -0
- magoo_pr-0.1.0/src/magoo/report/render.py +180 -0
- magoo_pr-0.1.0/src/magoo/report/walk.py +715 -0
- magoo_pr-0.1.0/src/magoo/sandbox/__init__.py +0 -0
- magoo_pr-0.1.0/src/magoo/sandbox/related.py +189 -0
- magoo_pr-0.1.0/src/magoo/sandbox/worktree.py +108 -0
- magoo_pr-0.1.0/src/magoo/skill/SKILL.md +87 -0
- magoo_pr-0.1.0/src/magoo/skill/magoo-recipe/SKILL.md +126 -0
- magoo_pr-0.1.0/src/magoo/store.py +308 -0
- magoo_pr-0.1.0/src/magoo/targets/__init__.py +0 -0
- magoo_pr-0.1.0/src/magoo/targets/base.py +130 -0
- magoo_pr-0.1.0/src/magoo/targets/branch.py +57 -0
- magoo_pr-0.1.0/src/magoo/targets/local.py +190 -0
- magoo_pr-0.1.0/src/magoo/targets/pr.py +309 -0
- magoo_pr-0.1.0/src/magoo/targets/stash.py +87 -0
- magoo_pr-0.1.0/src/magoo/ui/__init__.py +0 -0
- magoo_pr-0.1.0/src/magoo/ui/console.py +161 -0
- magoo_pr-0.1.0/tests/conftest.py +69 -0
- magoo_pr-0.1.0/tests/test_check_script.py +39 -0
- magoo_pr-0.1.0/tests/test_console.py +65 -0
- magoo_pr-0.1.0/tests/test_distribution.py +64 -0
- magoo_pr-0.1.0/tests/test_isolation.py +116 -0
- magoo_pr-0.1.0/tests/test_method.py +166 -0
- magoo_pr-0.1.0/tests/test_pipeline_and_receipts.py +968 -0
- magoo_pr-0.1.0/tests/test_post_and_manage_cli.py +690 -0
- magoo_pr-0.1.0/tests/test_pr_target.py +316 -0
- magoo_pr-0.1.0/tests/test_recipes.py +346 -0
- magoo_pr-0.1.0/tests/test_related_repositories.py +306 -0
- magoo_pr-0.1.0/tests/test_release_preflight.py +51 -0
- magoo_pr-0.1.0/tests/test_release_workflow.py +119 -0
- magoo_pr-0.1.0/tests/test_routes_and_plan.py +440 -0
- magoo_pr-0.1.0/tests/test_start_tui.py +178 -0
- magoo_pr-0.1.0/tests/test_targets.py +363 -0
- magoo_pr-0.1.0/tests/test_versioning.py +362 -0
- magoo_pr-0.1.0/tests/test_walk.py +747 -0
- magoo_pr-0.1.0/uv.lock +1279 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: Auto Version Bump
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [closed]
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pull-requests: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: auto-version-bump
|
|
14
|
+
# GitHub's default keeps only one pending run; retain a real queue so a burst
|
|
15
|
+
# of merged PRs cannot silently discard an intermediate release calculation.
|
|
16
|
+
queue: max
|
|
17
|
+
cancel-in-progress: false
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
version-bump:
|
|
21
|
+
# This workflow is deliberately opt-in: it needs a GitHub App token so its
|
|
22
|
+
# tag push can trigger release and publishing workflows. Enable it only
|
|
23
|
+
# after configuring the documented repository variable and App secrets.
|
|
24
|
+
if: >-
|
|
25
|
+
github.event.pull_request.merged == true &&
|
|
26
|
+
vars.RELEASE_AUTOMATION_ENABLED == 'true'
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
permissions:
|
|
29
|
+
contents: read
|
|
30
|
+
pull-requests: read
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
33
|
+
with:
|
|
34
|
+
persist-credentials: false
|
|
35
|
+
ref: ${{ github.sha }}
|
|
36
|
+
fetch-depth: 0
|
|
37
|
+
- name: Detect the highest bump since the last release tag
|
|
38
|
+
id: detect
|
|
39
|
+
env:
|
|
40
|
+
BASE_REF: ${{ github.event.pull_request.base.ref }}
|
|
41
|
+
GH_TOKEN: ${{ github.token }}
|
|
42
|
+
run: |
|
|
43
|
+
bump="$(python scripts/auto_version.py --bump-from-pr-titles --base "$BASE_REF")"
|
|
44
|
+
echo "bump=$bump" >> "$GITHUB_OUTPUT"
|
|
45
|
+
if [[ -z "$bump" ]]; then
|
|
46
|
+
echo "No release-worthy Conventional Commit since the last v* tag."
|
|
47
|
+
fi
|
|
48
|
+
- name: Generate release App token
|
|
49
|
+
if: steps.detect.outputs.bump != ''
|
|
50
|
+
id: app-token
|
|
51
|
+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
|
52
|
+
with:
|
|
53
|
+
app-id: ${{ secrets.RELEASE_APP_ID }}
|
|
54
|
+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
|
55
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
56
|
+
if: steps.detect.outputs.bump != ''
|
|
57
|
+
with:
|
|
58
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
59
|
+
ref: ${{ github.sha }}
|
|
60
|
+
fetch-depth: 0
|
|
61
|
+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
62
|
+
if: steps.detect.outputs.bump != ''
|
|
63
|
+
with:
|
|
64
|
+
version: "latest"
|
|
65
|
+
- name: Set up Python
|
|
66
|
+
if: steps.detect.outputs.bump != ''
|
|
67
|
+
run: uv python install 3.13
|
|
68
|
+
- name: Install dependencies
|
|
69
|
+
if: steps.detect.outputs.bump != ''
|
|
70
|
+
run: uv sync --all-extras --locked
|
|
71
|
+
- name: Configure release identity
|
|
72
|
+
if: steps.detect.outputs.bump != ''
|
|
73
|
+
run: |
|
|
74
|
+
git config user.name "github-actions[bot]"
|
|
75
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
76
|
+
- name: Bump, commit, and tag
|
|
77
|
+
if: steps.detect.outputs.bump != ''
|
|
78
|
+
id: bump
|
|
79
|
+
run: |
|
|
80
|
+
uv run python scripts/auto_version.py ${{ steps.detect.outputs.bump }}
|
|
81
|
+
echo "tag=$(git describe --tags --exact-match HEAD)" >> "$GITHUB_OUTPUT"
|
|
82
|
+
- name: Push release commit and tag
|
|
83
|
+
if: steps.detect.outputs.bump != ''
|
|
84
|
+
run: |
|
|
85
|
+
git push --atomic origin \
|
|
86
|
+
"HEAD:refs/heads/${{ github.event.pull_request.base.ref }}" \
|
|
87
|
+
"refs/tags/${{ steps.bump.outputs.tag }}"
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
lint:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
22
|
+
with:
|
|
23
|
+
persist-credentials: false
|
|
24
|
+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
25
|
+
with:
|
|
26
|
+
version: "latest"
|
|
27
|
+
- name: Set up Python
|
|
28
|
+
run: uv python install 3.13
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: uv sync --all-extras --locked
|
|
31
|
+
- name: Lint and format check
|
|
32
|
+
run: ./scripts/check.sh --lint
|
|
33
|
+
|
|
34
|
+
typecheck:
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
38
|
+
with:
|
|
39
|
+
persist-credentials: false
|
|
40
|
+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
41
|
+
with:
|
|
42
|
+
version: "latest"
|
|
43
|
+
- name: Set up Python
|
|
44
|
+
run: uv python install 3.13
|
|
45
|
+
- name: Install dependencies
|
|
46
|
+
run: uv sync --all-extras --locked
|
|
47
|
+
- name: Type check
|
|
48
|
+
run: ./scripts/check.sh --types
|
|
49
|
+
|
|
50
|
+
test:
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
strategy:
|
|
53
|
+
fail-fast: false
|
|
54
|
+
matrix:
|
|
55
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
56
|
+
steps:
|
|
57
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
58
|
+
with:
|
|
59
|
+
persist-credentials: false
|
|
60
|
+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
61
|
+
with:
|
|
62
|
+
version: "latest"
|
|
63
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
64
|
+
run: uv python install ${{ matrix.python-version }}
|
|
65
|
+
- name: Install dependencies
|
|
66
|
+
run: uv sync --all-extras --locked --python ${{ matrix.python-version }}
|
|
67
|
+
- name: Run tests
|
|
68
|
+
run: ./scripts/test.sh
|
|
69
|
+
|
|
70
|
+
packaging:
|
|
71
|
+
runs-on: ubuntu-latest
|
|
72
|
+
steps:
|
|
73
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
74
|
+
with:
|
|
75
|
+
persist-credentials: false
|
|
76
|
+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
77
|
+
with:
|
|
78
|
+
version: "latest"
|
|
79
|
+
- name: Set up Python
|
|
80
|
+
run: uv python install 3.13
|
|
81
|
+
- name: Install locked dependencies
|
|
82
|
+
run: uv sync --all-extras --locked --python 3.13
|
|
83
|
+
- name: Check release metadata
|
|
84
|
+
run: uv run --no-sync --python 3.13 python scripts/release_preflight.py
|
|
85
|
+
- name: Build and smoke-test distributions
|
|
86
|
+
run: ./scripts/check-package.sh
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: PR Title Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, edited, synchronize, reopened]
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
pull-requests: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
lint-title:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
|
|
16
|
+
env:
|
|
17
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
18
|
+
with:
|
|
19
|
+
types: |
|
|
20
|
+
feat
|
|
21
|
+
fix
|
|
22
|
+
docs
|
|
23
|
+
refactor
|
|
24
|
+
chore
|
|
25
|
+
style
|
|
26
|
+
perf
|
|
27
|
+
test
|
|
28
|
+
ci
|
|
29
|
+
build
|
|
30
|
+
revert
|
|
31
|
+
update
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
tag:
|
|
9
|
+
description: Existing release tag (vMAJOR.MINOR.PATCH)
|
|
10
|
+
required: true
|
|
11
|
+
type: string
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
concurrency:
|
|
17
|
+
group: publish-${{ inputs.tag || github.ref_name }}
|
|
18
|
+
cancel-in-progress: false
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
publish:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
environment: pypi
|
|
24
|
+
outputs:
|
|
25
|
+
tag: ${{ steps.tag.outputs.value }}
|
|
26
|
+
permissions:
|
|
27
|
+
contents: read
|
|
28
|
+
id-token: write
|
|
29
|
+
steps:
|
|
30
|
+
- name: Resolve the triggering tag
|
|
31
|
+
id: tag
|
|
32
|
+
env:
|
|
33
|
+
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
|
|
34
|
+
run: |
|
|
35
|
+
if [[ ! "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
36
|
+
echo "Release tag must be exactly vMAJOR.MINOR.PATCH." >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
echo "value=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
|
|
40
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
41
|
+
with:
|
|
42
|
+
persist-credentials: false
|
|
43
|
+
ref: refs/tags/${{ steps.tag.outputs.value }}
|
|
44
|
+
fetch-depth: 0
|
|
45
|
+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
|
|
46
|
+
with:
|
|
47
|
+
version: "latest"
|
|
48
|
+
- name: Set up Python
|
|
49
|
+
run: uv python install 3.13
|
|
50
|
+
- name: Install locked dependencies
|
|
51
|
+
run: uv sync --all-extras --locked --python 3.13
|
|
52
|
+
- name: Validate tagged release metadata
|
|
53
|
+
run: >-
|
|
54
|
+
uv run --no-sync --python 3.13 python scripts/release_preflight.py
|
|
55
|
+
--tag "${{ steps.tag.outputs.value }}"
|
|
56
|
+
- name: Run the full quality gate for the tagged commit
|
|
57
|
+
run: ./scripts/check-all.sh
|
|
58
|
+
- name: Build and smoke-test tagged distributions
|
|
59
|
+
run: ./scripts/check-package.sh --out-dir dist
|
|
60
|
+
- name: Publish to PyPI via Trusted Publishing
|
|
61
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
|
|
62
|
+
with:
|
|
63
|
+
packages-dir: dist/
|
|
64
|
+
skip-existing: true
|
|
65
|
+
|
|
66
|
+
release-notes:
|
|
67
|
+
needs: publish
|
|
68
|
+
permissions:
|
|
69
|
+
contents: write
|
|
70
|
+
uses: ./.github/workflows/release.yml
|
|
71
|
+
with:
|
|
72
|
+
tag: ${{ needs.publish.outputs.tag }}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Create Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
inputs:
|
|
6
|
+
tag:
|
|
7
|
+
description: Validated and published release tag
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: release-${{ inputs.tag }}
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
release:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
env:
|
|
22
|
+
RELEASE_TAG: ${{ inputs.tag }}
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
ref: refs/tags/${{ inputs.tag }}
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
- name: Create release notes from the tag
|
|
30
|
+
env:
|
|
31
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
32
|
+
run: |
|
|
33
|
+
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
|
|
34
|
+
case "$(gh release view "$RELEASE_TAG" --json isDraft --jq '.isDraft')" in
|
|
35
|
+
true)
|
|
36
|
+
echo "Publishing existing draft GitHub Release $RELEASE_TAG."
|
|
37
|
+
gh release edit "$RELEASE_TAG" --draft=false
|
|
38
|
+
;;
|
|
39
|
+
false)
|
|
40
|
+
echo "GitHub Release $RELEASE_TAG is already published; keeping it."
|
|
41
|
+
;;
|
|
42
|
+
*)
|
|
43
|
+
echo "Could not determine whether GitHub Release $RELEASE_TAG is a draft." >&2
|
|
44
|
+
exit 1
|
|
45
|
+
;;
|
|
46
|
+
esac
|
|
47
|
+
else
|
|
48
|
+
gh release create "$RELEASE_TAG" \
|
|
49
|
+
--title "$RELEASE_TAG" \
|
|
50
|
+
--generate-notes
|
|
51
|
+
fi
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: local
|
|
3
|
+
hooks:
|
|
4
|
+
- id: ruff
|
|
5
|
+
name: ruff
|
|
6
|
+
language: system
|
|
7
|
+
entry: uv run ruff check --fix
|
|
8
|
+
types: [python]
|
|
9
|
+
- id: ruff-format
|
|
10
|
+
name: ruff format
|
|
11
|
+
language: system
|
|
12
|
+
entry: uv run ruff format
|
|
13
|
+
types: [python]
|
|
14
|
+
- id: mypy
|
|
15
|
+
name: mypy
|
|
16
|
+
language: system
|
|
17
|
+
entry: uv run mypy src/
|
|
18
|
+
pass_filenames: false
|
|
19
|
+
always_run: true
|
|
20
|
+
|
|
21
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
22
|
+
rev: v5.0.0
|
|
23
|
+
hooks:
|
|
24
|
+
- id: trailing-whitespace
|
|
25
|
+
- id: end-of-file-fixer
|
|
26
|
+
- id: check-yaml
|
|
27
|
+
- id: check-added-large-files
|
|
28
|
+
args: [--maxkb=500]
|
|
29
|
+
- id: check-merge-conflict
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Contributing to Magoo PR
|
|
2
|
+
|
|
3
|
+
## Development setup
|
|
4
|
+
|
|
5
|
+
Requires Python 3.11+, [uv](https://docs.astral.sh/uv/), and Git. PR-target
|
|
6
|
+
tests use local Git remotes.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/ivanviragine/magoo-pr.git
|
|
10
|
+
cd magoo
|
|
11
|
+
uv sync --all-extras --locked
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Checks
|
|
15
|
+
|
|
16
|
+
| Command | Purpose |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `./scripts/test.sh` | Full test suite |
|
|
19
|
+
| `./scripts/check.sh` | Ruff lint/format check and mypy |
|
|
20
|
+
| `./scripts/check.sh --lint` | Ruff lint/format check only |
|
|
21
|
+
| `./scripts/check.sh --types` | Mypy only |
|
|
22
|
+
| `./scripts/fmt.sh` | Apply Ruff fixes and formatting |
|
|
23
|
+
| `./scripts/check-package.sh` | Build, inspect, and clean-install wheel and sdist |
|
|
24
|
+
| `./scripts/check-all.sh` | Full tests and static checks |
|
|
25
|
+
|
|
26
|
+
Install the optional local hook with `uv run pre-commit install`. It runs Ruff,
|
|
27
|
+
basic file checks, and mypy before a commit.
|
|
28
|
+
|
|
29
|
+
## Pull requests
|
|
30
|
+
|
|
31
|
+
Use Conventional Commit titles. `feat:` and `update:` imply a minor release;
|
|
32
|
+
`fix:`, `docs:`, `refactor:`, `chore:`, `test:`, `ci:`, and similar maintenance
|
|
33
|
+
types imply a patch release; a `!` after the type denotes a major release.
|
|
34
|
+
|
|
35
|
+
Keep the CLI layer thin: command modules parse Typer input and delegate to
|
|
36
|
+
targets, session orchestration, delivery, or reporting modules. Preserve the
|
|
37
|
+
review contract—source working trees must remain untouched, and any target
|
|
38
|
+
snapshot or safety relaxation must be explicit and test-covered. Repository
|
|
39
|
+
configuration must come from the target's pinned trusted Git tree, and a
|
|
40
|
+
related repository must never reach an adapter as a writable trusted directory.
|
|
41
|
+
|
|
42
|
+
## Releases
|
|
43
|
+
|
|
44
|
+
The first public release uses a manually pushed tag. Later releases can use
|
|
45
|
+
Conventional Commit automation. Create release tags from a verified `main`
|
|
46
|
+
checkout.
|
|
47
|
+
|
|
48
|
+
### Bootstrap `v0.1.0` once
|
|
49
|
+
|
|
50
|
+
`bootstrap` tags the synchronized initial version. Run it from a clean checkout
|
|
51
|
+
of `main` whose `HEAD` matches the configured push remote's `main`.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git switch main
|
|
55
|
+
git pull --ff-only
|
|
56
|
+
uv run python scripts/auto_version.py bootstrap --dry-run
|
|
57
|
+
uv run python scripts/auto_version.py bootstrap --push
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The command requires synchronized `pyproject.toml`, `src/magoo/__init__.py`,
|
|
61
|
+
and `uv.lock` versions; requires exactly `0.1.0`; refuses a dirty, detached, or
|
|
62
|
+
stale checkout; fetches remote tags; and refuses any existing `v0.1.0` tag. It
|
|
63
|
+
creates an annotated tag and pushes only that tag when `--push` is supplied.
|
|
64
|
+
|
|
65
|
+
Before running it, complete this external checklist:
|
|
66
|
+
|
|
67
|
+
- Confirm the exact `main` commit has green required CI checks.
|
|
68
|
+
- Confirm that the `magoo-pr` distribution name is available on PyPI. A pending
|
|
69
|
+
publisher does not reserve a name; if it is unavailable, stop and make a
|
|
70
|
+
distribution-name decision without renaming the `magoo` import or console
|
|
71
|
+
command by accident.
|
|
72
|
+
- Configure PyPI's pending Trusted Publisher for project `magoo-pr`, owner
|
|
73
|
+
`ivanviragine`, repository `magoo-pr`, workflow `publish.yml`, and
|
|
74
|
+
environment `pypi`.
|
|
75
|
+
- Configure the GitHub `pypi` environment with a deployment rule that allows
|
|
76
|
+
version tags matching `v*`. The publishing job requests short-lived PyPI
|
|
77
|
+
credentials through GitHub Actions OIDC.
|
|
78
|
+
- Check that Actions is enabled and `publish.yml` is available on `main`.
|
|
79
|
+
|
|
80
|
+
After the tag push, inspect the `Publish to PyPI` workflow. It validates the
|
|
81
|
+
exact tag and runs the full quality gate once, builds and smoke-tests the
|
|
82
|
+
distributions, publishes to PyPI, and only then calls `release.yml` to create
|
|
83
|
+
the GitHub Release notes. `release.yml` is a reusable workflow, not a second
|
|
84
|
+
tag-triggered validation run. A failed validation or upload cannot start it.
|
|
85
|
+
To retry publishing, rerun the original tag-triggered workflow. To start a new
|
|
86
|
+
run for an existing tag, dispatch the workflow at that same tag ref.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
gh workflow run publish.yml --ref v0.1.0 -f tag=v0.1.0
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
After publishing, install `magoo-pr==0.1.0` in a clean environment and run `magoo --version`,
|
|
93
|
+
`magoo --help`, and `./scripts/check-package.sh` from the tagged checkout
|
|
94
|
+
before enabling automation. GitHub Releases intentionally contain generated
|
|
95
|
+
release notes only; PyPI is the sole source of distribution files.
|
|
96
|
+
|
|
97
|
+
### Enable later Conventional Commit releases
|
|
98
|
+
|
|
99
|
+
After `v0.1.0` is visible on both GitHub and PyPI, create and install a release
|
|
100
|
+
GitHub App with repository Contents write access and Pull requests read
|
|
101
|
+
access. Configure the `RELEASE_APP_ID` and `RELEASE_APP_PRIVATE_KEY` secrets
|
|
102
|
+
and set the `RELEASE_AUTOMATION_ENABLED` repository variable to `true` when
|
|
103
|
+
you want automatic releases. The App token lets version tags trigger the
|
|
104
|
+
publish workflow.
|
|
105
|
+
|
|
106
|
+
`auto-version.yml` derives the highest Conventional Commit bump across PR
|
|
107
|
+
titles in the triggering event's Git ancestry since the last release tag, then
|
|
108
|
+
atomically pushes one version commit and its annotated tag. This keeps a delayed
|
|
109
|
+
run from losing an earlier feature bump or depending on a specific merge
|
|
110
|
+
strategy. Operators can also make a later deliberate release locally:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
uv run python scripts/auto_version.py patch --push # or minor / major
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
That command updates both source version declarations and `uv.lock`, commits
|
|
117
|
+
`chore: bump version to vX.Y.Z`, and atomically pushes the branch and its new
|
|
118
|
+
tag to the configured push destination. If the remote rejects the push, the
|
|
119
|
+
commit and tag remain local for retry. The tagged workflows reject malformed tags or mismatched
|
|
120
|
+
source and lock metadata before creating a GitHub Release or requesting
|
|
121
|
+
PyPI OIDC credentials.
|
|
122
|
+
|
|
123
|
+
### Recovery
|
|
124
|
+
|
|
125
|
+
| Situation | Operator action |
|
|
126
|
+
| --- | --- |
|
|
127
|
+
| PyPI name unavailable | Stop before tagging and make the distribution-name decision explicitly; preserve the `magoo` import and command unless that decision changes them. |
|
|
128
|
+
| Trusted Publisher/OIDC fails | Compare the pending publisher owner, repository, workflow, and environment to the checklist; correct external configuration, then rerun the same immutable tag workflow. |
|
|
129
|
+
| Tag or release already exists | Do not replace it. Inspect its commit and workflow runs; the release workflow keeps an existing release and PyPI publishing uses safe duplicate handling. |
|
|
130
|
+
| PyPI upload succeeded but GitHub Release is missing | Rerun the failed release-notes job in the same publishing run; it reuses the validated tag. Never rebuild a different commit for the same version. |
|
magoo_pr-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ivan Viragine
|
|
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.
|
magoo_pr-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: magoo-pr
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Adversarial code review across AI tools and models, powered by Crossby.
|
|
5
|
+
Project-URL: Homepage, https://github.com/ivanviragine/magoo-pr
|
|
6
|
+
Project-URL: Repository, https://github.com/ivanviragine/magoo-pr
|
|
7
|
+
Project-URL: Documentation, https://github.com/ivanviragine/magoo-pr#readme
|
|
8
|
+
Project-URL: Issues, https://github.com/ivanviragine/magoo-pr/issues
|
|
9
|
+
Author: Ivan Viragine
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: adversarial,ai,automation,code-review,git,pull-request
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
21
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Requires-Dist: crossby<0.64.0,>=0.63.2
|
|
24
|
+
Requires-Dist: pydantic>=2.0
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: rich>=13.0
|
|
27
|
+
Requires-Dist: structlog>=24.0
|
|
28
|
+
Requires-Dist: typer<0.26,>=0.12
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: mypy>=1.14; extra == 'dev'
|
|
31
|
+
Requires-Dist: pre-commit>=3.7; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
35
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# Magoo PR
|
|
39
|
+
|
|
40
|
+
**Adversarial code review across AI tools and models, powered by Crossby.**
|
|
41
|
+
|
|
42
|
+
Magoo PR uses Crossby to run independent review passes with Claude Code,
|
|
43
|
+
Codex, Antigravity CLI, and other supported tools. Mix tools and models in
|
|
44
|
+
the same review by assigning them to different lenses and stages.
|
|
45
|
+
[Crossby](https://github.com/ivanviragine/crossby)
|
|
46
|
+
|
|
47
|
+
Each review starts with a blind, diff-only baseline and lens-focused reviewers.
|
|
48
|
+
A fresh challenger tries to refute their drafts. After reconciliation,
|
|
49
|
+
a **second challenge checks the proposed report**, including findings promoted
|
|
50
|
+
from the baseline. Magoo PR produces a report only when receipts verify that
|
|
51
|
+
the required turns completed and every candidate was accounted for.
|
|
52
|
+
|
|
53
|
+
- **Get evidence you can act on.** Findings include the location, trigger,
|
|
54
|
+
impact, and suggested action. The report records why candidates were dropped
|
|
55
|
+
and what still needs verification before release.
|
|
56
|
+
- **Choose who sees the code.** Assign tools, models, and effort by stage or
|
|
57
|
+
review lens. Preview the provider companies and set an allowlist before any
|
|
58
|
+
model runs.
|
|
59
|
+
- **Verify the next revision.** Compare with `--prior last` to keep finding IDs
|
|
60
|
+
across reviews and check claimed fixes against the saved and current code.
|
|
61
|
+
- **Control what lands on GitHub.** Start with local drafts. When you choose to
|
|
62
|
+
post, Magoo checks the PR revision and inline anchors, skips equivalent
|
|
63
|
+
comments, and submits a single review.
|
|
64
|
+
|
|
65
|
+
## Get started
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
uv tool install git+https://github.com/ivanviragine/magoo-pr.git
|
|
69
|
+
magoo tools
|
|
70
|
+
magoo local -r quick
|
|
71
|
+
magoo report last --open
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
You need Python 3.11+, Git, and at least one headless AI CLI supported by Crossby
|
|
75
|
+
(Claude Code, Codex, Antigravity CLI, Cursor, Copilot, or OpenCode) with provider
|
|
76
|
+
authentication. Magoo PR installs Crossby as a dependency. GitHub PR reviews and
|
|
77
|
+
posting also require an authenticated `gh` CLI.
|
|
78
|
+
|
|
79
|
+
`magoo local` captures uncommitted changes in a disposable worktree and leaves
|
|
80
|
+
your checkout, index, branch, and stash alone. Each recipe runs the full review
|
|
81
|
+
sequence. `quick` uses medium effort and a concise reporting policy.
|
|
82
|
+
|
|
83
|
+
| Target | Command |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| Uncommitted changes | `magoo local` or `magoo local --staged` |
|
|
86
|
+
| A branch against a base | `magoo branch feat/retry-backoff --base main` |
|
|
87
|
+
| A GitHub pull request | `magoo pr 2469` |
|
|
88
|
+
| A stashed change | `magoo stash 'stash@{0}'` |
|
|
89
|
+
| Guided launcher | `magoo start` |
|
|
90
|
+
|
|
91
|
+
## Preview and tune a review
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
magoo check pr 2469 -r deep --post never
|
|
95
|
+
magoo explain -r deep --stage final-challenge
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`check` lists the resolved seats, provider routes, and backend restrictions
|
|
99
|
+
without starting a model. Run the command it prints with `--plan` to require the
|
|
100
|
+
review to match the preview. `deep` runs four specialist reviewer seats across
|
|
101
|
+
Codex, Claude, and Antigravity CLI. Use `standard` for a single reviewer covering
|
|
102
|
+
all nine lenses, `paranoid` for high-impact changes, or `ci` for concise P0/P1
|
|
103
|
+
reporting.
|
|
104
|
+
|
|
105
|
+
You can assign a different model to Phase 9 without writing YAML.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
magoo check pr 2469 -r standard --tool claude \
|
|
109
|
+
--seat security:claude:claude-opus-5.5:high \
|
|
110
|
+
--seat correctness,concurrency:codex:gpt-6.2:xhigh \
|
|
111
|
+
--final-challenge-tool codex --final-challenge-model gpt-6.2 \
|
|
112
|
+
--final-challenge-effort high --providers openai,anthropic --post never
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Use `magoo recipe new my-team --from deep --user` to save a reusable recipe,
|
|
116
|
+
`magoo recipe new my-team --interactive --user` to build one, or
|
|
117
|
+
`magoo pr --help` for the per-run options. [Configuration and recipes](docs/configuration.md)
|
|
118
|
+
|
|
119
|
+
## Work with the results
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
magoo runs
|
|
123
|
+
magoo report last --open
|
|
124
|
+
magoo resume 3
|
|
125
|
+
magoo local --prior last
|
|
126
|
+
magoo post last --walk
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Markdown, HTML, JSON, and receipt artifacts live under
|
|
130
|
+
`~/.magoo/projects/<repo>-<hash>/runs/<N>/` by default. For CI or a coding agent,
|
|
131
|
+
run a target command with `--json` and use the exit code and receipt status.
|
|
132
|
+
`magoo setup` installs the bundled review and recipe skills for supported
|
|
133
|
+
coding agents. Add `--global` to install them for your user account.
|
|
134
|
+
[Artifacts and exit codes](docs/artifacts-and-exit-codes.md) ·
|
|
135
|
+
[GitHub comment delivery](docs/comment-delivery.md)
|
|
136
|
+
|
|
137
|
+
The receipts verify that the required review stages completed, the baseline
|
|
138
|
+
seal held, and assigned lenses and candidates were accounted for. Evidence
|
|
139
|
+
quality still depends on the models and the material they could inspect.
|
|
140
|
+
Magoo asks Crossby to enforce read-only turns and reports the blind baseline's
|
|
141
|
+
isolation status for the selected backend.
|
|
142
|
+
[Trust, isolation, and known limits](docs/trust-and-isolation.md)
|
|
143
|
+
|
|
144
|
+
## Contributing
|
|
145
|
+
|
|
146
|
+
Run the tests, Ruff, mypy, and package checks before opening a PR.
|
|
147
|
+
[Contribution guide](CONTRIBUTING.md)
|
|
148
|
+
|
|
149
|
+
Magoo is MIT licensed.
|