Skip to content

Fix determinism checks for prompt mentions - #23

Merged
Michaelliv merged 1 commit into
mainfrom
issue-17-determinism-ast
May 31, 2026
Merged

Fix determinism checks for prompt mentions#23
Michaelliv merged 1 commit into
mainfrom
issue-17-determinism-ast

Conversation

@Michaelliv

@Michaelliv Michaelliv commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the raw-source nondeterminism regex with an AST-aware check
  • allow Date.now(), Math.random(), and new Date() mentions in prompts, metadata, comments, and string literals
  • continue rejecting executable Date.now(), Math.random(), and new Date() usage, including optional chaining and static computed-property forms
  • add a runtime regression for prompts that mention nondeterministic API names

Fixes #17

Verification

  • npm test — 24 tests pass

@Michaelliv
Michaelliv force-pushed the issue-17-determinism-ast branch from 082208b to 226e699 Compare May 31, 2026 07:14
@Michaelliv
Michaelliv merged commit 7b34dec into main May 31, 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.

Mentioning sources of randomness in agent prompts triggers the non-determinism checker

1 participant