Skip to content

fix(evolution): keep skill contracts growth-safe - #9

Merged
jhinpan merged 1 commit into
mainfrom
fix/evolution-growing-contracts
Jul 23, 2026
Merged

fix(evolution): keep skill contracts growth-safe#9
jhinpan merged 1 commit into
mainfrom
fix/evolution-growing-contracts

Conversation

@jhinpan

@jhinpan jhinpan commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • stop requiring every newly harvested repo directory name in the 1024-character skill description
  • compare the runtime ID index against generated corpus-manifest.yaml instead of hardcoding 7,542
  • update representative skill triggers for ROCm/rocm-libraries and ATOM

Verification

  • python3 tests/test_validate.py
  • python3 tests/test_evolution.py
  • python3 scripts/validate.py
  • git diff --check

Found by the live rolling PR #6: automatically harvesting the 7,543rd page correctly updated the corpus manifest, but two legacy assertions still assumed a permanently fixed corpus and blocked CI.

Summary by Sourcery

Align validation and skill metadata with a dynamically growing corpus and updated ROCm kernel optimization sources.

Bug Fixes:

  • Relax the codex skill contract test to no longer require every harvested repo directory name to appear in the skill description, preventing failures as new repos are added.
  • Derive the expected runtime ID index size from corpus-manifest.yaml instead of a hardcoded constant so tests pass as new pages are harvested.

Enhancements:

  • Refresh ROCm kernel skill documentation to reference updated libraries and projects, including ROCm/rocm-libraries and ATOM, in its usage guidance.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@sourcery-ai

sourcery-ai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts evolution skill validation to be robust to growing corpora by removing brittle directory-name assertions, tying the ID index size check to the corpus manifest, and updating ROCm-related skill description triggers to reflect current project naming and scope.

Flow diagram for evolution skill validation against corpus manifest

flowchart TD
    A[run validate.py] --> B[load_evolution_skill]
    B --> C[load_corpus_manifest_yaml]
    C --> D[get_runtime_id_index_size]
    D --> E[compare_index_size_to_manifest]

    E -->|sizes_match| F[validation_passes]
    E -->|sizes_mismatch| G[raise_assertion]

    %% Previously: required every repo directory name in description
    B -. removed .-> H[assert_all_repo_directories_in_skill_description]
Loading

File-Level Changes

Change Details Files
Relax skill contract validation so descriptions no longer need to enumerate every harvested PR repo directory.
  • Remove loop asserting each repo directory name from sources/prs appears in the skill description.
  • Keep existing constraints on name format, description length, presence of merged-PR marker, line count limit, and path expectations.
tests/test_validate.py
Make the id_index size assertion depend on the generated corpus manifest instead of a hardcoded page count.
  • Load data/corpus-manifest.yaml with yaml.safe_load.
  • Assert that len(id_index()) equals manifest['counts']['unique_page_ids'] rather than a fixed integer.
  • Preserve temporary sys.path modifications and cleanup in the test setup.
tests/test_validate.py
Update ROCm kernel wiki skill metadata to align triggers with current ROCm/rocm-libraries and ATOM naming and scope.
  • Add ATOM to the list of supported implementation libraries in the description.
  • Update merged-PR evidence sources to reference ROCm/rocm-libraries and ATOM instead of older library names.
  • Retain overall skill purpose and exclusions unchanged.
SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • In test_get_page_scope_and_index, consider guarding access to manifest['counts']['unique_page_ids'] (e.g., with get or an explicit assertion on manifest structure) so a malformed or evolving manifest format fails with a clearer error than a KeyError.
  • Since corpus-manifest.yaml is read on every invocation of test_get_page_scope_and_index, you might want to cache the parsed manifest (e.g., via a fixture) to avoid repeated disk I/O if more tests start depending on it.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `test_get_page_scope_and_index`, consider guarding access to `manifest['counts']['unique_page_ids']` (e.g., with `get` or an explicit assertion on manifest structure) so a malformed or evolving manifest format fails with a clearer error than a `KeyError`.
- Since `corpus-manifest.yaml` is read on every invocation of `test_get_page_scope_and_index`, you might want to cache the parsed manifest (e.g., via a fixture) to avoid repeated disk I/O if more tests start depending on it.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jhinpan
jhinpan merged commit f28fc45 into main Jul 23, 2026
3 checks passed
@jhinpan
jhinpan deleted the fix/evolution-growing-contracts branch July 23, 2026 00:02
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.

1 participant