No description
  • Go 79.2%
  • JavaScript 15.2%
  • Makefile 4.7%
  • HTML 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-15 11:07:39 -07:00
static/js fix 2024-12-31 11:18:20 -08:00
templates update 2026-05-08 11:51:25 -07:00
.gitignore update 2026-05-06 16:17:14 -07:00
correlation.go update name 2026-04-21 09:12:49 -07:00
correlation_test.go add test 2026-04-23 13:39:28 -07:00
frame.go Update dependency on websession to git.mypierian.com/borghives/websession 2026-06-19 18:48:07 -07:00
frame_test.go Update dependency on websession to git.mypierian.com/borghives/websession 2026-06-19 18:48:07 -07:00
go.mod update dependencies 2026-08-15 11:07:39 -07:00
go.sum update dependencies 2026-08-15 11:07:39 -07:00
Makefile chore(go): update dependencies 2026-08-02 12:12:29 -07:00
README.md change package url to git.mypierian.com 2026-06-22 16:12:17 -07:00
session.go Update dependency on websession to git.mypierian.com/borghives/websession 2026-06-19 18:48:07 -07:00
session_test.go Update dependency on websession to git.mypierian.com/borghives/websession 2026-06-19 18:48:07 -07:00
setup.go update entanglement 2026-04-19 03:48:36 -07:00
setup_test.go add test 2026-04-23 13:39:28 -07:00

entanglement

Entangle complexity between different systems knowledge to assure higher probability of intended operation.

entanglement is a Go library designed to manage state, cryptographically link (entangle) properties, and define state correlations for complex systems. It relies on git.mypierian.com/borghives/websession to verify context integrity via token validation.

Installation

go get git.mypierian.com/borghives/entanglement

Core Concepts

SystemFrame

A SystemFrame defines a contextual boundary for a given state. It includes:

  • Name: The identifier for the frame.
  • Nonce: A unique value for salt generation.
  • Token: A verification token to ensure the frame's integrity.
  • Properties: A key-value map of properties that make up the entangled state.

State Correlation

The library provides StateCorrelation and TypeStateCorrelation to map how entities transition between states. This allows you to validate whether a state transition is permitted based on predefined correlations.

Token Verification

Frames can generate and verify tokens using a websession.Session. The token is derived from a salt built using the frame's nonce and name.

Usage

Creating and Entangling a Frame

import (
	"git.mypierian.com/borghives/entanglement"
)

// Initialize a base frame
baseFrame := entanglement.Create("unique-nonce-123", "expected-token-val")

// Create a subframe and entangle properties
subFrame := baseFrame.CreateSubFrame("user-context").
	EntangleProperty("status", "active").
	EntangleProperty("role", "admin")

// Calculate the cryptographic state of all entangled properties
stateHash := subFrame.CalculateEntangledState()

State Correlations

import (
	"git.mypierian.com/borghives/entanglement"
)

correlations := make(entanglement.TypeStateCorrelation)

// Define allowed transitions for a "Document" frame
// e.g., "draft" can transition to "published"
correlations.AddCorrelation("Document", "draft", "published")

props := entanglement.EntangleProperties{}
props.UpdateCorrelationProperties(correlations)

Dependencies