graphify

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package graphify defines the persisted, workspace-bound Graphify contract.

Index

Constants

View Source
const (
	ConfigVersion  = 1
	MaxResultBytes = 32 << 10
	MaxQueryRounds = 8
)
View Source
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
)
View Source
const (
	PinnedPackageRequirement = "graphifyy[mcp]==0.9.61"
	PinnedPythonRequirement  = ">=3.10"
	PinnedMCPEntypoint       = "graphify-mcp"
)
View Source
const (
	MaxSourceVerifications = 8
	MaxSourceReadBytes     = 16 << 10
	MaxSourceExcerptBytes  = 2 << 10
)

Variables

This section is empty.

Functions

func ApprovedTools

func ApprovedTools() []string

func IsApprovedTool

func IsApprovedTool(name string) bool

func Save

func Save(path string, cfg Config) error

func ValidatePinnedToolInventory

func ValidatePinnedToolInventory(tools []ToolContract) error

func ValidateReleaseMetadata

func ValidateReleaseMetadata(data []byte) error

func ValidateTool

func ValidateTool(name string, round int, payload []byte) error

func ValidateToolArguments

func ValidateToolArguments(name string, args map[string]any) error

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.

func (Binding) Matches

func (b Binding) Matches(workspace, fingerprint string) error

func (Binding) Validate

func (b Binding) Validate() error

type Check

type Check struct {
	Name    string `json:"name"`
	Ready   bool   `json:"ready"`
	Message string `json:"message"`
}

type Config

type Config struct {
	Version          int       `yaml:"version" json:"version"`
	OperatorApproved bool      `yaml:"operator_approved" json:"operator_approved"`
	Binding          *Binding  `yaml:"binding,omitempty" json:"binding,omitempty"`
	Endpoint         *Endpoint `yaml:"endpoint,omitempty" json:"endpoint,omitempty"`
}

func Load

func Load(path string) (Config, error)

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) Validate

func (e Endpoint) Validate() error

func (Endpoint) ValidateServer

func (e Endpoint) ValidateServer(name, transport, command string) error

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

func CheckReadiness(cfg Config, workspace, fingerprint string) Readiness

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

type SourceCitation struct {
	Path string `json:"path"`
	Line int    `json:"line"`
}

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

Jump to

Keyboard shortcuts

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