Skip to content

fix: default the sidecar to the host clock - #12

Merged
EauDoon merged 1 commit into
mainfrom
devloop/cycle-06-sidecar-clock-defaults
Aug 30, 2026
Merged

fix: default the sidecar to the host clock#12
EauDoon merged 1 commit into
mainfrom
devloop/cycle-06-sidecar-clock-defaults

Conversation

@EauDoon

@EauDoon EauDoon commented Aug 30, 2026

Copy link
Copy Markdown
Owner

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 demo restores the frozen conformance epoch (2035-01-01T00:00:00.000Z). When flags are omitted, CONSEQUENCE_RAIL_PORT and CONSEQUENCE_RAIL_CLOCK supply the same defaults. Empty env values are treated as unset; flags still win over env.

Why

createReferenceServer() and cmd/rail.js built a ManualClock at 2035-01-01T00:00:00.000Z. A proposal with expires_at in 2026 was ACTION_EXPIRED against 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.js
  • node --test
  • New tests cover current-time admission vs the frozen demo clock, HTTP default-runtime propose, invalid --clock / env values, empty env, and --help documenting the new defaults.

Devin Review

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.
@EauDoon
EauDoon merged commit e6efeaf into main Aug 30, 2026
6 of 7 checks passed
@EauDoon
EauDoon deleted the devloop/cycle-06-sidecar-clock-defaults branch August 30, 2026 04:24

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread src/clock.js
Comment on lines +23 to +24
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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