Conversation
src/shared/event_statuses.py and infra/constants/event-statuses.ts held independently maintained copies of the same status strings, with no compiler or test link between them. The Step Functions workflow polls DynamoDB by comparing against the TypeScript copy while Lambda writes the Python copy, so a rename on the Python side wasn't a build error - it was a silent 60-minute poll timeout. Add scripts/generate-event-statuses.py, which mirrors the Python EventStatus class into TypeScript, and wire it into infra's existing prebuild step (alongside prepare-lambda/package-agent) so the generated file can never drift. The generated file is gitignored, like dist/.
rezabekf
force-pushed
the
rezabekf/event-status-single-source
branch
from
September 18, 2026 11:08
6a21712 to
05d3de2
Compare
msumari
approved these changes
Sep 18, 2026
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.
Issue number: N/A (found during an architecture review; fix predates the issue-first workflow introduced in #263)
Summary
Changes
src/shared/event_statuses.py(7 statuses) andinfra/constants/event-statuses.ts(hand-mirrored subset of 2) held independently maintained copies of the same status strings, with no compiler or test link between them.scripts/generate-event-statuses.py, which imports the realEventStatusclass and mirrors all statuses into TypeScript (as const+ derived type), wired intoinfra's existingprebuildstep (npm runs it automatically beforebuild/test/synth/deploy).infra/constants/event-statuses.tsbecomes a gitignored generated artifact, same asdist/.tests/test_generate_event_statuses.pycovering the generator (full mirror of the real class, order preservation, generated-file header).User experience
Before: the Step Functions workflow polls DynamoDB by comparing against the TypeScript copy of a status string, while the agent writes the Python copy. Renaming a status on the Python side produced no build error — the workflow's
Choicesilently fell through to its.otherwise()branch and polled until the 60-minute state-machine timeout.After: the TypeScript constants are generated from the Python source of truth on every build. A Python-side rename propagates automatically; drift is structurally impossible.
Verified:
cd infra && npm run buildregenerates + compiles clean; 26/26 vitest and 142/142 pytest pass.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
🤖 Generated with Claude Code