• Helper: compute factory that emits a single open conflict whenever a supplied node satisfies predicate. The registry overlays the lifecycle tag.

    Type Parameters

    • T

      Value type carried by the source node.

    Parameters

    • source: Node<T>

      The node observed to determine conflict presence.

    • predicate: (value: T) => boolean

      Returns true to raise a conflict for the current value.

    • describe: (value: T) => Pick<ConflictBase<T>, "id" | "target">

      Builds the partial conflict shape (id, target) from the current flagged value; the registry fills in value, raisedAt, and the eventual kind.

    • OptionalraisedAt: (value: T) => number

      Extracts the real GraphTime at which the conflict first appeared, from the flagged value itself (which carries it — e.g. a ./resource.ts!ResourceState in errored carries erroredAt). This raisedAt is both the value surfaced on the public ConflictBase.raisedAt and the identity of the conflict's episode: when the id leaves the open set and re-raises, a later raisedAt marks it as a fresh episode so a prior resolution does not resurrect onto it (issue #156). Omit only for domains whose value carries no raise timestamp; the fallback 0 then collapses every occurrence of the id into a single episode (the pre-#156 behaviour), which is acceptable when re-raise isolation is not needed but is NOT a real GraphTime.

    Returns Compute<readonly ConflictBase<T>[]>

    A Compute suitable for ConflictRegistryOptions.compute.

    Convenient for the common case of "raise a conflict whenever this one node violates this one rule". For richer scenarios (conflicts derived from multiple nodes, conflicts with structured ids) callers should write a bespoke Compute directly.