Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 22, 2025

Addresses code review feedback from PR #44. The system was calling bootstrap_consciousness() twice on startup (lines 442 and 492 in unified_server.py), potentially creating duplicate goals and inconsistent state. Demo file had imports scattered inside functions.

Duplicate Bootstrap Prevention

  • Extract is_consciousness_bootstrap_complete() helper that checks phenomenal_experience.bootstrap_complete flag
  • Apply check at both bootstrap locations (cognitive_manager init and unified_consciousness_engine init)
  • Add null safety for consciousness_engine and cognitive_state_injector
def is_consciousness_bootstrap_complete(cognitive_manager) -> bool:
    if not cognitive_manager or not hasattr(cognitive_manager, 'consciousness_engine'):
        return False
    ce = cognitive_manager.consciousness_engine
    if not ce or not hasattr(ce, "current_state") or not hasattr(ce.current_state, "phenomenal_experience"):
        return False
    return ce.current_state.phenomenal_experience.get("bootstrap_complete", False)

Bug Fix

  • Correct attribute name: consciousness_state_injectorcognitive_state_injector (the former doesn't exist in UnifiedConsciousnessEngine)

Code Quality

  • Move inline imports to top of demo_consciousness.py (6 imports consolidated)
  • Extract state_injector to local variable to avoid repeated property access

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits November 22, 2025 04:09
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Copilot AI changed the title [WIP] Integrate consciousness bootstrap with cognitive workflows Fix duplicate consciousness bootstrap calls and refactor demo imports Nov 22, 2025
Copilot AI requested a review from Steake November 22, 2025 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants