Skip to content

[2/4] buzz-sdk: share the agent definition text rules - #5843

Open
Maxwellimus wants to merge 1 commit into
maxwell/nip-ap-sdk-event-shapesfrom
maxwell/sdk-definition-text-rules
Open

[2/4] buzz-sdk: share the agent definition text rules#5843
Maxwellimus wants to merge 1 commit into
maxwell/nip-ap-sdk-event-shapesfrom
maxwell/sdk-definition-text-rules

Conversation

@Maxwellimus

@Maxwellimus Maxwellimus commented Aug 14, 2026

Copy link
Copy Markdown

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_validation and has Desktop delegate.

The SDK carries Extended_Pictographic as a literal range table rather than
pulling regex onto every binary's dependency path. Desktop already depends on
regex, so the exhaustive comparison against \p{Extended_Pictographic} runs
there — it walks the whole code space and fails if the table ever drifts from
the property, including when a future regex ships updated Unicode tables.

Test plan

  • just ci
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml
    sdk_pictographic_table_matches_the_unicode_property compares all 0x110000
    code points; currently byte-for-byte identical.

@Maxwellimus
Maxwellimus marked this pull request as ready for review August 14, 2026 06:22
@Maxwellimus
Maxwellimus requested a review from a team as a code owner August 14, 2026 06:22

@wolfyy970 wolfyy970 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.

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.

@Maxwellimus
Maxwellimus force-pushed the maxwell/sdk-definition-text-rules branch 2 times, most recently from 73f1e9f to d6c718d Compare August 14, 2026 19:36
@Maxwellimus
Maxwellimus force-pushed the maxwell/sdk-definition-text-rules branch from d6c718d to e7a71be Compare August 14, 2026 19:59
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>
@Maxwellimus
Maxwellimus force-pushed the maxwell/sdk-definition-text-rules branch from e7a71be to 358de84 Compare August 15, 2026 00:29

@wolfyy970 wolfyy970 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.

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.

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.

2 participants