-
-
Notifications
You must be signed in to change notification settings - Fork 49
feat: Complete interactive demo with 6 sections #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Smart installation with transparent planning phase - Hardware-aware intelligence demonstrations - AI natural language understanding - Smart stacks workflow (list and install) - Installation history tracking - Rollback protection demonstration - Comparison table finale showing key differentiators - Clear screen between sections for better UX - ~5 minute interactive tutorial - Matches actual Cortex output with CX branding Users type real commands to build muscle memory. Accepts any input for learning (no validation friction). Closes cortexlinux#366
📝 WalkthroughWalkthroughAdds a class-based interactive demo by introducing Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Demo as CortexDemo
participant HW as HardwareDetector
participant UI as RichRenderer
participant Sim as Simulator
User->>Demo: run_demo() / run()
Demo->>HW: detect_hardware()
HW-->>Demo: SystemInfo
Demo->>UI: render intro / clear_screen
Demo->>User: wait_for_user()
User->>Demo: continue
Demo->>User: prompt AI Intelligence
User->>Demo: enter command
Demo->>Sim: _simulate_cortex_output(command, packages)
Sim->>UI: render CX-style output
Demo->>User: prompt Smart Stacks
User->>Demo: enter stack command
Demo->>Sim: simulate stack execution (hw-aware)
Sim->>UI: render stack output
Demo->>UI: show History & Safety
Demo->>UI: show finale & comparison table
Demo-->>User: return exit code
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
cortex/demo.py (2)
206-217: Usegpu_infoconsistently instead of re-accessinggpu[0].After extracting
gpu_info = gpu[0], the code still accessesgpu[0].modeldirectly on lines 217, 239, and 252. Usinggpu_info.modelwould be more consistent and slightly cleaner.🔎 Proposed fix
if has_nvidia: # NVIDIA GPU - show successful CUDA install - self.console.print(f"[cyan]Detected GPU:[/cyan] {gpu[0].model}") + self.console.print(f"[cyan]Detected GPU:[/cyan] {gpu_info.model}")Apply similar changes to lines 239 and 252.
411-438: Consider using dynamic dates for the history table.The hardcoded dates (e.g., "2025-12-26 13:11:51") will appear stale as time passes. For a more polished demo, consider generating dates relative to the current time.
🔎 Example approach
from datetime import datetime, timedelta now = datetime.now() dates = [ now.strftime("%Y-%m-%d %H:%M:%S"), (now - timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"), (now - timedelta(days=1, hours=1)).strftime("%Y-%m-%d %H:%M:%S"), (now - timedelta(days=2)).strftime("%Y-%m-%d %H:%M:%S"), ]
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide
Type hints required in Python code
Docstrings required for all public APIs
Files:
cortex/demo.py
🧬 Code graph analysis (1)
cortex/demo.py (3)
cortex/branding.py (1)
show_banner(35-46)cortex/cli.py (2)
status(797-828)demo(180-184)cortex/progress_indicators.py (1)
total_steps(99-100)
🪛 GitHub Actions: CI
cortex/demo.py
[error] 6-6: I001 Import block is un-sorted or un-formatted (ruff).
🪛 GitHub Check: lint
cortex/demo.py
[failure] 63-63: Ruff (W293)
cortex/demo.py:63:1: W293 Blank line contains whitespace
[failure] 60-60: Ruff (W293)
cortex/demo.py:60:1: W293 Blank line contains whitespace
[failure] 58-58: Ruff (W293)
cortex/demo.py:58:1: W293 Blank line contains whitespace
[failure] 49-49: Ruff (W291)
cortex/demo.py:49:73: W291 Trailing whitespace
[failure] 44-44: Ruff (W293)
cortex/demo.py:44:1: W293 Blank line contains whitespace
[failure] 41-41: Ruff (W293)
cortex/demo.py:41:1: W293 Blank line contains whitespace
[failure] 35-35: Ruff (W293)
cortex/demo.py:35:1: W293 Blank line contains whitespace
[failure] 31-31: Ruff (W293)
cortex/demo.py:31:1: W293 Blank line contains whitespace
[failure] 21-21: Ruff (W293)
cortex/demo.py:21:1: W293 Blank line contains whitespace
[failure] 6-16: Ruff (I001)
cortex/demo.py:6:1: I001 Import block is un-sorted or un-formatted
🪛 GitHub Check: Lint
cortex/demo.py
[failure] 63-63: Ruff (W293)
cortex/demo.py:63:1: W293 Blank line contains whitespace
[failure] 60-60: Ruff (W293)
cortex/demo.py:60:1: W293 Blank line contains whitespace
[failure] 58-58: Ruff (W293)
cortex/demo.py:58:1: W293 Blank line contains whitespace
[failure] 49-49: Ruff (W291)
cortex/demo.py:49:73: W291 Trailing whitespace
[failure] 44-44: Ruff (W293)
cortex/demo.py:44:1: W293 Blank line contains whitespace
[failure] 41-41: Ruff (W293)
cortex/demo.py:41:1: W293 Blank line contains whitespace
[failure] 35-35: Ruff (W293)
cortex/demo.py:35:1: W293 Blank line contains whitespace
[failure] 31-31: Ruff (W293)
cortex/demo.py:31:1: W293 Blank line contains whitespace
[failure] 21-21: Ruff (W293)
cortex/demo.py:21:1: W293 Blank line contains whitespace
[failure] 6-16: Ruff (I001)
cortex/demo.py:6:1: I001 Import block is un-sorted or un-formatted
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: test (3.10)
- GitHub Check: test (3.11)
- GitHub Check: test (3.12)
🔇 Additional comments (8)
cortex/demo.py (8)
95-105: LGTM!The method correctly handles both interactive and non-interactive modes, with proper exception handling for user interruption.
107-124: LGTM!The method correctly implements the "accept any input for learning" design goal while maintaining proper exception handling.
126-171: LGTM!The simulation logic is well-structured with clear phases (understanding, planning, execution) and proper CX branding. The optional
show_executionparameter provides flexibility for different demo scenarios.
288-333: LGTM!The AI features section effectively demonstrates the
cortex askcapability with a well-formatted response panel.
335-389: LGTM!The stacks section provides a clear demonstration of the workflow bundles feature with a well-formatted table and simulated installation.
448-476: LGTM!The rollback section effectively demonstrates the undo capability and ties back to the installation ID from earlier sections.
478-564: LGTM!The finale provides a compelling comparison table and comprehensive next steps, making for a polished conclusion to the demo.
567-573: LGTM!The entry point is clean and correctly delegates to the new class-based implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
cortex/demo.py (3)
13-13: Remove unused imports fromrich.progress.
BarColumn,Progress,SpinnerColumn, andTextColumnare imported but never used in this file. The code usesself.console.status()which doesn't require these explicit imports.🔎 Proposed fix
-from rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn
23-27: Add type annotation forself.hwand docstring for__init__.Per coding guidelines, type hints are required in Python code and docstrings are required for all public APIs.
self.hwlacks a type annotation, and__init__lacks a docstring.🔎 Proposed fix
def __init__(self): + """Initialize the interactive demo with console and state.""" self.console = Console() - self.hw = None + self.hw: Optional[object] = None # Set by detect_hardware() self.is_interactive = sys.stdin.isatty() self.installation_id = self._generate_id()
131-133: Add return type hint for consistency.Per coding guidelines, type hints are required. This method implicitly returns
None.🔎 Proposed fix
def _simulate_cortex_output( self, command: str, packages: list[str], show_execution: bool = False - ): + ) -> None:
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
cortex/demo.pycortex/dependency_check.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide
Type hints required in Python code
Docstrings required for all public APIs
Files:
cortex/demo.pycortex/dependency_check.py
🧬 Code graph analysis (1)
cortex/demo.py (3)
cortex/branding.py (1)
show_banner(35-46)cortex/cli.py (2)
status(797-828)demo(180-184)cortex/progress_indicators.py (1)
total_steps(99-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Build Package
- GitHub Check: test (3.11)
- GitHub Check: test (3.10)
- GitHub Check: test (3.12)
🔇 Additional comments (13)
cortex/dependency_check.py (1)
46-46: LGTM!Trivial stylistic change from single to double quotes in the join delimiter. No functional impact.
cortex/demo.py (12)
29-35: LGTM!Both
clear_screenand_generate_idare well-documented with appropriate docstrings and type hints.
37-98: LGTM!The
runmethod is well-structured with proper error handling forKeyboardInterruptandEOFError, clear section progression, and appropriate return codes.
100-110: LGTM!Clean implementation with proper non-interactive mode support for CI and robust exception handling.
112-129: LGTM!Zero-validation approach aligns with PR objectives for a learning-focused demo. Good exception handling.
187-211: LGTM!Well-structured section with clear flow: explanation → command prompt → simulation → feature highlight.
213-322: LGTM!Hardware detection logic is sound with proper null checks. The three branches (NVIDIA/AMD/no GPU) provide good coverage for different user scenarios.
324-373: LGTM!Clean AI features section with well-formatted response content and appropriate Panel display.
375-431: LGTM!Stacks section effectively demonstrates listing and installation with proper table formatting.
433-474: LGTM!History section with appropriate example data. Hardcoded dates are acceptable for demo purposes.
476-512: LGTM!Rollback section cleanly demonstrates the undo capability with proper ID generation.
514-574: LGTM!Excellent finale with a compelling comparison table and comprehensive next steps. The summary effectively reinforces what users learned.
577-583: LGTM!Clean entry point that preserves the existing API while delegating to the new class-based implementation. Matches CLI integration in
cortex/cli.py.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (5)
cortex/demo.py (5)
13-13: Remove unused imports from rich.progress.The imports
BarColumn,Progress,SpinnerColumn, andTextColumnare not used in this file. The demo only usesself.console.status(...)contexts, which don't require these imports.🔎 Proposed fix
-from rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn
23-27: Consider adding a docstring and type annotation for better API documentation.The
__init__method lacks a docstring, andself.hwhas no type annotation. Per coding guidelines, docstrings are required for public APIs.🔎 Proposed enhancement
def __init__(self): + """ + Initialize the interactive demo. + + Sets up console, hardware detection placeholder, interactivity detection, + and generates a unique installation ID for demo purposes. + """ self.console = Console() - self.hw = None + self.hw: Optional[object] = None # Set by detect_hardware() self.is_interactive = sys.stdin.isatty() self.installation_id = self._generate_id()
29-31: Add return type annotation for consistency.Per coding guidelines, type hints are required. The
clear_screenmethod should explicitly declare-> None.🔎 Proposed fix
- def clear_screen(self): + def clear_screen(self) -> None: """Clears the terminal screen""" self.console.clear()
128-131: Add return type annotation.The method should declare
-> Noneper coding guidelines requiring type hints.🔎 Proposed fix
def _simulate_cortex_output( - self, command: str, packages: list[str], show_execution: bool = False + self, command: str, packages: list[str], show_execution: bool = False + ) -> None: - ): """Simulate real Cortex output with CX branding"""
184-186: Add return type annotation.Per coding guidelines, the method should declare
-> boolas its return type.🔎 Proposed fix
- def _section_ai_intelligence(self) -> bool: + def _section_ai_intelligence(self) -> bool: """Section 1: AI Intelligence - NLP, Planning, and Hardware Awareness"""(Note: The return type is actually already present in the signature. This might be a display issue.)
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide
Type hints required in Python code
Docstrings required for all public APIs
Files:
cortex/demo.py
🧬 Code graph analysis (1)
cortex/demo.py (3)
cortex/branding.py (1)
show_banner(35-46)cortex/cli.py (2)
status(797-828)demo(180-184)cortex/progress_indicators.py (1)
total_steps(99-100)
🪛 GitHub Actions: CI
cortex/demo.py
[error] 577-577: W292 No newline at end of file.
🪛 GitHub Check: lint
cortex/demo.py
[failure] 577-577: Ruff (W292)
cortex/demo.py:577:22: W292 No newline at end of file
🪛 GitHub Check: Lint
cortex/demo.py
[failure] 577-577: Ruff (W292)
cortex/demo.py:577:22: W292 No newline at end of file
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: test (3.12)
- GitHub Check: test (3.10)
- GitHub Check: test (3.11)
🔇 Additional comments (6)
cortex/demo.py (6)
37-96: LGTM! Well-structured demo orchestration.The
run()method has a clear flow: initialization, hardware detection, section execution, and finale. Error handling properly catches interruptions and returns appropriate exit codes. The section loop design allows early exit on user interruption.
97-127: LGTM! Robust user interaction handling.Both methods properly handle interactive vs. non-interactive modes and gracefully catch interruptions. The design choice to accept any input in
_prompt_command(line 118) aligns with the learning-friendly objective stated in the PR.
263-278: LGTM! Robust GPU detection with multiple vendor support.The GPU detection logic safely handles the case where hardware info is unavailable (lines 263-264) and checks for both NVIDIA and AMD GPUs using case-insensitive pattern matching. The three-way branching (NVIDIA/AMD/no-GPU) provides tailored demos for each scenario.
365-424: LGTM! Clear demonstration of stacks feature.The section effectively showcases the stacks workflow with a well-formatted table of available stacks and a complete installation simulation. The tip about creating custom stacks (lines 421-422) is a nice touch.
426-506: LGTM! Excellent narrative continuity.The section effectively demonstrates history tracking and rollback features. The use of
self.installation_idfrom the earlier webdev stack installation (line 449, 478, 481) creates excellent narrative continuity throughout the demo.
508-569: LGTM! Compelling finale with clear value proposition.The comparison table (lines 519-536) effectively highlights Cortex's differentiators, and the summary panel provides actionable next steps with correct command syntax. Recommending
cortex wizardas the first step (line 553) is good UX guidance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShreeJejurikar Please update your branch and merge with main. The lint CI issues causing the failures are fixed.
|
Update the branch |
Anshgrover23
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShreeJejurikar Kindly Update the branch and do CLA verification following this PR #401
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
CLA Verification PassedAll contributors have signed the CLA.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
cortex/demo.py (4)
20-27: Add type hints and expand class docstring.Per coding guidelines, type hints are required, and docstrings are required for public APIs. The class docstring is minimal, and
__init__lacks type annotations for instance attributes.Suggested improvement
class CortexDemo: - """Interactive Cortex demonstration""" + """Interactive Cortex demonstration. + + Provides a guided, hands-on tutorial showcasing Cortex's major features + including AI intelligence, smart stacks, and safety features. + """ - def __init__(self): - self.console = Console() - self.hw = None - self.is_interactive = sys.stdin.isatty() - self.installation_id = self._generate_id() + def __init__(self) -> None: + self.console: Console = Console() + self.hw: object | None = None # HardwareInfo from detect_hardware() + self.is_interactive: bool = sys.stdin.isatty() + self.installation_id: str = self._generate_id()
29-31: Add return type hint.Missing return type annotation per coding guidelines.
- def clear_screen(self): + def clear_screen(self) -> None: """Clears the terminal screen""" self.console.clear()
128-130: Add return type hint.Missing return type annotation per coding guidelines.
def _simulate_cortex_output( self, command: str, packages: list[str], show_execution: bool = False - ): + ) -> None: """Simulate real Cortex output with CX branding"""
263-282: Inconsistent variable usage: usegpu_infoinstead ofgpu[0].
gpu_infois extracted on line 264 but thengpu[0].modelis used directly on lines 282, 310, and 325. This is inconsistent and could lead to maintenance issues. Additionally, the length check is redundant since a non-empty list is truthy.Suggested fix
- gpu_info = gpu[0] if (gpu and len(gpu) > 0) else None + gpu_info = gpu[0] if gpu else None # Check for NVIDIA has_nvidia = gpu_info and ( "NVIDIA" in str(gpu_info.model).upper() or "GTX" in str(gpu_info.model).upper() or "RTX" in str(gpu_info.model).upper() ) ... if has_nvidia: # NVIDIA GPU - show successful CUDA install - self.console.print(f"[cyan]Detected GPU:[/cyan] {gpu[0].model}") + self.console.print(f"[cyan]Detected GPU:[/cyan] {gpu_info.model}")Apply the same change on lines 310 and 325.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide
Type hints required in Python code
Docstrings required for all public APIs
Files:
cortex/demo.py
🧬 Code graph analysis (1)
cortex/demo.py (3)
cortex/branding.py (1)
show_banner(35-46)cortex/cli.py (1)
demo(271-275)cortex/progress_indicators.py (1)
total_steps(99-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Test (Python 3.12)
- GitHub Check: Test (Python 3.10)
- GitHub Check: Test (Python 3.11)
- GitHub Check: test (3.11)
🔇 Additional comments (7)
cortex/demo.py (7)
37-95: LGTM!The main entry method has proper error handling, consistent return values, and clean section orchestration. The try/except for
KeyboardInterruptandEOFErrorensures graceful exits.
97-107: LGTM!Clean implementation handling both interactive (user input) and non-interactive (auto-advance) modes with proper exception handling.
109-126: LGTM!The zero-validation approach is well-documented and aligns with the PR objective of a "learning-friendly experience."
365-424: LGTM!The smart stacks section is well-structured with a clear table display and proper simulation of stack installation.
426-506: LGTM!The history and rollback demonstration is well-implemented with clear visual feedback through Rich status spinners.
508-568: LGTM!Excellent finale with a compelling comparison table and clear next steps. The summary effectively reinforces what users learned.
571-577: LGTM!Clean entry point that maintains the existing public API while delegating to the new class-based implementation.
868ab8e to
6fb41c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShreeJejurikar SonarQubeCloud CI check is failing.
|
@Anshgrover23 Please check again now that the SonarQubeCloud CI is passing. Thank you. |
Anshgrover23
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShreeJejurikar added some comments, also do not hardcoded things.
- Remove unused Optional import - Remove "Production Version" from docstring - Replace hardcoded dates with dynamic date generation - Replace hardcoded installation IDs with generated IDs
|
Understood on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @cortex/demo.py:
- Around line 461-474: The two history_table.add_row calls for "docker" and
"python3-dev" both call _generate_past_date(1, 13, 13) producing duplicate
timestamps; change the second _generate_past_date call (used in the row for
"python3-dev") to a different time (e.g., different hour/minute/second arguments
or a different day offset) so the timestamp differs, locating the calls in the
add_row invocations that pass _generate_past_date to history_table.add_row.
🧹 Nitpick comments (4)
cortex/demo.py (4)
13-13: Remove unused imports fromrich.progress.
BarColumn,Progress,SpinnerColumn, andTextColumnare imported but never used. The code usesself.console.status()for spinner animations instead.Suggested fix
-from rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn
29-31: Add return type hint for consistency.Per coding guidelines, type hints should be included. This method is missing its return type annotation.
Suggested fix
- def clear_screen(self): + def clear_screen(self) -> None: """Clears the terminal screen""" self.console.clear()
134-136: Add return type hint.This method is missing its return type annotation.
Suggested fix
def _simulate_cortex_output( self, command: str, packages: list[str], show_execution: bool = False - ): + ) -> None: """Simulate real Cortex output with CX branding"""
286-288: Usegpu_infoconsistently instead ofgpu[0].
gpu_infois assigned on line 270 butgpu[0]is used directly on lines 288, 316, and 331. Usegpu_infofor consistency.Suggested fix for lines 288, 316, 331
- self.console.print(f"[cyan]Detected GPU:[/cyan] {gpu[0].model}") + self.console.print(f"[cyan]Detected GPU:[/cyan] {gpu_info.model}")
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide for Python code
Include type hints in Python code
Add docstrings for all public APIs in Python code
Use dry-run mode by default for all installation operations
Do not use silent sudo - require explicit user confirmation for privilege escalation
Implement Firejail sandboxing for execution of untrusted code
Log all operations to ~/.cortex/history.db for audit purposes
Files:
cortex/demo.py
🧬 Code graph analysis (1)
cortex/demo.py (3)
cortex/branding.py (1)
show_banner(35-46)cortex/cli.py (2)
status(1006-1014)demo(271-275)cortex/progress_indicators.py (1)
total_steps(99-100)
🔇 Additional comments (3)
cortex/demo.py (3)
190-191: Add return type hint.This method is missing its return type annotation.
Suggested fix
- def _section_ai_intelligence(self) -> bool: + def _section_ai_intelligence(self) -> bool: """Section 1: AI Intelligence - NLP, Planning, and Hardware Awareness"""Wait, I see the AI summary says it has
-> bool, but looking at line 190, I need to verify... Line 190 shows justdef _section_ai_intelligence(self) -> bool:- it actually has the type hint. Let me skip this.
530-531: Add return type hint.This method is missing its return type annotation.
Suggested fix
- def _show_finale(self) -> None: + def _show_finale(self) -> None: """Show finale with comparison table and next steps"""Actually, checking the AI summary again - it shows
def _show_finale(self) -> None:. Let me verify from the annotated code... Line 530 showsdef _show_finale(self) -> None:. It already has the type hint.
593-599: LGTM!The
run_demo()entry point maintains API compatibility while delegating to the new class-based implementation. The docstring clearly describes the purpose.
- Remove unused rich.progress imports (BarColumn, Progress, SpinnerColumn, TextColumn) - Add return type hints (-> None) to clear_screen() and _simulate_cortex_output() - Use gpu_info consistently instead of gpu[0] (lines 288, 316, 331) - Fix duplicate timestamps: changed second entry from (1, 13, 13) to (1, 14, 25) All issues from code review are now resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
cortex/demo.py (2)
22-26: Consider adding type hints to__init__.Per coding guidelines, type hints should be included. The
__init__method is missing a return type annotation, andself.hwshould have an explicit type.✨ Suggested improvement
- def __init__(self): + def __init__(self) -> None: self.console = Console() - self.hw = None + self.hw: object | None = None # Consider using proper type from hardware_detection self.is_interactive = sys.stdin.isatty() self.installation_id = self._generate_id()
267-283: GPU detection string matching could miss some models.The current detection checks for "NVIDIA", "GTX", "RTX" but may miss other NVIDIA cards like GeForce (without GTX/RTX prefix), Quadro, or Tesla. Similarly, AMD detection might miss some models. For a demo, this is acceptable, but consider expanding coverage.
✨ More comprehensive GPU detection
# Check for NVIDIA has_nvidia = gpu_info and ( "NVIDIA" in str(gpu_info.model).upper() or "GTX" in str(gpu_info.model).upper() or "RTX" in str(gpu_info.model).upper() + or "GEFORCE" in str(gpu_info.model).upper() + or "QUADRO" in str(gpu_info.model).upper() + or "TESLA" in str(gpu_info.model).upper() ) # Check for AMD (dedicated or integrated Radeon) has_amd = gpu_info and ( "AMD" in str(gpu_info.model).upper() or "RADEON" in str(gpu_info.model).upper() or "RENOIR" in str(gpu_info.model).upper() + or "VEGA" in str(gpu_info.model).upper() + or "NAVI" in str(gpu_info.model).upper() + or "RX " in str(gpu_info.model).upper() )
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide for Python code
Include type hints in Python code
Add docstrings for all public APIs in Python code
Use dry-run mode by default for all installation operations
Do not use silent sudo - require explicit user confirmation for privilege escalation
Implement Firejail sandboxing for execution of untrusted code
Log all operations to ~/.cortex/history.db for audit purposes
Files:
cortex/demo.py
🧬 Code graph analysis (1)
cortex/demo.py (2)
cortex/branding.py (1)
show_banner(35-46)cortex/cli.py (1)
demo(271-275)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Build Package
- GitHub Check: test (3.10)
- GitHub Check: test (3.12)
- GitHub Check: test (3.11)
🔇 Additional comments (10)
cortex/demo.py (10)
1-17: LGTM!Module docstring and imports are well-organized. All imported components are used appropriately throughout the demo.
28-40: LGTM!Helper methods are well-documented with appropriate type hints. Using
secrets.token_hex()for demo IDs is a good choice for realistic-looking identifiers.
42-100: LGTM!The main
run()method is well-structured with:
- Proper type hint and docstring
- Comprehensive error handling for
KeyboardInterruptandEOFError- Clean section iteration pattern with early exit on interruption
- Appropriate exit codes (0 for success, 1 for interruption)
102-112: LGTM!Clean implementation handling both interactive and non-interactive (CI) modes. The error handling for user interruption is appropriate.
114-131: LGTM!The zero-validation approach is intentional per PR objectives, making the demo learning-friendly. Good visual feedback with the green checkmark after input.
157-161: Good adherence to dry-run by default pattern.The demo correctly shows that execution requires the
--executeflag, aligning with the coding guideline to use dry-run mode by default. This teaches users the safe behavior from the start.
189-198: LGTM!The AI Intelligence section is well-structured with clear part divisions. The method is lengthy but the narrative flow benefits from keeping the parts together. Good error handling throughout.
370-429: LGTM!Clean demonstration of the Smart Stacks feature with well-formatted tables and helpful tips for custom stack creation.
431-527: LGTM!History and rollback demonstration is well-executed with realistic-looking demo data and clear explanation of the safety features.
529-598: LGTM!The finale effectively showcases Cortex's differentiators with a clear comparison table. The
run_demo()function maintains backward compatibility while delegating to the new class-based implementation.
|
Nice demo overall. One UX bug: empty Enter at the “Try:” prompt still prints a hard-coded AI response, which is misleading. Please re-prompt on empty input or prefix the output with [Sample output — command not executed]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @cortex/demo.py:
- Around line 278-300: The GPU detection assumes self.hw has a .gpu attribute
and directly indexes/reads gpu_info.model which can raise AttributeError; change
gpu access to use getattr(self.hw, "gpu", None) and guard indexing (e.g., treat
gpu as iterable and only set gpu_info if gpu is truthy and has length > 0), and
use getattr(gpu_info, "model", "") when reading the model; also factor the
repeated string-matching logic into a helper method (suggested name:
_is_gpu_vendor(self, model: str, keywords: list[str])) and replace the
has_nvidia and has_amd checks to call that helper with appropriate keyword
lists.
🧹 Nitpick comments (3)
cortex/demo.py (3)
161-172: Hardcodedaptcommands in simulation.The simulated output always shows
sudo aptcommands regardless of the actual system's package manager. While acceptable for a demo, consider:
- Using the detected system's package manager for more realistic output, or
- Adding a comment noting this is a simplified simulation
The dry-run messaging (lines 169-172) showing the
--executeflag requirement aligns well with the coding guidelines about dry-run mode being the default.
398-398: Potentially incomplete output line.This line prints
" [cyan]CX[/cyan] │ \n"which appears to be a CX-branded prefix with no actual content. This may be intentional spacing, but if so, consider using justself.console.print()or adding a comment explaining the purpose.- self.console.print(" [cyan]CX[/cyan] │ \n") + self.console.print() # Visual spacing before stacks table
22-26: ImportSystemInfoand use it as the type hint forself.hw.The
object | Nonetype hint is too generic and provides no useful type information. Sincedetect_hardware()returnsSystemInfo, import and use that specific type:-from cortex.hardware_detection import detect_hardware +from cortex.hardware_detection import detect_hardware, SystemInfo class CortexDemo: """Interactive Cortex demonstration""" def __init__(self) -> None: self.console = Console() - self.hw: object | None = None # Type from hardware_detection.detect_hardware() + self.hw: SystemInfo | None = None self.is_interactive = sys.stdin.isatty() self.installation_id = self._generate_id()
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide for Python code
Include type hints in Python code
Add docstrings for all public APIs in Python code
Use dry-run mode by default for all installation operations
Do not use silent sudo - require explicit user confirmation for privilege escalation
Implement Firejail sandboxing for execution of untrusted code
Log all operations to ~/.cortex/history.db for audit purposes
Files:
cortex/demo.py
🧬 Code graph analysis (1)
cortex/demo.py (3)
cortex/branding.py (1)
show_banner(35-46)cortex/cli.py (1)
demo(271-275)cortex/progress_indicators.py (1)
total_steps(99-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Build Package
- GitHub Check: test (3.12)
- GitHub Check: test (3.10)
- GitHub Check: test (3.11)
🔇 Additional comments (4)
cortex/demo.py (4)
28-40: LGTM!Utility methods are well-implemented with proper docstrings and type hints. Using
secrets.token_hex()for ID generation is a good choice for cryptographically secure random values.
42-100: LGTM!The
run()method is well-structured with comprehensive error handling for user interruptions. The section-based iteration pattern is clean and maintainable. Exit codes appropriately distinguish between successful completion (0) and interruption (1).
114-142: LGTM - Addresses reviewer feedback.The
_prompt_commandmethod properly re-prompts on empty input (lines 127-131), which addresses the UX bug mentioned in the PR comments. This prevents the misleading behavior of showing a hard-coded AI response when the user presses Enter without typing anything.
546-615: LGTM!The finale section provides a strong conclusion with:
- A clear comparison table highlighting Cortex's differentiation
- A comprehensive summary of learned features
- Actionable next steps with essential commands
The
run_demo()function properly maintains the public API while delegating to the new class-based implementation.
- Use SystemInfo type hint instead of generic object - Replace empty CX line with simple spacing
- Add _is_gpu_vendor() helper method to reduce code duplication - Use defensive getattr() for GPU attribute access - Extract GPU vendor keywords into named lists for clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
cortex/demo.py (2)
144-146: Remove unusedcommandparameter.The
commandparameter is declared but never used within the method body. Consider removing it to avoid confusion, or use it in the output if intended.♻️ Suggested fix
def _simulate_cortex_output( - self, command: str, packages: list[str], show_execution: bool = False + self, packages: list[str], show_execution: bool = False ) -> None: """Simulate real Cortex output with CX branding"""Then update callers at lines 259-261 and 430-432:
-self._simulate_cortex_output( - 'cortex install "docker nodejs"', ["docker.io", "nodejs"], show_execution=False -) +self._simulate_cortex_output(["docker.io", "nodejs"], show_execution=False)
279-300: Consider caching the uppercase model string.The expression
str(gpu_info.model).upper()is evaluated multiple times (6 times for NVIDIA check, 6 times for AMD check). While acceptable for demo code, you could cache it:model_upper = str(gpu_info.model).upper() if gpu_info else "" has_nvidia = any(kw in model_upper for kw in ("NVIDIA", "GTX", "RTX", "GEFORCE", "QUADRO", "TESLA")) has_amd = any(kw in model_upper for kw in ("AMD", "RADEON", "RENOIR", "VEGA", "NAVI", "RX "))
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide for Python code
Include type hints in Python code
Add docstrings for all public APIs in Python code
Use dry-run mode by default for all installation operations
Do not use silent sudo - require explicit user confirmation for privilege escalation
Implement Firejail sandboxing for execution of untrusted code
Log all operations to ~/.cortex/history.db for audit purposes
Files:
cortex/demo.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Test (Python 3.11)
- GitHub Check: test (3.12)
- GitHub Check: test (3.11)
- GitHub Check: test (3.10)
🔇 Additional comments (8)
cortex/demo.py (8)
1-17: LGTM!Module docstring and imports are well-organized following PEP 8 conventions (standard library, third-party, then local imports). The
SystemInfotype hint import properly supports type checking.
28-40: LGTM!Helper methods are well-implemented with proper docstrings and type hints. Good use of
secrets.token_hex()for generating cryptographically secure random IDs rather thanrandom.
42-100: LGTM!The
run()method is well-structured with:
- Clear section iteration pattern (lines 74-88)
- Proper exit codes (0 for success, 1 for interruption)
- Comprehensive error handling wrapping the entire flow
The hardware detection at line 71 appropriately defers until after user confirms they want to start.
114-142: Good fix for the empty input handling.The re-prompt loop (lines 121-133) properly addresses the reported UX bug where pressing Enter with empty input previously showed misleading output. Now it gives a clear hint and re-prompts until the user provides input.
387-446: LGTM!The smart stacks section demonstrates the feature effectively with:
- Clear stack listing using Rich Table (lines 401-412)
- Simulated full installation flow (line 430-432)
- Helpful tip about custom stack creation (lines 443-444)
448-544: LGTM!The history and safety section effectively demonstrates:
- Installation tracking with realistic table output (lines 463-499)
- Rollback flow using the same
installation_idfrom earlier stack install for continuity (line 516)- Clear messaging about the safety benefits
546-615: LGTM!The finale provides a strong conclusion with:
- Effective comparison table highlighting Cortex advantages (lines 557-574)
- Comprehensive next steps including the wizard for API key setup (line 591)
- The
run_demo()function properly maintains the existing public API while delegating to the new class-based implementation
22-26: No action needed. The union type syntaxSystemInfo | Noneis appropriate for this project. The pyproject.toml explicitly declaresrequires-python = ">=3.10", and Python 3.10 introduced PEP 604 which supports theX | Yunion syntax. This modern syntax is used consistently throughout the codebase and aligns with the project's minimum version requirement.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cortex/demo.py (1)
149-151: Unused parameter:commandThe
commandparameter is accepted but never used within the method body. Consider removing it or adding a TODO comment if it's intended for future logging/audit purposes.Option 1: Remove unused parameter
def _simulate_cortex_output( - self, command: str, packages: list[str], show_execution: bool = False + self, packages: list[str], show_execution: bool = False ) -> None:Then update call sites at lines 264-266 and 423-425.
Option 2: Keep for future use with prefix
def _simulate_cortex_output( - self, command: str, packages: list[str], show_execution: bool = False + self, _command: str, packages: list[str], show_execution: bool = False ) -> None: + # TODO: Log command to history for audit purposes
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide for Python code
Include type hints in Python code
Add docstrings for all public APIs in Python code
Use dry-run mode by default for all installation operations
Do not use silent sudo - require explicit user confirmation for privilege escalation
Implement Firejail sandboxing for execution of untrusted code
Log all operations to ~/.cortex/history.db for audit purposes
Files:
cortex/demo.py
🧬 Code graph analysis (1)
cortex/demo.py (3)
cortex/branding.py (1)
show_banner(35-46)cortex/hardware_detection.py (1)
SystemInfo(135-174)cortex/cli.py (1)
demo(271-275)
🔇 Additional comments (13)
cortex/demo.py (13)
1-17: LGTM!Module docstring and imports are well-organized following PEP 8 import ordering (standard library → third-party → local).
19-26: LGTM!The class initialization properly sets up the console, hardware info placeholder, interactive mode detection, and generates a demo installation ID. Type hints are present.
28-45: LGTM!Helper methods are well-documented with appropriate type hints. The defensive
str(model)cast in_is_gpu_vendor(line 44) is a good practice for handling potentially unexpected types.
47-105: LGTM!The
run()method is well-structured with proper error handling for user interrupts, clear section iteration, and consistent return codes. The try/except at the top level (lines 101-105) ensures graceful handling of Ctrl+C at any point.
107-117: LGTM!Good implementation with proper interrupt handling and non-interactive auto-advance support for CI environments.
119-147: Good fix for the empty input UX issue.The
while Trueloop (lines 126-138) correctly addresses the reviewer feedback about empty input. Instead of showing misleading AI output, it now re-prompts with a helpful hint message.
149-151: Add return type hint for consistency.The method is missing a return type annotation. As per coding guidelines, type hints should be included.
Suggested fix
def _simulate_cortex_output( self, command: str, packages: list[str], show_execution: bool = False - ) -> None: + ) -> None:Actually, looking again, line 151 does have
-> None:but it's being parsed as part of the previous line. The signature appears correct. Let me verify the actual structure - the return type is present but formatted across lines.Note: On closer inspection, the signature spans lines 149-151 and does include
-> None:. The formatting is acceptable per PEP 8.
149-203: LGTM!The simulated output correctly defaults to dry-run mode (line 173-177), showing the plan without execution. This aligns with the coding guideline to "use dry-run mode by default for all installation operations." The sudo commands are displayed but not executed, which is safe for a demo.
283-294: Good defensive GPU detection pattern.The use of
getattr(self.hw, "gpu", None)(line 284) and the safe list indexing pattern (line 285) prevents potentialAttributeErrororIndexError. The GPU vendor keyword extraction (lines 288-292) improves maintainability per the commit message refactoring.
380-439: LGTM!The smart stacks section effectively demonstrates the feature with a clear table display and simulated installation. The tip about custom stacks (lines 436-437) adds educational value.
441-537: LGTM!The history and safety section effectively demonstrates both features. Using the same
installation_idfrom earlier (line 509, 512) provides narrative continuity through the demo.
539-599: LGTM!The finale provides an effective summary with the comparison table and actionable next steps. The command reference (lines 584-592) gives users immediate practical guidance.
602-608: LGTM!Clean entry point that maintains backward compatibility with the existing
cortex demoCLI command while delegating to the new class-based implementation.
- Remove non-existent docs.cortex.dev URL - Remove unused command parameter from _simulate_cortex_output - Remove emoji from comparison table title
Anshgrover23
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @cortex/demo.py:
- Around line 75-76: Wrap the call to detect_hardware() in a try/except so
hardware-detection exceptions (e.g., PermissionError, OSError) are caught; on
failure set self.hw to a safe default (e.g., None) and emit a non-fatal warning
using the demo's logger (or print) so the demo doesn’t crash. Specifically,
around the detect_hardware() invocation that assigns self.hw, add exception
handlers for PermissionError and OSError (and a broad Exception fallback),
assign self.hw = None on error, and log the exception message via the class
logger (or a clear warning) so downstream code can proceed safely.
🧹 Nitpick comments (5)
cortex/demo.py (5)
22-26: Consider adding type hints for all instance attributes.For consistency with
self.hw: SystemInfo | None, consider adding explicit type hints for the other instance attributes. This improves IDE support and documentation.🔧 Suggested improvement
def __init__(self) -> None: - self.console = Console() - self.hw: SystemInfo | None = None - self.is_interactive = sys.stdin.isatty() - self.installation_id = self._generate_id() + self.console: Console = Console() + self.hw: SystemInfo | None = None + self.is_interactive: bool = sys.stdin.isatty() + self.installation_id: str = self._generate_id()
165-169: Consider dynamic package manager in simulation.The intro (line 62) promises support for "apt, brew, npm, pip..." but the simulation always shows
aptcommands. For consistency, consider detecting the actual system's primary package manager or at least mentioning this is an apt-based example.This is a minor UX polish suggestion - the current implementation works fine for demonstrating the concept.
280-281: Simplify GPU list check.The check
(gpu and len(gpu) > 0)can be simplified since a non-empty list is truthy in Python.🔧 Suggested simplification
# Detect GPU (check both dedicated and integrated) gpu = getattr(self.hw, "gpu", None) if self.hw else None - gpu_info = gpu[0] if (gpu and len(gpu) > 0) else None + gpu_info = gpu[0] if gpu else None
415-416: Minor: Redundant consecutive print calls.These two print statements could be combined for cleaner output, though this is purely stylistic.
🔧 Optional consolidation
- self.console.print(" [cyan]CX[/cyan] [green]✓[/green] ") - self.console.print("🚀 Installing stack: [bold]Web Development[/bold]\n") + self.console.print(" [cyan]CX[/cyan] [green]✓[/green] 🚀 Installing stack: [bold]Web Development[/bold]\n")
421-423: Minor: Similar redundant print calls.Same pattern as above - consecutive prints could be consolidated.
🔧 Optional consolidation
- self.console.print(" [cyan]CX[/cyan] [green]✓[/green] ") - self.console.print("[green]✅ Stack 'Web Development' installed successfully![/green]") - self.console.print("[green]Installed 4 packages[/green]\n") + self.console.print(" [cyan]CX[/cyan] [green]✓[/green] [green]✅ Stack 'Web Development' installed successfully![/green]") + self.console.print("[green]Installed 4 packages[/green]\n")
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cortex/demo.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Follow PEP 8 style guide for Python code
Include type hints in Python code
Add docstrings for all public APIs in Python code
Use dry-run mode by default for all installation operations
Do not use silent sudo - require explicit user confirmation for privilege escalation
Implement Firejail sandboxing for execution of untrusted code
Log all operations to ~/.cortex/history.db for audit purposes
Files:
cortex/demo.py
🧬 Code graph analysis (1)
cortex/demo.py (3)
cortex/branding.py (1)
show_banner(35-46)cortex/hardware_detection.py (1)
SystemInfo(135-174)cortex/cli.py (2)
status(1006-1014)demo(271-275)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Build Package
- GitHub Check: test (3.11)
- GitHub Check: test (3.10)
- GitHub Check: test (3.12)
🔇 Additional comments (5)
cortex/demo.py (5)
1-17: LGTM!Module docstring and imports are appropriate. The imports align with the functionality needed for Rich-based UI, hardware detection, and branding.
28-45: LGTM!Helper methods are well-documented with proper type hints and docstrings. The use of
secrets.token_hex()for ID generation is appropriate for demo purposes.
119-147: LGTM - Empty input bug fixed!The
while Trueloop at lines 126-138 properly re-prompts the user when empty input is provided, addressing the UX bug mentioned in the PR comments. The hint message at line 134 guides users appropriately.
533-534: Add return type hint for consistency.For consistency with other methods in the class, consider adding the
-> Nonereturn type hint.🔧 Suggested fix
- def _show_finale(self) -> None: + def _show_finale(self) -> None:Actually, line 533 already has
-> None. Disregard this comment.
595-601: LGTM!The
run_demo()entry point properly delegates to theCortexDemoclass while maintaining the same public API signature. The docstring adequately describes the function's purpose.
* feat: Complete interactive demo with 6 sections - Smart installation with transparent planning phase - Hardware-aware intelligence demonstrations - AI natural language understanding - Smart stacks workflow (list and install) - Installation history tracking - Rollback protection demonstration - Comparison table finale showing key differentiators - Clear screen between sections for better UX - ~5 minute interactive tutorial - Matches actual Cortex output with CX branding Users type real commands to build muscle memory. Accepts any input for learning (no validation friction). Closes cortexlinux#366 * style: format with ruff and black * Update demo.py * style: add trailing newline to demo.py * fix: Use secrets module for demo ID generation (SonarQube) * fix(demo): address code review feedback - Remove unused Optional import - Remove "Production Version" from docstring - Replace hardcoded dates with dynamic date generation - Replace hardcoded installation IDs with generated IDs * fix(demo): address code review feedback - Remove unused rich.progress imports (BarColumn, Progress, SpinnerColumn, TextColumn) - Add return type hints (-> None) to clear_screen() and _simulate_cortex_output() - Use gpu_info consistently instead of gpu[0] (lines 288, 316, 331) - Fix duplicate timestamps: changed second entry from (1, 13, 13) to (1, 14, 25) All issues from code review are now resolved. * fix(demo): improve empty input message to reference the command being shown * fix(demo): address code review feedback - Use SystemInfo type hint instead of generic object - Replace empty CX line with simple spacing * refactor(demo): improve GPU detection code quality - Add _is_gpu_vendor() helper method to reduce code duplication - Use defensive getattr() for GPU attribute access - Extract GPU vendor keywords into named lists for clarity * fix(demo): address additional code review feedback - Remove non-existent docs.cortex.dev URL - Remove unused command parameter from _simulate_cortex_output - Remove emoji from comparison table title --------- Co-authored-by: Ansh Grover <168731971+Anshgrover23@users.noreply.github.com>



Related Issue
Closes #366
Summary
Completely redesigned cortex demo from a 5-second hardware check into a comprehensive 5-minute interactive tutorial.
Before
After
Sections
Key Features
AI Disclosure
Used Claude Code for assistance with code review and formatting.
Checklist
type(scope): descriptionor[scope] descriptionpytest tests/)Testing
Video demonstration:
Screencast from 26-12-25 03:45:52 PM IST.webm
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.