dos-kernel 0.22.0__py3-none-win_amd64.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.
- dos/__init__.py +261 -0
- dos/_bin/dos-hook.exe +0 -0
- dos/_filelock.py +255 -0
- dos/_job_policy.py +97 -0
- dos/_tree.py +145 -0
- dos/admission.py +433 -0
- dos/answer_shape.py +299 -0
- dos/arbiter.py +859 -0
- dos/archive_lock.py +266 -0
- dos/arg_provenance.py +814 -0
- dos/attest.py +472 -0
- dos/breaker.py +311 -0
- dos/churn.py +226 -0
- dos/claim_extract.py +229 -0
- dos/claim_ttl.py +150 -0
- dos/cli.py +8721 -0
- dos/commit_audit.py +666 -0
- dos/completion.py +466 -0
- dos/concurrency_class.py +154 -0
- dos/config.py +1380 -0
- dos/config_lint.py +464 -0
- dos/cooldown.py +390 -0
- dos/coverage.py +387 -0
- dos/dangling_intent.py +287 -0
- dos/data_class.py +397 -0
- dos/decisions.py +1274 -0
- dos/decisions_tui.py +251 -0
- dos/dispatch_top.py +740 -0
- dos/dispatch_top_tui.py +116 -0
- dos/drivers/__init__.py +40 -0
- dos/drivers/ci_status.py +630 -0
- dos/drivers/citation_resolve.py +703 -0
- dos/drivers/decision_stop.py +98 -0
- dos/drivers/export_file.py +173 -0
- dos/drivers/export_otlp.py +275 -0
- dos/drivers/export_statsd.py +242 -0
- dos/drivers/hook_dialects.py +391 -0
- dos/drivers/job.py +47 -0
- dos/drivers/llm_judge.py +360 -0
- dos/drivers/memory_recall.py +1231 -0
- dos/drivers/notify_slack.py +373 -0
- dos/drivers/notify_webhook.py +251 -0
- dos/drivers/operator_judge.py +114 -0
- dos/drivers/os_acceptance.py +228 -0
- dos/drivers/paste_log.py +132 -0
- dos/drivers/plan_scope.py +133 -0
- dos/drivers/self_improve.py +375 -0
- dos/drivers/similarity_judge.py +249 -0
- dos/drivers/state_diff.py +274 -0
- dos/drivers/supervisor.py +347 -0
- dos/drivers/watchdog.py +363 -0
- dos/drivers/workshop.py +160 -0
- dos/durable_schema.py +344 -0
- dos/effect_witness.py +393 -0
- dos/efficiency.py +318 -0
- dos/enforce.py +414 -0
- dos/enumerate.py +776 -0
- dos/env_print.py +378 -0
- dos/event_severity.py +258 -0
- dos/evidence.py +692 -0
- dos/exec_capability.py +256 -0
- dos/export_cursor.py +143 -0
- dos/exporter.py +320 -0
- dos/firing_label.py +353 -0
- dos/fleet_roll.py +226 -0
- dos/gate_classify.py +827 -0
- dos/gh4_coverage.py +179 -0
- dos/git_delta.py +122 -0
- dos/guard.py +215 -0
- dos/health.py +552 -0
- dos/help_summary.py +519 -0
- dos/home.py +934 -0
- dos/hook_binary.py +194 -0
- dos/hook_dialect.py +271 -0
- dos/hook_exit.py +191 -0
- dos/hook_install.py +437 -0
- dos/id_alloc.py +304 -0
- dos/improve.py +499 -0
- dos/intent_ledger.py +635 -0
- dos/interpret.py +176 -0
- dos/intervention.py +769 -0
- dos/intervention_eval.py +371 -0
- dos/journal_delta.py +308 -0
- dos/judge_eval.py +328 -0
- dos/judges.py +366 -0
- dos/lane_infer.py +127 -0
- dos/lane_journal.py +1001 -0
- dos/lane_lease.py +952 -0
- dos/lane_overlap.py +228 -0
- dos/lease_health.py +282 -0
- dos/lifecycle.py +211 -0
- dos/liveness.py +352 -0
- dos/lock_modes.py +185 -0
- dos/log_source.py +395 -0
- dos/loop_decide.py +1746 -0
- dos/marker_gate.py +254 -0
- dos/marker_sensor.py +396 -0
- dos/noop_streak.py +280 -0
- dos/notify.py +479 -0
- dos/observe.py +175 -0
- dos/oracle.py +1661 -0
- dos/overlap_eval.py +214 -0
- dos/overlap_policy.py +342 -0
- dos/packet_sidecar.py +267 -0
- dos/phase_shipped.py +1985 -0
- dos/pick_priority.py +225 -0
- dos/pickable.py +369 -0
- dos/picker_oracle.py +1037 -0
- dos/plan_board.py +513 -0
- dos/plan_board_tui.py +113 -0
- dos/plan_source.py +455 -0
- dos/posttool_sensor.py +528 -0
- dos/precursor_gate.py +499 -0
- dos/precursor_gate_eval.py +239 -0
- dos/preflight.py +825 -0
- dos/pretool_sensor.py +490 -0
- dos/proc_delta.py +181 -0
- dos/productivity.py +296 -0
- dos/provider_limit.py +242 -0
- dos/py.typed +4 -0
- dos/reason_morphology.py +299 -0
- dos/reasons.py +449 -0
- dos/reconcile.py +173 -0
- dos/recurring_wedge.py +206 -0
- dos/render.py +393 -0
- dos/result_state.py +468 -0
- dos/resume.py +578 -0
- dos/resume_evidence.py +293 -0
- dos/retention.py +344 -0
- dos/reward.py +372 -0
- dos/rewind.py +587 -0
- dos/rewind_evidence.py +168 -0
- dos/rewind_tokens.py +252 -0
- dos/run_id.py +342 -0
- dos/scope.py +520 -0
- dos/scope_source.py +382 -0
- dos/scout.py +982 -0
- dos/self_modify.py +209 -0
- dos/sibling_scan.py +569 -0
- dos/skills/EXAMPLES.md +584 -0
- dos/skills/dos-class-cycle/SKILL.md +107 -0
- dos/skills/dos-dispatch/SKILL.md +177 -0
- dos/skills/dos-dispatch-loop/SKILL.md +254 -0
- dos/skills/dos-goal-gate/SKILL.md +269 -0
- dos/skills/dos-next-up/SKILL.md +231 -0
- dos/skills/dos-promote/SKILL.md +114 -0
- dos/skills/dos-replan/SKILL.md +159 -0
- dos/skills/dos-replan-loop/SKILL.md +114 -0
- dos/skills/dos-self-improve/SKILL.md +213 -0
- dos/skills/dos-supervise-loop/SKILL.md +180 -0
- dos/skills/dos-unstick/SKILL.md +108 -0
- dos/skills/dos-witness-claim/SKILL.md +251 -0
- dos/stamp.py +1002 -0
- dos/state_health.py +387 -0
- dos/status.py +114 -0
- dos/stop_policy.py +334 -0
- dos/supervise.py +1014 -0
- dos/testwitness.py +392 -0
- dos/timeline.py +1027 -0
- dos/tokens.py +485 -0
- dos/tool_stream.py +393 -0
- dos/tool_stream_eval.py +226 -0
- dos/trace.py +524 -0
- dos/verdict.py +140 -0
- dos/verdict_cli.py +189 -0
- dos/verdict_journal.py +497 -0
- dos/verdict_rollup.py +217 -0
- dos/verdicts.py +181 -0
- dos/wedge_reason.py +282 -0
- dos_kernel-0.22.0.dist-info/METADATA +859 -0
- dos_kernel-0.22.0.dist-info/RECORD +178 -0
- dos_kernel-0.22.0.dist-info/WHEEL +5 -0
- dos_kernel-0.22.0.dist-info/entry_points.txt +39 -0
- dos_kernel-0.22.0.dist-info/licenses/LICENSE +21 -0
- dos_kernel-0.22.0.dist-info/top_level.txt +2 -0
- dos_mcp/__init__.py +52 -0
- dos_mcp/py.typed +2 -0
- dos_mcp/server.py +779 -0
dos/dispatch_top_tui.py
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"""The live `dos top` screen — a `rich.live` poll loop over `dispatch_top.snapshot`.
|
|
2
|
+
|
|
3
|
+
The rendering layer for `dos top`'s interactive mode, the live-ops sibling of
|
|
4
|
+
`decisions_tui`. It re-`snapshot()`s the workspace on a cadence and redraws — a
|
|
5
|
+
read-only watchdog the operator leaves open during a fleet run. It mutates
|
|
6
|
+
nothing: no lease, no launch, no write path; the only effect is drawing.
|
|
7
|
+
|
|
8
|
+
**Graceful degradation (the floor that always works).** `rich` is an OPTIONAL
|
|
9
|
+
dependency (the `[tui]` extra) — the kernel core stays PyYAML-only. So this module
|
|
10
|
+
is import-light at module scope (no top-level `import rich`), and `run_top`
|
|
11
|
+
imports rich lazily; on ImportError (rich not installed) or a non-interactive
|
|
12
|
+
stdout (a pipe / CI), it falls straight through to a single
|
|
13
|
+
`dispatch_top.render_frame_text` frame and returns. `dos top` therefore ALWAYS
|
|
14
|
+
works — `dos top --once` and a piped `dos top` print the plain frame everywhere;
|
|
15
|
+
the live redraw is the enhancement where rich is present and stdout is a tty. This
|
|
16
|
+
is exactly the lazy-import + plain-floor split `decisions_tui` uses for curses.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
import sys
|
|
22
|
+
import time
|
|
23
|
+
|
|
24
|
+
from dos import config as _config
|
|
25
|
+
from dos import dispatch_top as _top
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _render_once(cfg) -> str:
|
|
29
|
+
"""One plain-text frame — the floor and the `--once` body."""
|
|
30
|
+
return _top.render_frame_text(_top.snapshot(cfg))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def run_top(
|
|
34
|
+
config=None, *, once: bool = False, interval: float = 5.0,
|
|
35
|
+
) -> int:
|
|
36
|
+
"""Run the live `dos top` screen, or print one frame and return.
|
|
37
|
+
|
|
38
|
+
Returns a process exit code (always 0 — a read-only viewer has nothing to
|
|
39
|
+
fail). `once=True`, a non-interactive stdout, or a missing `rich` all collapse
|
|
40
|
+
to a single plain-text frame. Otherwise a `rich.live` loop redraws every
|
|
41
|
+
`interval` seconds until the operator interrupts (Ctrl-C / q-via-SIGINT),
|
|
42
|
+
which exits cleanly — there is no state to unwind.
|
|
43
|
+
"""
|
|
44
|
+
cfg = _config.ensure(config)
|
|
45
|
+
|
|
46
|
+
# The floor: one frame, no live loop. Taken for --once, a piped/CI stdout, or
|
|
47
|
+
# a box without rich. `isatty` guards the pipe case so `dos top | less` and
|
|
48
|
+
# CI capture get clean text, never escape codes.
|
|
49
|
+
interactive = bool(getattr(sys.stdout, "isatty", lambda: False)())
|
|
50
|
+
if once or not interactive:
|
|
51
|
+
print(_render_once(cfg))
|
|
52
|
+
return 0
|
|
53
|
+
|
|
54
|
+
try:
|
|
55
|
+
from rich.console import Console
|
|
56
|
+
from rich.live import Live
|
|
57
|
+
except ImportError:
|
|
58
|
+
# rich not installed (the [tui] extra is absent) — print one frame and
|
|
59
|
+
# tell the operator how to get the live screen, then return cleanly.
|
|
60
|
+
print(_render_once(cfg))
|
|
61
|
+
print("\n(install `dos-kernel[tui]` for the live auto-refreshing screen)")
|
|
62
|
+
return 0
|
|
63
|
+
|
|
64
|
+
console = Console()
|
|
65
|
+
interval = max(0.5, float(interval))
|
|
66
|
+
try:
|
|
67
|
+
with Live(_renderable(cfg), console=console, screen=True,
|
|
68
|
+
auto_refresh=False, transient=True) as live:
|
|
69
|
+
while True:
|
|
70
|
+
live.update(_renderable(cfg), refresh=True)
|
|
71
|
+
time.sleep(interval)
|
|
72
|
+
except KeyboardInterrupt:
|
|
73
|
+
# Read-only: nothing to undo. Print a final static frame so the operator
|
|
74
|
+
# is left with the last state on the restored terminal, not a blank.
|
|
75
|
+
print(_render_once(cfg))
|
|
76
|
+
return 0
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _renderable(cfg):
|
|
80
|
+
"""Build the rich renderable for one frame, or a plain string if rich is gone.
|
|
81
|
+
|
|
82
|
+
Kept separate so the live loop body is trivial. Uses a `rich.panel.Panel`
|
|
83
|
+
per section when rich is importable (it is, inside `run_top`'s live branch);
|
|
84
|
+
falls back to the plain text frame defensively.
|
|
85
|
+
"""
|
|
86
|
+
frame = _top.snapshot(cfg)
|
|
87
|
+
try:
|
|
88
|
+
from rich.console import Group
|
|
89
|
+
from rich.panel import Panel
|
|
90
|
+
from rich.text import Text
|
|
91
|
+
except Exception: # pragma: no cover - rich present in the live branch
|
|
92
|
+
return _top.render_frame_text(frame)
|
|
93
|
+
|
|
94
|
+
def _panel(title: str, body: str, style: str) -> Panel:
|
|
95
|
+
return Panel(Text(body), title=f"[bold]{title}[/]", border_style=style,
|
|
96
|
+
title_align="left")
|
|
97
|
+
|
|
98
|
+
# Reuse the pure plain-text section renderers as the panel bodies — one source
|
|
99
|
+
# of truth for content; rich only adds the frame/colour. (Strip each section's
|
|
100
|
+
# own header line since the panel title carries it.)
|
|
101
|
+
def _body(text: str) -> str:
|
|
102
|
+
lines = text.splitlines()
|
|
103
|
+
return "\n".join(lines[1:]) if len(lines) > 1 else ""
|
|
104
|
+
|
|
105
|
+
header = Text(
|
|
106
|
+
f"dos top · {frame.workspace} · {frame.now_iso}"
|
|
107
|
+
+ ("" if frame.initialized else " (no dos.toml — generic main/global)"),
|
|
108
|
+
style="bold cyan",
|
|
109
|
+
)
|
|
110
|
+
return Group(
|
|
111
|
+
header,
|
|
112
|
+
_panel("lanes", _body(_top.render_lanes_text(frame.lanes)), "cyan"),
|
|
113
|
+
_panel("recent verdicts", _body(_top.render_verdicts_text(frame.verdicts)), "magenta"),
|
|
114
|
+
_panel("recent commits", _body(_top.render_activity_text(frame.activity)), "green"),
|
|
115
|
+
Text("read-only · Ctrl-C to quit · this screen mutates nothing", style="dim"),
|
|
116
|
+
)
|
dos/drivers/__init__.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""dos.drivers — the layer where the kernel admits what it cannot itself contain.
|
|
2
|
+
|
|
3
|
+
The kernel (`dos.oracle`, `dos.arbiter`, `dos.wedge_reason`, …) is pure
|
|
4
|
+
*mechanism*: deterministic, I/O-policy-free, host-name-free. A **driver** is the
|
|
5
|
+
layer outside that boundary. There are two kinds, and conflating them hides the
|
|
6
|
+
interesting one:
|
|
7
|
+
|
|
8
|
+
1. **Host policy packs** — the dull kind. The *policy* a particular host repo
|
|
9
|
+
supplies on top of the mechanism: which lanes exist, how they admit
|
|
10
|
+
concurrency, where its plans and ship-state live. Data + thin factory
|
|
11
|
+
functions over `dos.config.SubstrateConfig`. `dos.drivers.job` (the
|
|
12
|
+
reference userland app) is the reference one; its symbols are
|
|
13
|
+
re-exported from `dos.config` for backward compatibility.
|
|
14
|
+
|
|
15
|
+
2. **Out-of-kernel adjudicators** — the interesting kind. The kernel adjudicates
|
|
16
|
+
a claim deterministically (`verify`/`picker_oracle`) and ABSTAINS on what it
|
|
17
|
+
cannot mechanically prove. The driver layer is where a *non-deterministic*
|
|
18
|
+
adjudicator — a model judge, a heuristic, a debate — rules on that residue.
|
|
19
|
+
This is the **JUDGE rung** of the trust ladder (ORACLE → JUDGE → HUMAN, see
|
|
20
|
+
`docs/87_the-adjudicator-trust-ladder.md`). `dos.drivers.llm_judge` is the
|
|
21
|
+
reference one. A judge has the surface the kernel forbids (a provider, I/O,
|
|
22
|
+
non-determinism — *a model verifying a model*), which is exactly *why* it lives
|
|
23
|
+
here, hedged by four disciplines: deterministic-first, advisory-only,
|
|
24
|
+
fail-to-abstain, and abstention-first (`dos.judges`).
|
|
25
|
+
|
|
26
|
+
Both kinds obey the one-way arrow: **they import the kernel; the kernel never
|
|
27
|
+
imports them.** Adding a host, or a new adjudicator, means adding a module here (or
|
|
28
|
+
a `dos.judges`/`dos.predicates`/`dos.renderers` entry-point plugin), never touching
|
|
29
|
+
the kernel.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
from __future__ import annotations
|
|
33
|
+
|
|
34
|
+
from dos.drivers.job import JOB_LANE_TAXONOMY, job_config
|
|
35
|
+
from dos.drivers.workshop import WORKSHOP_LANE_TAXONOMY, workshop_config
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"JOB_LANE_TAXONOMY", "job_config",
|
|
39
|
+
"WORKSHOP_LANE_TAXONOMY", "workshop_config",
|
|
40
|
+
]
|