Skip to content

Latest commit

 

History

History
20 lines (17 loc) · 1.24 KB

ARCCHR0003.md

File metadata and controls

20 lines (17 loc) · 1.24 KB
title ARCCHR0003 — Reactor must not reach the default event log
description Fix ARCCHR0003 in Arc TypeScript by returning events from Chronicle reactors instead of appending directly to the reactor's own default event log.

A reactor can return events to Chronicle. The rule finds direct this.<field>.eventLog.append(...) or appendMany(...) (including .transactional) when the field is initialized or assigned earlier in the same method with this.client.getEventStore(...) or this.runtime.getStore(...). It does not report fields initialized from other.getEventStore('elsewhere'), uninitialized store fields, reads, outbox writes, callbacks inside handlers, or helper calls. The reactor decorator must come from @cratis/chronicle or @cratis/chronicle/reactors. The SDK has no reactor DI ownership contract: even for a matching this.client/this.runtime field the rule cannot prove that client or store belongs to the reactor.

// Instead of: await this.store.eventLog.append(id, new FollowedUp());
return new FollowedUp();

This is an analog of the .NET warning, not a complete data-flow analysis. Other direct SDK appends still need review. Chronicle code analysis maps the other diagnostics.