effects

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package effects holds the sink catalogue: which calls can ultimately write a database, spawn a process, touch the filesystem, or leave the network (RFC-001 §5.2). The catalogue is data, not code — the default ships embedded, and workspaces extend it with .seamark/effects.yaml.

Detection is deliberately syntactic and matches call REFERENCES, not resolved edges: the interesting sinks (database/sql.Exec, subprocess.run) live in external dependencies the indexer never resolves. Direct tags land on the enclosing declaration; the indexer propagates them backwards along CALLS edges to fixpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog is the merged sink list, indexed for matching.

func Load

func Load(root string) (*Catalog, error)

Load returns the embedded catalogue merged with the workspace overlay at <root>/.seamark/effects.yaml (missing overlay is fine; a malformed one is an error — silently dropping the user's security config is worse).

func (*Catalog) MatchCall

func (c *Catalog) MatchCall(family, name string) []string

MatchCall returns tags for a bare call by name.

func (*Catalog) MatchCommand

func (c *Catalog) MatchCommand(name string, args []string) []string

MatchCommand returns tags for a shell command by its base name and argv tail. Subcommand candidates are non-flag tokens NOT preceded by a flag (a flag's separate value is skipped): `kubectl -n prod delete x` finds `delete`, while `terraform plan -out apply` does not find `apply`. Any candidate matching counts — for a security classifier a false positive beats a false negative.

func (*Catalog) MatchImport

func (c *Catalog) MatchImport(family, importPath, name string) []string

MatchImport returns tags for a call to name qualified through (or imported by name from) importPath.

func (*Catalog) MatchMethod

func (c *Catalog) MatchMethod(family, name string) []string

MatchMethod returns tags for an attribute/method call by name.

type CommandSink

type CommandSink struct {
	Name        string   `yaml:"name"`
	Subcommands []string `yaml:"subcommands"` // empty: any invocation matches
	Tag         string   `yaml:"tag"`
}

CommandSink classifies a shell command for the gate.

type Sink

type Sink struct {
	Language string   `yaml:"language"` // family key: go | ecma | python
	Import   string   `yaml:"import"`   // qualified through this import path
	Names    []string `yaml:"names"`    // names for the import matcher
	Method   string   `yaml:"method"`   // any attribute/method call
	Call     string   `yaml:"call"`     // bare call
	Tag      string   `yaml:"tag"`
}

Sink is one catalogue entry; exactly one matcher field is set.

Jump to

Keyboard shortcuts

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