-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (73 loc) · 3.74 KB
/
Copy pathMakefile
File metadata and controls
91 lines (73 loc) · 3.74 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
# 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
# driver-cdp(T2)目录与其 venv Python(隔离于宿主,避免污染系统解释器)。
DRIVER_CDP_DIR := drivers/driver-cdp
DRIVER_CDP_PY := $(DRIVER_CDP_DIR)/.venv/bin/python
# 工具链版本锁定(与 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 ./...
# ---------------------------------------------------------------------------
# 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