auditshared

package
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package auditshared holds analysis helpers shared by the discovery-metadata auditors (cmd/audit_1to1 R-META and cmd/audit_discovery_completeness): the projected-description probe, owner-package resolution, and the shared usage/description quality checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverActionSpecGroupBuilders

func DiscoverActionSpecGroupBuilders(dir string) ([]string, error)

DiscoverActionSpecGroupBuilders scans the top-level non-test, non-generated .go files of dir for buildXxxActionSpecs builder functions and returns their sorted names. It fails on duplicate builder names and when no builders are found, so both the manifest generator and the catalog-first auditor agree on the same source of truth.

func IsActionSpecGroupBuilderName

func IsActionSpecGroupBuilderName(name string) bool

IsActionSpecGroupBuilderName reports whether a function name follows the buildXxxActionSpecs convention used by the per-domain catalog builders.

func IsGenericUsage

func IsGenericUsage(usage string) bool

IsGenericUsage reports whether the Usage string is the placeholder template or empty.

func NewStubGitLabClient

func NewStubGitLabClient(token string) (*gitlabclient.Client, func(), error)

NewStubGitLabClient builds a GitLab client pointed at an in-process HTTP stub that answers every request with a fixed version payload. Generators and auditors use it to register the tool catalog offline. The returned cleanup func shuts the stub server down.

func OwnerPackage

func OwnerPackage(group tools.ActionSpecGroup, spec toolutil.ActionSpec) string

OwnerPackage resolves the owning package for an action: the spec override wins, then the group owner, then the group base domain.

func ProjectIndividualDescriptions

func ProjectIndividualDescriptions(client *gitlabclient.Client) (map[string]string, error)

ProjectIndividualDescriptions registers the individual-tool surface on an in-memory MCP server and returns the projected description per tool name — the exact text the model consumes.

func WeakIndividualDescription

func WeakIndividualDescription(spec toolutil.ActionSpec, projected map[string]string) bool

WeakIndividualDescription reports whether the effective individual-tool description the model sees lacks the norm's "Returns: … See also: …" form. The effective description is the projected mcp.Tool.Description (which already resolves the curated-description fallback chain), so this avoids false positives from specs that omit IndividualTool.Description yet still project a good curated one.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL