The Atlas BigLaw / Big Michael — documentation bound to its code
7 documents

Inside a DyTopo round

Open one round of Dynamic Topology Routing: agents declare what they Need and Offer, cosine similarity wires them into a comm graph, jurisdiction-ineligible agents are dropped, then everyone runs an agentic loop whose findings are gated, debated, verified, and rolled up into memory.

biglaw-go/internal/dytopo/jurisdiction.go36 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (C) 2026 Discover Legal

package dytopo

import (
	"strings"

	"github.com/discover-legal/biglaw-go/internal/types"
)

// JurisdictionMatch returns true when an agent is eligible for the given task jurisdiction.
//
// Rules:
//   - Agent has no jurisdictions (neutral) → always eligible.
//   - Task has no jurisdiction → all agents eligible.
//   - Otherwise: at least one of the agent's jurisdictions must be a
//     case-insensitive prefix of the task jurisdiction (so agent "US"
//     matches task "US-NY" and "US-CA"; agent "EU" does not match "US").
func JurisdictionMatch(agent types.AgentDefinition, taskJurisdiction string) bool {
	if len(agent.Jurisdictions) == 0 {
		return true
	}
	if taskJurisdiction == "" {
		return true
	}
	tj := strings.ToUpper(taskJurisdiction)
	for _, j := range agent.Jurisdictions {
		aj := strings.ToUpper(j)
		if tj == aj || strings.HasPrefix(tj, aj+"-") {
			return true
		}
	}
	return false
}