You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Route the two time.Now() child-session sites through port.Clock for full clock-injectability of the engine #116
Sibling of #113. Small, mechanical, makes the engine fully deterministic for an embedding host.
Context
The main turn loop already reads wall-clock only through the injected port.Clock (verified: loop.go reads are e.deps.Clock.Now(); the only time.Now token in loop.go is a comment). But there are two direct time.Now() calls in the engine core, both minting ephemeral child-session ids + timestamps outside the main turn path:
and the identical pattern in engine/agent/forkjudge.go (engineJudge.Judge: fmt.Sprintf("%s-%d", j.idPrefix, time.Now().UnixNano()) + time.Now() createdAt).
Why it matters
An embedding host (Atrium) bans direct time.Now() in loop code so time-sensitive behaviour is deterministic in tests — all wall-clock must come from the injected clock. These two sites are reachable only when the guardrail-checker or the Parallel "judge" strategy is wired, so they don't bite a minimal embedding — but they're the one spot that breaks a strict "engine is fully clock-injectable" guarantee.
Ask
Thread the engine's port.Clock into guardrailcheck.go and forkjudge.go so the child-session CreatedAt and the id-suffix derive from the injected clock (the id can use Clock.Now().UnixNano(), or a port-supplied id source if you'd rather not derive ids from time). Then the core has zero direct time.Now() calls and layering_test.go could optionally grow a guard for it.
Activity