Skip to content

Commit 2ed4233

Browse files
authored
Adopt the Shaka v1 workflow seam (#838)
* Adopt Shaka v1 workflow seam * Run full validation through CI shim * Preserve workflow trust metadata * Update the Shaka seam contract * Honor custom renderer hosts in validation * Deduplicate the full validation wrapper
1 parent c8728e2 commit 2ed4233

6 files changed

Lines changed: 91 additions & 76 deletions

File tree

‎.agents/README.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Generated by shaka seam init. -->
2+
# `.agents`
3+
4+
This directory is this repository's contract with the [Shaka](https://github.com/shakacode/shaka) workflow.
5+
6+
| Path | What it is |
7+
| --- | --- |
8+
| `agent-workflow.yml` | The typed contract for Shaka-specific workflow policy. Shaka reads it from the trusted default branch, so a pull request cannot grant itself authority by editing its own copy. Live GitHub settings remain authoritative. |
9+
| `bin/` | Standard wrappers for this repository's setup, validation, and tests. Their fixed names form the portable command interface; they run from the checkout under review, so a pull request that edits one changes what validation executes. |
10+
11+
Edit `agent-workflow.yml` by hand, then validate it with `shaka seam check --root . --local`.
12+
Validation is strict: unknown keys, unsafe paths, and missing or non-executable
13+
scripts fail rather than being ignored. Keep human-only constraints in `AGENTS.md`;
14+
this directory holds only typed policy.
15+
16+
- [Seam settings](https://github.com/shakacode/shaka/blob/main/docs/settings.md) — every key, its type, and what it controls.
17+
- [Getting started](https://github.com/shakacode/shaka/blob/main/docs/getting-started.md#initialize-a-repository-seam) — how this directory was created.
18+
19+
Generated by `shaka seam init` from Shaka 0.1.0.pre.1. Repeating that command
20+
leaves this file alone; it never overwrites one you have edited.

‎.agents/agent-workflow.yml‎

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
1+
# Generated by shaka seam init.
12
---
2-
base_branch: master
3-
merge_submission:
4-
mode: direct
5-
trusted_actions:
6-
- actions/checkout
7-
- actions/github-script
8-
- actions/setup-node
9-
- anthropics/claude-code-action
10-
- browser-actions/setup-chrome
11-
- coactions/setup-xvfb
12-
- docker/setup-buildx-action
13-
- ruby/setup-ruby
14-
- shakacode/control-plane-flow
15-
- shakacode/react_on_rails
16-
follow_up_prefix: 'Follow-up:'
17-
review_gate: n/a
18-
approval_exempt: n/a
19-
coordination_backend: n/a
20-
changelog: n/a
21-
benchmark_labels: n/a
22-
merge_ledger: n/a
23-
ci_parity_environment: n/a
24-
hosted_ci_trigger: n/a
25-
ci_change_detector: n/a
3+
version: 1
264
repo_prefix: RWRT
5+
review:
6+
required: none
7+
merge:
8+
preference: ask
9+
branches:
10+
name: '{login}-{host}/{issue}-{description}'

‎.agents/bin/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ is absent means that capability is n/a in this repository.
88
| Script | Purpose | This repo runs |
99
| --- | --- | --- |
1010
| `setup` | Install dependencies | `bin/conductor-exec bin/setup --skip-server` |
11-
| `validate` | Pre-push gate | `bin/conductor-exec bin/rubocop` |
12-
| `test` | Run tests | `bin/conductor-exec bin/ci` |
11+
| `validate` | Full CI-equivalent validation | `bin/conductor-exec bin/ci` |
12+
| `test` | Full-suite compatibility entry point during seam adoption | delegates to `.agents/bin/validate` |
13+
| `validate-local` | Fast pre-review validation | `bin/conductor-exec bin/rubocop` |
1314
| `lint` | Lint / format | `bin/conductor-exec yarn lint:eslint` |
1415
| `build` | Build / type-check | generate React on Rails packs, build ReScript, then `bin/conductor-exec yarn build:test` |
1516
| `docs` | Docs checks | n/a |

‎.agents/bin/test‎

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,4 @@
22
# Generated by shakacode/agent-workflows agent-workflow-seam-doctor --init.
33
set -euo pipefail
44
cd "$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
5-
6-
renderer_port="${RENDERER_PORT:-3800}"
7-
if [[ -n "${RENDERER_PORT:-}" && -z "${RENDERER_URL:-}" ]]; then
8-
export RENDERER_URL="http://localhost:$renderer_port"
9-
fi
10-
renderer_started=false
11-
renderer_pid=''
12-
13-
cleanup_renderer() {
14-
local status=$?
15-
16-
if [[ "$renderer_started" == true ]] && kill -0 "$renderer_pid" 2>/dev/null; then
17-
kill "$renderer_pid" 2>/dev/null || true
18-
wait "$renderer_pid" 2>/dev/null || true
19-
fi
20-
21-
exit "$status"
22-
}
23-
24-
trap cleanup_renderer EXIT
25-
26-
bin/conductor-exec bin/setup --skip-server
27-
28-
if nc -z localhost "$renderer_port" 2>/dev/null; then
29-
echo "Reusing existing Node renderer on port $renderer_port."
30-
else
31-
bin/conductor-exec node renderer/node-renderer.js &
32-
renderer_pid=$!
33-
renderer_started=true
34-
35-
echo "Waiting for Node renderer (PID $renderer_pid) on port $renderer_port..."
36-
for _ in $(seq 1 30); do
37-
if ! kill -0 "$renderer_pid" 2>/dev/null; then
38-
echo "Node renderer exited unexpectedly (see output above)." >&2
39-
exit 1
40-
fi
41-
if nc -z localhost "$renderer_port" 2>/dev/null; then
42-
break
43-
fi
44-
sleep 1
45-
done
46-
47-
if ! nc -z localhost "$renderer_port" 2>/dev/null; then
48-
echo "Node renderer failed to start on port $renderer_port within 30 seconds (see output above)." >&2
49-
exit 1
50-
fi
51-
fi
52-
53-
bin/conductor-exec bin/ci
5+
exec .agents/bin/validate "$@"

‎.agents/bin/validate‎

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,57 @@
22
# Generated by shakacode/agent-workflows agent-workflow-seam-doctor --init.
33
set -euo pipefail
44
cd "$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
5-
exec bin/conductor-exec bin/rubocop "$@"
5+
6+
renderer_port="${RENDERER_PORT:-3800}"
7+
renderer_host="${RENDERER_HOST:-localhost}"
8+
if [[ -z "${RENDERER_URL:-}" ]]; then
9+
renderer_url_host="$renderer_host"
10+
if [[ "$renderer_url_host" == *:* ]]; then
11+
renderer_url_host="[$renderer_url_host]"
12+
fi
13+
export RENDERER_URL="http://$renderer_url_host:$renderer_port"
14+
fi
15+
renderer_started=false
16+
renderer_pid=''
17+
18+
cleanup_renderer() {
19+
local status=$?
20+
21+
if [[ "$renderer_started" == true ]] && kill -0 "$renderer_pid" 2>/dev/null; then
22+
kill "$renderer_pid" 2>/dev/null || true
23+
wait "$renderer_pid" 2>/dev/null || true
24+
fi
25+
26+
exit "$status"
27+
}
28+
29+
trap cleanup_renderer EXIT
30+
31+
bin/conductor-exec bin/setup --skip-server
32+
33+
if nc -z "$renderer_host" "$renderer_port" 2>/dev/null; then
34+
echo "Reusing existing Node renderer on port $renderer_port."
35+
else
36+
bin/conductor-exec node renderer/node-renderer.js &
37+
renderer_pid=$!
38+
renderer_started=true
39+
40+
echo "Waiting for Node renderer (PID $renderer_pid) on port $renderer_port..."
41+
for _ in $(seq 1 30); do
42+
if ! kill -0 "$renderer_pid" 2>/dev/null; then
43+
echo "Node renderer exited unexpectedly (see output above)." >&2
44+
exit 1
45+
fi
46+
if nc -z "$renderer_host" "$renderer_port" 2>/dev/null; then
47+
break
48+
fi
49+
sleep 1
50+
done
51+
52+
if ! nc -z "$renderer_host" "$renderer_port" 2>/dev/null; then
53+
echo "Node renderer failed to start on port $renderer_port within 30 seconds (see output above)." >&2
54+
exit 1
55+
fi
56+
fi
57+
58+
bin/conductor-exec bin/ci

‎.agents/bin/validate-local‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Generated by shakacode/agent-workflows agent-workflow-seam-doctor --init.
3+
set -euo pipefail
4+
cd "$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
5+
exec bin/conductor-exec bin/rubocop "$@"

0 commit comments

Comments
 (0)