fix: default the sidecar to the host clock - #12
Merged
Conversation
The loopback server froze time at the 2035 demo epoch, so OpenAPI clients that sent current timestamps were rejected as expired. Use the host clock by default, keep --clock demo for conformance fixtures, and honor CONSEQUENCE_RAIL_PORT / CONSEQUENCE_RAIL_CLOCK when flags are omitted.
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Comment on lines
+23
to
+24
| } | ||
|
|
There was a problem hiding this comment.
🟡 Clock rollback invalidates valid actions
When the host clock moves backward, SystemClock.now() returns an earlier timestamp. Fresh evidence is rejected, and generated audit bundles can fail semantic verification.
Prompt for agents
Make SystemClock.now() preserve nondecreasing timestamps when the host wall clock moves backward. Account for both runtime freshness checks and the verifier's non-monotonic event rejection. Add deterministic tests using an injectable or mocked time source that moves backward between evidence capture and validation, and between consecutive event appends.
Was this helpful? React with 👍 or 👎 to provide feedback.
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.
What
The loopback sidecar no longer freezes time at the 2035 demo epoch. It uses the host clock by default so OpenAPI clients can send current timestamps.
--clock demorestores the frozen conformance epoch (2035-01-01T00:00:00.000Z). When flags are omitted,CONSEQUENCE_RAIL_PORTandCONSEQUENCE_RAIL_CLOCKsupply the same defaults. Empty env values are treated as unset; flags still win over env.Why
createReferenceServer()andcmd/rail.jsbuilt aManualClockat2035-01-01T00:00:00.000Z. A proposal withexpires_atin 2026 wasACTION_EXPIREDagainst that clock, so the documented "start the sidecar and use the OpenAPI surface" path failed for current-time clients. CLI demos and tests still use the deterministic frozen clock.How tested
node ./scripts/check.jsnode --test--clock/ env values, empty env, and--helpdocumenting the new defaults.