Skip to content

bindings: document schemas, additive telemetry-path export, deprecation + staleness/arg coverage - #32

Merged
andrescera merged 2 commits into
mainfrom
chore/prod-readiness
Jun 21, 2026
Merged

bindings: document schemas, additive telemetry-path export, deprecation + staleness/arg coverage#32
andrescera merged 2 commits into
mainfrom
chore/prod-readiness

Conversation

@andrescera

Copy link
Copy Markdown
Member

What

Documentation, an additive root re-export, and deprecation/coverage hardening for the
@ceralive/srtla TypeScript bindings. No behavior change to the bindings' runtime
surface; no C/C++ source changes.

  • Schema docs: JSDoc on the sender/receiver Zod option schemas and .describe() on
    their port (and related) fields, so the CLI mapping is self-documenting.
  • Additive root export: senderTelemetryPath is now re-exported explicitly from the
    package root (it was already reachable via export *; this makes it discoverable
    without the ./telemetry subpath).
  • Deprecation normalization: every retired C-sender export now carries the uniform
    tag @deprecated Use `@ceralive/srtla-send` instead. (previously a mix of /sender
    and /telemetry subpaths).
  • New tests:
    • deprecation-coverage.test.ts — a symbol-level @deprecated enumeration over the
      C-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 and
      names that export.
    • export-stability.test.ts — pins the full frozen runtime export set and confirms the
      additive senderTelemetryPath is callable from the root.
    • telemetry/staleness-boundary.test.ts — boundary coverage with hardcoded snapshot
      ages (4999/5000/5001 ms) so it genuinely pins the 5000 ms window.
    • sender/stats-file-arg.test.ts--stats-file emission from buildSrtlaSendArgs,
      tied to senderTelemetryPath(listenPort), plus the omitted-when-unset case.

The tracked dist/ output is rebuilt to stay in sync with src/.

Why

The bindings API is frozen (srtla AGENTS.md: "existing exports frozen") but under-
documented, and the C srtla_send is 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.
  • Falsifiability (both confirmed locally, then reverted):
    • Lower SENDER_TELEMETRY_STALE_MS to 4999 → the staleness boundary test fails on the
      age-5000 snapshot.
    • Remove @deprecated from one C-sender export → deprecation-coverage.test.ts fails and
      names that export (e.g. buildSrtlaSendArgs (line 18)).
  • C side unchanged: cmake -B build && cmake --build build && ctest --output-on-failure
    → 186/186 pass.

Risks

Low. No export added/removed/retyped (.describe() returns the same ZodType, so
z.input/z.output are 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, so
age 5000 ms is inclusive-fresh and 5001 ms is the first stale age (locked by the existing
index.test.ts boundary 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 the
existing test, and change the threshold behavior — all out of scope).

@andrescera
andrescera merged commit 55a4610 into main Jun 21, 2026
5 checks passed
@andrescera
andrescera deleted the chore/prod-readiness branch June 21, 2026 15:08
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.

1 participant