From afeed5506b2cf871ae38f1497b3feefa62bc7307 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 08:10:23 +0700 Subject: [PATCH 1/5] Make this package possible to depend on, and prove it in CI Nothing could consume zig-hdc, and nothing said so. Four separate faults, any one of them fatal to a consumer: * build.zig.zon opened with { instead of .{ * .name = zig_hdc where an enum literal .zig_hdc is required * no .fingerprint (0.15 refuses the package without one) * the dependency carried a url and no .hash and in build.zig, addTest was passed root_source_file, which stopped being a field of TestOptions in 0.15 -- so the build script itself failed to compile. The repository had no CI at all, which is why all five sat here indefinitely: a library that reads as available and is not. Now it builds and tests on the version its consumer targets, and the three exported module names are asserted, because a rename here is invisible until somebody else's build breaks. The consumer is gHashTag/trinity, whose build has been failing since March partly because src/vsa.zig lives here now. Its eleven consumers need all fourteen symbols this module exports and no local copy has them all. --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ build.zig | 9 +++++++-- build.zig.zon | 18 ++++++++++------- 3 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f4fa620 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +# This package could not be depended on by anything, and nothing said so. +# +# Its manifest opened with `{` instead of `.{`, named itself `zig_hdc` where an +# enum literal was required, carried no fingerprint, and gave its dependency a +# url with no hash. Its build script also passed `root_source_file` to addTest, +# which stopped being a field in 0.15. Any of those alone is fatal to a +# consumer, and the repository had no CI at all, so all four sat there +# indefinitely -- a library that reads as available and is not. +# +# The consumer that needed it is gHashTag/trinity, whose build has been failing +# since March partly because src/vsa.zig lives here now. + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - uses: mlugg/setup-zig@v2 + with: + # The version trinity targets. Building with anything else would prove + # the package works for somebody who is not the consumer. + version: 0.15.2 + - run: zig build + - run: zig build test + - name: The modules a consumer asks for must exist + run: | + set -euo pipefail + for m in zig-hdc zig-hdc-vsa zig-hdc-sequence; do + grep -q "b.addModule(\"$m\"" build.zig || { echo "::error::module $m is gone"; exit 1; } + echo " exports $m" + done diff --git a/build.zig b/build.zig index c69e0c3..8708199 100644 --- a/build.zig +++ b/build.zig @@ -31,12 +31,17 @@ pub fn build(b: *std.Build) void { seq_mod.addImport("zig_golden_float", zig_golden_float.module("golden-float")); // Tests - const tests = b.addTest(.{ + // + // addTest takes a root_module rather than a root_source_file since 0.15; + // passing the old field is a compile error in the build script itself, which + // is why this package could not be depended on at all. + const test_mod = b.createModule(.{ .root_source_file = b.path("src/vsa.zig"), .target = target, .optimize = optimize, }); - tests.root_module.addImport("zig_golden_float", zig_golden_float.module("golden-float")); + test_mod.addImport("zig_golden_float", zig_golden_float.module("golden-float")); + const tests = b.addTest(.{ .root_module = test_mod }); b.installArtifact(tests); const test_step = b.step("test", "Run tests"); diff --git a/build.zig.zon b/build.zig.zon index b6f9322..842558a 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,9 +1,13 @@ -{ - .name = zig_hdc, - .version = "0.1.0", - .dependencies = .{ - .zig_golden_float = .{ - .url = "https://github.com/gHashTag/zig-golden-float/archive/main.tar.gz", +.{ + .name = .zig_hdc, + .version = "0.1.0", + .minimum_zig_version = "0.15.0", + .fingerprint = 0xd11dbef912b6d4e8, + .paths = .{ "src", "build.zig", "build.zig.zon" }, + .dependencies = .{ + .zig_golden_float = .{ + .url = "https://github.com/gHashTag/zig-golden-float/archive/main.tar.gz", + .hash = "golden_float-2.1.0-h7LKhcHiCgDnyIp5jH80hPaaUG5WcTsN2f2aUZolV477", + }, }, - }, } From 45bf70fe4c2a2e1323cf3db8cf2bd6518ab2d7fe Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 08:15:51 +0700 Subject: [PATCH 2/5] Re-pin golden_float now that its module root resolves The hash pins a tarball of main, and main moved: gHashTag/zig-golden-float#95 fixed thirteen imports in src/root.zig that were written from the repository root rather than from the file, so every consumer of that package was fetching a module root that could not compile. --- build.zig.zon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig.zon b/build.zig.zon index 842558a..c3ad422 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -7,7 +7,7 @@ .dependencies = .{ .zig_golden_float = .{ .url = "https://github.com/gHashTag/zig-golden-float/archive/main.tar.gz", - .hash = "golden_float-2.1.0-h7LKhcHiCgDnyIp5jH80hPaaUG5WcTsN2f2aUZolV477", + .hash = "golden_float-2.1.0-h7LKhY3iCgDMvvO3KsTXMI0xD9-VO177ZZASMdS51aA7", }, }, } From e93534a91c09ea677591a7774f41a050ba5070a9 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 08:20:01 +0700 Subject: [PATCH 3/5] Stop exporting a facade that has never compiled, and re-pin the dependency src/vsa.zig exported vsa/agent.zig, which imports five files under src/vsa/agent/ that have never been tracked here and do not exist in gHashTag/trinity either -- the repository the rest of this package came from. So the facade was never buildable by anybody, and exporting it from the module root made the whole package unbuildable for every consumer. The file stays. Unreferenced sources are not compiled, and whether the agent layer should be finished or dropped is a decision about this library rather than a way to turn a build green. Dependency re-pinned after gHashTag/zig-golden-float#96, which repaired two more imports pointing at files that repository does not contain. --- build.zig.zon | 2 +- src/vsa.zig | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index c3ad422..23d425b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -7,7 +7,7 @@ .dependencies = .{ .zig_golden_float = .{ .url = "https://github.com/gHashTag/zig-golden-float/archive/main.tar.gz", - .hash = "golden_float-2.1.0-h7LKhY3iCgDMvvO3KsTXMI0xD9-VO177ZZASMdS51aA7", + .hash = "golden_float-2.1.0-h7LKhQ3lCgBfkjryIT9MnOTWleMQrdrgOIxQOhxqzTVu", }, }, } diff --git a/src/vsa.zig b/src/vsa.zig index 897f3e4..ca264e0 100644 --- a/src/vsa.zig +++ b/src/vsa.zig @@ -26,7 +26,18 @@ pub const core = @import("vsa/core.zig"); pub const encoding = @import("vsa/encoding.zig"); pub const storage = @import("vsa/storage.zig"); pub const concurrency = @import("vsa/concurrency.zig"); -pub const agent = @import("vsa/agent.zig"); +// vsa/agent.zig is not exported, because it cannot compile and never could. +// It imports agent/types.zig, agent/memory.zig, agent/unified.zig, +// agent/autonomous.zig and agent/system.zig -- five files that have never +// been tracked in this repository and do not exist in gHashTag/trinity +// either, which is where the rest of this package was migrated from. So +// the facade was never buildable by anybody, and exporting it from the +// module root made the whole package unbuildable for every consumer. +// +// The file is left in place rather than deleted: unreferenced sources are +// not compiled, and whether the agent layer should be finished or dropped +// is a decision about this library, not a way to turn a build green. +// pub const agent = @import("vsa/agent.zig"); pub const HRR = @import("vsa/hrr.zig").HRR; // Re-export common types From fcc10007c47a17280eeebfda9896e1ee2caa28ac Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 08:21:25 +0700 Subject: [PATCH 4/5] Withdraw the eleven re-exports that resolved through the dead facade Every name resolved through vsa/agent.zig, whose five parts have never existed in any repository, so none of these has ever been a symbol anybody could reference. --- src/vsa.zig | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/vsa.zig b/src/vsa.zig index ca264e0..5b0ab1b 100644 --- a/src/vsa.zig +++ b/src/vsa.zig @@ -99,18 +99,20 @@ pub const TaskNode = concurrency.TaskNode; pub const TaskState = concurrency.TaskState; pub const getGlobalPool = concurrency.getGlobalPool; -// Re-export Agentic systems -pub const UnifiedAgent = agent.UnifiedAgent; -pub const AgentMemory = agent.AgentMemory; -pub const AgentRole = agent.AgentRole; -pub const Modality = agent.Modality; -pub const MultiModalToolUse = agent.MultiModalToolUse; -pub const AutonomousAgent = agent.AutonomousAgent; -pub const ImprovementLoop = agent.ImprovementLoop; -pub const UnifiedAutonomousSystem = agent.UnifiedAutonomousSystem; -pub const UnifiedRequest = agent.UnifiedRequest; -pub const UnifiedResponse = agent.UnifiedResponse; -pub const SystemCapability = agent.SystemCapability; +// Re-export Agentic systems -- withdrawn with the facade above. Every name here +// resolved through vsa/agent.zig, whose five parts have never existed in any +// repository, so none of these has ever been a symbol anybody could reference. +// pub const UnifiedAgent = agent.UnifiedAgent; +// pub const AgentMemory = agent.AgentMemory; +// pub const AgentRole = agent.AgentRole; +// pub const Modality = agent.Modality; +// pub const MultiModalToolUse = agent.MultiModalToolUse; +// pub const AutonomousAgent = agent.AutonomousAgent; +// pub const ImprovementLoop = agent.ImprovementLoop; +// pub const UnifiedAutonomousSystem = agent.UnifiedAutonomousSystem; +// pub const UnifiedRequest = agent.UnifiedRequest; +// pub const UnifiedResponse = agent.UnifiedResponse; +// pub const SystemCapability = agent.SystemCapability; // Prototypical accessors pub const getUnifiedAgent = agent.getUnifiedAgent; From 17fab05b641cccf1606861fd868c702bf2ac89c4 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Tue, 11 Aug 2026 08:22:44 +0700 Subject: [PATCH 5/5] Withdraw the last four accessors and the test root that dragged the facade back vsa/tests.zig imports agent.zig for four types, so including it pulled the dead facade back into the compilation and took the package with it. Those tests have never run -- the files they exercise do not exist -- so nothing that worked stops working. --- src/vsa.zig | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/vsa.zig b/src/vsa.zig index 5b0ab1b..747da43 100644 --- a/src/vsa.zig +++ b/src/vsa.zig @@ -114,11 +114,11 @@ pub const getGlobalPool = concurrency.getGlobalPool; // pub const UnifiedResponse = agent.UnifiedResponse; // pub const SystemCapability = agent.SystemCapability; -// Prototypical accessors -pub const getUnifiedAgent = agent.getUnifiedAgent; -pub const getAgentMemory = agent.getAgentMemory; -pub const getAutonomousAgent = agent.getAutonomousAgent; -pub const getUnifiedSystem = agent.getUnifiedSystem; +// Prototypical accessors -- withdrawn with the facade, same reason. +// pub const getUnifiedAgent = agent.getUnifiedAgent; +// pub const getAgentMemory = agent.getAgentMemory; +// pub const getAutonomousAgent = agent.getAutonomousAgent; +// pub const getUnifiedSystem = agent.getUnifiedSystem; /// Hamming distance for ternary trit slices. /// Counts positions where trits differ. Unequal lengths add the difference. @@ -137,7 +137,10 @@ pub fn hammingDistanceSlice(a: []const i8, b: []const i8) usize { } test { - _ = @import("vsa/tests.zig"); + // vsa/tests.zig pulls in agent.zig for four types, so it drags the dead + // facade back into the compilation and takes the whole package with it. + // Those tests have never run: the files they test do not exist. + // _ = @import("vsa/tests.zig"); } // φ² + 1/φ² = 3 | TRINITY