AIQ PR Contribution Recipe
Apply the shared OSS quality protocol in
../../references/contribution-quality.md.
Project-specific instructions below override it when they conflict.
Use this recipe for NVIDIA-AI-Blueprints/aiq,
the NVIDIA AI-Q Blueprint built on NeMo Agent Toolkit (NAT). Keep changes
focused, evidence-backed, DCO-signed, and consistent across code, configuration,
documentation, and shipped examples.
Project facts
- Local checkout:
/Users/dejain/nvidia/oss/aiq
- Upstream:
NVIDIA-AI-Blueprints/aiq
- Fork owner:
deepujain
- Default contribution base:
develop
- Release branches: use only when a maintainer requests a backport
- Python: 3.11-3.13, managed with
uv
- UI: Node.js 22+, npm, Next.js/React/TypeScript
- MCP: independent uv project and lockfile under
mcp/
- Contribution gates: DCO, code-owner review, copy-pr-bot mirror, GitHub Actions,
CodeRabbit, resolved review threads
Load authoritative context
Before editing, read the current versions of:
AGENTS.md and any nearer AGENTS.md governing touched paths.
CONTRIBUTING.md and .github/pull_request_template.md.
- The relevant maintainer skill under
.agents/skills/:
aiq-add-data-source, aiq-add-tool, aiq-configure-workflow,
aiq-customize-prompts-models, aiq-maintain-ci, aiq-release-qa, or
aiq-prepare-pr.
- Current source-of-truth files: nearby code/tests,
pyproject.toml, the
relevant package manifest, workflow, config, or canonical docs page.
Do not treat this skill's command list as newer than repository files. AIQ
changes quickly; live repository guidance wins.
Required live reconnaissance
Run before selecting new work or sweeping existing PRs:
gh auth status
gh issue list --repo NVIDIA-AI-Blueprints/aiq --state open --limit 100
gh pr list --repo NVIDIA-AI-Blueprints/aiq --state open --limit 100
gh pr list --repo NVIDIA-AI-Blueprints/aiq --author deepujain --state open
For a candidate issue, read its full timeline and search overlap by number,
title terms, error text, subsystem, and hot files:
gh issue view <number> --repo NVIDIA-AI-Blueprints/aiq --comments
gh search prs --repo NVIDIA-AI-Blueprints/aiq '<number> in:title,body' --state open
gh search prs --repo NVIDIA-AI-Blueprints/aiq '<error text or subsystem>' --state open
Before implementing, scan the latest 20 merged PRs. Separate RAPIDS
forward-merges from substantive contributor PRs; inspect bodies, files, inline
comments, and checks for the latter. Use the current sample to calibrate branch
policy, validation, reviewer preferences, and file locations. See
references/recent-merged-prs.md for the
2026-08-07 baseline, but refresh it rather than assuming it is current.
Select work
Prefer:
- A confirmed bug or small enhancement with concrete acceptance criteria.
- One subsystem with a focused regression test or realistic smoke path.
- Config/docs parity fixes backed by a stable source of truth.
- Source/tool packages that follow an existing NAT registration pattern.
- Reliability, citation, state-transition, auth-boundary, or missing-secret
fixes whose negative and recovery paths can be tested locally.
Avoid or seek design alignment first for:
- Public API, architecture, auth, deployment, or contributor-workflow redesigns.
- Broad model/profile migrations spanning many configs and docs unless explicitly
approved and protected by repository-wide consistency tests.
- Work already covered by an active PR or newer
develop change.
- Changes requiring private infrastructure, secrets, or hardware unavailable for
meaningful proof.
- Direct
release/* work unless a maintainer requests an exact backport.
Sync and branch before editing
Preserve unrelated user work. Inspect status, branch, and remotes first:
cd /Users/dejain/nvidia/oss/aiq
git status --short
git branch --show-current
git remote -v
Ensure upstream points to NVIDIA-AI-Blueprints/aiq and origin points to
deepujain/aiq, then branch from current upstream/develop:
git fetch upstream
git switch develop
git pull --ff-only upstream develop
git switch -c fix/NNNN-short-description
Do not edit before the topic branch exists. If the checkout is dirty, preserve
only the relevant paths; never overwrite unrelated changes.
Implement by surface
Apply these rules throughout:
- Make the smallest coherent change. Do not reformat or refactor unrelated code.
- Add tests for behavior changes; assert stable behavior and contracts instead
of exact prompt prose.
- Update canonical docs under
docs/source/ when behavior, configuration, or
workflows change. Keep README, notebooks, examples, configs, skills, and
runtime defaults consistent when they describe the same contract.
- Never commit secrets, private endpoints, customer data, internal logs,
deploy/.env, or generated local artifacts.
Backend agents and API
- Preserve research graph state transitions, writer-only publication,
citations, cancellation, checkpointing, and selected-source behavior.
- Treat async jobs, artifacts, WebSockets, auth, and report ownership as public
contracts. Test success, rejection, failure persistence, and cross-user
isolation as applicable.
- Sanitize provider exceptions before they can reach model context, logs, or
API responses. Preserve useful successful evidence when sibling calls fail.
- For concurrency and circuit-breaking changes, test queued, in-flight,
exception, threshold, late-success, and recovery behavior.
Sources and tools
- Treat each
sources/* directory as an independent package.
- Use
FunctionBaseConfig, @register_function, and the package's
nat.plugins entry point.
- Resolve API keys at runtime with
SecretStr; missing-secret paths must return
a graceful stub or skip, never crash or leak.
- Register toggleable retrieval sources in
data_source_registry; general
tools go directly in the agent's tools list.
- Return structured, citation-usable output and cover malformed/empty/provider
failure responses.
Configs, prompts, and models
- Copy a shipped profile; do not invent schema fields.
- Keep every LLM alias defined and every role mapping explicit. Protect
orchestrator, source-router, planner, researcher, writer, clarifier, shallow,
and summary roles relevant to the profile.
- Keep prompts task-agnostic and preserve citation requirements. Prefer
structural/behavior tests over brittle literal prompt assertions.
- Validate changed configs with
nat validate --config_file <config> and any
repository config validator used by the relevant maintainer skill.
MCP
- Treat
mcp/ as an independent uv project. Keep mcp/uv.lock separate from
the root lock and run MCP tests with --project mcp.
- Document runtime/platform support when dependency changes cross an upstream
compatibility boundary. Keep root docs, MCP docs, security policy, and agent
guidance consistent.
UI
- Reuse existing KUI and adapter patterns; preserve auth-aware states.
- For proxy/auth changes, test the integration boundary, not only a helper.
- Include a screenshot for visible changes and validate lint, types, unit tests,
and build.
Deployment, docs, and CI
- For container changes, use clean builds plus runtime import/user/entrypoint
smoke tests; keep Docker documentation exact.
- For Helm/Compose changes, lint or render the relevant assets and exercise the
affected deployment path when practical.
- Keep workflow permissions least-privilege and preserve copy-pr-bot mirror
semantics. Do not weaken secret detection, auth, DCO, or code-owner gates.
- Clear notebook outputs and validate notebook/docs links and executable
commands. Do not claim a documented safety boundary that the selected config
does not actually attach.
Validate with an evidence ladder
Run the narrowest proof first, then adjacent checks, then broader gates when the
change crosses shared boundaries.
Backend or source package:
uv sync --group dev
uv run pytest <focused test paths> -v
uv run ruff check <changed paths>
uv run ruff format --check <changed paths>
Shared backend changes:
uv run ruff check .
uv run ruff format --check .
uv run pytest
MCP:
uv sync --project mcp --extra dev
uv run --project mcp --extra dev pytest mcp/tests
uv lock --check
uv lock --project mcp --check
UI, from frontends/ui/:
npm ci
npm run lint
npm run type-check
npm run test:ci
npm run build
Docs, config, and final diff:
uv run --extra docs make -C docs html
nat validate --config_file <changed config>
uv run pre-commit run --files <changed files>
git diff --check
Also run the exact runtime, Docker, Helm, API, CLI, eval, or browser smoke that
proves the reported behavior. Record commands, outcomes, pass counts, warnings,
and untested limits. Do not call a mocked argv test proof that the real external
tool accepts the invocation.
Commit and PR hygiene
Use the user's exact identity and sign off every commit:
git -c user.name="Deepak Jain" -c user.email="deepujain@gmail.com" \
commit -s --author="Deepak Jain <deepujain@gmail.com>" \
-m 'fix(scope): concise summary'
Verify every commit in the PR range has the correct author and sign-off. Do not
commit local PR-body files. Publish only when the user has authorized it; use
--force-with-lease after an authorized history rewrite.
Target develop unless a maintainer explicitly requested a release branch.
Fill the repository PR template exactly:
Overview: problem, root cause, solution, and intentional non-goals.
DCO sign-off for the squash commit: replace the placeholder with
Signed-off-by: Deepak Jain <deepujain@gmail.com> including angle brackets.
Validation: exact commands and observed results, plus honest limitations.
- Checklist: mark only claims actually satisfied.
Where should reviewers start?: name the key file/test/design decision.
Related Issues: use Fixes only when the whole issue is resolved; otherwise
use Relates to.
AIQ CI does not behave like ordinary push-triggered PR CI. A maintainer or
configured vetter comments /ok to test; copy-pr-bot mirrors the head to
pull-request/<number>, and required workflows run there. /nvskills-ci is
restricted to repository owners, organization members, and collaborators.
Maintainers use /merge only after checks, code-owner review, branch policy,
and review-thread requirements pass.
Shepherd an existing PR
When given a PR URL or asked to sweep, update that PR rather than opening a
replacement:
- Read metadata, base/head, commits, files, labels, checks, reviews, top-level
comments, and inline comments. Separate human, CodeRabbit, and bot feedback.
- Confirm the branch is based on the intended current base and has no overlap
that supersedes it.
- Fix every current actionable finding with the smallest change. Explain a
false positive or deliberate backport non-goal with evidence instead of
expanding scope.
- Rerun focused and adjacent validation. Rebase only when needed and reverify
every DCO trailer afterward.
- Push only with authorization, then reread the mirrored CI and reviews on the
current head. Do not call the PR ready while
/ok to test, code-owner review,
a required check, or a review thread is pending.
- Leave a short factual comment mapping fixes to commits/tests when useful.
At the start of repeated sweeps, reconcile previously open authored PRs with the
current set. Classify disappeared PRs as merged, superseded, duplicate,
policy-blocked, or unresolved; record only reusable lessons.
Durable lessons from the latest merged sample
- Separate release PRs from automated forward-merges; never copy bot PR bodies
as contributor practice.
- Exact surface proof matters: clean container build plus runtime smoke, API or
proxy-boundary test, config validation, or real research runs often provide
stronger evidence than a generic suite alone.
- Reviewers expect docs, examples, notebooks, configs, skills, and runtime
defaults to stay synchronized.
- Security/reliability changes need negative paths: sanitized exceptions,
auth-cookie removal, platform support boundaries, structured provider errors,
in-flight concurrency, and failure recovery.
- Backports should remain content-aligned with the original fix; explicitly
defer unrelated improvements to avoid release/develop divergence.
- CodeRabbit findings are reviewed, fixed, or answered with evidence. A green
status alone does not mean inline review threads are resolved.
Trigger phrases
sweep when the active repository context is AIQ.
Pick the next AIQ issue and follow the full contribution recipe.
Prepare this AIQ change for PR.
Fix or update this AIQ PR: <url>
1---2name: aiq-pr-contribution3description: Contribute focused, merge-ready pull requests to NVIDIA-AI-Blueprints/aiq and shepherd existing AIQ PRs through DCO, copy-pr-bot CI, CodeRabbit, code-owner review, and merge. Use when Codex needs to pick or implement an AIQ issue, change AIQ agents, sources, configs, prompts, MCP, UI, docs, deployment, or CI, prepare an AIQ PR, fix AIQ CI or review feedback, sweep AIQ PRs, or analyze recent merged AIQ contribution practices.4---56# AIQ PR Contribution Recipe78Apply the shared OSS quality protocol in9[../../references/contribution-quality.md](../../references/contribution-quality.md).10Project-specific instructions below override it when they conflict.1112Use this recipe for [NVIDIA-AI-Blueprints/aiq](https://github.com/NVIDIA-AI-Blueprints/aiq),13the NVIDIA AI-Q Blueprint built on NeMo Agent Toolkit (NAT). Keep changes14focused, evidence-backed, DCO-signed, and consistent across code, configuration,15documentation, and shipped examples.1617## Project facts1819- Local checkout: `/Users/dejain/nvidia/oss/aiq`20- Upstream: `NVIDIA-AI-Blueprints/aiq`21- Fork owner: `deepujain`22- Default contribution base: `develop`23- Release branches: use only when a maintainer requests a backport24- Python: 3.11-3.13, managed with `uv`25- UI: Node.js 22+, npm, Next.js/React/TypeScript26- MCP: independent uv project and lockfile under `mcp/`27- Contribution gates: DCO, code-owner review, copy-pr-bot mirror, GitHub Actions,28 CodeRabbit, resolved review threads2930## Load authoritative context3132Before editing, read the current versions of:33341. `AGENTS.md` and any nearer `AGENTS.md` governing touched paths.352. `CONTRIBUTING.md` and `.github/pull_request_template.md`.363. The relevant maintainer skill under `.agents/skills/`:37 `aiq-add-data-source`, `aiq-add-tool`, `aiq-configure-workflow`,38 `aiq-customize-prompts-models`, `aiq-maintain-ci`, `aiq-release-qa`, or39 `aiq-prepare-pr`.404. Current source-of-truth files: nearby code/tests, `pyproject.toml`, the41 relevant package manifest, workflow, config, or canonical docs page.4243Do not treat this skill's command list as newer than repository files. AIQ44changes quickly; live repository guidance wins.4546## Required live reconnaissance4748Run before selecting new work or sweeping existing PRs:4950```bash51gh auth status52gh issue list --repo NVIDIA-AI-Blueprints/aiq --state open --limit 10053gh pr list --repo NVIDIA-AI-Blueprints/aiq --state open --limit 10054gh pr list --repo NVIDIA-AI-Blueprints/aiq --author deepujain --state open55```5657For a candidate issue, read its full timeline and search overlap by number,58title terms, error text, subsystem, and hot files:5960```bash61gh issue view <number> --repo NVIDIA-AI-Blueprints/aiq --comments62gh search prs --repo NVIDIA-AI-Blueprints/aiq '<number> in:title,body' --state open63gh search prs --repo NVIDIA-AI-Blueprints/aiq '<error text or subsystem>' --state open64```6566Before implementing, scan the latest 20 merged PRs. Separate RAPIDS67forward-merges from substantive contributor PRs; inspect bodies, files, inline68comments, and checks for the latter. Use the current sample to calibrate branch69policy, validation, reviewer preferences, and file locations. See70[references/recent-merged-prs.md](references/recent-merged-prs.md) for the712026-08-07 baseline, but refresh it rather than assuming it is current.7273## Select work7475Prefer:7677- A confirmed bug or small enhancement with concrete acceptance criteria.78- One subsystem with a focused regression test or realistic smoke path.79- Config/docs parity fixes backed by a stable source of truth.80- Source/tool packages that follow an existing NAT registration pattern.81- Reliability, citation, state-transition, auth-boundary, or missing-secret82 fixes whose negative and recovery paths can be tested locally.8384Avoid or seek design alignment first for:8586- Public API, architecture, auth, deployment, or contributor-workflow redesigns.87- Broad model/profile migrations spanning many configs and docs unless explicitly88 approved and protected by repository-wide consistency tests.89- Work already covered by an active PR or newer `develop` change.90- Changes requiring private infrastructure, secrets, or hardware unavailable for91 meaningful proof.92- Direct `release/*` work unless a maintainer requests an exact backport.9394## Sync and branch before editing9596Preserve unrelated user work. Inspect status, branch, and remotes first:9798```bash99cd /Users/dejain/nvidia/oss/aiq100git status --short101git branch --show-current102git remote -v103```104105Ensure `upstream` points to `NVIDIA-AI-Blueprints/aiq` and `origin` points to106`deepujain/aiq`, then branch from current `upstream/develop`:107108```bash109git fetch upstream110git switch develop111git pull --ff-only upstream develop112git switch -c fix/NNNN-short-description113```114115Do not edit before the topic branch exists. If the checkout is dirty, preserve116only the relevant paths; never overwrite unrelated changes.117118## Implement by surface119120Apply these rules throughout:121122- Make the smallest coherent change. Do not reformat or refactor unrelated code.123- Add tests for behavior changes; assert stable behavior and contracts instead124 of exact prompt prose.125- Update canonical docs under `docs/source/` when behavior, configuration, or126 workflows change. Keep README, notebooks, examples, configs, skills, and127 runtime defaults consistent when they describe the same contract.128- Never commit secrets, private endpoints, customer data, internal logs,129 `deploy/.env`, or generated local artifacts.130131### Backend agents and API132133- Preserve research graph state transitions, writer-only publication,134 citations, cancellation, checkpointing, and selected-source behavior.135- Treat async jobs, artifacts, WebSockets, auth, and report ownership as public136 contracts. Test success, rejection, failure persistence, and cross-user137 isolation as applicable.138- Sanitize provider exceptions before they can reach model context, logs, or139 API responses. Preserve useful successful evidence when sibling calls fail.140- For concurrency and circuit-breaking changes, test queued, in-flight,141 exception, threshold, late-success, and recovery behavior.142143### Sources and tools144145- Treat each `sources/*` directory as an independent package.146- Use `FunctionBaseConfig`, `@register_function`, and the package's147 `nat.plugins` entry point.148- Resolve API keys at runtime with `SecretStr`; missing-secret paths must return149 a graceful stub or skip, never crash or leak.150- Register toggleable retrieval sources in `data_source_registry`; general151 tools go directly in the agent's `tools` list.152- Return structured, citation-usable output and cover malformed/empty/provider153 failure responses.154155### Configs, prompts, and models156157- Copy a shipped profile; do not invent schema fields.158- Keep every LLM alias defined and every role mapping explicit. Protect159 orchestrator, source-router, planner, researcher, writer, clarifier, shallow,160 and summary roles relevant to the profile.161- Keep prompts task-agnostic and preserve citation requirements. Prefer162 structural/behavior tests over brittle literal prompt assertions.163- Validate changed configs with `nat validate --config_file <config>` and any164 repository config validator used by the relevant maintainer skill.165166### MCP167168- Treat `mcp/` as an independent uv project. Keep `mcp/uv.lock` separate from169 the root lock and run MCP tests with `--project mcp`.170- Document runtime/platform support when dependency changes cross an upstream171 compatibility boundary. Keep root docs, MCP docs, security policy, and agent172 guidance consistent.173174### UI175176- Reuse existing KUI and adapter patterns; preserve auth-aware states.177- For proxy/auth changes, test the integration boundary, not only a helper.178- Include a screenshot for visible changes and validate lint, types, unit tests,179 and build.180181### Deployment, docs, and CI182183- For container changes, use clean builds plus runtime import/user/entrypoint184 smoke tests; keep Docker documentation exact.185- For Helm/Compose changes, lint or render the relevant assets and exercise the186 affected deployment path when practical.187- Keep workflow permissions least-privilege and preserve copy-pr-bot mirror188 semantics. Do not weaken secret detection, auth, DCO, or code-owner gates.189- Clear notebook outputs and validate notebook/docs links and executable190 commands. Do not claim a documented safety boundary that the selected config191 does not actually attach.192193## Validate with an evidence ladder194195Run the narrowest proof first, then adjacent checks, then broader gates when the196change crosses shared boundaries.197198Backend or source package:199200```bash201uv sync --group dev202uv run pytest <focused test paths> -v203uv run ruff check <changed paths>204uv run ruff format --check <changed paths>205```206207Shared backend changes:208209```bash210uv run ruff check .211uv run ruff format --check .212uv run pytest213```214215MCP:216217```bash218uv sync --project mcp --extra dev219uv run --project mcp --extra dev pytest mcp/tests220uv lock --check221uv lock --project mcp --check222```223224UI, from `frontends/ui/`:225226```bash227npm ci228npm run lint229npm run type-check230npm run test:ci231npm run build232```233234Docs, config, and final diff:235236```bash237uv run --extra docs make -C docs html238nat validate --config_file <changed config>239uv run pre-commit run --files <changed files>240git diff --check241```242243Also run the exact runtime, Docker, Helm, API, CLI, eval, or browser smoke that244proves the reported behavior. Record commands, outcomes, pass counts, warnings,245and untested limits. Do not call a mocked argv test proof that the real external246tool accepts the invocation.247248## Commit and PR hygiene249250Use the user's exact identity and sign off every commit:251252```bash253git -c user.name="Deepak Jain" -c user.email="deepujain@gmail.com" \254 commit -s --author="Deepak Jain <deepujain@gmail.com>" \255 -m 'fix(scope): concise summary'256```257258Verify every commit in the PR range has the correct author and sign-off. Do not259commit local PR-body files. Publish only when the user has authorized it; use260`--force-with-lease` after an authorized history rewrite.261262Target `develop` unless a maintainer explicitly requested a release branch.263Fill the repository PR template exactly:264265- `Overview`: problem, root cause, solution, and intentional non-goals.266- `DCO sign-off for the squash commit`: replace the placeholder with267 `Signed-off-by: Deepak Jain <deepujain@gmail.com>` including angle brackets.268- `Validation`: exact commands and observed results, plus honest limitations.269- Checklist: mark only claims actually satisfied.270- `Where should reviewers start?`: name the key file/test/design decision.271- `Related Issues`: use `Fixes` only when the whole issue is resolved; otherwise272 use `Relates to`.273274AIQ CI does not behave like ordinary push-triggered PR CI. A maintainer or275configured vetter comments `/ok to test`; copy-pr-bot mirrors the head to276`pull-request/<number>`, and required workflows run there. `/nvskills-ci` is277restricted to repository owners, organization members, and collaborators.278Maintainers use `/merge` only after checks, code-owner review, branch policy,279and review-thread requirements pass.280281## Shepherd an existing PR282283When given a PR URL or asked to `sweep`, update that PR rather than opening a284replacement:2852861. Read metadata, base/head, commits, files, labels, checks, reviews, top-level287 comments, and inline comments. Separate human, CodeRabbit, and bot feedback.2882. Confirm the branch is based on the intended current base and has no overlap289 that supersedes it.2903. Fix every current actionable finding with the smallest change. Explain a291 false positive or deliberate backport non-goal with evidence instead of292 expanding scope.2934. Rerun focused and adjacent validation. Rebase only when needed and reverify294 every DCO trailer afterward.2955. Push only with authorization, then reread the mirrored CI and reviews on the296 current head. Do not call the PR ready while `/ok to test`, code-owner review,297 a required check, or a review thread is pending.2986. Leave a short factual comment mapping fixes to commits/tests when useful.299300At the start of repeated sweeps, reconcile previously open authored PRs with the301current set. Classify disappeared PRs as merged, superseded, duplicate,302policy-blocked, or unresolved; record only reusable lessons.303304## Durable lessons from the latest merged sample305306- Separate release PRs from automated forward-merges; never copy bot PR bodies307 as contributor practice.308- Exact surface proof matters: clean container build plus runtime smoke, API or309 proxy-boundary test, config validation, or real research runs often provide310 stronger evidence than a generic suite alone.311- Reviewers expect docs, examples, notebooks, configs, skills, and runtime312 defaults to stay synchronized.313- Security/reliability changes need negative paths: sanitized exceptions,314 auth-cookie removal, platform support boundaries, structured provider errors,315 in-flight concurrency, and failure recovery.316- Backports should remain content-aligned with the original fix; explicitly317 defer unrelated improvements to avoid release/develop divergence.318- CodeRabbit findings are reviewed, fixed, or answered with evidence. A green319 status alone does not mean inline review threads are resolved.320321## Trigger phrases322323- `sweep` when the active repository context is AIQ.324- `Pick the next AIQ issue and follow the full contribution recipe.`325- `Prepare this AIQ change for PR.`326- `Fix or update this AIQ PR: <url>`