Skip to content

Conversation

@QuiltSimon
Copy link
Contributor

@QuiltSimon QuiltSimon commented Sep 29, 2025

Overview

Implements automatic generation of README.md and quilt_summarize.json files for all Quilt packages, addressing user requirements that:

  • README contents should be added as actual files in the package (not package metadata)
  • Every package should include a quilt_summarize.json file containing at least the README and, if relevant, visualizations

Changes

New Module: readme_generator.py

  • generate_package_readme() - Creates comprehensive markdown README with:
    • Package name, description, and metadata
    • File contents listing (with smart organization support)
    • Usage examples with Python code
    • License, citation, and provenance information
  • generate_quilt_summarize() - Creates JSON summary with:
    • Package summary and full README content
    • Complete metadata structure
    • Placeholder for future visualizations

Updated: QuiltService.create_package_revision()

Added three new optional parameters:

  • include_readme: bool = True - Automatically generate and include README.md
  • readme_content: Optional[str] = None - Provide custom README content
  • include_quilt_summary: bool = True - Automatically generate quilt_summarize.json

Testing

  • ✅ 10 new BDD tests in test_package_readme_generation.py
  • ✅ All 268 unit tests pass
  • ✅ 91% code coverage for readme_generator.py
  • ✅ 82% code coverage maintained for quilt_service.py
  • ✅ TDD workflow followed (Red → Green)
  • ✅ All linting checks passed

Implementation Details

Default Behavior:

  • README.md and quilt_summarize.json are automatically added to every package
  • Files are actual package entries (using pkg.set()), NOT S3 metadata
  • Generation happens before package push

Configurable:

  • Can disable README generation: include_readme=False
  • Can provide custom README: readme_content="# My README..."
  • Can disable quilt_summarize.json: include_quilt_summary=False

Backward Compatible:

  • All parameters are optional with sensible defaults
  • No breaking changes to existing API
  • Existing packages and tools continue to work unchanged

Impact on Package Creation Tools

All package creation tools that use QuiltService.create_package_revision() now automatically benefit from this feature:

  • package_create()
  • package_create_enhanced()
  • create_package_enhanced()
  • package_create_from_s3()
  • create_package() (unified tool)

Example Usage

Default (automatic generation):

result = service.create_package_revision(
    package_name="user/dataset",
    s3_uris=["s3://bucket/data.csv"],
    metadata={"description": "My dataset"}
)
# Package includes: data.csv, README.md, quilt_summarize.json

Custom README:

result = service.create_package_revision(
    package_name="user/dataset",
    s3_uris=["s3://bucket/data.csv"],
    readme_content="# Custom README\n\nMy documentation..."
)

Disable generation:

result = service.create_package_revision(
    package_name="user/dataset",
    s3_uris=["s3://bucket/data.csv"],
    include_readme=False,
    include_quilt_summary=False
)

Verification Checklist

  • All tests pass (268/268)
  • Code coverage maintained (91% for new code)
  • Linting passes
  • No breaking changes
  • TDD workflow followed
  • README and quilt_summarize.json are package entries (not metadata)
  • Feature enabled by default
  • Configurable via parameters
  • Comprehensive BDD test coverage

References

  • User requirement: Every package should include README.md as an actual file
  • User requirement: Every package should include quilt_summarize.json with at least README and visualizations
  • Follows TDD principles with Red → Green workflow
  • BDD tests verify all behavioral requirements

Note

Automatically generates and adds README.md and quilt_summarize.json when creating packages, with options to customize or disable; includes comprehensive unit tests.

  • Service:
    • Updates QuiltService.create_package_revision() to:
      • Add params: include_readme, readme_content, include_quilt_summary.
      • Generate and add README.md via generate_package_readme().
      • Generate and add quilt_summarize.json via generate_quilt_summarize().
  • New Module: src/quilt_mcp/services/readme_generator.py
    • generate_package_readme(...) for README markdown.
    • generate_quilt_summarize(...) for package summary JSON.
  • Tests:
    • Adds tests/unit/test_package_readme_generation.py covering default inclusion, metadata/contents, usage examples, and configurable enable/disable/custom README.

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

…packages

- Implement generate_package_readme() function to create comprehensive README
- Implement generate_quilt_summarize() function for package summaries
- Integrate generation into QuiltService.create_package_revision()
- Add configurable parameters: include_readme, readme_content, include_quilt_summary
- README contents are added as actual files in the package (not metadata)
- Every package includes quilt_summarize.json with README and metadata
- All 268 unit tests pass (10 new tests added)
- Code coverage: 91% for readme_generator.py, 82% for quilt_service.py

Per user requirements:
- README.md and quilt_summarize.json are package entries, not S3 metadata
- Enabled by default with option to disable or provide custom content
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Comment on lines +278 to +280
# Add README.md to package
pkg.set("README.md", readme_content)

Choose a reason for hiding this comment

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

[P0] Set README content as inline data instead of file path

The new logic calls pkg.set("README.md", readme_content) where readme_content is Markdown text produced on the fly. In quilt3 a str argument to Package.set is treated as a filesystem path to upload, so passing inline README text causes the method to try to read a local file whose name is the markdown contents and raises FileNotFoundError before the package push completes. Because this path runs by default for every package, create_package_revision will fail for normal usage. Pass bytes via the data parameter (e.g. pkg.set("README.md", data=readme_content.encode("utf-8"))). The same applies to the subsequent pkg.set("quilt_summarize.json", summary_content) call.

Useful? React with 👍 / 👎.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on October 25

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

)

# Add quilt_summarize.json to package
pkg.set("quilt_summarize.json", summary_content)
Copy link

Choose a reason for hiding this comment

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

Bug: Inconsistent README Handling in Package Summary

The create_package_revision method can generate an inconsistent quilt_summarize.json. When include_readme=False, the summary might include readme_content even if README.md isn't added to the package. Alternatively, if no readme_content is provided, the summary's README field becomes empty, which may not align with expectations for quilt_summarize.json.

Fix in Cursor Fix in Web

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