Skip to content

Conversation

@LucioFranco
Copy link
Contributor

@LucioFranco LucioFranco commented Jan 31, 2026

Note

Medium Risk
Changes how runtime logs are transported and surfaced in the CLI (including prod/dev UI suppression), which could affect log visibility or formatting across Python/TypeScript runners.

Overview
CLI/runtime logging is reworked to use structured stderr logs instead of an HTTP management endpoint. The /logs route and the CliMessage JSON payload are removed, and cliLog in both py-moose-lib and ts-moose-lib now writes __moose_structured_log__ JSON (with cli_action/cli_message_type, plus new Warning support) directly to stderr.

Child-process stderr handling is centralized and made prod-aware. apps/framework-cli extends parse_structured_log/process_stderr_lines to recognize CLI-style structured logs and route them to terminal UI in dev while always emitting them to tracing; is_prod is threaded through streaming, consumption APIs, and workflow worker spawns to suppress terminal UI in production.

Written by Cursor Bugbot for commit 5e5edc9. This will update automatically on new commits. Configure here.

Created using jj-spr 0.1.0
@linear
Copy link

linear bot commented Jan 31, 2026

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-v2 Ready Ready Preview, Comment Feb 3, 2026 6:45pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

Summary by CodeRabbit

  • Refactoring

    • CLI logging now emits structured JSON to stderr instead of sending logs over HTTP.
    • Logging behavior distinguishes production vs. development modes (affects which CLI messages are shown).
    • Removed the POST /logs endpoint.
  • New Features

    • Added a WARNING message type for CLI logs.
    • CLI logs now include action and message-type metadata for clearer display and routing.

Walkthrough

Replaces HTTP-based CLI logging with structured JSON emitted to stderr, adds CLI-specific structured fields and an is_prod flag to logger APIs to gate dev-only terminal rendering, removes local /logs HTTP route and TypeScript CliMessage, and threads is_prod through Python/TypeScript start/run callsites.

Changes

Cohort / File(s) Summary
CLI wiring & logger
apps/framework-cli/src/cli.rs, apps/framework-cli/src/cli/logger.rs
Whitespace tweak in cli.rs; StructuredLogData gains cli_action and cli_message_type; parse_structured_log extracts them; process_stderr_lines and spawn_stderr_structured_logger_with_ui add is_prod: bool to control dev-only terminal rendering while always forwarding to tracing.
Local webserver & TS bin
apps/framework-cli/src/cli/local_webserver.rs, apps/framework-cli/src/framework/typescript/bin.rs
Removed log_route and POST /logs; deleted TypeScript CliMessage type and related imports.
Runner & worker callsites
apps/framework-cli/src/framework/typescript/consumption.rs, .../scripts_worker.rs, .../streaming.rs, apps/framework-cli/src/framework/python/consumption.rs, .../streaming.rs, .../scripts_worker.rs
Added is_prod: bool to public run/start signatures and passed it into structured-stderr logger setup; streaming run gained extra optional params where applicable.
Process registries / orchestration
apps/framework-cli/src/infrastructure/processes/consumption_registry.rs, .../functions_registry.rs, .../orchestration_workers_registry.rs
Updated callsites to pass project.is_production into language run/start_worker functions to match new arity.
Client libraries (Py/TS)
packages/py-moose-lib/moose_lib/commons.py, packages/ts-moose-lib/src/commons.ts
Replaced HTTP POST CLI logging with writing structured JSON to stderr (__moose_structured_log__, level, message, resource_type, cli_action, cli_message_type, timestamp); added "Warning" message_type; Python adds cli_log helper and moose_management_port env var.
TypeScript framework bin removal
apps/framework-cli/src/framework/typescript/bin.rs
Removed public CliMessage struct and related serde::Deserialize import.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client Lib (Py/TS)
    participant Stderr as Process Stderr
    participant Logger as CLI Logger
    participant Trace as Tracing System
    participant Terminal as Terminal (Dev)

    Client->>Stderr: write structured JSON log (includes cli_action, cli_message_type)
    Stderr->>Logger: stream stderr line
    Logger->>Logger: parse structured log (level, cli_action, cli_message_type)
    alt is_prod == false
        Logger->>Terminal: render CLI message (dev-only)
        Terminal-->>Logger: rendered
    end
    Logger->>Trace: emit tracing log at mapped severity
    Trace-->>Logger: acknowledged
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • phiSgr
  • jmsuzuki

Poem

Stderr now whispers JSON, crisp and bright,
Dev screens show chatter, prod keeps out of sight,
Actions and types tagged on every line,
Tracing keeps watch while terminals shine,
Logs step forward, timestamped and tight. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly identifies the main change: updating cliLog to use structured logging instead of HTTP, matching the core PR objective.
Description check ✅ Passed Description details the shift from HTTP logging to structured stderr logs, removal of /logs route, and is_prod threading through runners.
Linked Issues check ✅ Passed Changes implement ENG-2074 requirement: cliLog now routes via structured logging (stderr JSON) instead of HTTP, with cli_action/cli_message_type fields.
Out of Scope Changes check ✅ Passed All changes directly support cliLog structured logging migration. Addition of is_prod parameter threading and removal of log_route/CliMessage are justified by the core objective.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch spr/LucioFranco/eng-2074-update-clilog-to-use-structured-logging

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@blacksmith-sh

This comment has been minimized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In `@apps/framework-cli/src/cli/logger.rs`:
- Around line 105-112: Add unit tests for the public helpers init_prod_mode and
is_prod: create tests that set the global IS_PROD via init_prod_mode(true) and
init_prod_mode(false) and assert is_prod() returns the expected boolean; include
tests that call init_prod_mode twice to verify the "Ignore if already set"
behavior (e.g., set true then attempt to set false and confirm is_prod() remains
true), and ensure tests run in isolation (reset or spawn a new thread/process if
needed to avoid global state leakage).

In `@packages/py-moose-lib/moose_lib/commons.py`:
- Around line 36-48: The current code writes log.message verbatim into
structured_log and emits it via sys.stderr.write, which can leak secrets/PII;
fix by sanitizing or gating that field before building structured_log: create or
call a sanitizer (e.g., redact_sensitive(message) or sanitize_cli_message) and
assign the sanitized value to the log message field (replace log.message in
structured_log with sanitized_message), or enforce a safe-logging flag on the
log object (e.g., log.allow_sensitive) and only include the raw text when
allowed else use a redacted placeholder; ensure
sys.stderr.write(json.dumps(structured_log)...) uses the sanitized/gated value
and add unit tests covering messages with secrets and the gating behavior.
- Around line 29-34: The cli_log function uses a string literal "Warning" and
the CliLogData type lacks a WARNING constant and matching Literal, causing type
mismatch; add a WARNING constant to CliLogData (alongside ERROR/INFO), update
its Literal/type annotation to include WARNING, and change cli_log to compare
against CliLogData.WARNING (and/or use the defined constants) so callers and
type checkers can use the warning level consistently.
- Around line 29-48: Add a new documentation page in the docs content explaining
the public API cli_log() and the CliLogData class: describe that cli_log emits
structured JSON to stderr with the __moose_structured_log__ marker, list and
describe all fields present in the structured_log (level, message,
resource_type, cli_action, cli_message_type, timestamp), document the
mapping/logic used to compute level (cli_log and CliLogData message_type
constants like ERROR/INFO/Warning), show a minimal example of the JSON output
and a short usage snippet calling cli_log(CliLogData(...)), and note that
timestamps are UTC ISO format and logs are written to stderr (flush behavior).

In `@packages/ts-moose-lib/src/commons.ts`:
- Around line 87-112: Add documentation entries for the public CLI logging API
by describing the exported type CliLogData and the function cliLog: state the
allowed message_type values (Info, Success, Warning, Error, Highlight), explain
each field in CliLogData (action, message, optional message_type), document the
structured log schema emitted by cliLog (fields __moose_structured_log__,
log_kind, level, message, resource_type, cli_action, cli_message_type,
timestamp) and note that cliLog writes JSON lines to stderr; update
apps/framework-docs-v2/content with these details and an example JSON line
showing the stderr output format and mapping from message_type to level.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b6f1e12 and 49aed29.

📒 Files selected for processing (6)
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/local_webserver.rs
  • apps/framework-cli/src/cli/logger.rs
  • apps/framework-cli/src/framework/typescript/bin.rs
  • packages/py-moose-lib/moose_lib/commons.py
  • packages/ts-moose-lib/src/commons.ts
💤 Files with no reviewable changes (1)
  • apps/framework-cli/src/cli/local_webserver.rs
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run linting checks before submitting PRs for TypeScript/JavaScript code

**/*.{ts,tsx,js,jsx}: Group imports by external dependencies, internal modules, and types; use named exports from barrel files (index.ts)
Use camelCase for variables and functions, PascalCase for types/classes/components, UPPER_SNAKE_CASE for constants in TypeScript/JavaScript
Prefix unused variables with underscore (e.g., _unusedParam) to bypass linting errors in TypeScript/JavaScript

Files:

  • packages/ts-moose-lib/src/commons.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Prefer interfaces for objects, types for unions/intersections; use explicit return types on public APIs in TypeScript

Files:

  • packages/ts-moose-lib/src/commons.ts
**/ts-moose-lib/src/**/*.ts

⚙️ CodeRabbit configuration file

**/ts-moose-lib/src/**/*.ts: When reviewing changes to typescript moose lib:

  1. Check if any public apis were changed (class, method, type, config, etc).
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content.
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • packages/ts-moose-lib/src/commons.ts
**/*.rs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run cargo clippy to ensure Rust code passes Clippy's linting standards before each commit

**/*.rs: Use thiserror with #[derive(thiserror::Error)] for error handling in Rust; define errors near the fallibility unit with NO global Error type
NEVER use anyhow::Result in Rust; define custom error types instead
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants in constants.rs at the appropriate module level in Rust
Use tuple structs with validation constructors as newtypes in Rust (e.g., struct UserId(String))
Write inline tests with #[cfg(test)] modules in Rust
Documentation is required for all public APIs in Rust

Files:

  • apps/framework-cli/src/framework/typescript/bin.rs
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/logger.rs
apps/framework-cli/**/*.rs

📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)

apps/framework-cli/**/*.rs: Always run cargo clippy --all-targets -- -D warnings before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Use rustfmt --edition 2021 for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Use thiserror crate instead of anyhow::Result for error handling
Define errors near their unit of fallibility (no global Error types)
Use #[derive(thiserror::Error)] with #[error()] messages for error definitions
Define newtypes as tuple structs: struct UserId(u64);
Add validation constructors for newtypes: UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes: #[derive(Debug, Clone, PartialEq)]
Implement From/TryFrom for newtype conversions
Use derive_more or nutype to reduce newtype boilerplate
Use const for static values (prefer over static)
Use UPPER_SNAKE_CASE naming for constants
Scope constant visibility with preference: pub(crate) > pub(super) > pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases

Files:

  • apps/framework-cli/src/framework/typescript/bin.rs
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/logger.rs
**/framework-cli/src/**

⚙️ CodeRabbit configuration file

**/framework-cli/src/**: When reviewing changes to Moose CLI:

  1. Check if any user-facing changes were made (commands, flags, configs, apis, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • apps/framework-cli/src/framework/typescript/bin.rs
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/logger.rs
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Follow PEP 8 style guidelines; use snake_case for functions and variables, PascalCase for classes, UPPER_SNAKE_CASE for constants in Python
Format Python code using Black with line-length 88
Use type hints for function signatures and public APIs in Python

Files:

  • packages/py-moose-lib/moose_lib/commons.py
**/py-moose-lib/moose_lib/**/*.py

⚙️ CodeRabbit configuration file

**/py-moose-lib/moose_lib/**/*.py: When reviewing changes to python moose lib:

  1. Check if any public apis were changed (class, method, type, config, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • packages/py-moose-lib/moose_lib/commons.py
🧠 Learnings (13)
📚 Learning: 2026-01-28T14:50:11.465Z
Learnt from: cjus
Repo: 514-labs/moosestack PR: 3407
File: apps/framework-docs-v2/content/guides/static-report-generation.mdx:1402-1406
Timestamp: 2026-01-28T14:50:11.465Z
Learning: Moose WebApp handlers are Node.js-only server-side code that runs in the backend runtime, never in browsers. When reviewing WebApp implementations, Node.js-specific types like `Buffer` are appropriate and don't need cross-platform browser compatibility considerations.

Applied to files:

  • packages/ts-moose-lib/src/commons.ts
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Document all public APIs and breaking changes

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Derive standard traits for newtypes: `#[derive(Debug, Clone, PartialEq)]`

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `derive_more` or `nutype` to reduce newtype boilerplate

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `#[derive(thiserror::Error)]` with `#[error()]` messages for error definitions

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Always run `cargo clippy --all-targets -- -D warnings` before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Write meaningful names for functions, variables, and types

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Define newtypes as tuple structs: `struct UserId(u64);`

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Group related constants together

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `rustfmt --edition 2021` for consistent formatting

Applied to files:

  • apps/framework-cli/src/framework/typescript/bin.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/constants.rs : Place constants in `constants.rs` at deepest common module level

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Scope constant visibility with preference: `pub(crate)` > `pub(super)` > `pub`

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-01-20T15:49:26.025Z
Learnt from: 514Ben
Repo: 514-labs/moosestack PR: 3150
File: packages/py-moose-lib/moose_lib/dmv2/materialized_view.py:35-35
Timestamp: 2026-01-20T15:49:26.025Z
Learning: In the Python moose library (packages/py-moose-lib), prefer typing.Union[X, Y] syntax over PEP 604's X | Y for type annotations. Use Union when you want to explicitly convey a union in the type system, especially if readability or tooling friendliness (e.g., older type checkers) is a consideration. Reserve X | Y for simple, modern type hints where you want concise syntax and are sure the project’s type checker version supports PEP 604 without issues.

Applied to files:

  • packages/py-moose-lib/moose_lib/commons.py
🧬 Code graph analysis (2)
apps/framework-cli/src/cli.rs (1)
apps/framework-cli/src/cli/logger.rs (1)
  • init_prod_mode (106-108)
packages/py-moose-lib/moose_lib/commons.py (1)
packages/ts-moose-lib/src/commons.ts (1)
  • CliLogData (87-91)
🪛 GitHub Check: CodeQL
packages/py-moose-lib/moose_lib/commons.py

[failure] 47-47: Clear-text logging of sensitive information
This expression logs sensitive data (private) as clear text.

⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Test E2E Python Default Template (Python 3.13)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 24, npm)
  • GitHub Check: Test E2E Python Tests Template (Python 3.12)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 22, npm)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 20, npm)
  • GitHub Check: Test E2E Python Tests Template (Python 3.13)
  • GitHub Check: Test E2E Python Default Template (Python 3.12)
  • GitHub Check: Build CLI Binaries (darwin-arm64, macos-14-large, aarch64-apple-darwin)
🔇 Additional comments (5)
apps/framework-cli/src/framework/typescript/bin.rs (1)

1-1: LGTM: import cleanup after CliMessage removal.

apps/framework-cli/src/cli.rs (2)

999-1001: LGTM: prod command now syncs logger mode.


696-698: Calling init_prod_mode is internal startup wiring, not a user-facing change.

The init_prod_mode function is already documented with a doc comment ("Initializes the production mode flag. Should be called once at CLI startup."). This change wires it correctly in dev/prod branches—it's internal CLI logic, not a user-facing command, flag, or config change. Per coding guidelines, documentation updates apply to user-facing changes; this does not qualify.

apps/framework-cli/src/cli/logger.rs (2)

807-811: LGTM: CLI log fields are plumbed through parsing.

Also applies to: 890-904


951-985: LGTM: dev‑mode UI display + tracing for CLI logs.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Created using jj-spr 0.1.0
@blacksmith-sh

This comment has been minimized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/py-moose-lib/moose_lib/commons.py (1)

65-71: ⚠️ Potential issue | 🟡 Minor

CodeQL flags this code path too (line 67).

Same clear-text logging concern applies here. The message parameter flows through unsanitized to moose_scripts_logger.info(), .error(), and .warning(). If the mitigation from the prior review comment (redaction helper) is adopted for cli_log, apply it consistently here.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 49aed29 and ad6e28e.

📒 Files selected for processing (1)
  • packages/py-moose-lib/moose_lib/commons.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Follow PEP 8 style guidelines; use snake_case for functions and variables, PascalCase for classes, UPPER_SNAKE_CASE for constants in Python
Format Python code using Black with line-length 88
Use type hints for function signatures and public APIs in Python

Files:

  • packages/py-moose-lib/moose_lib/commons.py
**/py-moose-lib/moose_lib/**/*.py

⚙️ CodeRabbit configuration file

**/py-moose-lib/moose_lib/**/*.py: When reviewing changes to python moose lib:

  1. Check if any public apis were changed (class, method, type, config, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • packages/py-moose-lib/moose_lib/commons.py
🧠 Learnings (2)
📚 Learning: 2026-01-20T15:49:26.025Z
Learnt from: 514Ben
Repo: 514-labs/moosestack PR: 3150
File: packages/py-moose-lib/moose_lib/dmv2/materialized_view.py:35-35
Timestamp: 2026-01-20T15:49:26.025Z
Learning: In the Python moose library (packages/py-moose-lib), prefer typing.Union[X, Y] syntax over PEP 604's X | Y for type annotations. Use Union when you want to explicitly convey a union in the type system, especially if readability or tooling friendliness (e.g., older type checkers) is a consideration. Reserve X | Y for simple, modern type hints where you want concise syntax and are sure the project’s type checker version supports PEP 604 without issues.

Applied to files:

  • packages/py-moose-lib/moose_lib/commons.py
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Document public APIs and complex logic in code

Applied to files:

  • packages/py-moose-lib/moose_lib/commons.py
🪛 GitHub Check: CodeQL
packages/py-moose-lib/moose_lib/commons.py

[failure] 67-67: Clear-text logging of sensitive information
This expression logs sensitive data (private) as clear text.

⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 22, npm)
  • GitHub Check: Test E2E Python Tests Template (Python 3.12)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 20, npm)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 24, npm)
  • GitHub Check: Test E2E Python Tests Template (Python 3.13)
🔇 Additional comments (1)
packages/py-moose-lib/moose_lib/commons.py (1)

6-6: LGTM. Necessary import for stderr writes.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Created using jj-spr 0.1.0
Created using jj-spr 0.1.0
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI agents
In `@apps/framework-cli/src/cli/logger.rs`:
- Around line 960-975: Update the CLI docs in apps/framework-docs-v2/content to
describe the new stderr structured logging behavior and the production-mode
suppression: document that when is_prod() is true the terminal display via
show_message! is suppressed, that messages are always routed to tracing with
structured logs emitted for crate::cli::display::MessageType
(Error/Warning/Info), and include examples of the new stderr format and guidance
for users on how to enable dev-mode output for debugging.
- Around line 948-978: Add a unit/integration test that exercises the cli_action
branch: construct a LogData with cli_action set and cli_message_type (e.g.,
"Info" or "Error") and call the code path that processes logs, ensuring
ui_callback is not invoked and any callback containers remain empty; to avoid
noisy terminal output set is_prod to true (or mock/stub is_prod to return true)
so the dev-only show_message! path is suppressed, and assert tracing/log output
mapping (MessageType -> error/warn/info) if desired. Use the unique identifiers
cli_action, cli_message_type, crate::cli::display::MessageType, show_message!,
is_prod, and ui_callback to locate the branch and wire the test around that
flow.

In `@packages/py-moose-lib/moose_lib/commons.py`:
- Around line 7-27: Ruff is flagging the use of Callable from typing and the
missing return annotation for CliLogData.__init__; update the imports to import
Callable from collections.abc (remove Callable from typing imports) and add an
explicit "-> None" return type to the CliLogData.__init__ signature to satisfy
the linter (locate the import line and the __init__ method in class CliLogData).
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e2c479e and 5643756.

📒 Files selected for processing (3)
  • apps/framework-cli/src/cli/logger.rs
  • packages/py-moose-lib/moose_lib/commons.py
  • packages/ts-moose-lib/src/commons.ts
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run linting checks before submitting PRs for TypeScript/JavaScript code

**/*.{ts,tsx,js,jsx}: Group imports by external dependencies, internal modules, and types; use named exports from barrel files (index.ts)
Use camelCase for variables and functions, PascalCase for types/classes/components, UPPER_SNAKE_CASE for constants in TypeScript/JavaScript
Prefix unused variables with underscore (e.g., _unusedParam) to bypass linting errors in TypeScript/JavaScript
Format TypeScript/JavaScript code with Prettier using experimentalTernaries: true; auto-formats on commit via Husky + lint-staged

Files:

  • packages/ts-moose-lib/src/commons.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Prefer interfaces for objects, types for unions/intersections in TypeScript; explicit return types on public APIs

Files:

  • packages/ts-moose-lib/src/commons.ts
**/ts-moose-lib/src/**/*.ts

⚙️ CodeRabbit configuration file

**/ts-moose-lib/src/**/*.ts: When reviewing changes to typescript moose lib:

  1. Check if any public apis were changed (class, method, type, config, etc).
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content.
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • packages/ts-moose-lib/src/commons.ts
**/*.rs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run cargo clippy to ensure Rust code passes Clippy's linting standards before each commit

**/*.rs: Use thiserror with #[derive(thiserror::Error)] for error handling in Rust; define errors near the fallibility unit, never use anyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants in constants.rs at the appropriate module level in Rust
Use tuple structs with validation constructors (newtypes) for Rust type safety (e.g., struct UserId(String))
Write inline tests with #[cfg(test)] modules in Rust
Documentation is required for all public APIs in Rust
Run cargo clippy --all-targets -- -D warnings before committing Rust code; no warnings allowed

Files:

  • apps/framework-cli/src/cli/logger.rs
apps/framework-cli/**/*.rs

📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)

apps/framework-cli/**/*.rs: Always run cargo clippy --all-targets -- -D warnings before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Use rustfmt --edition 2021 for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Use thiserror crate instead of anyhow::Result for error handling
Define errors near their unit of fallibility (no global Error types)
Use #[derive(thiserror::Error)] with #[error()] messages for error definitions
Define newtypes as tuple structs: struct UserId(u64);
Add validation constructors for newtypes: UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes: #[derive(Debug, Clone, PartialEq)]
Implement From/TryFrom for newtype conversions
Use derive_more or nutype to reduce newtype boilerplate
Use const for static values (prefer over static)
Use UPPER_SNAKE_CASE naming for constants
Scope constant visibility with preference: pub(crate) > pub(super) > pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases

Files:

  • apps/framework-cli/src/cli/logger.rs
**/framework-cli/src/**

⚙️ CodeRabbit configuration file

**/framework-cli/src/**: When reviewing changes to Moose CLI:

  1. Check if any user-facing changes were made (commands, flags, configs, apis, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • apps/framework-cli/src/cli/logger.rs
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Follow PEP 8 style guide in Python; use snake_case for functions/variables, PascalCase for classes, UPPER_SNAKE_CASE for constants
Format Python code with Black using line-length 88; auto-formats on commit via Husky + lint-staged
Use type hints for function signatures and public APIs in Python

Files:

  • packages/py-moose-lib/moose_lib/commons.py
**/py-moose-lib/moose_lib/**/*.py

⚙️ CodeRabbit configuration file

**/py-moose-lib/moose_lib/**/*.py: When reviewing changes to python moose lib:

  1. Check if any public apis were changed (class, method, type, config, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • packages/py-moose-lib/moose_lib/commons.py
🧠 Learnings (17)
📓 Common learnings
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Document all public APIs and breaking changes

Applied to files:

  • packages/ts-moose-lib/src/commons.ts
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Document public APIs and complex logic in code

Applied to files:

  • packages/ts-moose-lib/src/commons.ts
  • packages/py-moose-lib/moose_lib/commons.py
📚 Learning: 2026-01-28T14:50:11.465Z
Learnt from: cjus
Repo: 514-labs/moosestack PR: 3407
File: apps/framework-docs-v2/content/guides/static-report-generation.mdx:1402-1406
Timestamp: 2026-01-28T14:50:11.465Z
Learning: Moose WebApp handlers are Node.js-only server-side code that runs in the backend runtime, never in browsers. When reviewing WebApp implementations, Node.js-specific types like `Buffer` are appropriate and don't need cross-platform browser compatibility considerations.

Applied to files:

  • packages/ts-moose-lib/src/commons.ts
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Always run `cargo clippy --all-targets -- -D warnings` before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Scope constant visibility with preference: `pub(crate)` > `pub(super)` > `pub`

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Group related constants together

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `rustfmt --edition 2021` for consistent formatting

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/constants.rs : Place constants in `constants.rs` at deepest common module level

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Write unit tests for all public functions

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Test error conditions and edge cases

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Applies to **/*.rs : Write inline tests with `#[cfg(test)]` modules in Rust

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Write tests for new functionality

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/tests/**/*.rs : Use integration tests for CLI commands

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Ensure all tests pass: `cargo test` for Rust components and appropriate test commands for TS/JS

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-01-20T15:49:26.025Z
Learnt from: 514Ben
Repo: 514-labs/moosestack PR: 3150
File: packages/py-moose-lib/moose_lib/dmv2/materialized_view.py:35-35
Timestamp: 2026-01-20T15:49:26.025Z
Learning: In the Python moose library (packages/py-moose-lib), prefer typing.Union[X, Y] syntax over PEP 604's X | Y for type annotations. Use Union when you want to explicitly convey a union in the type system, especially if readability or tooling friendliness (e.g., older type checkers) is a consideration. Reserve X | Y for simple, modern type hints where you want concise syntax and are sure the project’s type checker version supports PEP 604 without issues.

Applied to files:

  • packages/py-moose-lib/moose_lib/commons.py
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Audit documentation when changing user-facing features

Applied to files:

  • packages/py-moose-lib/moose_lib/commons.py
🧬 Code graph analysis (2)
packages/ts-moose-lib/src/commons.ts (2)
packages/py-moose-lib/moose_lib/streaming/streaming_function_runner.py (1)
  • log (270-272)
packages/py-moose-lib/moose_lib/commons.py (1)
  • CliLogData (14-31)
packages/py-moose-lib/moose_lib/commons.py (1)
packages/py-moose-lib/moose_lib/streaming/streaming_function_runner.py (1)
  • log (270-272)
🪛 Ruff (0.14.14)
packages/py-moose-lib/moose_lib/commons.py

[warning] 7-7: Import from collections.abc instead: Callable

Import from collections.abc

(UP035)


[warning] 21-21: Missing return type annotation for special method __init__

Add return type annotation: None

(ANN204)

🔇 Additional comments (4)
apps/framework-cli/src/cli/logger.rs (2)

807-809: CLI metadata fields look good.
Optional cli_action / cli_message_type are aligned with the structured log format.


888-897: Parsing CLI metadata is consistent.
Optional extraction is safe and keeps non-CLI structured logs unaffected.

packages/py-moose-lib/moose_lib/commons.py (2)

11-11: OK to cache MOOSE_MANAGEMENT_PORT at import.
No concerns with reading the env var once here.


70-71: OK to map SUCCESS to info for the stdlib logger.
The fallback keeps behavior consistent without a custom success level.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@LucioFranco LucioFranco requested review from a team and callicles February 2, 2026 21:03
Created using jj-spr 0.1.0
Copy link
Collaborator

@callicles callicles left a comment

Choose a reason for hiding this comment

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

LGTM

Created using jj-spr 0.1.0
@blacksmith-sh

This comment has been minimized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 `@apps/framework-cli/src/cli/logger.rs`:
- Around line 792-794: Add Rust doc comments for the two public struct fields so
they meet the public API documentation requirement: above cli_action document
that it is an optional display label for the CLI describing the action
(examples: "Received", "DeadLetter") and above cli_message_type document that it
is an optional message severity/type label (allowed values: "Info", "Success",
"Warning", "Error", "Highlight") and how it affects rendering; update the
comments near the fields named cli_action and cli_message_type in the struct in
logger.rs to be concise, use /// doc comment style, and include expected
values/examples.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5643756 and 8a877a3.

📒 Files selected for processing (8)
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/logger.rs
  • apps/framework-cli/src/framework/typescript/consumption.rs
  • apps/framework-cli/src/framework/typescript/scripts_worker.rs
  • apps/framework-cli/src/framework/typescript/streaming.rs
  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
  • apps/framework-cli/src/infrastructure/processes/functions_registry.rs
  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run cargo clippy to ensure Rust code passes Clippy's linting standards before each commit

**/*.rs: Use thiserror with #[derive(thiserror::Error)] for error handling in Rust; define errors near the fallibility unit, never use anyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants in constants.rs at the appropriate module level in Rust
Use tuple structs with validation constructors (newtypes) for Rust type safety (e.g., struct UserId(String))
Write inline tests with #[cfg(test)] modules in Rust
Documentation is required for all public APIs in Rust
Run cargo clippy --all-targets -- -D warnings before committing Rust code; no warnings allowed

Files:

  • apps/framework-cli/src/framework/typescript/scripts_worker.rs
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/framework/typescript/consumption.rs
  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
  • apps/framework-cli/src/framework/typescript/streaming.rs
  • apps/framework-cli/src/infrastructure/processes/functions_registry.rs
  • apps/framework-cli/src/cli/logger.rs
  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
apps/framework-cli/**/*.rs

📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)

apps/framework-cli/**/*.rs: Always run cargo clippy --all-targets -- -D warnings before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Use rustfmt --edition 2021 for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Use thiserror crate instead of anyhow::Result for error handling
Define errors near their unit of fallibility (no global Error types)
Use #[derive(thiserror::Error)] with #[error()] messages for error definitions
Define newtypes as tuple structs: struct UserId(u64);
Add validation constructors for newtypes: UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes: #[derive(Debug, Clone, PartialEq)]
Implement From/TryFrom for newtype conversions
Use derive_more or nutype to reduce newtype boilerplate
Use const for static values (prefer over static)
Use UPPER_SNAKE_CASE naming for constants
Scope constant visibility with preference: pub(crate) > pub(super) > pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases

Files:

  • apps/framework-cli/src/framework/typescript/scripts_worker.rs
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/framework/typescript/consumption.rs
  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
  • apps/framework-cli/src/framework/typescript/streaming.rs
  • apps/framework-cli/src/infrastructure/processes/functions_registry.rs
  • apps/framework-cli/src/cli/logger.rs
  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
**/framework-cli/src/**

⚙️ CodeRabbit configuration file

**/framework-cli/src/**: When reviewing changes to Moose CLI:

  1. Check if any user-facing changes were made (commands, flags, configs, apis, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • apps/framework-cli/src/framework/typescript/scripts_worker.rs
  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/framework/typescript/consumption.rs
  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
  • apps/framework-cli/src/framework/typescript/streaming.rs
  • apps/framework-cli/src/infrastructure/processes/functions_registry.rs
  • apps/framework-cli/src/cli/logger.rs
  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
🧠 Learnings (16)
📓 Common learnings
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.
📚 Learning: 2026-01-26T01:14:58.758Z
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/execute.rs:141-146
Timestamp: 2026-01-26T01:14:58.758Z
Learning: In apps/framework-cli/src/infrastructure/orchestration/workflows.rs, workflow scheduling failures should be non-fatal. The workflows::execute_changes function should return () and log errors rather than returning Result and propagating failures. Failing to schedule a workflow is not a reason to fail the deploy.

Applied to files:

  • apps/framework-cli/src/framework/typescript/scripts_worker.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Document all public APIs and breaking changes

Applied to files:

  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/framework/typescript/consumption.rs
  • apps/framework-cli/src/framework/typescript/streaming.rs
  • apps/framework-cli/src/infrastructure/processes/functions_registry.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Always run `cargo clippy --all-targets -- -D warnings` before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)

Applied to files:

  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/framework/typescript/consumption.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `rustfmt --edition 2021` for consistent formatting

Applied to files:

  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Test error conditions and edge cases

Applied to files:

  • apps/framework-cli/src/cli.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-01-26T00:56:27.011Z
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.

Applied to files:

  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Write meaningful names for functions, variables, and types

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Write unit tests for all public functions

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Applies to **/*.rs : Write inline tests with `#[cfg(test)]` modules in Rust

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Write tests for new functionality

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/tests/**/*.rs : Use integration tests for CLI commands

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Ensure all tests pass: `cargo test` for Rust components and appropriate test commands for TS/JS

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Applies to **/*.rs : Documentation is required for all public APIs in Rust

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Audit documentation when changing user-facing features

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Always run end-to-end tests when changing MooseStack functionality

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
🧬 Code graph analysis (2)
apps/framework-cli/src/framework/typescript/scripts_worker.rs (2)
apps/framework-cli/src/framework/python/wrappers/scripts/python_worker_wrapper/worker.py (1)
  • start_worker (113-190)
apps/framework-cli/src/framework/python/scripts_worker.rs (1)
  • start_worker (21-139)
apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs (1)
apps/framework-cli/src/framework/typescript/scripts_worker.rs (1)
  • start_worker (21-108)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: changes
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (11)
apps/framework-cli/src/cli/logger.rs (2)

1280-1405: LGTM on test updates.

Tests correctly pass is_prod: false to process_stderr_lines, maintaining existing coverage for non-CLI structured logs.


946-951: show_message! macro is properly available. The macro is defined in message_display.rs and automatically exported via the #[macro_use] attribute on pub mod message_display in display/mod.rs (line 73). This is the standard Rust pattern for re-exporting macros and requires no explicit pub use entry. No import issue exists.

apps/framework-cli/src/framework/typescript/consumption.rs (1)

20-27: LGTM.

Signature correctly extended with is_prod parameter, threaded to the structured logger.

apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs (1)

86-97: LGTM.

TypeScript worker correctly receives project.is_production. The Python/TS asymmetry is consistent with the consumption registry pattern (addressed in that file's review).

apps/framework-cli/src/infrastructure/processes/functions_registry.rs (2)

97-109: LGTM.

is_production correctly threaded to TypeScript streaming function runner.


151-163: LGTM.

Second call site mirrors the first—consistent is_production propagation.

apps/framework-cli/src/framework/typescript/scripts_worker.rs (2)

21-21: LGTM.

Signature updated; is_prod correctly propagated to stderr logger.


98-105: LGTM.

Stderr handler now receives is_prod for production-mode gating.

apps/framework-cli/src/framework/typescript/streaming.rs (2)

15-25: LGTM.

#[allow(clippy::too_many_arguments)] is appropriate for 8 parameters. is_prod correctly added and propagated.


93-100: LGTM.

is_prod passed to structured logger, completing the production-mode gating chain.

apps/framework-cli/src/infrastructure/processes/consumption_registry.rs (1)

75-91: Add is_production parameter to Python consumption runner.

TypeScript's consumption::run accepts is_prod: bool (line 27 of typescript/consumption.rs), but Python's does not. Passing project.is_production to TypeScript (line 88) but not Python creates inconsistent production-mode behavior between languages.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Created using jj-spr 0.1.0
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/framework-cli/src/framework/python/consumption.rs (1)

16-22: ⚠️ Potential issue | 🟡 Minor

Add rustdoc for the new public parameter (is_prod).

Line 16-22: This is a public API signature change; document is_prod behavior and note the breaking change for callers.

Proposed diff
+/// Runs the Python consumption API runner.
+///
+/// `is_prod` controls whether structured stderr logs are rendered to the UI
+/// (disabled in production).
 pub fn run(
     project: &Project,
     clickhouse_config: &ClickHouseConfig,
     jwt_config: &Option<JwtConfig>,
     proxy_port: Option<u16>,
     is_prod: bool,
 ) -> Result<Child, ConsumptionError> {

As per coding guidelines: Document all public APIs and breaking changes.

apps/framework-cli/src/infrastructure/processes/consumption_registry.rs (1)

77-95: ⚠️ Potential issue | 🟠 Major

Add documentation for consumption API production-mode logging behavior.

Passing project.is_production to consumption runners gates whether subprocess logs display in the terminal (dev: shown, prod: hidden). Per coding guidelines, when user-facing feature documentation doesn't exist, it should be added. Create consumption API docs in apps/framework-docs-v2/content/moosestack/apis/ documenting this behavior and other consumption API features.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8a877a3 and da4d567.

📒 Files selected for processing (2)
  • apps/framework-cli/src/framework/python/consumption.rs
  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run cargo clippy to ensure Rust code passes Clippy's linting standards before each commit

**/*.rs: Use thiserror with #[derive(thiserror::Error)] for error handling in Rust; define errors near the fallibility unit, never use anyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants in constants.rs at the appropriate module level in Rust
Use tuple structs with validation constructors (newtypes) for Rust type safety (e.g., struct UserId(String))
Write inline tests with #[cfg(test)] modules in Rust
Documentation is required for all public APIs in Rust
Run cargo clippy --all-targets -- -D warnings before committing Rust code; no warnings allowed

Files:

  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
  • apps/framework-cli/src/framework/python/consumption.rs
apps/framework-cli/**/*.rs

📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)

apps/framework-cli/**/*.rs: Always run cargo clippy --all-targets -- -D warnings before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Use rustfmt --edition 2021 for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Use thiserror crate instead of anyhow::Result for error handling
Define errors near their unit of fallibility (no global Error types)
Use #[derive(thiserror::Error)] with #[error()] messages for error definitions
Define newtypes as tuple structs: struct UserId(u64);
Add validation constructors for newtypes: UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes: #[derive(Debug, Clone, PartialEq)]
Implement From/TryFrom for newtype conversions
Use derive_more or nutype to reduce newtype boilerplate
Use const for static values (prefer over static)
Use UPPER_SNAKE_CASE naming for constants
Scope constant visibility with preference: pub(crate) > pub(super) > pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases

Files:

  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
  • apps/framework-cli/src/framework/python/consumption.rs
**/framework-cli/src/**

⚙️ CodeRabbit configuration file

**/framework-cli/src/**: When reviewing changes to Moose CLI:

  1. Check if any user-facing changes were made (commands, flags, configs, apis, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
  • apps/framework-cli/src/framework/python/consumption.rs
🧠 Learnings (2)
📓 Common learnings
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Document all public APIs and breaking changes

Applied to files:

  • apps/framework-cli/src/infrastructure/processes/consumption_registry.rs
  • apps/framework-cli/src/framework/python/consumption.rs
🧬 Code graph analysis (2)
apps/framework-cli/src/infrastructure/processes/consumption_registry.rs (2)
apps/framework-cli/src/framework/python/consumption.rs (1)
  • run (16-132)
apps/framework-cli/src/framework/typescript/consumption.rs (1)
  • run (20-131)
apps/framework-cli/src/framework/python/consumption.rs (1)
apps/framework-cli/src/cli/logger.rs (1)
  • spawn_stderr_structured_logger_with_ui (1042-1064)
🔇 Additional comments (1)
apps/framework-cli/src/infrastructure/processes/consumption_registry.rs (1)

77-95: Verify rustfmt and clippy compliance by running the required checks locally.

This file is in apps/framework-cli/**/*.rs. Before merging, confirm:

  • cargo fmt --all -- --check passes
  • cargo clippy --all-targets -- -D warnings passes with zero warnings

The sandbox environment cannot execute these verification commands; manual inspection alone is insufficient to confirm strict linting compliance.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Created using jj-spr 0.1.0
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 `@apps/framework-cli/src/cli/logger.rs`:
- Around line 878-881: The code reads cli_message_type from log_entry into
cli_message_type but doesn’t normalize case, causing the subsequent match on
exact strings ("Error", "Warning", etc.) to misclassify values like "error";
update the extraction to normalize (e.g., map(|s| s.to_ascii_lowercase()) or
call .to_ascii_lowercase() when mapping into the variable) and then change the
match for cli_message_type to compare against the normalized lowercase tokens
("error", "warning", "info", "debug") (or perform a case-insensitive compare) so
that the match in the cli logging handling correctly maps all case variants to
the intended log levels.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between da4d567 and d6a43d2.

📒 Files selected for processing (2)
  • apps/framework-cli/src/cli/logger.rs
  • packages/py-moose-lib/moose_lib/commons.py
🧰 Additional context used
📓 Path-based instructions (5)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Follow PEP 8 style guide in Python; use snake_case for functions/variables, PascalCase for classes, UPPER_SNAKE_CASE for constants
Format Python code with Black using line-length 88; auto-formats on commit via Husky + lint-staged
Use type hints for function signatures and public APIs in Python

Files:

  • packages/py-moose-lib/moose_lib/commons.py
**/py-moose-lib/moose_lib/**/*.py

⚙️ CodeRabbit configuration file

**/py-moose-lib/moose_lib/**/*.py: When reviewing changes to python moose lib:

  1. Check if any public apis were changed (class, method, type, config, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • packages/py-moose-lib/moose_lib/commons.py
**/*.rs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run cargo clippy to ensure Rust code passes Clippy's linting standards before each commit

**/*.rs: Use thiserror with #[derive(thiserror::Error)] for error handling in Rust; define errors near the fallibility unit, never use anyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants in constants.rs at the appropriate module level in Rust
Use tuple structs with validation constructors (newtypes) for Rust type safety (e.g., struct UserId(String))
Write inline tests with #[cfg(test)] modules in Rust
Documentation is required for all public APIs in Rust
Run cargo clippy --all-targets -- -D warnings before committing Rust code; no warnings allowed

Files:

  • apps/framework-cli/src/cli/logger.rs
apps/framework-cli/**/*.rs

📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)

apps/framework-cli/**/*.rs: Always run cargo clippy --all-targets -- -D warnings before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Use rustfmt --edition 2021 for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Use thiserror crate instead of anyhow::Result for error handling
Define errors near their unit of fallibility (no global Error types)
Use #[derive(thiserror::Error)] with #[error()] messages for error definitions
Define newtypes as tuple structs: struct UserId(u64);
Add validation constructors for newtypes: UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes: #[derive(Debug, Clone, PartialEq)]
Implement From/TryFrom for newtype conversions
Use derive_more or nutype to reduce newtype boilerplate
Use const for static values (prefer over static)
Use UPPER_SNAKE_CASE naming for constants
Scope constant visibility with preference: pub(crate) > pub(super) > pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases

Files:

  • apps/framework-cli/src/cli/logger.rs
**/framework-cli/src/**

⚙️ CodeRabbit configuration file

**/framework-cli/src/**: When reviewing changes to Moose CLI:

  1. Check if any user-facing changes were made (commands, flags, configs, apis, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • apps/framework-cli/src/cli/logger.rs
🧠 Learnings (17)
📓 Common learnings
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.
📚 Learning: 2026-01-20T15:49:26.025Z
Learnt from: 514Ben
Repo: 514-labs/moosestack PR: 3150
File: packages/py-moose-lib/moose_lib/dmv2/materialized_view.py:35-35
Timestamp: 2026-01-20T15:49:26.025Z
Learning: In the Python moose library (packages/py-moose-lib), prefer typing.Union[X, Y] syntax over PEP 604's X | Y for type annotations. Use Union when you want to explicitly convey a union in the type system, especially if readability or tooling friendliness (e.g., older type checkers) is a consideration. Reserve X | Y for simple, modern type hints where you want concise syntax and are sure the project’s type checker version supports PEP 604 without issues.

Applied to files:

  • packages/py-moose-lib/moose_lib/commons.py
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Document public APIs and complex logic in code

Applied to files:

  • packages/py-moose-lib/moose_lib/commons.py
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Audit documentation when changing user-facing features

Applied to files:

  • packages/py-moose-lib/moose_lib/commons.py
  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Document all public APIs and breaking changes

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Test error conditions and edge cases

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Write meaningful names for functions, variables, and types

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Always run `cargo clippy --all-targets -- -D warnings` before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Write unit tests for all public functions

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Applies to **/*.rs : Write inline tests with `#[cfg(test)]` modules in Rust

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Write tests for new functionality

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/tests/**/*.rs : Use integration tests for CLI commands

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Ensure all tests pass: `cargo test` for Rust components and appropriate test commands for TS/JS

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-01-26T00:56:27.011Z
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `rustfmt --edition 2021` for consistent formatting

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Applies to **/*.rs : Documentation is required for all public APIs in Rust

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Always run end-to-end tests when changing MooseStack functionality

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
🧬 Code graph analysis (1)
packages/py-moose-lib/moose_lib/commons.py (1)
packages/ts-moose-lib/src/commons.ts (1)
  • CliLogData (87-91)
🪛 Ruff (0.14.14)
packages/py-moose-lib/moose_lib/commons.py

[warning] 7-7: Import from collections.abc instead: Callable

Import from collections.abc

(UP035)


[warning] 21-21: Missing return type annotation for special method __init__

Add return type annotation: None

(ANN204)

🔇 Additional comments (3)
apps/framework-cli/src/cli/logger.rs (3)

935-965: CLI log routing logic is sound.

Clean separation: terminal display for dev mode, tracing for all modes. The cli_action presence check is a reasonable discriminator.

Past reviews already noted test coverage and docs updates needed for this path.


1045-1067: LGTM.

is_prod parameter correctly threaded through to process_stderr_lines. Documentation updated.


1274-1408: Tests correctly updated with is_prod: false.

Existing test cases properly pass the new parameter. CLI log path coverage was flagged in a previous review.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Created using jj-spr 0.1.0
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/framework-cli/src/cli/logger.rs (1)

975-1003: ⚠️ Potential issue | 🟠 Major

is_prod doesn’t suppress UI callbacks on error paths.
ui_callback still fires for structured errors and plain stderr, so production can still emit terminal/UI output despite the is_prod contract. Gate the callback when is_prod is true.

Suggested fix
                 "error" => {
                     tracing::error!("{}", log_data.message);
-                    if let Some(action) = ui_action {
-                        ui_callback(
-                            crate::cli::display::MessageType::Error,
-                            crate::cli::display::Message {
-                                action: action.to_string(),
-                                details: log_data.message.clone(),
-                            },
-                        );
-                    }
+                    if !is_prod {
+                        if let Some(action) = ui_action {
+                            ui_callback(
+                                crate::cli::display::MessageType::Error,
+                                crate::cli::display::Message {
+                                    action: action.to_string(),
+                                    details: log_data.message.clone(),
+                                },
+                            );
+                        }
+                    }
                 }
@@
-        if let Some(action) = ui_action {
-            ui_callback(
-                crate::cli::display::MessageType::Error,
-                crate::cli::display::Message {
-                    action: action.to_string(),
-                    details: line.to_string(),
-                },
-            );
-        }
+        if !is_prod {
+            if let Some(action) = ui_action {
+                ui_callback(
+                    crate::cli::display::MessageType::Error,
+                    crate::cli::display::Message {
+                        action: action.to_string(),
+                        details: line.to_string(),
+                    },
+                );
+            }
+        }
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d6a43d2 and 8b3050c.

📒 Files selected for processing (1)
  • apps/framework-cli/src/cli/logger.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run cargo clippy to ensure Rust code passes Clippy's linting standards before each commit

**/*.rs: Use thiserror with #[derive(thiserror::Error)] for error handling in Rust; define errors near the fallibility unit, never use anyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants in constants.rs at the appropriate module level in Rust
Use tuple structs with validation constructors (newtypes) for Rust type safety (e.g., struct UserId(String))
Write inline tests with #[cfg(test)] modules in Rust
Documentation is required for all public APIs in Rust
Run cargo clippy --all-targets -- -D warnings before committing Rust code; no warnings allowed

Files:

  • apps/framework-cli/src/cli/logger.rs
apps/framework-cli/**/*.rs

📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)

apps/framework-cli/**/*.rs: Always run cargo clippy --all-targets -- -D warnings before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Use rustfmt --edition 2021 for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Use thiserror crate instead of anyhow::Result for error handling
Define errors near their unit of fallibility (no global Error types)
Use #[derive(thiserror::Error)] with #[error()] messages for error definitions
Define newtypes as tuple structs: struct UserId(u64);
Add validation constructors for newtypes: UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes: #[derive(Debug, Clone, PartialEq)]
Implement From/TryFrom for newtype conversions
Use derive_more or nutype to reduce newtype boilerplate
Use const for static values (prefer over static)
Use UPPER_SNAKE_CASE naming for constants
Scope constant visibility with preference: pub(crate) > pub(super) > pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases

Files:

  • apps/framework-cli/src/cli/logger.rs
**/framework-cli/src/**

⚙️ CodeRabbit configuration file

**/framework-cli/src/**: When reviewing changes to Moose CLI:

  1. Check if any user-facing changes were made (commands, flags, configs, apis, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • apps/framework-cli/src/cli/logger.rs
🧠 Learnings (15)
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Document all public APIs and breaking changes

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Test error conditions and edge cases

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Write meaningful names for functions, variables, and types

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `rustfmt --edition 2021` for consistent formatting

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Derive standard traits for newtypes: `#[derive(Debug, Clone, PartialEq)]`

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Always run `cargo clippy --all-targets -- -D warnings` before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/*.rs : Write unit tests for all public functions

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Applies to **/*.rs : Write inline tests with `#[cfg(test)]` modules in Rust

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Write tests for new functionality

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:09:10.917Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2025-12-16T23:09:10.917Z
Learning: Applies to apps/framework-cli/**/tests/**/*.rs : Use integration tests for CLI commands

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2025-12-16T23:08:31.521Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T23:08:31.521Z
Learning: Ensure all tests pass: `cargo test` for Rust components and appropriate test commands for TS/JS

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-01-26T00:56:27.011Z
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Applies to **/*.rs : Documentation is required for all public APIs in Rust

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Audit documentation when changing user-facing features

Applied to files:

  • apps/framework-cli/src/cli/logger.rs
📚 Learning: 2026-02-01T23:07:12.348Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T23:07:12.348Z
Learning: Always run end-to-end tests when changing MooseStack functionality

Applied to files:

  • apps/framework-cli/src/cli/logger.rs

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Created using jj-spr 0.1.0
Created using jj-spr 0.1.0
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Created using jj-spr 0.1.0
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 `@apps/framework-cli/src/framework/python/scripts_worker.rs`:
- Line 21: Add a rustdoc comment for the public function start_worker(project:
&Project, is_prod: bool) -> Result<Child, WorkerProcessError> that documents the
semantics of the is_prod parameter: state that is_prod == true signifies
production mode (suppress dev-only UI rendering/features) and is_prod == false
enables development-only UI/behaviors, describe any side effects callers should
expect (e.g., logs, spawned processes, feature gates), and mention the return
types Project and WorkerProcessError where relevant so callers understand the
behavior contract and errors they may need to handle.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c97a45f and 5e5edc9.

📒 Files selected for processing (2)
  • apps/framework-cli/src/framework/python/scripts_worker.rs
  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run cargo clippy to ensure Rust code passes Clippy's linting standards before each commit

**/*.rs: Use thiserror with #[derive(thiserror::Error)] for error handling in Rust; define errors near the fallibility unit, never use anyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants in constants.rs at the appropriate module level in Rust
Use tuple structs with validation constructors (newtypes) for Rust type safety (e.g., struct UserId(String))
Write inline tests with #[cfg(test)] modules in Rust
Documentation is required for all public APIs in Rust
Run cargo clippy --all-targets -- -D warnings before committing Rust code; no warnings allowed

Files:

  • apps/framework-cli/src/framework/python/scripts_worker.rs
  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
apps/framework-cli/**/*.rs

📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)

apps/framework-cli/**/*.rs: Always run cargo clippy --all-targets -- -D warnings before commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Use rustfmt --edition 2021 for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Use thiserror crate instead of anyhow::Result for error handling
Define errors near their unit of fallibility (no global Error types)
Use #[derive(thiserror::Error)] with #[error()] messages for error definitions
Define newtypes as tuple structs: struct UserId(u64);
Add validation constructors for newtypes: UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes: #[derive(Debug, Clone, PartialEq)]
Implement From/TryFrom for newtype conversions
Use derive_more or nutype to reduce newtype boilerplate
Use const for static values (prefer over static)
Use UPPER_SNAKE_CASE naming for constants
Scope constant visibility with preference: pub(crate) > pub(super) > pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases

Files:

  • apps/framework-cli/src/framework/python/scripts_worker.rs
  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
**/framework-cli/src/**

⚙️ CodeRabbit configuration file

**/framework-cli/src/**: When reviewing changes to Moose CLI:

  1. Check if any user-facing changes were made (commands, flags, configs, apis, etc)
  2. If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
  3. If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
  4. In addition to reviewing for docs discrepancies, you should also review the code as per usual guidelines.

Files:

  • apps/framework-cli/src/framework/python/scripts_worker.rs
  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
🧠 Learnings (2)
📓 Common learnings
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.
📚 Learning: 2026-01-26T00:56:27.011Z
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.

Applied to files:

  • apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
🧬 Code graph analysis (1)
apps/framework-cli/src/framework/python/scripts_worker.rs (1)
apps/framework-cli/src/framework/typescript/scripts_worker.rs (1)
  • start_worker (21-108)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 20, npm)
  • GitHub Check: Test E2E Python Tests Template (Python 3.12)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 24, npm)
  • GitHub Check: Test E2E TypeScript Tests Template (Node 22, npm)
  • GitHub Check: Test E2E Python Tests Template (Python 3.13)
🔇 Additional comments (3)
apps/framework-cli/src/framework/python/scripts_worker.rs (2)

21-21: Confirm clippy + rustfmt were run for this Rust change.

Please run cargo clippy --all-targets -- -D warnings and rustfmt --edition 2021 (or confirm CI enforces) before merge.

As per coding guidelines: Always run cargo clippy --all-targets -- -D warnings before commits and use rustfmt --edition 2021.


124-131: No documentation updates required for this change.

The structured logging configuration is already documented in metrics.mdx (environment variables: MOOSE_LOGGER__LEVEL, MOOSE_LOGGER__STDOUT, MOOSE_LOGGER__FORMAT). This change standardizes internal worker stderr handling using a centralized helper; it doesn't alter user-facing CLI behavior. No /logs endpoint documentation exists.

apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs (1)

89-95: Good propagation of project.is_production into worker startup.

This keeps child-process logging behavior consistent with the environment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@LucioFranco LucioFranco added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit b9e7167 Feb 3, 2026
59 checks passed
@LucioFranco LucioFranco deleted the spr/LucioFranco/eng-2074-update-clilog-to-use-structured-logging branch February 3, 2026 19:22
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.

3 participants