GovernanceTools

LLM-invocable tools over the schema governance operator surface: read the drift log and the current declaration, run a drift check, release a quarantined proposition.

Framework-light, the same way DiscoveryTools is: only @LlmTool annotations already on the classpath, no MCP SDK and no servlet dependency. A consuming application calls asTools and registers the returned List<Tool> with its own MCP server or agent tool set.

The host builds these

No DICE auto-configuration registers a GovernanceTools bean, which is how every other DICE tool object works — DiscoveryTools, GraphQueryTools and Memory are all constructed by the application that wants them. A tool object is only useful once it is registered with a particular agent or MCP server, and that registration is the host's call, so the host also decides when the object exists:

@Bean
fun governanceTools(operations: GovernanceOperationsService): List<Tool> =
GovernanceTools.asTools(operations)

Every tool runs through one GovernanceOperationsService, the same object GovernanceController calls over HTTP, so an agent and an operator reading the same state get one answer. Results are leak-free JSON via Tool.Result.text; a refused request — a limit outside its bounds, a blank identifier, a timestamp that will not parse — comes back as Tool.Result.error carrying the bound that was broken.

This is an administrative surface

Unlike DiscoveryTools, no context is baked in at construction, because two of these operations are about the whole graph: the drift log's global half and a whole-graph check both cover every context at once. So the per-context operations take their context as an argument, and an agent holding these tools can read and release in any context. A host decides whether an agent gets them at all by choosing to register them.

Running a check writes a drift report and moves no proposition. Releasing a proposition is the one tool here that changes stored data, and it changes exactly one proposition.

Parameters

operations

The single governance service every tool delegates to.

Constructors

Link copied to clipboard
constructor(operations: GovernanceOperationsService)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun declaredSchemaVersion(): <Error class: unknown class>

The declaration in force, and where it sits against what governance has recorded.

Link copied to clipboard
fun driftReportsInContext(contextId: String, limit: Int = GovernanceOperationsService.DEFAULT_REPORT_LIMIT, since: String? = null): <Error class: unknown class>

Drift checks scoped to one context, newest first.

Link copied to clipboard
fun latestDriftReports(limit: Int = GovernanceOperationsService.DEFAULT_REPORT_LIMIT, since: String? = null): <Error class: unknown class>

Whole-graph drift checks, newest first.

Link copied to clipboard
fun releaseQuarantinedProposition(contextId: String, propositionId: String): <Error class: unknown class>

Lift the hold on one quarantined proposition.

Link copied to clipboard
fun runDriftCheck(contextId: String? = null): <Error class: unknown class>

Run a check. It records a report and moves nothing.