Skip to content

cli: surface the E602 skip warning on the compile error path (#1004)#1021

Merged
aallan merged 2 commits into
mainfrom
fix/1004-codegenskip-diagnostic
Jul 13, 2026
Merged

cli: surface the E602 skip warning on the compile error path (#1004)#1021
aallan merged 2 commits into
mainfrom
fix/1004-codegenskip-diagnostic

Conversation

@aallan

@aallan aallan commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

vera compile (text mode) now prints the E602 "function skipped" warning on the error path, so a CodegenSkip of a called function no longer surfaces as an opaque unknown func alone.

When CodegenSkip drops a function (an unsupported construct) that has a caller, the caller's dangling call $f fails WAT assembly with unknown func: failed to find name $f. cmd_compile returned after printing only the errors on the text path, so the E602 warning explaining why the function was skipped was dropped. The warning was already in result.diagnostics — the --json envelope emitted it — so this was purely a text-presentation gap.

Change

  • vera/cli.py — print accumulated warnings on the text error path too (the JSON error branch already included them); remove the now-covered pragma: no cover.
  • tests/test_cli.py — a text test (skipped now prints alongside unknown func), reproduced RED first, plus a JSON control that covers the other leg of the codegen-error branch.

Validation

Reproduced live first (hash(@Decimal) in a contract predicate skips h; main calls it): text mode showed only unknown func, JSON carried warnings: [E602]. RED text test confirmed the drop, GREEN after the fix. test_cli.py (262) + the #922 degradation suite pass; mypy, ruff, doc-counts, and site-assets gates green.

Docs

KNOWN_ISSUES + SKILL rows removed, the #1006 cross-ref de-staled, ROADMAP's PR-C retired (Stage 19 sprint count 11 → 10), CHANGELOG [Unreleased] entry, test counts reconciled (7402). Site assets regenerated.

Closes #1004

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • vera compile now shows the E602 “function skipped” warning alongside the related compilation errors on both text and JSON outputs.
    • Any accumulated warnings are printed to stderr for type-check and codegen failures (while JSON continues to include warnings).
  • Tests
    • Added/updated CLI regression coverage to ensure warnings are surfaced for the corrected text error paths.
  • Documentation
    • Updated project status, roadmap stage metrics, testing metrics, and known-issue guidance to reflect the fix and 7,403 tests.

When CodegenSkip drops a called function, the caller's dangling call fails WAT assembly with an opaque `unknown func`; cmd_compile returned on the text error path before printing warnings, so the E602 skip reason was dropped (the --json envelope already carried it). Print accumulated warnings on the error path too, and drop the now-covered pragma. Docs lockstep: KNOWN_ISSUES/SKILL rows removed, ROADMAP PR-C retired, CHANGELOG + counts.

Co-Authored-By: Claude <noreply@anthropic.invalid>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

vera compile now prints accumulated E602 code-generation skip warnings alongside text errors and retains them in JSON diagnostics. Regression tests cover called-function skips on both output paths and type-error warnings, while project documentation and test metrics are updated.

Changes

Compile diagnostics

Layer / File(s) Summary
Emit warnings on compile errors
vera/cli.py, tests/test_cli.py
cmd_compile prints accumulated type-checking and code-generation warnings on failure, while tests verify E602 and E200 warnings in text output and E602 in JSON output.
Update regression and project records
CHANGELOG.md, KNOWN_ISSUES.md, README.md, ROADMAP.md, SKILL.md, TESTING.md
Project records document the resolved diagnostic issue and update reported test totals and CLI test counts.

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

Suggested labels: compiler, tests, docs

🚥 Pre-merge checks | ✅ 8
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main fix: surfacing the E602 skip warning on compile error paths for issue #1004.
Linked Issues check ✅ Passed The code and tests now print the skipped-function warning alongside the compile error, matching #1004.
Out of Scope Changes check ✅ Passed The docs, changelog, and test-count updates are all described in the PR objectives and support the same fix.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Changelog Covers Public-Surface Changes ✅ Passed CHANGELOG.md explicitly documents #1004’s CLI text-output warning fix, including the codegen and type-error paths, so the public-surface change is covered.
Spec And Implementation Move Together ✅ Passed No spec/ files changed, and the vera/cli.py edit only changes warning presentation on error paths, not parser/checker/verifier/codegen semantics.
Diagnostics Carry An Error Code ✅ Passed The PR only surfaces existing diagnostics; the touched ones all carry stable codes (E602, E121, E200), and no new code-less diagnostic was added.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1004-codegenskip-diagnostic

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.51%. Comparing base (4864506) to head (091ff64).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1021   +/-   ##
=======================================
  Coverage   93.51%   93.51%           
=======================================
  Files          96       96           
  Lines       32005    32017   +12     
  Branches      456      456           
=======================================
+ Hits        29929    29941   +12     
  Misses       2063     2063           
  Partials       13       13           
Flag Coverage Δ
javascript 78.41% <ø> (ø)
python 95.29% <100.00%> (+<0.01%) ⬆️

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a presentation gap in vera compile's text output: when a CodegenSkip drops a called function, the E602 "function skipped" warning is now printed alongside the downstream unknown func assembly error instead of being silently dropped. The same asymmetry on the type-error text path is corrected in the same pass.

  • vera/cli.py: Adds for w in all_warnings: print(...) before the error loop on the codegen-error text path, and mirrors the same fix for type_warnings on the type-error text path; removes the now-covered pragma: no cover.
  • tests/test_cli.py: Adds three regression tests — text-path E602 visibility, JSON-path E602 control, and type-warning visibility on the type-error path — each confirmed RED before the fix.
  • Docs/meta: KNOWN_ISSUES removes the resolved CodegenSkip of a CALLED function surfaces as an opaque unknown-func error — the E602 skip diagnostic is suppressed on the error path #1004 row, SKILL/docs copies drop the obsolete workaround row, ROADMAP retires PR-C and decrements the sprint count, and test-count figures are updated to 7,403.

Confidence Score: 5/5

Safe to merge — a small, targeted text-output addition with no behavioural changes to compilation logic and full regression coverage.

The change touches only the stderr-printing loops on two error return paths in cmd_compile; the actual compiler pipeline is untouched. Both new code paths are exercised by tests confirmed RED before the fix, the previously-noted type-error path asymmetry has been addressed in this same PR, and all documentation counts are internally consistent.

No files require special attention.

Important Files Changed

Filename Overview
vera/cli.py Adds warning printing before errors on both the type-error text path (new) and codegen-error text path (primary fix); removes the pragma: no cover now covered by the new test
tests/test_cli.py Adds three regression tests: text-path E602 warning visible, JSON-path E602 warning (control), and type-error text path warning visibility — each validated RED-first
CHANGELOG.md Adds [Unreleased] Fixed entry covering both the codegen-error and type-error path corrections
KNOWN_ISSUES.md Removes the now-resolved #1004 row; updates the #1006 cross-ref to reflect E602 is now visible even when a caller exists
ROADMAP.md Retires PR-C row, reduces sprint count from 11 to 10, updates test count to 7,403
TESTING.md Updates test_cli.py count (260 to 263) and line count (4,033 to 4,109) to match the three new tests; updates total tests to 7,403
SKILL.md Removes the now-obsolete Opaque unknown func after a skip workaround row
docs/SKILL.md Mirror of SKILL.md: same row removed from the docs copy
docs/llms-full.txt Mirror of SKILL.md: same row removed from the LLM-readable asset
README.md Updates test count in the project status line from 7,400 to 7,403

Reviews (2): Last reviewed commit: "cli: also print type_warnings on the com..." | Re-trigger Greptile

@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

🤖 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 `@ROADMAP.md`:
- Around line 17-29: Add a one-sentence entry for completed issue `#1004` to the
relevant current Stage table in HISTORY.md, matching the table’s existing style
and documenting the CLI-diagnostics work. Do not modify the ROADMAP.md diff or
add unrelated history details.

In `@tests/test_cli.py`:
- Around line 755-774: Update test_compile_skip_warning_shown_on_error_path_1004
to assert the specific E602 diagnostic marker "[E602]" instead of the broad
"skipped" substring, while preserving the existing unknown-func assertion and
error-path expectations.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9a33dac5-49cc-49af-a22e-ef0968ed1c0b

📥 Commits

Reviewing files that changed from the base of the PR and between 4864506 and 0983df5.

⛔ Files ignored due to path filters (2)
  • docs/SKILL.md is excluded by !docs/**
  • docs/llms-full.txt is excluded by !docs/**
📒 Files selected for processing (8)
  • CHANGELOG.md
  • KNOWN_ISSUES.md
  • README.md
  • ROADMAP.md
  • SKILL.md
  • TESTING.md
  • tests/test_cli.py
  • vera/cli.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • aallan/vera-bench (manual)
💤 Files with no reviewable changes (1)
  • SKILL.md

Comment thread ROADMAP.md
Comment thread tests/test_cli.py
…eview)

Greptile review flagged the sibling asymmetry: cmd_compile's text type-error path dropped type_warnings while its JSON branch carried them — the same class as the codegen-error path this PR fixed. Mirror the warning-print there, tested with a type-error + E200-warning program. Also tighten the skip-warning test to assert the [E602] code marker (CodeRabbit). Counts +1 -> 7403.

Co-Authored-By: Claude <noreply@anthropic.invalid>

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

Caution

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

⚠️ Outside diff range comments (1)
vera/cli.py (1)

448-455: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Emit accumulated warnings on the --target wasi-p2 error path. In vera/cli.py, the emit_wasi_component(...) ValueError branch still prints only Error: ... in text mode, while the JSON branch includes all_warnings. Print those warnings there too so compile failures don’t drop the earlier diagnostics.

🤖 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 `@vera/cli.py` around lines 448 - 455, Update the text-mode ValueError handling
in emit_wasi_component to print every accumulated warning from all_warnings to
stderr alongside the existing error message. Preserve the JSON branch and
warning formatting already used elsewhere.
🤖 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.

Outside diff comments:
In `@vera/cli.py`:
- Around line 448-455: Update the text-mode ValueError handling in
emit_wasi_component to print every accumulated warning from all_warnings to
stderr alongside the existing error message. Preserve the JSON branch and
warning formatting already used elsewhere.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 02f1dbd8-c84f-4180-bb62-8c69ea3e226a

📥 Commits

Reviewing files that changed from the base of the PR and between 0983df5 and 091ff64.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • README.md
  • ROADMAP.md
  • TESTING.md
  • tests/test_cli.py
  • vera/cli.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • aallan/vera-bench (manual)

@aallan aallan merged commit b87d02a into main Jul 13, 2026
28 checks passed
@aallan aallan deleted the fix/1004-codegenskip-diagnostic branch July 13, 2026 15:40
@aallan

aallan commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai The outside-diff finding on vera/cli.py is valid, and thank you for catching it — it was missed before this PR merged. The --target wasi-p2 emit_wasi_component ValueError text path dropped accumulated warnings (the JSON branch already carried them), the third sibling of the type-error and codegen-error paths corrected here. Since this PR is already merged, it's addressed in follow-up #1022 (commit 6daa5c5): warnings now print on that path too, with a RED-first test using an unsupported-family (<Http>) program carrying an uncalled E602 skip warning.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@aallan Thanks for confirming and for the quick follow-up. Good catch tracking down the third sibling — makes sense that emit_wasi_component's ValueError path on --target wasi-p2 had the same JSON-vs-text asymmetry as the type-error and codegen-error branches. The RED-first test approach with an unsupported-family (<Http>) program carrying an uncalled E602 skip warning sounds like a solid regression guard for that specific path. I'll take a look at #1022 (commit 6daa5c5) when it's up for review.


✏️ Learnings added
Learnt from: aallan
URL: https://github.com/aallan/vera/pull/1021

Timestamp: 2026-07-13T16:01:37.216Z
Learning: In vera/cli.py's `cmd_compile`, there are (at least) three sibling failure paths that must each print accumulated warnings to stderr in the text-output branch (the JSON branch already includes warnings): the type-error path (`type_warnings`), the codegen-error path (`all_warnings`), and the `--target wasi-p2` `emit_wasi_component` `ValueError` path. The third path was missed in PR `#1021` and fixed in follow-up PR `#1022` (commit 6daa5c5), with a regression test using an unsupported-family (`<Http>`) program carrying an uncalled E602 skip warning.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

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.

CodegenSkip of a CALLED function surfaces as an opaque unknown-func error — the E602 skip diagnostic is suppressed on the error path

1 participant