Zu Shadow: author a production agent by demonstration — record a human session, redact at capture, synthesize an agent + rail (§2.8)
Project description
zu-shadow — author an agent by demonstration (§2.8)
Import these (so you never reimplement Shadow by hand):
import does from zu_shadow import Recorderfold a human session into data.shadow.*events, redacted at capturefrom zu_shadow import Synthesizerturn a recording into a production agent + rail (offline, ScriptedProvider)from zu_shadow.live_executor import run_livere-run the demonstrated path on the live site and generalise it Also:
verify_and_gate/PromotionVerdict(the promotion gate before a path is trusted),redact_event/redact_text(the §9 content-free guarantee),SemanticTarget(role+name anchors, never selectors). Runzu capabilitiesto see what's installed. Depending onzu-corealone and rebuilding this loses redaction, the promotion gate, and the tested live executor.
A Shadow recording is the event bus run over a human session: the human is
the policy for that one run, so recording costs almost nothing architecturally.
You drive the task once, by hand; Shadow folds your clicks, types, navigations and
the page/network metadata into data.shadow.* events on the same append-only log
everything else in Zu uses, then synthesizes a production agent + a rail from it.
record (human session) ─▶ redact-at-capture ─▶ data.shadow.* on the log
│
synthesize (a Zu agent, ScriptedProvider offline)
│
agent spec + induced Fsm + Invariants + self-writing egress
│
verification-replay GATE (reuses zu-cli offline.py/build.py)
│
promote only if the recorded outcome reproduces
Four load-bearing disciplines
- Redaction is DEFAULT-ON and runs BEFORE append (
redaction.py). Passwords,Authorization/Cookie/Set-Cookieheaders, token/API-key shapes, and consumer-configured PII are stripped — including the "why" intent text — before any event reachesEventSink.append. The secret is gone before the event is hashed into the audit chain. This is conformance requirement ZU-AUDIT-4. - Capture is SEMANTIC (
capture.py). Every action is named by its target's{role, name, label}(the corezu_core.surfacecurrency, shared with the §4 locator and §5SurfaceView) — never a CSS selector or pixel coordinate, so the synthesized agent re-resolves on a changed page instead of breaking. - The synthesizer is a Zu agent (
synthesizer.py). It is driven by aModelProvider(offline-tested withScriptedProvider). The model writes only the policy prompt + goal; the egress allowlist, the inducedFsm, and theInvariants are derived deterministically from the log — the egress allowlist writes itself from the recordednetwork.responsehosts. No new FSM/invariant types: it emitszu_core.reachability.Fsmandzu_core.invariants.Invariant. - Promotion is GATED by reproduced outcome (
replay_gate.py). A synthesized agent does not run on real data until it reproduces the recorded outcome, reusing zu-cli'soffline.py/build.py. The "why" resolutions are surfaced for review, never auto-promoted.
The honest scope
Robustness comes from the runtime machinery — semantic re-resolution, detectors,
replay, the rail — not from a single recording. On a structurally different site
the honest behaviour is to escalate, not silently err. The live human recorder
(real Chromium + a real human over CDP) is demo/manual, behind the live extra and
a manual entrypoint (live.py); the offline core is fully tested against a
synthetic input/CDP stream at $0.
CLI
zu shadow record <stream.json> --site <url> -o recording.json # synthetic/live stream → recording
zu shadow synthesize <recording.json> --instruction "…" # recording → agent + rail proposal
zu shadow scale <agent> --rows rows.csv --var <name> # one governed run per CSV row
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zu_shadow-0.5.0.tar.gz.
File metadata
- Download URL: zu_shadow-0.5.0.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32e8e6fbefc04dead87a16e0e0955d1ad5e09b8a5c5889f26a91cb2fb4a3cc6e
|
|
| MD5 |
8f212209d5e87dc44099c6f59e21d515
|
|
| BLAKE2b-256 |
1f9c9d4cced020cbd4c7a9691c7713e9096dbcb59b65cd3d3ca908003ae324a5
|
File details
Details for the file zu_shadow-0.5.0-py3-none-any.whl.
File metadata
- Download URL: zu_shadow-0.5.0-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
695e9c14abff09f6db93d73d246bfaad6fb2e4f411bdf0521b2eef9cf1de1e08
|
|
| MD5 |
696cf8f76789a54b64be51fc49652b13
|
|
| BLAKE2b-256 |
02cdbcacf70c2b7fe1682a783744aec9b739923f95292e9dfc7dabea2cef9a19
|