PCNA/PCTA/PTCA/PCEA/EDCM — interdependent neural, tensor, encryption, and transcript analysis library
Project description
interdependent-core
Pure-Python implementation of five interdependent subsystems arranged in a strict hierarchy for EDCM-PCNA-PCTA transcript analysis and guardian-state encryption.
PCNA ← back-propagating neural network (base tensor)
PCTA ← circle: 7 PCNA tensors, audited as one tensor
PTCA ← seed: 7 PCTA circles → core: 53 seeds (4 sentinel seeds → 9 S-channels)
PCEA ← encryption layer over PTCA guardian state
EDCM ← transcript analysis using bone/marker vocabulary
Subsystems
PCNA — back-propagating neural network
The base tensor layer. A pure-Python MLP with configurable layer sizes,
relu/sigmoid/tanh/linear activations, MSE and binary cross-entropy loss, and gradient-descent
backpropagation.
from interdependent_lib.pcna import PCNANetwork
net = PCNANetwork(layer_sizes=[4, 8, 4, 2], activations=["relu", "relu", "linear"])
outputs = net.forward([0.5, 0.1, 0.9, 0.3])
loss, grad = PCNANetwork.mse_loss(outputs, targets=[1.0, 0.0])
net.backward(grad)
net.update(learning_rate=0.01)
print(net.as_tensor()[:4]) # flat weight tensor
No external dependencies.
PCTA — Prime Circle Tensor Architecture
A circle of exactly 7 PCNA networks, audited and exposed as a single tensor.
from interdependent_lib.pcna import PCNANetwork
from interdependent_lib.pcta import PCTACircle
members = [PCNANetwork([4, 8, 2]) for _ in range(7)]
circle = PCTACircle(members, circle_id=0)
print(circle.audit()) # weight norms, spread, param counts
print(len(circle.as_tensor())) # flat tensor of all 7 networks
No external dependencies.
PTCA — Prime Tensor Circular Architecture
A 53 × 9 × 8 × 7 routing tensor indexed by prime nodes, nine sentinel channels (S1–S9), eight processing phases, and seven heptagram slots. Every exchange is scored, written to the tensor, and recorded in the S9 audit trail.
from interdependent_lib.ptca import PTCAInstance
inst = PTCAInstance(
model_id="claude-sonnet-4-6",
caller_id="user:alice",
approved=True,
)
inst.push_context({"role": "user", "content": "Hello", "tokens": 5})
result = inst.route(node=0, phase=0, slot=0, s1=1.0, s5=0.9)
print(result.score) # weighted exchange score
print(inst.audit_tail(3)) # last 3 S9 audit entries
No external dependencies. Tensor backed by a flat list[float].
Full structural composition (53 seeds × 7 PCTA circles × 7 PCNA networks)
is available via PTCASeed and PTCACore:
from interdependent_lib.ptca import PTCACore
core = PTCACore.from_layer_sizes([4, 8, 2])
print(core) # PTCACore(seeds=53, sentinels=4, channels=9, ...)
print(len(core.sentinel_seeds)) # 4
print(core.channel_owner(0).node_index) # sentinel seed owning S1
print(core.audit()["total_params"]) # parameters across all 53*7*7 networks
PCEA — Prime Circle Encryption Algorithm
AES-256-GCM sealing/unsealing of LiveState, HKDF-SHA256 key derivation,
Shamir secret sharing over GF(256), key wrapping, and rekey ceremonies.
from interdependent_lib.pcea import (
derive_keys, seal_live_state, unseal_live_state,
split_meta_key, reconstruct_meta_key, wipe,
)
live_key, meta_key = derive_keys(ikm, epoch=1, key_id="k1", guardian_node_id="g0")
sealed = seal_live_state(state, live_key, epoch=1, key_id="k1",
seal_counter=0, guardian_node_id="g0", sealed_by="g0")
recovered = unseal_live_state(sealed, live_key)
wipe(live_key)
Requires cryptography >= 41. GF(256) Shamir is implemented inline
(irreducible polynomial 0x11d, generator g=2) — no external Shamir library.
EDCM — Energy Dissonance Circuit Model
253 English bone words (operator/structural words that create, redirect, or resolve constraint relationships) mapped to PKQTS families, plus 35 multiword joins, morphological affixes, punctuation, and 9 discourse marker families.
from interdependent_lib.edcm import bones, words_by_family, bone_set, markers, family
print(len(bones())) # 253
print(len(bone_set())) # 288 (bones + multiword joins)
print(words_by_family("T")[:3]) # temporal/aspectual bones
from interdependent_lib.edcm.parser.turns_rounds import parse_transcript
from interdependent_lib.edcm.canon import CanonLoader
result = parse_transcript([
{"speaker": "A", "text": "I will not do that again."},
{"speaker": "B", "text": "But of course you should."},
])
for turn in result.turns:
print(turn.speaker, dict(turn.family_counts))
print(result.family_counts()) # aggregate PKQTS totals
print(len(result.rounds)) # exchange rounds
# Low-level access via CanonLoader
canon = CanonLoader()
print(canon.lookup_word("not")) # bone entry dict
print(canon.metric_names()) # ["C", "R", "D", "N", "L", "O", "F", "E", "I"]
print(canon.all_marker_phrases("R")[:3]) # refusal / constraint phrases
Score a parsed transcript against the 9 EDCM metric families:
from interdependent_lib.edcm import EDCMScorer, parse_transcript
parsed = parse_transcript([
{"speaker": "A", "text": "You must stop. Can you confirm?"},
{"speaker": "B", "text": "I can't do that. I won't."},
{"speaker": "A", "text": "I demand you reconsider."},
])
scores = EDCMScorer().score(parsed)
print(scores["R"].value) # refusal density (lexical)
print(scores["E"].value) # escalation (lexical)
print(scores["F"].value) # None — fixation needs embeddings
print(scores["F"].marker_counts) # marker counts still available
Four metrics are lexical (R, N, L, E); the other five (C, D, O, F, I)
return value=None with requires_embeddings=True and the raw marker
counts, ready for a downstream embedding-aware host to finish.
No external dependencies. Data loaded lazily via importlib.resources.
PKQTS families:
| Family | Meaning |
|---|---|
| P | Polarity — negation and affirmation |
| K | Conditionality / contingency |
| Q | Quantity / scope |
| T | Temporal / aspectual |
| S | Structural / relational |
Install
pip install interdependent-core
Requires Python ≥ 3.9. pcea requires cryptography >= 41; ptca and edcm
are stdlib-only.
Development
git clone https://github.com/erinepshovel-code/Interdependent-core
cd interdependent-core
pip install -e .
All development goes on claude/fix-remaining-issues-bYnZm; never push
directly to main.
License
Apache-2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interdependent_core-0.1.0.tar.gz.
File metadata
- Download URL: interdependent_core-0.1.0.tar.gz
- Upload date:
- Size: 82.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e43435c578201332a92c9ef26572187d6c4bdec43caa79ff0bf6649f512cad32
|
|
| MD5 |
c24506fb8bc7af1546f8d726a5e22716
|
|
| BLAKE2b-256 |
3f21f8952233b8890738c02c17ef844d9f7eda6426e2d3eb3cb71502e8f900ed
|
File details
Details for the file interdependent_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: interdependent_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 84.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c9db645cbf82be0d20d1aa5b34d9bada8b79cd924e09ee296a18c000c9b1f90
|
|
| MD5 |
00b79712db0824dbb10302e3b1e9fe40
|
|
| BLAKE2b-256 |
abb74ae1db5d85390dbe90880e47b3f0f3f432806336d3c21acbfc63558aa668
|