Skip to content

Implement durable iot-digital-twin simulator runtime - #2

Merged
tstrall merged 2 commits into
mainfrom
feature/durable-iot-demo
Oct 17, 2026
Merged

tstrall merged 2 commits into
mainfrom
feature/durable-iot-demo

Conversation

@tstrall

@tstrall tstrall commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Implements the durable AWS integration defined by iot-digital-twin PR #22, which is merged and has passing CI. This is executable runtime code, not a reference-store/planning-only PR.

DynamoStore makes real SDK get/conditional put/transaction/update calls: consistent state reads, session/model revision validation, fenced leases/ticks, atomic epoch reset plus durable command receipt, duplicate command identity handling, and a bounded ACK claim before IoT publication. Failed or unknown reset commit cannot reach publication. Existing simulator and immutable trace rules are packaged from an exact reviewed Git revision, with all replayed trace epochs relabeled consistently.

Lambda handlers provide supervised initialization/bounded runner and trusted IoT reset processing. The runner can initialize with operation=start; reset processing validates exact session/topic/principal. No public mutation endpoint or duplicated modeling rules. Model/schema mismatch fails closed. Runtime SDK clients are lazy; unit tests inject mocked clients.

Verification: 17 existing ingestion tests and nine new runtime tests passed; nine runtime tests also passed importing the built ZIP. Ruff 0.11.13 format/lint and Bandit runtime scan passed. Repeated builds produced identical ZIP SHA-256 70c95cde1b448c6daf405ff680da06c971b30ad625270524d7752e9df7168cab. New CI fetches the exact public simulator commit, tests source/package and uploads the artifact.

scripts/test_demo_integration.py is a runnable operator-only integration against an EXISTING sandbox PK/SK table. It verifies artifact digest/provenance, STS account, sandbox tag and schema before isolated session writes. It tests actual DynamoDB conditions/transactions and records the generated ACK locally, without MQTT. Without the separate execution flag it exited 2 before SDK import or AWS calls. It was NOT executed against real AWS: exact target and write approval remain prerequisites. Session rows are retained for approved cleanup.

Companion Terraform code is prepared in aws-iac branch feature/iot-demo-runtime-wiring. aws-config declaration/artifact/principal/session/account bindings remain unresolved; no publication or apply is authorized by this PR. Read the runtime README for invocation contract and limits.

Remaining: no AWS-hosted dashboard adapter, device subscription/ACK/LED execution, automatic restart, or runner pending-ACK dispatcher. Reset retries/supervised same-command redelivery handle ACK recovery within the durable budget; live SDK timing/clock margins require integration verification. No claim of production readiness or successful 60-second cloud demonstration.

Refs usekarma/iot-digital-twin#17. No cloud resources, IAM/device policy changes, artifact upload, MQTT operation, flash, deployment or merge performed. Original sibling workspaces and their untracked work are preserved.

Companion Terraform implementation: usekarma/aws-iac#16

Coordinated naming update

Naming revision verified: deployment component/source directory and ZIP basename are iot-digital-twin-simulator; Project=iot-digital-twin, Experiment=atom-lite-simulator. Runtime and existing tests are byte-for-byte unchanged. All 26 source tests, nine packaged-ZIP tests, Ruff lint/format and Bandit passed. ZIP SHA-256 remains 70c95cde1b448c6daf405ff680da06c971b30ad625270524d7752e9df7168cab. No live DynamoDB test or AWS/device operation. Matching configuration declaration is a separate aws-config PR; unresolved sandbox/table/operator approval and binding values remain blockers.

@tstrall tstrall changed the title Implement durable DynamoDB simulator and reset ACK runtime Implement durable iot-digital-twin simulator runtime Oct 17, 2026
@tstrall
tstrall merged commit cbeb541 into main Oct 17, 2026
1 check passed
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