Repository navigation
test(studio): every bound method is recorded in an allowlist file, and the entry must agree with the code - #751
Merged
Merged
Conversation
…d the entry must agree with the code Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF
…ies corrected; decisions and the automation run surface recorded Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF
…sked in Go, previewed is its own label; gates tied to code Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF
jay23606
added a commit
to jay23606/flutter-probe
that referenced
this pull request
Nov 17, 2026
…d the entry must agree with the code (AlphaWaveSystems#751) ## Summary Test-only plus one data file. Every exported `App` method is callable from the window and, in the headless build, from a page script with the bridge token, so adding one is a decision. The decision table already existed in the test as a Go map with a category; it is now `studio/bound_methods.json`, the one place decisions are written, with one entry per method: - `category`, `does` (one sentence), `callers` (window, bridge, automation), `touches` (files, devices, network, keychain) and `confirm` (none, asks, answers, native-dialog). `bound_methods_test.go` reads the file (the other tests use the same data) and fails: - for a new method with no entry, and the message prints the entry to add; - for an entry whose method no longer exists; - when an entry contradicts the code: `callers` against the headless bridge's block list and the automation endpoint's method set, a secret that touches no keychain, a pure method that touches something, a run (`RunFile*`) that does not ask, a window-only preference that is not native-dialog, unknown values, a duplicate entry. ## Mutants Run against the real code and file: a new method with no entry, an entry removed, a stale entry, a secret whose touches were emptied, a run whose confirm was set to none: all killed. A second test runs the check on 12 deliberately wrong inputs (including the message naming the method and the entry to add). Writing the 67 entries meant stating what each touches, and one was wrong in my first pass (`CheckReplaceLine` reads nothing from disk), which the check caught. No production code changes. ## Test plan - [x] `go test -race ./studio` (whole package) - [x] mutants as above - [x] disclosure scan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test-only plus one data file. Every exported
Appmethod is callable from the window and, in the headless build, from a page script with the bridge token, so adding one is a decision. The decision table already existed in the test as a Go map with a category; it is nowstudio/bound_methods.json, the one place decisions are written, with one entry per method:category,does(one sentence),callers(window, bridge, automation),touches(files, devices, network, keychain) andconfirm(none, asks, answers, native-dialog).bound_methods_test.goreads the file (the other tests use the same data) and fails:callersagainst the headless bridge's block list and the automation endpoint's method set, a secret that touches no keychain, a pure method that touches something, a run (RunFile*) that does not ask, a window-only preference that is not native-dialog, unknown values, a duplicate entry.Mutants
Run against the real code and file: a new method with no entry, an entry removed, a stale entry, a secret whose touches were emptied, a run whose confirm was set to none: all killed. A second test runs the check on 12 deliberately wrong inputs (including the message naming the method and the entry to add).
Writing the 67 entries meant stating what each touches, and one was wrong in my first pass (
CheckReplaceLinereads nothing from disk), which the check caught. No production code changes.Test plan
go test -race ./studio(whole package)🤖 Generated with Claude Code
https://claude.ai/code/session_01NxVy8Kr2nZk8HoMNcxZPFF