-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (92 loc) · 5.16 KB
/
Copy pathMakefile
File metadata and controls
113 lines (92 loc) · 5.16 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
# Praxis 控制面构建入口。
# proto 目标复跑 gRPC/protobuf 代码生成,产物落 api/proto/(AGENTS.md 约定)。
.PHONY: proto proto-tools proto-check registry-portability-check sensing-invariant-check \
test test-integration build \
driver-cdp-venv driver-cdp-gen-proto driver-cdp-test driver-cdp-test-integration \
driver-cdp-benchmark driver-cdp-license-check \
live-site-acceptance-preflight live-site-acceptance
# driver-cdp(T2)目录与其 venv Python(隔离于宿主,避免污染系统解释器)。
DRIVER_CDP_DIR := drivers/driver-cdp
DRIVER_CDP_PY := $(DRIVER_CDP_DIR)/.venv/bin/python
# 真实站点验收显式门控;均可在命令行覆盖,默认只使用本机隔离 venv 与
# Google Chrome,不读取用户浏览器 Profile 或登录态。
LIVESITE_VENV ?= $(abspath $(DRIVER_CDP_PY))
LIVESITE_CHROME ?= /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
LIVESITE_REPORT ?= $(CURDIR)/docs/acceptance/live-site-e2e-latest.md
# 工具链版本锁定(与 CI 一致):
# protoc 33.x
# protoc-gen-go v1.36.x (google.golang.org/protobuf)
# protoc-gen-go-grpc v1.6.x (google.golang.org/grpc/cmd/protoc-gen-go-grpc)
PROTOC_GEN_GO_VERSION := v1.36.11
PROTOC_GEN_GO_GRPC_VERSION := v1.6.2
# proto-tools 安装锁定版本的 Go 插件到 $(go env GOPATH)/bin。
proto-tools:
go install google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GEN_GO_VERSION)
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$(PROTOC_GEN_GO_GRPC_VERSION)
# proto 生成 Go stub。产物与 .proto 同目录(go_package 指向 api/proto)。
# 可复跑:删除生成物后重跑结果一致。
proto:
protoc \
--proto_path=api/proto \
--go_out=. \
--go_opt=module=github.com/WW-AI-Lab/Agent-RPA \
--go-grpc_out=. \
--go-grpc_opt=module=github.com/WW-AI-Lab/Agent-RPA \
api/proto/browsernode.proto
# proto-check 校验全部 .proto 可编译(cognition.proto 为手写 Go 镜像,
# 不走 proto 生成目标,只做编译校验)。
proto-check:
bash scripts/proto-check.sh
# registry-portability-check 静态断言存储层可移植(skill-package-schema 6.4):
# SQL 无 SQLite 专有特性;驱动 import 仅限 Registry 参考实现。
registry-portability-check:
bash scripts/registry-portability-check.sh
# sensing-invariant-check 静态断言多模态感知层不变量(multimodal-sensing 7.1/7.2):
# I-1 不依赖具体驱动库;I-4 融合原语路径零认知依赖。
sensing-invariant-check:
bash scripts/sensing-invariant-check.sh
test:
go test ./...
test-integration:
go test -tags=integration ./test/...
build:
go build ./...
# live-site-acceptance 只访问公开免登录页面。前置检查失败会在启动 daemon 前
# 退出;站点不可达/结构漂移/人机挑战由 Go 套件分类并写入报告,不伪装为通过。
live-site-acceptance-preflight:
@test -x "$(LIVESITE_VENV)" || { echo "missing driver venv: $(LIVESITE_VENV); run make driver-cdp-venv" >&2; exit 1; }
@test -x "$(LIVESITE_CHROME)" || { echo "missing Chrome: $(LIVESITE_CHROME)" >&2; exit 1; }
@find openspec/changes/archive -maxdepth 1 -type d -name '*-browser-transport-runtime-wiring' -print -quit | grep -q . || { echo "browser-transport-runtime-wiring is not archived" >&2; exit 1; }
live-site-acceptance: live-site-acceptance-preflight
PRAXIS_LIVESITE_ACCEPTANCE=1 \
PRAXIS_LIVESITE_VENV="$(LIVESITE_VENV)" \
PRAXIS_LIVESITE_CHROME="$(LIVESITE_CHROME)" \
PRAXIS_LIVESITE_REPORT="$(LIVESITE_REPORT)" \
PRAXIS_LIVESITE_SECRET_SENTINEL="$${PRAXIS_LIVESITE_SECRET_SENTINEL:-praxis-live-site-i5-runtime-sentinel}" \
go test -count=1 -v ./test/acceptance/livesite
# ---------------------------------------------------------------------------
# driver-cdp(T2):Python 子进程驱动。单元测试离线可跑;integration/benchmark
# 需真实 headful Chrome(对应 change transport-driver-cdp-t2 §7)。
# ---------------------------------------------------------------------------
# driver-cdp-venv 建立隔离 venv 并安装运行/开发依赖(含 pytest)。
driver-cdp-venv:
cd $(DRIVER_CDP_DIR) && python3 -m venv .venv && \
.venv/bin/pip install --upgrade pip && \
.venv/bin/pip install -r requirements.txt pytest
# driver-cdp-gen-proto 从 api/proto/browsernode.proto 复跑 Python stub 生成。
driver-cdp-gen-proto:
cd $(DRIVER_CDP_DIR) && .venv/bin/python -m pip show grpcio-tools >/dev/null 2>&1 || .venv/bin/pip install grpcio-tools
cd $(DRIVER_CDP_DIR) && bash scripts/gen-proto.sh
# driver-cdp-test 跑离线单元测试(不启动 Chrome)。
driver-cdp-test:
cd $(DRIVER_CDP_DIR) && .venv/bin/python -m pytest -q
# driver-cdp-test-integration 跑端到端集成(需真实 Chrome)。
driver-cdp-test-integration:
cd $(DRIVER_CDP_DIR) && PRAXIS_CDP_INTEGRATION=1 .venv/bin/python -m pytest -q
go test -tags=integration ./drivers/cdp/
# driver-cdp-benchmark 跑抗检测基准(过第③层,SC3;需真实 Chrome)。
driver-cdp-benchmark:
cd $(DRIVER_CDP_DIR) && .venv/bin/python scripts/anti-detection-benchmark.py
# driver-cdp-license-check 静态断言主干未内联 nodriver(AGPL-3.0)。
driver-cdp-license-check:
bash $(DRIVER_CDP_DIR)/scripts/license-compliance-check.sh