Documentation
¶
Overview ¶
Package graphify defines the persisted, workspace-bound Graphify contract.
Index ¶
- Constants
- func ApprovedTools() []string
- func IsApprovedTool(name string) bool
- func Save(path string, cfg Config) error
- func ValidatePinnedToolInventory(tools []ToolContract) error
- func ValidateReleaseMetadata(data []byte) error
- func ValidateTool(name string, round int, payload []byte) error
- func ValidateToolArguments(name string, args map[string]any) error
- type Binding
- type Check
- type Config
- type Endpoint
- type EndpointKind
- type Readiness
- type ReleaseMetadata
- type SourceCitation
- type SourceVerification
- type ToolContract
Constants ¶
const ( ConfigVersion = 1 MaxResultBytes = 32 << 10 MaxQueryRounds = 8 )
const ( PinnedUpstreamVersion = "v0.9.61" PinnedUpstreamCommit = "fe66389083369c3159aa391117185c8f58b4d07c" PinnedContractID = "prism-graphify-mcp-v0.9.61" MaxGraphResponseBytes = 8 << 10 MaxTraversalDepth = 3 MaxPathHops = 6 MaxToolTokenBudget = 2048 MaxQuestionBytes = 2048 MaxLabelBytes = 512 )
const ( PinnedPackageRequirement = "graphifyy[mcp]==0.9.61" PinnedPythonRequirement = ">=3.10" PinnedMCPEntypoint = "graphify-mcp" )
const ( MaxSourceVerifications = 8 MaxSourceReadBytes = 16 << 10 MaxSourceExcerptBytes = 2 << 10 )
Variables ¶
This section is empty.
Functions ¶
func ApprovedTools ¶
func ApprovedTools() []string
func IsApprovedTool ¶
func ValidatePinnedToolInventory ¶
func ValidatePinnedToolInventory(tools []ToolContract) error
func ValidateReleaseMetadata ¶
Types ¶
type Binding ¶
type Binding struct {
Workspace string `yaml:"workspace" json:"workspace"`
IndexPath string `yaml:"index_path" json:"index_path"`
UpstreamVersion string `yaml:"upstream_version" json:"upstream_version"`
SchemaVersion string `yaml:"schema_version" json:"schema_version"`
GenerationFingerprint string `yaml:"generation_fingerprint" json:"generation_fingerprint"`
}
Binding ties a Graphify graph.json file to one exact workspace and generation. Prism never discovers an index implicitly: setup must record this binding.
type Config ¶
type Endpoint ¶
type Endpoint struct {
Server string `yaml:"server" json:"server"`
Kind EndpointKind `yaml:"kind" json:"kind"`
Executable string `yaml:"executable,omitempty" json:"executable,omitempty"`
Environment string `yaml:"environment,omitempty" json:"environment,omitempty"`
EnvironmentVersion string `yaml:"environment_version,omitempty" json:"environment_version,omitempty"`
}
Endpoint identifies the explicitly configured downstream MCP server that serves the bound Graphify index. Its server configuration remains in Prism's downstream-MCP state; this reference keeps Graphify access separate from generic per-agent MCP access policy.
func (Endpoint) ValidateServer ¶
ValidateServer verifies that the separately configured downstream MCP server is compatible with this explicit endpoint declaration. It does not connect to or start the endpoint.
type EndpointKind ¶
type EndpointKind string
const ( // EndpointLocal is an operator-managed executable on the local machine. EndpointLocal EndpointKind = "local" // EndpointSelfHosted is an operator-managed service or MCP bridge. EndpointSelfHosted EndpointKind = "self-hosted" // EndpointManaged is a specifically named and version-pinned managed service. EndpointManaged EndpointKind = "managed" )
type Readiness ¶
type Readiness struct {
Ready bool `json:"ready"`
Message string `json:"message"`
Binding *Binding `json:"binding,omitempty"`
Endpoint *Endpoint `json:"endpoint,omitempty"`
Checks []Check `json:"checks"`
}
func CheckReadiness ¶
CheckReadiness is read-only. It never downloads dependencies or builds an index; callers must use an explicit setup flow for either action.
type ReleaseMetadata ¶
type ReleaseMetadata struct {
MetadataVersion int `json:"metadata_version"`
Upstream struct {
Repository string `json:"repository"`
Tag string `json:"tag"`
Commit string `json:"commit"`
PythonPackage string `json:"python_package"`
PythonRequires string `json:"python_requires"`
MCPExtraRequirements []string `json:"mcp_extra_requirements"`
MCPEntrypoint string `json:"mcp_entrypoint"`
MCPLaunch struct {
Arguments []string `json:"arguments"`
} `json:"mcp_launch"`
CodeIndexing struct {
Command []string `json:"command"`
Output string `json:"output"`
} `json:"code_indexing"`
ReleaseAsset struct {
Name string `json:"name"`
SHA256 string `json:"sha256"`
} `json:"release_asset"`
License string `json:"license"`
} `json:"upstream"`
Contract struct {
ID string `json:"id"`
} `json:"contract"`
DependencyHashes struct {
PythonWheelSHA256 string `json:"python_wheel_sha256"`
PythonSDistSHA256 string `json:"python_sdist_sha256"`
UniversalUVLock string `json:"universal_uv_lock"`
UniversalUVLockSHA256 string `json:"universal_uv_lock_sha256"`
} `json:"dependency_hashes"`
DeliberatelyUnsupported []string `json:"deliberately_unsupported"`
}
type SourceCitation ¶
func ExtractSourceCitations ¶
func ExtractSourceCitations(output string) []SourceCitation
type SourceVerification ¶
type SourceVerification struct {
Citation SourceCitation `json:"citation"`
Verified bool `json:"verified"`
Excerpt string `json:"excerpt,omitempty"`
Truncated bool `json:"truncated,omitempty"`
Reason string `json:"reason,omitempty"`
}
func VerifyGraphSources ¶
func VerifyGraphSources(workspace fs.FS, graphOutput string) []SourceVerification
type ToolContract ¶
type ToolContract struct {
Name string `json:"name"`
InputSchema map[string]any `json:"input_schema"`
}
func PinnedToolContracts ¶
func PinnedToolContracts() []ToolContract