feat: add protocol compatibility diagnostics and historical readers

This commit is contained in:
2026-11-16 10:13:05 +00:00
parent a8a8faf5d8
commit f10c237d44
48 changed files with 1382 additions and 13 deletions
@@ -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");
}
}