From 28d2d50743479176307cec755413035a6a17c773 Mon Sep 17 00:00:00 2001 From: weichen Date: Tue, 13 Oct 2026 15:06:48 +0000 Subject: [PATCH] Enable canonical versioned Go module consumption Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements. Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate. Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable. Refs: Versioned dependencies U1/U3; feature/dependency-workspace --- PROJECT.md | 4 ++-- README.md | 2 +- cli/cli.go | 4 ++-- cli/cli_test.go | 4 ++-- conformance/registry_test.go | 4 ++-- domains/agent.go | 2 +- domains/catalog_test.go | 2 +- domains/catalog_write_test.go | 2 +- domains/export.go | 2 +- domains/intent.go | 2 +- domains/register.go | 2 +- domains/squad.go | 2 +- domains/sys.go | 2 +- go.mod | 2 +- httpx/httpx.go | 2 +- httpx/httpx_test.go | 4 ++-- main.go | 4 ++-- server/server.go | 4 ++-- server/server_test.go | 6 +++--- 19 files changed, 28 insertions(+), 28 deletions(-) diff --git a/PROJECT.md b/PROJECT.md index 0b7e515..5113139 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -5,9 +5,9 @@ ## 仓库与操作 - 目标/产品边界:跨系统错误码目录、进程内错误类型,以及可独立运行的查询服务。不依赖 Agent-Native、Agent-Squad 或日志库。 -- 源码、资产、文档、机器契约位置:模块路径 `error-code-system`。包为 `errcode`、`domains`、`httpx`、`server`、`cli`、`conformance`。映射文档在 `docs/`。种子码以 Go 注册为权威,`domains/*.json` 为导出快照。 +- 源码、资产、文档、机器契约位置:模块路径 `git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git`。包为 `errcode`、`domains`、`httpx`、`server`、`cli`、`conformance`。映射文档在 `docs/`。种子码以 Go 注册为权威,`domains/*.json` 为导出快照。 - 权威远端、集成基线、受保护分支:`ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Error-Code-System.git`,基线 `main`。 -- 并行共同基线记录位置、合入通知/主动检查方式:Gitea Issue/PR。消费方父仓 gitlink 才是它们使用的版本。 +- 并行共同基线记录位置、合入通知/主动检查方式:Gitea Issue/PR。新消费方以 go.mod 的实际模块图固定版本;旧 submodule 消费方继续按其固定源码版本构建,迁移须显式进行。 - 发布线与批准版本/实际制品查询入口:无独立制品库。`go build -o bin/errcode .` 从当前提交构建。 - 提交/审核/合并/发布身份与权限:仓库所有者 weichen。 - 任务唯一来源:Gitea `weichen/Error-Code-System` 的 Issue 与 Pull Request。 diff --git a/README.md b/README.md index 687e8a0..6289827 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 跨系统共用的错误码目录、进程内错误类型,以及可独立部署的查询服务。目标是让失败能够按稳定码定位,而不是依赖各服务自己拼接的错误文本。 -本仓库是该模块的源码位置。Go 模块路径为 `error-code-system`。不依赖 Agent-Native、Agent-Squad 或任何第三方模块。 +本仓库是该模块的源码位置。Go 模块路径为 `git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git`。不依赖 Agent-Native、Agent-Squad 或任何第三方模块。 ## 分层 diff --git a/cli/cli.go b/cli/cli.go index d51b01b..643a767 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -9,8 +9,8 @@ import ( "os" "strings" - "error-code-system/errcode" - "error-code-system/server" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/server" ) // Main 执行命令行并返回进程退出码。 diff --git a/cli/cli_test.go b/cli/cli_test.go index b76696c..23eb44f 100644 --- a/cli/cli_test.go +++ b/cli/cli_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "error-code-system/domains" - "error-code-system/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/domains" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" ) func TestCLIListShowValidate(t *testing.T) { diff --git a/conformance/registry_test.go b/conformance/registry_test.go index 8c52871..12e85ff 100644 --- a/conformance/registry_test.go +++ b/conformance/registry_test.go @@ -3,8 +3,8 @@ package conformance import ( "testing" - "error-code-system/domains" - "error-code-system/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/domains" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" ) func TestSeedCatalog(t *testing.T) { diff --git a/domains/agent.go b/domains/agent.go index 69e74a4..5846340 100644 --- a/domains/agent.go +++ b/domains/agent.go @@ -1,6 +1,6 @@ package domains -import "error-code-system/errcode" +import "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" // registerAgent 对齐 agent-native contract.ErrorCode(12)与 pitransport 历史码(7)。 // 副作用与重试语义见 docs/agent-native-mapping.md。 diff --git a/domains/catalog_test.go b/domains/catalog_test.go index c97ac9f..ef83201 100644 --- a/domains/catalog_test.go +++ b/domains/catalog_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "error-code-system/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" ) func TestEmbeddedCatalogMatchesRegistry(t *testing.T) { diff --git a/domains/catalog_write_test.go b/domains/catalog_write_test.go index 1feb02b..05e3f11 100644 --- a/domains/catalog_write_test.go +++ b/domains/catalog_write_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "error-code-system/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" ) func TestWriteCatalog(t *testing.T) { diff --git a/domains/export.go b/domains/export.go index a89fff2..46921ca 100644 --- a/domains/export.go +++ b/domains/export.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "error-code-system/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" ) // ExportDomain 导出单个域的定义 JSON(字典序)。 diff --git a/domains/intent.go b/domains/intent.go index 82587eb..9e4c85c 100644 --- a/domains/intent.go +++ b/domains/intent.go @@ -1,6 +1,6 @@ package domains -import "error-code-system/errcode" +import "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" func registerIntent(r *errcode.Registry) { must(r, def(errcode.IntentInvalidSpec, 400, errcode.SeverityError, errcode.RetryNever, errcode.SideEffectNone, diff --git a/domains/register.go b/domains/register.go index df6977a..c540f63 100644 --- a/domains/register.go +++ b/domains/register.go @@ -4,7 +4,7 @@ // conformance 测试保证二者一致。导入本包会填充 errcode.Default。 package domains -import "error-code-system/errcode" +import "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" func init() { RegisterAll(errcode.Default) } diff --git a/domains/squad.go b/domains/squad.go index 6e3b326..b1174ed 100644 --- a/domains/squad.go +++ b/domains/squad.go @@ -1,6 +1,6 @@ package domains -import "error-code-system/errcode" +import "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" func registerSquad(r *errcode.Registry) { must(r, def(errcode.SquadRoleNotFound, 404, errcode.SeverityInfo, errcode.RetryNever, errcode.SideEffectNone, diff --git a/domains/sys.go b/domains/sys.go index 6ebe047..1192704 100644 --- a/domains/sys.go +++ b/domains/sys.go @@ -1,6 +1,6 @@ package domains -import "error-code-system/errcode" +import "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" func registerSys(r *errcode.Registry) { must(r, def(errcode.SysInternal, 500, errcode.SeverityError, errcode.RetryNever, errcode.SideEffectUnknown, diff --git a/go.mod b/go.mod index 1d0a418..255b43d 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module error-code-system +module git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git go 1.27 diff --git a/httpx/httpx.go b/httpx/httpx.go index 27ba48c..553f2f4 100644 --- a/httpx/httpx.go +++ b/httpx/httpx.go @@ -10,7 +10,7 @@ import ( "strings" "unicode" - "error-code-system/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" ) // TraceHeader 是跨系统传递追踪标识的请求/响应头。 diff --git a/httpx/httpx_test.go b/httpx/httpx_test.go index dc0cf59..e8ae650 100644 --- a/httpx/httpx_test.go +++ b/httpx/httpx_test.go @@ -7,8 +7,8 @@ import ( "net/http/httptest" "testing" - "error-code-system/domains" - "error-code-system/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/domains" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" ) func TestTraceGeneratesAndEchoes(t *testing.T) { diff --git a/main.go b/main.go index 6623276..100d05b 100644 --- a/main.go +++ b/main.go @@ -3,8 +3,8 @@ package main import ( "os" - "error-code-system/cli" - _ "error-code-system/domains" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/cli" + _ "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/domains" ) func main() { diff --git a/server/server.go b/server/server.go index 234af6b..2985919 100644 --- a/server/server.go +++ b/server/server.go @@ -6,8 +6,8 @@ import ( "net/http" "strings" - "error-code-system/errcode" - "error-code-system/httpx" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/httpx" ) // DefaultAddr 是 errcode-serve 的默认监听地址。 diff --git a/server/server_test.go b/server/server_test.go index 6ee6ceb..bd4ae90 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -8,9 +8,9 @@ import ( "strings" "testing" - "error-code-system/domains" - "error-code-system/errcode" - "error-code-system/httpx" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/domains" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/httpx" ) func testServer(t *testing.T) *httptest.Server {