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
This commit is contained in:
2026-10-13 15:06:48 +00:00
parent 9e99b52611
commit 28d2d50743
19 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -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。
+1 -1
View File
@@ -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 或任何第三方模块。
## 分层
+2 -2
View File
@@ -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 执行命令行并返回进程退出码。
+2 -2
View File
@@ -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) {
+2 -2
View File
@@ -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) {
+1 -1
View File
@@ -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。
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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(字典序)。
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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) }
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -1,3 +1,3 @@
module error-code-system
module git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git
go 1.27
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"strings"
"unicode"
"error-code-system/errcode"
"git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode"
)
// TraceHeader 是跨系统传递追踪标识的请求/响应头。
+2 -2
View File
@@ -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) {
+2 -2
View File
@@ -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() {
+2 -2
View File
@@ -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 的默认监听地址。
+3 -3
View File
@@ -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 {