Skip to content

Surface audit

Surface audit #504

Workflow file for this run

name: Surface audit
# Runs the Layer B symbol-level surface audit: enumerate the TypeScript
# port's public API, diff against porting-sdk/python_surface.json, and fail
# if any drift is not covered by PORT_OMISSIONS.md or PORT_ADDITIONS.md.
env:
# Opt into Node.js 24 ahead of GitHub's 2026-06-02 default switch.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
on:
pull_request:
push:
branches: [main]
schedule:
# Nightly at 06:00 UTC — keeps us in sync with porting-sdk updates that
# follow upstream signalwire-python additions.
- cron: '0 6 * * *'
jobs:
surface-audit:
runs-on: ubuntu-latest
steps:
- name: Checkout TypeScript SDK
uses: actions/checkout@v7
with:
path: typescript-sdk
- name: Checkout porting-sdk (contains python_surface.json)
uses: actions/checkout@v7
with:
repository: signalwire/porting-sdk
# Coordinated-pass pin: 'main' normally; set the PORTING_SDK_REF repo variable
# to a wave branch to test a coordinated porting-sdk change, declared on the PR
# (see porting-sdk/COORDINATED_PASS.md). No revert commit.
ref: ${{ vars.PORTING_SDK_REF || 'main' }}
path: porting-sdk
token: ${{ secrets.PORTING_SDK_TOKEN }}
- name: Install porting-sdk script dependencies
# NOT optional: the gate scripts reach the reference oracle through
# generate_rest.py, which needs PyYAML, and a swallowed ImportError turned its
# absence into an EMPTY oracle — 266 gated members silently vanished and the diff
# reported "311 symbols missing from port" against a port that was correct.
run: python3 -m pip install --quiet -r ${{ github.workspace }}/porting-sdk/scripts/requirements.txt
- name: Setup Node
uses: actions/setup-node@v7
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: typescript-sdk/package-lock.json
- name: Setup Python (for diff_port_surface.py)
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install TS deps
working-directory: typescript-sdk
run: npm ci
- name: Enumerate TypeScript public API surface
working-directory: typescript-sdk
env:
PORTING_SDK_PATH: ${{ github.workspace }}/porting-sdk
run: npx tsx scripts/enumerate-surface.ts
- name: Diff against Python reference
working-directory: typescript-sdk
run: |
python3 ${{ github.workspace }}/porting-sdk/scripts/diff_port_surface.py \
--reference ${{ github.workspace }}/porting-sdk/python_surface.json \
--port-surface port_surface.json \
--omissions PORT_OMISSIONS.md \
--additions PORT_ADDITIONS.md