Skip to main content
Glama

twining_verify

Run verification checks on development scopes to validate test coverage, warnings, assembly tracking, and drift detection. Automatically posts findings with summaries.

Instructions

Run verification checks on a scope. Checks test coverage (tested_by relations), warnings acknowledgment, assembly-before-decision tracking, drift detection (P2 stub), and constraints (P2 stub). Auto-posts a finding with the summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeYesScope to verify (e.g., "src/auth/" or "project")
checksNoSpecific checks to run (default: all). Options: test_coverage, warnings, drift, assembly, constraints
agent_idNoFilter assembly check to a specific agent (default: all agents)
fail_onNoCheck names that should cause a failure status if they don't pass

Implementation Reference

  • Tool handler implementation for 'twining_verify', which calls VerifyEngine.verify().
    async (args) => {
      try {
        const result = await verifyEngine.verify({
          scope: args.scope,
          checks: args.checks,
          agent_id: args.agent_id,
          fail_on: args.fail_on,
        });
        return toolResult(result);
      } catch (e) {
        if (e instanceof TwiningError) {
          return toolError(e.message, e.code);
        }
        return toolError(
          e instanceof Error ? e.message : "Unknown error",
          "INTERNAL_ERROR",
        );
      }
    },
  • The core business logic of the 'twining_verify' tool, which orchestrates various checks (coverage, warnings, assembly, drift, constraints).
    async verify(input: {
      scope: string;
      checks?: string[];
      agent_id?: string;
      fail_on?: string[];
    }): Promise<VerifyResult> {
      const checksToRun: Set<CheckName> = new Set(
        input.checks
          ? (input.checks.filter((c) =>
              ALL_CHECKS.includes(c as CheckName),
            ) as CheckName[])
          : [...ALL_CHECKS],
      );
    
      const result: VerifyResult = {
        scope: input.scope,
        verified_at: new Date().toISOString(),
        checks: {},
        summary: "",
      };
    
      // Load decisions in scope
      const allDecisions = await this.decisionStore.getByScope(input.scope);
      const activeDecisions = allDecisions.filter(
        (d) => d.status === "active" || d.status === "provisional",
      );
    
      if (checksToRun.has("test_coverage")) {
        result.checks.test_coverage = await this.checkTestCoverage(activeDecisions);
      }
    
      if (checksToRun.has("warnings")) {
        result.checks.warnings = await this.checkWarnings(input.scope);
      }
    
      if (checksToRun.has("assembly")) {
        result.checks.assembly = this.checkAssembly(activeDecisions, input.agent_id);
      }
    
      if (checksToRun.has("drift")) {
        result.checks.drift = await this.checkDrift(activeDecisions, input.scope);
      }
    
      if (checksToRun.has("constraints")) {
        result.checks.constraints = await this.checkConstraints(input.scope);
      }
    
      // Build summary
      const parts: string[] = [];
      for (const [name, check] of Object.entries(result.checks)) {
        if (check) {
          parts.push(`${name}: ${check.status}`);
        }
      }
      result.summary = parts.join(", ");
    
      // Auto-post finding
      try {
        await this.blackboardEngine.post({
          entry_type: "finding",
          summary: `Verification: ${result.summary}`,
          detail: JSON.stringify(result.checks, null, 2),
          tags: ["verify"],
          scope: input.scope,
          agent_id: input.agent_id ?? "verify-engine",
        });
      } catch {
        // Non-fatal — verification result is still returned
      }
    
      return result;
    }
  • Registration of the 'twining_verify' tool within the MCP server.
    "twining_verify",

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/daveangulo/twining-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server