Documentation
¶
Overview ¶
Package replay replays captured agent hook payloads (testdata/hooks) through the real hook dispatcher and compares what graphmaster answers with golden files. The non-test code here only loads fixtures, expands their placeholders and normalizes output; the scenarios live in the package tests.
Index ¶
- func Environ(rec *hookrun.Recording, vars map[string]string) ([]string, error)
- func Expand(s string, vars map[string]string) (string, error)
- func ExpandJSON(raw []byte, vars map[string]string) ([]byte, error)
- func Fields(stdout []byte) []string
- func HooksDir() string
- func Load(rel string) (*hookrun.Recording, error)
- func Normalize(s string, scrub *hookrun.Scrubber) string
- func Placeholders(s string) []string
- func Stdin(rec *hookrun.Recording, vars map[string]string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Environ ¶
Environ returns the fixture's env snapshot (placeholders expanded) in os.Environ form, sorted by name.
func Expand ¶
Expand replaces every {{NAME}} in s with vars[NAME]. A placeholder without a value is an error, so a typo in a fixture cannot silently reach the dispatcher.
func ExpandJSON ¶
ExpandJSON is Expand for JSON text: values are escaped as JSON string content, which keeps Windows paths and quotes valid inside the payload.
func Fields ¶
Fields flattens a JSON object into "path: value" lines (sorted by path) so multi-line strings such as deny reasons read naturally in a golden file. Non-object input yields nil.
func Load ¶
Load reads one fixture. rel is relative to HooksDir, for example "claude/real-session-start-1.json".
func Normalize ¶
Normalize makes hook output comparable across runs: machine paths become {{REPO}} / {{HOME}} and timings become placeholders.
func Placeholders ¶
Placeholders returns the sorted distinct placeholder names in s.
Types ¶
This section is empty.