Skip to content

DOC: Replace API_MAP with graphify and fix Sphinx warnings - #105

Merged
aylward merged 3 commits into
Project-MONAI:mainfrom
aylward:graphify
Aug 3, 2026
Merged

DOC: Replace API_MAP with graphify and fix Sphinx warnings#105
aylward merged 3 commits into
Project-MONAI:mainfrom
aylward:graphify

Conversation

@aylward

@aylward aylward commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Remove the docs/API_MAP.md generator and every reference to it. The generated map duplicated what the graphify knowledge graph already provides, and its pre-commit hook regenerated a gitignored file on every Python change.

  • Delete utils/generate_api_map.py and the /regen-api-map skill
  • Drop the generate-api-map pre-commit hook
  • Point CLAUDE.md, AGENTS.md, .agents/ agents and skills, developer docs, tutorials/README.md, and statistics.md at graphify instead
  • Add docs/developer/ai_assistants.rst recommending graphify for AI coding, linked from contributing.rst and the Developer Guides toctree

Also fix four pre-existing Sphinx diagnostics that were masking real rendering bugs:

  • architecture.rst: two-line definition-list terms rendered their bodies as block quotes; join each term onto one line
  • RegisterTimeSeriesImages: missing blank lines before two lists made them render as run-on paragraphs
  • AnatomyGroup: autodoc and napoleon each documented the dataclass fields; use :no-members: so they appear once
  • api/utilities: two nav links pointed at a nonexistent nrrd_conversion page; repoint to image_conversion

Summary by CodeRabbit

  • Documentation

    • Added guidance for using the Graphify knowledge graph to navigate code, trace relationships, and find classes, methods, and signatures.
    • Added documentation for AI coding assistant workflows and contributor practices.
    • Updated API, tutorial, navigation, and training references.
    • Clarified fixed data-convention guidance and documented only genuine deviations.
    • Clarified that the knowledge graph is refreshed after public API changes.
  • Chores

    • Retired the legacy API map generation workflow and related contributor instructions.

Remove the docs/API_MAP.md generator and every reference to it. The
generated map duplicated what the graphify knowledge graph already
provides, and its pre-commit hook regenerated a gitignored file on
every Python change.

- Delete utils/generate_api_map.py and the /regen-api-map skill
- Drop the generate-api-map pre-commit hook
- Point CLAUDE.md, AGENTS.md, .agents/ agents and skills, developer
  docs, tutorials/README.md, and statistics.md at graphify instead
- Add docs/developer/ai_assistants.rst recommending graphify for AI
  coding, linked from contributing.rst and the Developer Guides toctree

Also fix four pre-existing Sphinx diagnostics that were masking real
rendering bugs:

- architecture.rst: two-line definition-list terms rendered their
  bodies as block quotes; join each term onto one line
- RegisterTimeSeriesImages: missing blank lines before two lists made
  them render as run-on paragraphs
- AnatomyGroup: autodoc and napoleon each documented the dataclass
  fields; use :no-members: so they appear once
- api/utilities: two nav links pointed at a nonexistent
  nrrd_conversion page; repoint to image_conversion
Copilot AI review requested due to automatic review settings August 2, 2026 23:34
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@aylward, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f0e5ef3-25dc-40a8-8e69-15a145d43697

📥 Commits

Reviewing files that changed from the base of the PR and between 8631382 and 2c95ca9.

📒 Files selected for processing (2)
  • .agents/skills/check-conventions/SKILL.md
  • AGENTS.md

Walkthrough

The repository replaces generated API-map workflows with Graphify guidance and updates contributor documentation. It also corrects API navigation, tutorial references, and documentation formatting.

Changes

Graphify documentation workflow

Layer / File(s) Summary
Graphify guidance and convention rules
.agents/..., AGENTS.md, CLAUDE.md
Agent and repository instructions now use graphify query for code discovery, graphify update . for graph maintenance, and fixed data conventions as the single source of truth.
Developer workflow and assistant documentation
docs/contributing.rst, docs/developer/..., docs/index.rst, tutorials/README.md, statistics.md
Documentation adds Graphify usage guidance and replaces API-map references and regeneration steps with Sphinx API documentation and knowledge-graph updates.
Documentation reference corrections
docs/api/..., docs/architecture.rst, docs/cli_scripts/byod_tutorials.rst, src/physiotwin4d/register_time_series_images.py
API navigation, tutorial references, autodocumentation options, and class-docstring spacing were corrected.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: replacing API_MAP with graphify and fixing Sphinx warnings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the legacy docs/API_MAP.md generation workflow (and its pre-commit regeneration hook) in favor of using the existing graphify-out/ knowledge graph for codebase navigation, while also fixing several Sphinx documentation diagnostics that were masking rendering issues.

Changes:

  • Delete utils/generate_api_map.py and remove the generate-api-map pre-commit hook.
  • Update contributor/agent/developer docs to reference graphify query/.../update instead of docs/API_MAP.md.
  • Fix Sphinx rendering issues (definition-list terms, list spacing, AnatomyGroup member duplication, and broken nav links).

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
utils/generate_api_map.py Removes the API map generator script.
tutorials/README.md Updates contributor API reference links and points AI navigation to graphify docs.
statistics.md Replaces API map references with Sphinx API docs / graphify.
src/physiotwin4d/register_time_series_images.py Fixes RST list rendering by adding required blank lines in docstring.
docs/index.rst Adds the new developer guide page to the docs toctree.
docs/developer/workflows.rst Replaces API map regeneration step with graphify update ..
docs/developer/extending.rst Replaces API map guidance with graphify refresh guidance.
docs/developer/core.rst Removes API map references; adds graphify refresh instructions.
docs/developer/ai_assistants.rst New page describing AI-assistant conventions and graphify usage.
docs/contributing.rst Adds a short callout recommending graphify for AI-assisted navigation.
docs/conf.py Removes API_MAP.md from Sphinx exclude patterns.
docs/architecture.rst Fixes definition-list term wrapping that caused block-quote rendering.
docs/api/utilities/test_tools.rst Fixes navigation link to point to image_conversion.
docs/api/utilities/contour_tools.rst Fixes navigation link to point to image_conversion (but currently drops test_tools).
docs/api/segmentation/base.rst Uses :no-members: for AnatomyGroup to avoid duplicate field docs.
docs/.gitignore Stops gitignoring API_MAP.md (since it’s removed).
CLAUDE.md Removes API map references; drops /regen-api-map mentions.
AGENTS.md Adds a graphify section and replaces API map guidance with graphify guidance.
.pre-commit-config.yaml Removes the local generate-api-map hook.
.agents/skills/simplify-staged/SKILL.md Updates “check API map” guidance to “check with graphify query”.
.agents/skills/regen-api-map/SKILL.md Deletes the regen skill documentation.
.agents/skills/plan/SKILL.md Replaces API map lookup instruction with graphify query.
.agents/skills/impl/SKILL.md Replaces API map lookup instruction with graphify query.
.agents/skills/doc-feature/SKILL.md Replaces API map regeneration instruction with graphify refresh instruction.
.agents/agents/implementation.md Replaces API map mention with graphify query guidance.
.agents/agents/docs.md Replaces API map mentions with graphify refresh guidance (but contains a quoting-style inconsistency).
.agents/agents/architecture.md Replaces API map mention with graphify query guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .agents/agents/docs.md Outdated
Comment thread docs/api/utilities/contour_tools.rst

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
docs/developer/ai_assistants.rst (1)

19-45: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document one clean-checkout Graphify workflow.

The affected documentation requires Graphify, but statistics.md states that graphify-out/ is not checked in. Verify that the supported environment provides the graphify executable and document graph initialization. If Graphify is optional, make the commands conditional and retain manual search as the fallback.

  • docs/developer/ai_assistants.rst#L19-L45: add installation, initialization, and fallback instructions.
  • AGENTS.md#L102-L120: distinguish generated local output from checked-in repository content.
  • AGENTS.md#L156-L157: require Graphify queries only when the graph exists.
  • docs/contributing.rst#L54-L56: link contributors to the setup and fallback procedure.
  • docs/developer/core.rst#L58-L63: link the API-change procedure to the same setup and fallback.
  • docs/developer/extending.rst#L64-L65: link the public-API procedure to the same setup and fallback.
  • tutorials/README.md#L92-L96: retain a usable fallback for contributors without Graphify.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/developer/ai_assistants.rst` around lines 19 - 45, Document a
clean-checkout Graphify workflow in docs/developer/ai_assistants.rst, including
verifying or installing the graphify executable, initializing graphify-out/, and
using manual search when Graphify is unavailable. Update AGENTS.md at lines
102-120 to distinguish generated local output from checked-in content and at
lines 156-157 to require queries only when the graph exists. Link the same setup
and fallback procedure from docs/contributing.rst lines 54-56,
docs/developer/core.rst lines 58-63, and docs/developer/extending.rst lines
64-65; retain a usable non-Graphify fallback in tutorials/README.md lines 92-96.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/doc-feature/SKILL.md:
- Around line 16-17: Update the Graphify guidance in the documented workflow to
require running `graphify update .` after any public API change, not only
changes to public class, method, or function signatures. Include changes to
public behavior and public attributes, while preserving the existing command and
placement in the workflow.

In `@docs/api/utilities/contour_tools.rst`:
- Line 18: Update the documentation navigation line to retain the existing
test_tools entry while replacing only the obsolete nrrd_conversion link with
image_conversion, preserving the transform_tools and index entries.

In `@docs/developer/workflows.rst`:
- Line 55: Update the workflow step describing when to run ``graphify update .``
so it says “after public API changes” instead of “after exposing public
methods,” covering additions, modifications, and removals of public methods.

---

Nitpick comments:
In `@docs/developer/ai_assistants.rst`:
- Around line 19-45: Document a clean-checkout Graphify workflow in
docs/developer/ai_assistants.rst, including verifying or installing the graphify
executable, initializing graphify-out/, and using manual search when Graphify is
unavailable. Update AGENTS.md at lines 102-120 to distinguish generated local
output from checked-in content and at lines 156-157 to require queries only when
the graph exists. Link the same setup and fallback procedure from
docs/contributing.rst lines 54-56, docs/developer/core.rst lines 58-63, and
docs/developer/extending.rst lines 64-65; retain a usable non-Graphify fallback
in tutorials/README.md lines 92-96.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 69cd2d18-1947-4f99-8e42-fa1bcbf10163

📥 Commits

Reviewing files that changed from the base of the PR and between 79bf471 and c2f0e65.

📒 Files selected for processing (27)
  • .agents/agents/architecture.md
  • .agents/agents/docs.md
  • .agents/agents/implementation.md
  • .agents/skills/doc-feature/SKILL.md
  • .agents/skills/impl/SKILL.md
  • .agents/skills/plan/SKILL.md
  • .agents/skills/regen-api-map/SKILL.md
  • .agents/skills/simplify-staged/SKILL.md
  • .pre-commit-config.yaml
  • AGENTS.md
  • CLAUDE.md
  • docs/.gitignore
  • docs/api/segmentation/base.rst
  • docs/api/utilities/contour_tools.rst
  • docs/api/utilities/test_tools.rst
  • docs/architecture.rst
  • docs/conf.py
  • docs/contributing.rst
  • docs/developer/ai_assistants.rst
  • docs/developer/core.rst
  • docs/developer/extending.rst
  • docs/developer/workflows.rst
  • docs/index.rst
  • src/physiotwin4d/register_time_series_images.py
  • statistics.md
  • tutorials/README.md
  • utils/generate_api_map.py
💤 Files with no reviewable changes (5)
  • docs/conf.py
  • docs/.gitignore
  • .pre-commit-config.yaml
  • utils/generate_api_map.py
  • .agents/skills/regen-api-map/SKILL.md

Comment thread .agents/skills/doc-feature/SKILL.md Outdated
Comment thread docs/api/utilities/contour_tools.rst
Comment thread docs/developer/workflows.rst Outdated
@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.61%. Comparing base (79bf471) to head (2c95ca9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #105   +/-   ##
=======================================
  Coverage   35.61%   35.61%           
=======================================
  Files          64       64           
  Lines        8277     8277           
=======================================
  Hits         2948     2948           
  Misses       5329     5329           
Flag Coverage Δ
integration-tests 35.42% <ø> (?)
unittests 35.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings August 3, 2026 01:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.

Suppressed comments (1)

CLAUDE.md:126

  • This PR introduces a new documentation/testing policy (“do not restate shape, axis order, or world space in docstrings, comments, or test docstrings”) that is not mentioned in the PR description, which otherwise frames the change as API_MAP→graphify + Sphinx warning fixes. If this policy change is intentional, it should be explicitly called out in the PR description (or split into a separate PR) since it changes contributor guidance and affects multiple agent skills/docs.
These conventions are fixed and hold everywhere, so this list is their single
source of truth — do not restate shape, axis order, or world space in
docstrings, comments, or test docstrings. Document only genuine deviations,
such as a raw NumPy array whose axes are reversed relative to the ITK image it
came from.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (1)
AGENTS.md (1)

156-157: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Define one Graphify availability rule.

These instructions require graphify query without a fallback when graphify-out/graph.json is absent. Use Graphify when the graph exists. Use manual search when it does not.

  • AGENTS.md#L156-L157: add the Graphify availability condition and manual-search fallback.
  • .agents/agents/implementation.md#L17-L18: apply the same condition before manual symbol searches.
  • .agents/skills/simplify-staged/SKILL.md#L48-L49: apply the same condition to the reuse check.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` around lines 156 - 157, Define one Graphify availability rule
across AGENTS.md:156-157, .agents/agents/implementation.md:17-18, and
.agents/skills/simplify-staged/SKILL.md:48-49: use graphify query only when
graphify-out/graph.json exists, and otherwise fall back to manual search; apply
this condition respectively to graph navigation, implementation symbol searches,
and the simplify-staged reuse check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/check-conventions/SKILL.md:
- Around line 60-61: Update the checklist rule in SKILL.md to flag any docstring
or comment that restates fixed ITK shape, axis order, or LPS world-space
conventions, regardless of whether it also documents parameters or return
values; remove the limiting “instead of” condition.

In `@AGENTS.md`:
- Around line 176-179: Update the later coordinate-transform rule in AGENTS.md
to use LPS-to-Y-up terminology, unless it explicitly describes a separate RAS
input boundary. Ensure the ITK/PyVista boundary guidance consistently
distinguishes the internal LPS frame from the export conversion.

---

Outside diff comments:
In `@AGENTS.md`:
- Around line 156-157: Define one Graphify availability rule across
AGENTS.md:156-157, .agents/agents/implementation.md:17-18, and
.agents/skills/simplify-staged/SKILL.md:48-49: use graphify query only when
graphify-out/graph.json exists, and otherwise fall back to manual search; apply
this condition respectively to graph navigation, implementation symbol searches,
and the simplify-staged reuse check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: efbb5ac0-c77b-4b92-ae17-7fe8febbf2dd

📥 Commits

Reviewing files that changed from the base of the PR and between c2f0e65 and 8631382.

📒 Files selected for processing (12)
  • .agents/agents/docs.md
  • .agents/agents/implementation.md
  • .agents/agents/testing.md
  • .agents/skills/check-conventions/SKILL.md
  • .agents/skills/doc-feature/SKILL.md
  • .agents/skills/plan/SKILL.md
  • .agents/skills/simplify-staged/SKILL.md
  • .agents/skills/test-feature/SKILL.md
  • AGENTS.md
  • CLAUDE.md
  • docs/cli_scripts/byod_tutorials.rst
  • docs/developer/workflows.rst
🚧 Files skipped from review as they are similar to previous changes (4)
  • .agents/skills/doc-feature/SKILL.md
  • .agents/skills/plan/SKILL.md
  • docs/developer/workflows.rst
  • CLAUDE.md

Comment thread .agents/skills/check-conventions/SKILL.md Outdated
Comment thread AGENTS.md
Copilot AI review requested due to automatic review settings August 3, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.

Suppressed comments (2)

docs/api/utilities/contour_tools.rst:18

  • The utilities navigation line no longer links to test_tools. The PR description only mentions repointing nrrd_conversion to image_conversion, so this looks like an accidental drop and makes it harder to hop from contour utilities to the testing helpers (still listed in docs/api/utilities/index.rst).
:doc:`transform_tools` | :doc:`index` | :doc:`image_conversion`

docs/conf.py:68

  • docs/API_MAP.md is no longer gitignored, but existing clones may still have a stale untracked docs/API_MAP.md from before this PR. Since .md is a Sphinx source suffix here, that file can reintroduce Sphinx warnings in local builds. Keeping it in exclude_patterns avoids regressing local make html for contributors who haven't deleted the old file yet.
    "README.md",

@aylward
aylward merged commit 766537d into Project-MONAI:main Aug 3, 2026
12 checks passed
@aylward
aylward deleted the graphify branch August 3, 2026 02:14
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.

2 participants