Skip to content

feat: v0.1.65#1005

Merged
Henry-811 merged 11 commits intomainfrom
dev/v0.1.65
Mar 18, 2026
Merged

feat: v0.1.65#1005
Henry-811 merged 11 commits intomainfrom
dev/v0.1.65

Conversation

@Henry-811
Copy link
Collaborator

@Henry-811 Henry-811 commented Mar 16, 2026

PR Title Format

Your PR title must follow the format: <type>: <brief description>

Valid types:

  • fix: - Bug fixes
  • feat: - New features
  • breaking: - Breaking changes
  • docs: - Documentation updates
  • refactor: - Code refactoring
  • test: - Test additions/modifications
  • chore: - Maintenance tasks
  • perf: - Performance improvements
  • style: - Code style changes
  • ci: - CI/CD configuration changes

Examples:

  • fix: resolve memory leak in data processing
  • feat: add export to CSV functionality
  • breaking: change API response format
  • docs: update installation guide

Description

Brief description of the changes in this PR

Type of change

  • Bug fix (fix:) - Non-breaking change which fixes an issue
  • New feature (feat:) - Non-breaking change which adds functionality
  • Breaking change (breaking:) - Fix or feature that would cause existing functionality to not work as expected
  • Documentation (docs:) - Documentation updates
  • Code refactoring (refactor:) - Code changes that neither fix a bug nor add a feature
  • Tests (test:) - Adding missing tests or correcting existing tests
  • Chore (chore:) - Maintenance tasks, dependency updates, etc.
  • Performance improvement (perf:) - Code changes that improve performance
  • Code style (style:) - Changes that do not affect the meaning of the code (formatting, missing semi-colons, etc.)
  • CI/CD (ci:) - Changes to CI/CD configuration files and scripts

Checklist

  • I have run pre-commit on my changed files and all checks pass
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Pre-commit status

# Paste the output of running pre-commit on your changed files:
# uv run pre-commit install
# git diff --name-only HEAD~1 | xargs uv run pre-commit run --files # for last commit
# git diff --name-only origin/<base branch>...HEAD | xargs uv run pre-commit run --files # for all commits in PR
# git add <your file> # if any fixes were applied
# git commit -m "chore: apply pre-commit fixes"
# git push origin <branch-name>

How to Test

Add test method for this PR.

Test CLI Command

Write down the test bash command. If there is pre-requests, please emphasize.

Expected Results

Description/screenshots of expected results.

Additional context

Add any other context about the PR here.

Summary by CodeRabbit

  • New Features

    • Added standalone MCP servers: Media (generate/read), Quality (init, criteria, checklist, improvements, reset), and Workflow (submit answers, vote).
  • Tests

    • Added comprehensive unit and integration tests covering the new servers and workflows.
  • Chores

    • Bumped package version to 0.1.65 and tightened a dependency range; updated framework MCP registry.
  • Documentation

    • Updated changelog, README(s), roadmap, release notes, announcements, and contributing docs for v0.1.65.

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a4e82642-68e6-4ffd-95c9-585923d11e0a

📥 Commits

Reviewing files that changed from the base of the PR and between 11b3f84 and 71b1663.

📒 Files selected for processing (3)
  • docs/announcements/current-release.md
  • docs/announcements/feature-highlights.md
  • docs/announcements/github-release-v0.1.65.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/announcements/feature-highlights.md
  • docs/announcements/github-release-v0.1.65.md

📝 Walkthrough

Walkthrough

Adds three standalone MCP servers (media, quality, workflow) with package initializer, tests, FRAMEWORK_MCPS updates, a dependency upper bound, a version bump to 0.1.65, and documentation/release notes updates.

Changes

Cohort / File(s) Summary
Version & Changelog
CHANGELOG.md, massgen/__init__.py
Bumped package version to 0.1.65 and updated changelog contributor ordering.
Standalone MCP package init
massgen/mcp_tools/standalone/__init__.py
Added package initializer with module docstring for standalone MCP servers.
Media MCP server
massgen/mcp_tools/standalone/media_server.py
New FastMCP server exposing generate_media and read_media; lazy-imports massgen implementations, builds kwargs from non-None params, returns JSON error payloads on failures, runs mcp.run() when executed.
Quality MCP server
massgen/mcp_tools/standalone/quality_server.py
New FastMCP server exposing init_session, generate_eval_criteria, submit_checklist, propose_improvements, reset_evaluation; JSON state persistence, validation, plateau detection, history tracking.
Workflow MCP server
massgen/mcp_tools/standalone/workflow_server.py
New FastMCP server exposing new_answer and vote; session/round dir management, snapshotting deliverables, writing submission manifests, returning structured JSON.
Filesystem constants
massgen/filesystem_manager/_constants.py
Added "massgen_quality_tools", "massgen_workflow_tools", "massgen_media_tools" to FRAMEWORK_MCPS.
Tests
massgen/tests/test_standalone_mcp_servers.py
Comprehensive unit and integration tests for new servers and helpers (session management, criteria/state handling, checklist evaluation, improvements, snapshotting, voting).
Dependency pinning
pyproject.toml
Adds upper bound to claude-agent-sdk (from >=0.1.44 to >=0.1.44,<0.1.49).
Docs & Releases
README.md, README_PYPI.md, ROADMAP.md, ROADMAP_v0.1.66.md, docs/...
Updated release/version references to v0.1.65 (and roadmap bump to v0.1.66), added v0.1.65 announcement and GitHub release, and updated docs to describe the MassGen Refinery Plugin and standalone MCP servers.
Contribution guide & configs
CONTRIBUTING.md, massgen/configs/README.md
Updated development branch/version examples to target dev/v0.1.66 and refreshed try-it/release examples for v0.1.65.
Removed file
docs/announcements/github-release-v0.1.64.md
Deleted the v0.1.64 GitHub release document (replaced by v0.1.65 release doc).

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client
    participant MCP as FastMCP Server (massgen_media_tools)
    participant Impl as massgen.media implementation
    participant FS as Filesystem/Storage

    rect rgba(0,128,0,0.5)
    Client->>MCP: call generate_media(params)
    end

    rect rgba(0,0,255,0.5)
    MCP->>MCP: sanitize params, build kwargs from non-None
    MCP->>Impl: lazy-import & invoke media generate API (kwargs)
    end

    alt success
        Impl->>FS: persist outputs (if applicable)
        Impl->>MCP: return generation result (data / URLs)
        MCP->>Client: return JSON result
    else failure
        Impl->>MCP: raises Exception / ImportError
        MCP->>Client: return JSON-formatted error payload
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • ncrispino
  • a5507203
🚥 Pre-merge checks | ✅ 3 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is entirely the template with all sections empty; no actual description of changes, type selection, checklist completion, test details, or context provided by the author. Fill in all template sections: add a brief description of v0.1.65 release changes (Quality/Workflow/Media servers), select the appropriate change type, complete the checklist, provide pre-commit output, add test commands, and describe expected results.
Docstring Coverage ⚠️ Warning Docstring coverage is 31.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Documentation Updated ⚠️ Warning The three new standalone MCP servers lack Google-style docstrings on public @mcp.tool decorated functions and absence of dedicated user guide or design documentation. Add Google-style docstrings to all public functions in media_server.py, quality_server.py, and workflow_server.py. Create design documentation in docs/dev_notes/ explaining the MassGen Refinery Plugin architecture.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: v0.1.65' follows the required format and correctly identifies this as a feature release, but lacks specificity about the main change—standalone MCP servers for the Refinery Plugin.
Capabilities Registry Check ✅ Passed PR adds three MCP servers wrapping existing tools without modifying backend models or capabilities; conditional check requirements do not apply.
Config Parameter Sync ✅ Passed The PR does not introduce new YAML configuration parameters, only version updates, new MCP server implementations, and MCP server name identifiers. The conditional check requirement is not met.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/v0.1.65
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Line 46: Revert the edit to the existing "0.1.64" section so it remains
exactly as in history (do not change the line that currently reads
"**Contributors**: `@praneeth999`, `@ncrispino`, `@HenryQi`, `@db-ol` and the MassGen
team"); instead add a new top-level release section heading "## [0.1.65] -
2026-03-16" and beneath it add the required subsections (e.g., Added, Changed,
Fixed, Documentation/Configurations/Resources, Technical Details) with PR/issue
refs and file paths relevant to this release; ensure the new section follows the
same formatting style as other release entries in CHANGELOG.md and does not
alter any previous release text.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 722611fc-0bd9-4533-a0c0-d94a0d423718

📥 Commits

Reviewing files that changed from the base of the PR and between d33f9d4 and 1645bc6.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • ROADMAP_v0.1.66.md
  • massgen/__init__.py

MassGen Agent and others added 3 commits March 17, 2026 18:00
Standalone entry points in massgen/mcp_tools/standalone/ that work
without an orchestrator, for use with the massgen-refinery Claude Code plugin:

- quality_server: init_session, generate_eval_criteria (storage),
  submit_checklist (verdict logic), propose_improvements (coverage
  validation), reset_evaluation. Per-session state in .massgen-quality/
- workflow_server: new_answer (snapshots deliverables per round),
  vote (stateless passthrough)
- media_server: generate_media (image/video/audio with full param
  surface), read_media (critical-first analysis, multi-file comparison,
  continue_from for follow-ups)

31 tests covering all tools.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: Add standalone MCP servers for general use, esp for massgen-refinery plugin
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (2)
massgen/mcp_tools/standalone/media_server.py (1)

96-102: Don't override optional defaults with empty placeholders.

Lines 96-102 and 208-215 always send multimodal_config={} and task_context="", even though the wrappers say they only forward non-None values. The wrapped helpers default those arguments to None, so this can change fallback/config-loading behavior for the standalone server.

♻️ Suggested cleanup
     kwargs: dict[str, Any] = {
         "mode": mode,
         "agent_cwd": str(cwd),
         "allowed_paths": [str(cwd)],
-        "multimodal_config": {},
-        "task_context": "",
     }
@@
     kwargs: dict[str, Any] = {
         "inputs": inputs,
         "max_concurrent": max_concurrent,
         "agent_cwd": str(cwd),
         "allowed_paths": [str(cwd)],
-        "multimodal_config": {},
-        "task_context": "",
     }

Also applies to: 208-215

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@massgen/mcp_tools/standalone/media_server.py` around lines 96 - 102, The
kwargs construction in media_server.py unconditionally sets "multimodal_config"
and "task_context" to empty placeholders, overriding helper defaults; update
both places where kwargs is built (the blocks that include "mode", "agent_cwd",
"allowed_paths" — lines around the existing kwargs and the second occurrence
around lines 208-215) so that you only add the "multimodal_config" and
"task_context" keys when their values are not None (i.e., check the local
variables before inserting into kwargs), leaving them absent so the wrapped
helpers can use their own None-based defaults.
massgen/mcp_tools/standalone/__init__.py (1)

1-5: Add Google-style docstrings to the new MCP entrypoints.

The new public tools in massgen.mcp_tools.standalone currently rely on decorator descriptions alone. Please add Google-style docstrings to the new MCP entrypoints before release.

As per coding guidelines, **/*.py: For new or changed functions, include Google-style docstrings.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@massgen/mcp_tools/standalone/__init__.py` around lines 1 - 5, The new
standalone MCP entrypoints in massgen.mcp_tools.standalone lack Google-style
docstrings; update the public functions/classes exported from
massgen.mcp_tools.standalone (start in the module __init__.py and any entrypoint
functions/classes it exposes) to include Google-style docstrings that describe
purpose, parameters (Args), return values (Returns), and possible exceptions
(Raises) and an optional Example; ensure each top-level public symbol
(functions, classes, and methods intended as MCP entrypoints) has a clear
docstring following the Google style guide before merging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@massgen/mcp_tools/standalone/__init__.py`:
- Around line 1-5: Add the three standalone MCP server names to the
FRAMEWORK_MCPS frozenset so they remain registered as direct protocol tools when
enable_code_based_tools is enabled; update the FRAMEWORK_MCPS definition in
massgen/filesystem_manager/_constants.py to include "massgen_quality_tools",
"massgen_workflow_tools", and "massgen_media_tools" (reference symbol:
FRAMEWORK_MCPS) ensuring the frozenset literal contains these exact string
identifiers so they are not wrapped as filesystem execution tools.

In `@massgen/mcp_tools/standalone/quality_server.py`:
- Around line 40-56: The session_id read in _get_session_dir (from
session_metadata.json) must be sanitized and validated before being used as a
filesystem path: generate a safe slug for session_id (allow only alphanumerics,
hyphen, underscore; drop/replace other chars and forbid empty or "."/".."),
import re for the slug logic, then resolve session_dir = (quality_root /
"sessions" / safe_slug).resolve() and ensure session_dir is a descendant of
(quality_root / "sessions").resolve() — if validation fails, fall back to
"default"; apply the same slugging + resolve-and-validate logic for any code
that appends raw labels to session IDs (e.g., where label is appended in
workflow_server.py) so no input can escape the .massgen-quality/sessions root.
- Around line 29-30: DEFAULT_CUTOFF is set to 70 but submit_checklist and its
tool description use a 1-10 score scale, causing a mismatch; change
DEFAULT_CUTOFF from 70 to 7 to match the 1-10 scale and update any user-facing
text in submit_checklist (and nearby guidance strings) to clearly state scores
are 1-10, or alternatively, if you intend a 0-100 scale, update submit_checklist
docs to accept 0-100 and keep DEFAULT_CUTOFF at 70; ensure consistency between
the DEFAULT_CUTOFF constant, DEFAULT_REQUIRED_RATIO, and the submit_checklist
description so callers and agents use the same score scale.

In `@massgen/mcp_tools/standalone/workflow_server.py`:
- Around line 92-106: The current loop accepts absolute paths and ../ segments
and copies them into snapshot_dir, allowing path traversal/data exfiltration;
change it to resolve each candidate (use src.resolve(strict=False) or
Path.resolve()) and reject any path that is not inside the intended workspace
root (compare against workspace_root.resolve() or Path.cwd().resolve() with
pathlib.Path.is_relative_to or equivalent) before performing
shutil.copytree/copy2. Specifically, in the block iterating over paths (variable
names: paths, src, snapshot_dir, copied) validate src_resolved =
src.resolve(strict=False) and only proceed if
src_resolved.is_relative_to(workspace_root_resolved) (or check that
workspace_root_resolved in src_resolved.parents or equal); otherwise log a
warning and skip copying to prevent absolute/../ escapes. Ensure directories and
files are still copied with shutil.copytree/shutil.copy2 after the validation.

In `@massgen/tests/test_standalone_mcp_servers.py`:
- Around line 135-449: The async tool-flow tests
(test_init_session_creates_timestamped_dir through test_vote) are
integration-style and should be marked with `@pytest.mark.integration`; update
each test function in that block (e.g.,
test_init_session_creates_timestamped_dir, test_init_session_without_label,
test_init_session_then_tools_use_it, test_generate_eval_criteria, ...,
test_vote) to add `@pytest.mark.integration` above the function (next to
`@pytest.mark.asyncio` where present), ensure pytest is imported, and optionally
move the file into the integration test folder; also add other opt-in markers
(e.g., `@pytest.mark.live_api`, `@pytest.mark.expensive`, `@pytest.mark.docker`) where
relevant per guidelines.

---

Nitpick comments:
In `@massgen/mcp_tools/standalone/__init__.py`:
- Around line 1-5: The new standalone MCP entrypoints in
massgen.mcp_tools.standalone lack Google-style docstrings; update the public
functions/classes exported from massgen.mcp_tools.standalone (start in the
module __init__.py and any entrypoint functions/classes it exposes) to include
Google-style docstrings that describe purpose, parameters (Args), return values
(Returns), and possible exceptions (Raises) and an optional Example; ensure each
top-level public symbol (functions, classes, and methods intended as MCP
entrypoints) has a clear docstring following the Google style guide before
merging.

In `@massgen/mcp_tools/standalone/media_server.py`:
- Around line 96-102: The kwargs construction in media_server.py unconditionally
sets "multimodal_config" and "task_context" to empty placeholders, overriding
helper defaults; update both places where kwargs is built (the blocks that
include "mode", "agent_cwd", "allowed_paths" — lines around the existing kwargs
and the second occurrence around lines 208-215) so that you only add the
"multimodal_config" and "task_context" keys when their values are not None
(i.e., check the local variables before inserting into kwargs), leaving them
absent so the wrapped helpers can use their own None-based defaults.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ec8a0435-44e6-4fe2-8170-5a66f4e1bd94

📥 Commits

Reviewing files that changed from the base of the PR and between 1645bc6 and 1ae9c48.

📒 Files selected for processing (6)
  • massgen/mcp_tools/standalone/__init__.py
  • massgen/mcp_tools/standalone/media_server.py
  • massgen/mcp_tools/standalone/quality_server.py
  • massgen/mcp_tools/standalone/workflow_server.py
  • massgen/tests/test_standalone_mcp_servers.py
  • pyproject.toml

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/source/index.rst`:
- Around line 203-206: Update the v0.1.65 "MassGen Refinery Plugin" release note
to include direct links to the three standalone server implementations
referenced: the quality server, the workflow server, and the media server; edit
the "MassGen Refinery Plugin" paragraph (v0.1.65 entry) to add reStructuredText
links or reference directives pointing to each server's implementation page or
repo (e.g., "quality server", "workflow server", "media server") so readers can
click through to their respective docs/implementations, and ensure the linked
labels match the actual target document IDs or URLs used elsewhere in the docs.

In `@README_PYPI.md`:
- Around line 161-165: The release notes under "What's New in v0.1.65" currently
list MassGen Refinery Plugin and then provide bullets for Quality Server and
Workflow Server but omit a corresponding Media Server bullet; add a third bullet
matching style and tone (e.g., "- **🎞️ Media Server** - Handles media
processing, storage and snapshot generation for deliverables, integrating with
the MassGen checklist workflow.") directly alongside the Quality and Workflow
bullets so all three MCP servers (quality, workflow, media) are documented
consistently under the "What's New in v0.1.65" section.

In `@ROADMAP.md`:
- Line 7: The "Last Updated" date at the top (the line containing "**Last
Updated:** March 18, 2026") conflicts with the footer date (March 11, 2026);
update whichever is incorrect so both show the same authoritative date (either
change the top "**Last Updated:**" line or modify the footer date text) and
ensure the phrase "**Last Updated:**" is used consistently in both places to
avoid duplicate/conflicting dates.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3ef9412e-20f6-4ac8-93e2-0d9030ce8178

📥 Commits

Reviewing files that changed from the base of the PR and between 1ae9c48 and ead81d7.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • README_PYPI.md
  • ROADMAP.md
  • ROADMAP_v0.1.66.md
  • docs/announcements/archive/v0.1.64.md
  • docs/announcements/current-release.md
  • docs/announcements/feature-highlights.md
  • docs/announcements/github-release-v0.1.64.md
  • docs/announcements/github-release-v0.1.65.md
  • docs/source/index.rst
  • massgen/configs/README.md
💤 Files with no reviewable changes (1)
  • docs/announcements/github-release-v0.1.64.md
✅ Files skipped from review due to trivial changes (4)
  • docs/announcements/github-release-v0.1.65.md
  • README.md
  • CONTRIBUTING.md
  • docs/announcements/archive/v0.1.64.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
massgen/mcp_tools/standalone/workflow_server.py (1)

64-75: ⚠️ Potential issue | 🟠 Major

Persist the reserved round number before creating round_* directories.

_get_round_number() computes round + 1 but does not persist it, so repeated new_answer calls in one session can reuse the same round directory and overwrite prior artifacts.

💡 Suggested fix
-def _get_round_number(session_dir: Path) -> int:
-    """Read the current round from state.json, or default to 1."""
+def _reserve_round_number(session_dir: Path) -> int:
+    """Read, increment, and persist the round number in state.json."""
     state_path = session_dir / "state.json"
-    if state_path.exists():
-        try:
-            with open(state_path) as f:
-                state = json.load(f)
-            return state.get("round", 0) + 1
-        except (json.JSONDecodeError, OSError):
-            pass
-    return 1
+    state: dict[str, Any] = {"checklist_history": [], "last_result": None, "round": 0}
+    if state_path.exists():
+        try:
+            with open(state_path) as f:
+                loaded = json.load(f)
+            if isinstance(loaded, dict):
+                state.update(loaded)
+        except (json.JSONDecodeError, OSError):
+            pass
+    next_round = int(state.get("round", 0)) + 1
+    state["round"] = next_round
+    with open(state_path, "w") as f:
+        json.dump(state, f, indent=2)
+    return next_round
@@
-    round_num = _get_round_number(session_dir)
+    round_num = _reserve_round_number(session_dir)

Also applies to: 89-94

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@massgen/mcp_tools/standalone/workflow_server.py` around lines 64 - 75,
_get_round_number() only returns the next round number but doesn't persist it,
allowing concurrent/repeated new_answer calls to reuse the same round directory;
modify _get_round_number to compute next_round = state.get("round", 0) + 1, then
immediately write the updated {"round": next_round} back to state.json
(preferably via an atomic write: write to a temp file then os.replace) before
returning next_round, and handle JSON/file errors gracefully; also apply the
same persistence change wherever the code reserves a round (e.g., the new_answer
flow that creates round_* directories) so the reserved round is stored prior to
directory creation.
🧹 Nitpick comments (3)
massgen/mcp_tools/standalone/workflow_server.py (1)

183-196: Add Google-style docstrings to MCP tool entrypoints.

new_answer and vote are new/changed functions and should carry Google-style docstrings for consistency with repo standards.

As per coding guidelines, "**/*.py: For new or changed functions, include Google-style docstrings".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@massgen/mcp_tools/standalone/workflow_server.py` around lines 183 - 196, Add
Google-style docstrings to the MCP tool entrypoints: insert a docstring for
new_answer describing its purpose (create a new answer), parameters (answer:
str, file_paths: list[str] | None) and return value (str), and a docstring for
vote describing its purpose (cast a vote to accept the current best answer),
parameters (choice: str, reasoning: str = "") and return value (str); place the
docstrings immediately below the async def new_answer(...) and async def
vote(...) signatures, following the project's Google-style format for short
summary, Args, and Returns.
massgen/tests/test_standalone_mcp_servers.py (1)

430-479: Add a regression test for repeated new_answer calls in the same session.

Right now the suite validates a single snapshot round, but not that a second submission gets a new round directory (round_002) instead of reusing round_001. Adding that check will catch round-counter regressions early.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@massgen/tests/test_standalone_mcp_servers.py` around lines 430 - 479, Add a
regression test that calls _init_session_impl once, then invokes
_new_answer_impl twice (using the same session) and asserts the second response
has round == 2 and its round_dir path name ends with or contains "round_002" (or
otherwise differs from the first round_dir); use the existing test structure and
helpers (_init_session_impl and _new_answer_impl) and reuse the deliverable file
setup from test_new_answer_snapshots_deliverables to create files for the first
submission and optionally none for the second, then assert both submission.json
files exist in their respective round directories and that the two round_dir
values are distinct.
massgen/mcp_tools/standalone/quality_server.py (1)

458-511: Add Google-style docstrings to exported MCP tool functions.

The public tool functions are new/changed and should include docstrings (Args / Returns) to match repository standards.

As per coding guidelines, "**/*.py: For new or changed functions, include Google-style docstrings".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@massgen/mcp_tools/standalone/quality_server.py` around lines 458 - 511, Add
Google-style docstrings to each exported MCP tool function (init_session,
generate_eval_criteria, submit_checklist, propose_improvements,
reset_evaluation): for each function include a short description, an Args
section describing parameter names and types (e.g., label: str, criteria:
list[dict[str, str]], scores: dict[str, Any], report_path: str = "",
improvements: dict[str, Any], preserve: dict[str, Any] | None), and a Returns
section describing the returned str and any notable behavior; ensure docstrings
follow the repository's Google-style format and are placed immediately below
each async def declaration for the listed functions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@massgen/mcp_tools/standalone/quality_server.py`:
- Around line 101-107: The _extract_score function can raise when dict entries
contain non-numeric or None scores; update _extract_score to safely handle
strings and None by validating the obtained value before calling int(): get
value = entry.get("score"), if value is instance of (int, float) return
int(value), if value is str attempt to parse with a guarded try/except to int()
and fall back to 0 on ValueError, and for any other type (including None) return
0; ensure the same safe logic is applied for top-level numeric checks
(isinstance(entry, (int, float))) so no conversion ever raises inside
_extract_score.

In `@massgen/mcp_tools/standalone/workflow_server.py`:
- Around line 113-119: The current snapshot code uses src_resolved.name for dest
which can cause basename collisions; change the destination logic in the block
that sets dest (near variables snapshot_dir, src_resolved, dest, copied) to
preserve the source's relative path or otherwise guarantee uniqueness (for
example compute a relative path from a common base/root and use snapshot_dir /
relative_path, or fallback to a unique filename suffix/hash/UUID when the
relative path cannot be determined) before calling shutil.copytree or
shutil.copy2; ensure the updated dest is created with parents as needed and
append the final string path to copied.

---

Duplicate comments:
In `@massgen/mcp_tools/standalone/workflow_server.py`:
- Around line 64-75: _get_round_number() only returns the next round number but
doesn't persist it, allowing concurrent/repeated new_answer calls to reuse the
same round directory; modify _get_round_number to compute next_round =
state.get("round", 0) + 1, then immediately write the updated {"round":
next_round} back to state.json (preferably via an atomic write: write to a temp
file then os.replace) before returning next_round, and handle JSON/file errors
gracefully; also apply the same persistence change wherever the code reserves a
round (e.g., the new_answer flow that creates round_* directories) so the
reserved round is stored prior to directory creation.

---

Nitpick comments:
In `@massgen/mcp_tools/standalone/quality_server.py`:
- Around line 458-511: Add Google-style docstrings to each exported MCP tool
function (init_session, generate_eval_criteria, submit_checklist,
propose_improvements, reset_evaluation): for each function include a short
description, an Args section describing parameter names and types (e.g., label:
str, criteria: list[dict[str, str]], scores: dict[str, Any], report_path: str =
"", improvements: dict[str, Any], preserve: dict[str, Any] | None), and a
Returns section describing the returned str and any notable behavior; ensure
docstrings follow the repository's Google-style format and are placed
immediately below each async def declaration for the listed functions.

In `@massgen/mcp_tools/standalone/workflow_server.py`:
- Around line 183-196: Add Google-style docstrings to the MCP tool entrypoints:
insert a docstring for new_answer describing its purpose (create a new answer),
parameters (answer: str, file_paths: list[str] | None) and return value (str),
and a docstring for vote describing its purpose (cast a vote to accept the
current best answer), parameters (choice: str, reasoning: str = "") and return
value (str); place the docstrings immediately below the async def
new_answer(...) and async def vote(...) signatures, following the project's
Google-style format for short summary, Args, and Returns.

In `@massgen/tests/test_standalone_mcp_servers.py`:
- Around line 430-479: Add a regression test that calls _init_session_impl once,
then invokes _new_answer_impl twice (using the same session) and asserts the
second response has round == 2 and its round_dir path name ends with or contains
"round_002" (or otherwise differs from the first round_dir); use the existing
test structure and helpers (_init_session_impl and _new_answer_impl) and reuse
the deliverable file setup from test_new_answer_snapshots_deliverables to create
files for the first submission and optionally none for the second, then assert
both submission.json files exist in their respective round directories and that
the two round_dir values are distinct.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 15814977-876c-40ae-bf2b-51b27e1bae0b

📥 Commits

Reviewing files that changed from the base of the PR and between ead81d7 and 11b3f84.

📒 Files selected for processing (5)
  • massgen/filesystem_manager/_constants.py
  • massgen/mcp_tools/standalone/media_server.py
  • massgen/mcp_tools/standalone/quality_server.py
  • massgen/mcp_tools/standalone/workflow_server.py
  • massgen/tests/test_standalone_mcp_servers.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • massgen/mcp_tools/standalone/media_server.py

@Henry-811 Henry-811 merged commit 7a3c901 into main Mar 18, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants