feat: add agent coordination and automatic work completion
Add portable topics and surveys, decision approval history, execution plans, local Codex and Claude adapters, and general agent routing. Consolidate Plan and EPIC results through deterministic completion receipts, reviewed cancellation scope and recoverable reconciliation. Track the completed WRK-0001 and WRK-0002 records, protocol documentation, source manifests and delivery evidence. Validation: 117 tests including Modulith; GraalVM 25 native compilation, standalone smoke and ZIP/TAR verification on macOS ARM64; identical persisted context across JVM and native executions.
This commit is contained in:
@@ -26,12 +26,18 @@ public final class ArtifactService {
|
||||
try (var input = Files.newInputStream(source)) { return input.readNBytes((int) MAX_BYTES + 1); }
|
||||
});
|
||||
if (bytes.length > MAX_BYTES) throw ProtocolException.invalid("Evidence exceeds 1 MiB");
|
||||
return attachBytes(root, workId, bytes, purpose, origin == null ? source.getFileName().toString() : origin, author);
|
||||
}
|
||||
/** Framework-generated receipts use the same canonical artifact format and integrity checks. */
|
||||
public Artifact attachBytes(Path root, String workId, byte[] content, String purpose, String origin, String author) {
|
||||
byte[] bytes = content.clone();
|
||||
if (bytes.length > MAX_BYTES) throw ProtocolException.invalid("Evidence exceeds 1 MiB");
|
||||
return Filespace.locked(root, () -> {
|
||||
var work = works.load(root, workId); String id = works.nextReference(work.artifacts(), "ART");
|
||||
var work = works.editable(root, workId); String id = works.nextReference(work.artifacts(), "ART");
|
||||
Path folder = works.folder(root, workId);
|
||||
Path parent = Filespace.resolve(folder, "artifacts/evidence");
|
||||
Path stage = Filespace.resolve(parent, "." + id + "-" + UUID.randomUUID() + ".tmp"); Filespace.directory(stage);
|
||||
var artifact = new Artifact(1, id, workId, origin == null ? source.getFileName().toString() : origin, purpose,
|
||||
var artifact = new Artifact(1, id, workId, origin, purpose,
|
||||
"artifacts/evidence/" + id + "/payload", hash(bytes), bytes.length, author, Instant.now().toString());
|
||||
Filespace.writeBytes(stage.resolve("payload"), bytes, false);
|
||||
Filespace.write(stage.resolve("artifact.yaml"), Documents.yaml(artifact), false);
|
||||
|
||||
Reference in New Issue
Block a user