[2/4] buzz-sdk: share the agent definition text rules - #5843
Conversation
wolfyy970
left a comment
There was a problem hiding this comment.
Reviewed at exact head 063ae69b4c7b. This preserves the existing Desktop validation boundary while making it available to every definition publisher. The literal pictographic table matches Desktop’s Unicode property across the full scalar range, so CLI and Desktop cannot quietly diverge on emoji handling.
I reran the SDK and Desktop definition-validation suites, including that exhaustive comparison. All 11 focused tests passed; both Rust format checks and git diff --check are clean. The red Desktop check is an unrelated randomized passphrase test failure.
73f1e9f to
d6c718d
Compare
d6c718d to
e7a71be
Compare
Desktop refuses a definition whose name or prompt carries invisible or
control characters — text that consumes input bytes without a visible
glyph defeats the human review that shared definitions depend on. That
check lived in the Tauri crate, so any other publisher could put a
definition on the relay that Desktop then declines to launch: it
publishes clean and fails later, which reads as a Desktop bug.
Move the rules to `buzz_sdk::definition_validation` and have Desktop
delegate. The SDK carries `Extended_Pictographic` as a literal range
table rather than pulling `regex` onto every binary's dependency path;
Desktop already has `regex`, so the exhaustive comparison against
`\p{Extended_Pictographic}` runs there and fails if the table ever drifts
from the property — including when a future `regex` updates its tables.
Signed-off-by: Max Lampert <maxwell@squareup.com>
e7a71be to
358de84
Compare
wolfyy970
left a comment
There was a problem hiding this comment.
Reviewed at exact head 358de84c55f3. I compared this to 063ae69b4c7b: the SDK and Desktop validation files are identical after the rebase onto current main. The earlier approval still applies.
Desktop refuses a definition whose name or prompt carries invisible or control
characters — text that consumes input bytes without a visible glyph defeats the
human review that shared definitions depend on. That check lived in the Tauri
crate, so any other publisher could put a definition on the relay that Desktop
then declines to launch: it publishes clean and fails later, which reads as a
Desktop bug.
Moves the rules to
buzz_sdk::definition_validationand has Desktop delegate.The SDK carries
Extended_Pictographicas a literal range table rather thanpulling
regexonto every binary's dependency path. Desktop already depends onregex, so the exhaustive comparison against\p{Extended_Pictographic}runsthere — it walks the whole code space and fails if the table ever drifts from
the property, including when a future
regexships updated Unicode tables.Test plan
just cicargo test --manifest-path desktop/src-tauri/Cargo.toml—sdk_pictographic_table_matches_the_unicode_propertycompares all 0x110000code points; currently byte-for-byte identical.