Skip to content

Commit 0ff7c94

Browse files
committed
merge w/ merge-train/fairies
2 parents a45d68a + a42bff4 commit 0ff7c94

245 files changed

Lines changed: 4225 additions & 2103 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/update-doc-references/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
name: update-doc-references
3+
description: Analyze source-file changes referenced by documentation, update affected docs when needed, and report documentation reference updates for a PR.
4+
---
5+
16
# Update Documentation References
27

38
When source files referenced by documentation change in a PR, analyze the

.github/workflows/backport.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,6 @@ jobs:
122122
gh workflow run claudebox.yml \
123123
-f prompt="Backport PR #$PR ($TITLE) to $BRANCH. The automatic cherry-pick failed due to conflicts. Follow .claude/claudebox/backport.md to resolve conflicts and create a PR." \
124124
-f link="${LINK:-$URL}" \
125-
-f target_ref="origin/backport-to-${BRANCH}-staging"
125+
-f target_ref="origin/backport-to-${BRANCH}-staging" \
126+
-f slack_channel="$CHANNEL_ID" \
127+
-f slack_thread_ts="$TS"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI3 Dashboard Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
paths:
8+
- "ci3/dashboard/**"
9+
- ".github/workflows/ci3-dashboard-deploy.yml"
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}
14+
cancel-in-progress: false
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
22+
with:
23+
persist-credentials: false
24+
25+
- name: Deploy ci3 dashboard
26+
env:
27+
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
28+
run: |
29+
set -eu
30+
mkdir -p ~/.ssh
31+
echo "${BUILD_INSTANCE_SSH_KEY}" | base64 --decode > ~/.ssh/build_instance_key
32+
chmod 600 ~/.ssh/build_instance_key
33+
ssh-keyscan -H ci.aztec-labs.com >> ~/.ssh/known_hosts 2>/dev/null
34+
35+
./ci3/dashboard/deploy.sh

.github/workflows/claudebox.yml

Lines changed: 69 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,27 @@ on:
1616
required: false
1717
type: string
1818
target_ref:
19-
description: 'Git ref to checkout in the container (e.g., origin/backport-to-v4-next-staging)'
19+
description: 'Git ref the session should work against (e.g., origin/merge-train/barretenberg)'
20+
required: false
21+
type: string
22+
slack_channel:
23+
description: 'Slack channel ID to thread status into (set by the kickoff script)'
24+
required: false
25+
type: string
26+
slack_thread_ts:
27+
description: 'Slack thread timestamp to reply under (set by the kickoff script)'
2028
required: false
2129
type: string
2230

31+
# ClaudeBox v2 runs as a public service at https://claudebox.work. CI hands a
32+
# job off by POSTing to its /run webhook (Bearer-authed with
33+
# CLAUDEBOX_API_SECRET) and returns immediately — the session reports progress
34+
# back to the bound Slack thread and to any GitHub comment IDs we pass through.
35+
# The old v1 server lived on a private build instance reached over an SSH
36+
# tunnel; that path is retired.
37+
env:
38+
CLAUDEBOX_URL: ${{ vars.CLAUDEBOX_URL || 'https://claudebox.work' }}
39+
2340
jobs:
2441
claudebox:
2542
if: >-
@@ -49,41 +66,13 @@ jobs:
4966
repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
5067
-f content='eyes' || true
5168
52-
- name: Setup SSH tunnel to ClaudeBox
53-
env:
54-
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
55-
run: |
56-
set -eu
57-
mkdir -p ~/.ssh
58-
echo "${BUILD_INSTANCE_SSH_KEY}" | base64 --decode > ~/.ssh/build_instance_key
59-
chmod 600 ~/.ssh/build_instance_key
60-
61-
# SSH tunnel: CI runner :4001 → bastion :3000 → (reverse tunnel) → claude-box :3001
62-
ssh -f -N -L 4001:localhost:3000 \
63-
-o StrictHostKeyChecking=no \
64-
-o ServerAliveInterval=30 \
65-
-o ServerAliveCountMax=3 \
66-
-o ConnectTimeout=15 \
67-
-i ~/.ssh/build_instance_key \
68-
ubuntu@ci.aztec-labs.com
69-
70-
# Wait for tunnel
71-
for i in $(seq 1 15); do
72-
if curl -s -o /dev/null --max-time 2 http://localhost:4001/ 2>/dev/null; then
73-
echo "SSH tunnel ready"
74-
exit 0
75-
fi
76-
sleep 1
77-
done
78-
echo "ERROR: SSH tunnel failed to connect"
79-
exit 1
80-
8169
- name: Parse command
8270
id: parse
8371
env:
8472
COMMENT_BODY: ${{ github.event.comment.body || '' }}
8573
INPUT_PROMPT: ${{ inputs.prompt || '' }}
8674
INPUT_LINK: ${{ inputs.link || '' }}
75+
INPUT_TARGET_REF: ${{ inputs.target_ref || '' }}
8776
run: |
8877
if [ -n "$INPUT_PROMPT" ]; then
8978
PROMPT="$INPUT_PROMPT"
@@ -93,6 +82,14 @@ jobs:
9382
LINK=""
9483
fi
9584
85+
# ClaudeBox v2 has no separate target_ref input; fold it into the
86+
# prompt so the agent fetches and bases its branch on the right ref.
87+
if [ -n "$INPUT_TARGET_REF" ]; then
88+
PROMPT="$PROMPT
89+
90+
Work against git ref: $INPUT_TARGET_REF. Fetch it and base your branch on it."
91+
fi
92+
9693
echo "link=$LINK" >> "$GITHUB_OUTPUT"
9794
{
9895
echo "prompt<<PROMPT_EOF"
@@ -120,22 +117,28 @@ jobs:
120117
echo "run_comment_id=$COMMENT_ID" >> "$GITHUB_OUTPUT"
121118
echo "Posted status comment: $COMMENT_ID"
122119
123-
- name: Run ClaudeBox
124-
timeout-minutes: 120
120+
- name: Dispatch ClaudeBox v2
125121
env:
126-
CLAUDEBOX_URL: http://localhost:4001
127122
CLAUDEBOX_API_SECRET: ${{ secrets.CLAUDEBOX_API_SECRET }}
128123
CLAUDEBOX_PROMPT: ${{ steps.parse.outputs.prompt }}
129124
CLAUDEBOX_LINK: ${{ steps.parse.outputs.link }}
130-
CLAUDEBOX_TARGET_REF: ${{ inputs.target_ref || '' }}
131125
COMMENT_ID: ${{ github.event.comment.id || '' }}
132126
RUN_COMMENT_ID: ${{ steps.status_comment.outputs.run_comment_id || '' }}
133127
REPO: ${{ github.repository }}
134128
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
135129
AUTHOR: ${{ github.event.comment.user.login || github.actor }}
130+
SLACK_CHANNEL: ${{ inputs.slack_channel || '' }}
131+
SLACK_THREAD_TS: ${{ inputs.slack_thread_ts || '' }}
132+
# Public mode grants the session read-write access to public repos
133+
# (aztec-packages). Without it the session only gets the group's
134+
# unscoped repos and cannot open PRs against aztec-packages.
135+
CLAUDEBOX_MODE: ${{ vars.CLAUDEBOX_MODE || 'public' }}
136136
run: |
137-
AUTH="Authorization: Bearer ${CLAUDEBOX_API_SECRET}"
138-
echo "Creating payload..."
137+
if [ -z "${CLAUDEBOX_API_SECRET:-}" ]; then
138+
echo "ERROR: CLAUDEBOX_API_SECRET is not set; cannot dispatch ClaudeBox v2"
139+
exit 1
140+
fi
141+
139142
PAYLOAD=$(jq -n \
140143
--arg prompt "$CLAUDEBOX_PROMPT" \
141144
--arg user "$AUTHOR" \
@@ -144,41 +147,30 @@ jobs:
144147
--arg repo "$REPO" \
145148
--arg run_url "$RUN_URL" \
146149
--arg link "$CLAUDEBOX_LINK" \
147-
--arg target_ref "$CLAUDEBOX_TARGET_REF" \
148-
'{prompt: $prompt, user: $user, comment_id: $comment_id, run_comment_id: $run_comment_id, repo: $repo, run_url: $run_url, link: $link, target_ref: $target_ref}')
149-
150-
echo "Sending payload..."
151-
# Start session — returns 202 with log URL
150+
--arg slack_channel "$SLACK_CHANNEL" \
151+
--arg slack_thread_ts "$SLACK_THREAD_TS" \
152+
--arg mode "$CLAUDEBOX_MODE" \
153+
'{prompt: $prompt, user: $user, repo: $repo, run_url: $run_url, link: $link, slack_channel: $slack_channel, slack_thread_ts: $slack_thread_ts, mode: $mode}
154+
+ (if $comment_id != "" then {comment_id: ($comment_id | tonumber)} else {} end)
155+
+ (if $run_comment_id != "" then {run_comment_id: ($run_comment_id | tonumber)} else {} end)')
156+
157+
# Fire-and-forget: v2 reports progress to Slack / GitHub comments.
152158
RESPONSE=$(curl -sS -w "\n%{http_code}" \
153-
-H "$AUTH" -H "Content-Type: application/json" \
159+
-H "Authorization: Bearer ${CLAUDEBOX_API_SECRET}" \
160+
-H "Content-Type: application/json" \
154161
-d "$PAYLOAD" "${CLAUDEBOX_URL}/run")
155162
156163
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
157164
BODY=$(echo "$RESPONSE" | head -n -1)
158165
159166
if [ "$HTTP_CODE" -ge 400 ] 2>/dev/null; then
160-
echo "ClaudeBox returned HTTP $HTTP_CODE: $BODY"
167+
echo "ClaudeBox v2 returned HTTP $HTTP_CODE: $BODY"
161168
exit 1
162169
fi
163170
164-
LOG_URL=$(echo "$BODY" | jq -r '.log_url // empty')
165-
SESSION_ID=$(basename "$LOG_URL")
166-
echo "Session started: $LOG_URL"
167-
168-
echo "Session received, polling..."
169-
# Poll until completed
170-
while true; do
171-
sleep 30
172-
STATUS_BODY=$(curl -sS -H "$AUTH" "${CLAUDEBOX_URL}/session/${SESSION_ID}" 2>/dev/null || echo '{}')
173-
STATUS=$(echo "$STATUS_BODY" | jq -r '.status // "unknown"')
174-
echo "$(date -u +%H:%M:%S) status=$STATUS"
175-
if [ "$STATUS" != "running" ]; then
176-
EXIT_CODE=$(echo "$STATUS_BODY" | jq -r '.exit_code // 1')
177-
echo "Session finished: status=$STATUS exit_code=$EXIT_CODE"
178-
echo "Log: $LOG_URL"
179-
exit "$EXIT_CODE"
180-
fi
181-
done
171+
SESSION_ID=$(echo "$BODY" | jq -r '.session_id // empty')
172+
echo "ClaudeBox v2 session: ${CLAUDEBOX_URL}/v2/sessions/${SESSION_ID}"
173+
echo "Status: $(echo "$BODY" | jq -r '.status // "unknown"')"
182174
183175
claude-review:
184176
if: >-
@@ -189,33 +181,6 @@ jobs:
189181
permissions:
190182
contents: read
191183
steps:
192-
- name: Setup SSH tunnel to ClaudeBox
193-
env:
194-
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
195-
run: |
196-
set -eu
197-
mkdir -p ~/.ssh
198-
echo "${BUILD_INSTANCE_SSH_KEY}" | base64 --decode > ~/.ssh/build_instance_key
199-
chmod 600 ~/.ssh/build_instance_key
200-
201-
ssh -f -N -L 4001:localhost:3000 \
202-
-o StrictHostKeyChecking=no \
203-
-o ServerAliveInterval=30 \
204-
-o ServerAliveCountMax=3 \
205-
-o ConnectTimeout=15 \
206-
-i ~/.ssh/build_instance_key \
207-
ubuntu@ci.aztec-labs.com
208-
209-
for i in $(seq 1 15); do
210-
if curl -s -o /dev/null --max-time 2 http://localhost:4001/ 2>/dev/null; then
211-
echo "SSH tunnel ready"
212-
exit 0
213-
fi
214-
sleep 1
215-
done
216-
echo "ERROR: SSH tunnel failed to connect"
217-
exit 1
218-
219184
- name: Post review status comment
220185
id: status_comment
221186
env:
@@ -232,10 +197,8 @@ jobs:
232197
echo "run_comment_id=$COMMENT_ID" >> "$GITHUB_OUTPUT"
233198
echo "Posted review status comment: $COMMENT_ID"
234199
235-
- name: Trigger ClaudeBox review
236-
timeout-minutes: 120
200+
- name: Dispatch ClaudeBox v2 review
237201
env:
238-
CLAUDEBOX_URL: http://localhost:4001
239202
CLAUDEBOX_API_SECRET: ${{ secrets.CLAUDEBOX_API_SECRET }}
240203
PR_NUMBER: ${{ github.event.pull_request.number }}
241204
PR_TITLE: ${{ github.event.pull_request.title }}
@@ -245,8 +208,12 @@ jobs:
245208
RUN_COMMENT_ID: ${{ steps.status_comment.outputs.run_comment_id || '' }}
246209
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
247210
REPO: ${{ github.repository }}
211+
CLAUDEBOX_MODE: ${{ vars.CLAUDEBOX_MODE || 'public' }}
248212
run: |
249-
AUTH="Authorization: Bearer ${CLAUDEBOX_API_SECRET}"
213+
if [ -z "${CLAUDEBOX_API_SECRET:-}" ]; then
214+
echo "ERROR: CLAUDEBOX_API_SECRET is not set; cannot dispatch ClaudeBox v2"
215+
exit 1
216+
fi
250217
251218
PROMPT="Review PR #${PR_NUMBER}: ${PR_TITLE}
252219
${PR_URL}
@@ -265,36 +232,23 @@ jobs:
265232
--arg repo "$REPO" \
266233
--arg run_url "$RUN_URL" \
267234
--arg link "$PR_URL" \
268-
--arg profile "review" \
269-
'{prompt: $prompt, user: $user, run_comment_id: $run_comment_id, repo: $repo, run_url: $run_url, link: $link, profile: $profile}')
235+
--arg mode "$CLAUDEBOX_MODE" \
236+
'{prompt: $prompt, user: $user, repo: $repo, run_url: $run_url, link: $link, mode: $mode}
237+
+ (if $run_comment_id != "" then {run_comment_id: ($run_comment_id | tonumber)} else {} end)')
270238
271239
RESPONSE=$(curl -sS -w "\n%{http_code}" \
272-
-H "$AUTH" -H "Content-Type: application/json" \
240+
-H "Authorization: Bearer ${CLAUDEBOX_API_SECRET}" \
241+
-H "Content-Type: application/json" \
273242
-d "$PAYLOAD" "${CLAUDEBOX_URL}/run")
274243
275244
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
276245
BODY=$(echo "$RESPONSE" | head -n -1)
277246
278247
if [ "$HTTP_CODE" -ge 400 ] 2>/dev/null; then
279-
echo "ClaudeBox returned HTTP $HTTP_CODE: $BODY"
280-
exit 1
248+
echo "ClaudeBox v2 returned HTTP $HTTP_CODE: $BODY"
249+
# Review dispatch failures are informational — don't fail the workflow.
250+
exit 0
281251
fi
282252
283-
LOG_URL=$(echo "$BODY" | jq -r '.log_url // empty')
284-
SESSION_ID=$(basename "$LOG_URL")
285-
echo "Review session started: $LOG_URL"
286-
287-
# Poll until completed
288-
while true; do
289-
sleep 30
290-
STATUS_BODY=$(curl -sS -H "$AUTH" "${CLAUDEBOX_URL}/session/${SESSION_ID}" 2>/dev/null || echo '{}')
291-
STATUS=$(echo "$STATUS_BODY" | jq -r '.status // "unknown"')
292-
echo "$(date -u +%H:%M:%S) status=$STATUS"
293-
if [ "$STATUS" != "running" ]; then
294-
EXIT_CODE=$(echo "$STATUS_BODY" | jq -r '.exit_code // 1')
295-
echo "Review finished: status=$STATUS exit_code=$EXIT_CODE"
296-
echo "Log: $LOG_URL"
297-
# Don't fail the workflow on review errors — the review itself is informational
298-
exit 0
299-
fi
300-
done
253+
SESSION_ID=$(echo "$BODY" | jq -r '.session_id // empty')
254+
echo "ClaudeBox v2 review session: ${CLAUDEBOX_URL}/v2/sessions/${SESSION_ID}"

.github/workflows/deploy-network.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ jobs:
294294
gh workflow run claudebox.yml \
295295
-f prompt="$PROMPT" \
296296
-f link="${LINK:-$RUN_URL}" \
297-
-f target_ref="${{ steps.checkout-ref.outputs.ref }}" || true
297+
-f target_ref="${{ steps.checkout-ref.outputs.ref }}" \
298+
-f slack_channel="$CHANNEL_ID" \
299+
-f slack_thread_ts="$TS" || true
298300
299301
update-irm:
300302
needs: deploy-network

barretenberg/cpp/pil/vm2/constants_gen.pil

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ namespace constants;
1515
pol MAX_L2_TO_L1_MSGS_PER_TX = 8;
1616
pol MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 3000;
1717
pol MAX_PROTOCOL_CONTRACTS = 11;
18-
pol CANONICAL_AUTH_REGISTRY_ADDRESS = 1;
1918
pol CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS = 2;
2019
pol CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS = 3;
2120
pol MULTI_CALL_ENTRYPOINT_ADDRESS = 4;

barretenberg/cpp/src/barretenberg/aztec/aztec_constants.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#define GENESIS_ARCHIVE_ROOT "0x177a4955b31ecaafad999753938a44e526b54c5ba5d536688227f85f15cfbdf5"
2222
#define MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS 3000
2323
#define MAX_PROTOCOL_CONTRACTS 11
24-
#define CANONICAL_AUTH_REGISTRY_ADDRESS 1
2524
#define CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS 2
2625
#define CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS 3
2726
#define MULTI_CALL_ENTRYPOINT_ADDRESS 4
@@ -247,8 +246,7 @@
247246
#define AVM_EMITPUBLICLOG_DYN_DA_GAS 32
248247
#define AVM_SSTORE_DYN_DA_GAS 64
249248
#define AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT 6
250-
#define AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT \
251-
"0x13954b76f8ab76c38ab687731f802fc90e5d55e0592fa6f56d0a73024b3f8356"
249+
#define AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT "0x13954b76f8ab76c38ab687731f802fc90e5d55e0592fa6f56d0a73024b3f8356"
252250
#define AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE 1
253251
#define AVM_RETRIEVED_BYTECODES_TREE_HEIGHT 5
254252
#define AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT "0x0ff65ad321f05745d4c80e2e18e94241093d2e49017ff8cc151df4f207a43c12"

boxes/boxes/react/src/contracts/src/main.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ contract BoxReact {
2121
let new_number = FieldNote { value: number };
2222

2323
self.storage.numbers.at(owner).initialize(new_number).deliver(
24-
MessageDelivery.ONCHAIN_CONSTRAINED,
24+
MessageDelivery::onchain_constrained(),
2525
);
2626
}
2727

2828
#[external("private")]
2929
fn setNumber(number: Field, owner: AztecAddress) {
3030
self.storage.numbers.at(owner).replace(|_old| FieldNote { value: number }).deliver(
31-
MessageDelivery.ONCHAIN_CONSTRAINED,
31+
MessageDelivery::onchain_constrained(),
3232
);
3333
}
3434

0 commit comments

Comments
 (0)