Skip to main content

Module env_protocol

Module env_protocol 

Source
Expand description

Back-half paydown 1D.5a (#4003): the cross-language BYNK_* protocol.

The toolchain hands generated TypeScript a small set of names: environment variables on the node/tsx process that bynk test starts, and entries in a Worker’s env (a [vars] entry or --var, a binding, a secret) that bynk dev, bynk deploy and the emitted wrangler.toml set. Rust writes each name and TypeScript reads it, so the two spellings must agree.

This module is the one definition of each name. Every Rust writer uses these constants (or a pub use of one kept at its older path), so a misspelt name in Rust fails to compile. The TypeScript readers are written by hand and keep their string literals, so the emitted output does not change. xtask/tests/env_protocol.rs holds them to PROTOCOL instead: every BYNK_ token a reader spells must be a name here, and every reader an entry lists must still spell its name.

Only the protocol lives here. Names that Rust alone reads or sets (BYNK_HOME, BYNK_NO_INSTALL, BYNK_PHASE_TIMING and the like) stay with their owners, and test gates stay in the tests (#4003, Decision E). No name here may be renamed: each one is part of what a generated program reads.

Structs§

Entry
One protocol name.
Reader
One hand-written TypeScript file that reads a protocol name.

Enums§

Carrier
How a name reaches the TypeScript that reads it.
ReaderDir
Where the hand-written readers live. Reader::path joins a reader’s file to its directory, so a directory that moves changes one line here. The test runtime’s readers are testing/<name>.ts under ReaderDir::Runtime (1B.3a, #4047): the sources, not the spliced artifacts in bynk-emit/src/testgen.
Shape
Whether an entry is one name, or the prefix of a family of names.

Constants§

CALL_FROM_BYNK_DEV
The edge key from bynk dev inspect’s caller, bynk.dev: the CALL_FROM_PREFIX family’s one fixed member.
CALL_FROM_PREFIX
The prefix of the secret a callee holds for the edge from one caller, followed by the caller’s edge suffix.
CALL_TO_PREFIX
The prefix of the secret a caller holds for the edge to one callee, followed by the callee’s edge suffix.
CONTAINERS_UNAVAILABLE
The wrangler dev --var that tells a generated container class its containers are off (bynk dev without Docker).
DATASET_PREFIX
The prefix of the [vars] entry naming an Analytics Engine dataset’s table, followed by the binding name. Reserved in [test.targets] vars.
DEV
1 on every Worker bynk dev serves, so a provider can tell a development session from a deployment.
DEV_ACK_AI
[dev] ai = "allow".
DEV_ACK_AI_SEARCH
[dev] ai-search = "allow".
DEV_ACK_ANALYTICS_SQL
[dev] analytics-sql = "allow".
DEV_ACK_MTLS
[dev] mtls = "allow".
DEV_ACK_PREFIX
The prefix of the [dev] acknowledgement variables (crate::dev_ack::REMOTE_KINDS).
DEV_ACK_VECTORIZE
[dev] vectorize = "allow".
DEV_INDEX_PREFIX
The prefix of the [vars] entry giving a local Vectorize index its dimensions and metric under bynk dev, followed by the binding name.
INSPECT_REGISTRY
The binding name of bynk dev’s agent-inspection registry.
MIGRATE_KEY
The secret a bynk migrate sweep key is set under for the sweep.
PROTOCOL
Every protocol name, with who sets it and who reads it.
SMOKE_DECLARED_FILE
The file a smoke run writes the declared statuses it saw to.
SNAPSHOT_REPORT
1 when the driver wants the snapshot files a run touched reported.
TEST_FILTER
The JSON test filter bynk test --filter hands the generated test main.
TEST_FORMAT
ndjson when the driver wants one JSON event per line from a test run.
TEST_RUN_ID
The run id a remote test run tags what it writes with.
TEST_SECRETS
The secrets of a remote test run, as JSON.
TEST_SEED
The hex seed of a property-test run.
TEST_SETTLE_MS
How long, in milliseconds, a test waits for a deferred effect to settle.
TEST_STRICT_WIRE
1 when a smoke run treats an undeclared wire shape as a failure.
TEST_TARGETS
The JSON [test.targets] a remote test run reaches.
UPDATE_SNAPSHOTS
1 when bynk test --update-snapshots rewrites snapshots.

Functions§

all_names
Every concrete name and prefix the protocol spells: each entry’s name, and each prefix’s fixed members.
entry_of
The entry token belongs to: the entry it names, or the prefix entry it starts with (a family member such as BYNK_DATASET_ANALYTICS_SIGNUPS).