oc_evidence_bundle
Capture a page state snapshot (DOM, screenshot, network, console, perceptual hash) into a bundle directory for debugging and auditing.
Instructions
Capture a snapshot of the current page state (DOM, screenshot, network slice, console, perceptual hash) and write it to a bundle directory. Returns { bundle_id, path, size_bytes, parts }. Default include = ['dom', 'screenshot']; pass include to capture more parts. network_window_ms (default 5000) limits the network slice to recent entries. Core-tier; does not depend on the pilot runtime.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Which parts to capture. Default ['dom', 'screenshot']. Allowed items: 'dom' | 'screenshot' | 'network' | 'console' | 'phash' | 'gate' | 'schema_diff'. `gate` requires `evidence.snapshot.gate`; `schema_diff` requires `target_schema` and `evidence.snapshot.observed`; otherwise the part is omitted. | |
| target_schema | No | Declared target schema (see src/core/contracts/schema-diff.ts: { version: 1, fields: [ { name, type, required? } ] }). When supplied together with `evidence.snapshot.observed` and the 'schema_diff' part is included, the bundle writes `schema_diff.json` containing the structured field-match diff. | |
| network_window_ms | No | Rolling window (ms) used to slice the supplied `evidence.snapshot.network` array. Default 5000. | |
| evidence | No | Caller-supplied snapshot. Provide the subset of fields the requested parts need: `dom`, `screenshot_png_base64`, `network`, `console`, `now_ms`, `gate`, `observed`. Missing fields cause the corresponding part to be omitted gracefully. | |
| output_mode | No | "inline" (default): return the full payload in-band — byte-identical to v1.11.0. "handle": write payload to the handle store and return a small descriptor; redeem with oc_output_fetch. "auto": inline if payload ≤ output_inline_limit_bytes, otherwise handle. | |
| output_inline_limit_bytes | No | Only honored when output_mode="auto". If the serialized payload exceeds this byte count the response spills to a handle. Default: 32768. |