feat: import open Discussion Framework agendas into Works

Add deterministic preview and fingerprint-bound application for independent
DF sources under an AIE umbrella. Preserve complete agendas and original
evidence with source-scoped identities, validated receipts and safe retries.

Publish prepared Works atomically, require review for changed imports and
retain existing refinement without source edits or model calls.

Advertise protocol contract 2 while continuing to read contract-1 projects. Add JVM,
concurrency, recovery and native coverage; document usage and complete
WRK-0007 with verification evidence.
This commit is contained in:
2026-11-16 14:53:05 +00:00
parent bc9fe8152c
commit 8f6cfa5d86
74 changed files with 3663 additions and 78 deletions
@@ -23,11 +23,16 @@ public final class DiscussionService {
if (respondsTo != null && list(root, workId).stream().noneMatch(e -> e.id().equals(respondsTo)))
throw ProtocolException.invalid("Response target not found in Work: " + respondsTo);
String id = works.nextReference(work.discussions(), "DSC");
var entry = new DiscussionEntry(1, id, workId, discussionId, kind, author, Instant.now().toString(), respondsTo, text);
Documents.writeMarkdownDocument(Filespace.resolve(works.folder(root, workId), "discussions/" + id + ".md"), entry, "text", false);
var entry = writePrepared(works.folder(root, workId), workId, id, text, kind, author, discussionId, respondsTo);
works.addReference(root, workId, "discussions", id); return entry;
});
}
/** Normal discussion format in an unpublished Work folder; caller publishes its Work references. */
public DiscussionEntry writePrepared(Path folder, String workId, String id, String text, DiscussionEntry.Kind kind,
String author, String discussionId, String respondsTo) {
var entry = new DiscussionEntry(1, id, workId, discussionId, kind, author, Instant.now().toString(), respondsTo, text);
Documents.writeMarkdownDocument(Filespace.resolve(folder, "discussions/" + id + ".md"), entry, "text", false); return entry;
}
public record MigrationReport(int schemaVersion, int converted, int unchanged, List<String> backups) {
public MigrationReport { backups = List.copyOf(backups); }
}