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
@@ -6,7 +6,7 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// spySink records audit events for assertions.
|
||||
@@ -127,7 +127,7 @@ func TestAuditSink_NopByDefault(t *testing.T) {
|
||||
var _ AuditSink = nopSink{} // compile-time assertion
|
||||
r := &Repository{} // sink left nil
|
||||
// Must not panic.
|
||||
r.auditSink().EmitIndexCreated(context.Background(), "weknora_768", 768)
|
||||
r.auditSink().EmitIndexCreated(context.Background(), "academy_768", 768)
|
||||
r.auditSink().EmitReindexExecuted(context.Background(), "a", "b", 3)
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ func TestAuditSink_EmitIndexCreated_OnEnsureReady(t *testing.T) {
|
||||
t.Fatalf("want 1 index_created event, got %d", len(spy.indexCreated))
|
||||
}
|
||||
got := spy.indexCreated[0]
|
||||
if got.alias != "weknora_test_768" || got.dim != 768 {
|
||||
if got.alias != "academy_test_768" || got.dim != 768 {
|
||||
t.Errorf("event mismatch: %+v", got)
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// inspectByQueryResponse parses an _update_by_query / _delete_by_query
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package opensearch
|
||||
|
||||
import "github.com/Tencent/WeKnora/internal/types"
|
||||
import "academy/internal/types"
|
||||
|
||||
// internalCfg is the driver-internal, immutable view of IndexConfig.
|
||||
// Defaults are chosen so the env-path (no IndexConfig) and DB-store path
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"github.com/google/uuid"
|
||||
osapi "github.com/opensearch-project/opensearch-go/v4/opensearchapi"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// copyBatchSize is the pagination size for the source scan. Kept under the
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
osapi "github.com/opensearch-project/opensearch-go/v4/opensearchapi"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// additionalParams contract (verified against
|
||||
|
||||
@@ -3,7 +3,7 @@ package opensearch
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// TestConnection verifies an OpenSearch cluster is reachable, runs a
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
osapi "github.com/opensearch-project/opensearch-go/v4/opensearchapi"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// clusterHandler serves both GET / (version info) and /_cat/plugins, so the
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
osapi "github.com/opensearch-project/opensearch-go/v4/opensearchapi"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// createIndexAndAlias creates "<alias>_v1" with the full k-NN mapping
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// retrieveFilters is the typed shape of OpenSearch query filter
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
"github.com/opensearch-project/opensearch-go/v4"
|
||||
osapi "github.com/opensearch-project/opensearch-go/v4/opensearchapi"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
)
|
||||
|
||||
// EngineAwareNormalizer applies the documented per-engine cosine-score
|
||||
@@ -42,7 +42,7 @@ import (
|
||||
// caller reads zero before the first caller persists.
|
||||
type Repository struct {
|
||||
client *osapi.Client
|
||||
baseIndex string // pre-suffix base name, e.g. "weknora_abcdef012345"
|
||||
baseIndex string // pre-suffix base name, e.g. "academy_abcdef012345"
|
||||
cfg internalCfg // immutable after construction (value, not pointer)
|
||||
|
||||
// Per-dimension lazy initialization. ensureReady(ctx, dim) inserts an
|
||||
@@ -84,13 +84,13 @@ var _ interfaces.RetrieveEngineRepository = (*Repository)(nil)
|
||||
// storeID is the VectorStore.ID owning this repository instance. It is
|
||||
// folded into the base index name so multiple OpenSearch VectorStores
|
||||
// pointing at the same cluster do not collide:
|
||||
// - storeID == "" — env-path; no prefix, base index = "weknora".
|
||||
// - storeID == "" — env-path; no prefix, base index = "academy".
|
||||
// - len(storeID) >= 16 — DB-store path; prefix = storeID[:12]
|
||||
// (48-bit collision space).
|
||||
// - 1..15 chars — rejected with ErrConfigInvalid.
|
||||
//
|
||||
// indexCfg is optional — pass nil to use env var (OPENSEARCH_INDEX) or
|
||||
// default ("weknora") values.
|
||||
// default ("academy") values.
|
||||
//
|
||||
// Optional behavior is configured via functional options (e.g.
|
||||
// WithAuditSink). Passing no options keeps audit emission as a no-op, so the
|
||||
@@ -114,7 +114,7 @@ func NewRepository(
|
||||
)
|
||||
}
|
||||
|
||||
base := types.ResolveIndexName(indexCfg, "OPENSEARCH_INDEX", "weknora")
|
||||
base := types.ResolveIndexName(indexCfg, "OPENSEARCH_INDEX", "academy")
|
||||
if storeID != "" {
|
||||
// 12 hex chars → 48-bit collision space (UUID is 32 chars; using
|
||||
// half gives strong-enough collision avoidance for the realistic
|
||||
|
||||
@@ -18,8 +18,8 @@ import (
|
||||
"github.com/opensearch-project/opensearch-go/v4"
|
||||
osapi "github.com/opensearch-project/opensearch-go/v4/opensearchapi"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
)
|
||||
|
||||
// ============================================================================
|
||||
@@ -83,7 +83,7 @@ func newTestRepo(t *testing.T, handler http.HandlerFunc) (*Repository, *httptest
|
||||
client := newTestClient(t, ts.URL)
|
||||
repo := &Repository{
|
||||
client: client,
|
||||
baseIndex: "weknora_test",
|
||||
baseIndex: "academy_test",
|
||||
cfg: internalCfg{
|
||||
shards: 1, replicas: 0,
|
||||
knnEngine: "lucene",
|
||||
@@ -192,8 +192,8 @@ func TestIsTransientErr(t *testing.T) {
|
||||
func TestSanitizeIndexName_AcceptsValidNames(t *testing.T) {
|
||||
t.Parallel()
|
||||
cases := []string{
|
||||
"weknora",
|
||||
"weknora_abc123def456_768",
|
||||
"academy",
|
||||
"academy_abc123def456_768",
|
||||
"a",
|
||||
"1abc",
|
||||
"foo-bar_baz",
|
||||
@@ -977,7 +977,7 @@ func TestEnsureReady_ConcurrentCallers_SingleCreate(t *testing.T) {
|
||||
|
||||
repo := &Repository{
|
||||
client: newTestClient(t, ts.URL),
|
||||
baseIndex: "weknora_test",
|
||||
baseIndex: "academy_test",
|
||||
cfg: internalCfg{shards: 1, replicas: 0, knnEngine: "lucene", hnswM: 16, hnswEFConstruction: 100, efSearch: 100},
|
||||
once: make(map[int]*sync.Once),
|
||||
initErr: make(map[int]error),
|
||||
@@ -1006,7 +1006,7 @@ func TestEnsureReady_PerDimensionIsolation(t *testing.T) {
|
||||
|
||||
repo := &Repository{
|
||||
client: newTestClient(t, ts.URL),
|
||||
baseIndex: "weknora_test",
|
||||
baseIndex: "academy_test",
|
||||
cfg: internalCfg{shards: 1, replicas: 0, knnEngine: "lucene", hnswM: 16, hnswEFConstruction: 100, efSearch: 100},
|
||||
once: make(map[int]*sync.Once),
|
||||
initErr: make(map[int]error),
|
||||
@@ -1058,7 +1058,7 @@ func TestEnsureReady_TransientError_NotCached(t *testing.T) {
|
||||
|
||||
repo := &Repository{
|
||||
client: newTestClient(t, ts.URL),
|
||||
baseIndex: "weknora_test",
|
||||
baseIndex: "academy_test",
|
||||
cfg: internalCfg{shards: 1, replicas: 0, knnEngine: "lucene", hnswM: 16, hnswEFConstruction: 100, efSearch: 100},
|
||||
once: make(map[int]*sync.Once),
|
||||
initErr: make(map[int]error),
|
||||
@@ -1083,17 +1083,17 @@ func TestEnsureReady_TransientError_NotCached(t *testing.T) {
|
||||
|
||||
func TestIndexAlias(t *testing.T) {
|
||||
t.Parallel()
|
||||
r := &Repository{baseIndex: "weknora_abc123def456"}
|
||||
if got := r.indexAlias(768); got != "weknora_abc123def456_768" {
|
||||
t.Errorf("indexAlias(768): want weknora_abc123def456_768, got %s", got)
|
||||
r := &Repository{baseIndex: "academy_abc123def456"}
|
||||
if got := r.indexAlias(768); got != "academy_abc123def456_768" {
|
||||
t.Errorf("indexAlias(768): want academy_abc123def456_768, got %s", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestKeywordsIndex(t *testing.T) {
|
||||
t.Parallel()
|
||||
r := &Repository{baseIndex: "weknora_abc123def456"}
|
||||
if got := r.keywordsIndex(); got != "weknora_abc123def456_keywords" {
|
||||
t.Errorf("keywordsIndex: want weknora_abc123def456_keywords, got %s", got)
|
||||
r := &Repository{baseIndex: "academy_abc123def456"}
|
||||
if got := r.keywordsIndex(); got != "academy_abc123def456_keywords" {
|
||||
t.Errorf("keywordsIndex: want academy_abc123def456_keywords, got %s", got)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
osapi "github.com/opensearch-project/opensearch-go/v4/opensearchapi"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// Retrieve dispatches to vectorRetrieve or keywordsRetrieve based on
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// The k-NN plugin reports (1 + cos) / 2; vector hits leave the driver as
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package opensearch
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// This file holds the remaining stubs for methods whose real implementation
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"github.com/opensearch-project/opensearch-go/v4"
|
||||
osapi "github.com/opensearch-project/opensearch-go/v4/opensearchapi"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/types"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
// NewOpenSearchClient builds a TLS-hardened, pool-tuned *osapi.Client for
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// TestNewOpenSearchClient_RejectsEmptyAddr verifies the constructor
|
||||
|
||||
Reference in new issue
Block a user