augur-sdk 0.1.0__tar.gz

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 (43) hide show
  1. augur_sdk-0.1.0/.gitignore +30 -0
  2. augur_sdk-0.1.0/CHANGELOG.md +30 -0
  3. augur_sdk-0.1.0/LICENSE +190 -0
  4. augur_sdk-0.1.0/PKG-INFO +322 -0
  5. augur_sdk-0.1.0/README.md +292 -0
  6. augur_sdk-0.1.0/examples/capture_from_cua.py +194 -0
  7. augur_sdk-0.1.0/pyproject.toml +96 -0
  8. augur_sdk-0.1.0/src/augur_sdk/__init__.py +60 -0
  9. augur_sdk-0.1.0/src/augur_sdk/_schema/__init__.py +93 -0
  10. augur_sdk-0.1.0/src/augur_sdk/_schema/json/__init__.py +0 -0
  11. augur_sdk-0.1.0/src/augur_sdk/_schema/json/capture_mode.schema.json +18 -0
  12. augur_sdk-0.1.0/src/augur_sdk/_schema/json/coordinate_space.schema.json +19 -0
  13. augur_sdk-0.1.0/src/augur_sdk/_schema/json/debug_session.schema.json +69 -0
  14. augur_sdk-0.1.0/src/augur_sdk/_schema/json/decision_event.schema.json +48 -0
  15. augur_sdk-0.1.0/src/augur_sdk/_schema/json/diagnostic_finding.schema.json +40 -0
  16. augur_sdk-0.1.0/src/augur_sdk/_schema/json/failure_class.schema.json +21 -0
  17. augur_sdk-0.1.0/src/augur_sdk/_schema/json/manifest.schema.json +95 -0
  18. augur_sdk-0.1.0/src/augur_sdk/_schema/json/observation.schema.json +90 -0
  19. augur_sdk-0.1.0/src/augur_sdk/_schema/json/provenance.schema.json +14 -0
  20. augur_sdk-0.1.0/src/augur_sdk/_schema/json/replay_fixture.schema.json +72 -0
  21. augur_sdk-0.1.0/src/augur_sdk/_schema/json/step_trace.schema.json +123 -0
  22. augur_sdk-0.1.0/src/augur_sdk/_schema/json/trace.schema.json +16 -0
  23. augur_sdk-0.1.0/src/augur_sdk/_version.py +7 -0
  24. augur_sdk-0.1.0/src/augur_sdk/adapter.py +50 -0
  25. augur_sdk-0.1.0/src/augur_sdk/bundle.py +353 -0
  26. augur_sdk-0.1.0/src/augur_sdk/capture.py +99 -0
  27. augur_sdk-0.1.0/src/augur_sdk/diagnostics/__init__.py +30 -0
  28. augur_sdk-0.1.0/src/augur_sdk/diagnostics/engine.py +205 -0
  29. augur_sdk-0.1.0/src/augur_sdk/diagnostics/packs/__init__.py +1 -0
  30. augur_sdk-0.1.0/src/augur_sdk/diagnostics/packs/cua.py +353 -0
  31. augur_sdk-0.1.0/src/augur_sdk/models.py +265 -0
  32. augur_sdk-0.1.0/src/augur_sdk/py.typed +0 -0
  33. augur_sdk-0.1.0/src/augur_sdk/recorder.py +88 -0
  34. augur_sdk-0.1.0/src/augur_sdk/redaction.py +123 -0
  35. augur_sdk-0.1.0/src/augur_sdk/session.py +250 -0
  36. augur_sdk-0.1.0/src/augur_sdk/storage.py +157 -0
  37. augur_sdk-0.1.0/src/augur_sdk/streaming.py +199 -0
  38. augur_sdk-0.1.0/src/augur_sdk/validation.py +202 -0
  39. augur_sdk-0.1.0/tests/test_capture_mode.py +20 -0
  40. augur_sdk-0.1.0/tests/test_diagnostics.py +18 -0
  41. augur_sdk-0.1.0/tests/test_redaction.py +37 -0
  42. augur_sdk-0.1.0/tests/test_session_end_to_end.py +115 -0
  43. augur_sdk-0.1.0/tests/test_storage.py +32 -0
@@ -0,0 +1,30 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .venv/
6
+ venv/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ dist/
11
+ build/
12
+
13
+ # Editors
14
+ .vscode/
15
+ .idea/
16
+ *.swp
17
+ .DS_Store
18
+
19
+ # Secrets / env
20
+ .env
21
+ .env.local
22
+ .env.*.local
23
+
24
+ # Logs / bundles
25
+ *.log
26
+ augur-data/
27
+ bundles/
28
+
29
+ # MkDocs build output
30
+ site/
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ All notable changes to `augur-sdk` are recorded here. Format roughly follows
4
+ [Keep a Changelog](https://keepachangelog.com/), with semver applied per
5
+ `docs/versioning.md` upstream (`MAJOR.MINOR.PATCH`; pre-1.0 minors may break).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] — 2026-05-19
10
+
11
+ Initial standalone release.
12
+
13
+ ### Added
14
+
15
+ - `DebugSession` context manager — the only API a CUA needs to integrate.
16
+ - Capture modes (`off` / `metadata` / `trace` / `screenshots` / `model_io` / `dispatch` / `replay` / `full`) spec'd in `augur_sdk.CaptureMode`.
17
+ - Atomic local bundle writer with path-stable layout (`manifest.json`, `trace.json`, `steps/`, `events/`, `screenshots/`, `AGENT.md`, `schema/`).
18
+ - DSN-based streaming sink (Sentry-style). Set `AUGUR_DSN=…` or pass `dsn=` directly; per-step + per-screenshot POSTs with a 15 s heartbeat. Bundle on disk is always written even if the network is flapping.
19
+ - Vendored JSON Schemas (`augur_sdk._schema`) — zero monorepo dependency at install time.
20
+ - `RedactionPolicy` + shipped `default-pii-v1` policy: drops `Authorization` / `Cookie` / `Set-Cookie` / `X-API-Key`; masks `token` / `api_key` / `ssn` / `credit_card` / `cvv`; regex-scrubs bearer tokens, AWS keys, JWTs, and password=… patterns.
21
+ - Diagnostic rules engine + generic `cua` rule pack (10 rules). Adapter packs land via the `augur.rule_packs` entry-point group.
22
+ - Adapter base protocol (`augur_sdk.Adapter`) + contract for adapter authors.
23
+ - `LocalFSStore` (default) + `S3Store` stub for forward compatibility.
24
+ - `validate_bundle()` — schema-validates every record in a bundle against the vendored JSON Schemas.
25
+
26
+ ### Compatibility
27
+
28
+ - Schema version: `0.1`.
29
+ - Python: ≥ 3.11.
30
+ - Compatible with the Augur server's `/api/v1/*` ingest endpoints at server version 0.1.x.
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend, and
172
+ hold each Contributor harmless for any liability incurred by, or
173
+ claims asserted against, such Contributor by reason of your accepting
174
+ any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 The Augur Authors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,322 @@
1
+ Metadata-Version: 2.4
2
+ Name: augur-sdk
3
+ Version: 0.1.0
4
+ Summary: Augur SDK — instrument any screenshot-grounded computer-use agent (CUA). Sentry-style DSN streaming + local bundle writer.
5
+ Project-URL: Homepage, https://mercurialsolo.github.io/augur-sdk/
6
+ Project-URL: Repository, https://github.com/mercurialsolo/augur-sdk
7
+ Project-URL: Documentation, https://mercurialsolo.github.io/augur-sdk/
8
+ Project-URL: Issues, https://github.com/mercurialsolo/augur-sdk/issues
9
+ Project-URL: Changelog, https://mercurialsolo.github.io/augur-sdk/changelog/
10
+ Author-email: Augur Authors <barada@gmail.com>
11
+ License: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: computer-use-agent,cua,debugger,instrumentation,observability,screenshot-grounding,sdk
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development :: Debuggers
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: jsonschema>=4.22
27
+ Requires-Dist: referencing>=0.35
28
+ Requires-Dist: urllib3>=2
29
+ Description-Content-Type: text/markdown
30
+
31
+ # augur-sdk
32
+
33
+ [![PyPI](https://img.shields.io/pypi/v/augur-sdk.svg)](https://pypi.org/project/augur-sdk/)
34
+ [![Python](https://img.shields.io/pypi/pyversions/augur-sdk.svg)](https://pypi.org/project/augur-sdk/)
35
+ [![License: Apache 2.0](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE)
36
+ [![Docs](https://img.shields.io/badge/docs-mercurialsolo.github.io/augur--sdk-blue.svg)](https://mercurialsolo.github.io/augur-sdk/)
37
+
38
+ **Full docs:** https://mercurialsolo.github.io/augur-sdk/
39
+
40
+ Instrument any **screenshot-grounded computer-use agent** (CUA) with one
41
+ context manager. Streams traces to **Augur** (a hosted cloud service for
42
+ CUA observability) over a Sentry-style DSN AND writes a path-stable
43
+ bundle to disk — both work, both at once, no extra glue.
44
+
45
+ > This is the **public client SDK**. The Augur server, viewer, and CLI
46
+ > are a managed cloud service — sign up at augur (URL TBD) to get a DSN.
47
+ > The SDK also works standalone in local-bundle mode with no account.
48
+
49
+ ```python
50
+ from augur_sdk import CaptureMode, DebugSession
51
+
52
+ with DebugSession(
53
+ run_id="run_abc",
54
+ client_name="myagent",
55
+ capture_mode=CaptureMode.SCREENSHOTS,
56
+ out_dir="/var/log/augur/run_abc",
57
+ ) as session:
58
+ pre = session.attach_observation(step_index=0, kind="pre", png_bytes=...)
59
+ post = session.attach_observation(step_index=0, kind="post", png_bytes=...)
60
+ session.record_step({
61
+ "step_id": "run_abc/step/0000",
62
+ "step_index": 0,
63
+ "step_type": "click",
64
+ "intent": "Click the login button",
65
+ "status": "succeeded",
66
+ "started_at": "2026-05-19T00:00:00Z",
67
+ "observation_pre": pre,
68
+ "observation_post": post,
69
+ "action": {"type": "click", "params": {"x": 100, "y": 200},
70
+ "coordinate_space": "viewport_css_px",
71
+ "dispatch_backend": "playwright"},
72
+ "grounding": {"provider": "myagent", "provenance": "screenshot"},
73
+ "verdict": {"status": "passed"},
74
+ })
75
+ ```
76
+
77
+ Set `AUGUR_DSN=…` and the same code streams to your Augur server. No code
78
+ change required to switch between local-only and hosted modes.
79
+
80
+ ## Install
81
+
82
+ ### From PyPI (when published)
83
+
84
+ ```bash
85
+ pip install augur-sdk
86
+ # or
87
+ uv pip install augur-sdk
88
+ ```
89
+
90
+ ### From source (today)
91
+
92
+ ```bash
93
+ git clone https://github.com/mercurialsolo/augur-sdk.git
94
+ cd augur-sdk
95
+ pip install -e .
96
+ # or
97
+ uv pip install -e .
98
+ ```
99
+
100
+ ### Requirements
101
+
102
+ - Python ≥ 3.11
103
+ - `jsonschema`, `referencing`, `urllib3` (installed automatically)
104
+
105
+ The SDK is self-contained: JSON Schemas are vendored inside the package
106
+ (`augur_sdk._schema`), so `import augur_sdk` requires no other Augur
107
+ components. The Augur server, viewer, and CLI are operated as a hosted
108
+ service — you only need this package on the **client side** (your CUA
109
+ runtime).
110
+
111
+ ## Quickstart — three modes
112
+
113
+ ### 1. Local-only (no server)
114
+
115
+ The default. Bundles are written under `out_dir/`. Use `augur view <dir>`
116
+ from the main Augur repo to render them in the viewer, or hand the path
117
+ to a coding agent.
118
+
119
+ ```python
120
+ from augur_sdk import CaptureMode, DebugSession
121
+
122
+ with DebugSession(
123
+ run_id="run_abc",
124
+ client_name="myagent",
125
+ out_dir="/var/log/augur/run_abc",
126
+ capture_mode=CaptureMode.SCREENSHOTS,
127
+ ) as session:
128
+ ...
129
+ ```
130
+
131
+ ### 2. Stream to an Augur server (Sentry-style)
132
+
133
+ Set one env var; nothing else changes.
134
+
135
+ ```bash
136
+ export AUGUR_DSN='https://augur.example/api/v1?token=<api_key>&tenant=<tenant_slug>'
137
+ ```
138
+
139
+ The SDK heart-beats every 15 s while a session is open so the server's
140
+ connection-status indicator stays green. Each step + screenshot + event
141
+ streams over HTTPS with `Authorization: Bearer <api_key>`. The local
142
+ bundle is still written; streaming is observe-only on top.
143
+
144
+ Or pass the DSN directly:
145
+
146
+ ```python
147
+ DebugSession(dsn="https://augur.example/api/v1?token=...&tenant=...", ...)
148
+ ```
149
+
150
+ Get a DSN by asking an Augur admin to run:
151
+
152
+ ```bash
153
+ augur admin dsn-issue --tenant <your-tenant> --label <client-name>
154
+ ```
155
+
156
+ ### 3. Adapter pattern (existing CUA exports)
157
+
158
+ Already have a trace exporter (Mantis-style)? Write a small adapter that
159
+ maps your shape to Augur records. See the
160
+ [adapter authoring guide](docs/reference/adapter-authoring.md).
161
+
162
+ ## What gets written
163
+
164
+ Every bundle is path-stable — no discovery needed:
165
+
166
+ ```text
167
+ out_dir/
168
+ manifest.json # envelope: schema_version, bundle_format, paths, signatures
169
+ trace.json # session + ordered steps[]
170
+ AGENT.md # coding-agent-friendly index (first-read hints, layout)
171
+ steps/0000.json # one StepTrace per file
172
+ events/0000.jsonl # decision events per step (planner / grounding / verifier / recovery)
173
+ screenshots/0000_pre.png
174
+ screenshots/0000_post.png
175
+ diagnostics/findings.json # if `augur diagnose` has been run
176
+ schema/*.schema.json # canonical record schemas (vendored for offline validation)
177
+ ```
178
+
179
+ The same bundle drives the viewer, the CLI, and any coding agent. See
180
+ [`docs/concepts/bundle-layout.md`](docs/concepts/bundle-layout.md) for
181
+ the full normative spec.
182
+
183
+ ## Capture modes
184
+
185
+ The `capture_mode` arg controls how much the SDK writes:
186
+
187
+ | Mode | What it captures | Cost |
188
+ |---------------|-----------------------------------------------------------------|------|
189
+ | `off` | Manifest envelope only | none |
190
+ | `metadata` | + run/step ids, status, action type, failure class | tiny |
191
+ | `trace` | + decisions, verifier output, recovery, grounding summary | low |
192
+ | `screenshots` | + pre/post PNGs + coordinate overlays | med |
193
+ | `video` | + video / MJPEG references | med |
194
+ | `model_io` | + prompts, model responses, redacted secrets | med |
195
+ | `dispatch` | + input dispatch details, retries, post-action state checks | low |
196
+ | `replay` | + observation/task/context state for replay fixtures | med |
197
+ | `full` | All above, subject to redaction + retention | high |
198
+
199
+ Set via `capture_mode=CaptureMode.FULL` or `AUGUR_CAPTURE_MODE=full`.
200
+
201
+ ## Redaction
202
+
203
+ `default-pii-v1` ships in the box and is applied to every bundle:
204
+
205
+ - Drops `Authorization`, `Cookie`, `Set-Cookie`, `X-API-Key` headers entirely.
206
+ - Masks `token`, `api_key`, `ssn`, `credit_card`, `cvv` keys.
207
+ - Regex-scrubs bearer tokens, AWS keys, JWTs, password=… patterns out of strings.
208
+ - Honors `sensitive=True` on a step: pre/post screenshots are dropped.
209
+
210
+ Subclass `augur_sdk.RedactionPolicy` for tighter rules:
211
+
212
+ ```python
213
+ from augur_sdk import DebugSession, RedactionPolicy
214
+
215
+ class StrictPolicy(RedactionPolicy):
216
+ id = "strict-v1"
217
+ drop_keys = RedactionPolicy.drop_keys | frozenset({"customer_email"})
218
+
219
+ DebugSession(redaction_policy=StrictPolicy(), ...)
220
+ ```
221
+
222
+ ## Diagnostics
223
+
224
+ Augur ships a generic CUA rules pack you can run against any bundle:
225
+
226
+ ```python
227
+ from augur_sdk.diagnostics import RulesEngine, load_pack
228
+
229
+ engine = RulesEngine(load_pack("cua"))
230
+ findings = engine.evaluate("/path/to/bundle")
231
+ for f in findings:
232
+ print(f["severity"], f["rule_id"], f["summary"])
233
+ ```
234
+
235
+ Adapter-specific packs (e.g. `mantis`) are registered via the
236
+ `augur.rule_packs` entry-point group; install the corresponding adapter
237
+ package alongside this SDK and they appear automatically in
238
+ `load_pack(...)`.
239
+
240
+ ## CUA contract — what the SDK enforces
241
+
242
+ Per Augur's design invariant: **runtime action selection MUST remain
243
+ screenshot-grounded**. The SDK doesn't enforce this at write time, but
244
+ the diagnostic-rules engine and the viewer both flag DOM-derived
245
+ coordinates that show up in `grounding.provenance != "screenshot"` and
246
+ get used as runtime inputs. Tag DOM probes as `provenance: dom` so they
247
+ stay visible as **diagnostic** evidence without being mistaken for the
248
+ agent's real target.
249
+
250
+ ## Develop
251
+
252
+ ```bash
253
+ git clone https://github.com/mercurialsolo/augur-sdk.git
254
+ cd augur-sdk
255
+ uv sync # creates .venv and installs dev deps
256
+ uv run pytest # tests
257
+ uv run ruff check . # lint
258
+ uv run mypy -p augur_sdk # types
259
+ ```
260
+
261
+ ## Publish to PyPI
262
+
263
+ Releases are tag-driven and run through `.github/workflows/release.yml`,
264
+ which authenticates to PyPI via **OIDC Trusted Publishing** — no API
265
+ token is stored anywhere.
266
+
267
+ ### One-time setup
268
+
269
+ 1. Register the project on PyPI as a pending publisher:
270
+ https://pypi.org/manage/account/publishing/
271
+ - PyPI project name: `augur-sdk`
272
+ - Owner: `mercurialsolo`
273
+ - Repository: `augur-sdk`
274
+ - Workflow name: `release.yml`
275
+ - Environment name: `pypi`
276
+ 2. (Optional) Pre-create the `pypi` GitHub Environment if you want to
277
+ gate releases behind required reviewers:
278
+
279
+ ```bash
280
+ gh api -X PUT /repos/mercurialsolo/augur-sdk/environments/pypi
281
+ ```
282
+
283
+ ### Cut a release
284
+
285
+ 1. Bump `__version__` in `src/augur_sdk/_version.py` and `version` in
286
+ `pyproject.toml`.
287
+ 2. Move the `[Unreleased]` block in `CHANGELOG.md` under the new version.
288
+ 3. Commit, tag, push:
289
+
290
+ ```bash
291
+ git commit -am "Release v0.1.0"
292
+ git tag v0.1.0 -m "Initial release"
293
+ git push origin main v0.1.0
294
+ ```
295
+
296
+ The tag push triggers `release.yml`: lint → typecheck → test → `uv build`
297
+ → publish to PyPI via OIDC. The wheel + sdist are also uploaded as
298
+ workflow artefacts.
299
+
300
+ ### Local build / manual upload (escape hatch)
301
+
302
+ If you need to publish outside CI (don't, normally):
303
+
304
+ ```bash
305
+ uv build # produces dist/*.whl + dist/*.tar.gz
306
+ uv publish # uses ~/.pypirc or UV_PUBLISH_TOKEN
307
+ ```
308
+
309
+ ## Where Augur lives
310
+
311
+ Augur (server, viewer, CLI, diagnostic rule packs, Mantis adapter) is a
312
+ **hosted cloud service** — not open source. This SDK is the only
313
+ component your CUA runtime needs; everything else is operated for you.
314
+
315
+ - **Get a DSN / sign up**: contact your Augur workspace admin, or reach
316
+ out at the project email below.
317
+ - **Issues for this SDK**: https://github.com/mercurialsolo/augur-sdk/issues
318
+ - **Schemas**: vendored under `src/augur_sdk/_schema/json/` in this repo.
319
+
320
+ ## License
321
+
322
+ Apache 2.0 — see [LICENSE](LICENSE).