Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,20 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: run clippy on wasm
run: cargo clippy --manifest-path=crates/wasm/Cargo.toml -- -Dwarnings

- name: Ensure docs generate no warnings
run: cargo doc

- name: Ensure Lib/_opcode_metadata is updated
run: |
python scripts/generate_opcode_metadata.py
if [ -z "$(git status --porcelain)" ]; then
exit 1
fi
Comment on lines +334 to +339
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix inverted validation logic - critical correctness issue.

The condition checks if the working tree is clean (no changes) and exits with failure in that case. This is backwards: the check should fail when changes are detected (metadata is stale) and pass when no changes are detected (metadata is current).

Currently:

  • Metadata up-to-date (no changes) → Fails ❌
  • Metadata stale (changes detected) → Passes ❌

Expected:

  • Metadata up-to-date (no changes) → Passes ✅
  • Metadata stale (changes detected) → Fails ✅
🐛 Fix to invert the logic
       - name: Ensure Lib/_opcode_metadata is updated
         run: |
           python scripts/generate_opcode_metadata.py
-          if [ -z "$(git status --porcelain)" ]; then
+          if [ -n "$(git status --porcelain)" ]; then
+            echo "Error: Lib/_opcode_metadata is out of date. Run 'python scripts/generate_opcode_metadata.py' locally and commit the changes."
             exit 1
           fi

The fix changes -z (zero length/empty) to -n (non-zero length/not empty) and adds a helpful error message.

🤖 Prompt for AI Agents
In @.github/workflows/ci.yaml around lines 334 - 339, The CI step "Ensure
Lib/_opcode_metadata is updated" has inverted logic: it currently fails when the
working tree is clean because it uses if [ -z "$(git status --porcelain)" ] then
exit 1; fix it by inverting the test to if [ -n "$(git status --porcelain)" ]
then echo a helpful message (e.g. "Lib/_opcode_metadata out of date") and exit
1; keep running python scripts/generate_opcode_metadata.py and use the git
status --porcelain output to decide failure so the job only fails when changes
are present.


- name: Install ruff
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-auto-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:

- run: ruff format
- run: ruff check --select I --fix
- run: python scripts/generate_opcode_metadata.py

- name: Configure git
run: |
Expand Down
4 changes: 4 additions & 0 deletions Lib/_opcode_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

_specializations = {}





_specialized_opmap = {}

opmap = {
Expand Down
Loading