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
@@ -8,16 +8,16 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/sandbox"
|
||||
"academy/internal/localsandbox"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/sandbox"
|
||||
)
|
||||
|
||||
// Adapter presents the local sandbox through the session-scoped capability
|
||||
// interfaces the agent already consumes. It *is* the session shell, file
|
||||
// store, and layout provider — not a wrapper around a second remote path.
|
||||
//
|
||||
// File operations do NOT go through the OS sandbox: WeKnora itself is trusted
|
||||
// File operations do NOT go through the OS sandbox: Academy itself is trusted
|
||||
// and already holds the user's privileges, so putting it inside Seatbelt would
|
||||
// only stop it reading its own database. They are bounded by PathGuard, which
|
||||
// is derived from the same Policy the backend compiles.
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox"
|
||||
"github.com/Tencent/WeKnora/internal/sandbox"
|
||||
"academy/internal/localsandbox"
|
||||
"academy/internal/sandbox"
|
||||
)
|
||||
|
||||
func TestAdapterSatisfiesCapabilityInterfaces(t *testing.T) {
|
||||
@@ -100,9 +100,9 @@ func TestLayoutForHintIsTheWorkspaceRoot(t *testing.T) {
|
||||
func TestLayoutForSessionWorkspaceHasNoInputOrOutput(t *testing.T) {
|
||||
l := LayoutFor(localsandbox.Workspace{
|
||||
Kind: localsandbox.WorkspaceSession,
|
||||
Root: "/Users/dev/Documents/WeKnora/s1",
|
||||
Root: "/Users/dev/Documents/Academy/s1",
|
||||
})
|
||||
require.Equal(t, []string{"/Users/dev/Documents/WeKnora/s1"}, l.WriteRoots)
|
||||
require.Equal(t, []string{"/Users/dev/Documents/Academy/s1"}, l.WriteRoots)
|
||||
require.Empty(t, l.InputDir)
|
||||
require.Empty(t, l.OutputDir)
|
||||
}
|
||||
@@ -240,10 +240,10 @@ func testService(t *testing.T, backend localsandbox.Backend) *localsandbox.Servi
|
||||
t.Helper()
|
||||
base := t.TempDir()
|
||||
home := filepath.Join(base, "home")
|
||||
appData := filepath.Join(home, "App Support", "WeKnora Lite")
|
||||
appData := filepath.Join(home, "App Support", "Academy Lite")
|
||||
require.NoError(t, os.MkdirAll(home, 0o755))
|
||||
resolver := localsandbox.NewWorkspaceResolver(localsandbox.DirLayout{
|
||||
SessionRoot: filepath.Join(home, "Documents", "WeKnora"),
|
||||
SessionRoot: filepath.Join(home, "Documents", "Academy"),
|
||||
}, stubProjects{})
|
||||
return localsandbox.NewService(backend, resolver, localsandbox.NewPolicyBuilder(home, appData), nil)
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/sandbox"
|
||||
"academy/internal/localsandbox"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/sandbox"
|
||||
)
|
||||
|
||||
// InstallRunner is the slice of localsandbox.Service an install needs.
|
||||
@@ -127,7 +127,7 @@ func (m *InstallManager) ExecShellCommandWithOptions(
|
||||
// installEnv points package caches inside dir: the default cache locations
|
||||
// under the home directory are not writable to the install policy.
|
||||
func installEnv(dir string, extra map[string]string) map[string]string {
|
||||
cache := filepath.Join(dir, ".weknora", "cache")
|
||||
cache := filepath.Join(dir, ".academy", "cache")
|
||||
env := make(map[string]string, len(extra)+4)
|
||||
for k, v := range extra {
|
||||
env[k] = v
|
||||
@@ -135,7 +135,7 @@ func installEnv(dir string, extra map[string]string) map[string]string {
|
||||
env["UV_CACHE_DIR"] = filepath.Join(cache, "uv")
|
||||
env["PIP_CACHE_DIR"] = filepath.Join(cache, "pip")
|
||||
env["npm_config_cache"] = filepath.Join(cache, "npm")
|
||||
env["WEKNORA_SKILL_DIR"] = dir
|
||||
env["ACADEMY_SKILL_DIR"] = dir
|
||||
return env
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox"
|
||||
"github.com/Tencent/WeKnora/internal/sandbox"
|
||||
"academy/internal/localsandbox"
|
||||
"academy/internal/sandbox"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -58,10 +58,10 @@ func TestInstallManagerRunsInBoundVersionDir(t *testing.T) {
|
||||
require.Equal(t, "ok", res.Stdout)
|
||||
require.Equal(t, dir, runner.policy.Cwd)
|
||||
require.Empty(t, runner.req.WorkDir, "/workspace means the version dir on host")
|
||||
require.Equal(t, filepath.Join(dir, ".weknora", "cache", "uv"), runner.req.Env["UV_CACHE_DIR"])
|
||||
require.Equal(t, filepath.Join(dir, ".weknora", "cache", "pip"), runner.req.Env["PIP_CACHE_DIR"])
|
||||
require.Equal(t, filepath.Join(dir, ".weknora", "cache", "npm"), runner.req.Env["npm_config_cache"])
|
||||
require.Equal(t, dir, runner.req.Env["WEKNORA_SKILL_DIR"])
|
||||
require.Equal(t, filepath.Join(dir, ".academy", "cache", "uv"), runner.req.Env["UV_CACHE_DIR"])
|
||||
require.Equal(t, filepath.Join(dir, ".academy", "cache", "pip"), runner.req.Env["PIP_CACHE_DIR"])
|
||||
require.Equal(t, filepath.Join(dir, ".academy", "cache", "npm"), runner.req.Env["npm_config_cache"])
|
||||
require.Equal(t, dir, runner.req.Env["ACADEMY_SKILL_DIR"])
|
||||
require.Equal(t, "1", runner.req.Env["X"])
|
||||
|
||||
release()
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package adapter
|
||||
|
||||
import (
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox"
|
||||
"github.com/Tencent/WeKnora/internal/sandbox"
|
||||
"academy/internal/localsandbox"
|
||||
"academy/internal/sandbox"
|
||||
)
|
||||
|
||||
// LayoutFor maps a resolved workspace onto the layout the agent tools consume.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// stack in internal/sandbox: the two share no domain model.
|
||||
package localsandbox
|
||||
|
||||
import "github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
import "academy/internal/localsandbox/core"
|
||||
|
||||
// The facade re-exports the core contract as aliases (not new types), so a
|
||||
// core.Policy and a localsandbox.Policy are the same type to the compiler and
|
||||
@@ -29,7 +29,7 @@ type (
|
||||
Prepared = core.Prepared
|
||||
// Process is a running sandboxed command.
|
||||
Process = core.Process
|
||||
// PathGuard validates filesystem access performed by WeKnora itself.
|
||||
// PathGuard validates filesystem access performed by Academy itself.
|
||||
PathGuard = core.PathGuard
|
||||
// Workspace is where one session's work happens.
|
||||
Workspace = core.Workspace
|
||||
|
||||
@@ -5,9 +5,9 @@ package localsandbox
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/seatbelt"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/localsandbox/core"
|
||||
"academy/internal/localsandbox/seatbelt"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// NewBackend returns the platform backend. The build tag on this file is the
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/localsandbox/core"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// NewBackend has no implementation outside macOS and Windows.
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
package localsandbox
|
||||
|
||||
import (
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/winhost"
|
||||
"academy/internal/localsandbox/core"
|
||||
"academy/internal/localsandbox/winhost"
|
||||
)
|
||||
|
||||
func NewBackend() (core.Backend, error) { return winhost.New() }
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
// model which secret paths exist is itself a small leak.
|
||||
var ErrPathDenied = errors.New("localsandbox: path is outside the permitted workspace")
|
||||
|
||||
// PathGuard validates filesystem access performed by WeKnora itself, which
|
||||
// PathGuard validates filesystem access performed by Academy itself, which
|
||||
// runs with the user's full privileges and therefore cannot be constrained by
|
||||
// the OS sandbox. It derives from the same Policy the backend compiles, so
|
||||
// both paths enforce the same rules.
|
||||
|
||||
@@ -135,7 +135,7 @@ func NewPolicyBuilder(homeDir, appDataDir string) *PolicyBuilder {
|
||||
return &PolicyBuilder{
|
||||
homeDir: filepath.Clean(homeDir),
|
||||
appDataDir: filepath.Clean(appDataDir),
|
||||
jobsRoot: filepath.Join(filepath.Clean(homeDir), ".weknora", "jobs"),
|
||||
jobsRoot: filepath.Join(filepath.Clean(homeDir), ".academy", "jobs"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ func (b *PolicyBuilder) rejectBroadWorkspace(root string) error {
|
||||
return fmt.Errorf("%w: %q", ErrWorkspaceTooBroad, root)
|
||||
}
|
||||
}
|
||||
// Background jobs live under ~/.weknora/jobs. A workspace that covers that
|
||||
// Background jobs live under ~/.academy/jobs. A workspace that covers that
|
||||
// directory, or sits inside it, can read or replace another session's output.
|
||||
if b.jobsRoot != "" && (PathUnder(b.jobsRoot, root) || PathUnder(root, b.jobsRoot)) {
|
||||
return fmt.Errorf("%w: %q overlaps the background jobs directory", ErrWorkspaceTooBroad, root)
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func builderFixture(t *testing.T) (*PolicyBuilder, Workspace) {
|
||||
t.Helper()
|
||||
home := filepath.Join(t.TempDir(), "home")
|
||||
appData := filepath.Join(home, "App Support", "WeKnora Lite")
|
||||
appData := filepath.Join(home, "App Support", "Academy Lite")
|
||||
ws := Workspace{
|
||||
Kind: WorkspaceProject,
|
||||
Root: filepath.Join(home, "My Project"),
|
||||
@@ -345,7 +345,7 @@ func TestRelaxRefusesToGrantAppData(t *testing.T) {
|
||||
func skillsBuilder(t *testing.T) (*PolicyBuilder, string) {
|
||||
t.Helper()
|
||||
b, _ := builderFixture(t)
|
||||
root := filepath.Join(b.homeDir, ".weknora", "skills")
|
||||
root := filepath.Join(b.homeDir, ".academy", "skills")
|
||||
return b.WithSkillsRoot(root), root
|
||||
}
|
||||
|
||||
@@ -390,14 +390,14 @@ func TestBuildInstallRejectsDirOutsideSkillsRoot(t *testing.T) {
|
||||
|
||||
func TestBuildInstallRequiresASkillsRoot(t *testing.T) {
|
||||
b, _ := builderFixture(t)
|
||||
_, err := b.BuildInstall(filepath.Join(b.homeDir, ".weknora", "skills", ".versions", "pdf-1"))
|
||||
_, err := b.BuildInstall(filepath.Join(b.homeDir, ".academy", "skills", ".versions", "pdf-1"))
|
||||
require.ErrorIs(t, err, ErrInstallDirOutsideSkillsRoot)
|
||||
}
|
||||
|
||||
func TestJobsDirectoryCannotBecomeAWorkspace(t *testing.T) {
|
||||
home := "/Users/local-test"
|
||||
jobs := filepath.Join(home, ".weknora", "jobs")
|
||||
b := NewPolicyBuilder(home, filepath.Join(home, "Library", "Application Support", "WeKnora Lite"))
|
||||
jobs := filepath.Join(home, ".academy", "jobs")
|
||||
b := NewPolicyBuilder(home, filepath.Join(home, "Library", "Application Support", "Academy Lite"))
|
||||
for _, root := range []string{filepath.Dir(jobs), jobs, filepath.Join(jobs, "sj_0123")} {
|
||||
_, err := b.Build(ModeAuto, Workspace{Root: root})
|
||||
require.Error(t, err, root)
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// WorkspaceKind distinguishes a user-picked project from an auto-allocated session dir.
|
||||
@@ -56,7 +56,7 @@ var ErrProjectDirRevoked = errors.New("localsandbox: session project directory i
|
||||
// DirLayout names the roots the resolver allocates under.
|
||||
type DirLayout struct {
|
||||
// SessionRoot is where session workspaces are created, by default
|
||||
// ~/Documents/WeKnoraLite. It is user-visible on purpose.
|
||||
// ~/Documents/AcademyLite. It is user-visible on purpose.
|
||||
SessionRoot string
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ func workspaceFixture(t *testing.T, projectDir string) WorkspaceResolver {
|
||||
t.Helper()
|
||||
base := t.TempDir()
|
||||
return NewWorkspaceResolver(DirLayout{
|
||||
SessionRoot: filepath.Join(base, "Documents", "WeKnora"),
|
||||
SessionRoot: filepath.Join(base, "Documents", "Academy"),
|
||||
}, fakeProjects{dir: projectDir})
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func TestResolveSessionWorkspaceCreatesDatedDirectory(t *testing.T) {
|
||||
func TestResolveSessionWorkspaceHasNoSpacesInCreatedNames(t *testing.T) {
|
||||
base := t.TempDir()
|
||||
r := NewWorkspaceResolver(DirLayout{
|
||||
SessionRoot: filepath.Join(base, "Documents", "WeKnora"),
|
||||
SessionRoot: filepath.Join(base, "Documents", "Academy"),
|
||||
}, fakeProjects{})
|
||||
|
||||
ws, err := r.Resolve(context.Background(), "session-abcdef123456")
|
||||
@@ -122,7 +122,7 @@ func TestResolveRejectsEmptySessionID(t *testing.T) {
|
||||
|
||||
func TestResolveFailsClosedWhenBoundProjectIsRevoked(t *testing.T) {
|
||||
base := t.TempDir()
|
||||
sessionRoot := filepath.Join(base, "Documents", "WeKnora")
|
||||
sessionRoot := filepath.Join(base, "Documents", "Academy")
|
||||
r := NewWorkspaceResolver(DirLayout{SessionRoot: sessionRoot}, revokedProjects{})
|
||||
|
||||
_, err := r.Resolve(context.Background(), "sess-revoked")
|
||||
@@ -138,7 +138,7 @@ func TestResolveFailsClosedWhenBoundProjectIsRevoked(t *testing.T) {
|
||||
func TestResolveSessionWorkspaceKeepsPathAfterMidnight(t *testing.T) {
|
||||
base := t.TempDir()
|
||||
r := NewWorkspaceResolver(DirLayout{
|
||||
SessionRoot: filepath.Join(base, "Documents", "WeKnora"),
|
||||
SessionRoot: filepath.Join(base, "Documents", "Academy"),
|
||||
}, fakeProjects{}).(*workspaceResolver)
|
||||
|
||||
day1 := time.Date(2026, 9, 20, 23, 0, 0, 0, time.UTC)
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/localsandbox/core"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// seatbeltExecPath is hard-coded rather than resolved through PATH: a PATH
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
"academy/internal/localsandbox/core"
|
||||
)
|
||||
|
||||
func darwinFixture(t *testing.T) (core.Backend, core.Policy, string) {
|
||||
@@ -171,7 +171,7 @@ func TestSeatbeltPolicyFromBuilderRunsLoginShell(t *testing.T) {
|
||||
|
||||
home, err := filepath.EvalSymlinks(t.TempDir())
|
||||
require.NoError(t, err)
|
||||
workspace := filepath.Join(home, "Documents", "WeKnora", "s1")
|
||||
workspace := filepath.Join(home, "Documents", "Academy", "s1")
|
||||
require.NoError(t, os.MkdirAll(workspace, 0o755))
|
||||
secretProfile := []byte("export AWS_SECRET_ACCESS_KEY=super-secret\n")
|
||||
require.NoError(t, os.WriteFile(filepath.Join(home, ".profile"), secretProfile, 0o644))
|
||||
@@ -361,14 +361,14 @@ func TestSeatbeltAllowsTmpAndDeniesVarFolders(t *testing.T) {
|
||||
|
||||
home, err := filepath.EvalSymlinks(t.TempDir())
|
||||
require.NoError(t, err)
|
||||
workspace := filepath.Join(home, "Documents", "WeKnora", "s1")
|
||||
workspace := filepath.Join(home, "Documents", "Academy", "s1")
|
||||
require.NoError(t, os.MkdirAll(workspace, 0o755))
|
||||
|
||||
tmpSecret := filepath.Join("/tmp", "weknora-seatbelt-"+t.Name())
|
||||
tmpSecret := filepath.Join("/tmp", "academy-seatbelt-"+t.Name())
|
||||
require.NoError(t, os.WriteFile(tmpSecret, []byte("TMPSECRET"), 0o600))
|
||||
t.Cleanup(func() { _ = os.Remove(tmpSecret) })
|
||||
|
||||
vfSecret := filepath.Join(os.TempDir(), "weknora-seatbelt-"+t.Name())
|
||||
vfSecret := filepath.Join(os.TempDir(), "academy-seatbelt-"+t.Name())
|
||||
require.NoError(t, os.WriteFile(vfSecret, []byte("VFSECRET"), 0o600))
|
||||
t.Cleanup(func() { _ = os.Remove(vfSecret) })
|
||||
|
||||
@@ -390,7 +390,7 @@ func TestSeatbeltAllowsTmpAndDeniesVarFolders(t *testing.T) {
|
||||
require.Equal(t, 0, status.Code, out)
|
||||
require.Contains(t, out, "TMPSECRET")
|
||||
|
||||
tmpOut := filepath.Join("/tmp", "weknora-seatbelt-out-"+t.Name())
|
||||
tmpOut := filepath.Join("/tmp", "academy-seatbelt-out-"+t.Name())
|
||||
t.Cleanup(func() { _ = os.Remove(tmpOut) })
|
||||
status, out = runSandboxedArgv(t, backend, p, append(noProfile, `echo from-sandbox > `+tmpOut+` && cat `+tmpOut), env)
|
||||
require.Equal(t, 0, status.Code, out)
|
||||
@@ -415,7 +415,7 @@ func TestSeatbeltPrepareResolvesTmpAlias(t *testing.T) {
|
||||
backend, err := New()
|
||||
require.NoError(t, err)
|
||||
|
||||
logical, err := os.MkdirTemp("/tmp", "weknora-seatbelt-")
|
||||
logical, err := os.MkdirTemp("/tmp", "academy-seatbelt-")
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() { _ = os.RemoveAll(logical) })
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
;; Base policy for WeKnora Lite's local sandbox.
|
||||
;; Base policy for Academy Lite's local sandbox.
|
||||
;; Deny-by-default; everything else is granted explicitly by the compiler.
|
||||
|
||||
(version 1)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
"academy/internal/localsandbox/core"
|
||||
)
|
||||
|
||||
//go:embed base.sbpl
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
"academy/internal/localsandbox/core"
|
||||
)
|
||||
|
||||
func seatbeltPolicy() core.Policy {
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// defaultRunTimeout matches the shell_exec tool default so behaviour does not
|
||||
|
||||
@@ -131,9 +131,9 @@ func serviceFixtureWithProjects(
|
||||
t.Helper()
|
||||
base := t.TempDir()
|
||||
home := filepath.Join(base, "home")
|
||||
appData := filepath.Join(home, "App Support", "WeKnora Lite")
|
||||
appData := filepath.Join(home, "App Support", "Academy Lite")
|
||||
resolver := NewWorkspaceResolver(DirLayout{
|
||||
SessionRoot: filepath.Join(home, "Documents", "WeKnora"),
|
||||
SessionRoot: filepath.Join(home, "Documents", "Academy"),
|
||||
}, projects)
|
||||
return NewService(backend, resolver, NewPolicyBuilder(home, appData), fixedMode(mode))
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
func newTree(t *testing.T) *Tree {
|
||||
t.Helper()
|
||||
tree, err := New(filepath.Join(t.TempDir(), ".weknora", "skills"))
|
||||
tree, err := New(filepath.Join(t.TempDir(), ".academy", "skills"))
|
||||
require.NoError(t, err)
|
||||
return tree
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox/core"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/localsandbox/core"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// New reports Windows as unavailable rather than running unsandboxed.
|
||||
|
||||
Reference in new issue
Block a user