Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2a31d0e
refactor(groups): extract GroupAttachmentBinder from GroupConversatio…
ginccc Aug 1, 2026
fe2edde
refactor(groups): extract GroupContextBuilder from GroupConversationS…
ginccc Aug 1, 2026
727d516
refactor(groups): extract GroupSigningGuard from GroupConversationSer…
ginccc Aug 1, 2026
8b76d74
fix(groups): key-rotation-safe signature verification
ginccc Aug 1, 2026
741bc3f
refactor(groups): extract MemberTurnExecutor from GroupConversationSe…
ginccc Aug 1, 2026
02d3760
refactor(groups): extract PhaseExecutionEngine from GroupConversation…
ginccc Aug 1, 2026
7de245a
refactor(groups): extract TaskForceEngine from GroupConversationService
ginccc Aug 1, 2026
338ddd4
docs(groups): fix stale PhaseExecutionEngine comment, log review of s…
ginccc Aug 1, 2026
5071acd
refactor(groups): extract GroupHitlCoordinator from GroupConversation…
ginccc Aug 1, 2026
8405935
refactor(groups): extract GroupLifecycleOps from GroupConversationSer…
ginccc Aug 1, 2026
118b310
chore(groups): R1 step 9 verification - facade finalized, no further …
ginccc Aug 1, 2026
2ae7e5d
feat(groups): wire group discussions into graceful shutdown
ginccc Aug 1, 2026
710a562
refactor(orchestrator): extract ToolContextBudget from AgentOrchestrator
ginccc Aug 1, 2026
0809465
feat(orchestrator): introduce the ToolSourceProvider SPI
ginccc Aug 1, 2026
105ce2f
refactor(orchestrator): extract HttpCallToolsProvider, first SPI prov…
ginccc Aug 1, 2026
25dd1b6
refactor(orchestrator): extract McpToolsProvider
ginccc Aug 1, 2026
82fd81b
feat(orchestrator): add A2AToolsProvider, not yet wired
ginccc Aug 1, 2026
76d9e52
refactor(orchestrator): extract DynamicAgentToolsProvider + ToolObjec…
ginccc Aug 2, 2026
a8cc233
refactor(orchestrator): extract ContextualToolsProvider
ginccc Aug 2, 2026
15c0299
fix(review): critical review pass over Wave R — 8 defects, docs corre…
ginccc Aug 2, 2026
b499aa7
fix(review): PR #626 automated-review findings — 6 defects, 2 declined
ginccc Aug 2, 2026
40c7a06
Merge origin/main into refactor/group-service-split
ginccc Aug 2, 2026
bcea36f
refactor(orchestrator): BuiltinToolsProvider + close the three SPI gaps
ginccc Aug 2, 2026
9109084
refactor(orchestrator): buildToolSetup now iterates providers
ginccc Aug 2, 2026
fc80f34
refactor(orchestrator): extract ToolApprovalGateSupport
ginccc Aug 2, 2026
b6e4c6a
refactor(orchestrator): introduce IAgentOrchestrator
ginccc Aug 2, 2026
956aa76
refactor(orchestrator): extract ToolLoopRunner + ToolLoopResumer
ginccc Aug 2, 2026
f0f104c
refactor(conversation): extract ConversationHitlService
ginccc Aug 2, 2026
09c365e
refactor(conversation): extract ConversationStepRunner — Wave R complete
ginccc Aug 2, 2026
135ab46
fix(review): Wave R branch review + PR nitpicks
ginccc Aug 2, 2026
f92fa2c
docs(groups): explain the remaining useless-parameter findings in place
ginccc Aug 2, 2026
7114358
fix(groups): DEBATE opposingArguments team-filter bug (V6(a))
ginccc Aug 3, 2026
f0c3d0c
feat(groups): LiveDiscussionRegistry (Wave 0, F1)
ginccc Aug 3, 2026
58344da
feat(groups): Speaker-level ResumePoint (Wave 0, F2)
ginccc Aug 3, 2026
e9dd3a7
feat(groups): DecisionRecord (Wave 0, F3)
ginccc Aug 3, 2026
74749ca
feat(groups): Transcript entry types + visibility matrix (Wave 0, F4)
ginccc Aug 3, 2026
e805225
feat(groups): GroupCostLedger (Wave 0, F5)
ginccc Aug 3, 2026
4ef2b96
feat(groups): Paused-document schema versioning (Wave 0, F6)
ginccc Aug 3, 2026
3aae80c
feat(groups): Group cost ceiling + attribution (I1)
ginccc Aug 3, 2026
743e9de
docs(orchestrator): correct four Javadocs left stale by R2's rewiring
ginccc Aug 3, 2026
3ada824
fix(orchestrator): UserMemoryTool never resolved its group scope
ginccc Aug 3, 2026
7c0b36e
fix(orchestrator): three SPI hardening fixes from PR review
ginccc Aug 3, 2026
8e2fc2c
feat(groups): Convergence detection + early exit (I2)
ginccc Aug 3, 2026
df2aadf
fix(orchestrator): restore interrupts wrapped in a cause chain
ginccc Aug 3, 2026
cc0fad3
feat(groups): Abstention + minority report (I4)
ginccc Aug 3, 2026
453217b
feat(groups): Structured verdicts + deterministic synthesis (I3)
ginccc Aug 3, 2026
66c7850
fix(groups): wouldExceedCeiling disagreed with enforceCeiling at zero
ginccc Aug 3, 2026
1c00ea8
feat(groups): Agent-writable shared task list (I5)
ginccc Aug 3, 2026
86307be
fix(groups): @Vetoed on GroupTaskTools — it broke application startup
ginccc Aug 3, 2026
03d5fbc
feat(groups): Runtime recruitment + configurable delegation timeout (I7)
ginccc Aug 3, 2026
31d3636
fix(groups): branch-review findings — cross-discussion write, ungated…
ginccc Aug 4, 2026
985c9d2
fix(groups): branch review round 2 — CME on persist, registry leak, c…
ginccc Aug 4, 2026
f7fee59
fix(groups): branch review round 3 — recruits were second-class every…
ginccc Aug 4, 2026
aca5a4a
fix(groups): a continuation round could report the previous round's c…
ginccc Aug 4, 2026
a84647e
test(orchestrator): cover two gates a real regression would have ship…
ginccc Aug 4, 2026
2a3dc6f
fix: the last five branch-review findings
ginccc Aug 4, 2026
8d5235a
fix(groups): pre-merge review — recruitment was inert, three earlier …
ginccc Aug 4, 2026
8306f6d
fix(orchestrator): MCP tool-name collision could run a different serv…
ginccc Aug 4, 2026
e00a940
Merge remote-tracking branch 'origin/main' into refactor/group-servic…
ginccc Aug 4, 2026
344d897
docs(plan): record implementation status and the gaps in what shipped
ginccc Aug 4, 2026
ed156c9
docs(plan): single handoff file so a new session knows what to build …
ginccc Aug 4, 2026
9ba135b
docs(plan): pin the verified anchors for the cost-pricing fix
ginccc Aug 4, 2026
326f0a9
docs(plan): file the round-5 review findings as pre-feature item N3
ginccc Aug 5, 2026
be86f17
Merge remote-tracking branch 'origin/main' into refactor/group-servic…
ginccc Aug 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
376 changes: 376 additions & 0 deletions docs/changelog.md

Large diffs are not rendered by default.

508 changes: 508 additions & 0 deletions planning/group-collaboration-improvements-plan.md

Large diffs are not rendered by default.

3,613 changes: 309 additions & 3,304 deletions src/main/java/ai/labs/eddi/engine/internal/GroupConversationService.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
/*
* Copyright EDDI contributors
* SPDX-License-Identifier: Apache-2.0
*/
package ai.labs.eddi.engine.internal.groups;

import ai.labs.eddi.engine.attachments.IAttachmentStore;
import ai.labs.eddi.engine.memory.model.Attachment;
import ai.labs.eddi.engine.model.Context;
import ai.labs.eddi.configs.groups.model.GroupConversation;
import org.jboss.logging.Logger;

import java.util.ArrayList;
import java.util.Base64;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
* Materializes, re-hydrates and grants a group discussion's shared attachments.
* Extracted from {@code GroupConversationService} (Wave R, R1 step 1) as a pure
* move — no behavior change.
*
* @author ginccc
*/
public class GroupAttachmentBinder {

private static final Logger LOGGER = Logger.getLogger(GroupAttachmentBinder.class);

private final IAttachmentStore attachmentStore;
private final String defaultTenantId;

public GroupAttachmentBinder(IAttachmentStore attachmentStore, String defaultTenantId) {
this.attachmentStore = attachmentStore;
this.defaultTenantId = defaultTenantId;
}

/**
* Materialize discussion attachments and bind them to the group conversation.
* Inline base64 files are stored in the blob store owned by {@code gc.getId()}
* (so they can be granted to members and reaped with the conversation); hosted
* {@code url} references and pre-stored {@code storageRef}s pass through. The
* resulting list is stashed on the {@link GroupConversation} for fan-out.
*/
public void materializeAttachments(GroupConversation gc, List<Attachment> incoming) {
if (incoming == null || incoming.isEmpty()) {
return;
}
List<Attachment> materialized = new ArrayList<>();
for (Attachment a : incoming) {
try {
if (a.getUrl() != null && !a.getUrl().isBlank()) {
// Hosted URL — forwarded as-is; no blob store required.
materialized.add(a);
} else if (a.getBase64Data() != null && !a.getBase64Data().isBlank()) {
if (attachmentStore == null) {
LOGGER.warn("Inline group attachment provided but no attachment store is configured; skipping it.");
continue;
}
byte[] bytes = Base64.getDecoder().decode(a.getBase64Data());
var stored = attachmentStore.store(bytes, a.getMimeType(), a.getFileName(), gc.getId(), defaultTenantId);
materialized.add(new Attachment(stored.mimeType(), stored.filename(), stored.sizeBytes(), stored.storageRef()));
} else if (a.getStorageRef() != null && !a.getStorageRef().isBlank()) {
materialized.add(a);
}
} catch (Exception e) {
LOGGER.warnf("Failed to materialize group attachment '%s': %s", a.getFileName(), e.getMessage());
}
}
if (!materialized.isEmpty()) {
gc.setAttachments(materialized);
LOGGER.infof("Group conversation '%s' has %d shared attachment(s)", gc.getId(), materialized.size());
}
}

/**
* Re-hydrate a group conversation's shared attachments from the durable blob
* store. {@link GroupConversation#getAttachments()} is {@code @JsonIgnore}
* transient, so a GC reloaded on a HITL resume has lost them; without this, a
* member whose first turn lands after the resume gets neither the blob grant
* nor the {@code attachment_*} context from {@link #grantAndInjectAttachments}.
* <p>
* No-op when attachments are already present (fresh discussion — set by
* {@link #materializeAttachments}) or when the store holds none. URL-only
* attachments are not blob-backed and are intentionally not recovered here.
*/
public void rehydrateAttachmentsFromStore(GroupConversation gc) {
if (attachmentStore == null || gc.getAttachments() != null && !gc.getAttachments().isEmpty()) {
return;
}
try {
var storedAttachments = attachmentStore.listByConversation(gc.getId());
if (storedAttachments.isEmpty()) {
return;
}
List<Attachment> rehydrated = new ArrayList<>();
for (var stored : storedAttachments) {
rehydrated.add(new Attachment(stored.mimeType(), stored.filename(),
stored.sizeBytes(), stored.storageRef()));
}
gc.setAttachments(rehydrated);
LOGGER.infof("Re-hydrated %d shared attachment(s) for group conversation '%s' from the blob store",
rehydrated.size(), gc.getId());

Check warning

Code scanning / CodeQL

Log Injection Medium

This log entry depends on a
user-provided value
.
} catch (Exception e) {
LOGGER.warnf("Failed to re-hydrate shared attachments for group conversation '%s': %s",
gc.getId(), e.getMessage());

Check warning

Code scanning / CodeQL

Log Injection Medium

This log entry depends on a
user-provided value
.
}
}

/**
* Grant a member conversation access to the group's stored attachments and
* inject them as {@code attachment_*} context on the member's first turn. URL
* references are forwarded as-is (no grant needed).
*/
public void grantAndInjectAttachments(GroupConversation gc, String memberConvId, Map<String, Context> context) {
List<Attachment> atts = gc.getAttachments();
if (atts == null || atts.isEmpty()) {
return;
}
int index = 0;
for (Attachment a : atts) {
Map<String, Object> value = new LinkedHashMap<>();
if (a.getStorageRef() != null) {
if (attachmentStore != null) {
try {
attachmentStore.grantAccess(a.getStorageRef(), memberConvId);
} catch (Exception e) {
LOGGER.warnf("Failed to grant attachment '%s' to member conversation '%s': %s",
a.getStorageRef(), memberConvId, e.getMessage());
continue;
}
}
value.put("storageRef", a.getStorageRef());
if (a.getFileName() != null) {
value.put("fileName", a.getFileName());
}
} else if (a.getUrl() != null) {
value.put("mimeType", a.getMimeType());
value.put("url", a.getUrl());
if (a.getFileName() != null) {
value.put("fileName", a.getFileName());
}
} else {
continue;
}
context.put("attachment_" + index, new Context(Context.ContextType.object, value));
index++;
}
}
}
Loading
Loading