Class ReleaseRecordFile

java.lang.Object
network.ike.workspace.ReleaseRecordFile

public final class ReleaseRecordFile extends Object
Reads and writes releases/release-<cycle>.yaml — the on-disk form of a ReleaseRecord (IKE-Network/ike-issues#973).

Unlike ManifestWriter, which performs comment-preserving surgical edits on the hand-maintained workspace.yaml, the release record is machine-owned (ws:record-release writes it, nothing hand-edits it), so this class renders the whole file from the model on every write — symmetric read/write over one canonical form, in the style of the checkpoint YAML files.

Scalar values that could parse as non-string YAML types (versions, shas, dates) are written quoted so a read-back always yields strings.

  • Method Details

    • pathFor

      public static Path pathFor(Path workspaceRoot, String cycle)
      The canonical record path for a cycle: <root>/releases/release-<cycle>.yaml.
      Parameters:
      workspaceRoot - the workspace root directory
      cycle - the cycle label, e.g. komet-wsr-1
      Returns:
      the record file path
      Throws:
      ManifestException - if cycle is null or blank
    • read

      public static ReleaseRecord read(Path path)
      Read a release record from disk.
      Parameters:
      path - the record file path
      Returns:
      the parsed record
      Throws:
      ManifestException - if the file cannot be read, is not a YAML map, or fails ReleaseRecord validation
    • write

      public static void write(Path path, ReleaseRecord record) throws IOException
      Write a release record to disk, creating the releases/ directory when absent. The rendered form is deterministic for a given record, so re-writing an unchanged record is byte-stable.
      Parameters:
      path - the record file path
      record - the record to render
      Throws:
      IOException - if the directory or file cannot be written