// engine/frontmatter-sha/reseal.ts — SPEC-723: Placeholder hook for bump_spec_version (SPEC-717)
//
// When SPEC-717 implements bump_spec_version, it should call resealFrontmatter()
// at the end of the version bump to update the SHA freeze for the modified spec.
import { computeFrontmatterSha } from './compute-sha.js';
import { appendTransitionEvent } from '../../storage/transition-log.js';
/**
 * Reseal the frontmatter SHA after an authorized mutation of a terminal spec.
 *
 * Records a `frontmatter_resealed` event in the transition log with the new
 * SHA computed from the post-mutation metadata. This allows verifyTerminalFrontmatter
 * to accept the updated values as the new ground truth.
 *
 * PLACEHOLDER: This function exists for SPEC-717 (bump_spec_version) to call.
 * It is not wired into any production path yet — SPEC-717 will connect it.
 */
export async function resealFrontmatter(input) {
    const frontmatterSha = computeFrontmatterSha(input.metadata);
    return appendTransitionEvent({
        projectId: input.projectId,
        specId: input.specId,
        eventType: 'frontmatter_resealed',
        frontmatterSha,
        actor: input.actor,
        reason: input.reason,
    });
}
//# sourceMappingURL=reseal.js.map