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

- 全量替换代码/配置/文档中的项目名(保留上游 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:
runny committed 2026-11-13 20:52:51 +08:00
1 parent 9097ee699d
commit 9058149576
3136 files changed
+18018 -18004

No files matched your search

+1 -1
View File
@@ -57,7 +57,7 @@ func (e *MissingSkillEnvError) Error() string {
// This is the second layer of reserved-name protection. Task 2's write-time
// blacklist is the first, but a value written before that blacklist existed
// would still be in the database, and letting it land on
// WEKNORA_SKILL_OUTPUT_DIR would silently redirect the turn's artifacts to a
// ACADEMY_SKILL_OUTPUT_DIR would silently redirect the turn's artifacts to a
// directory nobody drains. Skipping existing keys makes that impossible
// regardless of what is stored.
func ApplyResolvedEnv(env, resolved map[string]string) {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"errors"
"testing"
"github.com/Tencent/WeKnora/internal/sandbox"
"academy/internal/sandbox"
"github.com/stretchr/testify/require"
)
+10 -10
View File
@@ -7,33 +7,33 @@ import (
"strings"
"sync"
"github.com/Tencent/WeKnora/internal/sandbox"
"academy/internal/sandbox"
)
// artifactOutputEnvVar is the name of the environment variable that WeKnora
// artifactOutputEnvVar is the name of the environment variable that Academy
// injects into every skill script execution. The value points to the
// convention-driven directory where the script should drop artifacts the user
// will be able to download after the turn completes.
//
// The name is stable across releases; skills reference it via os.getenv(...)
// so they never hard-code the path.
const artifactOutputEnvVar = "WEKNORA_SKILL_OUTPUT_DIR"
const artifactOutputEnvVar = "ACADEMY_SKILL_OUTPUT_DIR"
// sessionInputEnvVar points skill scripts at user-uploaded files restored into
// the current session's Cube. Inputs are separate from generated artifacts.
const sessionInputEnvVar = "WEKNORA_SESSION_INPUT_DIR"
const sessionInputEnvVar = "ACADEMY_SESSION_INPUT_DIR"
// artifactHistoryEnvVar is the name of the environment variable that points
// to the root artifact output directory (/workspace/output). Skill scripts
// can use this to self-discover artifacts from prior runs when they need to
// chain without LLM mediation.
const artifactHistoryEnvVar = "WEKNORA_SKILL_HISTORY_ROOT"
const artifactHistoryEnvVar = "ACADEMY_SKILL_HISTORY_ROOT"
// skillDirEnvVar points a script at its own directory inside the sandbox
// image. Installed skills run with /workspace as WorkDir, so this is how a
// script reaches the data and helpers that were installed beside it. The
// install-time verification pass exports the same name.
const skillDirEnvVar = "WEKNORA_SKILL_DIR"
const skillDirEnvVar = "ACADEMY_SKILL_DIR"
// nodePathEnvVar carries the skill's own node_modules. pythonPathEnvVar is
// never injected — a skill's Python packages arrive through its venv
@@ -45,7 +45,7 @@ const nodePathEnvVar = "NODE_PATH"
// InjectedSandboxEnvVars is every name skill environment preparation writes into the sandbox
// environment. The skill-env declaration blacklist must reject these so a
// stored value cannot redirect artifacts, the skill directory, or the session
// input tree. Credential names such as WEKNORA_API_KEY are not in this list.
// input tree. Credential names such as ACADEMY_API_KEY are not in this list.
func InjectedSandboxEnvVars() []string {
return []string{
artifactOutputEnvVar,
@@ -58,7 +58,7 @@ func InjectedSandboxEnvVars() []string {
}
// defaultArtifactOutputDir is used when neither the environment variable
// (WEKNORA_SKILL_OUTPUT_DIR) nor the ExecuteConfig.Env has an override.
// (ACADEMY_SKILL_OUTPUT_DIR) nor the ExecuteConfig.Env has an override.
// /workspace/output sits inside the base sandbox image's writable tree and
// is guaranteed to survive across Execute calls for the same session (Cube
// SessionBoundManager keeps the MicroVM alive between calls).
@@ -70,7 +70,7 @@ const defaultArtifactOutputDir = "/workspace/output"
// draining artifacts after Execute returns.
//
// Resolution order (first usable wins):
// 1. WEKNORA_SKILL_OUTPUT_DIR from the host environment (ops override), when
// 1. ACADEMY_SKILL_OUTPUT_DIR from the host environment (ops override), when
// it names a directory inside the session workspace.
// 2. defaultArtifactOutputDir.
//
@@ -310,7 +310,7 @@ func (m *Manager) ListSkillFiles(ctx context.Context, skillName string) ([]strin
// SandboxSkillDir reports where a skill lives inside the sandbox image, and
// whether that path means anything to say out loud.
//
// Only an installed skill has one. A host skill is uploaded from the WeKnora
// Only an installed skill has one. A host skill is uploaded from the Academy
// machine for the session, so its original base path names a directory that no
// sandbox shell command can reach — telling the model about it would be worse
// than saying nothing.
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"fmt"
"github.com/Tencent/WeKnora/internal/sandbox"
"academy/internal/sandbox"
)
// PrepareShellEnvironment attaches an allowed, installed skill's runtime to
@@ -5,8 +5,8 @@ import (
"strings"
"testing"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/sandbox"
"academy/internal/types"
"github.com/stretchr/testify/require"
)
@@ -23,7 +23,7 @@ func TestShellEnvironmentSelectsOnlyAllowedInstalledSkills(t *testing.T) {
require.NoError(t, err)
require.Contains(t, wrapped, sandbox.ShellQuote(command))
require.Contains(t, wrapped, "/pdf/.venv/bin")
require.Contains(t, wrapped, "/pdf/.weknora/bin")
require.Contains(t, wrapped, "/pdf/.academy/bin")
require.Contains(t, wrapped, "--noprofile --norc")
require.Equal(t, "caller", actual["TOKEN"])
require.Equal(t, "/workspace/custom", actual["PYTHONPATH"],
@@ -49,7 +49,7 @@ func (h hostLayoutManager) SessionWorkspaceLayout(context.Context, string) (sand
}
func TestPrepareShellEnvironmentOnHostUsesLocalSkillsAndWorkspace(t *testing.T) {
root := "/Users/dev/.weknora/skills"
root := "/Users/dev/.academy/skills"
rows := []*types.TenantSkillEntity{{Name: "pdf", Status: types.SkillStatusReady, Enabled: true}}
m := NewManager(&ManagerConfig{Enabled: true}, hostLayoutManager{root: "/Users/dev/My Project"}).
WithSkillsRoot(root).
@@ -58,10 +58,10 @@ func TestPrepareShellEnvironmentOnHostUsesLocalSkillsAndWorkspace(t *testing.T)
cmd, env, err := m.PrepareShellEnvironment(context.Background(), "s1", "pdf", "python3 run.py", nil)
require.NoError(t, err)
require.Contains(t, cmd, root+"/pdf/.venv/bin")
require.Equal(t, root+"/pdf", env["WEKNORA_SKILL_DIR"])
require.Equal(t, "/Users/dev/My Project", env["WEKNORA_SKILL_OUTPUT_DIR"])
require.Equal(t, "/Users/dev/My Project", env["WEKNORA_SKILL_HISTORY_ROOT"])
_, hasInput := env["WEKNORA_SESSION_INPUT_DIR"]
require.Equal(t, root+"/pdf", env["ACADEMY_SKILL_DIR"])
require.Equal(t, "/Users/dev/My Project", env["ACADEMY_SKILL_OUTPUT_DIR"])
require.Equal(t, "/Users/dev/My Project", env["ACADEMY_SKILL_HISTORY_ROOT"])
_, hasInput := env["ACADEMY_SESSION_INPUT_DIR"]
require.False(t, hasInput)
}
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"sort"
"strings"
"github.com/Tencent/WeKnora/internal/sandbox"
"academy/internal/sandbox"
)
const (
+2 -2
View File
@@ -9,7 +9,7 @@ import (
"strings"
"testing"
"github.com/Tencent/WeKnora/internal/sandbox"
"academy/internal/sandbox"
"github.com/stretchr/testify/require"
)
@@ -71,7 +71,7 @@ func TestShellStagesHostResourcesOncePerSession(t *testing.T) {
backend := &stagingManager{store: store}
mgr := NewManager(&ManagerConfig{Enabled: true, SkillDirs: []string{root}, AllowedSkills: []string{"host-skill"}}, backend)
require.NoError(t, mgr.Initialize(context.Background()))
command := `python3 "$WEKNORA_SKILL_DIR/scripts/run.py"`
command := `python3 "$ACADEMY_SKILL_DIR/scripts/run.py"`
_, env, err := mgr.PrepareShellEnvironment(context.Background(), "session-1", "host-skill", command, nil)
require.NoError(t, err)
dir := env[skillDirEnvVar]
+1 -1
View File
@@ -20,7 +20,7 @@ var _ SkillSource = (*Loader)(nil)
// imageSkillSource is a source whose skills already exist inside the sandbox
// image. It is what separates the two sources at execution time: a host skill
// lives on the WeKnora machine and has to be uploaded into the sandbox, while
// lives on the Academy machine and has to be uploaded into the sandbox, while
// an installed skill is already there and is executed in place.
type imageSkillSource interface {
SkillSource
+4 -4
View File
@@ -11,8 +11,8 @@ import (
"strings"
"sync"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/sandbox"
"academy/internal/types"
)
// Bundle limits bound decompression. They mirror the install-time limits: the
@@ -54,7 +54,7 @@ const (
// neither - the files are already in the image.
type TenantSkillSource struct {
// root is the absolute directory that holds installed skill dirs
// (image root on remote sandboxes, ~/.weknora/skills on Lite).
// (image root on remote sandboxes, ~/.academy/skills on Lite).
root string
byName map[string]*types.TenantSkillEntity
@@ -90,7 +90,7 @@ func NewTenantSkillSource(
}
// NewTenantSkillSourceAt serves skills installed under root: the image root
// on remote sandboxes, ~/.weknora/skills on Lite.
// on remote sandboxes, ~/.academy/skills on Lite.
func NewTenantSkillSourceAt(
root string, rows []*types.TenantSkillEntity, loadBundle func(row *types.TenantSkillEntity) ([]byte, error),
) *TenantSkillSource {
+11 -11
View File
@@ -10,8 +10,8 @@ import (
"path/filepath"
"testing"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/types"
"academy/internal/sandbox"
"academy/internal/types"
"github.com/stretchr/testify/require"
)
@@ -61,7 +61,7 @@ func TestTenantSkillSourceBasePathIsTheImageDir(t *testing.T) {
base, err := src.GetSkillBasePath("pdf")
require.NoError(t, err)
require.Equal(t, "/opt/weknora/tenant/skills/pdf", base,
require.Equal(t, "/opt/academy/tenant/skills/pdf", base,
"the path is the skill name: that is the directory the installer writes")
}
@@ -100,8 +100,8 @@ func TestTenantSkillSourceLoadsInstructionsFromTheRow(t *testing.T) {
require.Equal(t, "PDF helpers", skill.Description)
require.Equal(t, "Run scripts/extract.py.", skill.Instructions)
require.True(t, skill.Loaded)
require.Equal(t, "/opt/weknora/tenant/skills/pdf", skill.BasePath)
require.Equal(t, "/opt/weknora/tenant/skills/pdf/SKILL.md", skill.FilePath)
require.Equal(t, "/opt/academy/tenant/skills/pdf", skill.BasePath)
require.Equal(t, "/opt/academy/tenant/skills/pdf/SKILL.md", skill.FilePath)
}
func TestTenantSkillSourceReadsLevel3FilesFromTheBundle(t *testing.T) {
@@ -126,7 +126,7 @@ func TestTenantSkillSourceReadsLevel3FilesFromTheBundle(t *testing.T) {
file, err := src.LoadSkillFile("pdf", "reference/FORMS.md")
require.NoError(t, err)
require.Equal(t, "form notes", file.Content)
require.Equal(t, "/opt/weknora/tenant/skills/pdf/reference/FORMS.md", file.Path,
require.Equal(t, "/opt/academy/tenant/skills/pdf/reference/FORMS.md", file.Path,
"the path the model is shown must be the one it can execute or read in the sandbox")
require.False(t, file.IsScript)
@@ -186,7 +186,7 @@ func TestTenantSkillSourceReportsAMissingBundleWithoutBlockingExecution(t *testi
remote, err := src.RemoteScriptPath("pdf", "scripts/extract.py")
require.NoError(t, err)
require.Equal(t, "/opt/weknora/tenant/skills/pdf/scripts/extract.py", remote)
require.Equal(t, "/opt/academy/tenant/skills/pdf/scripts/extract.py", remote)
}
func TestManagerIgnoresHostSkillsWhenTenantSourceIsAttached(t *testing.T) {
@@ -244,7 +244,7 @@ func TestSandboxSkillDirOnlyAnswersForInstalledSkills(t *testing.T) {
require.False(t, ok)
}
// Host skills keep uploading from the WeKnora machine and keep running in
// Host skills keep uploading from the Academy machine and keep running in
// their staged directory; the tenant source must not change that path at all.
type recordingSandboxManager struct {
config *sandbox.ExecuteConfig
@@ -357,13 +357,13 @@ func zipArchive(t *testing.T, files map[string]string) []byte {
func TestTenantSkillSourceAtUsesTheGivenRoot(t *testing.T) {
rows := []*types.TenantSkillEntity{{Name: "pdf", Status: types.SkillStatusReady, Enabled: true}}
src := NewTenantSkillSourceAt("/Users/dev/.weknora/skills", rows, nil)
src := NewTenantSkillSourceAt("/Users/dev/.academy/skills", rows, nil)
meta, err := src.DiscoverSkills()
require.NoError(t, err)
require.Equal(t, "/Users/dev/.weknora/skills/pdf", meta[0].BasePath)
require.Equal(t, "/Users/dev/.academy/skills/pdf", meta[0].BasePath)
script, err := src.RemoteScriptPath("pdf", "scripts/run.py")
require.NoError(t, err)
require.Equal(t, "/Users/dev/.weknora/skills/pdf/scripts/run.py", script)
require.Equal(t, "/Users/dev/.academy/skills/pdf/scripts/run.py", script)
legacy := NewTenantSkillSource(rows, nil)
dir, err := legacy.GetSkillBasePath("pdf")