[WIP] Build the Backend from versioned Go libraries and fixed frontend composition #196

Closed
weichen wants to merge 8 commits from feature/versioned-dependencies into main
278 changed files with 1309 additions and 773 deletions
+473 -12
View File
@@ -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-System-Backend":
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-System-Backend.git")
git(root, "fetch", "--depth=1", "origin", sha, token=root_token, repo="Agent-System-Backend")
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,7 +261,240 @@ 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: Install house-style Python packages
run: python3 -m pip install --break-system-packages -i https://pypi.tuna.tsinghua.edu.cn/simple python-docx python-pptx openpyxl
- name: Vet and test
run: GOWORK=off go vet ./... && GOWORK=off go test -count=1 ./...
run: |
set -euo pipefail
source .ci-mirrors.env
GOWORK=off go vet -mod=readonly ./... && GOWORK=off go test -mod=readonly -count=1 ./...
-21
View File
@@ -1,21 +0,0 @@
[submodule "deps/agent-system-core"]
path = deps/agent-system-core
url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Core.git
[submodule "deps/agent-native"]
path = deps/agent-native
url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Native.git
[submodule "deps/agent-intent"]
path = deps/agent-intent
url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Intent.git
[submodule "deps/logging-system"]
path = deps/logging-system
url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Logging-System.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/agent-squad"]
path = deps/agent-squad
url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Squad.git
[submodule "deps/agent-command"]
path = deps/agent-command
url = ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-Command.git
+2 -2
View File
@@ -1,6 +1,6 @@
# Agent 工作说明(Agent-System-Backend)
本仓开发遵循 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 实测)
+3 -3
View File
@@ -7,10 +7,10 @@
## 验证(P1–P4 状态)
- `go test ./...` — 单元 + 端到端(mock runner 全链路:流式/折叠部件/HITL 三分支/子代理任务树/工件/上传解析/中文检索/SSE 在线与重放/命令路由/插件装卸 fail-closed)。
- `CGO_ENABLED=0 go build ./cmd/agent-system` — 单二进制(静态,内嵌前端后)。
- `GOWORK=off go test -mod=readonly -count=1 ./...` — 单元 + 端到端(mock runner 全链路:流式/折叠部件/HITL 三分支/子代理任务树/工件/上传解析/中文检索/SSE 在线与重放/命令路由/插件装卸 fail-closed)。
- `GOWORK=off CGO_ENABLED=0 go build -mod=readonly ./cmd/agent-system` — 单二进制(静态,内嵌前端后)。
- 存储:嵌入式 SQLite(modernc.org/sqlite,纯 Go);FTS5 全文 + CJK LIKE 兜底。
- 依赖:agent-system-core(deps submodule + replace)、agent-native(runtime/llm 复用)。
- 依赖:完整模块路径的 Core、Native、Intent、Command、Squad 及基础库,版本由 `go.mod` / `go.sum` 固定;Native 复用 runtime/llm。正式消费使用 `GOWORK=off`、无本地目录 `replace`。旧提交保留其 gitlinks 供历史组合和在途分支重建;本提交已移除已替代指针。
## 配置(启动层)
+11
View File
@@ -3,3 +3,14 @@
对话系统后端:Go 模块化单体,默认构建为单二进制(go:embed 内嵌前端与嵌入式 SQLite 存储)。组合 Agent-Native / Agent-Squad / Agent-Intent 生态,依赖 agent-system-core 契约。
契约与架构见 Agent-System-Documents 设计方案与架构文档;开发规范见 development-guidelines(Dev 仓 `development/guidelines`)。本仓为 Agent-System 多仓组合的组成部分。
## 模块与版本依赖
Go 模块路径为 `git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git`。Core、Native、Intent、Command、Squad 与基础库的实际提交版本由 `go.mod` / `go.sum` 固定;正式测试和构建使用 `GOWORK=off`,不使用源码目录 `replace`。私有获取使用 Dev 的进程级传输配置,不修改全局 Git 配置。
```bash
GOWORK=off go test -mod=readonly -count=1 ./...
GOWORK=off CGO_ENABLED=0 go build -mod=readonly -o /tmp/agent-system ./cmd/agent-system
```
完整产品还需要 Dev 构建入口装配前端 `web/dist` 后再编译;Go 模块测试不证明前端组合产物。旧提交保留其 gitlinks 供历史组合和在途分支重建;本提交已移除已替代指针。本地源码联调通过 Dev 的显式组件链接管理;在途分支迁移 import 与模块前缀时保持公开协议、数据和事件标识。
+1 -1
View File
@@ -1,7 +1,7 @@
package main
import (
"agent-system-backend/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"bytes"
"io"
"os"
+4 -4
View File
@@ -12,10 +12,10 @@ import (
"strings"
"time"
"agent-system-backend/internal/app"
"agent-system-backend/internal/config"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/identity"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/app"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/config"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/identity"
)
var version = "0.1.0-dev"
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"strings"
"testing"
"agent-system-backend/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
)
// U4 集成(环境门控 AGENT_PG_TEST_DSN:CI test-pg job / 本机隔离实例):
+1 -1
View File
@@ -31,7 +31,7 @@ import (
_ "modernc.org/sqlite" // SQLite 驱动(源,只读打开)
"agent-system-backend/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
)
func main() {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"strings"
"testing"
"agent-system-backend/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
)
// U4 迁移工具测试:夹具覆盖全部当前 schema 的边值(布尔/空值/时间/JSON/
Submodule deps/agent-command deleted from 4f583ca3ee
Submodule deps/agent-intent deleted from 343b1e6d9a
Submodule deps/agent-native deleted from c348441691
-1
Submodule deps/agent-squad deleted from 490b0b2dfa
Submodule deps/logging-system deleted from 49b5d8be60
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"path/filepath"
"testing"
"agent-system-backend/internal/quality"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/quality"
)
func TestDesensitizedSampleBeatsColumnNotes(t *testing.T) {
+1 -1
View File
@@ -18,7 +18,7 @@ import (
"testing"
"time"
"agent-system-backend/internal/runtime"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/runtime"
)
// upload 上传一个材料文件,返回 artifact id。
+9 -25
View File
@@ -1,20 +1,20 @@
module agent-system-backend
module git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git
go 1.27
require (
agent-command v0.0.0
agent-intent v0.0.0
agent-native v0.0.0
agent-squad v0.0.0
agent-squad/adapters/native v0.0.0
agent-system-core v0.0.0
error-code-system v0.0.0
git-ssh.u1680832.nyat.app/weichen/Agent-Command.git v0.0.0-20261013153614-1aa532f45e55
git-ssh.u1680832.nyat.app/weichen/Agent-Intent.git v0.0.0-20261013153611-3a8468c83a80
git-ssh.u1680832.nyat.app/weichen/Agent-Native.git v0.0.0-20261013153610-6ddd3da8df5c
git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git v0.0.0-20261013154435-37b273e35f88
git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git/adapters/native v0.0.0-20261013154435-37b273e35f88
git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git v0.4.1-0.20261013151137-f32d4317846f
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
github.com/jackc/pgx/v5 v5.9.2
github.com/ledongthuc/pdf v0.0.0-20260907135840-6c8c28e0e8a0
github.com/redis/go-redis/v9 v9.14.0
golang.org/x/crypto v0.56.0
logging-system v0.0.0
modernc.org/sqlite v1.60.1
)
@@ -36,19 +36,3 @@ require (
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.12.1 // indirect
)
replace agent-intent => ./deps/agent-intent
replace agent-squad => ./deps/agent-squad
replace agent-squad/adapters/native => ./deps/agent-squad/adapters/native
replace agent-native => ./deps/agent-native
replace agent-system-core => ./deps/agent-system-core
replace error-code-system => ./deps/error-code-system
replace logging-system => ./deps/logging-system
replace agent-command => ./deps/agent-command
+16
View File
@@ -1,3 +1,19 @@
git-ssh.u1680832.nyat.app/weichen/Agent-Command.git v0.0.0-20261013153614-1aa532f45e55 h1:TAY0gfufDihgDhNNl3MN1V/Yf0vXpmFkBQ6KnUPasgE=
git-ssh.u1680832.nyat.app/weichen/Agent-Command.git v0.0.0-20261013153614-1aa532f45e55/go.mod h1:GkgKoD8bm/unq87QBZsWV0KmjlLRvfi5FQas8hLlJGY=
git-ssh.u1680832.nyat.app/weichen/Agent-Intent.git v0.0.0-20261013153611-3a8468c83a80 h1:MMYfIibHvQFqINaM9Hy0SQKivb3ofzyfUo2wMpacWIg=
git-ssh.u1680832.nyat.app/weichen/Agent-Intent.git v0.0.0-20261013153611-3a8468c83a80/go.mod h1:idJ6YUupl8JapXrwk4x5hVaqemp7c7x6f2Qf2ezCpz0=
git-ssh.u1680832.nyat.app/weichen/Agent-Native.git v0.0.0-20261013153610-6ddd3da8df5c h1:9FwMbsjF1qdnH/JANKZSYDXyHBd6H2tEo1z2cdPldds=
git-ssh.u1680832.nyat.app/weichen/Agent-Native.git v0.0.0-20261013153610-6ddd3da8df5c/go.mod h1:hONk3TC2TIn8Us+AcvoDCkBnIDAh1Aj/nevo9tJcZv4=
git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git v0.0.0-20261013154435-37b273e35f88 h1:bE4or5GHlv7D78tqoLXtaC9TW0Bt/bzj/fZ8IK99XwY=
git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git v0.0.0-20261013154435-37b273e35f88/go.mod h1:WRNAbaAaumPt7pe0Wg/2SxajcUc6IVZoBd7VJEe0tqk=
git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git/adapters/native v0.0.0-20261013154435-37b273e35f88 h1:jiTBm6dcMBbDUdC6/ufXVxtLyCac8E8u7fVmae7cnEA=
git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git/adapters/native v0.0.0-20261013154435-37b273e35f88/go.mod h1:+MOrRWwFOPs1F5LCAPR3pW5yqPoLKJtB6sWHsN54VN4=
git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git v0.4.1-0.20261013151137-f32d4317846f h1:39RW0R6zmtXLNbLQaqFCmtZ6zjEs2lhDLb9YLhudIiM=
git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git v0.4.1-0.20261013151137-f32d4317846f/go.mod h1:T3FU9NsngaxF/1C2ISi02fV7+aqNepOEvX0QhswA70Y=
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=
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
+1 -1
View File
@@ -5,7 +5,7 @@ package app
import (
"testing"
"agent-system-backend/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
)
func TestInprocHostListAccounts(t *testing.T) {
+1 -1
View File
@@ -1,7 +1,7 @@
package app
import (
"agent-system-backend/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"os"
"path/filepath"
"testing"
+37 -37
View File
@@ -19,44 +19,44 @@ import (
"syscall"
"time"
"error-code-system/errcode"
"logging-system/logsys"
"logging-system/sink"
"git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode"
"git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys"
"git-ssh.u1680832.nyat.app/weichen/Logging-System.git/sink"
"agent-native/runtime/checkpoint"
agentllm "agent-native/runtime/llm"
agentmcp "agent-native/runtime/mcp"
"agent-native/runtime/policy"
"agent-native/runtime/telemetry"
agenttools "agent-native/runtime/tools"
nativeadp "agent-squad/adapters/native"
"agent-system-backend/internal/blobstore"
"agent-system-backend/internal/bus"
"agent-system-backend/internal/cardsvc"
"agent-system-backend/internal/cmdbus"
"agent-system-backend/internal/config"
"agent-system-backend/internal/genui"
"agent-system-backend/internal/hostapi"
"agent-system-backend/internal/intentgate"
"agent-system-backend/internal/intentsem"
"agent-system-backend/internal/pgbus"
"agent-system-backend/internal/plugins"
"agent-system-backend/internal/profiles"
"agent-system-backend/internal/prompts"
"agent-system-backend/internal/rag"
"agent-system-backend/internal/ratelimit"
"agent-system-backend/internal/runmgr"
"agent-system-backend/internal/runtime"
"agent-system-backend/internal/server"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/skills"
"agent-system-backend/internal/squadadapter"
"agent-system-backend/internal/store"
"agent-system-backend/internal/surfacesvc"
"agent-system-backend/internal/tools"
"agent-system-backend/internal/workflow"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/checkpoint"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
agentmcp "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/mcp"
"git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/policy"
"git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/telemetry"
agenttools "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/tools"
nativeadp "git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git/adapters/native"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/blobstore"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/bus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/cardsvc"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/cmdbus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/config"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/genui"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/hostapi"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/intentgate"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/intentsem"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/pgbus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/plugins"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/profiles"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/prompts"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/rag"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/ratelimit"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/runmgr"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/runtime"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/server"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/skills"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/squadadapter"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/surfacesvc"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/tools"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/workflow"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
type Options struct {
+5 -5
View File
@@ -9,11 +9,11 @@ import (
"os"
"path/filepath"
agentcommand "agent-command"
"agent-system-backend/internal/cmdbus"
"agent-system-backend/internal/server"
"agent-system-backend/pkg/extension"
core "agent-system-core"
agentcommand "git-ssh.u1680832.nyat.app/weichen/Agent-Command.git"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/cmdbus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/server"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
type compiledRegistry struct {
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"testing"
"time"
"agent-system-backend/internal/cmdbus"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/cmdbus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// fakeExtAuthz 进程内扩展:注册 EXT-8 适配器+一条命令——修复前适配器注册被
+5 -5
View File
@@ -7,11 +7,11 @@ import (
"testing"
"time"
agentcommand "agent-command"
"agent-system-backend/internal/cmdbus"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
agentcommand "git-ssh.u1680832.nyat.app/weichen/Agent-Command.git"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/cmdbus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
)
// WP3-I4:applyCompiled 的注册面摘要——成功注册的命令/意图/技能记入
+4 -4
View File
@@ -8,10 +8,10 @@ import (
"path/filepath"
"testing"
"agent-system-backend/internal/rag"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/rag"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// newExt13Host EXT-13 装配:真实 store + rag 管线 + authz 槽 + inprocHost(bob 视角)。
+1 -1
View File
@@ -6,7 +6,7 @@ package app
import (
"testing"
"agent-system-backend/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
)
func TestExt18AdminProviderPositive(t *testing.T) {
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"path/filepath"
"testing"
"agent-system-backend/internal/rag"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/rag"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// newExt9Host EXT-9 测试装配:真实 store + rag 管线 + inprocHost(无 embedder,
+8 -8
View File
@@ -1,20 +1,20 @@
package app
import (
"agent-system-backend/pkg/extension"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
"context"
"fmt"
"sort"
"strings"
"sync"
"agent-system-backend/internal/ingest"
"agent-system-backend/internal/rag"
"agent-system-backend/internal/runtime"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
"agent-system-backend/internal/surfacesvc"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/ingest"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/rag"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/runtime"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/surfacesvc"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// hostcaps 聚合 owner 作用域的宿主能力(存储、检索管线、LLM 路由)。
+7 -7
View File
@@ -9,13 +9,13 @@ import (
"testing"
"time"
agentcommand "agent-command"
"agent-system-backend/internal/cmdbus"
"agent-system-backend/internal/rag"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
core "agent-system-core"
agentcommand "git-ssh.u1680832.nyat.app/weichen/Agent-Command.git"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/cmdbus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/rag"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// newInprocTestApp 组合根测试版:走真实的 applyCompiled → cmdbus.Dispatch →
+2 -2
View File
@@ -3,8 +3,8 @@ package app
import (
"testing"
"agent-system-backend/internal/settings"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// 慢通道开关默认关(行为与 I1 一致的机器证明):
+5 -5
View File
@@ -1,11 +1,11 @@
package app
import (
"agent-system-backend/internal/rag"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/rag"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
"context"
"testing"
)
+5 -5
View File
@@ -1,11 +1,11 @@
package app
import (
"agent-system-backend/internal/projectscope"
"agent-system-backend/internal/server"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/projectscope"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/server"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
"context"
"errors"
"sync"
+5 -5
View File
@@ -1,11 +1,11 @@
package app
import (
"agent-system-backend/internal/server"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/server"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
"bytes"
"context"
"encoding/json"
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"errors"
"testing"
"agent-system-backend/pkg/extension"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
)
func TestAuthorizeResourceV2FallbackAndQuery(t *testing.T) {
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"path/filepath"
"testing"
"agent-system-backend/internal/rag"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/rag"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
)
// EXT-11 红测:注入前 NewScopedHost fail-closed;注入后重建句柄与分发期同构
+1 -1
View File
@@ -6,7 +6,7 @@ package bus
import (
"sync"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
type subscriber struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package bus
import (
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func TestPublishClosesOverflowedSubscriber(t *testing.T) {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"sync"
"time"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// Emitter 由宿主注入(runmgr 事件缓冲包装):卡片事件走与会话事件同一管道,
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"testing"
"time"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func openTest(t *testing.T) (*store.Store, *Service, func() []core.StreamEvent) {
+2 -2
View File
@@ -3,8 +3,8 @@ package cardsvc
import (
"testing"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// EXT-12 最小开关(红测):MirrorConvCards=false 时会话卡不镜像进项目公共流
+2 -2
View File
@@ -14,8 +14,8 @@ import (
"sync"
"time"
agentcommand "agent-command"
"agent-system-core"
agentcommand "git-ssh.u1680832.nyat.app/weichen/Agent-Command.git"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// AuditStore 审计落盘端口(store 实现;v7 建表、v18 加 owner 列)。
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"testing"
"time"
agentcommand "agent-command"
"agent-system-core"
agentcommand "git-ssh.u1680832.nyat.app/weichen/Agent-Command.git"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// memAudit / memCards 测试替身。
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"testing"
"time"
agentcommand "agent-command"
agentcommand "git-ssh.u1680832.nyat.app/weichen/Agent-Command.git"
)
func newToolBus(t *testing.T) *Bus {
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"path/filepath"
"testing"
agentcommand "agent-command"
"agent-system-backend/internal/store"
agentcommand "git-ssh.u1680832.nyat.app/weichen/Agent-Command.git"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
)
func TestPendingConfirmRestoredAfterRestart(t *testing.T) {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"encoding/json"
"testing"
agentcommand "agent-command"
agentcommand "git-ssh.u1680832.nyat.app/weichen/Agent-Command.git"
)
// EXT-10② 红测:插件命令规格自带 slash 别名 → 四入口同源(slash 命中同一命令
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"time"
"unicode/utf8"
agentllm "agent-native/runtime/llm"
core "agent-system-core"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// Report 记录一次组装的实际构成(可观测:模型看到了什么、裁了什么)。
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"strings"
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func fakeUser(text string) core.Message {
+3 -3
View File
@@ -9,9 +9,9 @@ import (
"strings"
"sync"
agentllm "agent-native/runtime/llm"
"agent-native/runtime/reminders"
core "agent-system-core"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
"git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/reminders"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// Injection 是一条在组装末尾才决定是否注入的条件条目。
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"strings"
"testing"
agentllm "agent-native/runtime/llm"
core "agent-system-core"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func TestVisibleHistoryDropsExcludedAndUnselectedVariants(t *testing.T) {
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"testing"
"unicode/utf8"
agentllm "agent-native/runtime/llm"
core "agent-system-core"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func assistantWith(id string, parts ...core.Part) core.Message {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"strings"
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func TestSummarizeBeyondInjectsExtract(t *testing.T) {
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"strings"
"testing"
agentllm "agent-native/runtime/llm"
core "agent-system-core"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func surfaceSnap() core.SurfaceSnapshot {
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"strings"
"testing"
agentllm "agent-native/runtime/llm"
core "agent-system-core"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// 交错思考模型(MiniMax 等)要求历史 assistant 原样回传 <think>;
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"strconv"
"strings"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// PluginID 是插件身份(activation 台账与命令前缀共用)。
+4 -4
View File
@@ -11,10 +11,10 @@ import (
"strings"
"testing"
"agent-system-backend/internal/store"
"agent-system-backend/internal/surfacesvc"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/surfacesvc"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// realSvc 让 fakeHost.SurfaceSave 走真实 surfacesvc(校验/守卫行为与生产一致)。
+5 -5
View File
@@ -19,11 +19,11 @@ import (
"testing"
"time"
"agent-system-backend/internal/ctxasm"
"agent-system-backend/internal/store"
"agent-system-backend/internal/surfacesvc"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/ctxasm"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/surfacesvc"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
const materials = `材料:
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"net/http"
"strings"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// Server 依赖由组合根注入。Dispatch/Search/Complete 可为 nil(对应路由返回 503)。
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"path/filepath"
"testing"
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
)
func TestHostClientRoundTrip(t *testing.T) {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// EXT-8 余项:hostapi 检索面——SharedSearch 可用时整体切换(本人+适配器放行的
+2 -2
View File
@@ -3,9 +3,9 @@ package ingest
import (
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
"agent-system-backend/internal/docgen"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/docgen"
)
// TestParseDocxFromDocgen 回读契约:docgen 产出的 docx 必须能被 builtin:docx
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"strings"
"time"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
pdflib "github.com/ledongthuc/pdf"
)
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"strings"
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func TestParseMarkdown(t *testing.T) {
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"strings"
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func pythonModuleAvailable(t *testing.T, module string) bool {
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"strings"
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// zipBytes 按名称构造 zip(键排序保证确定性)。
+1 -1
View File
@@ -17,7 +17,7 @@ import (
"strconv"
"strings"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func parsePptx(content []byte) ([]core.DocBlock, []string) {
+1 -1
View File
@@ -17,7 +17,7 @@ import (
"strings"
"time"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// 解析上限(包级变量,测试可覆盖)。
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"fmt"
"sync"
agentintent "agent-intent/intent"
agentintent "git-ssh.u1680832.nyat.app/weichen/Agent-Intent.git/intent"
)
// SlotQuestion 是命中意图后仍缺的必填槽位,以及建议的提问。
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"encoding/json"
"testing"
agentintent "agent-intent/intent"
agentintent "git-ssh.u1680832.nyat.app/weichen/Agent-Intent.git/intent"
)
func raw(t *testing.T, v any) json.RawMessage {
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"fmt"
"strings"
agentintent "agent-intent/intent"
agentllm "agent-native/runtime/llm"
agentintent "git-ssh.u1680832.nyat.app/weichen/Agent-Intent.git/intent"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
)
// LightGenerator 用轻量模型实现 agentintent.CommandGenerator
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"strings"
"testing"
agentintent "agent-intent/intent"
agentllm "agent-native/runtime/llm"
agentintent "git-ssh.u1680832.nyat.app/weichen/Agent-Intent.git/intent"
agentllm "git-ssh.u1680832.nyat.app/weichen/Agent-Native.git/runtime/llm"
)
// fakeEmbedder 返回脚本化向量:texts[i] → vecs[i](循环取模)。
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"context"
"math"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// EmbeddingScorer 用语义向量实现 agentintent.SemanticScorer:
+3 -3
View File
@@ -19,9 +19,9 @@ import (
"sync"
"time"
"agent-system-backend/internal/bus"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/bus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
"github.com/jackc/pgx/v5"
)
+3 -3
View File
@@ -13,9 +13,9 @@ import (
"testing"
"time"
"agent-system-backend/internal/bus"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/bus"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func pgTestStore(t *testing.T) (*store.Store, string) {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// agentBannedKeys 是插件代理声明禁带的键:钩子、MCP 与权限模式归宿主与
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"strings"
"testing"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// writeAgentPlugin 写一个带 agents/ 资产的插件目录。
+5 -5
View File
@@ -13,11 +13,11 @@ import (
"strings"
"sync"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
"agent-system-backend/internal/tools"
"agent-system-backend/internal/workflow"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/tools"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/workflow"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// Loaded 是一个已装载插件的内存态(注册结果快照)。
+6 -6
View File
@@ -8,12 +8,12 @@ import (
"strings"
"testing"
"agent-system-backend/internal/intentgate"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
"agent-system-backend/internal/tools"
"agent-system-backend/internal/workflow"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/intentgate"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/tools"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/workflow"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func newHost(t *testing.T) (*Host, *tools.Registry, string) {
+4 -4
View File
@@ -9,10 +9,10 @@ import (
"path/filepath"
"strings"
"agent-system-backend/internal/skills"
"agent-system-backend/internal/store"
"agent-system-backend/internal/tools"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/skills"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/tools"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func (h *Host) SetSkillsRoot(dir string) { h.skillsRoot = dir }
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"testing"
"time"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func TestV2AssetsAndNetwork(t *testing.T) {
+2 -2
View File
@@ -4,8 +4,8 @@ package profiles
import (
"reflect"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// OwnerDefault 与 store 保持一致的默认租户(内置画像共享,owner=”)。
+3 -3
View File
@@ -3,9 +3,9 @@
package projectscope
import (
"agent-system-backend/internal/store"
"agent-system-backend/pkg/extension"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
"context"
)
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"strconv"
"strings"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// ParseModuleFile 解析一个库文件(frontmatter + 正文)。
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"strings"
"testing"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// 内置库必须全部可解析、ID 唯一、层级合法、触发引用完整。
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"sort"
"strings"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
//go:embed library/*.md
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"strings"
"time"
"agent-squad/squad"
"git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git/squad"
)
// Checker 把评分卡接到小队质检。不通过时把意见写到工作区 quality-feedback.md,
+2 -1
View File
@@ -10,6 +10,7 @@ import (
func TestLintCommandEnvCarriesSkillsRoot(t *testing.T) {
root := t.TempDir()
t.Setenv("PYTHONPATH", "/fixture/isolated-pydeps")
SetLintEnvRoot(root)
t.Cleanup(func() { SetLintEnvRoot("") })
env := lintCommandEnv()
@@ -18,7 +19,7 @@ func TestLintCommandEnvCarriesSkillsRoot(t *testing.T) {
if kv == "AGENT_SKILLS_DIR="+root {
sawSkills = true
}
if kv == "PYTHONPATH="+filepath.Join(root, "house-style") {
if kv == "PYTHONPATH="+filepath.Join(root, "house-style")+string(os.PathListSeparator)+"/fixture/isolated-pydeps" {
sawPath = true
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ package rag
import (
"strings"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// FixedChunker 段落感知定长分块:优先沿空行段落边界聚包,段落超长按窗口硬切,
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"net/http"
"time"
core "agent-system-core"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// Route 解析一次模型路由(设置层;组合根/管线调用方负责取有效设置)。
+3 -3
View File
@@ -6,9 +6,9 @@ import (
"encoding/hex"
"log"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// Pipeline 实现设计 4.12 检索管线:
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"strings"
"testing"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// fakeEmbedder 确定性向量:按首字符映射,验证混合检索排序无需真实模型。
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"path/filepath"
"testing"
"agent-system-backend/internal/settings"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/settings"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// EXT-8 余项红/绿:向量通道共享——他人 owner 的向量命中经 allow 放行可检。
+2 -2
View File
@@ -19,8 +19,8 @@
package route
import (
"agent-system-backend/internal/intentgate"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/intentgate"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// Kind 是路由决策类型。
+2 -2
View File
@@ -3,8 +3,8 @@ package route
import (
"testing"
"agent-system-backend/internal/intentgate"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/intentgate"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func startCmd(action intentgate.ActionRef) intentgate.Command {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"log"
"sync"
"agent-system-backend/internal/store"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
)
// 协作存储 U3 切片 2:执行许可门(R8)。预算经 budgetFn 动态读取(设置
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"testing"
"time"
"agent-system-backend/internal/store"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/store"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// 协作存储 U3 切片 2(R8):执行预算在 runmgr 侧的行为面——
+3 -3
View File
@@ -6,9 +6,9 @@ import (
"sync"
"testing"
"agent-system-backend/internal/cardsvc"
"agent-system-backend/internal/runtime"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/cardsvc"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/runtime"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
// newCardSpawnEnv 在后台派发环境上接线收件箱卡片服务,并捕获发出的卡片事件
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"testing"
"time"
"agent-system-backend/internal/runtime"
core "agent-system-core"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/internal/runtime"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
type gateRunner struct {

Some files were not shown because too many files have changed in this diff Show More