-
Notifications
You must be signed in to change notification settings - Fork 26
ENG-2074: update cliLog to use structured logging #3425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENG-2074: update cliLog to use structured logging #3425
Conversation
Created using jj-spr 0.1.0
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary by CodeRabbit
WalkthroughReplaces 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 Changes
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
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. Comment |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 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.
📒 Files selected for processing (6)
apps/framework-cli/src/cli.rsapps/framework-cli/src/cli/local_webserver.rsapps/framework-cli/src/cli/logger.rsapps/framework-cli/src/framework/typescript/bin.rspackages/py-moose-lib/moose_lib/commons.pypackages/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:
- Check if any public apis were changed (class, method, type, config, etc).
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content.
- 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.
- 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 clippyto ensure Rust code passes Clippy's linting standards before each commit
**/*.rs: Usethiserrorwith#[derive(thiserror::Error)]for error handling in Rust; define errors near the fallibility unit with NO globalErrortype
NEVER useanyhow::Resultin 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 inconstants.rsat 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.rsapps/framework-cli/src/cli.rsapps/framework-cli/src/cli/logger.rs
apps/framework-cli/**/*.rs
📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)
apps/framework-cli/**/*.rs: Always runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Usethiserrorcrate instead ofanyhow::Resultfor 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)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypeto reduce newtype boilerplate
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming 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.rsapps/framework-cli/src/cli.rsapps/framework-cli/src/cli/logger.rs
**/framework-cli/src/**
⚙️ CodeRabbit configuration file
**/framework-cli/src/**: When reviewing changes to Moose CLI:
- Check if any user-facing changes were made (commands, flags, configs, apis, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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.rsapps/framework-cli/src/cli.rsapps/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:
- Check if any public apis were changed (class, method, type, config, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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.rsapps/framework-cli/src/cli.rsapps/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.rsapps/framework-cli/src/cli.rsapps/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.rsapps/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.rsapps/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.rsapps/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: Callinginit_prod_modeis internal startup wiring, not a user-facing change.The
init_prod_modefunction 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.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
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 | 🟡 MinorCodeQL flags this code path too (line 67).
Same clear-text logging concern applies here. The
messageparameter flows through unsanitized tomoose_scripts_logger.info(),.error(), and.warning(). If the mitigation from the prior review comment (redaction helper) is adopted forcli_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.
📒 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:
- Check if any public apis were changed (class, method, type, config, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🤖 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.
📒 Files selected for processing (3)
apps/framework-cli/src/cli/logger.rspackages/py-moose-lib/moose_lib/commons.pypackages/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 usingexperimentalTernaries: 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:
- Check if any public apis were changed (class, method, type, config, etc).
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content.
- 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.
- 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 clippyto ensure Rust code passes Clippy's linting standards before each commit
**/*.rs: Usethiserrorwith#[derive(thiserror::Error)]for error handling in Rust; define errors near the fallibility unit, never useanyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants inconstants.rsat 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
Runcargo clippy --all-targets -- -D warningsbefore 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 runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Usethiserrorcrate instead ofanyhow::Resultfor 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)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypeto reduce newtype boilerplate
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming 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:
- Check if any user-facing changes were made (commands, flags, configs, apis, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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:
- Check if any public apis were changed (class, method, type, config, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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.tsapps/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.tspackages/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.
callicles
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Created using jj-spr 0.1.0
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@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.
📒 Files selected for processing (8)
apps/framework-cli/src/cli.rsapps/framework-cli/src/cli/logger.rsapps/framework-cli/src/framework/typescript/consumption.rsapps/framework-cli/src/framework/typescript/scripts_worker.rsapps/framework-cli/src/framework/typescript/streaming.rsapps/framework-cli/src/infrastructure/processes/consumption_registry.rsapps/framework-cli/src/infrastructure/processes/functions_registry.rsapps/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 clippyto ensure Rust code passes Clippy's linting standards before each commit
**/*.rs: Usethiserrorwith#[derive(thiserror::Error)]for error handling in Rust; define errors near the fallibility unit, never useanyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants inconstants.rsat 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
Runcargo clippy --all-targets -- -D warningsbefore committing Rust code; no warnings allowed
Files:
apps/framework-cli/src/framework/typescript/scripts_worker.rsapps/framework-cli/src/cli.rsapps/framework-cli/src/framework/typescript/consumption.rsapps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rsapps/framework-cli/src/framework/typescript/streaming.rsapps/framework-cli/src/infrastructure/processes/functions_registry.rsapps/framework-cli/src/cli/logger.rsapps/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 runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Usethiserrorcrate instead ofanyhow::Resultfor 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)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypeto reduce newtype boilerplate
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming 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.rsapps/framework-cli/src/cli.rsapps/framework-cli/src/framework/typescript/consumption.rsapps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rsapps/framework-cli/src/framework/typescript/streaming.rsapps/framework-cli/src/infrastructure/processes/functions_registry.rsapps/framework-cli/src/cli/logger.rsapps/framework-cli/src/infrastructure/processes/consumption_registry.rs
**/framework-cli/src/**
⚙️ CodeRabbit configuration file
**/framework-cli/src/**: When reviewing changes to Moose CLI:
- Check if any user-facing changes were made (commands, flags, configs, apis, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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.rsapps/framework-cli/src/cli.rsapps/framework-cli/src/framework/typescript/consumption.rsapps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rsapps/framework-cli/src/framework/typescript/streaming.rsapps/framework-cli/src/infrastructure/processes/functions_registry.rsapps/framework-cli/src/cli/logger.rsapps/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.rsapps/framework-cli/src/framework/typescript/consumption.rsapps/framework-cli/src/framework/typescript/streaming.rsapps/framework-cli/src/infrastructure/processes/functions_registry.rsapps/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.rsapps/framework-cli/src/framework/typescript/consumption.rsapps/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.rsapps/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.rsapps/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.rsapps/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: falsetoprocess_stderr_lines, maintaining existing coverage for non-CLI structured logs.
946-951:show_message!macro is properly available. The macro is defined inmessage_display.rsand automatically exported via the#[macro_use]attribute onpub mod message_displayindisplay/mod.rs(line 73). This is the standard Rust pattern for re-exporting macros and requires no explicitpub useentry. No import issue exists.apps/framework-cli/src/framework/typescript/consumption.rs (1)
20-27: LGTM.Signature correctly extended with
is_prodparameter, 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_productioncorrectly threaded to TypeScript streaming function runner.
151-163: LGTM.Second call site mirrors the first—consistent
is_productionpropagation.apps/framework-cli/src/framework/typescript/scripts_worker.rs (2)
21-21: LGTM.Signature updated;
is_prodcorrectly propagated to stderr logger.
98-105: LGTM.Stderr handler now receives
is_prodfor 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_prodcorrectly added and propagated.
93-100: LGTM.
is_prodpassed to structured logger, completing the production-mode gating chain.apps/framework-cli/src/infrastructure/processes/consumption_registry.rs (1)
75-91: Addis_productionparameter to Python consumption runner.TypeScript's
consumption::runacceptsis_prod: bool(line 27 of typescript/consumption.rs), but Python's does not. Passingproject.is_productionto 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
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 | 🟡 MinorAdd rustdoc for the new public parameter (
is_prod).Line 16-22: This is a public API signature change; document
is_prodbehavior 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 | 🟠 MajorAdd documentation for consumption API production-mode logging behavior.
Passing
project.is_productionto 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 inapps/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.
📒 Files selected for processing (2)
apps/framework-cli/src/framework/python/consumption.rsapps/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 clippyto ensure Rust code passes Clippy's linting standards before each commit
**/*.rs: Usethiserrorwith#[derive(thiserror::Error)]for error handling in Rust; define errors near the fallibility unit, never useanyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants inconstants.rsat 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
Runcargo clippy --all-targets -- -D warningsbefore committing Rust code; no warnings allowed
Files:
apps/framework-cli/src/infrastructure/processes/consumption_registry.rsapps/framework-cli/src/framework/python/consumption.rs
apps/framework-cli/**/*.rs
📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)
apps/framework-cli/**/*.rs: Always runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Usethiserrorcrate instead ofanyhow::Resultfor 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)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypeto reduce newtype boilerplate
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming 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.rsapps/framework-cli/src/framework/python/consumption.rs
**/framework-cli/src/**
⚙️ CodeRabbit configuration file
**/framework-cli/src/**: When reviewing changes to Moose CLI:
- Check if any user-facing changes were made (commands, flags, configs, apis, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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.rsapps/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.rsapps/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 -- --checkpassescargo clippy --all-targets -- -D warningspasses with zero warningsThe 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@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.
📒 Files selected for processing (2)
apps/framework-cli/src/cli/logger.rspackages/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:
- Check if any public apis were changed (class, method, type, config, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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 clippyto ensure Rust code passes Clippy's linting standards before each commit
**/*.rs: Usethiserrorwith#[derive(thiserror::Error)]for error handling in Rust; define errors near the fallibility unit, never useanyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants inconstants.rsat 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
Runcargo clippy --all-targets -- -D warningsbefore 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 runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Usethiserrorcrate instead ofanyhow::Resultfor 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)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypeto reduce newtype boilerplate
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming 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:
- Check if any user-facing changes were made (commands, flags, configs, apis, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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.pyapps/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_actionpresence check is a reasonable discriminator.Past reviews already noted test coverage and docs updates needed for this path.
1045-1067: LGTM.
is_prodparameter correctly threaded through toprocess_stderr_lines. Documentation updated.
1274-1408: Tests correctly updated withis_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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
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_proddoesn’t suppress UI callbacks on error paths.
ui_callbackstill fires for structured errors and plain stderr, so production can still emit terminal/UI output despite theis_prodcontract. Gate the callback whenis_prodis 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.
📒 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 clippyto ensure Rust code passes Clippy's linting standards before each commit
**/*.rs: Usethiserrorwith#[derive(thiserror::Error)]for error handling in Rust; define errors near the fallibility unit, never useanyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants inconstants.rsat 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
Runcargo clippy --all-targets -- -D warningsbefore 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 runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Usethiserrorcrate instead ofanyhow::Resultfor 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)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypeto reduce newtype boilerplate
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming 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:
- Check if any user-facing changes were made (commands, flags, configs, apis, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
Show resolved
Hide resolved
Created using jj-spr 0.1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@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.
📒 Files selected for processing (2)
apps/framework-cli/src/framework/python/scripts_worker.rsapps/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 clippyto ensure Rust code passes Clippy's linting standards before each commit
**/*.rs: Usethiserrorwith#[derive(thiserror::Error)]for error handling in Rust; define errors near the fallibility unit, never useanyhow::Result
Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants in Rust
Place constants inconstants.rsat 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
Runcargo clippy --all-targets -- -D warningsbefore committing Rust code; no warnings allowed
Files:
apps/framework-cli/src/framework/python/scripts_worker.rsapps/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 runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Write meaningful names for functions, variables, and types
Document all public APIs and breaking changes
Usethiserrorcrate instead ofanyhow::Resultfor 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)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypeto reduce newtype boilerplate
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming 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.rsapps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs
**/framework-cli/src/**
⚙️ CodeRabbit configuration file
**/framework-cli/src/**: When reviewing changes to Moose CLI:
- Check if any user-facing changes were made (commands, flags, configs, apis, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- 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.
- 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.rsapps/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 warningsandrustfmt --edition 2021(or confirm CI enforces) before merge.As per coding guidelines: Always run
cargo clippy --all-targets -- -D warningsbefore commits and userustfmt --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/logsendpoint documentation exists.apps/framework-cli/src/infrastructure/processes/orchestration_workers_registry.rs (1)
89-95: Good propagation ofproject.is_productioninto 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.
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
/logsroute and theCliMessageJSON payload are removed, andcliLogin bothpy-moose-libandts-moose-libnow writes__moose_structured_log__JSON (withcli_action/cli_message_type, plus newWarningsupport) directly to stderr.Child-process stderr handling is centralized and made prod-aware.
apps/framework-cliextendsparse_structured_log/process_stderr_linesto recognize CLI-style structured logs and route them to terminal UI in dev while always emitting them totracing;is_prodis 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.