yaga-cli 0.6.0__py3-none-win_arm64.whl
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.
- yaga/__init__.py +7 -0
- yaga/__main__.py +8 -0
- yaga/_bin/yaga.exe +0 -0
- yaga/_update_worker.py +65 -0
- yaga/entrypoint.py +82 -0
- yaga/self_update.py +179 -0
- yaga_cli-0.6.0.dist-info/METADATA +136 -0
- yaga_cli-0.6.0.dist-info/RECORD +11 -0
- yaga_cli-0.6.0.dist-info/WHEEL +4 -0
- yaga_cli-0.6.0.dist-info/entry_points.txt +2 -0
- yaga_cli-0.6.0.dist-info/licenses/LICENSE +29 -0
yaga/__init__.py
ADDED
yaga/__main__.py
ADDED
yaga/_bin/yaga.exe
ADDED
|
Binary file
|
yaga/_update_worker.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"""Standalone Windows update worker, copied outside the environment before replacement."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import ctypes
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
from ctypes import wintypes
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def main() -> int:
|
|
13
|
+
if sys.platform != "win32":
|
|
14
|
+
return 2
|
|
15
|
+
kernel = ctypes.WinDLL("kernel32", use_last_error=True)
|
|
16
|
+
kernel.OpenProcess.argtypes = [wintypes.DWORD, wintypes.BOOL, wintypes.DWORD]
|
|
17
|
+
kernel.OpenProcess.restype = wintypes.HANDLE
|
|
18
|
+
kernel.WaitForSingleObject.argtypes = [wintypes.HANDLE, wintypes.DWORD]
|
|
19
|
+
kernel.WaitForSingleObject.restype = wintypes.DWORD
|
|
20
|
+
kernel.CloseHandle.argtypes = [wintypes.HANDLE]
|
|
21
|
+
kernel.QueryFullProcessImageNameW.argtypes = [
|
|
22
|
+
wintypes.HANDLE,
|
|
23
|
+
wintypes.DWORD,
|
|
24
|
+
wintypes.LPWSTR,
|
|
25
|
+
ctypes.POINTER(wintypes.DWORD),
|
|
26
|
+
]
|
|
27
|
+
handles = []
|
|
28
|
+
try:
|
|
29
|
+
for index, raw_pid in enumerate(sys.argv[2:4]):
|
|
30
|
+
handle = kernel.OpenProcess(0x00100000 | 0x1000, False, int(raw_pid))
|
|
31
|
+
if not handle:
|
|
32
|
+
if ctypes.get_last_error() == 87: # The process already exited.
|
|
33
|
+
continue
|
|
34
|
+
raise OSError("cannot wait for the YAGA process to exit")
|
|
35
|
+
handles.append(handle)
|
|
36
|
+
if index == 1:
|
|
37
|
+
name = ctypes.create_unicode_buffer(32768)
|
|
38
|
+
size = wintypes.DWORD(len(name))
|
|
39
|
+
if not kernel.QueryFullProcessImageNameW(handle, 0, name, ctypes.byref(size)):
|
|
40
|
+
raise OSError("cannot identify the YAGA launcher")
|
|
41
|
+
if Path(name.value).name.casefold() != "yaga.exe":
|
|
42
|
+
continue # python -m yaga has no launcher; never wait for the user's shell.
|
|
43
|
+
if kernel.WaitForSingleObject(handle, 60000) != 0:
|
|
44
|
+
raise OSError("YAGA did not exit within the update handoff timeout")
|
|
45
|
+
result = subprocess.run(
|
|
46
|
+
[sys.argv[1], "--no-config", "tool", "upgrade", "yaga-cli"],
|
|
47
|
+
timeout=600,
|
|
48
|
+
check=False,
|
|
49
|
+
)
|
|
50
|
+
print(f"YAGA_UPDATE_EXIT_CODE={result.returncode}", flush=True)
|
|
51
|
+
return result.returncode
|
|
52
|
+
except (OSError, subprocess.SubprocessError) as error:
|
|
53
|
+
print(
|
|
54
|
+
f"YAGA update failed: {type(error).__name__}; run uv tool upgrade yaga-cli", flush=True
|
|
55
|
+
)
|
|
56
|
+
print("YAGA_UPDATE_EXIT_CODE=2", flush=True)
|
|
57
|
+
return 2
|
|
58
|
+
finally:
|
|
59
|
+
for handle in handles:
|
|
60
|
+
kernel.CloseHandle(handle)
|
|
61
|
+
Path(__file__).unlink(missing_ok=True)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if __name__ == "__main__":
|
|
65
|
+
raise SystemExit(main())
|
yaga/entrypoint.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""Launch the Rust ``yaga`` executable bundled with this Python wheel."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def find_yaga_bin() -> Path:
|
|
12
|
+
"""Return the path to the bundled ``yaga`` executable."""
|
|
13
|
+
import yaga
|
|
14
|
+
|
|
15
|
+
binary_name = "yaga.exe" if os.name == "nt" else "yaga"
|
|
16
|
+
candidates: list[Path] = []
|
|
17
|
+
for entry in getattr(yaga, "__path__", ()):
|
|
18
|
+
candidates.append(Path(entry) / "_bin" / binary_name)
|
|
19
|
+
candidates.append(Path(__file__).resolve().parent / "_bin" / binary_name)
|
|
20
|
+
|
|
21
|
+
seen: set[Path] = set()
|
|
22
|
+
for candidate in candidates:
|
|
23
|
+
resolved = candidate.resolve()
|
|
24
|
+
if resolved in seen:
|
|
25
|
+
continue
|
|
26
|
+
seen.add(resolved)
|
|
27
|
+
if candidate.is_file():
|
|
28
|
+
return candidate
|
|
29
|
+
raise FileNotFoundError(
|
|
30
|
+
"YAGA installation is missing its native executable. Reinstall yaga-cli."
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _operation(args: list[str]) -> tuple[str | None, str | None]:
|
|
35
|
+
words = iter(args)
|
|
36
|
+
|
|
37
|
+
def next_word() -> str | None:
|
|
38
|
+
word = next(words, None)
|
|
39
|
+
return next(words, None) if word == "--" else word
|
|
40
|
+
|
|
41
|
+
return next_word(), next_word()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def main(argv: list[str] | None = None) -> int:
|
|
45
|
+
"""Console entry point for the ``yaga`` script and ``python -m yaga``."""
|
|
46
|
+
args = sys.argv[1:] if argv is None else list(argv)
|
|
47
|
+
return _launch(args, console=argv is None)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def run_native(args: list[str]) -> int:
|
|
51
|
+
"""Invoke the bundled executable and return its exit code to the caller."""
|
|
52
|
+
return _launch(list(args), console=False)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _launch(args: list[str], *, console: bool) -> int:
|
|
56
|
+
try:
|
|
57
|
+
executable = find_yaga_bin()
|
|
58
|
+
except FileNotFoundError as error:
|
|
59
|
+
print(str(error), file=sys.stderr)
|
|
60
|
+
return 2
|
|
61
|
+
|
|
62
|
+
completion = os.environ.get("_YAGA_COMPLETE")
|
|
63
|
+
if not completion and _operation(args) == ("self", "update"):
|
|
64
|
+
# Let Clap validate argv first; exit 80/81 delegates to the Python manager.
|
|
65
|
+
status = _call(executable, args, os.environ | {"_YAGA_WHEEL_UPDATE_REQUEST": "1"})
|
|
66
|
+
if status in (80, 81):
|
|
67
|
+
from yaga.self_update import run_wheel_update
|
|
68
|
+
|
|
69
|
+
return run_wheel_update(dry_run=status == 80)
|
|
70
|
+
return status
|
|
71
|
+
|
|
72
|
+
if console and os.name == "posix":
|
|
73
|
+
os.execve(executable, [str(executable), *args], os.environ)
|
|
74
|
+
return _call(executable, args, dict(os.environ))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _call(executable: Path, args: list[str], environment: dict[str, str]) -> int:
|
|
78
|
+
try:
|
|
79
|
+
code = subprocess.call([str(executable), *args], env=environment)
|
|
80
|
+
except KeyboardInterrupt:
|
|
81
|
+
return 130
|
|
82
|
+
return 128 - code if code < 0 else code
|
yaga/self_update.py
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"""Explicit upgrades delegated to the Python tool manager owning this installation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import shlex
|
|
7
|
+
import shutil
|
|
8
|
+
import subprocess
|
|
9
|
+
import sys
|
|
10
|
+
import tempfile
|
|
11
|
+
from collections.abc import Callable
|
|
12
|
+
from dataclasses import dataclass
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
_UNMANAGED = (
|
|
16
|
+
"self update requires a uv tool installation; update yaga-cli with the manager "
|
|
17
|
+
"of this environment (for example uv sync --upgrade-package yaga-cli or "
|
|
18
|
+
"python -m pip install --upgrade yaga-cli)"
|
|
19
|
+
)
|
|
20
|
+
_PIPX = "self update requires a uv tool installation; run pipx upgrade yaga-cli"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class UpdateError(RuntimeError):
|
|
24
|
+
"""Raised when the running Python environment cannot be updated safely."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass(frozen=True)
|
|
28
|
+
class UpdateResult:
|
|
29
|
+
command: tuple[str, ...]
|
|
30
|
+
log: Path | None = None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _safe_text(value: object, *, maximum: int = 1000) -> str:
|
|
34
|
+
text = "".join(
|
|
35
|
+
ch if ch.isprintable() and ch not in "\r\n\t" else " " for ch in str(value)
|
|
36
|
+
).strip()
|
|
37
|
+
if len(text) > maximum:
|
|
38
|
+
return text[: maximum - 3] + "..."
|
|
39
|
+
return text
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _configure_utf8_output() -> None:
|
|
43
|
+
for stream in (sys.stdout, sys.stderr):
|
|
44
|
+
reconfigure = getattr(stream, "reconfigure", None)
|
|
45
|
+
if callable(reconfigure):
|
|
46
|
+
try:
|
|
47
|
+
reconfigure(encoding="utf-8", errors="replace")
|
|
48
|
+
except (OSError, ValueError):
|
|
49
|
+
pass
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def update_command() -> tuple[str, ...]:
|
|
53
|
+
"""Resolve uv and prove that its named tool is the current environment."""
|
|
54
|
+
return self_update(dry_run=True).command
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def self_update(*, dry_run: bool = False) -> UpdateResult:
|
|
58
|
+
"""Upgrade only YAGA, retaining uv's stored version constraints and extras."""
|
|
59
|
+
prefix = Path(sys.prefix).resolve()
|
|
60
|
+
if not (prefix / "uv-receipt.toml").is_file():
|
|
61
|
+
if (prefix / "pipx_metadata.json").is_file():
|
|
62
|
+
raise UpdateError(_PIPX)
|
|
63
|
+
raise UpdateError(_UNMANAGED)
|
|
64
|
+
|
|
65
|
+
raw_uv = shutil.which("uv")
|
|
66
|
+
if not raw_uv:
|
|
67
|
+
raise UpdateError("uv is unavailable; restore uv on PATH and retry")
|
|
68
|
+
uv_path = Path(raw_uv)
|
|
69
|
+
if not uv_path.is_absolute():
|
|
70
|
+
raise UpdateError("uv is unavailable; restore uv on PATH and retry")
|
|
71
|
+
uv_resolved = uv_path.resolve()
|
|
72
|
+
try:
|
|
73
|
+
cwd = Path.cwd().resolve()
|
|
74
|
+
except OSError as error:
|
|
75
|
+
raise UpdateError("could not resolve current working directory") from error
|
|
76
|
+
if uv_resolved.is_relative_to(cwd):
|
|
77
|
+
raise UpdateError("refusing a uv executable from the current directory")
|
|
78
|
+
|
|
79
|
+
probe_cmd = (str(uv_resolved), "--no-config", "tool", "dir")
|
|
80
|
+
directory = _probe(probe_cmd, prefix, timeout=15).strip(" \t\r\n\x0b\x0c\x1c\x1d\x1e\x1f")
|
|
81
|
+
if not directory or len(directory) > 4096 or "\n" in directory:
|
|
82
|
+
raise UpdateError("uv returned an invalid tool directory")
|
|
83
|
+
root = Path(directory)
|
|
84
|
+
if not root.is_absolute() or (root / "yaga-cli").resolve() != prefix:
|
|
85
|
+
raise UpdateError("uv tool directory does not own this YAGA installation")
|
|
86
|
+
|
|
87
|
+
command = (str(uv_resolved), "--no-config", "tool", "upgrade", "yaga-cli")
|
|
88
|
+
log = None if dry_run else _upgrade(command, prefix.parent, timeout=600)
|
|
89
|
+
return UpdateResult(command, log)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _probe(command: tuple[str, ...], cwd: Path, *, timeout: int) -> str:
|
|
93
|
+
try:
|
|
94
|
+
result = subprocess.run(
|
|
95
|
+
list(command),
|
|
96
|
+
cwd=cwd,
|
|
97
|
+
capture_output=True,
|
|
98
|
+
timeout=timeout,
|
|
99
|
+
check=True,
|
|
100
|
+
)
|
|
101
|
+
result.stderr.decode("utf-8")
|
|
102
|
+
return result.stdout.decode("utf-8").replace("\r\n", "\n").replace("\r", "\n")
|
|
103
|
+
except (OSError, UnicodeError, subprocess.SubprocessError) as error:
|
|
104
|
+
raise UpdateError("could not establish ownership using uv tool dir") from error
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _upgrade(command: tuple[str, ...], root: Path, *, timeout: int) -> Path | None:
|
|
108
|
+
environment = dict(os.environ)
|
|
109
|
+
environment["UV_TOOL_DIR"] = str(root)
|
|
110
|
+
if sys.platform == "win32":
|
|
111
|
+
return _windows_handoff(command, environment)
|
|
112
|
+
try:
|
|
113
|
+
subprocess.run(command, cwd=root, env=environment, timeout=timeout, check=True)
|
|
114
|
+
except (OSError, subprocess.SubprocessError) as error:
|
|
115
|
+
raise UpdateError(
|
|
116
|
+
"uv could not complete the update; inspect its output and retry "
|
|
117
|
+
"with uv tool upgrade yaga-cli"
|
|
118
|
+
) from error
|
|
119
|
+
return None
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def _windows_handoff(command: tuple[str, ...], environment: dict[str, str]) -> Path:
|
|
123
|
+
"""Run the manager only after the locked Windows launcher has exited."""
|
|
124
|
+
if sys.platform != "win32":
|
|
125
|
+
raise UpdateError("the Windows update handoff is unavailable on this platform")
|
|
126
|
+
python = Path(sys.base_prefix) / "python.exe"
|
|
127
|
+
if not python.is_file() or python.resolve().is_relative_to(Path(sys.prefix).resolve()):
|
|
128
|
+
raise UpdateError("cannot hand off this installation; run uv tool upgrade yaga-cli")
|
|
129
|
+
directory = Path(tempfile.mkdtemp(prefix="yaga-update-"))
|
|
130
|
+
worker = directory / "worker.py"
|
|
131
|
+
log = directory / "update.log"
|
|
132
|
+
try:
|
|
133
|
+
worker.write_bytes(Path(__file__).with_name("_update_worker.py").read_bytes())
|
|
134
|
+
with log.open("wb") as output:
|
|
135
|
+
subprocess.Popen(
|
|
136
|
+
[str(python), "-I", str(worker), command[0], str(os.getpid()), str(os.getppid())],
|
|
137
|
+
cwd=Path(sys.prefix).resolve().parent,
|
|
138
|
+
env=environment,
|
|
139
|
+
stdin=subprocess.DEVNULL,
|
|
140
|
+
stdout=output,
|
|
141
|
+
stderr=subprocess.STDOUT,
|
|
142
|
+
creationflags=subprocess.CREATE_NO_WINDOW,
|
|
143
|
+
)
|
|
144
|
+
except OSError as error:
|
|
145
|
+
worker.unlink(missing_ok=True)
|
|
146
|
+
raise UpdateError("could not start the update; run uv tool upgrade yaga-cli") from error
|
|
147
|
+
return log
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def run_wheel_update(*, dry_run: bool) -> int:
|
|
151
|
+
"""Run a self-update request parsed by the bundled CLI."""
|
|
152
|
+
_configure_utf8_output()
|
|
153
|
+
try:
|
|
154
|
+
result = self_update(dry_run=dry_run)
|
|
155
|
+
except KeyboardInterrupt:
|
|
156
|
+
return 130
|
|
157
|
+
except UpdateError as error:
|
|
158
|
+
print(_safe_text(error), file=sys.stderr)
|
|
159
|
+
return 2
|
|
160
|
+
report_update(result, dry_run, print)
|
|
161
|
+
return 0
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def report_update(result: UpdateResult, dry_run: bool, emit: Callable[[str], object]) -> None:
|
|
165
|
+
if dry_run:
|
|
166
|
+
emit("Update command: " + _safe_text(repr(list(result.command))))
|
|
167
|
+
elif result.log is not None:
|
|
168
|
+
emit("Update scheduled after YAGA exits. Completion log: " + _safe_text(result.log))
|
|
169
|
+
emit("Wait for YAGA_UPDATE_EXIT_CODE=0 in that log, then run yaga --version.")
|
|
170
|
+
path = result.log.as_posix()
|
|
171
|
+
emit("Read the log (repeat if the completion code is not present yet):")
|
|
172
|
+
emit(" Bash/zsh: " + _safe_text("cat -- " + shlex.quote(path)))
|
|
173
|
+
emit(
|
|
174
|
+
" PowerShell: "
|
|
175
|
+
+ _safe_text("Get-Content -LiteralPath '" + str(result.log).replace("'", "''") + "'")
|
|
176
|
+
)
|
|
177
|
+
emit("For future updates with foreground progress, run uv tool upgrade yaga-cli directly.")
|
|
178
|
+
else:
|
|
179
|
+
emit("uv completed the update. Run yaga --version to inspect the installed version.")
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: yaga-cli
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Configurable developer workflow checks for local use and GitHub Actions
|
|
5
|
+
Project-URL: Documentation, https://dariuszpanas.github.io/yaga/
|
|
6
|
+
Project-URL: Changelog, https://dariuszpanas.github.io/yaga/changelog.html
|
|
7
|
+
Project-URL: Repository, https://github.com/dariuszpanas/yaga
|
|
8
|
+
Project-URL: Issues, https://github.com/dariuszpanas/yaga/issues
|
|
9
|
+
Author: Dariusz Panas
|
|
10
|
+
License-Expression: BSD-3-Clause
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: cli,conventional-commits,git,github-actions,pre-commit,quality-assurance
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Requires-Python: >=3.12
|
|
24
|
+
Provides-Extra: quality
|
|
25
|
+
Provides-Extra: quality-bedrock
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# YAGA
|
|
29
|
+
|
|
30
|
+
<img src="https://dariuszpanas.github.io/yaga/assets/branding/isometric_terminal_y_logo_transparent.png" alt="YAGA terminal Y logo" width="128" height="128">
|
|
31
|
+
|
|
32
|
+
**Repository conventions you can check locally and enforce in CI.**
|
|
33
|
+
|
|
34
|
+
YAGA helps teams turn recurring review feedback into repeatable, deterministic checks. Catch
|
|
35
|
+
inconsistent commit structure, unfinished pull-request descriptions, missing companion changes,
|
|
36
|
+
unwanted committed files, risky workflow settings, and stale agent reviews before they become
|
|
37
|
+
another review conversation. Start with one check and adopt more as your project needs them.
|
|
38
|
+
|
|
39
|
+
## What can YAGA help with?
|
|
40
|
+
|
|
41
|
+
| Problem | What YAGA checks |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| Commit messages and branch names follow inconsistent conventions | [Commit policy](https://dariuszpanas.github.io/yaga/commit-policy.html) and [branch naming](https://dariuszpanas.github.io/yaga/branch-policy.html) defined by your team |
|
|
44
|
+
| Pull requests omit useful context or leave template sections unfinished | [Description checks](https://dariuszpanas.github.io/yaga/pull-request-descriptions.html) for required content, headings, templates, and optional spelling |
|
|
45
|
+
| Agent reviews finish asynchronously or leave pull requests waiting for an approval verdict | [Pull-request review checks](https://dariuszpanas.github.io/yaga/agent-review-gate.html#pull-request-review-state) with `codex`, `copilot`, and `claude` presets, active-review polling, and opt-in `APPROVE` / `REQUEST_CHANGES` verdicts |
|
|
46
|
+
| A change lands without the related files your project expects | [Changed-path rules](https://dariuszpanas.github.io/yaga/change-policy.html), such as source changes accompanied by tests |
|
|
47
|
+
| Unwanted files, oversized blobs, or incompatible paths enter the repository | [Committed-file checks](https://dariuszpanas.github.io/yaga/repository-checks.html) for contents, sizes, names, and entry modes |
|
|
48
|
+
| GitHub Actions workflows drift from your security and maintenance rules | [Workflow checks](https://dariuszpanas.github.io/yaga/workflow-checks.html) for immutable references, permission and checkout rules, and syntax |
|
|
49
|
+
| Local checks and CI enforce different policies | An explicit [repository plan](https://dariuszpanas.github.io/yaga/repository-plans.html) used in both places |
|
|
50
|
+
| A small change needs a clear test and qualification plan | [Test planning](https://dariuszpanas.github.io/yaga/test-planning.html) selects suites and required variants from explicit changed paths |
|
|
51
|
+
|
|
52
|
+
Checks produce actionable text, versioned JSON, and escaped GitHub workflow annotations with stable
|
|
53
|
+
exit codes (`0` pass, `1` policy finding, `2` input or operational error). You choose the policies
|
|
54
|
+
and checks; YAGA does not require adopting the entire CLI at once.
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
### Local CLI (`yaga-cli`)
|
|
59
|
+
|
|
60
|
+
Install the standalone `yaga` executable on Linux or macOS:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
curl -fsSL https://dariuszpanas.github.io/yaga/install.sh | sh
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
On Windows, run this command in PowerShell:
|
|
67
|
+
|
|
68
|
+
```powershell
|
|
69
|
+
irm https://dariuszpanas.github.io/yaga/install.ps1 | iex
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The installer verifies the release checksum for your operating system and CPU. Native releases
|
|
73
|
+
run without Python or Cargo. You can also install the standalone CLI from crates.io
|
|
74
|
+
(`cargo install --locked yaga-cli`), install the zero-dependency `yaga-cli` Python 3.12+ launcher
|
|
75
|
+
(`uv tool install --python 3.12 yaga-cli`), [build from a checkout with Cargo](https://dariuszpanas.github.io/yaga/getting-started.html#install-the-rust-cli-with-cargo),
|
|
76
|
+
or [use `yaga-core` in a Rust project](https://dariuszpanas.github.io/yaga/getting-started.html#use-yaga-core-in-a-rust-project).
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
yaga policy init --repo .
|
|
80
|
+
yaga policy check --repo .
|
|
81
|
+
yaga commit check
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Use `yaga policy init --repo .` interactively (or pass policy names or `--all`) to scaffold starter
|
|
85
|
+
policies under `.yaga/`, or `yaga config init --repo .` for a standalone `.yaga.toml` commit policy.
|
|
86
|
+
See [Get started](https://dariuszpanas.github.io/yaga/getting-started.html) for convenience
|
|
87
|
+
installers, `pipx`, virtual environments, and `pre-commit` setup. The Python package is tested on
|
|
88
|
+
Python 3.12 through 3.15.
|
|
89
|
+
|
|
90
|
+
### GitHub Action (`YAGA Checks`)
|
|
91
|
+
|
|
92
|
+
Run YAGA in GitHub Actions with `uses: dariuszpanas/yaga@<commit-sha>` (published on GitHub
|
|
93
|
+
Marketplace as **YAGA Checks**). `check` defaults to `commit` and supports `policy`, `pr-review`, `pr-triage`,
|
|
94
|
+
`pr-description`, `repo`, `branch`, `change`, `workflow`, `workflow-security`, `workflow-lint`,
|
|
95
|
+
`mode`, `path`, `size`, `tree`, and `gate`:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
99
|
+
with:
|
|
100
|
+
ref: ${{ github.event.pull_request.head.sha }}
|
|
101
|
+
fetch-depth: 0
|
|
102
|
+
persist-credentials: false
|
|
103
|
+
- uses: dariuszpanas/yaga@<audited-40-character-sha>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
See the [GitHub Actions guide](https://dariuszpanas.github.io/yaga/github-actions.html) and
|
|
107
|
+
copy-ready [workflow examples](https://github.com/dariuszpanas/yaga/tree/main/examples) for commit
|
|
108
|
+
policy, repository plans, and trusted `check: pr-review` verdict workflows.
|
|
109
|
+
|
|
110
|
+
## Documentation
|
|
111
|
+
|
|
112
|
+
- [Get started](https://dariuszpanas.github.io/yaga/getting-started.html) — install YAGA and run your first check.
|
|
113
|
+
- [Adoption recipes](https://dariuszpanas.github.io/yaga/recipes.html) — add local hooks, CI checks, and review gates to an existing repository.
|
|
114
|
+
- [Assess YAGA for CI](https://dariuszpanas.github.io/yaga/ci-adoption.html) — match your problem to a check and its prerequisites.
|
|
115
|
+
- [GitHub Actions](https://dariuszpanas.github.io/yaga/github-actions.html) — inputs, outputs, and trust boundaries for the unified `YAGA Checks` Action.
|
|
116
|
+
- [Command reference](https://dariuszpanas.github.io/yaga/commands.html) — complete CLI and report index.
|
|
117
|
+
- [Full documentation](https://dariuszpanas.github.io/yaga/) — policies, schemas, and operational guidance.
|
|
118
|
+
|
|
119
|
+
## Optional review tools
|
|
120
|
+
|
|
121
|
+
Beyond deterministic repository checks, YAGA offers:
|
|
122
|
+
|
|
123
|
+
- [Pull-request review checks, plans, and receipts](https://dariuszpanas.github.io/yaga/agent-review-gate.html) — evaluate head-bound Codex, Copilot, Claude, or custom bot reviews from snapshots or live `gh` state and optionally submit commit-bound pull-request reviews.
|
|
124
|
+
- [Commit-message feedback](https://dariuszpanas.github.io/yaga/commit-quality.html) — request an advisory review from OpenAI, Anthropic, Gemini, Amazon Bedrock, or your own OpenAI-compatible server.
|
|
125
|
+
- [GitHub status-gate adapter](https://dariuszpanas.github.io/yaga/github-review-adapter.html) — experimental multi-stage Codex lifecycle publisher for trusted workflows.
|
|
126
|
+
|
|
127
|
+
## Project status
|
|
128
|
+
|
|
129
|
+
YAGA is beta. CLI and configuration contracts may change before `1.0.0`. Workflow
|
|
130
|
+
security checks cover specific documented rules, not a complete security audit; see the
|
|
131
|
+
[security model](https://dariuszpanas.github.io/yaga/security.html) for boundaries and reporting.
|
|
132
|
+
|
|
133
|
+
[Changelog](https://dariuszpanas.github.io/yaga/changelog.html) ·
|
|
134
|
+
[Contributing](https://dariuszpanas.github.io/yaga/contributing.html)
|
|
135
|
+
|
|
136
|
+
Licensed under BSD-3-Clause.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
yaga/__init__.py,sha256=hMPs0xxSHxrtT5jdTWaBnv5cK5id-5d4NyeJjjXshYM,170
|
|
2
|
+
yaga/__main__.py,sha256=xIKR7HMQijVE8XS-L7osbMziVn5fewlMcTcZenB8EAk,184
|
|
3
|
+
yaga/_update_worker.py,sha256=b2YVyEejAe6MmHPzF4F3pLY8IhTWtt1t9K6A6yL1zt0,2641
|
|
4
|
+
yaga/entrypoint.py,sha256=9KJURLfxOI576tsPpXqf2OmkA-i8Oek5fIJeAl-vvMA,2743
|
|
5
|
+
yaga/self_update.py,sha256=463q57M-hd1q5vIn7PQnIrJ8mMbqQsiHF0B7rtOJVtE,7243
|
|
6
|
+
yaga/_bin/yaga.exe,sha256=tLJDNuqL6J8SEMw0Muiwp1nb7MgTnm2Tk1yEX5E3MeY,19456512
|
|
7
|
+
yaga_cli-0.6.0.dist-info/METADATA,sha256=UM4Sq3fr3RgMgw4B9gtgJh2GajfVVLNGgXAultR2Vdc,8167
|
|
8
|
+
yaga_cli-0.6.0.dist-info/WHEEL,sha256=WFezGyxI7afY59fTEbTiueKbbEV_hMxzB_HK5n-3eUY,94
|
|
9
|
+
yaga_cli-0.6.0.dist-info/entry_points.txt,sha256=jWoichskfFoZfY1vUa7Ke5tzUVR03ZZDu1AawCy4HxU,46
|
|
10
|
+
yaga_cli-0.6.0.dist-info/licenses/LICENSE,sha256=0Rnxsvq_ufqc7hchTq5nJmOUVm-I8kI_gewanAnpeLI,1550
|
|
11
|
+
yaga_cli-0.6.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Dariusz Panas
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|