Skip to content

feat(examples): promote the payment-failure-triage demo (#104) #257

feat(examples): promote the payment-failure-triage demo (#104)

feat(examples): promote the payment-failure-triage demo (#104) #257

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Lock file drift check
run: |
if grep -qE '"packages/[^"]+/node_modules/@codespar/' package-lock.json; then
echo "::error::package-lock.json contains nested @codespar/* installs; workspace cross-deps must resolve via symlinks, not tarballs. Run 'rm package-lock.json && npm install' locally, then commit the regenerated lock."
grep -nE '"packages/[^"]+/node_modules/@codespar/' package-lock.json
exit 1
fi
- name: Install dependencies
run: npm ci
- name: Build, typecheck, and test
run: npx turbo run build typecheck test
- name: Security audit
run: npm audit --omit=dev
validate-example-skeleton:
runs-on: ubuntu-latest
# GitHub-hosted runners ship with Docker. This job runs the
# examples/pix-nfse-skeleton/ end-to-end via the published runtime
# image at ghcr.io/codespar/codespar:latest, so a regression in
# the SDK <-> bridge wire contract fails this job loudly.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: examples/pix-nfse-skeleton/package-lock.json
- name: Install example dependencies
working-directory: examples/pix-nfse-skeleton
run: npm ci
- name: Run the walking skeleton end-to-end
working-directory: examples/pix-nfse-skeleton
run: npm run validate
validate-example-nfse-from-natural-language:
runs-on: ubuntu-latest
# Exercises the natural-language NFS-e example end-to-end via the
# published runtime image at ghcr.io/codespar/codespar:latest. Boots
# @copilotkit/aimock on port 4010 as the stand-in Anthropic API and
# points the runtime's ANTHROPIC_BASE_URL at it — so a regression in
# the runtime's LLM tool-use loop fails this job loudly.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: examples/nfse-from-natural-language/package-lock.json
- name: Install example dependencies
working-directory: examples/nfse-from-natural-language
run: npm ci
- name: Run the natural-language NFS-e example end-to-end
working-directory: examples/nfse-from-natural-language
run: npm run validate
validate-example-whatsapp-installment-negotiation:
runs-on: ubuntu-latest
# Exercises the multi-turn installment-negotiation example end-to-end
# via the published runtime image at ghcr.io/codespar/codespar:latest.
# Three buyer messages drive three session.send() calls; the Asaas
# MCP is exercised twice (preview + create) and the Nuvem Fiscal +
# Z-API MCPs once each — so a regression in session.send() state
# management across turns fails this job loudly.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: examples/whatsapp-installment-negotiation/package-lock.json
- name: Install example dependencies
working-directory: examples/whatsapp-installment-negotiation
run: npm ci
- name: Run the installment-negotiation example end-to-end
working-directory: examples/whatsapp-installment-negotiation
run: npm run validate
# Meta-tool example demos. Each runs an example end-to-end against the codespar
# runtime + aimock, replaying a fixed conversation so the meta-tool flow
# (codespar_pay / codespar_invoice / codespar_notify) is exercised
# deterministically. The image is pinned to :main because the meta-tool mock
# seam + CODESPAR_PLUGINS startup loader reach :latest only on a tagged runtime
# release; switch back to :latest once a release ships them. A fast fixtures-sync
# step first catches any drift between the checked-in aimock fixtures and the
# canonical scenario in @codespar/types/testing, without booting a runtime.
validate-example-service-invoice-meta-tool:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: examples/service-invoice-meta-tool/package-lock.json
- name: Install example dependencies
working-directory: examples/service-invoice-meta-tool
run: npm ci
- name: Fixtures stay in sync with the published scenario
working-directory: examples/service-invoice-meta-tool
run: npx vitest run fixtures-sync
- name: Run the service-invoice meta-tool demo end-to-end
working-directory: examples/service-invoice-meta-tool
env:
CODESPAR_RUNTIME_IMAGE: ghcr.io/codespar/codespar:main
run: npm run validate
validate-example-installment-negotiation-meta-tool:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: examples/installment-negotiation-meta-tool/package-lock.json
- name: Install example dependencies
working-directory: examples/installment-negotiation-meta-tool
run: npm ci
- name: Fixtures stay in sync with the published scenario
working-directory: examples/installment-negotiation-meta-tool
run: npx vitest run fixtures-sync
- name: Run the installment-negotiation meta-tool demo end-to-end
working-directory: examples/installment-negotiation-meta-tool
env:
CODESPAR_RUNTIME_IMAGE: ghcr.io/codespar/codespar:main
run: npm run validate
validate-example-payment-failure-triage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: examples/payment-failure-triage/package-lock.json
- name: Install example dependencies
working-directory: examples/payment-failure-triage
run: npm ci
- name: Fixtures stay in sync with the published scenarios
working-directory: examples/payment-failure-triage
run: npx vitest run fixtures-sync
- name: Dual-runtime divergence gate (OSS side — completeness + version-alignment)
working-directory: examples/payment-failure-triage
run: npx vitest run manifest-parity
- name: Run the payment-failure-triage demo end-to-end
working-directory: examples/payment-failure-triage
env:
CODESPAR_RUNTIME_IMAGE: ghcr.io/codespar/codespar:main
run: npm run validate