Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

Rename guardian → theta, add sigma ring - #3

Merged
erinepshovel-code merged 3 commits into
mainfrom
claude/update-from-interdependency-a0-clcOD
Apr 21, 2026
Merged

erinepshovel-code merged 3 commits into
mainfrom
claude/update-from-interdependency-a0-clcOD

Conversation

@erinepshovel-code

Copy link
Copy Markdown
Collaborator

Summary

  • core/guardian.py renamed to core/theta.py; class GuardianTensorThetaTensor; ring_alias field removed from state()
  • core/pcna.py: imports ThetaTensor from .theta; self.guardianself.theta; state() rings dict drops duplicate "guardian" key
  • core/merge.py: all .guardian..theta.; output keys updated (dominant_theta_coherence, a/b_theta_coherence_after)
  • core/zeta.py: _theta_gate_factor() uses .theta attribute
  • core/sigma.py (new): Σ filesystem observer ring (N=41, seed=41) wrapping PTCACore with file-content watching, drain_content_changed_events(), get_sigma() singleton

Test plan

  • python -m pytest passes
  • from core.theta import ThetaTensor resolves; from core.guardian import no longer exists
  • PCNAEngine().state()["rings"] contains "theta" and "sigma", no "guardian"
  • InstanceMerge.converge() result contains a_theta_coherence_after

https://claude.ai/code/session_018vyPzNQrgsLKq34wyyNY7W

…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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread core/pcna.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GuardianTensorThetaTensor (and updates state to drop ring_alias).
  • Updates PCNAEngine to use self.theta and removes the duplicate "guardian" entry from PCNAEngine.state()["rings"].
  • Updates merge protocol codepaths and result keys to use theta terminology.

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 exposes rings.theta, but ring_weights still contains a guardian entry. 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. Update RING_WEIGHTS/coherence scoring to use theta instead of guardian (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.

Comment thread core/pcna.py Outdated
Comment on lines +217 to +221
"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),

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment thread core/pcna.py Outdated
Comment on lines +271 to +275
@@ -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()),

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment thread core/pcna.py
claude and others added 2 commits April 21, 2026 21:53
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>
@erinepshovel-code
erinepshovel-code merged commit 574ffbb into main Apr 21, 2026
1 of 2 checks passed
@erinepshovel-code
erinepshovel-code deleted the claude/update-from-interdependency-a0-clcOD branch April 21, 2026 22:24
Copilot stopped work on behalf of erinepshovel-code due to an error April 21, 2026 22:25
@erinepshovel-code

Copy link
Copy Markdown
Collaborator Author

@copilot apply changes based on the comments in this thread

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants