analyzerruby

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 11 Imported by: 0

Documentation

Overview

Package analyzerruby is an isolated, static-only Ruby fact candidate.

It implements the closed Ruby family of docs/specs/analyzer-candidate-profiles.md: the `ruby.version`, `ruby.gemfile`, `ruby.gemfile-lock`, and `ruby.source` input records and the eight `ruby.*` fact kinds bound to them. It reads no path, consults no installed Ruby, Bundler, gem index, or network, and executes nothing. The request frame handed to AnalyzeCanonical is the sole input.

Index

Constants

View Source
const (
	Profile                 = "corvint-analyzer-candidate/experimental"
	Family                  = "ruby"
	MaxRequestBytes         = 1_500_000
	MaxInputBytes           = 1 << 20
	MaxOutputBytes          = 1 << 20
	MaxInputs               = 128
	MaxFeatures             = 64
	MaxAggregateBase64Bytes = 1_398_104
	MaxPathBytes            = 4096
	MaxPathSegmentBytes     = 128
	MaxJSONDepth            = 8
	MaxJSONTokens           = 4096
	MaxFactFieldBytes       = 4096
	MaxFacts                = 4096
	MaxFactsPerInput        = 4096
	MaxSourceBytes          = 65_536
	MaxBytesPerOp           = 35_000
	MaxAllocsPerOp          = 1_000
)

Variables

This section is empty.

Functions

func AnalyzeCanonical

func AnalyzeCanonical(raw []byte) []byte

AnalyzeCanonical never reads paths, executes Ruby, or resolves gems; raw is the sole input.

Types

type Echo

type Echo struct {
	Handle string `json:"handle"`
	SHA256 string `json:"sha256"`
}

type Fact

type Fact struct {
	Kind           string `json:"kind"`
	InputHandle    string `json:"input_handle"`
	RelatedHandle  string `json:"related_handle"`
	Subject        string `json:"subject"`
	Predicate      string `json:"predicate"`
	Value          string `json:"value"`
	InstanceID     string `json:"instance_id"`
	EvidenceSHA256 string `json:"evidence_sha256"`
}

type Input

type Input struct {
	Handle        string `json:"handle"`
	Family        string `json:"family"`
	Path          string `json:"path"`
	SHA256        string `json:"sha256"`
	ContentBase64 string `json:"content_base64"`
}

type Request

type Request struct {
	Profile           string  `json:"profile"`
	Family            string  `json:"family"`
	RequestID         string  `json:"request_id"`
	ScopeID           string  `json:"scope_id"`
	CompilationUnitID string  `json:"compilation_unit_id"`
	Target            Target  `json:"target"`
	Inputs            []Input `json:"inputs"`
}

type Target

type Target struct {
	OS           string   `json:"os"`
	Architecture string   `json:"architecture"`
	ABI          string   `json:"abi"`
	Features     []string `json:"features"`
}

Jump to

Keyboard shortcuts

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