-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsimulation-readiness-nightly.yml
More file actions
160 lines (136 loc) · 6.09 KB
/
Copy pathsimulation-readiness-nightly.yml
File metadata and controls
160 lines (136 loc) · 6.09 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Simulation Readiness Nightly
on:
schedule:
- cron: "25 5 * * *"
workflow_dispatch:
jobs:
class-1-nightly:
name: Class-1 Nightly Trends
runs-on: ubuntu-latest
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 expanded-seed readiness simulation
run: |
set -euo pipefail
SEEDS="11,19,23,31,43,59,71,97,101,131,149,173"
NIGHTLY_ROOT="../../tmp/simulation/nightly"
LEDGER_PATH="${NIGHTLY_ROOT}/run-ledger.jsonl"
TREND_REPORT="${NIGHTLY_ROOT}/nightly-trend-report.json"
ADVISORY_JSON="${NIGHTLY_ROOT}/advisory-status.json"
ADVISORY_MARKDOWN="${NIGHTLY_ROOT}/simulation-advisory-status-$(date -u +%F).md"
TRACE_LOG="${NIGHTLY_ROOT}/trace.jsonl"
mkdir -p "${NIGHTLY_ROOT}"
cat > "${TRACE_LOG}" <<'JSONL'
{"timestamp":"2026-02-22T00:00:00.000Z","role":"simulation_runner","model":"deterministic","method":"nightly","args":[],"kwargs":{},"code":"result = 1","duration_ms":1.0,"generation_attempt":1}
JSONL
run_pack() {
local pack_id="$1"
local pack_path="$2"
local pack_out="${NIGHTLY_ROOT}/${pack_id}"
local fixture_root="${NIGHTLY_ROOT}/fixtures/${pack_id}"
mkdir -p "${pack_out}" "${fixture_root}"
bundle exec ruby bin/recurgent-sim \
--pack "${pack_path}" \
--mode fixture \
--seeds "${SEEDS}" \
--operational-mode nightly \
--nightly-trend-report "${TREND_REPORT}" \
--fixture-root "${fixture_root}" \
--ledger-path "${LEDGER_PATH}" > "${pack_out}/fixture.json"
bundle exec ruby bin/recurgent-sim \
--pack "${pack_path}" \
--mode replay \
--seeds "${SEEDS}" \
--operational-mode nightly \
--nightly-trend-report "${TREND_REPORT}" \
--fixture-root "${fixture_root}" \
--ledger-path "${LEDGER_PATH}" > "${pack_out}/replay-1.json"
bundle exec ruby bin/recurgent-sim \
--pack "${pack_path}" \
--mode replay \
--seeds "${SEEDS}" \
--trace-log "${TRACE_LOG}" \
--operational-mode nightly \
--nightly-trend-report "${TREND_REPORT}" \
--fixture-root "${fixture_root}" \
--ledger-path "${LEDGER_PATH}" > "${pack_out}/replay-2.json"
jq -e '.gates | to_entries | all(.value.status == "pass")' "${pack_out}/replay-2.json" > /dev/null
}
run_pack_advisory() {
local pack_id="$1"
local pack_path="$2"
local pack_out="${NIGHTLY_ROOT}/${pack_id}"
local fixture_root="${NIGHTLY_ROOT}/fixtures/${pack_id}"
mkdir -p "${pack_out}" "${fixture_root}"
bundle exec ruby bin/recurgent-sim \
--pack "${pack_path}" \
--mode fixture \
--seeds "${SEEDS}" \
--operational-mode nightly \
--nightly-trend-report "${TREND_REPORT}" \
--fixture-root "${fixture_root}" \
--ledger-path "${LEDGER_PATH}" > "${pack_out}/fixture.json"
bundle exec ruby bin/recurgent-sim \
--pack "${pack_path}" \
--mode replay \
--seeds "${SEEDS}" \
--operational-mode nightly \
--nightly-trend-report "${TREND_REPORT}" \
--fixture-root "${fixture_root}" \
--ledger-path "${LEDGER_PATH}" > "${pack_out}/replay-1.json"
bundle exec ruby bin/recurgent-sim \
--pack "${pack_path}" \
--mode replay \
--seeds "${SEEDS}" \
--trace-log "${TRACE_LOG}" \
--operational-mode nightly \
--nightly-trend-report "${TREND_REPORT}" \
--fixture-root "${fixture_root}" \
--ledger-path "${LEDGER_PATH}" > "${pack_out}/replay-2.json"
}
run_pack "calculator-core-v1" "../../specs/contract/v1/simulation/scenario-packs/calculator-core-v1.yaml"
run_pack "calculator-edge-v1" "../../specs/contract/v1/simulation/scenario-packs/calculator-edge-v1.yaml"
run_pack_advisory "assistant-continuity-v1" "../../specs/contract/v1/simulation/scenario-packs/assistant-continuity-v1.yaml"
run_pack_advisory "debate-orchestration-v1" "../../specs/contract/v1/simulation/scenario-packs/debate-orchestration-v1.yaml"
bundle exec ruby bin/recurgent-sim-advisory-report \
--ledger-path "${LEDGER_PATH}" \
--pack-ids "assistant-continuity-v1,debate-orchestration-v1" \
--write-json "${ADVISORY_JSON}" \
--write-markdown "${ADVISORY_MARKDOWN}" > "${NIGHTLY_ROOT}/advisory-analysis.json"
jq -s '
{
generated_at: (now | todate),
seed_matrix: "'"${SEEDS}"'" | split(",") | map(tonumber),
runs: map({
run_id,
scenario_pack_id,
mode,
overall_score: .score_vector.overall,
gates: (.gates | with_entries(.value = .value.status)),
baseline_diff_classification: .metrics.baseline_diff_report.classification
})
}
' "${LEDGER_PATH}" > "${TREND_REPORT}"
{
echo "### Nightly Simulation Readiness"
echo ""
echo "- Seed matrix: \`${SEEDS}\`"
echo "- Trend report: \`${TREND_REPORT}\`"
echo "- Advisory report: \`${ADVISORY_MARKDOWN}\`"
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload nightly readiness artifacts
uses: actions/upload-artifact@v7
with:
name: simulation-readiness-nightly
path: tmp/simulation/nightly