Rename guardian → theta, add sigma ring - #3
Conversation
…nsor → ThetaTensor - core/theta.py: renamed from guardian.py; class GuardianTensor → ThetaTensor; removed ring_alias field from state() - core/pcna.py: import ThetaTensor from .theta; self.guardian → self.theta; state() rings dict drops duplicate "guardian" key, renames variable guardian_state → theta_state - core/merge.py: all .guardian. → .theta.; output keys dominant_guardian_coherence → dominant_theta_coherence, a/b_guardian_coherence_after → a/b_theta_coherence_after - core/zeta.py: _theta_gate_factor() uses .theta attribute https://claude.ai/code/session_018vyPzNQrgsLKq34wyyNY7W
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ad9dce8f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR renames the “guardian” ring implementation and references to “theta”, and updates PCNA/merge/zeta integration points to use the new ThetaTensor naming while removing the ring_alias field from theta state.
Changes:
- Renames
GuardianTensor→ThetaTensor(and updates state to dropring_alias). - Updates
PCNAEngineto useself.thetaand removes the duplicate"guardian"entry fromPCNAEngine.state()["rings"]. - Updates merge protocol codepaths and result keys to use
thetaterminology.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| core/theta.py | Defines ThetaTensor and updates its state() payload (drops ring_alias). |
| core/pcna.py | Swaps engine attribute/imports to ThetaTensor and updates rings state mapping. |
| core/merge.py | Migrates merge logic from .guardian to .theta and updates output keys accordingly. |
| core/zeta.py | Updates theta gate factor lookup to use .theta. |
Comments suppressed due to low confidence (1)
core/pcna.py:344
state()now exposesrings.theta, butring_weightsstill contains aguardianentry. That mismatch makes it unclear how to interpret weights relative to the rings dict and may break any code that zips/joins these by key. UpdateRING_WEIGHTS/coherence scoring to usethetainstead ofguardian(or emit both keys with identical values during a deprecation window).
"sigma": sigma_state,
"memory_l": self.memory_l.state(),
"memory_s": self.memory_s.state(),
},
"ring_weights": RING_WEIGHTS,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "guardian_nodes": len(g_audit), | ||
| "gates_open": len(open_nodes), | ||
| "gates_closed": len(closed_nodes), | ||
| "avg_circles": round(sum(n["circles"] for n in g_audit) / len(g_audit), 2), | ||
| "guardian_coherence": round(float(self.guardian.node_coherence.mean()), 4), | ||
| "guardian_coherence": round(float(self.theta.node_coherence.mean()), 4), |
There was a problem hiding this comment.
In _pcta_circle_audit(), the returned payload still uses guardian_* keys (guardian_nodes, guardian_coherence) even though the underlying ring is now theta. This makes the API inconsistent with state()["rings"] (which now exposes only theta) and with merge outputs (*_theta_coherence_*). Consider renaming these fields to theta_* (and, if backwards compatibility matters, optionally include the old guardian_* keys as deprecated aliases).
There was a problem hiding this comment.
@copilot apply changes based on this feedback
| @@ -272,7 +272,7 @@ def infer(self, text: str) -> dict: | |||
| "coherence_score": coherence["weighted_coherence"], | |||
| "winner": coherence["winner"], | |||
| "confidence": coherence["confidence"], | |||
| "guardian_circles": int(self.guardian.circle_count.mean()), | |||
| "guardian_circles": int(self.theta.circle_count.mean()), | |||
There was a problem hiding this comment.
This infer result still reports guardian_circles (and nearby step3_propagate uses guardian_steps) even though the ring has been renamed to theta. For consistency with the rest of the rename and to avoid confusing downstream consumers, update these output keys to theta_circles / theta_steps (or provide deprecated aliases if you need compatibility).
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
@copilot apply changes based on this feedback
Address Codex P2 and Copilot review comments: all remaining guardian_* identifiers in PCNAEngine now use theta_* so ring_weights, rings dict, and all method return payloads are internally consistent. - RING_WEIGHTS: "guardian" → "theta" - _pcta_circle_audit(): guardian_nodes → theta_nodes, guardian_coherence → theta_coherence - _coherence_score(): ring_scores key "guardian" → "theta"; indexes circle_audit["theta_coherence"] - infer(): guardian_steps → theta_steps, guardian_circles → theta_circles - reward(): guardian_circles_after → theta_circles_after https://claude.ai/code/session_018vyPzNQrgsLKq34wyyNY7W
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
Summary
core/guardian.pyrenamed tocore/theta.py; classGuardianTensor→ThetaTensor;ring_aliasfield removed fromstate()core/pcna.py: importsThetaTensorfrom.theta;self.guardian→self.theta;state()rings dict drops duplicate"guardian"keycore/merge.py: all.guardian.→.theta.; output keys updated (dominant_theta_coherence,a/b_theta_coherence_after)core/zeta.py:_theta_gate_factor()uses.thetaattributecore/sigma.py(new): Σ filesystem observer ring (N=41, seed=41) wrapping PTCACore with file-content watching,drain_content_changed_events(),get_sigma()singletonTest plan
python -m pytestpassesfrom core.theta import ThetaTensorresolves;from core.guardian importno longer existsPCNAEngine().state()["rings"]contains"theta"and"sigma", no"guardian"InstanceMerge.converge()result containsa_theta_coherence_afterhttps://claude.ai/code/session_018vyPzNQrgsLKq34wyyNY7W