refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名) - 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块) - docreader proto 描述符采用等长替换,保持序列化字节布局有效 - Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像 - 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
This commit is contained in:
1 parent
9097ee699d
commit
9058149576
3136 files changed
+18018
-18004
No files matched your search
@@ -5,7 +5,7 @@
|
||||
// treats the authoritative session→sandbox binding as external state that
|
||||
// lives in SessionSandboxBindingStore (Redis in production, memory in tests
|
||||
// and single-process deployments). This makes the manager provider-neutral
|
||||
// (Cube , E2B) and multi-instance safe: two WeKnora processes
|
||||
// (Cube , E2B) and multi-instance safe: two Academy processes
|
||||
// concurrently servicing the same session never allocate duplicate sandboxes,
|
||||
// and a restart never loses the session's remote resource.
|
||||
//
|
||||
@@ -37,12 +37,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/common/redislock"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/sandbox/admission"
|
||||
"github.com/Tencent/WeKnora/internal/sandbox/allocation"
|
||||
"github.com/Tencent/WeKnora/internal/sandbox/workspace"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/common/redislock"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/sandbox/admission"
|
||||
"academy/internal/sandbox/allocation"
|
||||
"academy/internal/sandbox/workspace"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// SessionInputRoot is reserved for durable user attachments restored from
|
||||
@@ -55,14 +55,14 @@ const SessionInputRoot = workspace.InputDir
|
||||
// do not depend on the template user being able to mkdir under /workspace.
|
||||
const SessionOutputRoot = workspace.OutputDir
|
||||
|
||||
// skillOutputEnvVar matches the skills manager's WEKNORA_SKILL_OUTPUT_DIR.
|
||||
const skillOutputEnvVar = "WEKNORA_SKILL_OUTPUT_DIR"
|
||||
// skillOutputEnvVar matches the skills manager's ACADEMY_SKILL_OUTPUT_DIR.
|
||||
const skillOutputEnvVar = "ACADEMY_SKILL_OUTPUT_DIR"
|
||||
|
||||
// sessionInputEnvVar matches the skills manager's WEKNORA_SESSION_INPUT_DIR.
|
||||
// sessionInputEnvVar matches the skills manager's ACADEMY_SESSION_INPUT_DIR.
|
||||
// Both names are injected into the sandbox environment itself, not only into
|
||||
// the skill-script Execute call, so an agent exploring with shell_exec reads
|
||||
// the same paths the skills framework uses.
|
||||
const sessionInputEnvVar = "WEKNORA_SESSION_INPUT_DIR"
|
||||
const sessionInputEnvVar = "ACADEMY_SESSION_INPUT_DIR"
|
||||
|
||||
// SessionWorkspaceRoot is the writable workspace root inside remote sandboxes.
|
||||
// shell_exec work_dir must stay underneath this path.
|
||||
@@ -476,7 +476,7 @@ func withWorkspaceEnvDefaults(env map[string]string) map[string]string {
|
||||
}
|
||||
|
||||
// executionOutputDir resolves the artifact directory for this Execute call.
|
||||
// It prefers WEKNORA_SKILL_OUTPUT_DIR from cfg.Env when the path stays under
|
||||
// It prefers ACADEMY_SKILL_OUTPUT_DIR from cfg.Env when the path stays under
|
||||
// SessionWorkspaceRoot; otherwise it falls back to SessionOutputRoot.
|
||||
func executionOutputDir(cfg *ExecuteConfig) string {
|
||||
if cfg != nil && cfg.Env != nil {
|
||||
@@ -769,7 +769,7 @@ func (m *SessionBoundManager) WriteSessionWorkspaceFiles(
|
||||
parents := make(map[string]struct{}, len(files))
|
||||
for _, file := range files {
|
||||
// Session mode keeps the historical cleaner, which is pinned to
|
||||
// /workspace and ignores a host WEKNORA_SKILL_OUTPUT_DIR overlay.
|
||||
// /workspace and ignores a host ACADEMY_SKILL_OUTPUT_DIR overlay.
|
||||
clean, err := cleanSessionWorkspaceWritePath(file.Path)
|
||||
if sc.user {
|
||||
clean, err = workspace.CleanWriteFileIn(sc.layout, file.Path)
|
||||
@@ -1035,7 +1035,7 @@ func (m *SessionBoundManager) ExecShellCommand(
|
||||
|
||||
// ExecShellCommandWithOptions runs a shell command with install-only options.
|
||||
// Fallback is explicitly refused so even privileged installer calls never
|
||||
// escape onto the WeKnora host machine.
|
||||
// escape onto the Academy host machine.
|
||||
func (m *SessionBoundManager) ExecShellCommandWithOptions(
|
||||
ctx context.Context,
|
||||
sessionID string,
|
||||
@@ -1218,7 +1218,7 @@ func (m *SessionBoundManager) SessionInstallShellExecutor() SessionInstallShellE
|
||||
}
|
||||
|
||||
// SessionWorkspaceLayout reports where sessionID's files live. A session-owned
|
||||
// machine keeps the /workspace contract (a validated WEKNORA_SKILL_OUTPUT_DIR
|
||||
// machine keeps the /workspace contract (a validated ACADEMY_SKILL_OUTPUT_DIR
|
||||
// overlays OutputDir). A shared machine reports that session's directory.
|
||||
// Lookups do not admit and do not require a tenant: tool descriptions call
|
||||
// this before any provider operation.
|
||||
@@ -1508,7 +1508,7 @@ var _ SessionDesktopProvider = (*SessionBoundManager)(nil)
|
||||
|
||||
// Cleanup marks the manager closed. Session sandboxes are not force-deleted
|
||||
// here: their lifecycle is authoritative in the binding store and would
|
||||
// leak to any other WeKnora replica if this replica reaped them on shutdown.
|
||||
// leak to any other Academy replica if this replica reaped them on shutdown.
|
||||
// Providers reclaim idle sandboxes via their own timeout/pause policies.
|
||||
func (m *SessionBoundManager) Cleanup(_ context.Context) error {
|
||||
if m == nil {
|
||||
@@ -1690,7 +1690,7 @@ type forkSnapshotCreator interface {
|
||||
}
|
||||
|
||||
// createForkOrProviderSnapshot uses a fork-specific commit when the client
|
||||
// has one (Docker's weknora-fork/ namespace). Cube and E2B have no extra
|
||||
// has one (Docker's academy-fork/ namespace). Cube and E2B have no extra
|
||||
// namespace, so they keep using CreateSnapshot.
|
||||
func createForkOrProviderSnapshot(
|
||||
ctx context.Context,
|
||||
@@ -2338,7 +2338,7 @@ func (m *SessionBoundManager) DeleteSessionWorkspaces(
|
||||
// Refuse a symlinked parent instead of following it: an agent on this
|
||||
// machine runs as root and may have replaced one.
|
||||
script := `set -eu
|
||||
for p in /workspace /workspace/sessions /var/lib/weknora /var/lib/weknora/sessions; do
|
||||
for p in /workspace /workspace/sessions /var/lib/academy /var/lib/academy/sessions; do
|
||||
if [ -L "$p" ]; then echo "refusing to clean through symlinked $p" >&2; exit 4; fi
|
||||
done
|
||||
for t in ` + strings.Join(targets, " ") + `; do
|
||||
@@ -2397,7 +2397,7 @@ func withSessionEnv(env map[string]string, layout WorkspaceLayout) map[string]st
|
||||
|
||||
// userScriptDir is where an uploaded skill script lands on a shared machine.
|
||||
func userScriptDir(layout WorkspaceLayout) string {
|
||||
return path.Join(layout.Root, ".weknora", "scripts")
|
||||
return path.Join(layout.Root, ".academy", "scripts")
|
||||
}
|
||||
|
||||
// sessionKey resolves the tenant-scoped binding key. Tenant ID comes from the
|
||||
@@ -2696,12 +2696,12 @@ SRC_GIT=%s
|
||||
DST_TREE=%s
|
||||
DST_GIT=%s
|
||||
SHA=%s
|
||||
for p in /workspace /workspace/sessions /var/lib/weknora /var/lib/weknora/sessions; do
|
||||
for p in /workspace /workspace/sessions /var/lib/academy /var/lib/academy/sessions; do
|
||||
if [ -L "$p" ]; then echo "refusing symlinked $p" >&2; exit 4; fi
|
||||
done
|
||||
if [ -e "$DST_TREE" ] || [ -e "$DST_GIT" ]; then echo "fork target exists" >&2; exit 5; fi
|
||||
mkdir -p /var/lib/weknora/sessions /workspace/sessions
|
||||
tmp=$(mktemp -d /var/lib/weknora/sessions/.fork.XXXXXX)
|
||||
mkdir -p /var/lib/academy/sessions /workspace/sessions
|
||||
tmp=$(mktemp -d /var/lib/academy/sessions/.fork.XXXXXX)
|
||||
trap 'rm -rf -- "$tmp"' EXIT
|
||||
g() { git -c safe.directory='*' -c core.hooksPath=/dev/null "$@"; }
|
||||
g --git-dir="$SRC_GIT" cat-file -e "$SHA^{commit}"
|
||||
@@ -2712,8 +2712,8 @@ g init -q --bare "$tmp/repo.git"
|
||||
g -c uploadpack.allowAnySHA1InWant=true --git-dir="$tmp/repo.git" fetch -q --no-tags "$SRC_GIT" "$SHA:refs/heads/main"
|
||||
g --git-dir="$tmp/repo.git" symbolic-ref HEAD refs/heads/main
|
||||
g --git-dir="$tmp/repo.git" config core.bare false
|
||||
g --git-dir="$tmp/repo.git" config user.email agent@weknora.local
|
||||
g --git-dir="$tmp/repo.git" config user.name 'WeKnora Agent'
|
||||
g --git-dir="$tmp/repo.git" config user.email agent@academy.local
|
||||
g --git-dir="$tmp/repo.git" config user.name 'Academy Agent'
|
||||
mkdir -p "$tmp/tree"
|
||||
g --git-dir="$tmp/repo.git" --work-tree="$tmp/tree" checkout -q -f main
|
||||
mkdir -p "$tmp/tree/input" "$tmp/tree/output"
|
||||
@@ -2743,7 +2743,7 @@ func (f *workspaceFork) Remove(targetSessionID string) error {
|
||||
return err
|
||||
}
|
||||
_, err = f.run(fmt.Sprintf(`set -eu
|
||||
for p in /workspace /workspace/sessions /var/lib/weknora /var/lib/weknora/sessions; do
|
||||
for p in /workspace /workspace/sessions /var/lib/academy /var/lib/academy/sessions; do
|
||||
if [ -L "$p" ]; then echo "refusing symlinked $p" >&2; exit 4; fi
|
||||
done
|
||||
rm -rf -- %s %s`, ShellQuote(target.Root), ShellQuote(target.GitDir)))
|
||||
@@ -2762,7 +2762,7 @@ var (
|
||||
)
|
||||
|
||||
// PermissiveSessionExistenceChecker accepts every session. It is safe in
|
||||
// deployments where WeKnora's own DestroySession is the only session-delete
|
||||
// deployments where Academy's own DestroySession is the only session-delete
|
||||
// path (single-process memory binding store); the Redis-authoritative
|
||||
// deployment must inject a real checker consulting the session repository.
|
||||
type PermissiveSessionExistenceChecker struct{}
|
||||
|
||||
Reference in new issue
Block a user