Skip to content

Refresh truth-ledger manifest #61

Refresh truth-ledger manifest

Refresh truth-ledger manifest #61

name: Refresh truth-ledger manifest
# Truth-ledger needs the broader AGIRAILS monorepo layout — sibling
# SDK / Platform / Protocol repos. This workflow checks them out
# alongside the docs repo to match the local-dev layout, runs
# scripts/build-truth-ledger.ts, and opens a PR if the generated
# static/sdk-manifest.json differs from what's committed.
#
# Three triggers:
# - workflow_dispatch: manual (Damir runs when source repos have moved)
# - schedule: daily safety net (catches drift if no manual trigger)
# - repository_dispatch (event: 'source-released'): downstream from
# SDK release workflows that emit a webhook
#
# IMPORTANT: this workflow assumes the source repos are public so the
# default GITHUB_TOKEN can clone them. If any go private later, swap
# `token: ${{ secrets.GITHUB_TOKEN }}` for a PAT secret with read scope
# on the source repos.
on:
workflow_dispatch:
schedule:
# Daily at 06:00 UTC — catches drift even if no one triggers manually
- cron: '0 6 * * *'
repository_dispatch:
types: [source-released]
permissions:
contents: write
pull-requests: write
jobs:
refresh:
runs-on: ubuntu-latest
steps:
# Workspace layout we build:
# $GITHUB_WORKSPACE/
# docs-site/
# SDK and Runtime/
# sdk-js/
# python-sdk-v2/
# Protocol/actp-kernel/
# Platform/agirails-mcp-server/
# Platform/agirails.app/web/
- name: Checkout docs-site
uses: actions/checkout@v4
with:
path: docs-site
- name: Checkout sdk-js (TypeScript SDK)
uses: actions/checkout@v4
with:
repository: agirails/sdk-js
path: 'SDK and Runtime/sdk-js'
- name: Checkout python-sdk (sdk-python repo, local path python-sdk-v2)
uses: actions/checkout@v4
with:
repository: agirails/sdk-python
path: 'SDK and Runtime/python-sdk-v2'
- name: Checkout actp-kernel
uses: actions/checkout@v4
with:
repository: agirails/actp-kernel
path: Protocol/actp-kernel
- name: Checkout mcp-server
uses: actions/checkout@v4
with:
repository: agirails/agirails-mcp-server
path: Platform/agirails-mcp-server
- name: Checkout agirails.app (private repo — needs PAT)
uses: actions/checkout@v4
with:
repository: agirails/agirails.app
path: Platform/agirails.app/web
# agirails/agirails.app is a private repo. Default GITHUB_TOKEN
# cannot cross-org-clone private repos; we use a DamirAGI PAT
# stored as repo secret AGIRAILS_APP_PAT (repo scope).
token: ${{ secrets.AGIRAILS_APP_PAT }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install docs-site deps
working-directory: docs-site
run: npm ci
- name: Pre-flight check
working-directory: docs-site
run: npm run truth-ledger:check
- name: Run truth-ledger
working-directory: docs-site
env:
# Strict mode hard-fails on Sourcify deployment-mismatch.
# CI is exactly where we want this gate.
CI_STRICT: 'true'
run: npm run truth-ledger
- name: Render auto-extracted reference pages
# Consumes static/sdk-manifest.json → writes docs/reference/{contracts,cli,mcp-server}/*.md
# If manifest is content-unchanged from emit.ts's idempotent compare,
# render still runs (cheap) but git will see no diff.
working-directory: docs-site
run: npm run render-reference
- name: Run compat tests
working-directory: docs-site
run: npx vitest run scripts/truth-ledger/__tests__/
- name: Open PR if manifest changed
uses: peter-evans/create-pull-request@v7
with:
path: docs-site
branch: chore/truth-ledger-refresh
commit-message: |
chore(truth-ledger): refresh manifest from source
Auto-regenerated by .github/workflows/truth-ledger-refresh.yml
on ${{ github.event_name }}.
Source versions captured in manifest._sourceVersions.
title: 'chore(truth-ledger): auto-refresh manifest'
body: |
Truth-ledger workflow regenerated `static/sdk-manifest.json`
from current source. Review the diff for:
- `_sourceVersions` — which SDK / mcp-server versions are pinned
- `divergences.summary` — any new ts_only / python_only entries
- `contracts` — `verified_status` per address
- any `_extraction_warning` flags
**Triggered by**: `${{ github.event_name }}`
**Run**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
labels: |
truth-ledger
automated
delete-branch: true