diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index ede1fbd..bb62b4c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -9,23 +9,251 @@ jobs: runs-on: ubuntu-latest env: GOPROXY: https://goproxy.cn,direct + GOTOOLCHAIN: local + GOWORK: "off" + GOPRIVATE: git-ssh.u1680832.nyat.app/weichen steps: - name: Checkout env: TOKEN: ${{ secrets.GITHUB_TOKEN }} SUBMODULE_TOKEN: ${{ secrets.SUBMODULE_TOKEN }} - run: | + run: &trusted_acquisition_1 | set -euo pipefail - git init -q - git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" - git -c http.extraheader="AUTHORIZATION: token ${TOKEN}" fetch --depth=1 origin "${GITHUB_SHA}" - git checkout -q --detach FETCH_HEAD - if [ -z "${SUBMODULE_TOKEN}" ]; then - echo "SUBMODULE_TOKEN is not configured" >&2 - exit 1 - fi - git config --global url."https://weichen:${SUBMODULE_TOKEN}@git-home.u1680832.nyat.app:30319/".insteadOf "ssh://git@git-ssh.u1680832.nyat.app:31411/" - git -c fetch.recurseSubmodules=false submodule update --init --recursive + python3 - <<'PY_TRUSTED' + # Trusted workflow code only: never import or execute checkout scripts here. + # Token scopes, workflow provenance and runner isolation are platform NOT_RUN. + import json + import os + from pathlib import Path + import re + import shlex + import subprocess + import sys + import tempfile + from urllib.parse import urlsplit + + SERVER = os.environ.get("GITHUB_SERVER_URL", "").rstrip("/") + parsed = urlsplit(SERVER) + if (parsed.scheme not in {"http", "https"} or not parsed.netloc or + parsed.username or parsed.password or parsed.query or parsed.fragment): + sys.exit("Acquisition requires the platform-injected http(s) server") + SSH = "ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/" + GO_PREFIX = "git-ssh.u1680832.nyat.app/weichen/" + REPOS = {"Agent-System-Dev", "Logging-System", "Error-Code-System", "Agent-System-Core", "Agent-Native", + "Agent-Intent", "Agent-Command", "Agent-Squad", "Agent-System-Backend", + "Agent-System-Frontend", "Agent-System-UI", "Agent-System-RDM", + "Development-Guidelines", "Agent-System-Documents"} + LEGACY = { + "modules/core": "Agent-System-Core", "modules/backend": "Agent-System-Backend", + "modules/frontend": "Agent-System-Frontend", "modules/ui": "Agent-System-UI", + "modules/documents": "Agent-System-Documents", "deps/agent-system-core": "Agent-System-Core", + "deps/development-guidelines": "Development-Guidelines", "deps/agent-native": "Agent-Native", + "deps/agent-squad": "Agent-Squad", "deps/agent-intent": "Agent-Intent", + "deps/agent-command": "Agent-Command", "deps/error-code-system": "Error-Code-System", + "deps/logging-system": "Logging-System", "pins/agent-system-backend": "Agent-System-Backend", + "pins/agent-system-core": "Agent-System-Core", "pins/agent-system-frontend": "Agent-System-Frontend", + "pins/agent-system-ui": "Agent-System-UI", + } + GO_REPOS = REPOS - {"Agent-System-Dev", "Agent-System-UI", "Agent-System-Frontend", "Development-Guidelines", "Agent-System-Documents"} + GO_MODULES = {GO_PREFIX + repo + ".git" for repo in GO_REPOS} + GO_MODULES |= {GO_PREFIX + "Agent-Squad.git/" + suffix for suffix in + ("adapters/native", "adapters/intent", "adapters/sqlite", "adapters/a2a", "cmd/agent-squad")} + root_token = os.environ.pop("TOKEN", "") + component_token = os.environ.pop("SUBMODULE_TOKEN", "") + # Go environment files and inherited Git tracing/config must not change acquisition. + clean = {k: v for k, v in os.environ.items() + if not k.startswith(("GIT_", "NPM_CONFIG_", "npm_config_")) and + not any(word in k.upper() for word in ("TOKEN", "PASSWORD", "SECRET"))} + clean.update(GIT_CONFIG_NOSYSTEM="1", GIT_CONFIG_SYSTEM="/dev/null", GIT_CONFIG_GLOBAL="/dev/null", + GIT_TERMINAL_PROMPT="0", GOENV="off", GOTOOLCHAIN="local", GOWORK="off", GOFLAGS="-mod=readonly", + GOPRIVATE=GO_PREFIX.rstrip("/"), GONOPROXY=GO_PREFIX.rstrip("/"), GONOSUMDB=GO_PREFIX.rstrip("/")) + if os.environ.get("npm_config_cache"): + clean["npm_config_cache"] = os.environ["npm_config_cache"] + config = {"core.hooksPath": "/dev/null", "core.fsmonitor": "false", "init.templateDir": "", + "credential.helper": "", "fetch.recurseSubmodules": "false", "submodule.recurse": "false", + "http.followRedirects": "false", "protocol.allow": "never", "protocol." + parsed.scheme + ".allow": "always"} + root = Path.cwd() + mirrors = root / ".ci-mirrors" + + def process_env(values): + env = clean | {"GIT_CONFIG_COUNT": str(len(values))} + for index, (key, value) in enumerate(values.items()): + env[f"GIT_CONFIG_KEY_{index}"] = key + env[f"GIT_CONFIG_VALUE_{index}"] = value + return env + + def git(directory, *args, token="", repo=""): + values = config.copy() + if token: + if repo not in REPOS: + raise ValueError("Credential destination is outside the reviewed repository allowlist") + values[f"http.{SERVER}/weichen/{repo}.git.extraheader"] = "AUTHORIZATION: token " + token + result = subprocess.run(["git", "-C", str(directory), *args], env=process_env(values), + check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + return result.stdout + + def fixed_sha(value): + if not isinstance(value, str) or not re.fullmatch(r"[0-9a-fA-F]{40}", value): + raise ValueError("Source acquisition requires a fixed commit SHA") + return value.lower() + + def mirror(repo, sha, token): + sha = fixed_sha(sha) + destination = mirrors / (repo + ".git") + if destination.is_symlink() or mirrors.is_symlink(): + raise ValueError("Mirror directory cannot be a symlink") + mirrors.mkdir(exist_ok=True) + if not destination.exists(): + destination.mkdir() + git(destination, "init", "--bare", "-q") + url = f"{SERVER}/weichen/{repo}.git" + try: + git(destination, "cat-file", "-e", sha + "^{commit}") + except subprocess.CalledProcessError: + git(destination, "fetch", "--depth=200", url, sha, token=token, repo=repo) + git(destination, "update-ref", "refs/heads/main", sha) + git(destination, "symbolic-ref", "HEAD", "refs/heads/main") + git(destination, "update-ref", "refs/ci/" + sha, sha) + return destination + + def mirror_env(): + values = {"protocol.file.allow": "always", "core.hooksPath": "/dev/null", "credential.helper": ""} + # Distinct keys use repeated .insteadOf values, represented as a sequence below. + pairs = list(values.items()) + for repo in sorted(REPOS): + destination = mirrors / (repo + ".git") + if not destination.exists(): + continue + key = "url." + destination.as_uri() + ".insteadOf" + pairs.extend((key, url) for url in (SSH + repo + ".git", "https://" + GO_PREFIX + repo + ".git", + SERVER + "/weichen/" + repo + ".git", "https://" + GO_PREFIX + repo)) + env = clean | {"CI_DEPENDENCY_MIRRORS": str(mirrors), "GIT_CONFIG_COUNT": str(len(pairs))} + for index, (key, value) in enumerate(pairs): + env[f"GIT_CONFIG_KEY_{index}"] = key + env[f"GIT_CONFIG_VALUE_{index}"] = value + exports = {k: v for k, v in env.items() if k.startswith("GIT_CONFIG_") or k == "CI_DEPENDENCY_MIRRORS"} + (root / ".ci-mirrors.env").write_text("".join("export " + k + "=" + shlex.quote(v) + "\n" for k, v in exports.items())) + return env + + def materialize_legacy(directory, depth=0): + if depth > 16: + raise ValueError("Historical submodule depth exceeds the checkout limit") + links = {} + for entry in git(directory, "ls-tree", "-rz", "HEAD").split(b"\0"): + if entry: + metadata, path = entry.split(b"\t", 1) + mode, kind, commit = metadata.decode().split() + if mode == "160000": + links[path.decode()] = commit + if not links: + return + raw = git(directory, "config", "--no-includes", "--blob", "HEAD:.gitmodules", "--null", "--list") + entries = {} + for item in raw.split(b"\0"): + if not item: + continue + key, value = item.decode().split("\n", 1) + match = re.fullmatch(r"submodule\.(.+)\.(path|url)", key) + if not match: + raise ValueError("Unsupported candidate .gitmodules setting") + name, field = match.groups() + if field in entries.setdefault(name, {}): + raise ValueError("Duplicate candidate .gitmodules setting") + entries[name][field] = value + if set(entries) != set(links): + raise ValueError("Submodule names must match fixed gitlink paths") + for name, fields in entries.items(): + repo = LEGACY.get(name) + if not repo or fields.get("path") != name or fields.get("url") not in { + SSH + repo + ".git", f"{SERVER}/weichen/{repo}.git"}: + raise ValueError("Historical submodule source is outside the reviewed allowlist") + for name in entries: + repo = LEGACY[name] + sha = links[name] + url = f"{SERVER}/weichen/{repo}.git" + git(directory, "config", f"submodule.{name}.url", url) + # Trusted explicit checkout prevents candidate update commands from running. + git(directory, "submodule", "update", "--init", "--checkout", "--", name, token=component_token, repo=repo) + child = directory / name + if git(child, "rev-parse", "HEAD").decode().strip() != sha: + raise ValueError("Historical submodule does not match its fixed SHA") + mirror(repo, sha, component_token) + materialize_legacy(child, depth + 1) + + def materialize_manifest(directory): + manifest = directory / "components.json" + lock = directory / "components.lock.json" + if not manifest.exists() and not lock.exists(): + materialize_legacy(directory) + return + data = json.loads(manifest.read_text()) + locked = json.loads(lock.read_text()) + if data.get("schema") != 1 or locked.get("schema") != 1: + raise ValueError("Unsupported source manifest schema") + entries = {} + for item in data["components"]: + repo = item["id"] + path = ".workspace/" + repo + if (repo not in REPOS or repo in entries or item["path"] != path or + item["repo"] not in {SSH + repo + ".git", f"{SERVER}/weichen/{repo}.git"} or + item.get("role") not in {"go-library", "npm-library", "application", "guidelines", "documentation"}): + raise ValueError("Candidate source manifest is outside the reviewed allowlist") + for module in item.get("modules", []): + if module.get("path") not in GO_MODULES or not module["path"].startswith(GO_PREFIX + repo + ".git"): + raise ValueError("Candidate module mapping is outside the reviewed allowlist") + entries[repo] = item + selected = locked["components"] + if set(selected) - set(entries): + raise ValueError("Source lock refers to an unregistered repository") + for repo, item in entries.items(): + if item["role"] in {"application", "guidelines", "documentation"} and repo not in selected: + raise ValueError("Application and documentation source needs a fixed lock") + for repo, pin in selected.items(): + fixed_sha(pin["commit"]) + destination = directory / entries[repo]["path"] + if destination.exists() or destination.is_symlink() or destination.parent.is_symlink(): + raise ValueError("Source materialization requires a fresh destination") + # Validate the complete lock before any authenticated component fetch. + for repo, pin in selected.items(): + sha = fixed_sha(pin["commit"]) + destination = directory / entries[repo]["path"] + destination.mkdir(parents=True) + url = f"{SERVER}/weichen/{repo}.git" + git(destination, "init", "-q") + git(destination, "remote", "add", "origin", url) + git(destination, "fetch", "--depth=1", "origin", sha, token=component_token, repo=repo) + git(destination, "checkout", "-q", "--detach", "FETCH_HEAD") + if git(destination, "rev-parse", "HEAD").decode().strip() != sha: + raise ValueError("Materialized source differs from the fixed lock") + # Persist the registered identity; process config chooses the transport. + git(destination, "remote", "set-url", "origin", entries[repo]["repo"]) + mirror(repo, sha, component_token) + materialize_legacy(destination) + + try: + if os.environ.get("GITHUB_REPOSITORY") != "weichen/Agent-Native": + raise ValueError("Checkout repository is outside the reviewed allowlist") + sha = fixed_sha(os.environ.get("GITHUB_SHA", "")) + if not root_token: + raise ValueError("Checkout requires TOKEN") + if (root / ".git").exists(): + raise ValueError("Checkout requires a fresh workspace") + git(root, "init", "-q") + git(root, "remote", "add", "origin", SERVER + "/weichen/Agent-Native.git") + git(root, "fetch", "--depth=1", "origin", sha, token=root_token, repo="Agent-Native") + git(root, "checkout", "-q", "--detach", "FETCH_HEAD") + if git(root, "rev-parse", "HEAD").decode().strip() != sha: + raise ValueError("Checked-out commit differs from the platform commit") + if (root / ".ci-mirrors").exists() or (root / ".ci-mirrors.env").exists(): + raise ValueError("Candidate cannot provide trusted prefetch state") + materialize_manifest(root) + mirror_env() + except (ValueError, KeyError, OSError, subprocess.CalledProcessError) as error: + # Do not print child stderr or environment: a failed credential fetch stays redacted. + sys.exit("Checkout refused: " + str(error)) + print("Fixed source checkout complete; credentials were not persisted") + PY_TRUSTED + unset TOKEN SUBMODULE_TOKEN - name: Install Go 1.27.1 run: | set -euo pipefail @@ -33,21 +261,250 @@ jobs: tar -C /usr/local -xzf "$RUNNER_TEMP/go.tgz" ln -sfn /usr/local/go/bin/go /usr/local/bin/go ln -sfn /usr/local/go/bin/gofmt /usr/local/bin/gofmt + - name: Prefetch Go modules without executing candidate code + env: + SUBMODULE_TOKEN: ${{ secrets.SUBMODULE_TOKEN }} + run: &trusted_acquisition_2 | + set -euo pipefail + python3 - <<'PY_TRUSTED' + # Trusted workflow code only: never import or execute checkout scripts here. + # Token scopes, workflow provenance and runner isolation are platform NOT_RUN. + import json + import os + from pathlib import Path + import re + import shlex + import subprocess + import sys + import tempfile + from urllib.parse import urlsplit + + SERVER = os.environ.get("GITHUB_SERVER_URL", "").rstrip("/") + parsed = urlsplit(SERVER) + if (parsed.scheme not in {"http", "https"} or not parsed.netloc or + parsed.username or parsed.password or parsed.query or parsed.fragment): + sys.exit("Acquisition requires the platform-injected http(s) server") + SSH = "ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/" + GO_PREFIX = "git-ssh.u1680832.nyat.app/weichen/" + REPOS = {"Agent-System-Dev", "Logging-System", "Error-Code-System", "Agent-System-Core", "Agent-Native", + "Agent-Intent", "Agent-Command", "Agent-Squad", "Agent-System-Backend", + "Agent-System-Frontend", "Agent-System-UI", "Agent-System-RDM", + "Development-Guidelines", "Agent-System-Documents"} + LEGACY = { + "modules/core": "Agent-System-Core", "modules/backend": "Agent-System-Backend", + "modules/frontend": "Agent-System-Frontend", "modules/ui": "Agent-System-UI", + "modules/documents": "Agent-System-Documents", "deps/agent-system-core": "Agent-System-Core", + "deps/development-guidelines": "Development-Guidelines", "deps/agent-native": "Agent-Native", + "deps/agent-squad": "Agent-Squad", "deps/agent-intent": "Agent-Intent", + "deps/agent-command": "Agent-Command", "deps/error-code-system": "Error-Code-System", + "deps/logging-system": "Logging-System", "pins/agent-system-backend": "Agent-System-Backend", + "pins/agent-system-core": "Agent-System-Core", "pins/agent-system-frontend": "Agent-System-Frontend", + "pins/agent-system-ui": "Agent-System-UI", + } + GO_REPOS = REPOS - {"Agent-System-Dev", "Agent-System-UI", "Agent-System-Frontend", "Development-Guidelines", "Agent-System-Documents"} + GO_MODULES = {GO_PREFIX + repo + ".git" for repo in GO_REPOS} + GO_MODULES |= {GO_PREFIX + "Agent-Squad.git/" + suffix for suffix in + ("adapters/native", "adapters/intent", "adapters/sqlite", "adapters/a2a", "cmd/agent-squad")} + root_token = os.environ.pop("TOKEN", "") + component_token = os.environ.pop("SUBMODULE_TOKEN", "") + # Go environment files and inherited Git tracing/config must not change acquisition. + clean = {k: v for k, v in os.environ.items() + if not k.startswith(("GIT_", "NPM_CONFIG_", "npm_config_")) and + not any(word in k.upper() for word in ("TOKEN", "PASSWORD", "SECRET"))} + clean.update(GIT_CONFIG_NOSYSTEM="1", GIT_CONFIG_SYSTEM="/dev/null", GIT_CONFIG_GLOBAL="/dev/null", + GIT_TERMINAL_PROMPT="0", GOENV="off", GOTOOLCHAIN="local", GOWORK="off", GOFLAGS="-mod=readonly", + GOPRIVATE=GO_PREFIX.rstrip("/"), GONOPROXY=GO_PREFIX.rstrip("/"), GONOSUMDB=GO_PREFIX.rstrip("/")) + if os.environ.get("npm_config_cache"): + clean["npm_config_cache"] = os.environ["npm_config_cache"] + config = {"core.hooksPath": "/dev/null", "core.fsmonitor": "false", "init.templateDir": "", + "credential.helper": "", "fetch.recurseSubmodules": "false", "submodule.recurse": "false", + "http.followRedirects": "false", "protocol.allow": "never", "protocol." + parsed.scheme + ".allow": "always"} + root = Path.cwd() + mirrors = root / ".ci-mirrors" + + def process_env(values): + env = clean | {"GIT_CONFIG_COUNT": str(len(values))} + for index, (key, value) in enumerate(values.items()): + env[f"GIT_CONFIG_KEY_{index}"] = key + env[f"GIT_CONFIG_VALUE_{index}"] = value + return env + + def git(directory, *args, token="", repo=""): + values = config.copy() + if token: + if repo not in REPOS: + raise ValueError("Credential destination is outside the reviewed repository allowlist") + values[f"http.{SERVER}/weichen/{repo}.git.extraheader"] = "AUTHORIZATION: token " + token + result = subprocess.run(["git", "-C", str(directory), *args], env=process_env(values), + check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + return result.stdout + + def fixed_sha(value): + if not isinstance(value, str) or not re.fullmatch(r"[0-9a-fA-F]{40}", value): + raise ValueError("Source acquisition requires a fixed commit SHA") + return value.lower() + + def mirror(repo, sha, token): + sha = fixed_sha(sha) + destination = mirrors / (repo + ".git") + if destination.is_symlink() or mirrors.is_symlink(): + raise ValueError("Mirror directory cannot be a symlink") + mirrors.mkdir(exist_ok=True) + if not destination.exists(): + destination.mkdir() + git(destination, "init", "--bare", "-q") + url = f"{SERVER}/weichen/{repo}.git" + try: + git(destination, "cat-file", "-e", sha + "^{commit}") + except subprocess.CalledProcessError: + git(destination, "fetch", "--depth=200", url, sha, token=token, repo=repo) + git(destination, "update-ref", "refs/heads/main", sha) + git(destination, "symbolic-ref", "HEAD", "refs/heads/main") + git(destination, "update-ref", "refs/ci/" + sha, sha) + return destination + + def mirror_env(): + values = {"protocol.file.allow": "always", "core.hooksPath": "/dev/null", "credential.helper": ""} + # Distinct keys use repeated .insteadOf values, represented as a sequence below. + pairs = list(values.items()) + for repo in sorted(REPOS): + destination = mirrors / (repo + ".git") + if not destination.exists(): + continue + key = "url." + destination.as_uri() + ".insteadOf" + pairs.extend((key, url) for url in (SSH + repo + ".git", "https://" + GO_PREFIX + repo + ".git", + SERVER + "/weichen/" + repo + ".git", "https://" + GO_PREFIX + repo)) + env = clean | {"CI_DEPENDENCY_MIRRORS": str(mirrors), "GIT_CONFIG_COUNT": str(len(pairs))} + for index, (key, value) in enumerate(pairs): + env[f"GIT_CONFIG_KEY_{index}"] = key + env[f"GIT_CONFIG_VALUE_{index}"] = value + exports = {k: v for k, v in env.items() if k.startswith("GIT_CONFIG_") or k == "CI_DEPENDENCY_MIRRORS"} + (root / ".ci-mirrors.env").write_text("".join("export " + k + "=" + shlex.quote(v) + "\n" for k, v in exports.items())) + return env + + def source_roots(): + bases = [root] + composition = root / ".ci-composition-dev" + if composition.is_dir() and not composition.is_symlink(): + bases.append(composition) + paths = [] + for base in bases: + paths += [base, base / "rdm"] + [base / path for path in LEGACY] + [base / ".workspace" / repo for repo in sorted(REPOS)] + return [path for path in paths if path.is_dir() and not path.is_symlink()] + try: + targets = [] + for source in source_roots(): + for suffix in (".", "examples/trace", "adapters/native", "adapters/intent", "adapters/sqlite", "adapters/a2a", "cmd/agent-squad"): + directory = source / suffix + if (directory / "go.mod").is_file() and directory.resolve() not in targets: + targets.append(directory.resolve()) + # Parse using the installed local Go tool without credentials or candidate execution. + original_files = {} + for directory in targets: + parsed_mod = json.loads(subprocess.check_output(["go", "mod", "edit", "-json"], cwd=directory, env=clean)) + canonical = parsed_mod["Module"]["Path"].startswith(GO_PREFIX) + for name in ("go.mod", "go.sum"): + dependency_file = directory / name + if dependency_file.is_file(): + original_files[(directory, name)] = dependency_file.read_bytes() + elif canonical and name == "go.sum": + original_files[(directory, name)] = None + for dep in (parsed_mod.get("Require") or []): + path = dep["Path"] + if path.startswith(GO_PREFIX) and path not in GO_MODULES: + raise ValueError("Go dependency is outside the reviewed module mapping") + for replacement in (parsed_mod.get("Replace") or []): + path = replacement["New"]["Path"] + if canonical and not replacement["New"].get("Version"): + raise ValueError("Canonical module cannot acquire a local path replacement") + if path.startswith(GO_PREFIX) and path not in GO_MODULES: + raise ValueError("Go replacement is outside the reviewed module mapping") + auth = config.copy() + for repo in sorted(GO_REPOS): + url = f"{SERVER}/weichen/{repo}.git" + auth[f"url.{url}.insteadOf"] = "https://" + GO_PREFIX + repo + auth[f"http.{url}.extraheader"] = "AUTHORIZATION: token " + component_token + def objects(output): + decoder = json.JSONDecoder() + remaining = output.strip() + while remaining: + item, end = decoder.raw_decode(remaining) + remaining = remaining[end:].lstrip() + yield item + def unchanged(): + for (owner, name), contents in original_files.items(): + dependency_file = owner / name + current = dependency_file.read_bytes() if dependency_file.exists() else None + if current != contents: + raise ValueError("Go acquisition modified a committed Go dependency file: " + str(dependency_file)) + for directory in targets: + # Resolve private go.mod metadata only through exact repository headers; + # validate the complete selected graph before acquiring module zip files. + graph = subprocess.run(["go", "list", "-mod=readonly", "-m", "-json", "all"], cwd=directory, + env=process_env(auth), capture_output=True, text=True) + if graph.returncode: + raise ValueError("Go selected graph resolution failed: " + graph.stderr.strip()) + for item in objects(graph.stdout): + if item.get("Main"): + continue + selected = item.get("Replace") or item + for path in (item.get("Path", ""), selected.get("Path", "")): + if path.startswith(GO_PREFIX) and path not in GO_MODULES: + raise ValueError("Selected Go module is outside the reviewed mapping") + unchanged() + # Go 1.27 can prune go.sum even under -mod=readonly for this + # metadata-only command. Use a disposable copy, then validate actual + # package loading against the unchanged committed source locks. + local_replacements = json.loads(subprocess.check_output( + ["go", "mod", "edit", "-json"], cwd=directory, env=clean)).get("Replace") or [] + downloaded = "" + if not any(not item["New"].get("Version") for item in local_replacements): + with tempfile.TemporaryDirectory(prefix="ci-go-prefetch-") as temporary: + download_root = Path(temporary) + for name in ("go.mod", "go.sum"): + if (directory / name).is_file(): + (download_root / name).write_bytes((directory / name).read_bytes()) + result = subprocess.run(["go", "mod", "download", "-json"], cwd=download_root, + env=process_env(auth), capture_output=True, text=True) + if result.returncode: + raise ValueError("Go module acquisition failed: " + result.stderr.strip()) + downloaded = result.stdout + unchanged() + for item in objects(downloaded): + path = item.get("Path", "") + if path.startswith(GO_PREFIX): + if path not in GO_MODULES: + raise ValueError("Resolved Go module is outside the reviewed mapping") + repo = path[len(GO_PREFIX):].split(".git", 1)[0] + origin = item.get("Origin") or json.loads(Path(item["Info"]).read_text()).get("Origin") or {} + mirror(repo, fixed_sha(origin.get("Hash")), component_token) + # Package metadata loads actual test/build dependencies without running + # vet, compilers, package init functions or candidate tests. No CGO tools. + packages = subprocess.run(["go", "list", "-mod=readonly", "-deps", "-test", "./..."], cwd=directory, + env=process_env(auth) | {"CGO_ENABLED": "0"}, capture_output=True, text=True) + if packages.returncode: + raise ValueError("Go test/build dependency acquisition failed: " + packages.stderr.strip()) + unchanged() + mirror_env() + except (ValueError, OSError, subprocess.CalledProcessError) as error: + sys.exit("Go prefetch refused: " + str(error)) + print("Go modules cached with GOTOOLCHAIN=local; no candidate code executed") + PY_TRUSTED + unset TOKEN SUBMODULE_TOKEN - name: Vet, test, and race - run: go vet ./... && go test -count=1 ./... && go test -count=1 -race ./... + run: | + set -euo pipefail + source .ci-mirrors.env + go vet -mod=readonly ./... && go test -mod=readonly -count=1 ./... && go test -mod=readonly -count=1 -race ./... docker-checkout-hostgateway: runs-on: ubuntu-latest options: --add-host gitea:host-gateway env: GITHUB_SERVER_URL: http://gitea:3000 steps: - - name: Checkout without GitHub actions + - name: Checkout env: TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - git init -q - git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" - git -c http.extraheader="AUTHORIZATION: token ${TOKEN}" fetch --depth=1 origin "${GITHUB_SHA}" - git checkout -q --detach FETCH_HEAD - test -f go.mod && echo "docker-mode checkout via host-gateway OK" + SUBMODULE_TOKEN: ${{ secrets.SUBMODULE_TOKEN }} + run: *trusted_acquisition_1 + - run: test -f go.mod && echo "docker-mode checkout via host-gateway OK" diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 1581d80..0000000 --- a/.gitmodules +++ /dev/null @@ -1,12 +0,0 @@ -[submodule "deps/development-guidelines"] - path = deps/development-guidelines - url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Development-Guidelines.git -[submodule "deps/error-code-system"] - path = deps/error-code-system - url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Error-Code-System.git -[submodule "deps/logging-system"] - path = deps/logging-system - url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Logging-System.git -[submodule "deps/agent-intent"] - path = deps/agent-intent - url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Intent.git diff --git a/AGENTS.md b/AGENTS.md index cdd7ddb..cc38a92 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # Agent 工作说明(Agent-Native) -本仓开发遵循 Development-Guidelines(Dev 仓 `deps/development-guidelines`,gitlink 固定版本): +本仓开发遵循 Development-Guidelines(由 Dev 固定规范来源;新布局见 Dev components.lock.json,规则目录 .workspace/Development-Guidelines;历史布局仍读原 gitlink): 核心规则见其 `core/`,按任务触发阅读 `standards/` 专题;日常交付走 `workflows/delivery.md`。 ## 任务启动门禁 @@ -15,7 +15,7 @@ ## 仓内规则 - 模块边界、公开契约与隔离档位见 `policy/modules/`(如有)与 PROJECT.md。 -- 跨仓 gitlink 变更须经组合验证后在 Dev 仓推进;受保护分支经 PR 合入。 +- 跨仓语言依赖/应用源码锁变更须经固定组合验证后在消费方推进;源码提交到所属仓;受保护分支经 PR 合入。 - 验证命令见 PROJECT.md「验证」节;完成声明须附实际命令输出证据。 ## Gitea 与 Git 访问事实(2026-09-30 实测) diff --git a/PROJECT.md b/PROJECT.md index 602d651..adc3bb6 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -5,10 +5,10 @@ ## 仓库与操作 - 目标/产品边界:独立的 Agent 执行基础库。提供执行契约(contract)、执行端口(exec)、自研运行时(runtime)、外部适配器(adapters)与行为验收(conformance)。不实现小队编排,不依赖 Core 或 Squad。 -- 源码、资产、文档、机器契约位置:Go 源码在仓库根包目录;模块路径 `agent-native`;人类文档在根 `README.md`、`docs/`、`policy/`;过程记录在 `docs/records/`;机器契约以 `contract` 包类型为准。 +- 源码、资产、文档、机器契约位置:Go 源码在仓库根包目录;模块路径 `git-ssh.u1680832.nyat.app/weichen/Agent-Native.git`;人类文档在根 `README.md`、`docs/`、`policy/`;过程记录在 `docs/records/`;机器契约以 `contract` 包类型为准。 - 权威远端、集成基线、受保护分支:`ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Native.git`,集成基线 `main`。 - 并行共同基线记录位置、合入通知/主动检查方式:任务主记录在 Gitea Issue/PR;合入前在本仓 `main` 上 `git fetch` 并确认 HEAD。 -- 发布线与批准版本/实际制品查询入口:当前无独立制品仓库。可构建性以本仓 `main` 的 `go test` 为准;依赖子模块版本以 gitlink 为准,不把工作区未提交文件当发布组合。 +- 发布线与批准版本/实际制品查询入口:当前无独立制品仓库。可构建性以本仓 `main` 的 `go test` 为准;Go 依赖以 `go.mod` / `go.sum` 为准,不把工作区未提交文件当发布组合。 - 提交/审核/合并/发布身份与权限:仓库所有者 weichen。本机提交不代替远端合并。 - 任务唯一来源:Gitea `weichen/Agent-Native` 的 Issue 与 Pull Request。 - 规范性文档目录:`policy/`。 @@ -20,19 +20,17 @@ | 逻辑 ID | 路径 | 角色 | |---|---|---| -| development-guidelines | `deps/development-guidelines` | development-only,规范文本 | -| error-code-system | `deps/error-code-system` | build-required,规范码目录 | -| logging-system | `deps/logging-system` | build-required,可选日志器 | -| agent-intent | `deps/agent-intent` | build-required,可选意图闸门装饰器(`adapters/intentgate`) | +| development-guidelines | Dev `.workspace/Development-Guidelines`(源码锁固定) | development-only,规范文本 | +| error-code-system | `go.mod` / `go.sum` | build-required,规范码目录 | +| logging-system | `go.mod` / `go.sum` | build-required,可选日志器 | 克隆: ```bash -git clone --recurse-submodules ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Native.git -# 已克隆时:git submodule update --init --recursive +git clone ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Native.git ``` -构建、审核和发布固定父仓 gitlink,不执行 `submodule update --remote`。 +Go 构建、审核固定 `go.mod` / `go.sum` 版本,正式消费使用 `GOWORK=off`。旧提交保留其 gitlinks 供历史组合和在途分支重建;本提交已移除已替代指针;开发规范由 Dev components.lock.json 固定。 ## 验证命令 @@ -47,7 +45,7 @@ git clone --recurse-submodules ssh://git@git-ssh.u1680832.nyat.app:31411/weichen | 环境/实例 ID | 只读查询入口 | 授权写入入口 | DB/存储归属 | 恢复入口 | |---|---|---|---|---| -| 本地开发 | 本机工作区与 `go test` | 本机 git 提交 | 无共享数据库;会话文件由调用方 Workspace 决定 | 重新 clone 父仓并 `submodule update --init --recursive` | +| 本地开发 | 本机工作区与 `go test` | 本机 git 提交 | 无共享数据库;会话文件由调用方 Workspace 决定 | 普通 clone 并下载 go.mod 固定依赖 | 共享项及 ACL:无。部署、迁移、发布的审批依据与负责角色:当前库不独立部署;合并进 `main` 由仓库所有者批准。 实际制品/配置/schema 的查询方法:阅读当前 `main` 的 `contract` 包与 `go.mod`,不以历史 README 快照代替。 diff --git a/README.md b/README.md index 37d10d0..8ed8358 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 独立的 Agent 执行基础仓库:自研执行内核(runtime)、模型与工具能力接入、外部 Agent 适配器(现有 PI Runner 等),以及共用执行契约与行为验收(conformance)。 -本仓库是该模块的源码位置。Go 模块路径为 `agent-native`。 +本仓库是该模块的源码位置。Go 模块路径为 `git-ssh.u1680832.nyat.app/weichen/Agent-Native.git`。 ## 仓库分层 @@ -43,20 +43,11 @@ - Workspace 路径授权 ≠ OS 沙箱。 - `contract.ErrorCode` 取值是 `agent.*` 规范码。`ErrorCode()` / `ErrorFields()` 供日志库识别,本包不导入错误码库。 -## 依赖子模块 +## 依赖与版本 -| 路径 | 作用 | -|---|---| -| `deps/development-guidelines` | 开发规范,不参与编译 | -| `deps/error-code-system` | 规范码目录。`go.mod` 的 `replace` 指向这里 | -| `deps/logging-system` | 结构化日志。runtime 与 native 适配器可选使用 | +错误码与日志依赖由 `go.mod` / `go.sum` 固定远端可获取的提交版本。正式测试和构建使用 `GOWORK=off`,不依赖源码目录替换。私有模块获取使用 Dev 工作区提供的进程级传输配置;模块身份不包含端口或凭证。 -版本以本仓 gitlink 为准。`scripts/submodule-consistency.sh` 核对 gitlink 与检出的 HEAD。 - -```bash -git clone --recurse-submodules ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Native.git -# 已克隆时:git submodule update --init --recursive -``` +旧提交保留其 gitlinks 供历史组合和在途分支重建;本提交已移除已替代指针;本版本编译不消费其中的 Go 源码。开发规范由 Dev components.lock.json 固定。迁移在途分支时只改 Go import 前缀与模块声明,不改后端名、事件或持久化标识;本地联调通过 Dev 的显式组件链接管理。 ## CodeGraph @@ -73,15 +64,14 @@ go test ./... ## 依赖本仓库 -消费方把本仓库当作独立模块。模块路径是短名 `agent-native`,在消费方 `go.mod` 中用 `replace` 指向检出目录: +消费方以真实提交版本接入,在已配置私有传输的环境中运行: -``` -require agent-native v0.0.0 - -replace agent-native => ./deps/agent-native +```bash +go get git-ssh.u1680832.nyat.app/weichen/Agent-Native.git@ +GOWORK=off go test ./... ``` -本仓自己的 `go.mod` 则把错误码库和日志库替换到 `./deps/`。消费方若同时依赖这三仓,必须在消费方 `go.mod` 里写自己的 `replace`:依赖模块内部的 `replace` 不会在上层构建中生效。 +版本由 Go 生成并记录在消费方 `go.mod` / `go.sum`。源码 import 使用同一完整模块前缀;运行时后端名仍为 `agent-native`。 远程:`ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Native.git` diff --git a/adapters/native/backend.go b/adapters/native/backend.go index aa28882..4ab04e6 100644 --- a/adapters/native/backend.go +++ b/adapters/native/backend.go @@ -12,20 +12,20 @@ import ( "sync" "time" - "agent-native/exec" - "agent-native/runtime" - "agent-native/runtime/checkpoint" - "agent-native/runtime/filestate" - "agent-native/runtime/hooks" - "agent-native/runtime/llm" - "agent-native/runtime/mcp" - "agent-native/runtime/promptx" - "agent-native/runtime/session" - "agent-native/runtime/skills" - "agent-native/runtime/subagent" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/checkpoint" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/filestate" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/mcp" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/promptx" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/skills" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/subagent" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // ModelOptions 是模型接入。Stream 非空时不再按 APIBase/APIKey 构造客户端。 diff --git a/adapters/native/backend_test.go b/adapters/native/backend_test.go index 80f0f51..4ed80e9 100644 --- a/adapters/native/backend_test.go +++ b/adapters/native/backend_test.go @@ -9,8 +9,8 @@ import ( "sync" "testing" - "agent-native/exec" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) // script 按序回放假助手轮次(对齐 runtime/loop_test 的伪造方式)。 diff --git a/adapters/native/compact_test.go b/adapters/native/compact_test.go index 04d9e47..a3e4f37 100644 --- a/adapters/native/compact_test.go +++ b/adapters/native/compact_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "agent-native/exec" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) func TestBackendCompactBeforeRun(t *testing.T) { diff --git a/adapters/native/contract.go b/adapters/native/contract.go index 020b927..899b37b 100644 --- a/adapters/native/contract.go +++ b/adapters/native/contract.go @@ -5,7 +5,7 @@ import ( "errors" "strings" - "agent-native/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" ) // contractBackend 把 Backend 适配为 exec.ContractBackend。 diff --git a/adapters/native/contract_test.go b/adapters/native/contract_test.go index f214508..52d1fec 100644 --- a/adapters/native/contract_test.go +++ b/adapters/native/contract_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "agent-native/conformance" - "agent-native/exec" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/conformance" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) // TestContractBackendConformance 把 native 后端的契约形态挂上最小契约套件 diff --git a/adapters/native/exec_tools_test.go b/adapters/native/exec_tools_test.go index 5a8a015..6a8306f 100644 --- a/adapters/native/exec_tools_test.go +++ b/adapters/native/exec_tools_test.go @@ -8,11 +8,11 @@ import ( "strings" "testing" - "agent-native/exec" - "agent-native/runtime/llm" - "agent-native/runtime/mcp" - "agent-native/runtime/subagent" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/mcp" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/subagent" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) func TestBackendExecToolsWiredWithOptionsAndRequestEnv(t *testing.T) { diff --git a/adapters/native/host_tools_test.go b/adapters/native/host_tools_test.go index e6f7025..ba8dac1 100644 --- a/adapters/native/host_tools_test.go +++ b/adapters/native/host_tools_test.go @@ -6,9 +6,9 @@ import ( "sync" "testing" - "agent-native/exec" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) type hostTool struct{ name string } diff --git a/adapters/native/mcpmain_test.go b/adapters/native/mcpmain_test.go index 9133aee..594eb88 100644 --- a/adapters/native/mcpmain_test.go +++ b/adapters/native/mcpmain_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "agent-native/runtime/mcp" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/mcp" ) // TestMain:MCP fake server 的 re-exec 分支(详见 mcp.RunFakeServer)。 diff --git a/adapters/native/pi_conformance_test.go b/adapters/native/pi_conformance_test.go index 6dd1295..1d1e44f 100644 --- a/adapters/native/pi_conformance_test.go +++ b/adapters/native/pi_conformance_test.go @@ -7,10 +7,10 @@ import ( "os/exec" "testing" - "agent-native/rpc" - "agent-native/runtime" - "agent-native/runtime/llm" - "agent-native/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/rpc" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" ) func TestEventAndRPCFixtures(t *testing.T) { diff --git a/adapters/native/request_v2_test.go b/adapters/native/request_v2_test.go index 11d72da..9c9e40a 100644 --- a/adapters/native/request_v2_test.go +++ b/adapters/native/request_v2_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "agent-native/exec" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) // captureStream 捕获每次调用的 model / 首条 system 消息,并按序回放回合。 diff --git a/adapters/native/rotation_test.go b/adapters/native/rotation_test.go index 5f95d19..b080c50 100644 --- a/adapters/native/rotation_test.go +++ b/adapters/native/rotation_test.go @@ -9,8 +9,8 @@ import ( "sync" "testing" - "agent-native/exec" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) // failThenSucceed 首次流返回 context overflow 错误,之后正常结束。 diff --git a/catalogcheck/align_test.go b/catalogcheck/align_test.go index ef29b2f..48f9648 100644 --- a/catalogcheck/align_test.go +++ b/catalogcheck/align_test.go @@ -3,8 +3,8 @@ package catalogcheck import ( "testing" - "agent-native/exec" - "error-code-system/errcode" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" ) // 常量取值必须与错误码库种子码相同。旧短字符串只作为错误码库里的别名存在。 diff --git a/cmd/agent-native/main.go b/cmd/agent-native/main.go index e82185d..48e9f32 100644 --- a/cmd/agent-native/main.go +++ b/cmd/agent-native/main.go @@ -10,10 +10,10 @@ import ( "os" "path/filepath" - "agent-native/rpc" - "agent-native/runtime" - "agent-native/runtime/llm" - "agent-native/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/rpc" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" ) func main() { diff --git a/conformance/fake.go b/conformance/fake.go index 422c6e8..84a8cca 100644 --- a/conformance/fake.go +++ b/conformance/fake.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "agent-native/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" ) // FakeBackend 是确定性假实现,仅用于契约套件自测与消费方单测。 diff --git a/conformance/spec_test.go b/conformance/spec_test.go index 4a5bd7e..8647622 100644 --- a/conformance/spec_test.go +++ b/conformance/spec_test.go @@ -3,7 +3,7 @@ package conformance import ( "testing" - "agent-native/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" ) func TestFakeBackendSuite(t *testing.T) { diff --git a/deps/agent-intent b/deps/agent-intent deleted file mode 160000 index 343b1e6..0000000 --- a/deps/agent-intent +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 343b1e6d9a5b58e47bf7e594826221036ae8175c diff --git a/deps/development-guidelines b/deps/development-guidelines deleted file mode 160000 index 26b562d..0000000 --- a/deps/development-guidelines +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 26b562d2e34fbc560711296a309c91c74ffc55b1 diff --git a/deps/error-code-system b/deps/error-code-system deleted file mode 160000 index a3ee67b..0000000 --- a/deps/error-code-system +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a3ee67bba269e1276c14e22c026171ecf2cf6190 diff --git a/deps/logging-system b/deps/logging-system deleted file mode 160000 index 49b5d8b..0000000 --- a/deps/logging-system +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 49b5d8be604d05e4246dffa0d10fa1c2b7ad45d7 diff --git a/exec/backend_test.go b/exec/backend_test.go index ae0e125..1db77ef 100644 --- a/exec/backend_test.go +++ b/exec/backend_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "agent-native/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" ) func TestStubBackendExecution(t *testing.T) { diff --git a/exec/limiter_test.go b/exec/limiter_test.go index 4155d4f..5b2d809 100644 --- a/exec/limiter_test.go +++ b/exec/limiter_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "agent-native/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" ) type slowBackend struct { diff --git a/go.mod b/go.mod index f46d604..ac72c3a 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,8 @@ -module agent-native +module git-ssh.u1680832.nyat.app/weichen/Agent-Native.git go 1.27 require ( - error-code-system v0.0.0 - logging-system v0.0.0 + git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git v0.0.0-20261013150648-28d2d5074347 + git-ssh.u1680832.nyat.app/weichen/Logging-System.git v0.0.0-20261013150647-9c5442f06d05 ) - -replace error-code-system => ./deps/error-code-system - -replace logging-system => ./deps/logging-system diff --git a/go.sum b/go.sum index e69de29..c249419 100644 --- a/go.sum +++ b/go.sum @@ -0,0 +1,4 @@ +git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git v0.0.0-20261013150648-28d2d5074347 h1:mESnwe9ZpZqpLoGPzLyCWEmXDHKm7ouKC8qpF8EztEQ= +git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git v0.0.0-20261013150648-28d2d5074347/go.mod h1:b8CDy31Xo3uRzAhA3HldwcgNnk0x5Lb02osIb9ewJ3A= +git-ssh.u1680832.nyat.app/weichen/Logging-System.git v0.0.0-20261013150647-9c5442f06d05 h1:gtFuWlGr7GlpEkuoIfIw6f/uXHUlYXlHU2qgLWAV46Y= +git-ssh.u1680832.nyat.app/weichen/Logging-System.git v0.0.0-20261013150647-9c5442f06d05/go.mod h1:Jg/bDRsd1/g5YjIoEUYkCsTgJOrTolYccfyb/tc57Dk= diff --git a/rpc/server.go b/rpc/server.go index 08235dd..1cc5cfe 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -5,9 +5,9 @@ import ( "encoding/json" "fmt" - "agent-native/runtime" - "agent-native/runtime/llm" - "agent-native/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" ) // Request is one RPC command. Type matches the pi headless command set. diff --git a/rpc/server_test.go b/rpc/server_test.go index a6fb7ab..b7f4ee8 100644 --- a/rpc/server_test.go +++ b/rpc/server_test.go @@ -6,9 +6,9 @@ import ( "path/filepath" "testing" - "agent-native/runtime" - "agent-native/runtime/llm" - "agent-native/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" ) func TestRPCSessionCommandsAndClient(t *testing.T) { diff --git a/runtime/ab_gate_test.go b/runtime/ab_gate_test.go index c9fa2e0..aa9fd17 100644 --- a/runtime/ab_gate_test.go +++ b/runtime/ab_gate_test.go @@ -5,9 +5,9 @@ import ( "errors" "testing" - "agent-native/runtime/hooks" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) func TestHookAdaptersMatchDirectCallbacks(t *testing.T) { diff --git a/runtime/durable_test.go b/runtime/durable_test.go index 7535280..1c629e4 100644 --- a/runtime/durable_test.go +++ b/runtime/durable_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/session" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) type replayTool struct { diff --git a/runtime/event_vocabulary_test.go b/runtime/event_vocabulary_test.go index ad2a279..ee45604 100644 --- a/runtime/event_vocabulary_test.go +++ b/runtime/event_vocabulary_test.go @@ -6,8 +6,8 @@ import ( "sync" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // ProcessEventVocabulary 是过程流消费方(小队过程视图,对应 PI proc 帧转发) diff --git a/runtime/ext/process.go b/runtime/ext/process.go index 99069ff..c1b43fb 100644 --- a/runtime/ext/process.go +++ b/runtime/ext/process.go @@ -9,8 +9,8 @@ import ( "os/exec" "sync" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // Message is one JSONL frame on the extension pipe. diff --git a/runtime/ext/process_test.go b/runtime/ext/process_test.go index bc3c9e4..75ddc81 100644 --- a/runtime/ext/process_test.go +++ b/runtime/ext/process_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "agent-native/runtime/ext/pkg" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/ext/pkg" ) func TestExtensionRegistersAndHooks(t *testing.T) { diff --git a/runtime/gates/progress.go b/runtime/gates/progress.go index 50c4e48..858559e 100644 --- a/runtime/gates/progress.go +++ b/runtime/gates/progress.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "agent-native/runtime/reminders" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/reminders" ) // ProgressReminder 是进度提醒的节流状态机与格式化机制。 diff --git a/runtime/guardrails/guardrails.go b/runtime/guardrails/guardrails.go index bcb11cc..c2a1bee 100644 --- a/runtime/guardrails/guardrails.go +++ b/runtime/guardrails/guardrails.go @@ -7,7 +7,7 @@ package guardrails import ( "context" - "agent-native/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" ) // Verdict 是一次护栏表态。空 Decision 表示不插手。 diff --git a/runtime/guardrails/guardrails_test.go b/runtime/guardrails/guardrails_test.go index 2e39e4b..d161151 100644 --- a/runtime/guardrails/guardrails_test.go +++ b/runtime/guardrails/guardrails_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "agent-native/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" ) func TestToolGuardrailMergesOnPreToolUse(t *testing.T) { diff --git a/runtime/loop.go b/runtime/loop.go index 980a52f..d9c5630 100644 --- a/runtime/loop.go +++ b/runtime/loop.go @@ -9,15 +9,15 @@ import ( "sync" "time" - "agent-native/runtime/hooks" - "agent-native/runtime/llm" - "agent-native/runtime/memory" - "agent-native/runtime/reminders" - "agent-native/runtime/session" - "agent-native/runtime/telemetry" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/memory" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/reminders" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/telemetry" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) const ( diff --git a/runtime/loop_budget_test.go b/runtime/loop_budget_test.go index f2a09a7..ccc056c 100644 --- a/runtime/loop_budget_test.go +++ b/runtime/loop_budget_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // usageScript 产出带 usage 的固定回合,用于预算测试。 diff --git a/runtime/loop_cache_contract_test.go b/runtime/loop_cache_contract_test.go index ff8fbc3..14fb426 100644 --- a/runtime/loop_cache_contract_test.go +++ b/runtime/loop_cache_contract_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // ---- N2 WP1:前缀稳定契约(缓存友好的机器钉住:同一注册序列 → 逐字节确定)---- diff --git a/runtime/loop_callctx_test.go b/runtime/loop_callctx_test.go index 61849e6..7b6b285 100644 --- a/runtime/loop_callctx_test.go +++ b/runtime/loop_callctx_test.go @@ -6,8 +6,8 @@ import ( "sync" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // ctxEchoTool 把自己从 ctx 读到的调用 ID 记下来(并发安全),验证内核 diff --git a/runtime/loop_callid_test.go b/runtime/loop_callid_test.go index cf72ca7..92af987 100644 --- a/runtime/loop_callid_test.go +++ b/runtime/loop_callid_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // TestLoopToolEventsCarryCallID 验证 tool_execution_start/end 事件带工具调用 diff --git a/runtime/loop_guardrails_test.go b/runtime/loop_guardrails_test.go index ce5d9d4..e2718e4 100644 --- a/runtime/loop_guardrails_test.go +++ b/runtime/loop_guardrails_test.go @@ -5,10 +5,10 @@ import ( "strings" "testing" - "agent-native/runtime/guardrails" - "agent-native/runtime/hooks" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/guardrails" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // TestInputGuardrailDenySkipsLoop:输入护栏 deny 时不进循环、不调模型, diff --git a/runtime/loop_harness_test.go b/runtime/loop_harness_test.go index a4dc152..33f3c99 100644 --- a/runtime/loop_harness_test.go +++ b/runtime/loop_harness_test.go @@ -9,9 +9,9 @@ import ( "sync" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/session" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) func TestLoopStopContinuesUntilCap(t *testing.T) { diff --git a/runtime/loop_hooks_lifecycle_test.go b/runtime/loop_hooks_lifecycle_test.go index 03fce49..4fa80f8 100644 --- a/runtime/loop_hooks_lifecycle_test.go +++ b/runtime/loop_hooks_lifecycle_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "agent-native/runtime/hooks" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) type eventRecorder struct { diff --git a/runtime/loop_otel_n3_test.go b/runtime/loop_otel_n3_test.go index eb14984..40968b5 100644 --- a/runtime/loop_otel_n3_test.go +++ b/runtime/loop_otel_n3_test.go @@ -6,8 +6,8 @@ import ( "sync" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // ---- N3 WP4:循环 span 形态(名称后缀、关联、usage)---- diff --git a/runtime/loop_serial_partition_test.go b/runtime/loop_serial_partition_test.go index 280a3fa..a880872 100644 --- a/runtime/loop_serial_partition_test.go +++ b/runtime/loop_serial_partition_test.go @@ -6,8 +6,8 @@ import ( "sync" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // orderTool 记录自己的执行序号(并发安全)。 diff --git a/runtime/loop_test.go b/runtime/loop_test.go index e9bd9d9..5675d53 100644 --- a/runtime/loop_test.go +++ b/runtime/loop_test.go @@ -7,9 +7,9 @@ import ( "sync" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/session" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) func script(turns ...llm.Message) llm.StreamFunc { diff --git a/runtime/mcp/manager.go b/runtime/mcp/manager.go index ec3a7e4..39c2ea4 100644 --- a/runtime/mcp/manager.go +++ b/runtime/mcp/manager.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // 桥接上限:server 元数据是不可信输入,长度与数量都必须受限。 diff --git a/runtime/mcp/mcp_test.go b/runtime/mcp/mcp_test.go index 5c8121f..1cca24b 100644 --- a/runtime/mcp/mcp_test.go +++ b/runtime/mcp/mcp_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // TestMain:环境变量置位时,本测试二进制化身为 stdio MCP server(真实子进程测试)。 diff --git a/runtime/memory/write.go b/runtime/memory/write.go index 6845bc3..ab722c8 100644 --- a/runtime/memory/write.go +++ b/runtime/memory/write.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // memory_write 工具:模型自服务写回(fail-closed 校验 scope/type/content)。 diff --git a/runtime/memory_n3_test.go b/runtime/memory_n3_test.go index ada5627..c827d0e 100644 --- a/runtime/memory_n3_test.go +++ b/runtime/memory_n3_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/memory" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/memory" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // ---- N3 WP5:循环消费点(注入 + memory_write 接线)---- diff --git a/runtime/r2_regression_test.go b/runtime/r2_regression_test.go index e758fce..0cefca2 100644 --- a/runtime/r2_regression_test.go +++ b/runtime/r2_regression_test.go @@ -7,9 +7,9 @@ import ( "strings" "testing" - "agent-native/runtime/llm" - "agent-native/runtime/session" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) type countingTool struct { diff --git a/runtime/reminders/reminders.go b/runtime/reminders/reminders.go index 254d65d..e5fbc08 100644 --- a/runtime/reminders/reminders.go +++ b/runtime/reminders/reminders.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) type Kind string diff --git a/runtime/reminders/reminders_test.go b/runtime/reminders/reminders_test.go index d639d5c..8b5fd78 100644 --- a/runtime/reminders/reminders_test.go +++ b/runtime/reminders/reminders_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) func TestAttachDoesNotAddUserAfterTool(t *testing.T) { diff --git a/runtime/resources/resources_test.go b/runtime/resources/resources_test.go index 1ca6fbf..20f7f73 100644 --- a/runtime/resources/resources_test.go +++ b/runtime/resources/resources_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "agent-native/runtime/skills" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/skills" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) func TestContextAndPromptAndTrust(t *testing.T) { diff --git a/runtime/session/compact.go b/runtime/session/compact.go index 8975172..e696ffa 100644 --- a/runtime/session/compact.go +++ b/runtime/session/compact.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) // Stats 是转录文件的轻量元数据(扫描即得,无副作用)。 diff --git a/runtime/session/compact_test.go b/runtime/session/compact_test.go index a70e5bc..b605551 100644 --- a/runtime/session/compact_test.go +++ b/runtime/session/compact_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) func appendMsgs(t *testing.T, s *Store, msgs ...llm.Message) { diff --git a/runtime/session/intent.go b/runtime/session/intent.go index 750e707..b914a33 100644 --- a/runtime/session/intent.go +++ b/runtime/session/intent.go @@ -3,7 +3,7 @@ package session import ( "encoding/json" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) // ToolIntent 是一次尚未配对结果的工具调用声明。 diff --git a/runtime/session/jsonl.go b/runtime/session/jsonl.go index 8b9177e..a605de8 100644 --- a/runtime/session/jsonl.go +++ b/runtime/session/jsonl.go @@ -5,7 +5,7 @@ import ( "path/filepath" "sync" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) // Store is an append-only JSONL transcript. New sessions are a tree of diff --git a/runtime/session/jsonl_test.go b/runtime/session/jsonl_test.go index 871c624..d49b8d5 100644 --- a/runtime/session/jsonl_test.go +++ b/runtime/session/jsonl_test.go @@ -4,7 +4,7 @@ import ( "path/filepath" "testing" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) func TestAppendAndReplay(t *testing.T) { diff --git a/runtime/session/microcompact.go b/runtime/session/microcompact.go index 1c3e783..a3c6855 100644 --- a/runtime/session/microcompact.go +++ b/runtime/session/microcompact.go @@ -5,7 +5,7 @@ import ( "path/filepath" "strings" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) const ( diff --git a/runtime/session/microcompact_test.go b/runtime/session/microcompact_test.go index 1a8ac5f..76b7f6b 100644 --- a/runtime/session/microcompact_test.go +++ b/runtime/session/microcompact_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) func TestClearOldToolResultsKeepsLastFive(t *testing.T) { diff --git a/runtime/session/r2_regression_test.go b/runtime/session/r2_regression_test.go index f7fcede..a535e70 100644 --- a/runtime/session/r2_regression_test.go +++ b/runtime/session/r2_regression_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) func TestR2CompactKeepsToolPair(t *testing.T) { diff --git a/runtime/session/tree.go b/runtime/session/tree.go index 2afbf7e..858114f 100644 --- a/runtime/session/tree.go +++ b/runtime/session/tree.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) // EntryType is the kind of one JSONL record. diff --git a/runtime/session/tree_test.go b/runtime/session/tree_test.go index 96b8f25..c06ea0d 100644 --- a/runtime/session/tree_test.go +++ b/runtime/session/tree_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) func TestTreeForkCloneAndLeaf(t *testing.T) { diff --git a/runtime/session_agent.go b/runtime/session_agent.go index 94f3f44..94e511d 100644 --- a/runtime/session_agent.go +++ b/runtime/session_agent.go @@ -4,9 +4,9 @@ import ( "context" "sync" - "agent-native/runtime/hooks" - "agent-native/runtime/llm" - "agent-native/runtime/session" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/session" ) // Delivery selects how a queued steer or follow-up is handed to the loop. diff --git a/runtime/session_agent_test.go b/runtime/session_agent_test.go index dce0947..df91054 100644 --- a/runtime/session_agent_test.go +++ b/runtime/session_agent_test.go @@ -5,7 +5,7 @@ import ( "sync" "testing" - "agent-native/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" ) func TestAgentSessionPromptForwardsStop(t *testing.T) { diff --git a/runtime/skills/skills.go b/runtime/skills/skills.go index 08f29c5..6bc6de7 100644 --- a/runtime/skills/skills.go +++ b/runtime/skills/skills.go @@ -18,7 +18,7 @@ import ( "path/filepath" "strings" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) const ( diff --git a/runtime/skills/skills_test.go b/runtime/skills/skills_test.go index 6d85533..32395fb 100644 --- a/runtime/skills/skills_test.go +++ b/runtime/skills/skills_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // writeSkill 写一份符合开放规范的 SKILL.md(name/description 齐备)。 diff --git a/runtime/subagent/subagent.go b/runtime/subagent/subagent.go index 4319521..be1e235 100644 --- a/runtime/subagent/subagent.go +++ b/runtime/subagent/subagent.go @@ -15,8 +15,8 @@ import ( "time" "unicode/utf8" - "agent-native/runtime/hooks" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // Request 是一次委派的完整信息集(模型经工具参数逐项填写)。 diff --git a/runtime/subagent/subagent_hooks_test.go b/runtime/subagent/subagent_hooks_test.go index 5cf4319..a2e96cc 100644 --- a/runtime/subagent/subagent_hooks_test.go +++ b/runtime/subagent/subagent_hooks_test.go @@ -5,8 +5,8 @@ import ( "encoding/json" "testing" - "agent-native/runtime/hooks" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/hooks" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) func TestDelegateEmitsStartAndStop(t *testing.T) { diff --git a/runtime/subagent/subagent_test.go b/runtime/subagent/subagent_test.go index 875d450..ba78ca0 100644 --- a/runtime/subagent/subagent_test.go +++ b/runtime/subagent/subagent_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) func TestRegisterNilFactoryNoop(t *testing.T) { diff --git a/runtime/telemetry/telemetry.go b/runtime/telemetry/telemetry.go index 3234ea1..450fca2 100644 --- a/runtime/telemetry/telemetry.go +++ b/runtime/telemetry/telemetry.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // Span 是一次 invoke_agent、chat 或 execute_tool。 diff --git a/runtime/tools/builtin.go b/runtime/tools/builtin.go index 4cb0627..502edf6 100644 --- a/runtime/tools/builtin.go +++ b/runtime/tools/builtin.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "agent-native/runtime/filestate" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/filestate" ) type readFile struct { diff --git a/runtime/tools/checkpoint_hook_test.go b/runtime/tools/checkpoint_hook_test.go index 4cc22f9..9c657af 100644 --- a/runtime/tools/checkpoint_hook_test.go +++ b/runtime/tools/checkpoint_hook_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "agent-native/runtime/checkpoint" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/checkpoint" ) func TestWriteAndEditRecordCheckpoints(t *testing.T) { diff --git a/runtime/tools/code_tool.go b/runtime/tools/code_tool.go index e181e14..16c0d5b 100644 --- a/runtime/tools/code_tool.go +++ b/runtime/tools/code_tool.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "agent-native/runtime/codeorch" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/codeorch" ) // RegisterCodeTool 注册 run_tool_script。调用方在开关打开时才注册。 diff --git a/runtime/tools/deferred.go b/runtime/tools/deferred.go index 2601aa6..99ce8a5 100644 --- a/runtime/tools/deferred.go +++ b/runtime/tools/deferred.go @@ -7,7 +7,7 @@ import ( "os" "strings" - "agent-native/runtime/codeorch" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/codeorch" ) type searchTool struct{ reg *Registry } diff --git a/runtime/tools/filestate_test.go b/runtime/tools/filestate_test.go index 67b2064..ada1ce0 100644 --- a/runtime/tools/filestate_test.go +++ b/runtime/tools/filestate_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "agent-native/runtime/filestate" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/filestate" ) func TestTrackedWriteRejectsUnreadAndStale(t *testing.T) { diff --git a/runtime/tools/registry.go b/runtime/tools/registry.go index 563acae..a9f67da 100644 --- a/runtime/tools/registry.go +++ b/runtime/tools/registry.go @@ -9,8 +9,8 @@ import ( "sync" "time" - "agent-native/runtime/checkpoint" - "agent-native/runtime/filestate" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/checkpoint" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/filestate" ) // Result is the tool payload returned to the model. diff --git a/runtime/usage_retry_n3_test.go b/runtime/usage_retry_n3_test.go index 5dcaecf..b1a014d 100644 --- a/runtime/usage_retry_n3_test.go +++ b/runtime/usage_retry_n3_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "agent-native/runtime/llm" - "agent-native/runtime/tools" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools" ) // ---- N3 WP6:计费拆分与默认重试 ---- diff --git a/schema/roundtrip_test.go b/schema/roundtrip_test.go index 93b08ba..0c3104a 100644 --- a/schema/roundtrip_test.go +++ b/schema/roundtrip_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "testing" - "agent-native/exec" + "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/exec" ) func TestRequestAndResultRoundTrip(t *testing.T) {