simplicio-loop 1.0.2__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.
Files changed (28) hide show
  1. simplicio_loop/__init__.py +8 -0
  2. simplicio_loop/_bundle/hooks/hooks.claude.json +20 -0
  3. simplicio_loop/_bundle/hooks/hooks.json +12 -0
  4. simplicio_loop/_bundle/hooks/learn_stop.py +38 -0
  5. simplicio_loop/_bundle/hooks/loop_capture.py +67 -0
  6. simplicio_loop/_bundle/hooks/loop_stop.py +205 -0
  7. simplicio_loop/_bundle/hooks/orient_clamp.py +167 -0
  8. simplicio_loop/_bundle/hooks/orient_rewrite.py +96 -0
  9. simplicio_loop/_bundle/skills/simplicio-compress/SKILL.md +86 -0
  10. simplicio_loop/_bundle/skills/simplicio-learn/SKILL.md +70 -0
  11. simplicio_loop/_bundle/skills/simplicio-loop/SKILL.md +108 -0
  12. simplicio_loop/_bundle/skills/simplicio-orient/SKILL.md +188 -0
  13. simplicio_loop/_bundle/skills/simplicio-review/SKILL.md +94 -0
  14. simplicio_loop/_bundle/skills/simplicio-tasks/SKILL.md +213 -0
  15. simplicio_loop/_bundle/skills/simplicio-tasks/references/azure-devops-adapter.md +69 -0
  16. simplicio_loop/_bundle/skills/simplicio-tasks/references/extension-points.md +60 -0
  17. simplicio_loop/_bundle/skills/simplicio-tasks/references/orchestration.md +131 -0
  18. simplicio_loop/_bundle/skills/simplicio-tasks/references/quality-safety-delivery.md +121 -0
  19. simplicio_loop/_bundle/skills/simplicio-tasks/references/standing-loop-247.md +117 -0
  20. simplicio_loop/_bundle/skills/simplicio-tasks/references/token-economy.md +175 -0
  21. simplicio_loop/_bundle/skills/simplicio-tasks/references/web-evidence.md +93 -0
  22. simplicio_loop/cli.py +76 -0
  23. simplicio_loop-1.0.2.dist-info/METADATA +75 -0
  24. simplicio_loop-1.0.2.dist-info/RECORD +28 -0
  25. simplicio_loop-1.0.2.dist-info/WHEEL +5 -0
  26. simplicio_loop-1.0.2.dist-info/entry_points.txt +2 -0
  27. simplicio_loop-1.0.2.dist-info/licenses/LICENSE +21 -0
  28. simplicio_loop-1.0.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,117 @@
1
+ # 24/7 standing loop + arming the watcher (Step 7 full detail)
2
+
3
+ To run unattended for 24h and cover the WHOLE work universe, the skill becomes a durable,
4
+ self-governing, self-healing loop. When `simplicio-loop` is loaded, it provides the drive
5
+ (evidence-gated completion-promise + cap); this is the orchestrator-side policy. Ten axes:
6
+
7
+ ### 1. Durable driver
8
+ A durable scheduler (host-native cron if bound, else OS cron / scheduled task) that survives
9
+ reboot/closed session — NOT a session-bound loop. Each ~2-min tick: load state → poll all sources
10
+ → dispatch within capacity → persist state → sleep. If the loop dies, the scheduler restarts it
11
+ and it resumes from the journal.
12
+
13
+ ### 2. Total coverage matrix ("exactly everything")
14
+ Every SOURCE × every WORK-TYPE, drained each tick:
15
+
16
+ | Sources | Work-types |
17
+ |---|---|
18
+ | GitHub issues/PRs/CI, Jira, Asana, ClickUp, Trello, Azure DevOps, local, delegations | new feature/bug, CI failure, PR review comment / requested change, PR behind main, security advisory (Dependabot/CVE), flaky test, stale PR, confirmed TODO/FIXME, failed scheduled job |
19
+
20
+ "Done forever" never happens — idle cheaply when drained, wake on anything. Forward path
21
+ (Steps 2–6) and feedback path (Step 6b) both run every tick.
22
+
23
+ ### 3. Durable state (idempotent, resumable)
24
+ Persist on disk (journal, JSONL/SQLite): `seen` set, idempotency keys, in-flight claims,
25
+ dead-letter quarantine, `dry` counter, lessons. Each tick, reconcile state with reality (which PRs
26
+ merged, which items closed) before acting.
27
+
28
+ ### 4. Cost & resource governance
29
+ - **HARD $ kill-switch**: stop all spend when the daily budget is exceeded; resume next window.
30
+ Unattended runs MUST have a ceiling.
31
+ - Shared token/quota bucket across agents (no 429 storms); re-probe provider quota each tick.
32
+ - Re-probe CPU/RAM/disk/load each tick → degrade tiers as resources tighten.
33
+ - Disk hygiene: prune old worktrees, rotate logs, GC build artifacts + old receipts. Time-box
34
+ every item and every tick.
35
+
36
+ **Kill-switch — concrete.** `.orchestrator/loop-budget.json`:
37
+ ```json
38
+ { "daily_usd_ceiling": 0, "per_run_token_ceiling": 0,
39
+ "spent_usd_today": 0, "reset_at": "ISO-8601", "state": "running|halted" }
40
+ ```
41
+ Every tick + before every dispatch: read it; compute real spend via `savings_ledger` (or
42
+ estimate). `spent >= ceiling` (ceiling > 0) → `state=halted`, stop dispatch, alert, idle until
43
+ `reset_at`. `ceiling = 0` = UNSET → the loop refuses to run unattended (fail-safe). On `reset_at`,
44
+ zero spend, resume.
45
+
46
+ ### 5. Unattended safety (no human at the keyboard)
47
+ - Irreversible ops queue to an async approval channel and BLOCK. Never auto-proceed.
48
+ - **Headless rule:** if NO approver is reachable, REMOVE the destructive capability (do the safe
49
+ part, defer the rest) — do not execute unsupervised.
50
+ - Secret-scan every push. Aggregate blast-radius cap per item AND per day. Injection hardening on
51
+ all item/PR/comment content.
52
+
53
+ ### 6. Self-healing + intelligent retry by failure class
54
+ | Failure class | Detection | Retry strategy |
55
+ |---|---|---|
56
+ | Compile error | build/typecheck emits `^error` | Fix via `diagnostics` → retry (max 3×) |
57
+ | Test failure | runner exit ≠ 0 | Parse failing test + assertion → targeted fix → retry (max 3×) |
58
+ | Merge conflict | `git merge/rebase` exit ≠ 0 | Conflict retry protocol (Step 6b) → retry (max 3×) |
59
+ | Static-analysis blocker | new clippy/Sonar blocker | Fix the finding → re-run → retry (max 2×) |
60
+ | Timeout / infra | no output > wall-clock | Kill → re-queue → backoff 2× (max 2×) |
61
+ | Missing dependency | undefined symbol from unmerged dep | Suspend until the dependency issue closes |
62
+ | Security gate | secret in diff | Remove → rotate if live → retry once; second hit → dead-letter + alert |
63
+
64
+ Circuit breakers: open after N same-class failures on the same item → dead-letter with full log.
65
+ Watchdog: no progress across ALL items in M ticks → alert + reduce WIP cap. Dead-letter items
66
+ surfaced in the evidence package + next-run intake summary.
67
+
68
+ ### 7. Prioritization & WIP
69
+ Portfolio order: security/prod-broken → blockers → CI failures → high-impact/low-effort →
70
+ deadlines → bugs → features → docs. Enforce a WIP cap and backpressure.
71
+
72
+ ### 8. Observability
73
+ Structured event stream (JSONL: claimed/planned/edited/gate_passed/failed/merged/blocked) +
74
+ provenance chain. A live status surface (host-provided if bound). Periodic digest: items closed,
75
+ blocked, $ spent, queue depth.
76
+
77
+ **Periodic savings audit (deterministic, zero new model calls).** On a slow cadence, scan the
78
+ run's OWN command log for commands that MATCH the output-reduction catalog but ran RAW. Split
79
+ compound commands the same way the live gate does, sum estimated leaked tokens per the catalog's
80
+ expected-%, emit: adoption rate, top offending patterns, total tokens leaked. Reuse the exact same
81
+ catalog the live gate uses so the audit never drifts.
82
+
83
+ **Snapshot-based measurement (generate once, score offline).** Split any savings/quality
84
+ measurement into an EXPENSIVE generator (runs the model once, snapshots raw outputs + metadata to
85
+ a committed file) and a CHEAP offline scorer (recomputes from the snapshot with a FIXED tokenizer,
86
+ NO model call). Regenerate only when the skill/prompt set materially changes. Prefer per-item
87
+ MEDIAN, include min–max + stdev, disclose limits. Published metrics live between begin/end markers,
88
+ mechanically rewritten from committed evidence — never hand-typed.
89
+
90
+ ### 9. Self-improvement
91
+ After each item, record the trajectory + learn from the run (delegate to `simplicio-learn`); reuse
92
+ prior solved patterns (precedents) so they're applied, not regenerated. Run the Step 6 self-audit
93
+ per item. Daily meta-review: scan escapes/blocks → propose protocol tweaks, back-tested before adoption.
94
+
95
+ ### 10. Coordination & clean stop
96
+ Multiple loop instances: atomic claims (tuple-space/labels/lockfile) + lease/heartbeat/TTL so a
97
+ dead worker's items are reclaimed, never stolen while live. A single `STOP` signal (flag file
98
+ `.orchestrator/STOP` or channel command) halts cleanly between ticks. Daily budget resets on schedule.
99
+
100
+ **Exit condition: none by design** — idle when drained, wake on any new item/comment/check. Only
101
+ STOPS on the explicit stop signal, budget exhaustion, or a safety halt.
102
+
103
+ ## Arming the watcher (idle, between runs)
104
+ Cadence configurable (default ~2 min). The user chooses always-on vs session-only via the
105
+ kill-switch ceiling (`ceiling > 0` arms the 24/7 watcher, `ceiling = 0` runs once and stops).
106
+
107
+ Mechanisms (prefer the most durable):
108
+ - **Host-native durable scheduler** (if bound): a 2-minute tick that discovers + dispatches.
109
+ - **OS cron / scheduled task**: `*/2 * * * *` re-invoking this skill — survives reboots.
110
+ - **Session loop** (least durable): `/loop 2m /simplicio-tasks <goal>` — alive while the session is.
111
+ - **simplicio-loop** (if loaded): binds re-feed/iteration to a real stop-hook with an
112
+ evidence-gated completion-promise — exits only when `<promise>` is genuinely true AND backed by a
113
+ passing gate. Wires the watcher into the hard rule: never close work without a merged PR or
114
+ concrete evidence.
115
+
116
+ MANDATORY before arming 24/7: a cost ceiling configured; persistent source auth; the irreversible-op
117
+ human gate ON; the secret-scan gate blocking any commit with a secret.
@@ -0,0 +1,175 @@
1
+ # Token-economy routing gate (full detail)
2
+
3
+ The condensed rule lives in SKILL.md Step 1c; this is the full mechanism. When `simplicio-orient`
4
+ is loaded, delegate to it — it IS this gate as a standalone skill. The cheapest token is the one
5
+ not spent: deterministic first, terminal for facts, model only where it pays.
6
+
7
+ ## THINK vs NO-THINK
8
+ - NO-THINK (fast, prefer `deterministic_edit`/`orient`/`recall`): template/cache hit, known
9
+ scaffold, single mechanical op, exact regex/AST match, a deterministic plan exists, or the
10
+ answer is known from recall.
11
+ - THINK (planner/reviewer, record evidence): template miss, ambiguous task, multi-step plan, new
12
+ domain, error/conflict/retry, architecture decision, output touches multiple files, security/
13
+ release risk.
14
+
15
+ ## INTERNET — default OFF
16
+ - OFF when: the task is about local code; repo/vendor/lockfile already has the API/docs; it is a
17
+ test/docs/refactor change.
18
+ - ON only when: current external docs are required, a CVE/recent package version matters, an
19
+ API/SDK error is undocumented locally, or the source demands current information.
20
+
21
+ ## EXECUTE via terminal — NEVER simulate
22
+ Every git, cargo, gh, az, or shell command MUST run via a real terminal call. Never reason about
23
+ what a command "would return". Priority: (1) host native `shell_exec` if bound; (2) shell tool
24
+ with output clamping; (3) NEVER LLM-simulated output.
25
+
26
+ ## Auto-clarity (safety overrides brevity)
27
+ Compression YIELDS to the safety gate. When a command/message is security-sensitive, irreversible
28
+ (force-push, history rewrite, prod deploy, data/schema delete, mass-file delete), or
29
+ order-dependent, FORCE full-clarity verbose output for that segment — the complete warning, the
30
+ exact command quoted verbatim, steps in explicit order — then resume terse. Brevity is never
31
+ applied to a confirmation a human must act on.
32
+
33
+ ## Output-reduction catalog (drives clamp routing)
34
+ Consult BEFORE running. Each row `{pattern, recipe, exp-savings, SKIP-if}`. SKIP-if fires on
35
+ structured output (`--json`/`--jq`) or a write/confirm op. Clamp highest-savings first; NEVER
36
+ clamp a SKIP-if row; report the catalog's expected-% in the savings receipt.
37
+
38
+ | command pattern | reduce recipe | exp. savings | skip-if |
39
+ |---|---|---|---|
40
+ | test/spec runner | success-collapse to `pass: N`; on fail keep ≤20 error lines | ~90% | piped to structured consumer |
41
+ | type/compile check | error lines only; clean→`ok` | ~80% | — |
42
+ | diff / show | stat + hunks only, drop context | ~80% | piped to structured consumer |
43
+ | lint | findings only; clean→`ok` | ~80% | — |
44
+ | add / commit / push | collapse to `ok <branch/sha>` | ~59% | — |
45
+ | PR / list view | counts + titles only | ~87% | `--json`/`--jq` present |
46
+ | package / image inventory | keep ≤50 rows | ~50% | — |
47
+ | format / passthrough | run raw | 0% | always |
48
+
49
+ Content-type routing (headroom taxonomy): route by detected type — JSON → keep
50
+ errors/anomalies/boundaries; code → keep signatures, collapse bodies; logs → keep failures, drop
51
+ passing noise; diff → stat+hunks. Same intent as the rows above, articulated by content type.
52
+
53
+ ## Signal-tiered caps (one shared set)
54
+ `CAP_ERRORS=20`, `CAP_WARNINGS=10`, `CAP_LIST=20`, `CAP_INVENTORY=50`. Always keep ERROR lines
55
+ over surrounding context. A lowered cap is underflow-safe: falls back to the full cap rather than
56
+ emptying a non-empty result. Never flat "head N + tail N" (over-cuts errors).
57
+
58
+ ## Two clamp primitives (both `unless errors present`)
59
+ - Success-collapse: exit 0 + clean pattern + no error/warning → one-line verdict.
60
+ - Dedup-with-counts: collapse runs of identical lines to `line xN`.
61
+ If ANY error/warning line exists, fall back to signal-tiered caps — a collapse can NEVER hide a failure.
62
+
63
+ ## tee cache + CCR reversible retrieve (failure escape hatch)
64
+ On any NON-ZERO exit, or when a cap clips a FAILING command, write full output to
65
+ `.orchestrator/tee/<ts>_<cmd-slug>.log` and surface only the path + kept error lines. The agent
66
+ re-reads it lazily only if needed — recovering full context WITHOUT re-running (which re-burns
67
+ tokens and may be non-deterministic). Config `.orchestrator/orient.toml` → `tee.mode =
68
+ failures|always|never` (default `failures`).
69
+
70
+ **CCR (compress-cache-retrieve), folded from headroom:** make the clamp REVERSIBLE, not lossy.
71
+ Every clamped blob gets a stable handle = the tee path. Surface a retrieve convention so a worker
72
+ pulls the original on demand instead of re-running:
73
+ ```
74
+ retrieve <tee-path> [--lines a-b] [--grep PATTERN]
75
+ ```
76
+ This turns "lossy by policy" into "reversible decision point": clamp to a signature/summary
77
+ in-context, keep the full original on disk keyed by handle, fetch by handle only when the kept
78
+ lines aren't enough. Removes the main risk of aggressive clamping (losing the one line that
79
+ mattered) at zero up-front token cost.
80
+
81
+ ## Compound-command clamping (pipe/redirect-safe)
82
+ Understand `&& || ; |`: (1) split respecting quotes/escapes, clamp each segment; (2) for `|`,
83
+ clamp ONLY the left producer, leave the pipe TARGET raw; (3) never clamp a `find`/glob producer
84
+ feeding a pipe; (4) strip trailing redirects (`2>&1`,`>/dev/null`), clamp inner, re-append;
85
+ (5) unsplittable (`$(...)`, backticks, heredoc, file-target redirect) → run RAW with a tail clamp.
86
+
87
+ ## Density tiers by consumer
88
+ MACHINE tier (terse, fixed-schema — the worker report contract) for worker→orchestrator reports
89
+ and internal digests; HUMAN tier (readable prose) for PR bodies, status comments, confirmations.
90
+ Skip a compression pass on already-dense content (code, config, lockfiles).
91
+
92
+ ## Fail-open
93
+ Every reduction step is additive and removable. On ANY error/missing dep/unparseable payload/
94
+ unknown command, run the original command unchanged and propagate its REAL exit status. A bad
95
+ profile degrades to "slightly more tokens", never "task dead".
96
+
97
+ A raw `cargo check` costs ~2000 tokens to read; catalog-clamped
98
+ (`--message-format json | grep '"level":"error"'`) costs ~80.
99
+
100
+ ## Terminal substitution table — use the terminal, NOT the LLM
101
+ Detect platform once: `python3 -c "import platform; print(platform.system())"` →
102
+ `Windows | Darwin | Linux`. Prefer cross-platform (`git`,`gh`,`rg`,`python3`,`cargo`) first.
103
+
104
+ ### filesystem / system facts
105
+ | need | cross-platform | Windows | Linux/macOS |
106
+ |---|---|---|---|
107
+ | File exists? | `python3 -c "import os,sys;sys.exit(0 if os.path.exists('<p>') else 1)"` | `Test-Path <p>` | `test -f <p>` |
108
+ | Find in code | `rg "<pat>" --json` | same | same |
109
+ | Count matches | `rg -c "<pat>" <file>` | same | same |
110
+ | Grep + context | `rg -C 3 "<p>" <file>` | same | same |
111
+ | CPU cores | `python3 -c "import os;print(os.cpu_count())"` | `$env:NUMBER_OF_PROCESSORS` | `nproc` |
112
+ | Free disk GB | `python3 -c "import shutil;print(shutil.disk_usage('.').free//1024**3)"` | same | `df -BG .` |
113
+ | Free RAM MB | `python3 -c "import psutil;print(psutil.virtual_memory().available//1024**2)"` | `(Get-CimInstance Win32_OS).FreePhysicalMemory` | `free -m` |
114
+ | Today UTC | `python3 -c "from datetime import*;print(datetime.now(timezone.utc).date())"` | same | `date -u +%F` |
115
+ | Sort+dedup | `python3 -c "import sys;print('\n'.join(sorted(set(sys.stdin.read().split()))))"` | same | `sort -u` |
116
+ | Port listening? | `python3 -c "import socket;s=socket.socket();print(s.connect_ex(('127.0.0.1',<port>))==0)"` | `netstat -an \| findstr :<port>` | `ss -tlnp \| grep :<port>` |
117
+
118
+ ### git (highest-value — answer from git, not from reasoning)
119
+ | intent | command (cross-platform) |
120
+ |---|---|
121
+ | Current branch | `git rev-parse --abbrev-ref HEAD` |
122
+ | Ahead of main? | `git rev-list --count main..HEAD` |
123
+ | Files changed in branch | `git diff --name-only main...HEAD` |
124
+ | Commits since base | `git log <BASE>..HEAD --oneline` |
125
+ | Last commit SHA | `git rev-parse HEAD` |
126
+ | Branch exists remotely? | `git ls-remote --heads origin <b>` |
127
+ | Show file at commit | `git show <commit>:<path>` |
128
+ | Blame line N | `git blame -L <N>,<N> <file> --porcelain` |
129
+ | Sync branch | `git fetch origin <b> && git checkout <b> && git pull --ff-only` |
130
+ | Isolated checkout | `git worktree add --detach <dir> <sha>` |
131
+
132
+ ### gh (GitHub — all 5 scanned repos use this, not Azure DevOps)
133
+ | intent | command |
134
+ |---|---|
135
+ | Issue state | `gh issue view N --json state --jq ".state"` |
136
+ | Count open issues | `gh issue list --state open --json number --jq "length"` |
137
+ | List ready items (metadata) | `gh issue list --state open --json number,title,labels` |
138
+ | PR for branch | `gh pr list --head <b> --json number --jq ".[0].number"` |
139
+ | PR checks | `gh pr checks <n>` |
140
+ | PR diff | `gh pr diff <n>` |
141
+ | Comment / close | `gh issue comment N --body "…"` · `gh issue close N` |
142
+ | Workflow dispatch | `gh api repos/{owner}/{repo}/dispatches -f event_type=X` |
143
+
144
+ ### node (vscode, openclaw, claude-code) / python (hermes) / rust (codex)
145
+ | intent | command |
146
+ |---|---|
147
+ | Deterministic install | `npm ci` · `pnpm install --frozen-lockfile` · `uv sync --locked` |
148
+ | Build | `npm run build` · `cargo build -p <crate>` |
149
+ | Test (clamp: failures-only) | `npm test` · `pytest -q` · `cargo test` |
150
+ | Lint (clamp: findings-only) | `eslint .` · `ruff check --fix` · `cargo clippy --all-targets` |
151
+ | Typecheck | `tsc --noEmit` · `mypy` |
152
+ | Dep inventory | `cargo metadata --no-deps --format-version 1` · `npm ls --depth=0` |
153
+
154
+ ### docker / azure
155
+ | intent | command |
156
+ |---|---|
157
+ | Build / run | `docker build -t <img> .` · `docker run -d --name <c> <img>` |
158
+ | Exec / cleanup | `docker exec <c> sh -c "<cmd>"` · `docker rm -f <c>` |
159
+ | Compose | `docker compose -f <f> up -d` / `down` |
160
+ | Azure login / acct | `az login` · `az account show -o json` |
161
+ | Azure DevOps boards (if used) | `az boards work-item show --id N` · `az boards query --wiql "…"` · `az repos pr list` · `az pipelines runs list` |
162
+
163
+ > NOTE: the 5 scanned local repos (hermes-agent, openclaw, vscode, codex, claude-code) use
164
+ > **GitHub (`gh`) + GitHub Actions exclusively** — no Azure DevOps. The `az`/`az boards` rows are
165
+ > provided for repos that DO use Azure DevOps; bind them as a `source_adapter` only when detected.
166
+
167
+ **Rule:** if the answer is a fact about the filesystem, git, processes, or system resources — the
168
+ terminal knows it exactly; the LLM approximates it expensively. Always pick the terminal.
169
+
170
+ ## TOOLS / SKILLS — minimum necessary
171
+ - NO-TOOLS when the answer is derivable from context or the tool only confirms something
172
+ irrelevant. A tool call must change a decision, an implementation, or evidence.
173
+ - NO-SKILLS by default. Rank/recall first; lazy-load only a genuinely relevant skill.
174
+
175
+ Record the chosen modes per sub-task in the receipt (one line).
@@ -0,0 +1,93 @@
1
+ # Web evidence — `web_verify` via Playwright (front-end proof)
2
+
3
+ Concrete implementation of the `web_verify` extension point: drive a real browser to PROVE a
4
+ front-end change works, and capture a **screenshot + trace** as evidence. The north star from
5
+ Step 4b ("works, not just compiles") applied to UI: a front-end change that was never rendered is
6
+ PARTIAL, not done.
7
+
8
+ Credit: Microsoft Playwright (`playwright`, `playwright-mcp`, `playwright-python`). The agent-facing
9
+ path is **playwright-mcp** (structured accessibility snapshots, not pixels).
10
+
11
+ ## When it fires (cheap gate — terminal, not LLM)
12
+ Run the front-end detector via the terminal:
13
+ ```
14
+ git diff --name-only <base>...HEAD | rg -i "\.(tsx|jsx|vue|svelte|css|scss|html)$|^(components|pages|app|public|src/ui)/"
15
+ ```
16
+ No front-end files changed → SKIP the whole gate. Front-end files changed → run `web_verify` as a
17
+ conditional sub-gate of `validate`/`smoke`.
18
+
19
+ ## How to drive the browser
20
+ **Preferred — playwright-mcp** (the worker has the MCP server registered):
21
+ ```json
22
+ { "mcpServers": { "playwright": { "command": "npx",
23
+ "args": ["@playwright/mcp@latest", "--headless", "--output-dir", ".orchestrator/tee/web", "--save-trace"] } } }
24
+ ```
25
+ Per acceptance check: `browser_navigate(url)` → act (`browser_click` / `browser_fill_form` /
26
+ `browser_type`) → `browser_snapshot` (assert text present — compact a11y tree, no vision needed) →
27
+ `browser_take_screenshot({filename:"<issue>-<step>.png", fullPage:true})` →
28
+ `browser_console_messages` + `browser_network_requests` for an error scan. Trace auto-written by
29
+ `--save-trace`.
30
+
31
+ **Fallback A — `npx playwright` (no MCP):**
32
+ ```bash
33
+ npx playwright install --with-deps chromium
34
+ PWTEST_OUTPUT_DIR=.orchestrator/tee/web npx playwright test --trace on --output .orchestrator/tee/web
35
+ ```
36
+
37
+ **Fallback B — playwright-python / pytest (Python repos, e.g. hermes-agent):**
38
+ ```bash
39
+ pip install playwright pytest-playwright && playwright install chromium
40
+ pytest --tracing retain-on-failure --output .orchestrator/tee/web
41
+ ```
42
+ or programmatic: `context.tracing.start(screenshots=True, snapshots=True)` … `page.screenshot(
43
+ path=".orchestrator/tee/web/shot.png")` … `context.tracing.stop(path=".orchestrator/tee/web/trace.zip")`.
44
+
45
+ ## Capture into the evidence ledger
46
+ All artifacts write to `.orchestrator/tee/web/` (screenshots `*.png`, `trace.zip`, optional
47
+ `console.log`/`network.json`). Append a ledger row recording **paths + a one-line verdict**:
48
+ ```
49
+ web_verify: PASS — /login renders, 0 console errors; shot=.orchestrator/tee/web/login.png trace=…/trace.zip
50
+ ```
51
+ The ledger stores the path, never the bytes.
52
+
53
+ ## Attach to the PR (link, don't paste)
54
+ ```bash
55
+ # CI: prefer actions/upload-artifact; locally a release/gist works
56
+ gh release upload "evidence-<pr>" .orchestrator/tee/web/login.png .orchestrator/tee/web/trace.zip
57
+ gh pr comment <pr> --body "web_verify ✅ screenshot: <url> trace: <url> (open in trace.playwright.dev)"
58
+ ```
59
+
60
+ ## Token economy (critical)
61
+ - NEVER paste DOM, screenshot bytes, or full page HTML into context. Evidence = **file path/URL +
62
+ boolean verdict**.
63
+ - Prefer `browser_snapshot` (compact a11y text) over vision to assert state; the screenshot is for
64
+ the human reviewer, not the model.
65
+ - Clamp `browser_console_messages` / `browser_network_requests` through the orient catalog (tee to
66
+ file; feed back only count + first N error lines — same rtk-style clamp as build/test output).
67
+ - Run `--headless --isolated`, one browser context per check.
68
+
69
+ ## Enforcement (simplicio-review rubric line)
70
+ At MEDIUM+, `simplicio-review` adds: "if the diff is front-end, REQUIRE a `web_verify` ledger entry
71
+ with screenshot+trace paths and 0 console errors, else FAIL." `web_verify` is the producer;
72
+ `simplicio-review` is the enforcer; `pr`/`evidence` attaches.
73
+
74
+ ## Runnable worker (`scripts/web_verify.py`)
75
+ The prose above is the contract; `scripts/web_verify.py` is the runnable form. Two backends via
76
+ `--runner`: `npx` (default, Fallback A) and `pytest` (Fallback B, playwright-python);
77
+ playwright-mcp stays the richer path when a worker has the MCP server:
78
+ ```bash
79
+ python3 scripts/web_verify.py detect --base origin/main [--exit-code] # cheap FE-diff gate
80
+ python3 scripts/web_verify.py run --url URL --expect "Sign in" --issue 10 [--runner npx|pytest] [--upload --pr N]
81
+ python3 scripts/web_verify.py verify --url URL --expect TEXT --base origin/main --issue 10
82
+ ```
83
+ `verify` = detect + (run only if the diff is front-end, else a SKIP ledger note). It writes the
84
+ screenshot, trace, and console scan under `.orchestrator/tee/web/`, appends the ledger row, and
85
+ prints the MACHINE-tier verdict (`done|fail|skip|blocked`); a missing toolchain yields BLOCKED,
86
+ never a fake pass. **CI artifact upload:** `.github/workflows/web-verify.yml` runs the worker on
87
+ front-end PRs and uploads `.orchestrator/tee/web` via `actions/upload-artifact@v4`; locally pass
88
+ `--upload --pr <N>` to `gh release upload` the artifacts and `gh pr comment` the links.
89
+
90
+ ## Scope (v1 — don't over-engineer)
91
+ Build: FE-diff detector · `web_verify` worker (playwright-mcp preferred, npx/pytest fallback) ·
92
+ ledger row schema · the review rubric line. Skip: vision/coordinate caps, video, visual-diff
93
+ baselines, multi-browser matrix. Single headless Chromium + screenshot + trace is sufficient proof.
simplicio_loop/cli.py ADDED
@@ -0,0 +1,76 @@
1
+ """CLI for simplicio-loop: install the bundled skills + hooks into a runtime."""
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import shutil
6
+ from pathlib import Path
7
+
8
+ from . import __version__
9
+
10
+ BUNDLE = Path(__file__).resolve().parent / "_bundle"
11
+
12
+
13
+ def _copy_tree(src: Path, dst: Path) -> int:
14
+ """Copy every file under src into dst, preserving structure. Returns file count."""
15
+ count = 0
16
+ for item in src.rglob("*"):
17
+ if item.is_file():
18
+ out = dst / item.relative_to(src)
19
+ out.parent.mkdir(parents=True, exist_ok=True)
20
+ shutil.copy2(item, out)
21
+ count += 1
22
+ return count
23
+
24
+
25
+ def install(target: Path, globally: bool) -> int:
26
+ base = (Path.home() / ".claude") if globally else (target / ".claude")
27
+ skills_dst = base / "skills"
28
+ hooks_dst = (base / "hooks") if globally else (target / "hooks")
29
+
30
+ if not (BUNDLE / "skills").is_dir():
31
+ print("error: bundled skills not found in the installed package.", flush=True)
32
+ return 1
33
+
34
+ n_skills = _copy_tree(BUNDLE / "skills", skills_dst)
35
+ n_hooks = _copy_tree(BUNDLE / "hooks", hooks_dst)
36
+
37
+ print(f"simplicio-loop {__version__} installed:")
38
+ print(f" skills -> {skills_dst} ({n_skills} files)")
39
+ print(f" hooks -> {hooks_dst} ({n_hooks} files)")
40
+ print("")
41
+ print("Use it in your agent runtime (Claude Code, Cursor, ...):")
42
+ print(" /simplicio-tasks finish all the open issues")
43
+ return 0
44
+
45
+
46
+ def main(argv=None) -> int:
47
+ parser = argparse.ArgumentParser(
48
+ prog="simplicio-loop",
49
+ description=(
50
+ "Install the simplicio-loop super-plugin (6 AI-orchestration skills + "
51
+ "loop/token-economy hooks) into a runtime's skills location."
52
+ ),
53
+ )
54
+ parser.add_argument(
55
+ "command", nargs="?", default="install", choices=["install"],
56
+ help="action to run (default: install)",
57
+ )
58
+ parser.add_argument(
59
+ "--target", default=".",
60
+ help="project directory to install into (default: current directory)",
61
+ )
62
+ parser.add_argument(
63
+ "--global", dest="globally", action="store_true",
64
+ help="install into ~/.claude instead of the project",
65
+ )
66
+ parser.add_argument(
67
+ "-V", "--version", action="version", version=f"simplicio-loop {__version__}",
68
+ )
69
+ args = parser.parse_args(argv)
70
+ if args.command == "install":
71
+ return install(Path(args.target).resolve(), args.globally)
72
+ return 0
73
+
74
+
75
+ if __name__ == "__main__":
76
+ raise SystemExit(main())
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.4
2
+ Name: simplicio-loop
3
+ Version: 1.0.2
4
+ Summary: The Universal Looping AI Orchestrator — a runtime-agnostic super-plugin (6 skills) that drains any queue of work end-to-end on any LLM/runtime.
5
+ Author-email: Wesley Simplicio <wesleybob4@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/wesleysimplicio/simplicio-loop
8
+ Project-URL: Repository, https://github.com/wesleysimplicio/simplicio-loop
9
+ Project-URL: Issues, https://github.com/wesleysimplicio/simplicio-loop/issues
10
+ Keywords: ai,agent,orchestrator,llm,claude,cursor,automation,ralph-loop,token-economy,cli
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Topic :: Software Development :: Build Tools
17
+ Classifier: Topic :: Utilities
18
+ Classifier: Operating System :: OS Independent
19
+ Requires-Python: >=3.8
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Dynamic: license-file
23
+
24
+ # simplicio-loop
25
+
26
+ **The Universal Looping AI Orchestrator** — a runtime-agnostic **super-plugin** (6 skills) that
27
+ drains any queue of work end-to-end on **any LLM / runtime**:
28
+ `discover → implement → verify → merge → close → watch 24/7`, behind safety gates and a hard cost
29
+ kill-switch, at up to **96% fewer tokens**. Not a chatbot. A worker.
30
+
31
+ ![simplicio-loop](https://raw.githubusercontent.com/wesleysimplicio/simplicio-loop/main/assets/simplicio-loop-hero.jpg)
32
+
33
+ ## Install
34
+
35
+ ```bash
36
+ pip install simplicio-loop
37
+ ```
38
+
39
+ Then drop the skills + hooks into your project (or globally):
40
+
41
+ ```bash
42
+ simplicio-loop install # into ./.claude of the current project
43
+ simplicio-loop install --global # into ~/.claude (all projects)
44
+ ```
45
+
46
+ Now invoke it from your agent runtime (Claude Code, Cursor, Codex, Gemini, …):
47
+
48
+ ```
49
+ /simplicio-tasks finish all the open issues
50
+ ```
51
+
52
+ ## What you get — 6 skills
53
+
54
+ | Skill | What it does |
55
+ |---|---|
56
+ | `simplicio-tasks` | The orchestrator loop: discover → implement → verify → merge → close → watch 24/7. |
57
+ | `simplicio-loop` | Hardened Ralph loop — re-feed the goal until an evidence-gated `<promise>` or a cap. |
58
+ | `simplicio-orient` | Terminal-first token economy — output-reduction catalog, tee-cache, signatures-read. |
59
+ | `simplicio-review` | Adversarial review — parallel subagents on distinct rubrics, deduped into one verdict. |
60
+ | `simplicio-compress` | Output + memory compression, byte-preserving identifiers. |
61
+ | `simplicio-learn` | Retrospective — durable, deduped lessons written back to memory. |
62
+
63
+ ## Highlights
64
+
65
+ - **11 runtimes, one protocol** — Claude Code, Codex, VS Code/Copilot, Cursor, Antigravity, Kiro,
66
+ OpenCode, Gemini, Aider, Hermes, OpenClaw.
67
+ - **Evidence-gated completion** — never a false "done"; exits only on a verified `<promise>` or a
68
+ cap / budget / STOP.
69
+ - **Token economy** — honest "answer concisely" baseline; savings credited only on verified-correct
70
+ outcomes.
71
+
72
+ Requires Python 3.8+. The skills, hooks, and installer are pure cross-platform Python.
73
+
74
+ MIT — part of the [Simplicio](https://github.com/wesleysimplicio) ecosystem.
75
+ Full docs: <https://github.com/wesleysimplicio/simplicio-loop>
@@ -0,0 +1,28 @@
1
+ simplicio_loop/__init__.py,sha256=yIVFFI-jF4Cr7xX4JA-AFm6XGVszfPio8rEs5j5R3OQ,304
2
+ simplicio_loop/cli.py,sha256=xGHOMND_2HlzyXaGCkzZCX4YeZkPOip2U_9jZLFDmKc,2519
3
+ simplicio_loop/_bundle/hooks/hooks.claude.json,sha256=7Kun7MXhAkG2ztnDiDTteo9zBwdmtL0pmYs1pulLCoA,509
4
+ simplicio_loop/_bundle/hooks/hooks.json,sha256=hITifltLMzf1DsfiQLe5lNMRAMNAwBQbtfr8s_3mdiE,285
5
+ simplicio_loop/_bundle/hooks/learn_stop.py,sha256=x9zJiYqaXI1OvwLu8w-orPVID-yivVcE5KMuW-vVpzE,1298
6
+ simplicio_loop/_bundle/hooks/loop_capture.py,sha256=KxAuyy2fKI0r_9ACPZG_k4t-MIfQo5cLoUL7QXm61Qs,2447
7
+ simplicio_loop/_bundle/hooks/loop_stop.py,sha256=_DxtbwHpDsCfEZSAuz50uyQjnXCXCEIAPxX0t5cyw-M,7460
8
+ simplicio_loop/_bundle/hooks/orient_clamp.py,sha256=dN9JV5UJTzTfPhGcNNxLXXOjmkbBFx5vcPqvqrtSH6g,6161
9
+ simplicio_loop/_bundle/hooks/orient_rewrite.py,sha256=ZOt7ajvfhbWsOU5EwCr-UODx8ZGv3eaqZzGo5ALN3fM,3996
10
+ simplicio_loop/_bundle/skills/simplicio-compress/SKILL.md,sha256=mFVasjKa30HSfn8EG-MpfTFN9DHCv8ybfSUTxid2Pgw,4714
11
+ simplicio_loop/_bundle/skills/simplicio-learn/SKILL.md,sha256=FxLjlX13NdkrsXJoy9B5qPeWHmI8jndCd_P2JrY3FvI,4057
12
+ simplicio_loop/_bundle/skills/simplicio-loop/SKILL.md,sha256=cT88aCeHLGlXjTd_pCkb2VqXTM5ruk1bkLr3nwpIBvo,6322
13
+ simplicio_loop/_bundle/skills/simplicio-orient/SKILL.md,sha256=Me4r3Mh9TrRQpj_tBDcjX4OkOWEi35CMcKGu_0JaAFs,10835
14
+ simplicio_loop/_bundle/skills/simplicio-review/SKILL.md,sha256=XJ7l4Hz82xKTIutKynrjqv3M7h7OlQxLQZDoe6ejBR0,5218
15
+ simplicio_loop/_bundle/skills/simplicio-tasks/SKILL.md,sha256=CMeagEawcYf_nRmSH2UEM2Du1pLn__PrnRkJ9dNs9ec,15853
16
+ simplicio_loop/_bundle/skills/simplicio-tasks/references/azure-devops-adapter.md,sha256=d5Xaa_jZyU-XUl5fLVo_uCRmsrtm4ZJhtGhO1ynPBgc,4347
17
+ simplicio_loop/_bundle/skills/simplicio-tasks/references/extension-points.md,sha256=CatX67AbeGdgj7ipdJLT8MhKZ0e4St6VE4V9NjBWrMU,7443
18
+ simplicio_loop/_bundle/skills/simplicio-tasks/references/orchestration.md,sha256=TIIPW1GUopHainPax1oPDNGR0Rr5Z4W5nj9zlk4c77s,8516
19
+ simplicio_loop/_bundle/skills/simplicio-tasks/references/quality-safety-delivery.md,sha256=ybOSwMYRH5W-XJHsSHPTZJ28hWScar19K8khLydRK_k,8094
20
+ simplicio_loop/_bundle/skills/simplicio-tasks/references/standing-loop-247.md,sha256=cpTpY-lR1SCBN3jRHIK_imk5hi2MyClA7qXuJVPqUtg,7448
21
+ simplicio_loop/_bundle/skills/simplicio-tasks/references/token-economy.md,sha256=1F9y7uyXJtxEMuse58EM7hQm75nXqXkXpjSCVPwD0u4,10799
22
+ simplicio_loop/_bundle/skills/simplicio-tasks/references/web-evidence.md,sha256=EaOUfu1LM53gBSWaxIrxMoLMl1vbw4c3_3xN021G5vw,5403
23
+ simplicio_loop-1.0.2.dist-info/licenses/LICENSE,sha256=M9nybyYRmZgzRcII42mrIiSDj8Ay0E6XV1xGAsT7J7M,1073
24
+ simplicio_loop-1.0.2.dist-info/METADATA,sha256=ptPMglTiibOPmx83v2B8pNqodkT8izxSczxYeODE6DI,3359
25
+ simplicio_loop-1.0.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
26
+ simplicio_loop-1.0.2.dist-info/entry_points.txt,sha256=ZfdATdazngE4o68qwDHv0t4WAWiAYdQAjVizMTxEK6c,59
27
+ simplicio_loop-1.0.2.dist-info/top_level.txt,sha256=VNjXUAbkTKMspHVv_w5B4JDsu43U_Rw1kH8iJLZHqA0,15
28
+ simplicio_loop-1.0.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ simplicio-loop = simplicio_loop.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wesley Simplicio
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.
@@ -0,0 +1 @@
1
+ simplicio_loop