docs: add browser click workflow example

This commit is contained in:
lda
2026-06-15 00:33:00 +07:00 Verified
parent 06bd1f36b4
commit 18df04101c
5 changed files with 54 additions and 0 deletions
+2
View File
@@ -75,6 +75,8 @@ Evidence:
- `src/wf_sources_python/` - `src/wf_sources_python/`
- `tests/examples/test_report_workflow_example.py` - `tests/examples/test_report_workflow_example.py`
- `tests/wf_sources_python/test_loader.py` - `tests/wf_sources_python/test_loader.py`
- `examples/browser_click_workflow/`
- `tests/examples/test_browser_click_workflow_example.py`
## Limitations ## Limitations
+3
View File
@@ -931,6 +931,9 @@ single deterministic extraction node. The surrounding Python source includes
additional capabilities used for capability discovery and extensibility additional capabilities used for capability discovery and extensibility
evidence; it is not evaluated as a multi-node read -> extract -> render evidence; it is not evaluated as a multi-node read -> extract -> render
pipeline in this artifact. pipeline in this artifact.
A supplemental browser-click example demonstrates a serial three-node workflow
with bounded before/after snapshots; it is supporting evidence, not the main
case study.
(Evidence: `tests/examples/test_report_workflow_example.py`.) (Evidence: `tests/examples/test_report_workflow_example.py`.)
+1
View File
@@ -187,6 +187,7 @@ stable.
- Completed thesis system-design draft: `docs/add/system-design-implementation.md` - Completed thesis system-design draft: `docs/add/system-design-implementation.md`
now frames the platform as a formal system design/implementation report backed now frames the platform as a formal system design/implementation report backed
by `docs/add/evidence-index.md` and the report-workflow case study. by `docs/add/evidence-index.md` and the report-workflow case study.
- Completed supplemental browser-click workflow example with serial multi-node lifecycle evidence.
## Historical References ## Historical References
+2
View File
@@ -69,6 +69,8 @@ see [`workflow platform presentation`](add/2026-06-workflow-platform-presentatio
- `examples/rpc_cli_smoke.py` spawns `wf-rpc-server`, runs the bounded CLI - `examples/rpc_cli_smoke.py` spawns `wf-rpc-server`, runs the bounded CLI
lifecycle from the RPC CLI smoke runbook, and cleans up. Use lifecycle from the RPC CLI smoke runbook, and cleans up. Use
`--keep-temp` to preserve the generated config/store on failure. `--keep-temp` to preserve the generated config/store on failure.
- `examples/browser_click_workflow/` is a serial browser-click workflow
example with bounded before/after snapshots and full lifecycle tests.
## Documentation ## Documentation
+46
View File
@@ -0,0 +1,46 @@
# Browser Click Workflow Example
This example demonstrates a serial multi-node workflow over a trusted Python
source:
```text
open_click_page -> wait_for_click -> collect_snapshots
```
It opens a local HTML page with one visible button, captures a bounded JSON
snapshot before the click, performs a deterministic simulated click by default,
captures an after snapshot, closes the local server, and returns both snapshots
as workflow output.
The example deliberately avoids browser screenshots and base64 payloads. The
snapshots are small JSON objects suitable for CLI and LLM-agent output.
## Run
From the repository root:
```powershell
uv run wf config validate examples/browser_click_workflow/wf.config.json
uv run wf-rpc-server --config examples/browser_click_workflow/wf.config.json
```
In another terminal:
```powershell
uv run wf --config examples/browser_click_workflow/wf.config.json status
uv run wf --config examples/browser_click_workflow/wf.config.json cap list --source local.browser_click
```
The full artifact/deployment/run lifecycle is covered by:
```powershell
uv run pytest tests/examples/test_browser_click_workflow_example.py -q
```
## Manual Browser Mode
The checked-in test uses `"simulate": true` and `"open_browser": false`.
For manual experimentation, set `"open_browser": true` in the run input and
use `"simulate": false`; then click the button before `timeout_seconds` elapses.
Any browser or local server opened by the source is closed by the final
`collect_snapshots` node.