@usekova/recursive
v2.0.0
Published
Recursive covenant structures with self-referential constraints
Downloads
43
Maintainers
Readme
@usekova/recursive
Recursive covenant structures with self-referential constraints, DAG-based termination proofs, and transitive trust computation.
Installation
npm install @usekova/recursiveKey APIs
- createMetaCovenant(targetType, constraints, dependsOn?): Create a meta-covenant targeting a specific entity type (e.g.
'covenant','agent','verifier') - addLayer(existing, newConstraints): Add a constraint layer to an existing meta-covenant, incrementing recursion depth
- proveTermination(metaCovenants): Analyze a chain of meta-covenants for cycles and convergence using DFS-based DAG analysis
- verifyRecursively(entities, maxDepth): Walk a verification chain, producing a
RecursiveVerificationfor each layer - trustBase(): Return the irreducible cryptographic trust assumptions (Ed25519, SHA-256)
- computeTrustTransitivity(edges, source, target, attenuationFactor?): Compute effective trust between nodes in a trust graph with per-hop attenuation
- findMinimalVerificationSet(verifiers, requiredConstraints): Greedy set-cover approximation for the smallest set of verifiers covering all constraints
Usage
import {
createMetaCovenant,
addLayer,
proveTermination,
computeTrustTransitivity,
} from '@usekova/recursive';
// Build a recursive covenant chain
const base = createMetaCovenant('covenant', ['no-exfiltration']);
const layer1 = addLayer(base, ['rate-limit-enforced']);
// Prove the chain terminates
const proof = proveTermination([base, layer1]);
console.log(proof.converges); // true
console.log(proof.maxDepth); // 1
// Compute transitive trust through a graph
const trust = computeTrustTransitivity(
[
{ from: 'alice', to: 'bob', trustScore: 0.9 },
{ from: 'bob', to: 'carol', trustScore: 0.8 },
],
'alice',
'carol',
0.9,
);
console.log(trust.effectiveTrust); // ~0.648
console.log(trust.path); // ['alice', 'bob', 'carol']Types
MetaCovenant,MetaTargetType,RecursiveVerification,TerminationProofTrustBase,TrustEdge,TransitiveTrustResultVerificationEntity,VerifierNode,MinimalVerificationSetResult
Docs
See the Stele SDK root documentation for the full API reference.
