/**
 * ConflictPipelineContext — explicit dependencies for conflict analysis stages.
 *
 * Conflict pipeline modules receive this narrow context instead of the
 * ConflictAnalyzerService orchestrator.
 *
 * @module domain/services/strand/ConflictPipelineContext
 */
import { canonicalStringify } from "../../utils/canonicalStringify.js";
export default class ConflictPipelineContext {
    graph;
    _digestCache;
    constructor({ graph, }) {
        this.graph = graph;
        this._digestCache = new Map();
        Object.freeze(this);
    }
    async hash(payload) {
        const canonical = canonicalStringify(payload);
        const cached = this._digestCache.get(canonical);
        if (cached !== undefined) {
            return cached;
        }
        const digest = await this.graph._crypto.hash('sha256', canonical);
        this._digestCache.set(canonical, digest);
        return digest;
    }
}
