polyctl 0.7.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.
- polyctl/__init__.py +7 -0
- polyctl/__main__.py +5 -0
- polyctl/a2a.py +226 -0
- polyctl/a2a_mcp.py +546 -0
- polyctl/acp.py +417 -0
- polyctl/adapters/README.md +101 -0
- polyctl/adapters/aider.json +32 -0
- polyctl/adapters/amazon-q.json +15 -0
- polyctl/adapters/amp.json +16 -0
- polyctl/adapters/antigravity.json +120 -0
- polyctl/adapters/claude-code.json +229 -0
- polyctl/adapters/cloud-generic.json +57 -0
- polyctl/adapters/codex.json +47 -0
- polyctl/adapters/command-code.json +45 -0
- polyctl/adapters/copilot.json +17 -0
- polyctl/adapters/cursor-agent.json +29 -0
- polyctl/adapters/deepseek.json +13 -0
- polyctl/adapters/droid.json +34 -0
- polyctl/adapters/gemini.json +30 -0
- polyctl/adapters/grok.json +22 -0
- polyctl/adapters/hermes.json +34 -0
- polyctl/adapters/kilocode.json +30 -0
- polyctl/adapters/kimi.json +23 -0
- polyctl/adapters/kiro.json +332 -0
- polyctl/adapters/ollama.json +29 -0
- polyctl/adapters/omp.json +34 -0
- polyctl/adapters/openai-api.json +68 -0
- polyctl/adapters/opencode.json +162 -0
- polyctl/adapters/pi.json +24 -0
- polyctl/adapters/pr-agent.json +54 -0
- polyctl/adapters/profiles.json +9 -0
- polyctl/adapters/qoder.json +163 -0
- polyctl/adapters/qwen.json +27 -0
- polyctl/adapters/reasonix.json +25 -0
- polyctl/adapters/rewriters/rtk.json +24 -0
- polyctl/adapters/trae.json +31 -0
- polyctl/adapters/vendors.json +42 -0
- polyctl/adapters/warp.json +88 -0
- polyctl/allowlist.py +1756 -0
- polyctl/api_review.py +920 -0
- polyctl/cli.py +835 -0
- polyctl/conformance_harness.py +9 -0
- polyctl/demo.py +503 -0
- polyctl/drivers.py +146 -0
- polyctl/email.py +160 -0
- polyctl/features.py +98 -0
- polyctl/journal.py +144 -0
- polyctl/language.py +945 -0
- polyctl/lib.py +1296 -0
- polyctl/matrix.py +660 -0
- polyctl/mcp.py +1362 -0
- polyctl/ntfy.py +169 -0
- polyctl/outbound.py +39 -0
- polyctl/parts/__init__.py +5 -0
- polyctl/parts/cli_authority.py +2615 -0
- polyctl/parts/cli_channels.py +1325 -0
- polyctl/parts/cli_checks.py +2293 -0
- polyctl/parts/cli_completion.py +686 -0
- polyctl/parts/cli_evidence.py +141 -0
- polyctl/parts/cli_gain.py +375 -0
- polyctl/parts/cli_harness.py +392 -0
- polyctl/parts/cli_hooks.py +1816 -0
- polyctl/parts/cli_install.py +638 -0
- polyctl/parts/cli_lanes.py +106 -0
- polyctl/parts/cli_maintenance.py +2536 -0
- polyctl/parts/cli_next.py +248 -0
- polyctl/parts/cli_pr.py +53 -0
- polyctl/parts/cli_project.py +2857 -0
- polyctl/parts/cli_review.py +5158 -0
- polyctl/parts/cli_status.py +898 -0
- polyctl/parts/lib_adapters.py +2933 -0
- polyctl/parts/lib_alarms.py +2106 -0
- polyctl/parts/lib_events.py +224 -0
- polyctl/parts/lib_evidence.py +412 -0
- polyctl/parts/lib_gates.py +2099 -0
- polyctl/parts/lib_lanes.py +829 -0
- polyctl/parts/lib_mail.py +1541 -0
- polyctl/parts/lib_next.py +652 -0
- polyctl/parts/lib_pr.py +331 -0
- polyctl/parts/lib_slices.py +3337 -0
- polyctl/parts/lib_state.py +2415 -0
- polyctl/parts/lib_transcript.py +4118 -0
- polyctl/pressure.py +325 -0
- polyctl/prices.json +47 -0
- polyctl/procs.py +1194 -0
- polyctl/settings.py +505 -0
- polyctl/skill/SKILL.md +365 -0
- polyctl/skillkit.py +503 -0
- polyctl/storage.py +2055 -0
- polyctl/telegram.py +327 -0
- polyctl/tiers.py +123 -0
- polyctl/verdicts.py +41 -0
- polyctl/watchdog.py +3887 -0
- polyctl/web.py +337 -0
- polyctl-0.7.0.dist-info/METADATA +235 -0
- polyctl-0.7.0.dist-info/RECORD +99 -0
- polyctl-0.7.0.dist-info/WHEEL +4 -0
- polyctl-0.7.0.dist-info/entry_points.txt +5 -0
- polyctl-0.7.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""Lanes: `polyctl lane start`, `polyctl lane list` and `polyctl lane remove` (LANE-START).
|
|
2
|
+
|
|
3
|
+
A part of src/polyctl/cli.py, run in its namespace by `_part` as the parts split out of it are; it is
|
|
4
|
+
not importable on its own.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def cmd_lane(cfg, args):
|
|
9
|
+
"""Start, list or remove this checkout's lanes: one git worktree per board item (LANE-START).
|
|
10
|
+
|
|
11
|
+
Two writers in one checkout make interleaved diffs nobody can review, and a worktree
|
|
12
|
+
added by hand is prepared by hand, or not at all. A lane is made only for a READY item,
|
|
13
|
+
on a branch of its own beside the main checkout, and is reported ready only once the
|
|
14
|
+
settings have prepared it. A refusal exits 2 and changes nothing, a lane setting polyctl cannot
|
|
15
|
+
use among its reasons; a lane git could not make, or the settings could not prepare, exits
|
|
16
|
+
1; a start stopped by Ctrl-C, SIGTERM or SIGHUP stops what it ran and exits 130.
|
|
17
|
+
"""
|
|
18
|
+
action = getattr(args, "action", None) or "list"
|
|
19
|
+
item = getattr(args, "item", None)
|
|
20
|
+
if action == "list":
|
|
21
|
+
return _lane_list(cfg)
|
|
22
|
+
if not item:
|
|
23
|
+
print(f"{C['red']}refused{C['reset']}: polyctl lane {action} names the board item: polyctl lane {action} <item>")
|
|
24
|
+
return 2
|
|
25
|
+
try:
|
|
26
|
+
return _lane_start(cfg, item) if action == "start" else _lane_remove(cfg, item)
|
|
27
|
+
except A.LaneRefused as exc:
|
|
28
|
+
print(f"{C['red']}refused{C['reset']}: {exc}")
|
|
29
|
+
return 2
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _lane_start(cfg, item):
|
|
33
|
+
root = cfg["root"]
|
|
34
|
+
try:
|
|
35
|
+
lane = A.start_lane(root, cfg, item)
|
|
36
|
+
except (OSError, RuntimeError) as exc:
|
|
37
|
+
print(f"{C['red']}lane {item} not started{C['reset']}: {exc}")
|
|
38
|
+
return 1
|
|
39
|
+
except KeyboardInterrupt:
|
|
40
|
+
# Stopped by a signal: say what the record now says, if the terminal is still there to read it. Nothing
|
|
41
|
+
# done to say it may take the interrupt's place, nor its exit 130: the record was read outside the guard,
|
|
42
|
+
# and what reading it raised replaced the interrupt (LEADS-INSTALL).
|
|
43
|
+
try:
|
|
44
|
+
lane = A.lane_record(root, item) or {}
|
|
45
|
+
if lane.get("problem"):
|
|
46
|
+
print(f"{C['red']}lane {item} not ready{C['reset']}: {lane['problem']}; "
|
|
47
|
+
f"`polyctl lane remove {item}` retires it")
|
|
48
|
+
except Exception:
|
|
49
|
+
pass
|
|
50
|
+
raise
|
|
51
|
+
where = f"{lane['path']} on {lane['branch']} from {lane['base'][:10]}"
|
|
52
|
+
if lane["state"] == "ready":
|
|
53
|
+
print(f"{C['green']}lane {item} ready{C['reset']}: {where}")
|
|
54
|
+
if lane["steps"]:
|
|
55
|
+
print(f" {C['dim']}{' · '.join(lane['steps'])}{C['reset']}")
|
|
56
|
+
return 0
|
|
57
|
+
print(f"{C['red']}lane {item} not ready{C['reset']}: {lane['problem']}")
|
|
58
|
+
if lane["steps"]:
|
|
59
|
+
print(f" {C['dim']}done before it: {' · '.join(lane['steps'])}{C['reset']}")
|
|
60
|
+
try:
|
|
61
|
+
with open(A.lane_log_path(root, lane["name"]), encoding=UTF8, errors="replace") as fh:
|
|
62
|
+
tail = _last_lines(fh.read()[-4000:])
|
|
63
|
+
except OSError:
|
|
64
|
+
tail = ""
|
|
65
|
+
if tail:
|
|
66
|
+
print(tail)
|
|
67
|
+
print(f" the worktree stays at {lane['path']} for inspection; `polyctl lane remove {item}` retires it")
|
|
68
|
+
return 1
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _lane_list(cfg):
|
|
72
|
+
rows = A.lane_rows(cfg["root"])
|
|
73
|
+
if not rows:
|
|
74
|
+
print(f"{C['dim']}no lanes; `polyctl lane start <item>` starts one for a READY board item{C['reset']}")
|
|
75
|
+
return 0
|
|
76
|
+
tones = {"ready": C["green"], "preparing": C["yellow"]}
|
|
77
|
+
for row in rows:
|
|
78
|
+
facts = []
|
|
79
|
+
if not row["exists"]:
|
|
80
|
+
facts.append("worktree gone")
|
|
81
|
+
elif row["changes"] is None:
|
|
82
|
+
facts.append("its git status cannot be read")
|
|
83
|
+
elif row["changes"]:
|
|
84
|
+
facts.append(f"{len(row['changes'])} uncommitted change(s)")
|
|
85
|
+
facts.append(f"board: {row['board'] or 'not on the board'}")
|
|
86
|
+
if row.get("held"):
|
|
87
|
+
facts.append(row["held"])
|
|
88
|
+
if row.get("problem"):
|
|
89
|
+
facts.append(row["problem"])
|
|
90
|
+
print(f" {C['b']}{row.get('item') or row['name']}{C['reset']} "
|
|
91
|
+
f"{tones.get(row['state'], C['red'])}{row['state']}{C['reset']} "
|
|
92
|
+
f"{C['dim']}{row.get('branch') or '-'}{C['reset']} {row.get('path') or '-'} "
|
|
93
|
+
f"{C['dim']}{' · '.join(facts)}{C['reset']}")
|
|
94
|
+
return 0
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _lane_remove(cfg, item):
|
|
98
|
+
try:
|
|
99
|
+
steps = A.remove_lane(cfg["root"], item)
|
|
100
|
+
except (OSError, RuntimeError) as exc:
|
|
101
|
+
print(f"{C['red']}stopped{C['reset']}: {exc}; `polyctl lane list` shows what is left")
|
|
102
|
+
return 1
|
|
103
|
+
for step in steps:
|
|
104
|
+
print(f" done: {step}")
|
|
105
|
+
print(f"{C['green']}lane {item} removed{C['reset']}")
|
|
106
|
+
return 0
|