-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (80 loc) · 3.21 KB
/
Copy pathsimulation-readiness-ci.yml
File metadata and controls
94 lines (80 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Simulation Readiness CI
on:
pull_request:
push:
branches:
- main
jobs:
class-1-readiness:
name: Class-1 Readiness (${{ matrix.pack.id }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pack:
- id: calculator-core-v1
path: ../../specs/contract/v1/simulation/scenario-packs/calculator-core-v1.yaml
- id: calculator-edge-v1
path: ../../specs/contract/v1/simulation/scenario-packs/calculator-edge-v1.yaml
defaults:
run:
working-directory: runtimes/ruby
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Run readiness matrix
env:
PACK_ID: ${{ matrix.pack.id }}
PACK_PATH: ${{ matrix.pack.path }}
run: |
set -euo pipefail
OUT_DIR="../../tmp/simulation/ci/${PACK_ID}"
FIXTURE_ROOT="../../tmp/simulation/ci-fixtures/${PACK_ID}"
LEDGER_PATH="${OUT_DIR}/run-ledger.jsonl"
TRACE_LOG="${OUT_DIR}/trace.jsonl"
mkdir -p "${OUT_DIR}" "${FIXTURE_ROOT}"
cat > "${TRACE_LOG}" <<'JSONL'
{"timestamp":"2026-02-22T00:00:00.000Z","role":"simulation_runner","model":"deterministic","method":"run_pack","args":[],"kwargs":{},"code":"result = 1","duration_ms":1.0,"generation_attempt":1}
JSONL
bundle exec ruby bin/recurgent-sim \
--pack "${PACK_PATH}" \
--mode fixture \
--operational-mode ci \
--fixture-root "${FIXTURE_ROOT}" \
--ledger-path "${LEDGER_PATH}" > "${OUT_DIR}/fixture.json"
bundle exec ruby bin/recurgent-sim \
--pack "${PACK_PATH}" \
--mode replay \
--operational-mode ci \
--fixture-root "${FIXTURE_ROOT}" \
--ledger-path "${LEDGER_PATH}" > "${OUT_DIR}/replay-1.json"
bundle exec ruby bin/recurgent-sim \
--pack "${PACK_PATH}" \
--mode replay \
--trace-log "${TRACE_LOG}" \
--operational-mode ci \
--fixture-root "${FIXTURE_ROOT}" \
--ledger-path "${LEDGER_PATH}" > "${OUT_DIR}/replay-2.json"
jq -e '.gates | to_entries | all(.value.status == "pass")' "${OUT_DIR}/replay-2.json" > /dev/null
{
echo "### ${PACK_ID}"
echo ""
echo "| Gate | Status | Message |"
echo "| --- | --- | --- |"
jq -r '.gates | to_entries[] | "| \(.key) | \(.value.status) | \(.value.message // "") |"' "${OUT_DIR}/replay-2.json"
echo ""
echo "- Baseline diff: \`$(jq -r '.metrics.baseline_diff_report.classification' "${OUT_DIR}/replay-2.json")\`"
echo "- Score overall: \`$(jq -r '.score_vector.overall' "${OUT_DIR}/replay-2.json")\`"
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload readiness artifacts
uses: actions/upload-artifact@v7
with:
name: simulation-readiness-${{ matrix.pack.id }}
path: tmp/simulation/ci/${{ matrix.pack.id }}