|
48551
|
27246
|
116
|
5
|
7f603d3ee205f8cd2b45a24f4acb597bfd45a403
|
0
|
Static checks (locked engineering dependency)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
public-static:
name: Static checks (locked engineering dependency)
runs-on: ubuntu-latest
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Test bounded Action preparation (synthetic credentials only)
run: PYTHONDONTWRITEBYTECODE=1 python3 ci/test-prepare-actions.py
- name: Test image release credential preflight (synthetic credentials only)
run: node --test .github/scripts/test/*.test.mjs
- name: Install contracts dependencies (public npm only, frozen lockfile; CT-1 build / validators / generated-types check)
run: pnpm --dir contracts install --frozen-lockfile
- name: Install dictionary service dependencies (independent frozen lockfile)
run: pnpm --dir runtime/services/master-data-registry install --frozen-lockfile
- name: Docker CLI for pinned-image syntax checks (runner images may ship without it)
run: command -v docker >/dev/null || { apt-get update && apt-get install -y --no-install-recommends docker.io; }
- name: Caddy and alert rule syntax (compose-pinned images; skipped fails here)
run: |
pnpm check:caddy
pnpm check:otel
env:
CHECK_SYNTAX_REQUIRED: "1"
- name: Governance checks (exact engineering package; public contracts dependencies)
run: |
pnpm check:module-imports
pnpm check:canonical-ids
pnpm check:code-sets
pnpm check:omni-platform
pnpm check:fact-pii
pnpm check:catalog
pnpm check:migration-decs
pnpm test
pnpm contracts:check:local
- name: Pack publishable packages (contracts + governance; no publish)
run: |
rm -rf dist-artifacts
pnpm --dir contracts build
pnpm --dir governance pack --pack-destination ../dist-artifacts
pnpm --dir contracts pack --pack-destination ../dist-artifacts
ls -la dist-artifacts
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload package tarballs
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-packages-${{ env.CANDIDATE_TAG }}
path: dist-artifacts/*.tgz
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload public static evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-public-static-${{ env.CANDIDATE_TAG }}
path: reports/*.latest.json
retention-days: "30"
timeout-minutes: "15"
permissions:
contents: read
...
|
public-static
|
null
|
["ubuntu-latest"]
|
39288
|
2
|
1794234067
|
1794234067
|
1794234067
|
1794234067
|
|
0
|
|
0
|
Edit
Delete
|
|
48552
|
27246
|
116
|
5
|
7f603d3ee205f8cd2b45a24f4acb597bfd45a403
|
0
|
Static governance (repo root, private packages)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
static:
name: Static governance (repo root, private packages)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Install contracts dependencies (public npm only, frozen lockfile; CT-1 build / validators / generated-types check)
run: pnpm --dir contracts install --frozen-lockfile
- name: Install dictionary service dependencies (independent frozen lockfile)
run: pnpm --dir runtime/services/master-data-registry install --frozen-lockfile
- name: Generate Prisma clients
run: pnpm --dir runtime prisma:generate
- name: Build runtime modules (fixture suites evaluate migrated rules from dist)
run: pnpm runtime:build:modules
- name: Repo-root governance gate
run: pnpm check
- name: Source tree must stay clean apart from latest reports (no tracked .npmrc mutation)
run: |
git status --porcelain | grep -vE '\.latest\.json$' && { echo "::error::静态门禁修改了报告以外的跟踪文件"; exit 1; } || echo "clean apart from latest reports"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload static evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-static-${{ env.CANDIDATE_TAG }}
path: |
reports/*.latest.json
runtime/reports/*.latest.json
!runtime/reports/runtime-acceptance.latest.json
!runtime/reports/ui-acceptance.latest.json
retention-days: "30"
timeout-minutes: "30"
permissions:
contents: read
...
|
static
|
null
|
["ubuntu-latest"]
|
39289
|
2
|
1794234069
|
1794234069
|
1794234067
|
1794234069
|
|
0
|
|
0
|
Edit
Delete
|
|
48553
|
27246
|
116
|
5
|
7f603d3ee205f8cd2b45a24f4acb597bfd45a403
|
0
|
Unit tests without DB (modules / packages / govern Unit tests without DB (modules / packages / governance)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
unit:
name: Unit tests without DB (modules / packages / governance)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Generate clients for authority module unit imports (no database)
run: pnpm --dir runtime prisma:generate
- name: Module / package unit tests
run: pnpm --dir runtime exec turbo run test --filter='./modules/*' --filter='./packages/*' --filter='./clients/*' --force
- name: Governance package tests
run: pnpm governance:test
timeout-minutes: "20"
permissions:
contents: read
...
|
unit
|
["static"]
|
["ubuntu-latest"]
|
39290
|
4
|
1794234071
|
1794234071
|
1794234067
|
1794234071
|
|
1
|
|
0
|
Edit
Delete
|
|
48554
|
27246
|
116
|
5
|
7f603d3ee205f8cd2b45a24f4acb597bfd45a403
|
0
|
Port conformance (kernel / modules / clients)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
port-conformance:
name: Port conformance (kernel / modules / clients)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "20"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Run port conformance with complete suite coverage
run: pnpm check:port-conformance
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload port conformance evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-port-conformance-${{ env.CANDIDATE_TAG }}
path: reports/port-conformance.latest.json
retention-days: "30"
timeout-minutes: "20"
permissions:
contents: read
...
|
port-conformance
|
["static"]
|
["ubuntu-latest"]
|
39291
|
4
|
1794234073
|
1794234073
|
1794234067
|
1794234073
|
|
1
|
|
0
|
Edit
Delete
|
|
48555
|
27246
|
116
|
5
|
7f603d3ee205f8cd2b45a24f4acb597bfd45a403
|
0
|
Runtime and UI acceptance (real PostgreSQL + Redis Runtime and UI acceptance (real PostgreSQL + Redis)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
runtime:
name: Runtime and UI acceptance (real PostgreSQL + Redis)
runs-on: ubuntu-latest
env:
# 库名前缀由 runtime/package.json name 派生(G15 基座守卫:enterprise_platform*)
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/enterprise_platform_ci?schema=public
REDIS_URL: redis://127.0.0.1:6379
KAFKA_BROKERS: 127.0.0.1:59092
MAINLINE_CHAOS_CONTAINER: enterprise-platform-ms23-ci-redpanda-1
# Compose parses all services even for --no-deps redpanda and down.
# These unused service values deliberately cannot start a runtime.
PLATFORM_DEPLOYMENT_ENV: test
PLATFORM_RUNTIME_IMAGE: enterprise-platform/runtime:ci-not-started
PLATFORM_RUNTIME_DATABASE_RUNTIME_URL: postgresql://unused@127.0.0.1:1/unused
PLATFORM_RUNTIME_DATABASE_SYSTEM_URL: postgresql://unused@127.0.0.1:1/unused
PLATFORM_RUNTIME_REDIS_URL: redis://127.0.0.1:1/15
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Install Playwright browser
run: pnpm --dir runtime --filter web exec playwright install --with-deps chromium
- name: Workbench browser regressions (intercepted read APIs)
run: pnpm check:workbench-ui
- name: Generate Prisma clients
run: pnpm --dir runtime prisma:generate
- name: Build persistence modules and provision every module acceptance database
run: |
pnpm runtime:build:modules
node governance/prepare-module-databases.mjs
- name: Prepare mainline fixtures and verify identity ordinary-role databases
run: |
pnpm mainline:prepare
pnpm identity:prepare
- name: Policy activation concurrency and lease fencing (isolated PostgreSQL with RLS)
run: pnpm check:policy-governance
- name: Build isolated MinIO from pinned upstream source
run: docker build -t enterprise-platform/test-minio:a6c538c5 stack/test-minio
- name: Real file and notification execution slices (S3, ClamAV, durable receiver receipts)
run: pnpm check:execution-slices
env:
EXECUTION_CLAMAV_PORT: "3310"
- name: Registry admission and central audit recovery
run: pnpm check:registry-admission
- name: Start isolated Redpanda and provision registered topics
run: |
docker compose -p enterprise-platform-ms23-ci -f stack/compose.yaml -f stack/overlays/test.yaml up -d --wait --no-deps redpanda
bash stack/provision/redpanda-topics.sh --apply
- name: Real DB and Redis acceptance (deploy → RLS roles → differential → tests incl. 7 profile boots)
run: pnpm runtime:check:runtime
- name: Configuration snapshots, tenant isolation and remote SDK acceptance
run: pnpm acceptance:configuration
- name: Persistent mainline, audit tamper, revocation SLA and real broker failure
run: pnpm mainline:check
- name: Identity signing against isolated OpenBao Transit
run: pnpm identity:check:transit
- name: UI acceptance (NestJS / Fastify x WS / SSE)
run: pnpm runtime:check:ui
env:
UI_MATRIX: "1"
- name: Identity module browser acceptance (login / MFA / consent / sessions)
run: pnpm identity:check:module-ui
- name: MCP controlled writes (isolated IdP, Owner receipt, retry and revocation)
run: pnpm check:mcp-writes
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload workbench browser diagnostics
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-workbench-browser-${{ env.CANDIDATE_TAG }}
path: /tmp/platform-workbench-ui-*/
retention-days: "7"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload runtime and UI evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-runtime-${{ env.CANDIDATE_TAG }}
path: |
runtime/reports/runtime-acceptance.latest.json
runtime/reports/ui-acceptance.latest.json
reports/workbench-ui.latest.json
reports/identity-ui.latest.json
reports/mcp-writes.latest.json
reports/mainline-acceptance.latest.json
reports/configuration-runtime.latest.json
reports/revocation-sla.latest.json
reports/policy-governance.latest.json
reports/execution-slices.latest.json
reports/registry-admission.latest.json
reports/identity-transit.latest.json
reports/scope-http.latest.json
reports/scope-fact-sla.latest.json
reports/machine-revocation-sla.latest.json
reports/credential-m1-sla.latest.json
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Stop isolated acceptance broker
run: docker compose -p enterprise-platform-ms23-ci -f stack/compose.yaml -f stack/overlays/test.yaml down
timeout-minutes: "50"
services:
clamav:
image: clamav/clamav-debian@sha256:be3cb41d9833ce9ffb98f3d3e1483c35c0d87060c2bda3624d75fd28bbf0b3bd
ports:
- 3310:3310
options: --health-cmd "clamdcheck.sh" --health-start-period 120s --health-interval 10s --health-timeout 5s --health-retries 24
postgres:
image: postgres:16
env:
POSTGRES_DB: enterprise_platform_ci
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres -d enterprise_platform_ci" --health-interval 5s --health-timeout 5s --health-retries 20
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 20
permissions:
contents: read
...
|
runtime
|
["static"]
|
["ubuntu-latest"]
|
39292
|
4
|
1794234075
|
1794234075
|
1794234067
|
1794234075
|
|
1
|
|
0
|
Edit
Delete
|
|
48556
|
27246
|
116
|
5
|
7f603d3ee205f8cd2b45a24f4acb597bfd45a403
|
0
|
M1 identity transitional workspace (IdP static → E M1 identity transitional workspace (IdP static → E2 → governance)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
identity:
name: M1 identity transitional workspace (IdP static → E2 → governance)
runs-on: ubuntu-latest
env:
# 库名前缀由 identity/package.json name 派生(enterprise_idp*);Redis 必须 db 0(老框架 C22)
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/enterprise_idp_ci?schema=public
REDIS_URL: redis://127.0.0.1:6379/0
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: identity/pnpm-lock.yaml
node-version: "20"
- name: Private registry auth (temporary userconfig; shared runtime identity fixture dependencies)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install identity workspace (frozen lockfile)
run: pnpm --dir identity install --frozen-lockfile
- name: Build shared identity fixture dependencies from this checkout
run: |
pnpm --dir runtime install --frozen-lockfile --filter @juhai/module-identity... --filter @juhai/client-identity --filter api-nestjs
pnpm --dir runtime --filter @juhai/module-identity prisma:generate
pnpm --dir runtime exec turbo run build --filter=@juhai/module-identity... --filter=@juhai/client-identity...
pnpm --dir identity --filter api-nestjs exec node -e "require('node:assert/strict').strictEqual(require('@juhai/module-kit'), require('../../../runtime/modules/kit'))"
- name: Provision ordinary owner for the isolated identity test database
run: |
psql "${DATABASE_URL%%\?*}" -v ON_ERROR_STOP=1 <<'SQL'
CREATE ROLE enterprise_idp_ci_rt LOGIN PASSWORD 'ci-test-only' NOSUPERUSER NOCREATEDB NOCREATEROLE NOBYPASSRLS;
ALTER DATABASE enterprise_idp_ci OWNER TO enterprise_idp_ci_rt;
ALTER SCHEMA public OWNER TO enterprise_idp_ci_rt;
SQL
echo 'DATABASE_URL=postgresql://enterprise_idp_ci_rt:ci-test-only@127.0.0.1:5432/enterprise_idp_ci?schema=public' >> "$GITHUB_ENV"
- name: Generate Prisma clients
run: pnpm --dir identity prisma:generate
- name: IdP static sub-checks (independent of runtime / UI reports)
run: pnpm identity:check:static
- name: IdP real DB acceptance (single NestJS host, serialized)
run: pnpm identity:check:runtime
- name: Install Playwright browser
run: pnpm --dir identity --filter web exec playwright install --with-deps chromium
- name: IdP UI acceptance (single NestJS host)
run: pnpm identity:check:ui
- name: IdP final governance aggregation (same checkout, fresh runtime / UI reports)
run: pnpm identity:check:governance
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload identity evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-identity-${{ env.CANDIDATE_TAG }}
path: identity/reports/*.latest.json
retention-days: "30"
timeout-minutes: "50"
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: enterprise_idp_ci
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres -d enterprise_idp_ci" --health-interval 5s --health-timeout 5s --health-retries 20
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 20
permissions:
contents: read
...
|
identity
|
["static"]
|
["ubuntu-latest"]
|
39293
|
4
|
1794234077
|
1794234077
|
1794234067
|
1794234077
|
|
1
|
|
0
|
Edit
Delete
|
|
48557
|
27246
|
116
|
5
|
7f603d3ee205f8cd2b45a24f4acb597bfd45a403
|
0
|
Runtime image build + SBOM (+ cosign when a key is Runtime image build + SBOM (+ cosign when a key is provided)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
image:
name: Runtime image build + SBOM (+ cosign when a key is provided)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "20"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Resolve npmrc for BuildKit secret (never printed)
run: |
cfg="${RUNNER_TEMP}/platform-npmrc-resolved"
umask 077
printf '@juhai:registry=https://gitea.g-hi.com/api/packages/luoanwu/npm/\n//gitea.g-hi.com/api/packages/luoanwu/npm/:_authToken=%s\n' "${GITEA_NPM_TOKEN}" > "${cfg}"
echo "PLATFORM_NPMRC=${cfg}" >> "${GITHUB_ENV}"
- name: Build runtime image from git archive HEAD:runtime (reports/image-digest.json)
run: node governance/build-image.mjs --context head --npmrc "${PLATFORM_NPMRC}"
- name: Install syft (pinned) and generate SPDX SBOM
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b "${RUNNER_TEMP}/bin" v1.20.0
PATH="${RUNNER_TEMP}/bin:${PATH}" node governance/sbom.mjs
- name: Install cosign (pinned)
uses: ./.git/ci-actions/cosign-installer
with:
cosign-release: v2.4.1
- name: Sign image when COSIGN_PRIVATE_KEY is provided (otherwise explicit skip)
run: |
if [ -n "${COSIGN_PRIVATE_KEY}" ]; then
umask 077; printf '%s' "${COSIGN_PRIVATE_KEY}" > "${RUNNER_TEMP}/cosign.key"
COSIGN_KEY="${RUNNER_TEMP}/cosign.key" node governance/sign-image.mjs
else
node governance/sign-image.mjs
fi
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload image evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-image-${{ env.CANDIDATE_TAG }}
path: |
reports/image-digest.json
reports/sbom.spdx.json
reports/sbom.latest.json
reports/signature.json
retention-days: "30"
timeout-minutes: "40"
permissions:
contents: read
...
|
image
|
["static"]
|
["ubuntu-latest"]
|
39294
|
4
|
1794234079
|
1794234079
|
1794234067
|
1794234079
|
|
1
|
|
0
|
Edit
Delete
|
|
48558
|
27246
|
116
|
5
|
7f603d3ee205f8cd2b45a24f4acb597bfd45a403
|
0
|
Release candidate verification + manifest
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
candidate:
name: Release candidate verification + manifest
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "20"
- name: Download static evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-static-${{ env.CANDIDATE_TAG }}
path: candidate/static
continue-on-error: true
- name: Download runtime evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-runtime-${{ env.CANDIDATE_TAG }}
path: candidate/runtime/runtime/reports
continue-on-error: true
- name: Download identity evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-identity-${{ env.CANDIDATE_TAG }}
path: candidate/identity/identity/reports
continue-on-error: true
- name: Download port-conformance evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-port-conformance-${{ env.CANDIDATE_TAG }}
path: candidate/port-conformance/reports
continue-on-error: true
- id: verify
name: Verify candidate (per-report sourceSha / dirty / status / digest; missing → ineligible)
run: node governance/verify-candidate.mjs --candidate candidate --sha "${{ github.sha }}" --run-id "${{ github.run_id }}" --attempt "${GITHUB_RUN_ATTEMPT}" --out reports/release-candidate.latest.json
continue-on-error: true
- name: Download image and full SBOM evidence for the same candidate
uses: ./.git/ci-actions/download-artifact
with:
name: platform-image-${{ env.CANDIDATE_TAG }}
path: reports
- name: Release Manifest (known facts, status partial until all deliverables exist)
run: node governance/release-manifest.mjs
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload candidate evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-candidate-${{ env.CANDIDATE_TAG }}
path: |
reports/release-candidate.latest.json
reports/release-manifest.latest.json
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Propagate upstream results and candidate eligibility
run: |
echo "public-static=${{ needs.public-static.result }} static=${{ needs.static.result }} runtime=${{ needs.runtime.result }} identity=${{ needs.identity.result }} verify=${{ steps.verify.outcome }}"
test "${{ needs.public-static.result }}" = "success"
test "${{ needs.static.result }}" = "success"
test "${{ needs.unit.result }}" = "success"
test "${{ needs.port-conformance.result }}" = "success"
test "${{ needs.runtime.result }}" = "success"
test "${{ needs.identity.result }}" = "success"
test "${{ needs.image.result }}" = "success"
test "${{ steps.verify.outcome }}" = "success"
timeout-minutes: "10"
permissions:
contents: read
...
|
candidate
|
["public-static","static","uni ["public-static","static","unit","port-conformance","runtime","identity","image"]...
|
["ubuntu-latest"]
|
39295
|
2
|
1794234081
|
1794234081
|
1794234067
|
1794234081
|
|
1
|
|
0
|
Edit
Delete
|
|
48559
|
27247
|
116
|
5
|
b5ce58a608adc36ce9ac11886723de31bde7964f
|
0
|
Static checks (locked engineering dependency)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
public-static:
name: Static checks (locked engineering dependency)
runs-on: ubuntu-latest
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: "0"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: https://github.com/actions/setup-node@v4
with:
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Test image release credential preflight (synthetic credentials only)
run: node --test .github/scripts/test/*.test.mjs
- name: Install contracts dependencies (public npm only, frozen lockfile; CT-1 build / validators / generated-types check)
run: pnpm --dir contracts install --frozen-lockfile
- name: Install dictionary service dependencies (independent frozen lockfile)
run: pnpm --dir runtime/services/master-data-registry install --frozen-lockfile
- name: Docker CLI for pinned-image syntax checks (runner images may ship without it)
run: command -v docker >/dev/null || { apt-get update && apt-get install -y --no-install-recommends docker.io; }
- name: Caddy and alert rule syntax (compose-pinned images; skipped fails here)
run: |
pnpm check:caddy
pnpm check:otel
env:
CHECK_SYNTAX_REQUIRED: "1"
- name: Governance checks (exact engineering package; public contracts dependencies)
run: |
pnpm check:module-imports
pnpm check:canonical-ids
pnpm check:code-sets
pnpm check:omni-platform
pnpm check:fact-pii
pnpm check:catalog
pnpm check:migration-decs
pnpm test
pnpm contracts:check:local
- name: Pack publishable packages (contracts + governance; no publish)
run: |
rm -rf dist-artifacts
pnpm --dir contracts build
pnpm --dir governance pack --pack-destination ../dist-artifacts
pnpm --dir contracts pack --pack-destination ../dist-artifacts
ls -la dist-artifacts
- if: always()
name: Upload package tarballs
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: error
name: platform-packages-${{ env.CANDIDATE_TAG }}
path: dist-artifacts/*.tgz
retention-days: "30"
- if: always()
name: Upload public static evidence
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: warn
name: platform-public-static-${{ env.CANDIDATE_TAG }}
path: reports/*.latest.json
retention-days: "30"
timeout-minutes: "15"
permissions:
contents: read
...
|
public-static
|
null
|
["ubuntu-latest"]
|
39296
|
2
|
1794234857
|
1794234861
|
1794234857
|
1794234861
|
|
0
|
|
0
|
Edit
Delete
|
|
48560
|
27247
|
116
|
5
|
b5ce58a608adc36ce9ac11886723de31bde7964f
|
0
|
Static governance (repo root, private packages)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
static:
name: Static governance (repo root, private packages)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: "0"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: https://github.com/actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Install contracts dependencies (public npm only, frozen lockfile; CT-1 build / validators / generated-types check)
run: pnpm --dir contracts install --frozen-lockfile
- name: Install dictionary service dependencies (independent frozen lockfile)
run: pnpm --dir runtime/services/master-data-registry install --frozen-lockfile
- name: Generate Prisma clients
run: pnpm --dir runtime prisma:generate
- name: Build runtime modules (fixture suites evaluate migrated rules from dist)
run: pnpm runtime:build:modules
- name: Repo-root governance gate
run: pnpm check
- name: Source tree must stay clean apart from latest reports (no tracked .npmrc mutation)
run: |
git status --porcelain | grep -vE '\.latest\.json$' && { echo "::error::静态门禁修改了报告以外的跟踪文件"; exit 1; } || echo "clean apart from latest reports"
- if: always()
name: Upload static evidence
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: warn
name: platform-static-${{ env.CANDIDATE_TAG }}
path: |
reports/*.latest.json
runtime/reports/*.latest.json
!runtime/reports/runtime-acceptance.latest.json
!runtime/reports/ui-acceptance.latest.json
retention-days: "30"
timeout-minutes: "30"
permissions:
contents: read
...
|
static
|
null
|
["ubuntu-latest"]
|
39297
|
2
|
1794234862
|
1794234865
|
1794234857
|
1794234865
|
|
0
|
|
0
|
Edit
Delete
|
|
48561
|
27247
|
116
|
5
|
b5ce58a608adc36ce9ac11886723de31bde7964f
|
0
|
Unit tests without DB (modules / packages / govern Unit tests without DB (modules / packages / governance)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
unit:
name: Unit tests without DB (modules / packages / governance)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: "0"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: https://github.com/actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Generate clients for authority module unit imports (no database)
run: pnpm --dir runtime prisma:generate
- name: Module / package unit tests
run: pnpm --dir runtime exec turbo run test --filter='./modules/*' --filter='./packages/*' --filter='./clients/*' --force
- name: Governance package tests
run: pnpm governance:test
timeout-minutes: "20"
permissions:
contents: read
...
|
unit
|
["static"]
|
["ubuntu-latest"]
|
39298
|
4
|
1794234868
|
1794234868
|
1794234857
|
1794234868
|
|
1
|
|
0
|
Edit
Delete
|
|
48562
|
27247
|
116
|
5
|
b5ce58a608adc36ce9ac11886723de31bde7964f
|
0
|
Port conformance (kernel / modules / clients)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
port-conformance:
name: Port conformance (kernel / modules / clients)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: "0"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: https://github.com/actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "20"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Run port conformance with complete suite coverage
run: pnpm check:port-conformance
- if: always()
name: Upload port conformance evidence
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: error
name: platform-port-conformance-${{ env.CANDIDATE_TAG }}
path: reports/port-conformance.latest.json
retention-days: "30"
timeout-minutes: "20"
permissions:
contents: read
...
|
port-conformance
|
["static"]
|
["ubuntu-latest"]
|
39299
|
4
|
1794234869
|
1794234869
|
1794234857
|
1794234869
|
|
1
|
|
0
|
Edit
Delete
|
|
48563
|
27247
|
116
|
5
|
b5ce58a608adc36ce9ac11886723de31bde7964f
|
0
|
Runtime and UI acceptance (real PostgreSQL + Redis Runtime and UI acceptance (real PostgreSQL + Redis)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
runtime:
name: Runtime and UI acceptance (real PostgreSQL + Redis)
runs-on: ubuntu-latest
env:
# 库名前缀由 runtime/package.json name 派生(G15 基座守卫:enterprise_platform*)
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/enterprise_platform_ci?schema=public
REDIS_URL: redis://127.0.0.1:6379
KAFKA_BROKERS: 127.0.0.1:59092
MAINLINE_CHAOS_CONTAINER: enterprise-platform-ms23-ci-redpanda-1
# Compose parses all services even for --no-deps redpanda and down.
# These unused service values deliberately cannot start a runtime.
PLATFORM_DEPLOYMENT_ENV: test
PLATFORM_RUNTIME_IMAGE: enterprise-platform/runtime:ci-not-started
PLATFORM_RUNTIME_DATABASE_RUNTIME_URL: postgresql://unused@127.0.0.1:1/unused
PLATFORM_RUNTIME_DATABASE_SYSTEM_URL: postgresql://unused@127.0.0.1:1/unused
PLATFORM_RUNTIME_REDIS_URL: redis://127.0.0.1:1/15
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: "0"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: https://github.com/actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Install Playwright browser
run: pnpm --dir runtime --filter web exec playwright install --with-deps chromium
- name: Workbench browser regressions (intercepted read APIs)
run: pnpm check:workbench-ui
- name: Generate Prisma clients
run: pnpm --dir runtime prisma:generate
- name: Build persistence modules and provision every module acceptance database
run: |
pnpm runtime:build:modules
node governance/prepare-module-databases.mjs
- name: Prepare mainline fixtures and verify identity ordinary-role databases
run: |
pnpm mainline:prepare
pnpm identity:prepare
- name: Policy activation concurrency and lease fencing (isolated PostgreSQL with RLS)
run: pnpm check:policy-governance
- name: Build isolated MinIO from pinned upstream source
run: docker build -t enterprise-platform/test-minio:a6c538c5 stack/test-minio
- name: Real file and notification execution slices (S3, ClamAV, durable receiver receipts)
run: pnpm check:execution-slices
env:
EXECUTION_CLAMAV_PORT: "3310"
- name: Registry admission and central audit recovery
run: pnpm check:registry-admission
- name: Start isolated Redpanda and provision registered topics
run: |
docker compose -p enterprise-platform-ms23-ci -f stack/compose.yaml -f stack/overlays/test.yaml up -d --wait --no-deps redpanda
bash stack/provision/redpanda-topics.sh --apply
- name: Real DB and Redis acceptance (deploy → RLS roles → differential → tests incl. 7 profile boots)
run: pnpm runtime:check:runtime
- name: Configuration snapshots, tenant isolation and remote SDK acceptance
run: pnpm acceptance:configuration
- name: Persistent mainline, audit tamper, revocation SLA and real broker failure
run: pnpm mainline:check
- name: Identity signing against isolated OpenBao Transit
run: pnpm identity:check:transit
- name: UI acceptance (NestJS / Fastify x WS / SSE)
run: pnpm runtime:check:ui
env:
UI_MATRIX: "1"
- name: Identity module browser acceptance (login / MFA / consent / sessions)
run: pnpm identity:check:module-ui
- name: MCP controlled writes (isolated IdP, Owner receipt, retry and revocation)
run: pnpm check:mcp-writes
- if: always()
name: Upload workbench browser diagnostics
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: warn
name: platform-workbench-browser-${{ env.CANDIDATE_TAG }}
path: /tmp/platform-workbench-ui-*/
retention-days: "7"
- if: always()
name: Upload runtime and UI evidence
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: warn
name: platform-runtime-${{ env.CANDIDATE_TAG }}
path: |
runtime/reports/runtime-acceptance.latest.json
runtime/reports/ui-acceptance.latest.json
reports/workbench-ui.latest.json
reports/identity-ui.latest.json
reports/mcp-writes.latest.json
reports/mainline-acceptance.latest.json
reports/configuration-runtime.latest.json
reports/revocation-sla.latest.json
reports/policy-governance.latest.json
reports/execution-slices.latest.json
reports/registry-admission.latest.json
reports/identity-transit.latest.json
reports/scope-http.latest.json
reports/scope-fact-sla.latest.json
reports/machine-revocation-sla.latest.json
reports/credential-m1-sla.latest.json
retention-days: "30"
- if: always()
name: Stop isolated acceptance broker
run: docker compose -p enterprise-platform-ms23-ci -f stack/compose.yaml -f stack/overlays/test.yaml down
timeout-minutes: "50"
services:
clamav:
image: clamav/clamav-debian@sha256:be3cb41d9833ce9ffb98f3d3e1483c35c0d87060c2bda3624d75fd28bbf0b3bd
ports:
- 3310:3310
options: --health-cmd "clamdcheck.sh" --health-start-period 120s --health-interval 10s --health-timeout 5s --health-retries 24
postgres:
image: postgres:16
env:
POSTGRES_DB: enterprise_platform_ci
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres -d enterprise_platform_ci" --health-interval 5s --health-timeout 5s --health-retries 20
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 20
permissions:
contents: read
...
|
runtime
|
["static"]
|
["ubuntu-latest"]
|
39300
|
4
|
1794234871
|
1794234871
|
1794234857
|
1794234871
|
|
1
|
|
0
|
Edit
Delete
|
|
48564
|
27247
|
116
|
5
|
b5ce58a608adc36ce9ac11886723de31bde7964f
|
0
|
M1 identity transitional workspace (IdP static → E M1 identity transitional workspace (IdP static → E2 → governance)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
identity:
name: M1 identity transitional workspace (IdP static → E2 → governance)
runs-on: ubuntu-latest
env:
# 库名前缀由 identity/package.json name 派生(enterprise_idp*);Redis 必须 db 0(老框架 C22)
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/enterprise_idp_ci?schema=public
REDIS_URL: redis://127.0.0.1:6379/0
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: "0"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: https://github.com/actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: identity/pnpm-lock.yaml
node-version: "20"
- name: Private registry auth (temporary userconfig; shared runtime identity fixture dependencies)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install identity workspace (frozen lockfile)
run: pnpm --dir identity install --frozen-lockfile
- name: Build shared identity fixture dependencies from this checkout
run: |
pnpm --dir runtime install --frozen-lockfile --filter @juhai/module-identity... --filter @juhai/client-identity --filter api-nestjs
pnpm --dir runtime --filter @juhai/module-identity prisma:generate
pnpm --dir runtime exec turbo run build --filter=@juhai/module-identity... --filter=@juhai/client-identity...
pnpm --dir identity --filter api-nestjs exec node -e "require('node:assert/strict').strictEqual(require('@juhai/module-kit'), require('../../../runtime/modules/kit'))"
- name: Provision ordinary owner for the isolated identity test database
run: |
psql "${DATABASE_URL%%\?*}" -v ON_ERROR_STOP=1 <<'SQL'
CREATE ROLE enterprise_idp_ci_rt LOGIN PASSWORD 'ci-test-only' NOSUPERUSER NOCREATEDB NOCREATEROLE NOBYPASSRLS;
ALTER DATABASE enterprise_idp_ci OWNER TO enterprise_idp_ci_rt;
ALTER SCHEMA public OWNER TO enterprise_idp_ci_rt;
SQL
echo 'DATABASE_URL=postgresql://enterprise_idp_ci_rt:ci-test-only@127.0.0.1:5432/enterprise_idp_ci?schema=public' >> "$GITHUB_ENV"
- name: Generate Prisma clients
run: pnpm --dir identity prisma:generate
- name: IdP static sub-checks (independent of runtime / UI reports)
run: pnpm identity:check:static
- name: IdP real DB acceptance (single NestJS host, serialized)
run: pnpm identity:check:runtime
- name: Install Playwright browser
run: pnpm --dir identity --filter web exec playwright install --with-deps chromium
- name: IdP UI acceptance (single NestJS host)
run: pnpm identity:check:ui
- name: IdP final governance aggregation (same checkout, fresh runtime / UI reports)
run: pnpm identity:check:governance
- if: always()
name: Upload identity evidence
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: warn
name: platform-identity-${{ env.CANDIDATE_TAG }}
path: identity/reports/*.latest.json
retention-days: "30"
timeout-minutes: "50"
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: enterprise_idp_ci
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres -d enterprise_idp_ci" --health-interval 5s --health-timeout 5s --health-retries 20
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 20
permissions:
contents: read
...
|
identity
|
["static"]
|
["ubuntu-latest"]
|
39301
|
4
|
1794234873
|
1794234873
|
1794234857
|
1794234873
|
|
1
|
|
0
|
Edit
Delete
|
|
48565
|
27247
|
116
|
5
|
b5ce58a608adc36ce9ac11886723de31bde7964f
|
0
|
Runtime image build + SBOM (+ cosign when a key is Runtime image build + SBOM (+ cosign when a key is provided)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
image:
name: Runtime image build + SBOM (+ cosign when a key is provided)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: "0"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: https://github.com/actions/setup-node@v4
with:
node-version: "20"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Resolve npmrc for BuildKit secret (never printed)
run: |
cfg="${RUNNER_TEMP}/platform-npmrc-resolved"
umask 077
printf '@juhai:registry=https://gitea.g-hi.com/api/packages/luoanwu/npm/\n//gitea.g-hi.com/api/packages/luoanwu/npm/:_authToken=%s\n' "${GITEA_NPM_TOKEN}" > "${cfg}"
echo "PLATFORM_NPMRC=${cfg}" >> "${GITHUB_ENV}"
- name: Build runtime image from git archive HEAD:runtime (reports/image-digest.json)
run: node governance/build-image.mjs --context head --npmrc "${PLATFORM_NPMRC}"
- name: Install syft (pinned) and generate SPDX SBOM
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b "${RUNNER_TEMP}/bin" v1.20.0
PATH="${RUNNER_TEMP}/bin:${PATH}" node governance/sbom.mjs
- name: Install cosign (pinned)
uses: https://github.com/sigstore/cosign-installer@v3
with:
cosign-release: v2.4.1
- name: Sign image when COSIGN_PRIVATE_KEY is provided (otherwise explicit skip)
run: |
if [ -n "${COSIGN_PRIVATE_KEY}" ]; then
umask 077; printf '%s' "${COSIGN_PRIVATE_KEY}" > "${RUNNER_TEMP}/cosign.key"
COSIGN_KEY="${RUNNER_TEMP}/cosign.key" node governance/sign-image.mjs
else
node governance/sign-image.mjs
fi
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
- if: always()
name: Upload image evidence
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: warn
name: platform-image-${{ env.CANDIDATE_TAG }}
path: |
reports/image-digest.json
reports/sbom.spdx.json
reports/sbom.latest.json
reports/signature.json
retention-days: "30"
timeout-minutes: "40"
permissions:
contents: read
...
|
image
|
["static"]
|
["ubuntu-latest"]
|
39302
|
4
|
1794234875
|
1794234875
|
1794234857
|
1794234875
|
|
1
|
|
0
|
Edit
Delete
|
|
48566
|
27247
|
116
|
5
|
b5ce58a608adc36ce9ac11886723de31bde7964f
|
0
|
Release candidate verification + manifest
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
candidate:
name: Release candidate verification + manifest
runs-on: ubuntu-latest
if: always()
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: "0"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: https://github.com/actions/setup-node@v4
with:
node-version: "20"
- name: Download static evidence
uses: https://github.com/actions/download-artifact@v3
with:
name: platform-static-${{ env.CANDIDATE_TAG }}
path: candidate/static
continue-on-error: true
- name: Download runtime evidence
uses: https://github.com/actions/download-artifact@v3
with:
name: platform-runtime-${{ env.CANDIDATE_TAG }}
path: candidate/runtime/runtime/reports
continue-on-error: true
- name: Download identity evidence
uses: https://github.com/actions/download-artifact@v3
with:
name: platform-identity-${{ env.CANDIDATE_TAG }}
path: candidate/identity/identity/reports
continue-on-error: true
- name: Download port-conformance evidence
uses: https://github.com/actions/download-artifact@v3
with:
name: platform-port-conformance-${{ env.CANDIDATE_TAG }}
path: candidate/port-conformance/reports
continue-on-error: true
- id: verify
name: Verify candidate (per-report sourceSha / dirty / status / digest; missing → ineligible)
run: node governance/verify-candidate.mjs --candidate candidate --sha "${{ github.sha }}" --run-id "${{ github.run_id }}" --attempt "${GITHUB_RUN_ATTEMPT}" --out reports/release-candidate.latest.json
continue-on-error: true
- name: Download image and full SBOM evidence for the same candidate
uses: https://github.com/actions/download-artifact@v3
with:
name: platform-image-${{ env.CANDIDATE_TAG }}
path: reports
- name: Release Manifest (known facts, status partial until all deliverables exist)
run: node governance/release-manifest.mjs
- if: always()
name: Upload candidate evidence
uses: https://github.com/actions/upload-artifact@v3
with:
if-no-files-found: error
name: platform-candidate-${{ env.CANDIDATE_TAG }}
path: |
reports/release-candidate.latest.json
reports/release-manifest.latest.json
retention-days: "30"
- if: always()
name: Propagate upstream results and candidate eligibility
run: |
echo "public-static=${{ needs.public-static.result }} static=${{ needs.static.result }} runtime=${{ needs.runtime.result }} identity=${{ needs.identity.result }} verify=${{ steps.verify.outcome }}"
test "${{ needs.public-static.result }}" = "success"
test "${{ needs.static.result }}" = "success"
test "${{ needs.unit.result }}" = "success"
test "${{ needs.port-conformance.result }}" = "success"
test "${{ needs.runtime.result }}" = "success"
test "${{ needs.identity.result }}" = "success"
test "${{ needs.image.result }}" = "success"
test "${{ steps.verify.outcome }}" = "success"
timeout-minutes: "10"
permissions:
contents: read
...
|
candidate
|
["public-static","static","uni ["public-static","static","unit","port-conformance","runtime","identity","image"]...
|
["ubuntu-latest"]
|
39303
|
2
|
1794234877
|
1794234882
|
1794234857
|
1794234883
|
|
1
|
|
0
|
Edit
Delete
|
|
48567
|
27248
|
116
|
5
|
40f932f0c9e53b72bc13a520aab8cf2ef42bc476
|
0
|
observe
|
1
|
name: Inspect private bounded memory restore layou name: Inspect private bounded memory restore layout without admission
"on":
workflow_dispatch:
jobs:
observe:
name: observe
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and measure complete restore placement without mounts or service changes
run: |
set -eu
python3 <<'PY'
import ast,os,pathlib,re,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-layout-'+run);work.mkdir(mode=0o700)
for name in ['inspect-memory-restore.py','memory-restore-layout.py','test-memory-restore-layout.py','window-support.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_MEMORY_LAYOUT_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
subprocess.run(['python3','-B',str(work/'test-memory-restore-layout.py')],check=True,timeout=30)
props=['User=root','Nice=15','CPUQuota=50%','MemoryMax=512M','TasksMax=32','RuntimeMaxSec=360','TimeoutStopSec=15','ProtectSystem=strict','ProtectHome=read-only','PrivateTmp=yes','PrivateDevices=yes','NoNewPrivileges=yes','ReadWritePaths='+str(work),'StandardOutput=file:'+str(work/'native.stdout'),'StandardError=file:'+str(work/'native.stderr')]
r=subprocess.run(['systemd-run','--quiet','--wait','--collect','--unit=eios-r1-memory-layout-'+run,'--setenv=GITHUB_RUN_ID='+run,'--setenv=GITHUB_SHA='+sha,*['--property='+p for p in props],'/usr/bin/python3','-B',str(work/'inspect-memory-restore.py')],capture_output=True,timeout=420)
if r.returncode:raise RuntimeError('READONLY_MEMORY_LAYOUT_INSPECTION_FAILED')
print((work/'native.stdout').read_text())
PY
shell: bash
timeout-minutes: "8"
permissions:
contents: read
...
|
observe
|
null
|
["ubuntu-latest"]
|
39304
|
1
|
1794235248
|
1794235290
|
1794235248
|
1794235291
|
|
0
|
|
0
|
Edit
Delete
|
|
48568
|
27249
|
116
|
5
|
877e0a80f3ff2d4fef69259f1d2d6c5ec5512b53
|
0
|
Static checks (locked engineering dependency)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
public-static:
name: Static checks (locked engineering dependency)
runs-on: ubuntu-latest
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Test bounded Action preparation (synthetic credentials only)
run: PYTHONDONTWRITEBYTECODE=1 python3 ci/test-prepare-actions.py
- name: Test image release credential preflight (synthetic credentials only)
run: node --test .github/scripts/test/*.test.mjs
- name: Install contracts dependencies (public npm only, frozen lockfile; CT-1 build / validators / generated-types check)
run: pnpm --dir contracts install --frozen-lockfile
- name: Install dictionary service dependencies (independent frozen lockfile)
run: pnpm --dir runtime/services/master-data-registry install --frozen-lockfile
- name: Docker CLI for pinned-image syntax checks (runner images may ship without it)
run: command -v docker >/dev/null || { apt-get update && apt-get install -y --no-install-recommends docker.io; }
- name: Caddy and alert rule syntax (compose-pinned images; skipped fails here)
run: |
pnpm check:caddy
pnpm check:otel
env:
CHECK_SYNTAX_REQUIRED: "1"
- name: Governance checks (exact engineering package; public contracts dependencies)
run: |
pnpm check:module-imports
pnpm check:canonical-ids
pnpm check:code-sets
pnpm check:omni-platform
pnpm check:fact-pii
pnpm check:catalog
pnpm check:migration-decs
pnpm test
pnpm contracts:check:local
- name: Pack publishable packages (contracts + governance; no publish)
run: |
rm -rf dist-artifacts
pnpm --dir contracts build
pnpm --dir governance pack --pack-destination ../dist-artifacts
pnpm --dir contracts pack --pack-destination ../dist-artifacts
ls -la dist-artifacts
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload package tarballs
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-packages-${{ env.CANDIDATE_TAG }}
path: dist-artifacts/*.tgz
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload public static evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-public-static-${{ env.CANDIDATE_TAG }}
path: reports/*.latest.json
retention-days: "30"
timeout-minutes: "15"
permissions:
contents: read
...
|
public-static
|
null
|
["ubuntu-latest"]
|
39305
|
2
|
1794235554
|
1794235554
|
1794235554
|
1794235554
|
|
0
|
|
0
|
Edit
Delete
|
|
48569
|
27249
|
116
|
5
|
877e0a80f3ff2d4fef69259f1d2d6c5ec5512b53
|
0
|
Static governance (repo root, private packages)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
static:
name: Static governance (repo root, private packages)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Install contracts dependencies (public npm only, frozen lockfile; CT-1 build / validators / generated-types check)
run: pnpm --dir contracts install --frozen-lockfile
- name: Install dictionary service dependencies (independent frozen lockfile)
run: pnpm --dir runtime/services/master-data-registry install --frozen-lockfile
- name: Generate Prisma clients
run: pnpm --dir runtime prisma:generate
- name: Build runtime modules (fixture suites evaluate migrated rules from dist)
run: pnpm runtime:build:modules
- name: Repo-root governance gate
run: pnpm check
- name: Source tree must stay clean apart from latest reports (no tracked .npmrc mutation)
run: |
git status --porcelain | grep -vE '\.latest\.json$' && { echo "::error::静态门禁修改了报告以外的跟踪文件"; exit 1; } || echo "clean apart from latest reports"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload static evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-static-${{ env.CANDIDATE_TAG }}
path: |
reports/*.latest.json
runtime/reports/*.latest.json
!runtime/reports/runtime-acceptance.latest.json
!runtime/reports/ui-acceptance.latest.json
retention-days: "30"
timeout-minutes: "30"
permissions:
contents: read
...
|
static
|
null
|
["ubuntu-latest"]
|
39306
|
2
|
1794235556
|
1794235556
|
1794235554
|
1794235556
|
|
0
|
|
0
|
Edit
Delete
|
|
48570
|
27249
|
116
|
5
|
877e0a80f3ff2d4fef69259f1d2d6c5ec5512b53
|
0
|
Unit tests without DB (modules / packages / govern Unit tests without DB (modules / packages / governance)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
unit:
name: Unit tests without DB (modules / packages / governance)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Generate clients for authority module unit imports (no database)
run: pnpm --dir runtime prisma:generate
- name: Module / package unit tests
run: pnpm --dir runtime exec turbo run test --filter='./modules/*' --filter='./packages/*' --filter='./clients/*' --force
- name: Governance package tests
run: pnpm governance:test
timeout-minutes: "20"
permissions:
contents: read
...
|
unit
|
["static"]
|
["ubuntu-latest"]
|
39307
|
4
|
1794235558
|
1794235558
|
1794235554
|
1794235558
|
|
1
|
|
0
|
Edit
Delete
|
|
48571
|
27249
|
116
|
5
|
877e0a80f3ff2d4fef69259f1d2d6c5ec5512b53
|
0
|
Port conformance (kernel / modules / clients)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
port-conformance:
name: Port conformance (kernel / modules / clients)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "20"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Run port conformance with complete suite coverage
run: pnpm check:port-conformance
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload port conformance evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-port-conformance-${{ env.CANDIDATE_TAG }}
path: reports/port-conformance.latest.json
retention-days: "30"
timeout-minutes: "20"
permissions:
contents: read
...
|
port-conformance
|
["static"]
|
["ubuntu-latest"]
|
39308
|
4
|
1794235560
|
1794235560
|
1794235554
|
1794235560
|
|
1
|
|
0
|
Edit
Delete
|
|
48572
|
27249
|
116
|
5
|
877e0a80f3ff2d4fef69259f1d2d6c5ec5512b53
|
0
|
Runtime and UI acceptance (real PostgreSQL + Redis Runtime and UI acceptance (real PostgreSQL + Redis)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
runtime:
name: Runtime and UI acceptance (real PostgreSQL + Redis)
runs-on: ubuntu-latest
env:
# 库名前缀由 runtime/package.json name 派生(G15 基座守卫:enterprise_platform*)
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/enterprise_platform_ci?schema=public
REDIS_URL: redis://127.0.0.1:6379
KAFKA_BROKERS: 127.0.0.1:59092
MAINLINE_CHAOS_CONTAINER: enterprise-platform-ms23-ci-redpanda-1
# Compose parses all services even for --no-deps redpanda and down.
# These unused service values deliberately cannot start a runtime.
PLATFORM_DEPLOYMENT_ENV: test
PLATFORM_RUNTIME_IMAGE: enterprise-platform/runtime:ci-not-started
PLATFORM_RUNTIME_DATABASE_RUNTIME_URL: postgresql://unused@127.0.0.1:1/unused
PLATFORM_RUNTIME_DATABASE_SYSTEM_URL: postgresql://unused@127.0.0.1:1/unused
PLATFORM_RUNTIME_REDIS_URL: redis://127.0.0.1:1/15
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Install Playwright browser
run: pnpm --dir runtime --filter web exec playwright install --with-deps chromium
- name: Workbench browser regressions (intercepted read APIs)
run: pnpm check:workbench-ui
- name: Generate Prisma clients
run: pnpm --dir runtime prisma:generate
- name: Build persistence modules and provision every module acceptance database
run: |
pnpm runtime:build:modules
node governance/prepare-module-databases.mjs
- name: Prepare mainline fixtures and verify identity ordinary-role databases
run: |
pnpm mainline:prepare
pnpm identity:prepare
- name: Policy activation concurrency and lease fencing (isolated PostgreSQL with RLS)
run: pnpm check:policy-governance
- name: Build isolated MinIO from pinned upstream source
run: docker build -t enterprise-platform/test-minio:a6c538c5 stack/test-minio
- name: Real file and notification execution slices (S3, ClamAV, durable receiver receipts)
run: pnpm check:execution-slices
env:
EXECUTION_CLAMAV_PORT: "3310"
- name: Registry admission and central audit recovery
run: pnpm check:registry-admission
- name: Start isolated Redpanda and provision registered topics
run: |
docker compose -p enterprise-platform-ms23-ci -f stack/compose.yaml -f stack/overlays/test.yaml up -d --wait --no-deps redpanda
bash stack/provision/redpanda-topics.sh --apply
- name: Real DB and Redis acceptance (deploy → RLS roles → differential → tests incl. 7 profile boots)
run: pnpm runtime:check:runtime
- name: Configuration snapshots, tenant isolation and remote SDK acceptance
run: pnpm acceptance:configuration
- name: Persistent mainline, audit tamper, revocation SLA and real broker failure
run: pnpm mainline:check
- name: Identity signing against isolated OpenBao Transit
run: pnpm identity:check:transit
- name: UI acceptance (NestJS / Fastify x WS / SSE)
run: pnpm runtime:check:ui
env:
UI_MATRIX: "1"
- name: Identity module browser acceptance (login / MFA / consent / sessions)
run: pnpm identity:check:module-ui
- name: MCP controlled writes (isolated IdP, Owner receipt, retry and revocation)
run: pnpm check:mcp-writes
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload workbench browser diagnostics
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-workbench-browser-${{ env.CANDIDATE_TAG }}
path: /tmp/platform-workbench-ui-*/
retention-days: "7"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload runtime and UI evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-runtime-${{ env.CANDIDATE_TAG }}
path: |
runtime/reports/runtime-acceptance.latest.json
runtime/reports/ui-acceptance.latest.json
reports/workbench-ui.latest.json
reports/identity-ui.latest.json
reports/mcp-writes.latest.json
reports/mainline-acceptance.latest.json
reports/configuration-runtime.latest.json
reports/revocation-sla.latest.json
reports/policy-governance.latest.json
reports/execution-slices.latest.json
reports/registry-admission.latest.json
reports/identity-transit.latest.json
reports/scope-http.latest.json
reports/scope-fact-sla.latest.json
reports/machine-revocation-sla.latest.json
reports/credential-m1-sla.latest.json
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Stop isolated acceptance broker
run: docker compose -p enterprise-platform-ms23-ci -f stack/compose.yaml -f stack/overlays/test.yaml down
timeout-minutes: "50"
services:
clamav:
image: clamav/clamav-debian@sha256:be3cb41d9833ce9ffb98f3d3e1483c35c0d87060c2bda3624d75fd28bbf0b3bd
ports:
- 3310:3310
options: --health-cmd "clamdcheck.sh" --health-start-period 120s --health-interval 10s --health-timeout 5s --health-retries 24
postgres:
image: postgres:16
env:
POSTGRES_DB: enterprise_platform_ci
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres -d enterprise_platform_ci" --health-interval 5s --health-timeout 5s --health-retries 20
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 20
permissions:
contents: read
...
|
runtime
|
["static"]
|
["ubuntu-latest"]
|
39309
|
4
|
1794235562
|
1794235562
|
1794235554
|
1794235562
|
|
1
|
|
0
|
Edit
Delete
|
|
48573
|
27249
|
116
|
5
|
877e0a80f3ff2d4fef69259f1d2d6c5ec5512b53
|
0
|
M1 identity transitional workspace (IdP static → E M1 identity transitional workspace (IdP static → E2 → governance)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
identity:
name: M1 identity transitional workspace (IdP static → E2 → governance)
runs-on: ubuntu-latest
env:
# 库名前缀由 identity/package.json name 派生(enterprise_idp*);Redis 必须 db 0(老框架 C22)
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/enterprise_idp_ci?schema=public
REDIS_URL: redis://127.0.0.1:6379/0
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: identity/pnpm-lock.yaml
node-version: "20"
- name: Private registry auth (temporary userconfig; shared runtime identity fixture dependencies)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install identity workspace (frozen lockfile)
run: pnpm --dir identity install --frozen-lockfile
- name: Build shared identity fixture dependencies from this checkout
run: |
pnpm --dir runtime install --frozen-lockfile --filter @juhai/module-identity... --filter @juhai/client-identity --filter api-nestjs
pnpm --dir runtime --filter @juhai/module-identity prisma:generate
pnpm --dir runtime exec turbo run build --filter=@juhai/module-identity... --filter=@juhai/client-identity...
pnpm --dir identity --filter api-nestjs exec node -e "require('node:assert/strict').strictEqual(require('@juhai/module-kit'), require('../../../runtime/modules/kit'))"
- name: Provision ordinary owner for the isolated identity test database
run: |
psql "${DATABASE_URL%%\?*}" -v ON_ERROR_STOP=1 <<'SQL'
CREATE ROLE enterprise_idp_ci_rt LOGIN PASSWORD 'ci-test-only' NOSUPERUSER NOCREATEDB NOCREATEROLE NOBYPASSRLS;
ALTER DATABASE enterprise_idp_ci OWNER TO enterprise_idp_ci_rt;
ALTER SCHEMA public OWNER TO enterprise_idp_ci_rt;
SQL
echo 'DATABASE_URL=postgresql://enterprise_idp_ci_rt:ci-test-only@127.0.0.1:5432/enterprise_idp_ci?schema=public' >> "$GITHUB_ENV"
- name: Generate Prisma clients
run: pnpm --dir identity prisma:generate
- name: IdP static sub-checks (independent of runtime / UI reports)
run: pnpm identity:check:static
- name: IdP real DB acceptance (single NestJS host, serialized)
run: pnpm identity:check:runtime
- name: Install Playwright browser
run: pnpm --dir identity --filter web exec playwright install --with-deps chromium
- name: IdP UI acceptance (single NestJS host)
run: pnpm identity:check:ui
- name: IdP final governance aggregation (same checkout, fresh runtime / UI reports)
run: pnpm identity:check:governance
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload identity evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-identity-${{ env.CANDIDATE_TAG }}
path: identity/reports/*.latest.json
retention-days: "30"
timeout-minutes: "50"
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: enterprise_idp_ci
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres -d enterprise_idp_ci" --health-interval 5s --health-timeout 5s --health-retries 20
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 20
permissions:
contents: read
...
|
identity
|
["static"]
|
["ubuntu-latest"]
|
39310
|
4
|
1794235564
|
1794235564
|
1794235554
|
1794235564
|
|
1
|
|
0
|
Edit
Delete
|
|
48574
|
27249
|
116
|
5
|
877e0a80f3ff2d4fef69259f1d2d6c5ec5512b53
|
0
|
Runtime image build + SBOM (+ cosign when a key is Runtime image build + SBOM (+ cosign when a key is provided)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
image:
name: Runtime image build + SBOM (+ cosign when a key is provided)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "20"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Resolve npmrc for BuildKit secret (never printed)
run: |
cfg="${RUNNER_TEMP}/platform-npmrc-resolved"
umask 077
printf '@juhai:registry=https://gitea.g-hi.com/api/packages/luoanwu/npm/\n//gitea.g-hi.com/api/packages/luoanwu/npm/:_authToken=%s\n' "${GITEA_NPM_TOKEN}" > "${cfg}"
echo "PLATFORM_NPMRC=${cfg}" >> "${GITHUB_ENV}"
- name: Build runtime image from git archive HEAD:runtime (reports/image-digest.json)
run: node governance/build-image.mjs --context head --npmrc "${PLATFORM_NPMRC}"
- name: Install syft (pinned) and generate SPDX SBOM
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b "${RUNNER_TEMP}/bin" v1.20.0
PATH="${RUNNER_TEMP}/bin:${PATH}" node governance/sbom.mjs
- name: Install cosign (pinned)
uses: ./.git/ci-actions/cosign-installer
with:
cosign-release: v2.4.1
- name: Sign image when COSIGN_PRIVATE_KEY is provided (otherwise explicit skip)
run: |
if [ -n "${COSIGN_PRIVATE_KEY}" ]; then
umask 077; printf '%s' "${COSIGN_PRIVATE_KEY}" > "${RUNNER_TEMP}/cosign.key"
COSIGN_KEY="${RUNNER_TEMP}/cosign.key" node governance/sign-image.mjs
else
node governance/sign-image.mjs
fi
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload image evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-image-${{ env.CANDIDATE_TAG }}
path: |
reports/image-digest.json
reports/sbom.spdx.json
reports/sbom.latest.json
reports/signature.json
retention-days: "30"
timeout-minutes: "40"
permissions:
contents: read
...
|
image
|
["static"]
|
["ubuntu-latest"]
|
39311
|
4
|
1794235566
|
1794235566
|
1794235554
|
1794235566
|
|
1
|
|
0
|
Edit
Delete
|
|
48575
|
27249
|
116
|
5
|
877e0a80f3ff2d4fef69259f1d2d6c5ec5512b53
|
0
|
Release candidate verification + manifest
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
candidate:
name: Release candidate verification + manifest
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "20"
- name: Download static evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-static-${{ env.CANDIDATE_TAG }}
path: candidate/static
continue-on-error: true
- name: Download runtime evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-runtime-${{ env.CANDIDATE_TAG }}
path: candidate/runtime/runtime/reports
continue-on-error: true
- name: Download identity evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-identity-${{ env.CANDIDATE_TAG }}
path: candidate/identity/identity/reports
continue-on-error: true
- name: Download port-conformance evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-port-conformance-${{ env.CANDIDATE_TAG }}
path: candidate/port-conformance/reports
continue-on-error: true
- id: verify
name: Verify candidate (per-report sourceSha / dirty / status / digest; missing → ineligible)
run: node governance/verify-candidate.mjs --candidate candidate --sha "${{ github.sha }}" --run-id "${{ github.run_id }}" --attempt "${GITHUB_RUN_ATTEMPT}" --out reports/release-candidate.latest.json
continue-on-error: true
- name: Download image and full SBOM evidence for the same candidate
uses: ./.git/ci-actions/download-artifact
with:
name: platform-image-${{ env.CANDIDATE_TAG }}
path: reports
- name: Release Manifest (known facts, status partial until all deliverables exist)
run: node governance/release-manifest.mjs
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload candidate evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-candidate-${{ env.CANDIDATE_TAG }}
path: |
reports/release-candidate.latest.json
reports/release-manifest.latest.json
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Propagate upstream results and candidate eligibility
run: |
echo "public-static=${{ needs.public-static.result }} static=${{ needs.static.result }} runtime=${{ needs.runtime.result }} identity=${{ needs.identity.result }} verify=${{ steps.verify.outcome }}"
test "${{ needs.public-static.result }}" = "success"
test "${{ needs.static.result }}" = "success"
test "${{ needs.unit.result }}" = "success"
test "${{ needs.port-conformance.result }}" = "success"
test "${{ needs.runtime.result }}" = "success"
test "${{ needs.identity.result }}" = "success"
test "${{ needs.image.result }}" = "success"
test "${{ steps.verify.outcome }}" = "success"
timeout-minutes: "10"
permissions:
contents: read
...
|
candidate
|
["public-static","static","uni ["public-static","static","unit","port-conformance","runtime","identity","image"]...
|
["ubuntu-latest"]
|
39312
|
2
|
1794235568
|
1794235568
|
1794235554
|
1794235568
|
|
1
|
|
0
|
Edit
Delete
|
|
48576
|
27250
|
116
|
5
|
1d22f982b7393d24fe87092d756727acb96288a1
|
0
|
validate
|
1
|
name: Verify private memory restore mounts and abn name: Verify private memory restore mounts and abnormal cleanup with fixtures
"on":
workflow_dispatch:
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Verify fixed private fixture filesystems without changing production
run: |
set -eu
python3 <<'PY'
import ast,os,pathlib,re,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-fs-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-restore-filesystems.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-restore-layout.py','window-support.py','run-memory-filesystem-probe.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_FILESYSTEM_PROBE_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-filesystem-probe.py')],check=True,timeout=300)
PY
shell: bash
timeout-minutes: "8"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39313
|
2
|
1794235927
|
1794235928
|
1794235927
|
1794235928
|
|
0
|
|
0
|
Edit
Delete
|
|
48577
|
27251
|
116
|
5
|
d28b6c1cecbc618e609529bc6551374c82c43969
|
0
|
validate
|
1
|
name: Verify private memory restore mounts and abn name: Verify private memory restore mounts and abnormal cleanup with fixtures
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Inspect only the fixed owned failure 27250; empty runs a new fixture
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Verify fixed private fixture filesystems without changing production
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_MEMORY_PROBE_RUN','')
if inspect:
if inspect!='27250':raise RuntimeError('ONLY_FIXED_OWNED_FAILURE_INSPECTION_ALLOWED')
prior=pathlib.Path('/var/lib/eios-r1-maintenance/memory-fs-probe-27250')
for name in ['run-memory-filesystem-probe.py','probe-memory-restore-filesystems.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show','1d22f982b7393d24fe87092d756727acb96288a1:ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_PROBE_SOURCE_REQUIRED')
p=prior/'normal/native.stderr'
if p.is_symlink() or p.stat().st_uid!=0 or p.stat().st_mode&0o077 or p.stat().st_size>262144:raise RuntimeError('PRIVATE_FIXED_FAILURE_LOG_REQUIRED')
raw=p.read_text();frames=[]
for name,line,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',raw):
frames.append({'file':pathlib.Path(name).name,'line':int(line),'function':function})
units={}
for mode in ['normal','kill']:
r=subprocess.run(['systemctl','show','eios-r1-memory-fs-'+mode+'-27250','--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
units[mode]=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
errors=re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',raw)
report={'kind':'R1PrivateMemoryFilesystemFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':'27250','failedSource':'1d22f982b7393d24fe87092d756727acb96288a1','frames':frames,'errors':[{'class':name,'errno':int(number)} for name,number in errors],'proc1MountNamespaceMentioned':"/proc/1/ns/mnt" in raw,'hostMountsUnderOwnedWork':len(mounts),'ownedUnitStates':units,'productionServicesChanged':False,'windowAdmissionGranted':False}
print('R1_MEMORY_FS_FAILURE_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-fs-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-restore-filesystems.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-restore-layout.py','window-support.py','run-memory-filesystem-probe.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_FILESYSTEM_PROBE_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-filesystem-probe.py')],check=True,timeout=300)
PY
shell: bash
env:
INSPECT_MEMORY_PROBE_RUN: ${{ inputs.inspect_run }}
timeout-minutes: "8"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39314
|
2
|
1794236171
|
1794236171
|
1794236169
|
1794236171
|
|
0
|
|
0
|
Edit
Delete
|
|
48578
|
27252
|
116
|
5
|
35a98e36c99e7aeb9e018ac54047cf03ed8f0611
|
0
|
validate
|
1
|
name: Verify private memory restore mounts and abn name: Verify private memory restore mounts and abnormal cleanup with fixtures
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Inspect only the fixed owned failure 27250; empty runs a new fixture
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Verify fixed private fixture filesystems without changing production
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_MEMORY_PROBE_RUN','')
if inspect:
if inspect!='27250':raise RuntimeError('ONLY_FIXED_OWNED_FAILURE_INSPECTION_ALLOWED')
prior=pathlib.Path('/var/lib/eios-r1-maintenance/memory-fs-probe-27250')
for name in ['run-memory-filesystem-probe.py','probe-memory-restore-filesystems.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show','1d22f982b7393d24fe87092d756727acb96288a1:ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_PROBE_SOURCE_REQUIRED')
p=prior/'normal/native.stderr'
for parent in [prior.parent,prior,prior/'normal']:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_FAILURE_ANCESTRY_REQUIRED')
details=p.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_FIXED_FAILURE_LOG_REQUIRED')
raw=p.read_text();frames=[]
for name,line,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',raw):
frames.append({'file':pathlib.Path(name).name,'line':int(line),'function':function})
units={}
for mode in ['normal','kill']:
r=subprocess.run(['systemctl','show','eios-r1-memory-fs-'+mode+'-27250','--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
units[mode]=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
errors=re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',raw)
report={'kind':'R1PrivateMemoryFilesystemFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':'27250','failedSource':'1d22f982b7393d24fe87092d756727acb96288a1','logMetadata':{'mode':oct(stat.S_IMODE(details.st_mode)),'uid':details.st_uid,'bytes':details.st_size,'privateAncestorChainVerified':True},'frames':frames,'errors':[{'class':name,'errno':int(number)} for name,number in errors],'proc1MountNamespaceMentioned':"/proc/1/ns/mnt" in raw,'hostMountsUnderOwnedWork':len(mounts),'ownedUnitStates':units,'productionServicesChanged':False,'windowAdmissionGranted':False}
print('R1_MEMORY_FS_FAILURE_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-fs-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-restore-filesystems.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-restore-layout.py','window-support.py','run-memory-filesystem-probe.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_FILESYSTEM_PROBE_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-filesystem-probe.py')],check=True,timeout=300)
PY
shell: bash
env:
INSPECT_MEMORY_PROBE_RUN: ${{ inputs.inspect_run }}
timeout-minutes: "8"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39315
|
1
|
1794236474
|
1794236474
|
1794236473
|
1794236474
|
|
0
|
|
0
|
Edit
Delete
|
|
48579
|
27253
|
116
|
5
|
8cffc85cc7b2b6cc4cbc02d50c007317c9be12d0
|
0
|
validate
|
1
|
name: Verify private memory restore mounts and abn name: Verify private memory restore mounts and abnormal cleanup with fixtures
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Inspect only the fixed owned failure 27250; empty runs a new fixture
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Verify fixed private fixture filesystems without changing production
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_MEMORY_PROBE_RUN','')
if inspect:
if inspect!='27250':raise RuntimeError('ONLY_FIXED_OWNED_FAILURE_INSPECTION_ALLOWED')
prior=pathlib.Path('/var/lib/eios-r1-maintenance/memory-fs-probe-27250')
for name in ['run-memory-filesystem-probe.py','probe-memory-restore-filesystems.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show','1d22f982b7393d24fe87092d756727acb96288a1:ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_PROBE_SOURCE_REQUIRED')
p=prior/'normal/native.stderr'
for parent in [prior.parent,prior,prior/'normal']:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_FAILURE_ANCESTRY_REQUIRED')
details=p.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_FIXED_FAILURE_LOG_REQUIRED')
raw=p.read_text();frames=[]
for name,line,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',raw):
frames.append({'file':pathlib.Path(name).name,'line':int(line),'function':function})
units={}
for mode in ['normal','kill']:
r=subprocess.run(['systemctl','show','eios-r1-memory-fs-'+mode+'-27250','--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
units[mode]=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
errors=re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',raw)
report={'kind':'R1PrivateMemoryFilesystemFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':'27250','failedSource':'1d22f982b7393d24fe87092d756727acb96288a1','logMetadata':{'mode':oct(stat.S_IMODE(details.st_mode)),'uid':details.st_uid,'bytes':details.st_size,'privateAncestorChainVerified':True},'frames':frames,'errors':[{'class':name,'errno':int(number)} for name,number in errors],'proc1MountNamespaceMentioned':"/proc/1/ns/mnt" in raw,'hostMountsUnderOwnedWork':len(mounts),'ownedUnitStates':units,'productionServicesChanged':False,'windowAdmissionGranted':False}
print('R1_MEMORY_FS_FAILURE_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-fs-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-restore-filesystems.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-restore-layout.py','window-support.py','run-memory-filesystem-probe.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_FILESYSTEM_PROBE_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-filesystem-probe.py')],check=True,timeout=300)
PY
shell: bash
env:
INSPECT_MEMORY_PROBE_RUN: ${{ inputs.inspect_run }}
timeout-minutes: "8"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39316
|
1
|
1794236610
|
1794236611
|
1794236609
|
1794236611
|
|
0
|
|
0
|
Edit
Delete
|
|
48580
|
27254
|
116
|
5
|
afd591986e5dc8c1c30830f1fd3b9b9b901ac389
|
0
|
Static checks (locked engineering dependency)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
public-static:
name: Static checks (locked engineering dependency)
runs-on: ubuntu-latest
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Test bounded Action preparation (synthetic credentials only)
run: PYTHONDONTWRITEBYTECODE=1 python3 ci/test-prepare-actions.py
- name: Test image release credential preflight (synthetic credentials only)
run: node --test .github/scripts/test/*.test.mjs
- name: Install contracts dependencies (public npm only, frozen lockfile; CT-1 build / validators / generated-types check)
run: pnpm --dir contracts install --frozen-lockfile
- name: Install dictionary service dependencies (independent frozen lockfile)
run: pnpm --dir runtime/services/master-data-registry install --frozen-lockfile
- name: Docker CLI for pinned-image syntax checks (runner images may ship without it)
run: command -v docker >/dev/null || { apt-get update && apt-get install -y --no-install-recommends docker.io; }
- name: Caddy and alert rule syntax (compose-pinned images; skipped fails here)
run: |
pnpm check:caddy
pnpm check:otel
env:
CHECK_SYNTAX_REQUIRED: "1"
- name: Governance checks (exact engineering package; public contracts dependencies)
run: |
pnpm check:module-imports
pnpm check:canonical-ids
pnpm check:code-sets
pnpm check:omni-platform
pnpm check:fact-pii
pnpm check:catalog
pnpm check:migration-decs
pnpm test
pnpm contracts:check:local
- name: Pack publishable packages (contracts + governance; no publish)
run: |
rm -rf dist-artifacts
pnpm --dir contracts build
pnpm --dir governance pack --pack-destination ../dist-artifacts
pnpm --dir contracts pack --pack-destination ../dist-artifacts
ls -la dist-artifacts
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload package tarballs
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-packages-${{ env.CANDIDATE_TAG }}
path: dist-artifacts/*.tgz
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload public static evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-public-static-${{ env.CANDIDATE_TAG }}
path: reports/*.latest.json
retention-days: "30"
timeout-minutes: "15"
permissions:
contents: read
...
|
public-static
|
null
|
["ubuntu-latest"]
|
39317
|
2
|
1794237169
|
1794237169
|
1794237168
|
1794237169
|
|
0
|
|
0
|
Edit
Delete
|
|
48581
|
27254
|
116
|
5
|
afd591986e5dc8c1c30830f1fd3b9b9b901ac389
|
0
|
Static governance (repo root, private packages)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
static:
name: Static governance (repo root, private packages)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Install contracts dependencies (public npm only, frozen lockfile; CT-1 build / validators / generated-types check)
run: pnpm --dir contracts install --frozen-lockfile
- name: Install dictionary service dependencies (independent frozen lockfile)
run: pnpm --dir runtime/services/master-data-registry install --frozen-lockfile
- name: Generate Prisma clients
run: pnpm --dir runtime prisma:generate
- name: Build runtime modules (fixture suites evaluate migrated rules from dist)
run: pnpm runtime:build:modules
- name: Repo-root governance gate
run: pnpm check
- name: Source tree must stay clean apart from latest reports (no tracked .npmrc mutation)
run: |
git status --porcelain | grep -vE '\.latest\.json$' && { echo "::error::静态门禁修改了报告以外的跟踪文件"; exit 1; } || echo "clean apart from latest reports"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload static evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-static-${{ env.CANDIDATE_TAG }}
path: |
reports/*.latest.json
runtime/reports/*.latest.json
!runtime/reports/runtime-acceptance.latest.json
!runtime/reports/ui-acceptance.latest.json
retention-days: "30"
timeout-minutes: "30"
permissions:
contents: read
...
|
static
|
null
|
["ubuntu-latest"]
|
39318
|
2
|
1794237171
|
1794237171
|
1794237168
|
1794237171
|
|
0
|
|
0
|
Edit
Delete
|
|
48582
|
27254
|
116
|
5
|
afd591986e5dc8c1c30830f1fd3b9b9b901ac389
|
0
|
Unit tests without DB (modules / packages / govern Unit tests without DB (modules / packages / governance)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
unit:
name: Unit tests without DB (modules / packages / governance)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Generate clients for authority module unit imports (no database)
run: pnpm --dir runtime prisma:generate
- name: Module / package unit tests
run: pnpm --dir runtime exec turbo run test --filter='./modules/*' --filter='./packages/*' --filter='./clients/*' --force
- name: Governance package tests
run: pnpm governance:test
timeout-minutes: "20"
permissions:
contents: read
...
|
unit
|
["static"]
|
["ubuntu-latest"]
|
39319
|
4
|
1794237173
|
1794237173
|
1794237168
|
1794237173
|
|
1
|
|
0
|
Edit
Delete
|
|
48583
|
27254
|
116
|
5
|
afd591986e5dc8c1c30830f1fd3b9b9b901ac389
|
0
|
Port conformance (kernel / modules / clients)
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
port-conformance:
name: Port conformance (kernel / modules / clients)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "20"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Run port conformance with complete suite coverage
run: pnpm check:port-conformance
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload port conformance evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-port-conformance-${{ env.CANDIDATE_TAG }}
path: reports/port-conformance.latest.json
retention-days: "30"
timeout-minutes: "20"
permissions:
contents: read
...
|
port-conformance
|
["static"]
|
["ubuntu-latest"]
|
39320
|
4
|
1794237175
|
1794237175
|
1794237168
|
1794237175
|
|
1
|
|
0
|
Edit
Delete
|
|
48584
|
27254
|
116
|
5
|
afd591986e5dc8c1c30830f1fd3b9b9b901ac389
|
0
|
Runtime and UI acceptance (real PostgreSQL + Redis Runtime and UI acceptance (real PostgreSQL + Redis)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
runtime:
name: Runtime and UI acceptance (real PostgreSQL + Redis)
runs-on: ubuntu-latest
env:
# 库名前缀由 runtime/package.json name 派生(G15 基座守卫:enterprise_platform*)
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/enterprise_platform_ci?schema=public
REDIS_URL: redis://127.0.0.1:6379
KAFKA_BROKERS: 127.0.0.1:59092
MAINLINE_CHAOS_CONTAINER: enterprise-platform-ms23-ci-redpanda-1
# Compose parses all services even for --no-deps redpanda and down.
# These unused service values deliberately cannot start a runtime.
PLATFORM_DEPLOYMENT_ENV: test
PLATFORM_RUNTIME_IMAGE: enterprise-platform/runtime:ci-not-started
PLATFORM_RUNTIME_DATABASE_RUNTIME_URL: postgresql://unused@127.0.0.1:1/unused
PLATFORM_RUNTIME_DATABASE_SYSTEM_URL: postgresql://unused@127.0.0.1:1/unused
PLATFORM_RUNTIME_REDIS_URL: redis://127.0.0.1:1/15
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: runtime/pnpm-lock.yaml
node-version: "22"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install runtime workspace (frozen lockfile)
run: pnpm --dir runtime install --frozen-lockfile
- name: Install Playwright browser
run: pnpm --dir runtime --filter web exec playwright install --with-deps chromium
- name: Workbench browser regressions (intercepted read APIs)
run: pnpm check:workbench-ui
- name: Generate Prisma clients
run: pnpm --dir runtime prisma:generate
- name: Build persistence modules and provision every module acceptance database
run: |
pnpm runtime:build:modules
node governance/prepare-module-databases.mjs
- name: Prepare mainline fixtures and verify identity ordinary-role databases
run: |
pnpm mainline:prepare
pnpm identity:prepare
- name: Policy activation concurrency and lease fencing (isolated PostgreSQL with RLS)
run: pnpm check:policy-governance
- name: Build isolated MinIO from pinned upstream source
run: docker build -t enterprise-platform/test-minio:a6c538c5 stack/test-minio
- name: Real file and notification execution slices (S3, ClamAV, durable receiver receipts)
run: pnpm check:execution-slices
env:
EXECUTION_CLAMAV_PORT: "3310"
- name: Registry admission and central audit recovery
run: pnpm check:registry-admission
- name: Start isolated Redpanda and provision registered topics
run: |
docker compose -p enterprise-platform-ms23-ci -f stack/compose.yaml -f stack/overlays/test.yaml up -d --wait --no-deps redpanda
bash stack/provision/redpanda-topics.sh --apply
- name: Real DB and Redis acceptance (deploy → RLS roles → differential → tests incl. 7 profile boots)
run: pnpm runtime:check:runtime
- name: Configuration snapshots, tenant isolation and remote SDK acceptance
run: pnpm acceptance:configuration
- name: Persistent mainline, audit tamper, revocation SLA and real broker failure
run: pnpm mainline:check
- name: Identity signing against isolated OpenBao Transit
run: pnpm identity:check:transit
- name: UI acceptance (NestJS / Fastify x WS / SSE)
run: pnpm runtime:check:ui
env:
UI_MATRIX: "1"
- name: Identity module browser acceptance (login / MFA / consent / sessions)
run: pnpm identity:check:module-ui
- name: MCP controlled writes (isolated IdP, Owner receipt, retry and revocation)
run: pnpm check:mcp-writes
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload workbench browser diagnostics
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-workbench-browser-${{ env.CANDIDATE_TAG }}
path: /tmp/platform-workbench-ui-*/
retention-days: "7"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload runtime and UI evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-runtime-${{ env.CANDIDATE_TAG }}
path: |
runtime/reports/runtime-acceptance.latest.json
runtime/reports/ui-acceptance.latest.json
reports/workbench-ui.latest.json
reports/identity-ui.latest.json
reports/mcp-writes.latest.json
reports/mainline-acceptance.latest.json
reports/configuration-runtime.latest.json
reports/revocation-sla.latest.json
reports/policy-governance.latest.json
reports/execution-slices.latest.json
reports/registry-admission.latest.json
reports/identity-transit.latest.json
reports/scope-http.latest.json
reports/scope-fact-sla.latest.json
reports/machine-revocation-sla.latest.json
reports/credential-m1-sla.latest.json
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Stop isolated acceptance broker
run: docker compose -p enterprise-platform-ms23-ci -f stack/compose.yaml -f stack/overlays/test.yaml down
timeout-minutes: "50"
services:
clamav:
image: clamav/clamav-debian@sha256:be3cb41d9833ce9ffb98f3d3e1483c35c0d87060c2bda3624d75fd28bbf0b3bd
ports:
- 3310:3310
options: --health-cmd "clamdcheck.sh" --health-start-period 120s --health-interval 10s --health-timeout 5s --health-retries 24
postgres:
image: postgres:16
env:
POSTGRES_DB: enterprise_platform_ci
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres -d enterprise_platform_ci" --health-interval 5s --health-timeout 5s --health-retries 20
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 20
permissions:
contents: read
...
|
runtime
|
["static"]
|
["ubuntu-latest"]
|
39321
|
4
|
1794237177
|
1794237177
|
1794237168
|
1794237177
|
|
1
|
|
0
|
Edit
Delete
|
|
48585
|
27254
|
116
|
5
|
afd591986e5dc8c1c30830f1fd3b9b9b901ac389
|
0
|
M1 identity transitional workspace (IdP static → E M1 identity transitional workspace (IdP static → E2 → governance)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
identity:
name: M1 identity transitional workspace (IdP static → E2 → governance)
runs-on: ubuntu-latest
env:
# 库名前缀由 identity/package.json name 派生(enterprise_idp*);Redis 必须 db 0(老框架 C22)
DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/enterprise_idp_ci?schema=public
REDIS_URL: redis://127.0.0.1:6379/0
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
cache: pnpm
cache-dependency-path: identity/pnpm-lock.yaml
node-version: "20"
- name: Private registry auth (temporary userconfig; shared runtime identity fixture dependencies)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Install identity workspace (frozen lockfile)
run: pnpm --dir identity install --frozen-lockfile
- name: Build shared identity fixture dependencies from this checkout
run: |
pnpm --dir runtime install --frozen-lockfile --filter @juhai/module-identity... --filter @juhai/client-identity --filter api-nestjs
pnpm --dir runtime --filter @juhai/module-identity prisma:generate
pnpm --dir runtime exec turbo run build --filter=@juhai/module-identity... --filter=@juhai/client-identity...
pnpm --dir identity --filter api-nestjs exec node -e "require('node:assert/strict').strictEqual(require('@juhai/module-kit'), require('../../../runtime/modules/kit'))"
- name: Provision ordinary owner for the isolated identity test database
run: |
psql "${DATABASE_URL%%\?*}" -v ON_ERROR_STOP=1 <<'SQL'
CREATE ROLE enterprise_idp_ci_rt LOGIN PASSWORD 'ci-test-only' NOSUPERUSER NOCREATEDB NOCREATEROLE NOBYPASSRLS;
ALTER DATABASE enterprise_idp_ci OWNER TO enterprise_idp_ci_rt;
ALTER SCHEMA public OWNER TO enterprise_idp_ci_rt;
SQL
echo 'DATABASE_URL=postgresql://enterprise_idp_ci_rt:ci-test-only@127.0.0.1:5432/enterprise_idp_ci?schema=public' >> "$GITHUB_ENV"
- name: Generate Prisma clients
run: pnpm --dir identity prisma:generate
- name: IdP static sub-checks (independent of runtime / UI reports)
run: pnpm identity:check:static
- name: IdP real DB acceptance (single NestJS host, serialized)
run: pnpm identity:check:runtime
- name: Install Playwright browser
run: pnpm --dir identity --filter web exec playwright install --with-deps chromium
- name: IdP UI acceptance (single NestJS host)
run: pnpm identity:check:ui
- name: IdP final governance aggregation (same checkout, fresh runtime / UI reports)
run: pnpm identity:check:governance
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload identity evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-identity-${{ env.CANDIDATE_TAG }}
path: identity/reports/*.latest.json
retention-days: "30"
timeout-minutes: "50"
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: enterprise_idp_ci
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres -d enterprise_idp_ci" --health-interval 5s --health-timeout 5s --health-retries 20
redis:
image: redis:7
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 5s --health-retries 20
permissions:
contents: read
...
|
identity
|
["static"]
|
["ubuntu-latest"]
|
39322
|
4
|
1794237179
|
1794237179
|
1794237168
|
1794237179
|
|
1
|
|
0
|
Edit
Delete
|
|
48586
|
27254
|
116
|
5
|
afd591986e5dc8c1c30830f1fd3b9b9b901ac389
|
0
|
Runtime image build + SBOM (+ cosign when a key is Runtime image build + SBOM (+ cosign when a key is provided)...
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
image:
name: Runtime image build + SBOM (+ cosign when a key is provided)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "20"
- name: Private registry auth (temporary userconfig)
uses: ./.github/actions/private-npm
with:
token: ${{ secrets.PLATFORM_NPM_TOKEN }}
- name: Install locked governance tools
run: pnpm --dir governance install --frozen-lockfile --ignore-scripts
- name: Resolve npmrc for BuildKit secret (never printed)
run: |
cfg="${RUNNER_TEMP}/platform-npmrc-resolved"
umask 077
printf '@juhai:registry=https://gitea.g-hi.com/api/packages/luoanwu/npm/\n//gitea.g-hi.com/api/packages/luoanwu/npm/:_authToken=%s\n' "${GITEA_NPM_TOKEN}" > "${cfg}"
echo "PLATFORM_NPMRC=${cfg}" >> "${GITHUB_ENV}"
- name: Build runtime image from git archive HEAD:runtime (reports/image-digest.json)
run: node governance/build-image.mjs --context head --npmrc "${PLATFORM_NPMRC}"
- name: Install syft (pinned) and generate SPDX SBOM
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b "${RUNNER_TEMP}/bin" v1.20.0
PATH="${RUNNER_TEMP}/bin:${PATH}" node governance/sbom.mjs
- name: Install cosign (pinned)
uses: ./.git/ci-actions/cosign-installer
with:
cosign-release: v2.4.1
- name: Sign image when COSIGN_PRIVATE_KEY is provided (otherwise explicit skip)
run: |
if [ -n "${COSIGN_PRIVATE_KEY}" ]; then
umask 077; printf '%s' "${COSIGN_PRIVATE_KEY}" > "${RUNNER_TEMP}/cosign.key"
COSIGN_KEY="${RUNNER_TEMP}/cosign.key" node governance/sign-image.mjs
else
node governance/sign-image.mjs
fi
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload image evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: warn
name: platform-image-${{ env.CANDIDATE_TAG }}
path: |
reports/image-digest.json
reports/sbom.spdx.json
reports/sbom.latest.json
reports/signature.json
retention-days: "30"
timeout-minutes: "40"
permissions:
contents: read
...
|
image
|
["static"]
|
["ubuntu-latest"]
|
39323
|
4
|
1794237181
|
1794237181
|
1794237168
|
1794237181
|
|
1
|
|
0
|
Edit
Delete
|
|
48587
|
27254
|
116
|
5
|
afd591986e5dc8c1c30830f1fd3b9b9b901ac389
|
0
|
Release candidate verification + manifest
|
1
|
name: Platform
"on":
pull_request:
name: Platform
"on":
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
GITEA_ACTIONS: "true"
PNPM_VERSION: 9.15.9
jobs:
candidate:
name: Release candidate verification + manifest
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Candidate tag (real run attempt, computed per job)
run: |
if ! [[ "${GITHUB_RUN_ATTEMPT:-}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::GITHUB_RUN_ATTEMPT is missing or invalid on this runner; the candidate tag needs the real attempt (no fallback, decision 2026-10-11)"
exit 1
fi
echo "CANDIDATE_TAG=${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_ENV"
- name: Prepare fixed Actions using existing read-only job token
run: |
python3 <<'PYTHON'
import hashlib,os,pathlib,re,subprocess,tempfile,urllib.request
sha=os.environ.get('GITHUB_SHA','')
if not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_SOURCE_REQUIRED')
if os.environ.get('GITHUB_SERVER_URL','').rstrip('/')!='https://gitea.g-hi.com' or os.environ.get('GITHUB_REPOSITORY')!='luoanwu/enterprise-platform':raise RuntimeError('UNEXPECTED_ORIGIN')
token=os.environ.get('CI_ACTION_READ_TOKEN','')
if not token or any(c in token for c in '\r\n'):raise RuntimeError('JOB_TOKEN_REQUIRED')
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self,*args,**kwargs):return None
request=urllib.request.Request('https://gitea.g-hi.com/api/v1/repos/luoanwu/enterprise-platform/raw/ci/prepare-actions.py?ref='+sha,headers={'Authorization':'token '+token})
with urllib.request.build_opener(NoRedirect()).open(request,timeout=20) as response:
data=response.read(65537)
if len(data)>65536 or hashlib.sha256(data).hexdigest()!='d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102':raise RuntimeError('BOOTSTRAP_d1a743408b27459c015d90fa6035952cf6f26f43899ee8a7cd24df39c2af0102_MISMATCH')
with tempfile.TemporaryDirectory(prefix='verified-action-bootstrap-') as td:
script=pathlib.Path(td,'prepare-actions.py');script.write_bytes(data)
subprocess.run(['python3',str(script)],check=True,timeout=510)
PYTHON
shell: bash
env:
CI_ACTION_READ_TOKEN: ${{ github.token }}
- uses: ./.git/ci-actions/checkout
with:
fetch-depth: "0"
persist-credentials: "false"
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@${PNPM_VERSION} --activate
- uses: ./.git/ci-actions/setup-node
with:
node-version: "20"
- name: Download static evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-static-${{ env.CANDIDATE_TAG }}
path: candidate/static
continue-on-error: true
- name: Download runtime evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-runtime-${{ env.CANDIDATE_TAG }}
path: candidate/runtime/runtime/reports
continue-on-error: true
- name: Download identity evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-identity-${{ env.CANDIDATE_TAG }}
path: candidate/identity/identity/reports
continue-on-error: true
- name: Download port-conformance evidence
uses: ./.git/ci-actions/download-artifact
with:
name: platform-port-conformance-${{ env.CANDIDATE_TAG }}
path: candidate/port-conformance/reports
continue-on-error: true
- id: verify
name: Verify candidate (per-report sourceSha / dirty / status / digest; missing → ineligible)
run: node governance/verify-candidate.mjs --candidate candidate --sha "${{ github.sha }}" --run-id "${{ github.run_id }}" --attempt "${GITHUB_RUN_ATTEMPT}" --out reports/release-candidate.latest.json
continue-on-error: true
- name: Download image and full SBOM evidence for the same candidate
uses: ./.git/ci-actions/download-artifact
with:
name: platform-image-${{ env.CANDIDATE_TAG }}
path: reports
- name: Release Manifest (known facts, status partial until all deliverables exist)
run: node governance/release-manifest.mjs
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Upload candidate evidence
uses: ./.git/ci-actions/upload-artifact
with:
if-no-files-found: error
name: platform-candidate-${{ env.CANDIDATE_TAG }}
path: |
reports/release-candidate.latest.json
reports/release-manifest.latest.json
retention-days: "30"
- if: ${{ always() && env.CANDIDATE_TAG != '' }}
name: Propagate upstream results and candidate eligibility
run: |
echo "public-static=${{ needs.public-static.result }} static=${{ needs.static.result }} runtime=${{ needs.runtime.result }} identity=${{ needs.identity.result }} verify=${{ steps.verify.outcome }}"
test "${{ needs.public-static.result }}" = "success"
test "${{ needs.static.result }}" = "success"
test "${{ needs.unit.result }}" = "success"
test "${{ needs.port-conformance.result }}" = "success"
test "${{ needs.runtime.result }}" = "success"
test "${{ needs.identity.result }}" = "success"
test "${{ needs.image.result }}" = "success"
test "${{ steps.verify.outcome }}" = "success"
timeout-minutes: "10"
permissions:
contents: read
...
|
candidate
|
["public-static","static","uni ["public-static","static","unit","port-conformance","runtime","identity","image"]...
|
["ubuntu-latest"]
|
39324
|
2
|
1794237185
|
1794237185
|
1794237168
|
1794237185
|
|
1
|
|
0
|
Edit
Delete
|
|
48588
|
27255
|
116
|
5
|
319949a9c2e90e3860d4bce64612aa423af9bf71
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,os,pathlib,re,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39325
|
2
|
1794238246
|
1794238289
|
1794238246
|
1794238289
|
|
0
|
|
0
|
Edit
Delete
|
|
48589
|
27256
|
116
|
5
|
3dcb06b1a35e6a90426a2b448510c8924a2292d6
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only the fixed owned failed old database probe 27255
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
if inspect!='27255':raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
prior=pathlib.Path('/var/lib/eios-r1-maintenance/memory-old-db-probe-27255')
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show','319949a9c2e90e3860d4bce64612aa423af9bf71:ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/'native.stderr';details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-27255','--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':'27255','failedSource':'319949a9c2e90e3860d4bce64612aa423af9bf71','frames':frames,'errors':errors,'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39326
|
1
|
1794238901
|
1794238901
|
1794238900
|
1794238902
|
|
0
|
|
0
|
Edit
Delete
|
|
48590
|
27257
|
116
|
5
|
68d84effb41d15214efce2ad0e3750e32370c77c
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only the fixed owned failed old database probe 27255
required: false
default: ''
identity_only:
description: Fixed credential transition diagnostic without database or pressure data
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
if inspect!='27255':raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
prior=pathlib.Path('/var/lib/eios-r1-maintenance/memory-old-db-probe-27255')
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show','319949a9c2e90e3860d4bce64612aa423af9bf71:ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/'native.stderr';details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-27255','--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':'27255','failedSource':'319949a9c2e90e3860d4bce64612aa423af9bf71','frames':frames,'errors':errors,'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
OLD_DB_IDENTITY_ONLY: ${{ inputs.identity_only }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39327
|
1
|
1794239307
|
1794239336
|
1794239306
|
1794239336
|
|
0
|
|
0
|
Edit
Delete
|
|
48591
|
27258
|
116
|
5
|
44b9ef674036881b09d96efd4acc64da7ac5bbc7
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only the fixed owned failed old database probe 27255
required: false
default: ''
identity_only:
description: Fixed credential transition diagnostic without database or pressure data
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
if inspect!='27255':raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
prior=pathlib.Path('/var/lib/eios-r1-maintenance/memory-old-db-probe-27255')
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show','319949a9c2e90e3860d4bce64612aa423af9bf71:ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/'native.stderr';details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-27255','--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':'27255','failedSource':'319949a9c2e90e3860d4bce64612aa423af9bf71','frames':frames,'errors':errors,'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
OLD_DB_IDENTITY_ONLY: ${{ inputs.identity_only }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39328
|
2
|
1794239985
|
1794240002
|
1794239985
|
1794240003
|
|
0
|
|
0
|
Edit
Delete
|
|
48592
|
27259
|
116
|
5
|
b37a22561c9def6a0f2b056f84abeac5397172e1
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only fixed owned failed old database probes 27255 or 27258
required: false
default: ''
identity_only:
description: Fixed credential transition diagnostic without database or pressure data
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
allowed={'27255':('319949a9c2e90e3860d4bce64612aa423af9bf71','native.stderr'),'27258':('44b9ef674036881b09d96efd4acc64da7ac5bbc7','layout-observation.stderr')}
if inspect not in allowed:raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
failed_sha,log_name=allowed[inspect];prior=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+inspect)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',failed_sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/log_name;details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':inspect,'failedSource':failed_sha,'frames':frames,'errors':errors,'runtimeCodes':re.findall(r'(?m)^(?:RuntimeError|ValueError): ([A-Z_]+)$',text),'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
OLD_DB_IDENTITY_ONLY: ${{ inputs.identity_only }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39329
|
1
|
1794240069
|
1794240069
|
1794240068
|
1794240069
|
|
0
|
|
0
|
Edit
Delete
|
|
48593
|
27260
|
116
|
5
|
abf5c11c5ded1406fce403156a3064e7739dfd7d
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only fixed owned failed old database probes 27255 or 27258
required: false
default: ''
identity_only:
description: Fixed credential transition diagnostic without database or pressure data
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
allowed={'27255':('319949a9c2e90e3860d4bce64612aa423af9bf71','native.stderr'),'27258':('44b9ef674036881b09d96efd4acc64da7ac5bbc7','layout-observation.stderr')}
if inspect not in allowed:raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
failed_sha,log_name=allowed[inspect];prior=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+inspect)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',failed_sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/log_name;details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':inspect,'failedSource':failed_sha,'frames':frames,'errors':errors,'runtimeCodes':re.findall(r'(?m)^(?:RuntimeError|ValueError): ([A-Z_]+)$',text),'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
OLD_DB_IDENTITY_ONLY: ${{ inputs.identity_only }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39330
|
2
|
1794240161
|
1794240212
|
1794240160
|
1794240212
|
|
0
|
|
0
|
Edit
Delete
|
|
48594
|
27261
|
116
|
5
|
93e0f6332a91507cfd9d411b86c2277ad6bd91df
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only fixed owned failed old database probes 27255, 27258 or 27260
required: false
default: ''
identity_only:
description: Fixed credential transition diagnostic without database or pressure data
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
allowed={'27255':('319949a9c2e90e3860d4bce64612aa423af9bf71','native.stderr'),'27258':('44b9ef674036881b09d96efd4acc64da7ac5bbc7','layout-observation.stderr'),'27260':('abf5c11c5ded1406fce403156a3064e7739dfd7d','old-helper.stderr')}
if inspect not in allowed:raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
failed_sha,log_name=allowed[inspect];prior=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+inspect)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',failed_sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/log_name;details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
r=subprocess.run(['systemctl','show','eios-r1-memory-old-service-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
child_state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
import urllib.request
with urllib.request.urlopen('http://127.0.0.1:3345/api/healthz',timeout=10) as response:live_health=response.status
if live_health!=200:raise RuntimeError('CURRENT_LIVE_HEALTH_REQUIRED')
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':inspect,'failedSource':failed_sha,'frames':frames,'errors':errors,'runtimeCodes':re.findall(r'(?m)^(?:RuntimeError|ValueError): ([A-Z_]+)$',text),'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
report.update(ownedChildUnitState=child_state,currentLiveHealth=live_health)
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
OLD_DB_IDENTITY_ONLY: ${{ inputs.identity_only }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39331
|
1
|
1794240440
|
1794240441
|
1794240440
|
1794240441
|
|
0
|
|
0
|
Edit
Delete
|
|
48595
|
27262
|
116
|
5
|
04ef8af3e437ba8eed86b599d2aec68fb092b4d8
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only fixed owned failed old database probes 27255, 27258 or 27260
required: false
default: ''
identity_only:
description: Fixed credential transition diagnostic without database or pressure data
required: false
default: ''
bind_view_only:
description: Public fixture of managed private mount handoff without database snapshot or pressure
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
allowed={'27255':('319949a9c2e90e3860d4bce64612aa423af9bf71','native.stderr'),'27258':('44b9ef674036881b09d96efd4acc64da7ac5bbc7','layout-observation.stderr'),'27260':('abf5c11c5ded1406fce403156a3064e7739dfd7d','old-helper.stderr')}
if inspect not in allowed:raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
failed_sha,log_name=allowed[inspect];prior=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+inspect)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',failed_sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/log_name;details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
r=subprocess.run(['systemctl','show','eios-r1-memory-old-service-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
child_state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
import urllib.request
with urllib.request.urlopen('http://127.0.0.1:3345/api/healthz',timeout=10) as response:live_health=response.status
if live_health!=200:raise RuntimeError('CURRENT_LIVE_HEALTH_REQUIRED')
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':inspect,'failedSource':failed_sha,'frames':frames,'errors':errors,'runtimeCodes':re.findall(r'(?m)^(?:RuntimeError|ValueError): ([A-Z_]+)$',text),'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
report.update(ownedChildUnitState=child_state,currentLiveHealth=live_health)
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
OLD_DB_IDENTITY_ONLY: ${{ inputs.identity_only }}
OLD_DB_BIND_VIEW_ONLY: ${{ inputs.bind_view_only }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39332
|
2
|
1794240622
|
1794240674
|
1794240622
|
1794240674
|
|
0
|
|
0
|
Edit
Delete
|
|
48596
|
27263
|
116
|
5
|
a350b4de659604bcdc6dcf9cd05c44bfd0238599
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only fixed owned failed old database probes 27255, 27258 or 27260
required: false
default: ''
identity_only:
description: Fixed credential transition diagnostic without database or pressure data
required: false
default: ''
bind_view_only:
description: Public fixture of managed private mount handoff without database snapshot or pressure
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
allowed={'27255':('319949a9c2e90e3860d4bce64612aa423af9bf71','native.stderr'),'27258':('44b9ef674036881b09d96efd4acc64da7ac5bbc7','layout-observation.stderr'),'27260':('abf5c11c5ded1406fce403156a3064e7739dfd7d','old-helper.stderr')}
if inspect not in allowed:raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
failed_sha,log_name=allowed[inspect];prior=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+inspect)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',failed_sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/log_name;details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
r=subprocess.run(['systemctl','show','eios-r1-memory-old-service-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
child_state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
import urllib.request
with urllib.request.urlopen('http://127.0.0.1:3345/api/healthz',timeout=10) as response:live_health=response.status
if live_health!=200:raise RuntimeError('CURRENT_LIVE_HEALTH_REQUIRED')
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':inspect,'failedSource':failed_sha,'frames':frames,'errors':errors,'runtimeCodes':re.findall(r'(?m)^(?:RuntimeError|ValueError): ([A-Z_]+)$',text),'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
report.update(ownedChildUnitState=child_state,currentLiveHealth=live_health)
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
OLD_DB_IDENTITY_ONLY: ${{ inputs.identity_only }}
OLD_DB_BIND_VIEW_ONLY: ${{ inputs.bind_view_only }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39333
|
2
|
1794240998
|
1794241020
|
1794240997
|
1794241022
|
|
0
|
|
0
|
Edit
Delete
|
|
48597
|
27264
|
116
|
5
|
83e434bf177a53d2d300b005de72c9fe243620e7
|
0
|
validate
|
1
|
name: Restore readonly old database under bounded name: Restore readonly old database under bounded private memory pressure
"on":
workflow_dispatch:
inputs:
inspect_run:
description: Read only fixed owned failed old database probes 27255, 27258 or 27260
required: false
default: ''
identity_only:
description: Fixed credential transition diagnostic without database or pressure data
required: false
default: ''
bind_view_only:
description: Public fixture of managed private mount handoff without database snapshot or pressure
required: false
default: ''
jobs:
validate:
name: validate
runs-on: ubuntu-latest
if: github.repository == 'luoanwu/enterprise-platform'
steps:
- name: Test and rehearse readonly database with private RAM and zero swap
run: |
set -eu
python3 <<'PY'
import ast,hashlib,json,os,pathlib,re,stat,subprocess
run=os.environ['GITHUB_RUN_ID'];sha=os.environ['GITHUB_SHA']
if not run.isdigit() or not re.fullmatch('[0-9a-f]{40}',sha):raise RuntimeError('FIXED_JOB_IDENTITY_REQUIRED')
inspect=os.environ.get('INSPECT_OLD_DB_RUN','')
if inspect:
allowed={'27255':('319949a9c2e90e3860d4bce64612aa423af9bf71','native.stderr'),'27258':('44b9ef674036881b09d96efd4acc64da7ac5bbc7','layout-observation.stderr'),'27260':('abf5c11c5ded1406fce403156a3064e7739dfd7d','old-helper.stderr')}
if inspect not in allowed:raise RuntimeError('ONLY_FIXED_OLD_DB_FAILURE_ALLOWED')
failed_sha,log_name=allowed[inspect];prior=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+inspect)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',failed_sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode or hashlib.sha256((prior/name).read_bytes()).digest()!=hashlib.sha256(r.stdout).digest():raise RuntimeError('FIXED_FAILED_OLD_DB_SOURCE_REQUIRED')
for parent in [prior.parent,prior]:
details=parent.lstat()
if not stat.S_ISDIR(details.st_mode) or details.st_uid!=0 or details.st_mode&0o077:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_ANCESTRY_REQUIRED')
log=prior/log_name;details=log.lstat()
if not stat.S_ISREG(details.st_mode) or details.st_uid!=0 or details.st_nlink!=1 or details.st_mode&0o022 or details.st_size>262144:raise RuntimeError('PRIVATE_OLD_DB_FAILURE_LOG_REQUIRED')
text=log.read_text();frames=[{'file':pathlib.Path(name).name,'line':int(number),'function':function} for name,number,function in re.findall(r'File "([^"]+)", line ([0-9]+), in ([A-Za-z_][A-Za-z0-9_]*)',text)]
errors=[{'class':name,'errno':int(number)} for name,number in re.findall(r'(?m)^([A-Za-z]+Error): \[Errno ([0-9]+)\]',text)]
r=subprocess.run(['systemctl','show','eios-r1-memory-old-db-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
r=subprocess.run(['systemctl','show','eios-r1-memory-old-service-'+inspect,'--property=LoadState,ActiveState,ExecMainPID'],capture_output=True,text=True,timeout=20)
child_state=dict(line.split('=',1) for line in r.stdout.splitlines() if '=' in line)
import urllib.request
with urllib.request.urlopen('http://127.0.0.1:3345/api/healthz',timeout=10) as response:live_health=response.status
if live_health!=200:raise RuntimeError('CURRENT_LIVE_HEALTH_REQUIRED')
mounts=[line for line in pathlib.Path('/proc/self/mountinfo').read_text().splitlines() if line.split()[4].startswith(str(prior)+'/')]
report={'kind':'R1MemoryOldDatabaseFailureInspection','ci':{'runId':run,'sourceSha':sha},'failedRunId':inspect,'failedSource':failed_sha,'frames':frames,'errors':errors,'runtimeCodes':re.findall(r'(?m)^(?:RuntimeError|ValueError): ([A-Z_]+)$',text),'pythonExecutableMentioned':"'/usr/bin/python3'" in text,'preexecMentioned':'preexec_fn' in text,'ownedUnitState':state,'hostMountsUnderOwnedWork':len(mounts),'scratchDirectoriesAbsent':all(not (prior/name).exists() for name in ['recovery','lfs-disk']),'productionServicesChanged':False,'windowAdmissionGranted':False}
report.update(ownedChildUnitState=child_state,currentLiveHealth=live_health)
print('R1_MEMORY_OLD_DB_INSPECTION_JSON '+json.dumps(report));raise SystemExit(0)
work=pathlib.Path('/var/lib/eios-r1-maintenance')/('memory-old-db-probe-'+run);work.mkdir(mode=0o700)
for name in ['probe-memory-old-database.py','run-memory-old-database-probe.py','memory-restore-mounts.py','memory-restore-layout.py','test-memory-old-database.py','test-memory-restore-layout.py','test-memory-restore-mounts.py','window-support.py','window-controller.py','rehearse-old-database.py','inspect-memory-restore.py','window-metadata-capacity.py','restore-independent-mirror.py','inspect-restore-resources.py']:
r=subprocess.run(['git','-c','safe.directory=/home/git/repositories/luoanwu/enterprise-platform.git','-c','core.hooksPath=/dev/null','-C','/home/git/repositories/luoanwu/enterprise-platform.git','show',sha+':ops/gitea-r1/'+name],capture_output=True,timeout=30)
if r.returncode:raise RuntimeError('FIXED_PRIVATE_OLD_DB_SOURCE_REQUIRED')
ast.parse(r.stdout);(work/name).write_bytes(r.stdout)
for name in ['test-memory-restore-layout.py','test-memory-restore-mounts.py','test-memory-old-database.py']:subprocess.run(['python3','-B',str(work/name)],check=True,timeout=30)
subprocess.run(['python3','-B',str(work/'run-memory-old-database-probe.py')],check=True,timeout=780)
PY
shell: bash
env:
INSPECT_OLD_DB_RUN: ${{ inputs.inspect_run }}
OLD_DB_IDENTITY_ONLY: ${{ inputs.identity_only }}
OLD_DB_BIND_VIEW_ONLY: ${{ inputs.bind_view_only }}
timeout-minutes: "15"
permissions:
contents: read
...
|
validate
|
null
|
["ubuntu-latest"]
|
39334
|
2
|
1794241144
|
1794241166
|
1794241142
|
1794241166
|
|
0
|
|
0
|
Edit
Delete
|