Table of Contents

Class PolicyVersionHistory

Namespace
JD.AI.Core.Governance
Assembly
JD.AI.Core.dll

Tracks policy version history as an append-only JSON log file. Each entry records the policy content hash, timestamp, and metadata to support auditing and rollback.

public sealed class PolicyVersionHistory
Inheritance
PolicyVersionHistory
Inherited Members

Constructors

PolicyVersionHistory(string)

public PolicyVersionHistory(string historyFilePath)

Parameters

historyFilePath string

Methods

GetHistory(string?, int)

Returns all version history entries, newest first.

public IReadOnlyList<PolicyVersionEntry> GetHistory(string? policyName = null, int limit = 50)

Parameters

policyName string
limit int

Returns

IReadOnlyList<PolicyVersionEntry>

HasChanged(string, string)

Checks if a policy has changed since the last recorded version.

public bool HasChanged(string policyName, string currentContent)

Parameters

policyName string
currentContent string

Returns

bool

Record(string, string, string?)

Records a policy version snapshot.

public void Record(string policyName, string yamlContent, string? author = null)

Parameters

policyName string
yamlContent string
author string