feat: bootstrap portable engineering protocol CLI

Implement milestones 0 and 1 with project and repository configuration, Work persistence, discussions, draft decisions, evidence integrity, and deterministic context exports.

Add Java 25, Spring Boot and Modulith, native distributions, CI workflows, protocol documentation, and the pinned SDKMAN GraalVM CE toolchain.

Validated with 20 passing tests and the macOS ARM64 native multi-repository continuity smoke.
This commit is contained in:
2026-11-11 16:14:22 +00:00
commit b91829270b
49 changed files with 2367 additions and 0 deletions
@@ -0,0 +1,35 @@
package net.intrepid.aiengineering.filesystem;
import tools.jackson.databind.json.JsonMapper;
import tools.jackson.dataformat.yaml.YAMLMapper;
import tools.jackson.core.StreamReadFeature;
import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.cfg.EnumFeature;
import java.nio.file.Path;
/** Explicit protocol records, never Spring internal objects, are canonical. */
public final class Documents {
private static final YAMLMapper YAML = YAMLMapper.builder().enable(StreamReadFeature.STRICT_DUPLICATE_DETECTION)
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES,
DeserializationFeature.FAIL_ON_TRAILING_TOKENS).enable(EnumFeature.FAIL_ON_NUMBERS_FOR_ENUMS).build();
private static final JsonMapper JSON = JsonMapper.builder().enable(StreamReadFeature.STRICT_DUPLICATE_DETECTION).build();
private Documents() {}
public static String yaml(Object value) { return YAML.writeValueAsString(value); }
public static String json(Object value) { return JSON.writerWithDefaultPrettyPrinter().writeValueAsString(value) + "\n"; }
public static <T> T parse(String yaml, Class<T> type) {
try { return YAML.readValue(yaml, type); }
catch (RuntimeException e) { throw ProtocolException.validation("Invalid " + type.getSimpleName() + ": " + e.getMessage()); }
}
public static <T> T read(Path path, Class<T> type) { return parse(Filespace.read(path), type); }
public static <T> T readDocument(Path path, Class<T> type) {
String text = Filespace.read(path);
if (!text.startsWith("---\n")) throw ProtocolException.validation("Missing YAML front matter: " + path);
int end = text.indexOf("\n---\n", 4);
if (end < 0) throw ProtocolException.validation("Unclosed YAML front matter: " + path);
return parse(text.substring(4, end), type);
}
public static void writeDocument(Path path, Object value, boolean replace) {
String yaml = yaml(value).replaceFirst("^---\\n", "");
Filespace.write(path, "---\n" + yaml + "---\n", replace);
}
}