Merge branch 'master' into worktree-windows-runtime

This commit is contained in:
Tianyi Cui
2026-07-20 20:39:13 +08:00
1064 changed files with 22568 additions and 10875 deletions

View File

@@ -1,7 +1,7 @@
name: Build single-exe
# Native builds for the release targets; see
# docs/rfc/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.md.
# .agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.md.
# A full target run retains one SDK wheel and three runtime wheels; subset
# dispatch retains the SDK wheel and selected runtime wheels. Bare executables
# and source closures are test inputs. Run manually or label a PR

View File

@@ -23,7 +23,7 @@ name: E2E (real DeepSeek API)
# in the BASE repo's context WITH secrets while still able to check out untrusted
# fork code — a textbook key-leak vector, especially once this repo is public.
# The fork/secret model and its public-repo implications are recorded in
# docs/rfc/implemented/testing/2026-06-19-real-api-e2e-ci.md.
# .agents/notes/implemented/testing/2026-06-19-real-api-e2e-ci.md.
#
# Note: scheduled triggers are auto-disabled after 60 days of repo inactivity;
# push/pull_request/workflow_dispatch act as backstops.

View File

@@ -0,0 +1,21 @@
name: Expected filenames
on:
pull_request:
paths:
- '*[gG][oO][lL][dD][eE][nN]*'
- '**/*[gG][oO][lL][dD][eE][nN]*'
- '!vendor/**'
permissions:
contents: read
jobs:
expected-filenames:
name: no golden filenames
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check tracked filenames
run: scripts/check-expected-filenames.sh

127
.github/workflows/landlock-run.yml vendored Normal file
View File

@@ -0,0 +1,127 @@
# Manually-dispatched CI for the landlock-run source of record
# (native/landlock-run). A separate workflow from ci.yml on purpose: the
# subtree is a self-contained pnpm workspace with its own gates, exercised on
# demand — per-architecture native legs (build + behavioral tests + pack
# rehearsal on real kernels) plus one darwin leg proving the documented
# degradation on hosts without a platform package. Legs derive from the
# subtree's checked-in package matrix (scripts/github-matrix.mjs). Packing
# for npm happens in the release mirror (node-addon-landlock-run) after an
# export — see native/README.md; this workflow never packs for release.
name: Landlock Run
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
working-directory: native/landlock-run
jobs:
matrix:
name: Matrix
runs-on: ubuntu-24.04
outputs:
ci: ${{ steps.matrix.outputs.ci }}
steps:
- uses: actions/checkout@v4
- id: matrix
run: echo "ci=$(node ./scripts/github-matrix.mjs ci)" >> "$GITHUB_OUTPUT"
native:
name: ${{ matrix.platform }}
needs: matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.ci) }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
package_json_file: native/landlock-run/package.json
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: native/landlock-run/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install musl toolchain
run: |
sudo apt-get update -q
sudo apt-get install -yq musl-tools
- name: Build TypeScript
run: pnpm build:ts
- name: Typecheck
run: pnpm typecheck
- name: Build native binaries (this architecture is the builder of record)
run: pnpm build:native
- name: Entry tests (keyless)
run: node ./test/entry.test.js
# NALR_REQUIRE_LANDLOCK: a self-skip on the very platform that exists to
# prove enforcement would be a false green, so an unenforcing kernel
# fails the leg instead of skipping.
- name: Launcher tests (real kernel enforcement)
run: node ./test/launcher.test.js
env:
NALR_REQUIRE_LANDLOCK: 1
- name: Pack rehearsal (pack → install → confine, this platform only)
run: |
node ./scripts/pack-release.mjs .release/npm --current-platform-only
node ./scripts/verify-packed-install.mjs .release/npm --current-platform-only
env:
NALR_REQUIRE_LANDLOCK: 1
darwin:
name: darwin (no platform package — degradation proof)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
package_json_file: native/landlock-run/package.json
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: native/landlock-run/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build TypeScript
run: pnpm build:ts
- name: Typecheck
run: pnpm typecheck
- name: Entry tests (keyless)
run: node ./test/entry.test.js
- name: Launcher tests (must self-skip cleanly)
run: node ./test/launcher.test.js
- name: Pack rehearsal (entry only — fallback resolution + unusable probe)
run: |
node ./scripts/pack-release.mjs .release/npm --current-platform-only
node ./scripts/verify-packed-install.mjs .release/npm --current-platform-only

View File

@@ -0,0 +1,78 @@
name: E2E (pi-ai Azure OpenAI and Anthropic)
# This suite spends tokens against two external providers and is intentionally
# opt-in. It has no push, pull_request, schedule, or workflow_call trigger.
on:
workflow_dispatch:
inputs:
azure_openai_model:
description: Azure OpenAI model from pi-ai's installed catalog
required: true
default: gpt-5.5
type: string
anthropic_model:
description: Anthropic model from pi-ai's installed catalog
required: true
default: claude-opus-4-8
type: string
permissions:
contents: read
jobs:
e2e:
runs-on: ubuntu-latest
name: Azure OpenAI Responses + Anthropic Messages
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Enable corepack (pnpm)
run: corepack enable
- name: Resolve pnpm store path
id: pnpm-store
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-24-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-24-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
# The tests self-skip locally when a credential is absent. A manually
# dispatched CI run must fail instead of reporting an all-skipped green.
- name: Preflight (require provider API keys)
env:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY_EXTERNAL }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY_EXTERNAL }}
run: |
set -euo pipefail
missing=0
for name in AZURE_OPENAI_API_KEY ANTHROPIC_API_KEY; do
if [ -z "${!name:-}" ]; then
echo "::error::${name} is empty. Configure the corresponding *_EXTERNAL repository secret."
missing=1
fi
done
exit "$missing"
- name: E2E tests (real Azure OpenAI and Anthropic APIs)
env:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY_EXTERNAL }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY_EXTERNAL }}
DSH_PI_AI_OPENAI_MODEL: ${{ inputs.azure_openai_model }}
DSH_PI_AI_OPENAI_BASE_URL: https://openai-routerhub-resource.services.ai.azure.com/api/projects/openai/openai/v1
DSH_PI_AI_ANTHROPIC_MODEL: ${{ inputs.anthropic_model }}
DSH_E2E_MAX_WORKERS: 2
run: >-
pnpm exec vitest run --config vitest.e2e.config.ts
packages/llm/llm-pi-ai/tests/provider-apis.e2e.ts

View File

@@ -19,7 +19,7 @@ permissions:
contents: read
jobs:
# Keyless real-kernel sandbox proofs (sandbox RFC § Testing): each ladder
# Keyless real-kernel sandbox proofs (sandbox Agent Note § Testing): each ladder
# rung is only provable on a host where it enforces, so this job fans out
# an OS×runner matrix — bwrap and Landlock on Linux (separate legs: the
# Landlock files force the bwrap rung off, so each leg proves exactly one