bindings: document schemas, additive telemetry-path export, deprecation + staleness/arg coverage - #32
Merged
Merged
Conversation
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.
What
Documentation, an additive root re-export, and deprecation/coverage hardening for the
@ceralive/srtlaTypeScript bindings. No behavior change to the bindings' runtimesurface; no C/C++ source changes.
.describe()ontheir port (and related) fields, so the CLI mapping is self-documenting.
senderTelemetryPathis now re-exported explicitly from thepackage root (it was already reachable via
export *; this makes it discoverablewithout the
./telemetrysubpath).tag
@deprecated Use `@ceralive/srtla-send` instead.(previously a mix of/senderand
/telemetrysubpaths).deprecation-coverage.test.ts— a symbol-level@deprecatedenumeration over theC-sender export files (parses each export and inspects the JSDoc block directly above
it; not a whole-file
grep -L). Dropping the tag from one export fails the test andnames that export.
export-stability.test.ts— pins the full frozen runtime export set and confirms theadditive
senderTelemetryPathis callable from the root.telemetry/staleness-boundary.test.ts— boundary coverage with hardcoded snapshotages (4999/5000/5001 ms) so it genuinely pins the 5000 ms window.
sender/stats-file-arg.test.ts—--stats-fileemission frombuildSrtlaSendArgs,tied to
senderTelemetryPath(listenPort), plus the omitted-when-unset case.The tracked
dist/output is rebuilt to stay in sync withsrc/.Why
The bindings API is frozen (srtla
AGENTS.md: "existing exports frozen") but under-documented, and the C
srtla_sendis retired in favour of@ceralive/srtla-send(ADR-003). These changes make the deprecation story uniform and machine-checked, document
the option schemas for consumers, and lock the telemetry staleness/arg behavior with
falsifiable tests — all additively, without touching the frozen export set.
How to verify
cd bindings/typescript && bun x tsc -p tsconfig.json --noEmit→ clean.bun test→ 136 pass / 0 fail.SENDER_TELEMETRY_STALE_MSto4999→ the staleness boundary test fails on theage-5000 snapshot.
@deprecatedfrom one C-sender export →deprecation-coverage.test.tsfails andnames that export (e.g.
buildSrtlaSendArgs (line 18)).cmake -B build && cmake --build build && ctest --output-on-failure→ 186/186 pass.
Risks
Low. No export added/removed/retyped (
.describe()returns the sameZodType, soz.input/z.outputare unchanged); edits are JSDoc/comment-only plus four new test files.The 5000 ms staleness threshold is unchanged.
Note on the staleness boundary: the committed reader is
now - last_updated_ms > 5000, soage 5000 ms is inclusive-fresh and 5001 ms is the first stale age (locked by the existing
index.test.tsboundary test and the C header). The new test asserts that implementation-true boundary; the plan's "now-5000 → null" wording is an off-by-one against the frozen
>semantics and was intentionally not "fixed" (doing so would flip>→>=, break theexisting test, and change the threshold behavior — all out of scope).