Skip to content

Add token-budgeted a11y text observation (indexed, viewport-pruned) - #363

Merged
JE-Chen merged 1 commit into
devfrom
feat/observation-batch
Jun 23, 2026
Merged

Add token-budgeted a11y text observation (indexed, viewport-pruned)#363
JE-Chen merged 1 commit into
devfrom
feat/observation-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

screen_state.describe_screen returns role counts + a flat label list — no stable per-element index, no [12] button "Submit" @(x,y) lines, no viewport clipping, no element cap / token budget. Modern agents feed a flattened, indexed, viewport-pruned text observation and act by index.

  • flatten_tree: flatten a nested element tree, keeping interactive roles by default.
  • observation_index (AC_observation_index): clip to the viewport, reading-order, cap at max_elements, assign a stable index.
  • serialize_observation (AC_serialize_observation): render [i] role "name" @(cx,cy) lines for the model; it replies "click [i]".
  • Pure-stdlib over element dicts; reuses element_parse.reading_order. Pairs with fuse_elements / set_of_marks. Fully headless-testable (viewport clip, interactive filter, cap). Wired through all 5 layers + headless test + EN/Zh docs + WHATS_NEW. Qt-free.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 36 complexity · 0 duplication

Metric Results
Complexity 36
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen
JE-Chen merged commit 38e0679 into dev Jun 23, 2026
16 checks passed
@JE-Chen
JE-Chen deleted the feat/observation-batch branch June 23, 2026 05:06
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant