Repository navigation
156 lines (150 loc) · 6.51 KB
/
Copy patht12-supervisor.yml
File metadata and controls
156 lines (150 loc) · 6.51 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
# T12 supervisor (G1): INERT.
#
# Nothing runs by itself. There is no schedule here on purpose: adding one is an owner decision at a later
# gate. A manual start also does nothing unless the owner sets the repository variable
# T12_SUPERVISOR_ENABLED to true and creates the secrets, and none of those exist today.
#
# Three separate jobs, on three separate machines, each holding only its own credentials. Each job reads
# its own database secret, for its own Postgres role (t12_lane_maker, t12_lane_checker, t12_lane_integrator),
# and Postgres refuses any stage move that is not that role's: a maker cannot approve its own work. One
# owner still holds all three credentials, so this is separation under one controller, not independent
# authority. Model-written
# commits travel as an artifact pinned by id, then each bundle is checked against the digest on the task row.
# Model-written code runs only inside the verified container. Raw runner output is never printed or
# uploaded, because this repository's logs are public; detail stays in the database receipts.
name: t12-supervisor
on:
workflow_dispatch:
inputs:
target_repo:
description: 'Repository the lanes work on (owner/name, must be on the lane allowlist)'
required: true
specs:
description: 'Reviewed lane specs file in this repository'
required: true
default: 'ops/t12/specs.jsonl'
publish:
description: 'Run the integrator (opens draft PRs only)'
type: boolean
default: false
permissions:
contents: read
concurrency:
group: t12-supervisor
cancel-in-progress: false
jobs:
maker:
if: vars.T12_SUPERVISOR_ENABLED == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: '22'
- run: npm install --legacy-peer-deps --ignore-scripts
- uses: actions/checkout@v7
with:
repository: ${{ inputs.target_repo }}
path: target
fetch-depth: 0
persist-credentials: false
- name: Maker, no way to run code and no push token
env:
DATABASE_URL: ${{ secrets.T12_MAKER_DATABASE_URL }}
T12_LANES_ENABLED: 'true'
T12_FREE_WAVE: 'true'
GROQ_API_KEY: ${{ secrets.T12_GROQ_API_KEY }}
TARGET_REPO: ${{ inputs.target_repo }}
SPECS: ${{ inputs.specs }}
run: |
mkdir -p transfer
npx ts-node --transpile-only scripts/t12/lanes.ts --role maker --lane-name trinity-lane-1 --wake human_prompt \
--specs "$SPECS" --repo "$TARGET_REPO=$PWD/target" --work-root "$RUNNER_TEMP/w" --transfer-out transfer --daily-cap 3 \
> "$RUNNER_TEMP/report.json" 2> "$RUNNER_TEMP/stderr.txt"
node -e "const r=require(process.env.RUNNER_TEMP+'/report.json');console.log(JSON.stringify({made:r.made,errors:r.errors.length,stoppedBy:r.stoppedBy}))"
- id: upload
uses: actions/upload-artifact@v7
with:
name: t12-transfer-${{ github.run_id }}
path: transfer/*.bundle
if-no-files-found: ignore
retention-days: 1
checker:
needs: maker
if: vars.T12_SUPERVISOR_ENABLED == 'true' && needs.maker.outputs.artifact-id != ''
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: '22'
- run: npm install --legacy-peer-deps --ignore-scripts
- uses: actions/checkout@v7
with:
repository: ${{ inputs.target_repo }}
path: target
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.maker.outputs.artifact-id }}
path: transfer
digest-mismatch: error
- name: Checker, runs model code only in the container, no model keys and no push token
env:
DATABASE_URL: ${{ secrets.T12_CHECKER_DATABASE_URL }}
T12_LANES_ENABLED: 'true'
T12_LANES_ALLOW_EXEC: 'true'
TARGET_REPO: ${{ inputs.target_repo }}
SPECS: ${{ inputs.specs }}
run: |
npx ts-node --transpile-only scripts/t12/lanes.ts --role checker --lane-name trinity-lane-2 --wake human_prompt \
--specs "$SPECS" --repo "$TARGET_REPO=$PWD/target" --work-root "$RUNNER_TEMP/w" --transfer-in transfer \
> "$RUNNER_TEMP/report.json" 2> "$RUNNER_TEMP/stderr.txt"
node -e "const r=require(process.env.RUNNER_TEMP+'/report.json');console.log(JSON.stringify({approved:r.approved,rejected:r.rejected,notChecked:r.notChecked,errors:r.errors.length,stoppedBy:r.stoppedBy}))"
integrator:
needs: [maker, checker]
if: vars.T12_SUPERVISOR_ENABLED == 'true' && inputs.publish && needs.checker.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: '22'
- run: npm install --legacy-peer-deps --ignore-scripts
- uses: actions/checkout@v7
with:
repository: ${{ inputs.target_repo }}
path: target
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.maker.outputs.artifact-id }}
path: transfer
digest-mismatch: error
- name: Integrator, opens draft PRs only, cannot run code and holds no model keys
env:
DATABASE_URL: ${{ secrets.T12_INTEGRATOR_DATABASE_URL }}
T12_LANES_ENABLED: 'true'
T12_LANES_PUBLISH: 'true'
GH_TOKEN: ${{ secrets.T12_PR_TOKEN }}
TARGET_REPO: ${{ inputs.target_repo }}
SPECS: ${{ inputs.specs }}
run: |
gh auth setup-git
npx ts-node --transpile-only scripts/t12/lanes.ts --role integrator --lane-name trinity-lane-3 --wake human_prompt \
--specs "$SPECS" --repo "$TARGET_REPO=$PWD/target" --work-root "$RUNNER_TEMP/w" --transfer-in transfer \
> "$RUNNER_TEMP/report.json" 2> "$RUNNER_TEMP/stderr.txt"
node -e "const r=require(process.env.RUNNER_TEMP+'/report.json');console.log(JSON.stringify({integrated:r.integrated,errors:r.errors.length,stoppedBy:r.stoppedBy}))"