feat: add protocol compatibility diagnostics and historical readers
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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 = 1;
|
||||
public static final List<Integer> READABLE = List.of(1);
|
||||
/** 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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user