Docs menu

Canonicalization Engine

Declare one SoT per concept in .ags/canonical.yml; detect and plan fixes for mirror drift.

What you will learn

  • Author concepts
  • canon_enforce
  • canon_plan_fix

Prerequisites

Surface

MCPcanon_get · canon_validate · canon_enforce · canon_drift · canon_plan_fix
Config.ags/canonical.yml

What this feature does

Each concept has one canonicalPath. Mirrors (docs) may reference it but must not diverge silently. canon_drift lists mismatches; canon_plan_fix proposes repairs.

Configuration

Wire these surfaces first: .ags/canonical.yml.. Treat them as the contract agents must not invent around.

.ags/canonical.yml yaml
schemaVersion: 1
concepts:
  - id: versioning-config
    label: Versioning policy
    canonicalPath: .ags/versioning.yml
    kind: config
    mirrors:
      - docs/AGENT_VERSIONING_PROTOCOL.md
graphArtifact: docs/canonical-map/latest.json

How to call it

Call these MCP tools through your AGS / tower-gov host — canon_get, canon_validate, canon_enforce, canon_drift, canon_plan_fix.. Prefer scan/get before validate/diff, and enforce only when the change set is ready.

  1. Add concept to .ags/canonical.yml
  2. canon_validate
  3. canon_drift
  4. canon_enforce
MCP: canon_enforce json
{
  /* Example MCP call — fill args from schema_get / docs */
  "tool": "canon_get",
  "arguments": {}
}

Plan a fix

When drift is real, plan before editing mirrors.

MCP: canon_plan_fix json
{ "conceptId": "versioning-config" }

What success looks like

canon_enforce ok

canon_drift empty or accepted

Common failure modes

Two SoTs for one concept

Docs rewritten as authority

Missing graphArtifact update

Related reference

AGS documentation