procyon-worker 0.1.0__py3-none-any.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.
- procyon_worker/__init__.py +75 -0
- procyon_worker/__main__.py +9 -0
- procyon_worker/agents.py +1992 -0
- procyon_worker/cli.py +1209 -0
- procyon_worker/config.py +249 -0
- procyon_worker/constants.py +314 -0
- procyon_worker/fix_context.py +168 -0
- procyon_worker/github.py +795 -0
- procyon_worker/intentions.py +140 -0
- procyon_worker/local_endpoint.py +279 -0
- procyon_worker/loop.py +559 -0
- procyon_worker/oauth.py +394 -0
- procyon_worker/paths.py +94 -0
- procyon_worker/plans_pin.py +188 -0
- procyon_worker/prompts/analysis.md +116 -0
- procyon_worker/prompts/bump-open.md +70 -0
- procyon_worker/prompts/bump.md +67 -0
- procyon_worker/prompts/fix-ci.md +62 -0
- procyon_worker/prompts/fix.md +62 -0
- procyon_worker/prompts/rebase.md +54 -0
- procyon_worker/quota.py +3162 -0
- procyon_worker/review_diagnostics.py +350 -0
- procyon_worker/review_state.py +389 -0
- procyon_worker/round.py +336 -0
- procyon_worker/runtime.py +208 -0
- procyon_worker/runtime_status.py +103 -0
- procyon_worker/salvage.py +314 -0
- procyon_worker/scripts/claim.sh +195 -0
- procyon_worker/scripts/gh-safe-pr-create +81 -0
- procyon_worker/scripts/git-safe-push +59 -0
- procyon_worker/scripts/oauth_refresh_loop.py +97 -0
- procyon_worker/scripts/review-local +27 -0
- procyon_worker/survey.py +818 -0
- procyon_worker/transcript.py +666 -0
- procyon_worker/tui.py +906 -0
- procyon_worker/update_check.py +217 -0
- procyon_worker/usage.py +421 -0
- procyon_worker/work_units.py +1396 -0
- procyon_worker/worker_manager.py +2421 -0
- procyon_worker-0.1.0.dist-info/METADATA +463 -0
- procyon_worker-0.1.0.dist-info/RECORD +44 -0
- procyon_worker-0.1.0.dist-info/WHEEL +4 -0
- procyon_worker-0.1.0.dist-info/entry_points.txt +2 -0
- procyon_worker-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""procyon_worker — the Procyon worker.
|
|
2
|
+
|
|
3
|
+
Bare `procyon` opens a dashboard + launcher; `procyon work [--loop]` does the work (one round, or
|
|
4
|
+
the driver loop); `procyon status` prints the read-only survey.
|
|
5
|
+
|
|
6
|
+
The worker acts on eic/Procyon as the authenticated `gh` account, and treats that
|
|
7
|
+
account's own PRs as the ones it tends. Each round does exactly ONE unit of work, chosen in
|
|
8
|
+
priority order: rebase -> bump -> fix-ci -> fix -> review -> analysis.
|
|
9
|
+
|
|
10
|
+
This package was split from a single-file script for navigability. The split is behaviour-
|
|
11
|
+
preserving. For both the test harness (which reaches `procyon_worker.<NAME>`) and the historical
|
|
12
|
+
single-module API, every submodule's top-level name is flattened into the package namespace below;
|
|
13
|
+
the submodules themselves stay importable (e.g. `procyon_worker.github`) so a test can monkeypatch
|
|
14
|
+
a function on the module that actually looks it up.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
# stdlib re-exports for the historical single-module surface (a few tests read tc.json, tc.time, …).
|
|
20
|
+
import json # noqa: F401
|
|
21
|
+
import random # noqa: F401
|
|
22
|
+
import subprocess # noqa: F401
|
|
23
|
+
import sys # noqa: F401
|
|
24
|
+
import time # noqa: F401
|
|
25
|
+
|
|
26
|
+
from . import (
|
|
27
|
+
agents,
|
|
28
|
+
cli,
|
|
29
|
+
config,
|
|
30
|
+
constants,
|
|
31
|
+
github,
|
|
32
|
+
loop,
|
|
33
|
+
oauth, # noqa: F401 — a submodule attribute, deliberately not flattened below
|
|
34
|
+
paths,
|
|
35
|
+
quota,
|
|
36
|
+
review_state,
|
|
37
|
+
round,
|
|
38
|
+
runtime, # noqa: F401 — a submodule attribute like oauth: small, and reached as procyon_worker.runtime
|
|
39
|
+
runtime_status,
|
|
40
|
+
survey,
|
|
41
|
+
transcript,
|
|
42
|
+
tui,
|
|
43
|
+
usage,
|
|
44
|
+
work_units,
|
|
45
|
+
worker_manager,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# Flatten each submodule's public + private top-level names into the package namespace, in
|
|
49
|
+
# dependency order, so the entire former single-module surface is reachable as procyon_worker.<NAME>.
|
|
50
|
+
# `oauth` is deliberately absent: it is a self-contained credential-rotation module whose names
|
|
51
|
+
# (Provider, provider, expires_at) would collide with the pacer's. Reach it as procyon_worker.oauth.
|
|
52
|
+
_MODULES = (
|
|
53
|
+
paths,
|
|
54
|
+
constants,
|
|
55
|
+
config,
|
|
56
|
+
github,
|
|
57
|
+
quota,
|
|
58
|
+
review_state,
|
|
59
|
+
survey,
|
|
60
|
+
round,
|
|
61
|
+
runtime_status,
|
|
62
|
+
transcript,
|
|
63
|
+
usage,
|
|
64
|
+
agents,
|
|
65
|
+
work_units,
|
|
66
|
+
loop,
|
|
67
|
+
worker_manager,
|
|
68
|
+
tui,
|
|
69
|
+
cli,
|
|
70
|
+
)
|
|
71
|
+
for _m in _MODULES:
|
|
72
|
+
for _k, _v in vars(_m).items():
|
|
73
|
+
if not _k.startswith("__"):
|
|
74
|
+
globals()[_k] = _v
|
|
75
|
+
del _m, _k, _v
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""`python -m procyon_worker …` — the child-process entry used by self_argv() for spawned
|
|
2
|
+
rounds and heartbeats, and a convenient equivalent of the `procyon` console script."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from .cli import cli_main
|
|
7
|
+
|
|
8
|
+
if __name__ == "__main__":
|
|
9
|
+
raise SystemExit(cli_main())
|