feat: add production UI gallery and inspector system
CI / Format, lint, test, build (push) Waiting to run
CI / Format, lint, test, build (push) Waiting to run
This commit is contained in:
1 parent
cf6eaba534
commit
53dc1e44d8
95 files changed
+11003
-1652
No files matched your search
@@ -24,6 +24,10 @@ field() {
|
||||
|
||||
LANE="$(field build_lane)"
|
||||
[[ -n "$LANE" ]] || LANE="dev"
|
||||
PACKAGE="$(field package)"
|
||||
[[ -n "$PACKAGE" ]] || PACKAGE="editor"
|
||||
BINARY_NAME="$(field binary)"
|
||||
[[ -n "$BINARY_NAME" ]] || BINARY_NAME="editor"
|
||||
FIXTURE="$(field fixture)"
|
||||
mkdir -p "$STATE_ROOT" "$EVIDENCE_ROOT"
|
||||
|
||||
@@ -102,14 +106,15 @@ PY
|
||||
|
||||
case "$ACTION" in
|
||||
plan)
|
||||
LANE_JSON="$(lane_json)" python - "$SCENARIO" "$FIXTURE" <<'PY'
|
||||
LANE_JSON="$(lane_json)" PACKAGE="$PACKAGE" BINARY_NAME="$BINARY_NAME" python - "$SCENARIO" "$FIXTURE" <<'PY'
|
||||
import json, os, pathlib, sys
|
||||
layout = json.loads(os.environ["LANE_JSON"])
|
||||
scenario = pathlib.Path(sys.argv[1])
|
||||
fixture = sys.argv[2]
|
||||
binary = pathlib.Path(layout["target_dir"]) / layout["profile_dir"] / "editor"
|
||||
binary = pathlib.Path(layout["target_dir"]) / layout["profile_dir"] / os.environ["BINARY_NAME"]
|
||||
print(f"PASS native-qa-plan — {scenario.stem}")
|
||||
print(f"Lane: {layout['lane']} ({layout['mode']})")
|
||||
print(f"Package: {os.environ['PACKAGE']}")
|
||||
print(f"Binary: {binary}")
|
||||
print(f"Runtime deps: {layout['runtime_deps']}")
|
||||
print(f"Fixture: {fixture or 'scenario-defined'}")
|
||||
@@ -131,10 +136,14 @@ PY
|
||||
--gate "native-$NAME-build" \
|
||||
--log "$ROOT/.codex/logs/native-$NAME-build.log" \
|
||||
--json-result "$ROOT/.codex/logs/native-$NAME-build.json" \
|
||||
-- python "$ROOT/scripts/codex/cargo_lane.py" exec "$LANE" -- cargo build -p editor --bin editor
|
||||
-- python "$ROOT/scripts/codex/cargo_lane.py" exec "$LANE" -- cargo build -p "$PACKAGE" --bin "$BINARY_NAME"
|
||||
python "$ROOT/scripts/codex/build_storage.py" enforce --phase post
|
||||
LAUNCH_ARGS=()
|
||||
if [[ "$BINARY_NAME" = "editor" ]]; then
|
||||
LAUNCH_ARGS=(--project "$ROOT")
|
||||
fi
|
||||
nohup python "$ROOT/scripts/codex/cargo_lane.py" run "$LANE" -- \
|
||||
target/debug/editor --project "$ROOT" \
|
||||
"target/debug/$BINARY_NAME" "${LAUNCH_ARGS[@]}" \
|
||||
>"$ROOT/.codex/logs/native-$NAME-launch.log" 2>&1 &
|
||||
PID=$!
|
||||
python - "$STATE_ROOT/native-$NAME.json" "$PID" <<'PY'
|
||||
@@ -151,7 +160,7 @@ PY
|
||||
PID="$3"
|
||||
kill -0 "$PID" 2>/dev/null || { echo "native-qa: PID $PID is not running" >&2; exit 2; }
|
||||
CMDLINE="$(tr '\0' ' ' <"/proc/$PID/cmdline")"
|
||||
[[ "$CMDLINE" == *"editor"* ]] || { echo "native-qa: refusing unexpected process: $CMDLINE" >&2; exit 2; }
|
||||
[[ "$CMDLINE" == *"$BINARY_NAME"* ]] || { echo "native-qa: refusing unexpected process: $CMDLINE" >&2; exit 2; }
|
||||
snapshot_fixture
|
||||
python - "$STATE_ROOT/native-$NAME.json" "$PID" <<'PY'
|
||||
import json, pathlib, sys, time
|
||||
@@ -328,7 +337,7 @@ PY
|
||||
SPAWNED="$(python -c 'import json,sys; print(str(bool(json.load(open(sys.argv[1])).get("spawned_by_runner"))).lower())' "$RECORD")"
|
||||
if [[ "$SPAWNED" = "true" ]] && kill -0 "$PID" 2>/dev/null; then
|
||||
CMDLINE="$(tr '\0' ' ' <"/proc/$PID/cmdline")"
|
||||
[[ "$CMDLINE" == *"editor"* ]] || { echo "native-qa: refusing to stop unexpected process: $CMDLINE" >&2; exit 2; }
|
||||
[[ "$CMDLINE" == *"$BINARY_NAME"* ]] || { echo "native-qa: refusing to stop unexpected process: $CMDLINE" >&2; exit 2; }
|
||||
kill -TERM "$PID"
|
||||
fi
|
||||
python - "$RECORD" <<'PY'
|
||||
|
||||
Reference in new issue
Block a user