Skip to content

docs(help): match audit findings to the snapshot by element name - #4739

Merged
thymikee merged 2 commits into
mainfrom
docs/audit-help-match-by-name
Nov 19, 2026
Merged

thymikee merged 2 commits into
mainfrom
docs/audit-help-match-by-name

Conversation

@thymikee

@thymikee thymikee commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

#4652 made audit print each finding's element name. help accessibility (step 3) and the help dogfood Platform checks still told agents to find the element by role and position. This PR changes both to the element name that audit prints. A missing-name finding has no name, so the help keeps role and rect for that case.

  • Touched file: src/commands/schema/cli-help-workflows.ts. No runtime change.

Validation

  • Tested SHA: bdcef77e9daff60a4668b23eccdd1ad6d9b95de8.
  • pnpm check:affected --run: all runnable checks passed.
  • vitest run src/commands/schema: 114 passed.
  • pnpm bench:help-conformance --case accessibility-review --runner claude:sonnet --repeat 3: 3/3. One earlier run scored 2/3 because the model added --settle to find, which find does not support. That is unrelated to this wording.
  • Docs and help text only. No device run applies.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.40 MB 6.40 MB +572 B
Package (unpacked) 6.40 MB 6.40 MB +572 B
Package (download) 1.94 MB 1.94 MB +148 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 24.6 ms 26.2 ms +1.6 ms
CLI --help 47.5 ms 52.3 ms +4.7 ms

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 2 new findings on bdcef77. The verdict and the full list are in the summary comment.

@thymikee

Copy link
Copy Markdown
Member Author

At bdcef77 the help wording change looks fine, but the branch also commits 119 generated Gradle outputs under examples/test-app/modules/push-broadcast-lab/android/build/ (classes.dex, classes.jar, R.jar, Kotlin incremental caches, merged manifests, previous-compilation-data.bin). main tracks only the module's sources there (build.gradle, AndroidManifest.xml, the two .kt files), so an Android build of the test app followed by git add -A most likely swept the directory in.

This turns a one-file help change into about 120 binary files in main. It adds repo weight, makes later local builds dirty the tree, and can trip gates that read tracked files, such as the layering scan, fallow and format. Please reduce the branch to the single cli-help-workflows.ts hunk, remove the 119 paths and force-push. If this build output will recur, a separate PR can ignore build/ for modules/*/android in examples/test-app/.gitignore.

The Coverage job is failing, and its log excerpt ends mid-run with no failing test or threshold line, so the cause is unclear. The wording change does not touch any test that ran there. The tracked build files are the only possible overlap. Please re-run Coverage on the one-file diff after the cleanup. Smoke Tests (macos) was still running, and it does not exercise help text. There are no conflicts.

Not blocking: these can be taken or left. The new text at src/commands/schema/cli-help-workflows.ts line 217 says to find the element by the name that audit prints, with a fallback only for missing-name findings. elementText in packages/command-output/src/capture/audit-output.ts prints no name for a small-target or covered-control finding whose node has no label, or when several nodes share one label, so the agent has no instruction for those cases. You could extend the fallback to use the id=... that audit prints, or role and rect, if it is worth the extra words. Also, the accessibility-review case in scripts/help-conformance-cases.mjs has no matcher for name-based matching, so it passes the same on old and new wording. One matcher for a plan that finds a finding by quoted name would close that gap.

Once the build files are gone and Coverage is green on the one-file diff, the wording is fine to merge.

@thymikee
thymikee force-pushed the docs/audit-help-match-by-name branch from bdcef77 to f0ba29a Compare November 19, 2026 11:08
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The 119 committed Gradle build outputs are gone at f0ba29a, and the help text now falls back to role and rect when a finding shows only a role. One problem from the earlier review (#4739 (comment)) remains.

A screen can have two buttons named Save at different positions, with only one undersized. The audit then prints a small-target finding for button "Save", and the snapshot has two rows with the same role and name. The finding carries its rect in the JSON output, but the accessibility and dogfood instructions (cli-help-workflows.ts#L217) reserve the rect fallback for findings that print only a role. An agent following the workflow can then tap or record the wrong control. In both workflows, please use the printed name or identifier only when it identifies exactly one snapshot element. Use role and rect from the JSON output when the identity is missing, absent from the snapshot text, or matches several elements. The agent should act only after it has identified a unique element.

Please also confirm that the text output of snapshot -i prints the identifier on a screen with duplicate names, because the help relies on it when the audit shows id=. The earlier bench (3/3) and the src/commands/schema run were at bdcef77.

The open inline thread about the unnamed or descendant-named controls is fixed at this head and can be resolved (#4739 (comment)). So can the thread about the Gradle build outputs (#4739 (comment)).

Coverage failed in the "Run coverage" step, but the log has no assertion or error line. It stops in the react-native companion-worker tests. The diff is one help-text string and no test asserts the old or new phrases, so the failure looks unrelated. The job has been re-run. The other 17 checks pass, and there are no conflicts.

Before merge, please fix the duplicate-name case above and make sure Coverage passes.

@thymikee
thymikee force-pushed the docs/audit-help-match-by-name branch from 4c43221 to a1125cc Compare November 19, 2026 12:09
@thymikee

Copy link
Copy Markdown
Member Author

Fixed at a1125cc, rebased onto main after #4737 merged.

  • Step 3 and the dogfood Platform checks now say: use the element name or identifier that audit prints only when it matches exactly one element in the snapshot. When the name matches more than one element, or the finding line shows only a role, match by role and rect from audit --json and snapshot -i --json. Act only on a unique element. If no element is unique, report the finding and do not act. This covers two "Save" buttons where only one is undersized.
  • snapshot -i text does not always print the identifier. extractReadableText uses the identifier only as a fallback for an element with no label or value. The help now says to read identifiers from snapshot -i --json.
  • The branch changes one file, src/commands/schema/cli-help-workflows.ts.
  • Bench: claude:sonnet 3/3. vitest run src/commands/schema: 114 passed. check:affected passed before the rebase.
  • The last Coverage failure was the recording-source test that fix(recording): regenerate the embedded recording overlay source #4737 fixes. CI runs again on the rebased head.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of a1125cc

Since the review of f0ba29a: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' prompt (1 file)
  • src/commands/schema/cli-help-workflows.ts: no reviewer was selected for this change

Reviewed with this repository's own Sentinel configuration (8804ce24cc1d).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at a1125cc. Both points from the earlier review are fixed: a finding with only a role now matches by role and rect, and id= findings match by identifier. The checks are green (18 of 18 pass), and the earlier Coverage failure was the recording-source test fixed by #4737, which this head now includes. There are no conflicts, and nothing else stands between this PR and merge.

Not blocking, and you can take or leave these: audit runs on the full capture but snapshot -i on the interactive projection, so a hidden Save could leave a different visible Save as the only name match, and the rule could ask the agent to confirm the matched rect equals the finding's rect before acting; the dogfood platform checks at line 266 could also add "If no element is unique, report the finding and do not act", as the accessibility topic already says.

The open inline threads on the 119 Gradle outputs (#4739 (comment)) and on nameless findings (#4739 (comment)) no longer apply. The first one is out of date because this head changes only one file. The second one is covered by the new role-and-rect wording. Please resolve both.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@thymikee
thymikee merged commit e766e88 into main Nov 19, 2026
18 checks passed
@thymikee
thymikee deleted the docs/audit-help-match-by-name branch November 19, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant