Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 7 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
18 changes: 11 additions & 7 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -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-h7LKhQ3lCgBfkjryIT9MnOTWleMQrdrgOIxQOhxqzTVu",
},
},
},
}
54 changes: 35 additions & 19 deletions src/vsa.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -88,24 +99,26 @@ 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;
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.
Expand All @@ -124,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
Loading