CB-571: make PeerHandle.charterReceipt() abstract, fix OpenCode adapter's silent null
SessionAwareHandle wrapped the base's WorkerHandle but never overrode charterReceipt(), so it silently inherited the interface default (null) while the real receipt sat on its delegate. sol/terra never got a charterSource/charterSha256 roster row. Deletes the default so every PeerHandle must answer explicitly; the compiler now catches this class of gap instead of a roster field quietly going missing.
This commit is contained in:
@@ -7,6 +7,7 @@ import dev.ltms.bridged.herdr.Agent;
|
||||
import dev.ltms.bridged.herdr.AgentControl;
|
||||
import dev.ltms.bridged.herdr.WorkspaceControl;
|
||||
import dev.ltms.bridged.peer.Capability;
|
||||
import dev.ltms.bridged.peer.CharterReceipt;
|
||||
import dev.ltms.bridged.peer.PeerHandle;
|
||||
import dev.ltms.bridged.peer.SpawnRequest;
|
||||
|
||||
@@ -406,6 +407,11 @@ public final class OpenCodeLauncher extends HerdrPeerLauncher {
|
||||
// appeared).
|
||||
return discovery.sessionIdForDirectory(cwd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharterReceipt charterReceipt() {
|
||||
return delegate.charterReceipt();
|
||||
}
|
||||
}
|
||||
|
||||
// --- Agent-returning convenience spawns (used by callers/tests that want the herdr Agent) ---
|
||||
|
||||
@@ -74,9 +74,11 @@ public interface PeerHandle {
|
||||
* adapter, or a launcher before this field); the session registry stores it so the spawn result
|
||||
* and the roster row can show an operator which charter a member actually got.
|
||||
*
|
||||
* <p>Deliberately not a {@code default}: a decorator that forgets to override this silently
|
||||
* answers {@code null} for a question it has no basis to answer, and the gap surfaces only as
|
||||
* a missing roster field, not a compile error. Every implementation must answer explicitly.
|
||||
*
|
||||
* @return the fingerprint, or {@code null} when the launcher carries none
|
||||
*/
|
||||
default CharterReceipt charterReceipt() {
|
||||
return null;
|
||||
}
|
||||
CharterReceipt charterReceipt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user