Skip to content

chore: add skills, design docs, and tooling config#190

Open
nv-alicheng wants to merge 1 commit intofeat/alicheng-test-cleanupfrom
feat/alicheng-skills-and-docs
Open

chore: add skills, design docs, and tooling config#190
nv-alicheng wants to merge 1 commit intofeat/alicheng-test-cleanupfrom
feat/alicheng-skills-and-docs

Conversation

@nv-alicheng
Copy link
Copy Markdown
Collaborator

@nv-alicheng nv-alicheng commented Mar 18, 2026

  • Add msgspec-patterns and msgspec-struct-gc-check Claude/Cursor skills
  • Add design docs for services architecture and metrics aggregator
  • Update .gitignore for new artifact patterns
  • Update zmq_pubsub_demo.py for new transport API

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

@nv-alicheng nv-alicheng requested a review from a team as a code owner March 18, 2026 00:56
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@github-actions github-actions bot requested review from arekay-nv and nvzhihanj March 18, 2026 00:57
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the development environment and documentation. It introduces new AI assistant skills to guide developers on efficient msgspec usage and safe garbage collection practices. Concurrently, it provides detailed architectural design documents for the EventRecord Pub-Sub system and the Metrics Aggregator Service, offering clarity on how events are handled and metrics are processed. The .gitignore has been updated to streamline local development by excluding new tooling artifacts, and the zmq_pubsub_demo.py script has been improved to better demonstrate the updated event logging infrastructure.

Highlights

  • New AI Assistant Skills: Added msgspec-patterns and msgspec-struct-gc-check skills for Claude/Cursor, providing guidance on msgspec.Struct usage and gc=False safety.
  • Comprehensive Design Documentation: Introduced comprehensive design documentation for the EventRecord Pub-Sub system and the Metrics Aggregator Service, detailing their architecture, data flow, and lifecycle.
  • Tooling Configuration Updates: Updated .gitignore to properly exclude new agent-related artifacts and local development configuration files.
  • Demo Script Refactoring: Refactored zmq_pubsub_demo.py to integrate the event_logger as a subprocess, remove the FileSubscriber, and include verification of SQL output.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new documentation in the form of Claude/Cursor skills and system design documents, and significantly refactors the zmq_pubsub_demo.py script. The documentation is thorough and well-structured, providing valuable insights into the msgspec patterns and the pub-sub architecture. The demo script update is a great improvement, now demonstrating the out-of-process subscriber pattern with verification, which aligns well with the design documents. My review includes a couple of suggestions to enhance clarity in the documentation and improve resource management in the demo script.


## NDJSON with encode_into

For line-delimited JSON, use `encode_into()` with `buffer.extend()` to avoid copies:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The description for NDJSON says to use encode_into() with buffer.extend(), but the code example doesn't use buffer.extend(). This is confusing as encode_into and buffer.extend serve different purposes. The example shows writing a single encoded message to a file, which is a valid use case for encode_into to avoid intermediate allocations.

To improve clarity, I suggest updating the description to better match the example. For instance:
"For line-delimited JSON, use encode_into() to write into a reusable buffer before sending the data to a file or socket. This avoids extra memory copies."

Comment on lines +326 to +352
conn = sqlite3.connect(str(events_db))
try:
cur = conn.execute(
"SELECT id, sample_uuid, event_type, timestamp_ns, data FROM events ORDER BY id"
)
rows = cur.fetchall()
for row in rows:
row_id, sample_uuid, event_type, timestamp_ns, data = row
sample_short = (
(sample_uuid[:8] + "..") if sample_uuid else "N/A"
)
data_preview = (
data[:60] + b"..."
if data and len(data) > 60
else data or b""
) or b""
logger.info(
" id=%s | event_type=%s | sample=%s | timestamp_ns=%s | data=%s",
row_id,
event_type,
sample_short,
timestamp_ns,
data_preview.decode("utf-8", errors="replace"),
)
logger.info("Total rows: %s", len(rows))
finally:
conn.close()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The SQLite connection is manually closed in a finally block. It's more idiomatic and safer to use the connection object as a context manager (with statement). This ensures the connection is properly closed even if errors occur, and it also handles transaction commits or rollbacks automatically.

                try:
                    with sqlite3.connect(str(events_db)) as conn:
                        cur = conn.execute(
                            "SELECT id, sample_uuid, event_type, timestamp_ns, data FROM events ORDER BY id"
                        )
                        rows = cur.fetchall()
                        for row in rows:
                            row_id, sample_uuid, event_type, timestamp_ns, data = row
                            sample_short = (
                                (sample_uuid[:8] + "..") if sample_uuid else "N/A"
                            )
                            data_preview = (
                                data[:60] + b"..."
                                if data and len(data) > 60
                                else data or b""
                            ) or b""
                            logger.info(
                                "  id=%s | event_type=%s | sample=%s | timestamp_ns=%s | data=%s",
                                row_id,
                                event_type,
                                sample_short,
                                timestamp_ns,
                                data_preview.decode("utf-8", errors="replace"),
                            )
                        logger.info("Total rows: %s", len(rows))
                except sqlite3.Error as e:
                    logger.error("Failed to read from SQLite DB: %s", e)

- Add msgspec-patterns and msgspec-struct-gc-check Claude/Cursor skills
- Add design docs for services architecture and metrics aggregator
- Update .gitignore for new artifact patterns
- Update zmq_pubsub_demo.py for new transport API
@nv-alicheng nv-alicheng force-pushed the feat/alicheng-skills-and-docs branch from 683b17c to 8c5f45f Compare March 18, 2026 03:43
@nv-alicheng nv-alicheng force-pushed the feat/alicheng-test-cleanup branch from b723356 to bc244a8 Compare March 18, 2026 03:43
@@ -0,0 +1,119 @@
---
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please fold it or symlink to claude skills to avoid duplication

Copy link
Copy Markdown
Collaborator

@nvzhihanj nvzhihanj left a comment

Choose a reason for hiding this comment

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

Review Council — Multi-AI Code Review

Reviewed by: Codex + Claude

Found 0 issues.

This PR adds skill definitions, design documentation, tooling config (.gitignore), a demo script refactor, and a minor test formatting fix. No source code logic changes — no issues to flag.

@nvzhihanj
Copy link
Copy Markdown
Collaborator

Review Council — Multi-AI Code Review Council

Reviewed by: Codex + Claude

Found 0 issues across 8 files.

This PR adds skill definitions (msgspec-patterns, msgspec-struct-gc-check), design documentation for the EventRecord pub-sub and metrics aggregator services, tooling config (.gitignore updates), a demo script refactor (subprocess-based event_logger with JSONL+SQL), and a minor test formatting fix. No source code logic changes — nothing to flag.

# File Change Type Notes
1 .claude/skills/msgspec-patterns/SKILL.md New Skill reference doc
2 .claude/skills/msgspec-struct-gc-check/SKILL.md New Skill reference doc
3 .cursor/skills/msgspec-struct-gc-check/SKILL.md New Cursor skill mirror
4 .gitignore Modified Agent artifacts, local rules
5 docs/async_utils/services/design.md New Pub-sub design doc
6 docs/async_utils/services/metrics_aggregator/design.md New Metrics aggregator design doc
7 scripts/zmq_pubsub_demo.py Modified Refactored to use event_logger subprocess
8 tests/unit/metrics/test_recorder.py Modified Minor formatting

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