19 lines
917 B
Java
19 lines
917 B
Java
package net.intrepid.aiengineering.project;
|
|
|
|
import net.intrepid.aiengineering.filesystem.ProtocolException;
|
|
import java.util.List;
|
|
|
|
/** A contract revision is not a storage schema or a product release number. */
|
|
public final class ProtocolContract {
|
|
private ProtocolContract() {}
|
|
public static final String CLI_VERSION = "0.1.0";
|
|
public static final int CURRENT = 4;
|
|
public static final List<Integer> READABLE = List.of(1, 2, 3, 4);
|
|
/** Pre-versioned manifests describe the supported baseline contract, without rewriting them. */
|
|
public static int effective(Integer declared) { return declared == null ? 1 : declared; }
|
|
public static void require(Integer declared) {
|
|
if (!READABLE.contains(effective(declared))) throw ProtocolException.validation(
|
|
"Unsupported protocolVersion: " + declared + "; use a compatible CLI; inspect with aie project compatibility");
|
|
}
|
|
}
|