Skip to content

docs: Align documented behavior with the implementation - #9

Merged
renato-freis merged 1 commit into
mainfrom
docs/align-claims-with-implementation-gh
Aug 19, 2026
Merged

docs: Align documented behavior with the implementation#9
renato-freis merged 1 commit into
mainfrom
docs/align-claims-with-implementation-gh

Conversation

@renato-freis

Copy link
Copy Markdown
Contributor

Summary

Aligns the README and the in-app documentation with what the code actually does, and adds the first dashboard screenshots to the README.

Several documented claims described behavior this repository does not implement. For a sample that readers use as a reference, those are the most costly kind of defect.

Corrected claims

Documented before Actual behavior
Implementation of the SCTE-130 specification Implements the ESAM SPE/SPN signal-conditioning exchange (SCTE-130 Part 9)
Rule chaining with short-circuit evaluation First-match evaluation; only the first matching rule applies
Roles: Admin, Operator, Viewer + per-channel ACLs Two Cognito groups: admin and user; no per-channel scope
/esam uses Basic Authentication Basic Authentication is optional, configured per channel
Session state in DynamoDB with TTL-based expiration One active break per channel, with a calculated expiry; no DynamoDB TTL attribute is written
Asynchronous action execution to avoid processing latency Actions run inside the ESAM request path; the SPN waits for their timeouts and retries
Support for all SCTE-35 segmentation types Matching and modification for the documented fields
cdk destroy --all removes everything Stack-managed resources; runtime-created SSM parameters and log groups need a check

The rule example also used break_duration, which is not a valid modification target. It is now breakDuration, matching ModificationTarget in backend/domain/models/channel.py, and the README documents the supported condition fields, operators, actions and modification targets.

The fallback administrator procedure previously listed only admin-create-user. Without admin-add-user-to-group, the resulting account cannot administer the dashboard.

Removed unsubstantiated performance figures

The in-app documentation advertised ~50 req/s and P95 < 150ms. This repository has no benchmark, so those numbers were not supportable. The Metrics page now explains what the CloudWatch dashboard graphs and what the reader should measure. Publishing real percentiles is deliberately left for a separate change with a reproducible methodology.

Behavior changes

Environment profiles are now wired to the API stack. lib/config/environment.ts declared enableDetailedLogging, enableXRayTracing and throttling limits per environment, but only logRetentionDays reached ApiStack, so the README statement about environment profiles was not true. Verified by synth:

dev prod
DataTraceEnabled true false
LoggingLevel INFO ERROR
Burst / rate 200 / 100 2000 / 1000

This also stops full ESAM XML payloads from being written to CloudWatch in the prod profile.

Opt-in MediaLive permissions. The MediaLive plugin calls BatchUpdateSchedule, but the signal-processing role had no MediaLive permissions, so the feature could not work as deployed. Passing -c mediaLiveChannelArns=<arn>[,<arn>] now grants medialive:BatchUpdateSchedule and medialive:DescribeSchedule scoped to those channels. Without the flag, nothing is granted.

Dashboard screenshots

The repository had no interface images. The README now shows the Channels page, the rule configuration form and the live SCTE-35 feed. The images were rendered from the application's own compiled stylesheet, component markup and lucide icon set, with fictitious sample data and no account identifiers, ARNs, API IDs or credentials.

Request path behavior

New README section describing the failure modes of the synchronous path: the 30-second Lambda timeout, stage throttling, the noop fallback for unknown or disabled channels, the defaultAction fallback on parse failure, fail-open break-state handling, and the fact that encoder behavior on an unreachable POIS is configured on the encoder.

Testing

  • pytest --cov: 176 passed, 68.96% coverage (gate 65%)
  • ruff check . and black --check .: clean
  • npx tsc --noEmit, npm run lint, npm run build (frontend): clean
  • npm run build (infrastructure): clean
  • npx cdk synth for the dev and prod API stacks, asserting the table above and the scoped MediaLive statement

No functional backend change; LICENSE and CODE_OF_CONDUCT.md are untouched.

Several README and in-app documentation claims described behavior the code
does not implement, which is a problem for a sample that readers use as a
reference.

Corrected claims:
- Scope is the ESAM SPE/SPN signal-conditioning exchange, not the whole
  SCTE-130 specification.
- Rules use first-match evaluation; there is no rule chaining.
- Roles are admin and user. Operator, Viewer and per-channel ACLs do not
  exist.
- Basic Authentication on /esam is optional and configured per channel.
- Stateful mode tracks one active break per channel and does not rely on
  DynamoDB TTL for expiry.
- External actions run inside the ESAM request path, so their timeouts and
  retries add to encoder response time.
- The rule example now uses the real modification target (breakDuration) and
  documents the supported condition fields, operators and targets.
- Cost figures are an indicative estimate, not a quote.
- Cleanup covers runtime-created SSM parameters and retained log groups.
- The fallback administrator procedure includes group membership, without
  which the account cannot administer the dashboard.

Removed the unsubstantiated "~50 req/s" and "P95 < 150ms" figures from the
in-app documentation. No benchmark exists in this repository, so the
documentation now describes what to measure instead.

Also wires the environment profiles that were declared but never passed to
the API stack, so -c env=prod now applies its throttling limits and turns off
API Gateway data trace logging, and adds an opt-in least-privilege MediaLive
grant through -c mediaLiveChannelArns so the external-action plugin can work
without granting account-wide access.

Adds a Dashboard section to the README with three dashboard screens, since
the repository had no interface images.

Added a request path behavior section covering timeouts, throttling and the
fail-open paths, so readers understand the failure modes before putting the
service in a signal path.
@renato-freis
renato-freis merged commit 998fe0c into main Aug 19, 2026
6 checks passed
@renato-freis
renato-freis deleted the docs/align-claims-with-implementation-gh branch August 19, 2026 21:07
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