Documentation
¶
Overview ¶
Package safety adapts the unity-fileid-graph safety kernel for unity-ctx write paths. It is the only package in unity-ctx allowed to import github.com/Kubonsang/unity-fileid-graph.
Index ¶
Constants ¶
const ( StatusOK = "OK" StatusWarn = "WARN" StatusError = "ERROR" CodeParseFailed = "PARSE_FAILED" CodeGraphBuildFailed = "GRAPH_BUILD_FAILED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Phase ¶
type Phase string
const ( // PhasePlan is the earliest write-path phase: a dry-run-time, op-aware // pre-check (e.g. reparent cycle/symmetry) that runs before the graph-check // phases below. It is a generalized hook other structural ops can reuse. PhasePlan Phase = "plan" PhasePre Phase = "pre_check" PhaseTemp Phase = "temp_check" PhaseFinal Phase = "final_check" )
type Ref ¶
type Ref struct {
Block int64
Class string
Field string
FileID int64
GUID string
HasGUID bool
Type int
HasType bool
}
Ref is one PPtr/GUID reference extracted from a Unity YAML block.
type RefIssue ¶
RefIssue is a structured warning from refs extraction, mirroring the fields uyaml emits in its refs JSON issues[] (severity is always WARN).
type RefsReport ¶
func ExtractRefs ¶
func ExtractRefs(data []byte, namespace, file string) (RefsReport, error)
ExtractRefs extracts PPtr/GUID reference evidence from raw Unity YAML bytes. It errors only when the bytes cannot be block-parsed.
type Report ¶
type Report struct {
Status string
Blocks int
GameObjects int
Components int
Transforms int
Findings []Finding
}
func CheckBytes ¶
CheckBytes runs the fileid-graph safety kernel (parse, graph build, integrity check) over raw Unity YAML bytes. It never returns an error: parse or build failures are reported as blocking findings.