Documentation
¶
Overview ¶
Package nodes implements Trajectory IR node identity for the Go IR core.
Hashing matches the Python reference in pkg/trajectory_ir/runtime/nodes.py: RFC 8785 JCS of the payload, then SHA-256 hex for payload_hash; node_id is SHA-256 hex of tenant|trajectory|step|seq|kind|payload_hash with the same string rules as Python (step None formats as the four characters None).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NODE_KINDS = map[string]struct{}{
"INPUT": {},
"CONSTRAINT": {},
"STATE_SET": {},
"PROJECT_CONTEXT": {},
"THOUGHT": {},
"DECISION": {},
"TOOL_CALL": {},
"TOOL_RESULT": {},
"ARTIFACT_PUT": {},
"ARTIFACT_REF": {},
"LTM_QUERY": {},
"LTM_HIT": {},
"LTM_PROJECT": {},
"COMMIT_STEP": {},
"ABORT": {},
"REDACTION": {},
}
NODE_KINDS is the Phase 1A set used by the Python reference.
Functions ¶
func NodeID ¶
NodeID builds the content-addressed id string used by the Python reference. stepN nil is formatted as "None" so it matches Python f-string None.
func PayloadHash ¶
PayloadHash returns SHA-256 hex of the RFC 8785 canonical form of payload. The payload must not contain a "ts" key (wall clock is never hashed).
func ValidateIDComponent ¶
ValidateIDComponent rejects empty values and characters that break the '|' joined node_id preimage (delimiter / control injection).