Skip to content

Conversation

@ricochet
Copy link
Contributor

@ricochet ricochet commented Jan 7, 2026

Linter for @since Annotations in WIT Files:

  • Validates @since or @unstable annotations on top-level declarations (interfaces, worlds, types, records, variants, enums, flags, resources)
  • Excludes deps/ directories (vendored code)
  • Outputs GitHub Actions annotation format for clickable error links
  • Can be run standalone: node .github/scripts/validate-since.js

I think a better approach would be to have the AST and inspect the annotations directly rather than regexing the source, but this was faster to implement and immediately useful. If we ever run into issues, I'm game to convert this to something more robust.

Added missing @since annotations to:

  • proposals/filesystem/wit/types.wit - directory-entry, error-code
  • proposals/filesystem/wit-0.3.0-draft/types.wit - directory-entry, error-code
  • proposals/http/wit-0.3.0-draft/types.wit - 18 declarations (interface, variants, records, types, resources)
  • proposals/http/wit-0.3.0-draft/worlds.wit - 4 declarations (2 worlds, 2 interfaces)

When a PR changes WIT files, it will:

  1. Validate WIT syntax (existing)
  2. Validate wasm encoding (existing)
  3. Validate @since annotations (new) - fails CI if any top-level declaration is missing @since or @unstable

Example error output:
::error file=proposals/http/wit/types.wit,line=5::Missing @since annotation for interface 'types'

Fixes #865

@ricochet ricochet requested review from a team as code owners January 7, 2026 17:01
@github-actions github-actions bot added P-filesystem Proposal: wasi-filesystem P-http Proposal: wasi-http github_actions Pull requests that update GitHub Actions code labels Jan 7, 2026
@badeend
Copy link
Member

badeend commented Jan 7, 2026

I think a better approach would be to have the AST and inspect the annotations directly rather than regexing the source, but this was faster to implement and immediately useful. If we ever run into issues, I'm game to convert this to something more robust.

Well, as long as it works: 👍

@yoshuawuyts
Copy link
Member

@ricochet can you rebase the commits here to put @since in backticks? Right now we're mentioning a GitHub user, which will ping them anytime this repo is rebased and the like.

Screenshot 2026-01-07 at 18 35 25

badeend
badeend previously approved these changes Jan 7, 2026
@ricochet ricochet requested a review from a team as a code owner January 8, 2026 17:20
@github-actions github-actions bot added P-cli Proposal: wasi-cli dependencies Pull requests that update a dependency file labels Jan 8, 2026
@ricochet ricochet requested a review from yoshuawuyts January 8, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code P-cli Proposal: wasi-cli P-filesystem Proposal: wasi-filesystem P-http Proposal: wasi-http

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI enhancement: lint for since version

5 participants