Skip to content

Expose time globals to Lua raters and generators#85

Open
coccyx wants to merge 1 commit intodevfrom
feature/lua-time-expose
Open

Expose time globals to Lua raters and generators#85
coccyx wants to merge 1 commit intodevfrom
feature/lua-time-expose

Conversation

@coccyx
Copy link
Copy Markdown
Owner

@coccyx coccyx commented Mar 31, 2026

Summary

  • Expose now, beginTime, and endTime as Lua globals in script raters, enabling time-aware rate decisions (operating hours, weekly ramp-up curves)
  • Expose beginTime and endTime to Lua generators for timeline-aware event scheduling
  • 3 new tests covering all new globals; all existing tests pass with no regressions

Test plan

  • go test ./rater/ ./generator/ — all tests pass
  • Verify now is accessible in Lua rater scripts and reflects the current interval time
  • Verify beginTime/endTime are accessible in both generators and raters when begin/end are configured
  • Verify beginTime/endTime are not set when begin/end are omitted (no nil errors)

🤖 Generated with Claude Code

Expose now, beginTime, and endTime as Lua globals in script raters,
enabling time-aware rate decisions (operating hours, weekly ramp-up).
Expose beginTime and endTime to Lua generators for timeline-aware
event scheduling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 71.853%. first build
when pulling 2900825 on feature/lua-time-expose
into 1f35225 on dev.

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.

2 participants