Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions prime_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=45:13 imports_exports=4:1 calls_definitions=0:0
"""prime_core — three-stratum PTCA core (tensor / circle / seed).

Public surface (handoff §2 MODULE_BUILD):
Expand Down Expand Up @@ -61,3 +62,4 @@
"SEED_ROUTING_STEP",
"is_coherence_prime",
]
# ratios: loc_comments=45:13 imports_exports=4:1 calls_definitions=0:0
2 changes: 2 additions & 0 deletions prime_core/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=55:58 imports_exports=2:1 calls_definitions=13:4
"""Frozen composition counts and the coherence-prime guard for prime_core.

Source provenance (IMPORTANT — unverified in this environment):
Expand Down Expand Up @@ -128,3 +129,4 @@ def is_coherence_prime(p: int) -> bool:
return False
_build_coherence_up_to(p)
return p in _coherence_known
# ratios: loc_comments=55:58 imports_exports=2:1 calls_definitions=13:4
2 changes: 2 additions & 0 deletions prime_core/core.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=104:53 imports_exports=6:8 calls_definitions=27:21
"""prime_core.core — the three-stratum PTCA core builder.

Stratification (handoff §1.1): scalar tensors are grafted into UCNS *circle*
Expand Down Expand Up @@ -203,3 +204,4 @@ def build_core(spec: Optional[CoreSpec] = None, *, init: float = 1.0) -> Core:
circles.append(compose_circle(fiqs, routing_step=spec.circle_routing_step))
seeds.append(compose_seed(circles, routing_step=spec.seed_routing_step))
return Core(seeds, spec)
# ratios: loc_comments=104:53 imports_exports=6:8 calls_definitions=27:21
2 changes: 2 additions & 0 deletions prime_core/fiq.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=72:32 imports_exports=2:3 calls_definitions=23:13
"""fiq — the middle stratum object of a PTCA core.

fiq (n.) the tensor holding the UCNS object.
Expand Down Expand Up @@ -134,3 +135,4 @@ def wrap_tensor_fiq(
"""
payload = [v if isinstance(v, Scalar) else Scalar(v) for v in values]
return Fiq(payload=payload, anchor=anchor, identity=identity)
# ratios: loc_comments=72:32 imports_exports=2:3 calls_definitions=23:13
2 changes: 2 additions & 0 deletions ptca/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=54:25 imports_exports=8:1 calls_definitions=4:0
"""
ptca-lib — Prime Tensor Core Architecture

Expand Down Expand Up @@ -84,3 +85,4 @@
# version
"__version__",
]
# ratios: loc_comments=54:25 imports_exports=8:1 calls_definitions=4:0
2 changes: 2 additions & 0 deletions ptca/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=33:22 imports_exports=0:0 calls_definitions=1:0
"""
PTCA schema constants.

Expand Down Expand Up @@ -60,3 +61,4 @@
ALPHA, # S8_RISK
0.0, # S9_AUDIT (append-only log, not scored)
)
# ratios: loc_comments=33:22 imports_exports=0:0 calls_definitions=1:0
2 changes: 2 additions & 0 deletions ptca/exchange.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=98:109 imports_exports=9:5 calls_definitions=14:8
"""
Exchange mechanics — weighted scoring across sentinel channels.

Expand Down Expand Up @@ -244,3 +245,4 @@ def batch_route(
Each dict is passed as keyword arguments to :meth:`route`.
"""
return [self.route(**exc) for exc in exchanges]
# ratios: loc_comments=98:109 imports_exports=9:5 calls_definitions=14:8
2 changes: 2 additions & 0 deletions ptca/instance.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=191:104 imports_exports=9:1 calls_definitions=41:26
"""
PTCAInstance — a PTCA-aware stateful model session.

Expand Down Expand Up @@ -351,3 +352,4 @@ def __repr__(self) -> str:
f"risk={self.risk_score:.3f}, "
f"approved={self.approved})"
)
# ratios: loc_comments=191:104 imports_exports=9:1 calls_definitions=41:26
2 changes: 2 additions & 0 deletions ptca/primes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=22:11 imports_exports=2:3 calls_definitions=4:3
"""
Prime-node axis for the PTCA tensor.

Expand Down Expand Up @@ -43,3 +44,4 @@ def prime_for_node(idx: int) -> int:
def is_prime_node(p: int) -> bool:
"""Return True if *p* is one of the 53 routing primes."""
return p in PRIME_TO_NODE
# ratios: loc_comments=22:11 imports_exports=2:3 calls_definitions=4:3
2 changes: 2 additions & 0 deletions ptca/provenance.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=58:79 imports_exports=6:5 calls_definitions=14:6
"""
Provenance hashing — S1_PROVENANCE support.

Expand Down Expand Up @@ -162,3 +163,4 @@ def extend_chain(
)
blocks.append(block)
return block
# ratios: loc_comments=58:79 imports_exports=6:5 calls_definitions=14:6
2 changes: 2 additions & 0 deletions ptca/sentinels.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=133:37 imports_exports=6:10 calls_definitions=32:28
"""
Sentinel channel definitions and live state.

Expand Down Expand Up @@ -215,3 +216,4 @@ def to_dict(self) -> dict[str, Any]:
"S8_RISK": dataclasses.asdict(self.s8),
"S9_AUDIT": dataclasses.asdict(self.s9),
}
# ratios: loc_comments=133:37 imports_exports=6:10 calls_definitions=32:28
2 changes: 2 additions & 0 deletions ptca/tensor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ratios: loc_comments=101:48 imports_exports=3:1 calls_definitions=33:17
"""
PTCA Tensor — 53 × 9 × 8 × 7 routing structure.

Expand Down Expand Up @@ -182,3 +183,4 @@ def __repr__(self) -> str:

def __len__(self) -> int:
return self.SIZE
# ratios: loc_comments=101:48 imports_exports=3:1 calls_definitions=33:17
Loading