diff --git a/AGENTS.md b/AGENTS.md index be16c02..e5b0656 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,24 +11,20 @@ Studio's job, not Huginn's. - Project root: `F:\Projects\Huginn` - Upstream: `https://github.com/GameCult/Huginn.git` -- Body: a Rust workspace of `eureka-pipeline`, `huginn-mind`, `huginn-daemon`, - and `eureka-state` under `crates/`. Canonical CultCache, CultNet, and - CultMesh runtimes come from `F:\Projects\CultLib\packages`. - `eureka-pipeline` is the pipeline leaf: document shapes, bounds, formats, - keys and the schemas published under `schemas/cultnet`. `huginn-mind` is - live: it persists, admits and reads back an instance's mind, queries and - derived status included, over `cultcache-rs` and `eureka-pipeline`. - `huginn-daemon` serves one mind over CultNet RUDP through `cultnet-rs`, and reaches the leaf and the store type through `huginn-mind` - so the workspace's one CultLib revision (root `[workspace.dependencies]`) decides both. `eureka-state` is the client core: one call - to a daemon over CultNet, holding no state; its `huginn` binary is the CLI agents reach the mind through, and it holds no state either. +- Body: a Rust workspace of `huginn-mind`, `huginn-daemon`, and + `eureka-state` under `crates/`. Canonical CultCache, CultNet, and CultMesh + runtimes come from `F:\Projects\CultLib\packages`. `huginn-mind` is live: + it persists, admits and reads back an instance's mind, queries and derived + status included, over `cultcache-rs` and `epiphany-pipeline` pinned by git + rev. `huginn-daemon` serves one mind over CultNet RUDP through `cultnet-rs` + at the same rev, and reaches the leaf and the store type through + `huginn-mind` so one crate pins each revision. `eureka-state` is a stub. - Owned: an instance's memory documents, their admission and the read side that derives their status, in `huginn-mind`, over a redb CultCache store at `/minds//mind.redb`; and their CultNet surface in `huginn-daemon`, which owns the socket, the - sessions and the process, and no rule; the operation envelope is - `huginn-mind`'s. The two wire - schemas are published from `schemas/cultnet/` and listed, with the - pipeline schemas, in its `index.json`. + sessions, the process and the operation envelope, and no rule. The two wire + schemas are published from `schemas/cultnet/`. There is no index yet. - To depend on: Qdrant, directly, once retrieval exists. Unreachable Qdrant is to be a loud refusal, never a fallback store. No crate connects to it yet. - Forbidden: a second writer of mind state; mind state in version control; @@ -38,8 +34,7 @@ Studio's job, not Huginn's. - Prefer CultLib's typed Rust APIs over ad hoc decoding. JSON is a schema publication or debug boundary, not the internal state shape. -- The campaign's cut specs in the mind (`eureka-body`, read through - `eureka-state`) and `docs/eureka-body-map.md` own +- The Eureka cut map in `Epiphany/notes/eureka-pipeline-state-cut.md` owns what each crate does next. Read the cut before the crate. - Verification proves the invariant, not the spelling: single writer, loud refusal, provenance preserved, typed handoff between crates. diff --git a/Cargo.lock b/Cargo.lock index 45d9d79..3ecdc74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,46 +37,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.17", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "getrandom 0.3.4", - "once_cell", - "serde", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "android_system_properties" version = "0.1.6" @@ -86,82 +46,12 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" - -[[package]] -name = "anstyle-parse" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys 0.61.2", -] - [[package]] name = "anyhow" version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" -[[package]] -name = "ar_archive_writer" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cd58deff2140a0a8eae87e417bd01db68a33e148aa93d1e8cd837e55e312b6" -dependencies = [ - "object", -] - -[[package]] -name = "async-trait" -version = "0.1.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.5", -] - [[package]] name = "autocfg" version = "1.5.1" @@ -180,27 +70,6 @@ version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.13.2" @@ -216,24 +85,12 @@ dependencies = [ "generic-array", ] -[[package]] -name = "borrow-or-share" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0b364ead1874514c8c2855ab558056ebfeb775653e7ae45ff72f28f8f3166c" - [[package]] name = "bumpalo" version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" -[[package]] -name = "bytecount" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" - [[package]] name = "bytes" version = "1.12.1" @@ -280,52 +137,6 @@ dependencies = [ "inout", ] -[[package]] -name = "clap" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 3.0.5", -] - -[[package]] -name = "clap_lex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" - -[[package]] -name = "colorchoice" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" - [[package]] name = "const-oid" version = "0.9.6" @@ -370,11 +181,11 @@ dependencies = [ [[package]] name = "cultcache-rs" version = "0.2.0" -source = "git+https://github.com/GameCult/CultLib.git?rev=8fc74c709444b884a2bd339e0c306bf9484d99d2#8fc74c709444b884a2bd339e0c306bf9484d99d2" +source = "git+https://github.com/GameCult/CultLib.git?rev=6251cbcd37c12ef3f0c1cc50063a03369225b7ac#6251cbcd37c12ef3f0c1cc50063a03369225b7ac" dependencies = [ "anyhow", "chrono", - "cultcache-rs-derive 0.1.0", + "cultcache-rs-derive", "fs2", "redb", "rmp-serde", @@ -385,40 +196,10 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "cultcache-rs" -version = "0.3.1" -source = "git+https://github.com/GameCult/CultLib.git?rev=a4eae9056152335662f1115f97bf35fb00ab6d23#a4eae9056152335662f1115f97bf35fb00ab6d23" -dependencies = [ - "anyhow", - "chrono", - "cultcache-rs-derive 0.2.0", - "fs2", - "redb", - "rmp-serde", - "serde", - "serde_bytes", - "serde_json", - "serde_stacker", - "stacker", - "uuid", - "windows-sys 0.59.0", -] - [[package]] name = "cultcache-rs-derive" version = "0.1.0" -source = "git+https://github.com/GameCult/CultLib.git?rev=8fc74c709444b884a2bd339e0c306bf9484d99d2#8fc74c709444b884a2bd339e0c306bf9484d99d2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "cultcache-rs-derive" -version = "0.2.0" -source = "git+https://github.com/GameCult/CultLib.git?rev=a4eae9056152335662f1115f97bf35fb00ab6d23#a4eae9056152335662f1115f97bf35fb00ab6d23" +source = "git+https://github.com/GameCult/CultLib.git?rev=6251cbcd37c12ef3f0c1cc50063a03369225b7ac#6251cbcd37c12ef3f0c1cc50063a03369225b7ac" dependencies = [ "proc-macro2", "quote", @@ -428,39 +209,13 @@ dependencies = [ [[package]] name = "cultnet-rs" version = "0.1.0" -source = "git+https://github.com/GameCult/CultLib.git?rev=8fc74c709444b884a2bd339e0c306bf9484d99d2#8fc74c709444b884a2bd339e0c306bf9484d99d2" +source = "git+https://github.com/GameCult/CultLib.git?rev=6251cbcd37c12ef3f0c1cc50063a03369225b7ac#6251cbcd37c12ef3f0c1cc50063a03369225b7ac" dependencies = [ "aes-gcm", "anyhow", "base64", "chrono", - "cultcache-rs 0.2.0", - "ed25519-dalek", - "hmac", - "rand", - "reed-solomon-erasure", - "rmp-serde", - "rmpv", - "serde", - "serde_bytes", - "serde_json", - "sha2", - "socket2", - "uuid", - "windows-sys 0.61.2", - "zeroize", -] - -[[package]] -name = "cultnet-rs" -version = "0.2.0" -source = "git+https://github.com/GameCult/CultLib.git?rev=a4eae9056152335662f1115f97bf35fb00ab6d23#a4eae9056152335662f1115f97bf35fb00ab6d23" -dependencies = [ - "aes-gcm", - "anyhow", - "base64", - "chrono", - "cultcache-rs 0.3.1", + "cultcache-rs", "ed25519-dalek", "hmac", "rand", @@ -503,46 +258,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.119", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "data-encoding" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" - [[package]] name = "der" version = "0.7.10" @@ -595,20 +310,18 @@ dependencies = [ ] [[package]] -name = "email_address" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e079f19b08ca6239f47f8ba8509c11cf3ea30095831f7fed61441475edd8c449" +name = "epiphany-pipeline" +version = "0.1.0" +source = "git+https://github.com/GameCult/Epiphany.git?rev=4891f2e59008efeb262197564eddaa75bc3c75ea#4891f2e59008efeb262197564eddaa75bc3c75ea" dependencies = [ + "anyhow", + "chrono", + "cultcache-rs", + "rmp-serde", + "schemars", "serde", ] -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - [[package]] name = "errno" version = "0.3.14" @@ -619,48 +332,9 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "eureka-pipeline" -version = "0.1.0" -dependencies = [ - "anyhow", - "chrono", - "cultcache-rs 0.2.0", - "rmp-serde", - "schemars", - "serde", - "serde_json", -] - [[package]] name = "eureka-state" version = "0.1.0" -dependencies = [ - "anyhow", - "chrono", - "clap", - "cultnet-rs 0.1.0", - "huginn-daemon", - "huginn-mind", - "rmcp", - "rmp-serde", - "schemars", - "serde", - "serde_json", - "tempfile", - "tokio", -] - -[[package]] -name = "fancy-regex" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d301f5bf187b3c295fce6468d3875037a0bccc5f6b151c63cac2f85babf21912" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] [[package]] name = "fastrand" @@ -680,33 +354,6 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d" -[[package]] -name = "fluent-uri" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc74ac4d8359ae70623506d512209619e5cf8f347124910440dbc221714b328e" -dependencies = [ - "borrow-or-share", - "ref-cast", - "serde", -] - -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - -[[package]] -name = "fraction" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e246562084dde8ebbcc943b261c406ce4f68e5032ec28029a251a47d6a295500" -dependencies = [ - "num", - "num-bigint", -] - [[package]] name = "fs2" version = "0.4.3" @@ -717,71 +364,12 @@ dependencies = [ "winapi", ] -[[package]] -name = "futures" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" -dependencies = [ - "futures-core", - "futures-sink", -] - [[package]] name = "futures-core" version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" -[[package]] -name = "futures-executor" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" - -[[package]] -name = "futures-macro" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.5", -] - -[[package]] -name = "futures-sink" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" - [[package]] name = "futures-task" version = "0.3.34" @@ -794,13 +382,8 @@ version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ - "futures-channel", "futures-core", - "futures-io", - "futures-macro", - "futures-sink", "futures-task", - "memchr", "pin-project-lite", "slab", ] @@ -833,11 +416,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", - "js-sys", "libc", "r-efi 5.3.0", "wasip2", - "wasm-bindgen", ] [[package]] @@ -861,32 +442,6 @@ dependencies = [ "polyval", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] - -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "hmac" version = "0.12.1" @@ -919,9 +474,10 @@ dependencies = [ "anyhow", "base64", "chrono", - "cultnet-rs 0.1.0", + "cultnet-rs", "huginn-mind", "rmp-serde", + "schemars", "serde", "serde_json", "sha2", @@ -935,17 +491,14 @@ name = "huginn-mind" version = "0.1.0" dependencies = [ "anyhow", - "base64", "chrono", - "cultcache-rs 0.2.0", - "cultnet-rs 0.1.0", - "eureka-pipeline", - "jsonschema", + "cultcache-rs", + "cultnet-rs", + "epiphany-pipeline", "rmp-serde", "schemars", "serde", "serde_json", - "serde_path_to_error", "sha2", "tempfile", ] @@ -974,12 +527,6 @@ dependencies = [ "cc", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "inout" version = "0.1.4" @@ -989,21 +536,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" - [[package]] name = "itoa" version = "1.0.18" @@ -1021,227 +553,30 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonschema" -version = "0.58.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f622c574a29fb3034a0a90645afee194dfedc75fc124228801b6e77041075bd1" -dependencies = [ - "ahash 0.8.12", - "bytecount", - "data-encoding", - "email_address", - "fancy-regex", - "fraction", - "getrandom 0.3.4", - "itoa", - "jsonschema-regex", - "jsonschema-value", - "num-cmp", - "num-traits", - "percent-encoding", - "referencing", - "regex", - "serde", - "serde_json", - "strum", - "unicode-general-category", - "uuid-simd", -] - -[[package]] -name = "jsonschema-regex" -version = "0.58.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a968fffd387b2ab005bf00c1851f5d26e90df05b6f7ad609ed0d620033cca5e7" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "jsonschema-value" -version = "0.58.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39b7670345e5ce87371339d13705dbb9276b7e3e934bbe1efa2c6734a1f65a96" -dependencies = [ - "ahash 0.8.12", - "bytecount", - "fraction", - "getrandom 0.3.4", - "num-cmp", - "num-traits", - "serde_json", - "zmij", -] - [[package]] name = "libc" version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" -[[package]] -name = "libm" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" - [[package]] name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - [[package]] name = "log" version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" -[[package]] -name = "lru" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" -dependencies = [ - "hashbrown 0.12.3", -] - [[package]] name = "memchr" version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" -[[package]] -name = "micromap" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a86d3146ed3995b5913c414f6664344b9617457320782e64f0bb44afd49d74" - -[[package]] -name = "mind-body" -version = "0.1.0" -dependencies = [ - "anyhow", - "chrono", - "cultcache-rs 0.2.0", - "cultnet-rs 0.1.0", - "eureka-pipeline", - "eureka-state", - "huginn-mind", - "libc", - "model-connector", - "proc-macro2", - "quote", - "rmp-serde", - "rustix", - "serde", - "serde_json", - "sha2", - "syn 2.0.119", - "tempfile", - "uuid", -] - -[[package]] -name = "model-connector" -version = "0.1.0" -source = "git+https://eureka.gamecult.org/forge/GameCult/ModelConnector.git?rev=c1802d85bee3ae04b0c5737563c8343c1fef515d#c1802d85bee3ae04b0c5737563c8343c1fef515d" -dependencies = [ - "aes-gcm", - "base64", - "cultnet-rs 0.2.0", - "rand_core 0.6.4", - "rmp-serde", - "rmpv", - "schemars", - "serde", - "serde_bytes", - "serde_json", - "sha2", - "thiserror", - "zeroize", -] - -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-cmp" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1251,93 +586,18 @@ dependencies = [ "autocfg", ] -[[package]] -name = "object" -version = "0.39.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" -[[package]] -name = "once_cell_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" - [[package]] name = "opaque-debug" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "outref" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" - -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core 0.9.12", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.18", - "smallvec", - "windows-link", -] - -[[package]] -name = "pastey" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" - [[package]] name = "percent-encoding" version = "2.3.2" @@ -1390,16 +650,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "psm" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd034599e63b970727f70d79e02d62390a4a84f7c6b827c27c46d5ac3fa622" -dependencies = [ - "ar_archive_writer", - "cc", -] - [[package]] name = "quote" version = "1.0.47" @@ -1468,37 +718,6 @@ dependencies = [ "libc", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags 2.13.2", -] - -[[package]] -name = "reed-solomon-erasure" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7263373d500d4d4f505d43a2a662d475a894aa94503a1ee28e9188b5f3960d4f" -dependencies = [ - "libm", - "lru", - "parking_lot 0.11.2", - "smallvec", - "spin", -] - [[package]] name = "ref-cast" version = "1.0.27" @@ -1519,86 +738,6 @@ dependencies = [ "syn 3.0.5", ] -[[package]] -name = "referencing" -version = "0.58.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558f3855529c0a7e78a48e409fa653456e55f1b167eab4109c16a255b7727e3f" -dependencies = [ - "ahash 0.8.12", - "fluent-uri", - "getrandom 0.3.4", - "hashbrown 0.17.1", - "itoa", - "micromap", - "parking_lot 0.12.5", - "percent-encoding", - "serde_json", -] - -[[package]] -name = "regex" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" - -[[package]] -name = "rmcp" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14db48ee17a9ba61810ab1a9c1beb7d06d8136ae39ac25a1137f10d357af01af" -dependencies = [ - "async-trait", - "chrono", - "futures", - "pastey", - "pin-project-lite", - "rmcp-macros", - "schemars", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "rmcp-macros" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "783d787bf21813b285f13019adc49e11af501c658890c1e519f31f937c68b7e3" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.119", -] - [[package]] name = "rmp" version = "0.8.15" @@ -1644,7 +783,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.13.2", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -1663,7 +802,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" dependencies = [ - "chrono", "dyn-clone", "ref-cast", "schemars_derive", @@ -1683,12 +821,6 @@ dependencies = [ "syn 3.0.5", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "semver" version = "1.0.28" @@ -1759,34 +891,6 @@ dependencies = [ "zmij", ] -[[package]] -name = "serde_path_to_error" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" -dependencies = [ - "itoa", - "serde", - "serde_core", -] - -[[package]] -name = "serde_stacker" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4936375d50c4be7eff22293a9344f8e46f323ed2b3c243e52f89138d9bb0f4a" -dependencies = [ - "serde", - "serde_core", - "stacker", -] - -[[package]] -name = "sha1_smol" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" - [[package]] name = "sha2" version = "0.10.9" @@ -1839,12 +943,6 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" -[[package]] -name = "smallvec" -version = "1.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e" - [[package]] name = "socket2" version = "0.5.10" @@ -1855,12 +953,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" - [[package]] name = "spki" version = "0.7.3" @@ -1871,46 +963,6 @@ dependencies = [ "der", ] -[[package]] -name = "stacker" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707f49d46706bacf8a2b00d51dace3f9de527c13eec3778f570c411f89e69967" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "windows-sys 0.61.2", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "subtle" version = "2.6.1" @@ -1952,105 +1004,12 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "thiserror" -version = "2.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.5", -] - -[[package]] -name = "tokio" -version = "1.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" -dependencies = [ - "bytes", - "pin-project-lite", - "tokio-macros", -] - -[[package]] -name = "tokio-macros" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.5", -] - -[[package]] -name = "tokio-util" -version = "0.7.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "libc", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tracing" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "tracing-core" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -dependencies = [ - "once_cell", -] - [[package]] name = "typenum" version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" -[[package]] -name = "unicode-general-category" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f" - [[package]] name = "unicode-ident" version = "1.0.24" @@ -2098,12 +1057,6 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - [[package]] name = "uuid" version = "1.26.1" @@ -2112,32 +1065,15 @@ checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce" dependencies = [ "getrandom 0.4.3", "js-sys", - "sha1_smol", "wasm-bindgen", ] -[[package]] -name = "uuid-simd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b082222b4f6619906941c17eb2297fff4c2fb96cb60164170522942a200bd8" -dependencies = [ - "outref", - "vsimd", -] - [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "vsimd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" - [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index 58edea6..9522717 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,20 +1,12 @@ [workspace] members = [ - "crates/eureka-pipeline", "crates/huginn-mind", "crates/huginn-daemon", "crates/eureka-state", - "crates/mind-body", ] resolver = "3" [workspace.package] edition = "2024" -license = "AGPL-3.0-only" +license = "MIT" publish = false - -# The one CultLib revision the workspace speaks. Every crate inherits these -# entries; a bump is a change to this table and nowhere else. -[workspace.dependencies] -cultcache-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "8fc74c709444b884a2bd339e0c306bf9484d99d2", package = "cultcache-rs" } -cultnet-rs = { git = "https://github.com/GameCult/CultLib.git", rev = "8fc74c709444b884a2bd339e0c306bf9484d99d2", package = "cultnet-rs" } diff --git a/LICENSE b/LICENSE deleted file mode 100644 index be3f7b2..0000000 --- a/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/README.md b/README.md index 9fea14c..695c5ff 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ steer its next action, and the provenance of every admitted claim. Upstream: `https://github.com/GameCult/Huginn.git` -**Status.** Live: `huginn-mind` (admission with receipts, typed queries, derived status), `huginn-daemon` (CultNet RUDP with a Qdrant semantic index), and the `huginn` CLI from `crates/eureka-state` (whoami, view, query, admit, schema). The `eureka` instance runs on Yggdrasil. Entry points: `cargo check --workspace`, `crates/huginn-mind/src/admission.rs`, `crates/huginn-daemon/src/serve.rs`, `schemas/cultnet/`. Planned: what each crate does next is owned by the `eureka-body` cut specs in the mind and `docs/eureka-body-map.md`; the legacy `.voidbot/` Persona migration belongs to the portable-Persona work. - ## Authority - An instance owns its mind; Huginn owns the state. Huginn is the single @@ -26,14 +24,8 @@ Upstream: `https://github.com/GameCult/Huginn.git` restart compares the mind with the collection and writes what is missing. An unreachable Qdrant or Ollama shows in `whoami` as the index's status and is retried; admission never waits on it. The daemon requires `--qdrant-url`, - `--ollama-url` and `--embedding-model`; `--ollama-url` repeats for each GPU - host and `--reserve-ollama-url` for each CPU host, and the GPU hosts embed - together while the CPU hosts serve only when none can. A `query` carrying `semantic` is - answered through the same selection as any other: the index supplies - candidate ids and scores, and the mind keeps only the documents it holds and - the selection admits (ask for `in_force` to exclude resolved ones), ordered by - score. It takes no cursor, and it is refused `Unavailable` while the index is - failing or refused. + `--ollama-url` and `--embedding-model`. The semantic read side is not wired + yet. - Mind state is not version-controlled. It lives in Huginn's store, not in any repository. @@ -42,17 +34,14 @@ edits `.cc` state. Huginn reads and writes minds. ## Layout -A Cargo workspace of five crates (`crates/eureka-pipeline` holds the document shapes and keys, `crates/mind-body` the control store, launch primitive and `mind-heartbeat` timeline; the three below are the mind, the daemon and the client): +A Cargo workspace of three crates: - `crates/huginn-mind`: storage, identity, admission, and queries and derived status over memory documents. -- `crates/huginn-daemon`: the CultNet surface. The socket, the sessions and - the process, and no rule. The operation envelope both sides speak is - `huginn-mind`'s. -- `crates/eureka-state`: the client core, `HuginnClient::call`: one request to a - daemon over CultNet RUDP, a deferred answer resolved, and no state. Its - `huginn` binary is the agents' CLI: whoami, view, query and named recipes, - admit with read-back, schema. +- `crates/huginn-daemon`: the CultNet surface. The socket, the sessions, the + process and the operation envelope, and no rule. +- `crates/eureka-state`: a stub. It will carry typed state for the Eureka + pipeline; today it holds none. `huginn-mind` is live: it opens one instance's store (an owned redb CultCache at `/minds//mind.redb`, locked for the mind's lifetime), @@ -67,7 +56,7 @@ It reads them back the same way: a document with the facts of its admission joined from that receipt and its status derived at read time, and typed queries over one mind. Status is never stored, and the views derive it through the same rules admission does. Document shape and keys come from -`eureka-pipeline` (`crates/eureka-pipeline`); the store is CultLib's Rust CultCache. +`epiphany-pipeline`; the store is CultLib's Rust CultCache. `huginn-daemon` opens one mind, binds one UDP socket in that order, and answers every frame on the session it arrived on: one operation per `Mind` @@ -75,21 +64,18 @@ method plus `whoami`, whose payload is the mind's own types as named MessagePack. A refusal is an answer with a `rejected` status, never a transport error; an envelope that does not decode is answered with a typed failure and reaches no mind. The two schemas it publishes live in -`schemas/cultnet/`, listed in its `index.json`, and are pinned to their -derivation by a test. +`schemas/cultnet/` and are pinned to their derivation by a test. There is no +index yet. -The campaign's cut specs in the mind (`eureka-body`) and -`docs/eureka-body-map.md` own what each crate does next. +`eureka-state` is a stub; the campaign's cut map in +`Epiphany/notes/eureka-pipeline-state-cut.md` owns what each crate must do +next. ```powershell cargo check --workspace -cargo run -p huginn-daemon -- --state-root --instance --bind 127.0.0.1:17872 ` - --qdrant-url http://127.0.0.1:6333 --ollama-url http://10.77.0.4:11434 --embedding-model qwen3-embedding:0.6b +cargo run -p huginn-daemon -- --state-root --instance --bind 127.0.0.1:17872 ``` -The deployed daemon (instance `eureka` on Yggdrasil) is installed and run by -`gamecult-ops/runbooks/huginn-yggdrasil.md`. - ## Persona Huginn's legacy repo Persona lives under `.voidbot/`. Its `state/huginn.cc` diff --git a/crates/eureka-pipeline/Cargo.toml b/crates/eureka-pipeline/Cargo.toml deleted file mode 100644 index 73d983c..0000000 --- a/crates/eureka-pipeline/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "eureka-pipeline" -version = "0.1.0" -edition.workspace = true -license.workspace = true -publish = false -autobins = false - -# Provenance: this crate was copied once from GameCult/Epiphany at ef956865, -# where it was licensed PolyForm Noncommercial. Its sole copyright holder -# relicensed it AGPL-3.0-only on 2026-10-09, as the rest of the workspace is -# (ruling eureka-body:ruling:leaf-relicensed-agpl). - -[lib] -name = "eureka_pipeline" -path = "src/lib.rs" - -# A leaf type library. Every dependency here is one the document types or the -# write path need in a non-test build: the organ prepares, decodes and -# validates envelopes through this crate, so `anyhow` (the cache's error type) -# and `rmp-serde` (the payload decode) are normal dependencies. Only the -# schema-publication check needs JSON. -[dependencies] -anyhow = "1" -chrono = "0.4.44" -cultcache-rs.workspace = true -rmp-serde = "1" -schemars = "1" -serde = { version = "1", features = ["derive"] } - -[dev-dependencies] -serde_json = "1" diff --git a/crates/eureka-pipeline/README.md b/crates/eureka-pipeline/README.md deleted file mode 100644 index 25fa726..0000000 --- a/crates/eureka-pipeline/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# eureka-pipeline - -The pipeline leaf: typed documents, bounds, keys and the cultcache wrappers -that define the mind's wire. Library only. - -## Provenance and license - -Copied once from GameCult/Epiphany at `ef956865`, where it was licensed -PolyForm Noncommercial. Its sole copyright holder relicensed it AGPL-3.0-only -on 2026-10-09; the root `LICENSE` is the AGPL-3.0 text and covers this crate -like the rest of the workspace. - -## Wire parity checks - -Committed (runs in `cargo test -p eureka-pipeline`): `encoded_envelopes_match_the_committed_golden` -asserts key, cultcache type id, schema name and payload bytes of every kind -and every encoding-relevant variant against `golden/envelopes.txt`. A diff -there is a wire change; do not regenerate it to make the test pass. An additive -field adds golden lines and never changes an existing one. - -The real-store gate is huginn-mind's `#[ignore]` `query::tests::stored_documents_read_back`, -which checks these stored bytes and the read path together (the leaf cannot see the read -path); the Huginn Upgrade runbook in gamecult-ops runs it. diff --git a/crates/eureka-pipeline/golden/envelopes.txt b/crates/eureka-pipeline/golden/envelopes.txt deleted file mode 100644 index db205d5..0000000 --- a/crates/eureka-pipeline/golden/envelopes.txt +++ /dev/null @@ -1,49 +0,0 @@ -# Golden encoded envelopes of the pipeline leaf. One line per document: -# label key type-id schema-name payload-hex (payload is the cultcache MessagePack payload) -# Provenance: the payload lines were dumped once by `golden_dump` from this -# crate at huginn 44be4cd. 87b6455 differs from 44be4cd only in test code -# (cfg(test) items; no encoding path). They match the encoder of Epiphany -# ef956865 byte for byte after one substitution: the sample source-path string -# was renamed in four kinds (cut_spec, cut_report, finding, follow_up), where it -# sits in a CodeLocation path. Soul proved the encoding byte-identical to the -# live mind store (eureka-body:verdict:cut-leaf-into-huginn.s1) and to -# Epiphany ef956865 modulo that rename (verdict ...s2). Never regenerate to make -# a failing test pass: a diff here is a wire change and needs its own ruling. -# cut_spec.reads-and-symbol and finding.location-symbol were appended after 44c010c added CodeLocation.symbol and PipelineCutSpec.reads (ruling context-pack-read-anchors); no earlier line changed. -# target.repos was appended after 9298371 added PipelineTarget.repos (ruling campaign-repo-set-home); no earlier line changed. -sample.campaign eureka-state:campaign:self epiphany.pipeline.campaign.v2 EpiphanyPipelineCampaignDocument 9185a4736c7567ac657572656b612d7374617465a57469746c65b5457572656b6120706970656c696e65207374617465a57265706f7391b147616d6543756c742f4570697068616e79ae776f726b696e675f6272616e6368bb636f6465782f657572656b612d706970656c696e652d7374617465aa7461726765745f646f6384a470617468d9256e6f7465732f657572656b612d706970656c696e652d73746174652d7461726765742e6d64aa73746172745f6c696e6501a8656e645f6c696e6509a6636f6d6d6974a83566393832323864 -sample.target eureka-state:target:r2 epiphany.pipeline.target.v2 EpiphanyPipelineTargetDocument 9186a863616d706169676eac657572656b612d7374617465a87265766973696f6e02aa696e76617269616e74739182a56c6162656cab6d696e642d61646d697473a973746174656d656e74b64f6e6c792061646d697373696f6e207772697465732eac6e6f745f696e5f73636f706591ac4576652062726f7773696e67b963616e6f6e6963616c5f696d706c656d656e746174696f6e7391a743756c744c6962a3646f6384a470617468d9256e6f7465732f657572656b612d706970656c696e652d73746174652d7461726765742e6d64aa73746172745f6c696e6501a8656e645f6c696e6509a6636f6d6d6974a83566393832323864 -sample.question eureka-state:question:Q1 epiphany.pipeline.question.v2 EpiphanyPipelineQuestionDocument 9189a863616d706169676eac657572656b612d7374617465a56c6162656ca25131a57469746c65b357686f206f776e73207468652073746174653fa87175657374696f6eb357686f206f776e73207468652073746174653fa76f7074696f6e739282a56c6162656ca141a474657874ab616e20696e7374616e636582a56c6162656ca142a474657874a661207265706fab7265636f6d6d656e646564a141a7646570656e647391a6437574203361a97261697365645f696e82a46b696e64a743757453706563a26964bf657572656b612d73746174653a6375745f737065633a6375742d33612e7231a861736b65645f6f6eaa323032362d30392d3135 -sample.ruling eureka-state:ruling:R8 epiphany.pipeline.ruling.v2 EpiphanyPipelineRulingDocument 918aa863616d706169676eac657572656b612d7374617465a56c6162656ca25238a57469746c65b9416e20696e7374616e6365206f776e7320697473206d696e64a7616e7377657273b8657572656b612d73746174653a7175657374696f6e3a5131a663686f696365a141a672756c696e67ba416e20696e7374616e6365206f776e7320697473206d696e642eae6f70657261746f725f71756f7465bd616c6c207265636f6d6d656e646174696f6e732c20676f206168656164a872756c65645f6f6eaa323032362d30392d3135aa707265636564656e74739185a47265706fb147616d6543756c742f4165746865726961a6636f6d6d6974d92861616161616161616161616161616161616161616161616161616161616161616161616161616161a46b696e64a652756c696e67a26964b363756c7463616368653a72756c696e673a5231ae7061796c6f61645f736861323536d94062626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262a9617574686f72697479a84f70657261746f72 -sample.cut_spec eureka-state:cut_spec:cut-3a.r1 epiphany.pipeline.cut_spec.v2 EpiphanyPipelineCutSpecDocument 91de0012a863616d706169676eac657572656b612d7374617465a3637574a23361a87265766973696f6e01a57469746c65b2506970656c696e6520646f63756d656e7473a47265706fb147616d6543756c742f4570697068616e79a66272616e6368bb636f6465782f657572656b612d706970656c696e652d7374617465a462617365a83566393832323864aa646570656e64735f6f6e91a132a5666972737491ae526561642074686520737065632ea764656c657465739183a470617468a66f6c642e7273a56c696e657303a46e6f7465a464656164ab6b656570735f6d6f76657391ac636f6d6d6974206f776e6572a46164647391b5706970656c696e655f646f63756d656e74732e7273ac66696c655f6368616e6765739182a86c6f636174696f6e83a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509a66368616e6765a3616464ad617574686f726974795f6d617087a56f776e6572a4636f7265a6696e7075747391af747970656420646f63756d656e7473a76f75747075747391a9656e76656c6f706573ad646572697665645f737461746591ac64657269766564206b657973b1666f7262696464656e5f7772697465727391a34d4350ac7368617265645f706174687391a961646d697373696f6ead64656c6574696f6e5f6c696e65a36e2f61ac766572696669636174696f6e84a66275696c647391ab636172676f20636865636ba574657374739182a46e616d65a46b657973a470696e73af6f6e652064657269766564206b6579a86e656761746976659182a77061747465726ea75665633c75383ea573636f7065a9646f63756d656e7473a86f70657261746f7291a46e6f6e65a8657374696d61746588ab6c696e65735f6164646564cd0384ad6c696e65735f72656d6f76656400b2646570656e64656e636965735f616464656491a8736368656d617273b4646570656e64656e636965735f72656d6f76656490ad666f726d6174735f616464656491b66570697068616e792e706970656c696e652e2a2e7631af666f726d6174735f72656d6f76656490ad746172676574735f616464656490af746172676574735f72656d6f76656490a772756c696e677391b6657572656b612d73746174653a72756c696e673a5238a97175657374696f6e7391b8657572656b612d73746174653a7175657374696f6e3a5131 -sample.cut_report eureka-state:cut_report:cut-3a.h1 epiphany.pipeline.cut_report.v2 EpiphanyPipelineCutReportDocument 918fa863616d706169676eac657572656b612d7374617465a86375745f73706563bf657572656b612d73746174653a6375745f737065633a6375742d33612e7231a7617474656d707401a47265706fb147616d6543756c742f4570697068616e79a66272616e6368bb636f6465782f657572656b612d706970656c696e652d7374617465a7636f6d6d6974739183a3736861a83566393832323864a77375626a656374ba4164642074686520706970656c696e6520646f63756d656e7473a66275696c6473c3a572616e676582a462617365a83566393832323864a468656164a83566393832323864ac766572696669636174696f6e9183a46b696e64a454657374a76c6f6361746f72aa636172676f2074657374a6726573756c74a26f6ba96d75746174696f6e739187a56c6162656ca24d31a472756c65ae6b65792064657269766174696f6ea86c6f636174696f6e83a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509a66265666f7265bd706172656e745f637574286669656c642c20737065632c20277227293fa56166746572a473706563a6636f6d6d6974a83566393832323864b26661696c65645f61735f6578706563746564c3aa646576696174696f6e739182a477686174a56e616d6573a3776879ac676c6f62206578706f727473a5666f726b7391b8657572656b612d73746174653a7175657374696f6e3a5131b07374727563747572616c5f64656c746188ab6c696e65735f6164646564cd0384ad6c696e65735f72656d6f76656400b2646570656e64656e636965735f616464656491a8736368656d617273b4646570656e64656e636965735f72656d6f76656490ad666f726d6174735f616464656491b66570697068616e792e706970656c696e652e2a2e7631af666f726d6174735f72656d6f76656490ad746172676574735f616464656490af746172676574735f72656d6f76656490ac6c616e6465645f6e616d65739182a46e616d65b0506970656c696e65446f63756d656e74a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a6756e646f6e6591a961646d697373696f6ea870726f6d697365739182a56c6162656ca25031a474657874bd4f6e652064657269766564206b65792070657220646f63756d656e742e -sample.verdict eureka-state:verdict:cut-3a.s2 epiphany.pipeline.verdict.v2 EpiphanyPipelineVerdictDocument 9185a863616d706169676eac657572656b612d7374617465aa6375745f7265706f7274d921657572656b612d73746174653a6375745f7265706f72743a6375742d33612e6831a47061737302a572616e676582a462617365a83566393832323864a468656164a83566393832323864a6636c61696d739186a5636c61696dbe4120636f6d706f736564206b657920686173206f6e6520736f757263652ea76f7574636f6d65a946616c736966696564a865766964656e63659183a46b696e64a454657374a76c6f6361746f72aa636172676f2074657374a6726573756c74a26f6ba866696e64696e677391d921657572656b612d73746174653a66696e64696e673a6375742d33612e73322e4634a770726f6d697365a25031a96d75746174696f6e7391a24d31 -sample.finding eureka-state:finding:cut-3a.s2.F4 epiphany.pipeline.finding.v2 EpiphanyPipelineFindingDocument 918da863616d706169676eac657572656b612d7374617465a776657264696374be657572656b612d73746174653a766572646963743a6375742d33612e7332a56c6162656ca24634a572616e676582a462617365a83566393832323864a468656164a83566393832323864aa636f6e666964656e6365a9436f6e6669726d6564a87365766572697479a448696768a5636c61696dd9214120646f74746564206c6162656c20636f6d706f7365732074776f206b6579732eaa696e76617269616e747391ab6d696e642d61646d697473a96c6f636174696f6e739183a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509b06661696c7572655f7363656e6172696fbc54776f20646f63756d656e747320636c61696d206f6e65206b65792ea865766964656e63659183a46b696e64a454657374a76c6f6361746f72aa636172676f2074657374a6726573756c74a26f6baa707265636564656e747390a66f726967696eaa496e74726f6475636564 -sample.follow_up eureka-state:follow_up:FU-4 epiphany.pipeline.follow_up.v2 EpiphanyPipelineFollowUpDocument 9188a863616d706169676eac657572656b612d7374617465a56c6162656ca446552d34a6736f7572636582a46b696e64a746696e64696e67a26964d921657572656b612d73746174653a66696e64696e673a6375742d33612e73322e4634a47265706fb147616d6543756c742f4570697068616e79a96c6f636174696f6e739183a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509a46974656db95065722d6b696e642061646d697373696f6e2072756c65732eaf7768795f69745f63616e5f77616974b9546865206f7267616e206f776e732061646d697373696f6e2ea56f776e6572a548616e6473 -sample.resolution eureka-state:resolution:question.Q1.n1 epiphany.pipeline.resolution.v2 EpiphanyPipelineResolutionDocument 9185a77375626a65637482a46b696e64a85175657374696f6ea26964b8657572656b612d73746174653a7175657374696f6e3a5131a873657175656e636501a76f7574636f6d6581a8416e73776572656481a2627982a46b696e64a652756c696e67a26964b6657572656b612d73746174653a72756c696e673a5238a9726174696f6e616c65a852756c656420412eab7265736f6c7665645f6f6eaa323032362d30392d3135 -sample.instance yggdrasil:instance:self epiphany.pipeline.instance.v2 EpiphanyPipelineInstanceDocument 9184a8696e7374616e6365a979676764726173696cac646973706c61795f6e616d65ae59676764726173696c206d696e64aa637265617465645f6174aa323032362d30392d3135a4686f7374a979676764726173696c -sample.stewardship yggdrasil:stewardship:gamecult_-epiphany.n1 epiphany.pipeline.stewardship.v2 EpiphanyPipelineStewardshipDocument 9185a8696e7374616e6365a979676764726173696ca47265706fb147616d6543756c742f4570697068616e79a873657175656e636501ab61737369676e65645f6f6eaa323032362d30392d3135a46e6f7465b954686520457572656b612063616d706169676e207265706f2e -sample.hand_off yggdrasil:hand_off:thought-cage.gamecult_-epiphany.2026-09-15 epiphany.pipeline.hand_off.v2 EpiphanyPipelineHandOffDocument 9186ad66726f6d5f696e7374616e6365a979676764726173696cab746f5f696e7374616e6365ac74686f756768742d63616765a47265706fb147616d6543756c742f4570697068616e79a9646f63756d656e747392ac657572656b612d7374617465b6657572656b612d73746174653a72756c696e673a5238a6726561736f6ed92854686520776f726b73746174696f6e206d696e642074616b6573207468652063616d706169676e2ea968616e6465645f6f6eaa323032362d30392d3135 -sample.run yggdrasil:run:mind-2026-10-09-1 epiphany.pipeline.run.v2 EpiphanyPipelineRunDocument 9189a8696e7374616e6365a979676764726173696ca56c6162656cb16d696e642d323032362d31302d30392d31ab6f706572617465645f6279a44d696e64a47475726ea753656c6652756ea4686f7374a979676764726173696caa737461727465645f6f6eaa323032362d30392d3135aa6275646765745f757364a3372e35a6636c61696d739182a46b696e64a743757453706563a26964d925657572656b612d73746174653a6375745f737065633a6375742d72756e2d6b696e642e7232a963616d706169676e7391ac657572656b612d7374617465 -sample.pulse yggdrasil:pulse:2026-10-31t041200-t0 epiphany.pipeline.pulse.v2 EpiphanyPipelinePulseDocument 9185a8696e7374616e6365a979676764726173696ca56c6162656cb4323032362d31302d3331743034313230302d7430b174656d706f5f766f74655f626561745f73cd0258b0757267656e63795f7065726d696c6c65ccfaa46e6f7465d92254686520737761726d2069732069646c653b20612073686f7274657220626561742e -sample.memory yggdrasil:memory:2026-10-31t041200-t0-m0 epiphany.pipeline.memory.v2 EpiphanyPipelineMemoryDocument 9189a8696e7374616e6365a979676764726173696ca56c6162656cb7323032362d31302d3331743034313230302d74302d6d30a4736f7274a9436f6d6d6974746564a474657874d936492074616b6520746865206261636b67726f756e6420736861646572733b204c6962627920686f6c64732074686520736f756e64732ea561626f757491ab406c696262793a63686174a66f726967696e81a4526f6f6d82a5726f6f6d73a5737761726daa68656172645f66726f6d91ab406c696262793a63686174a7736f757263657391a3246531b173616c69656e63655f7065726d696c6c65cd02bcac636f6e736f6c69646174657390 -resolution.superseded eureka-state:resolution:question.Q1.n1 epiphany.pipeline.resolution.v2 EpiphanyPipelineResolutionDocument 9185a77375626a65637482a46b696e64a85175657374696f6ea26964b8657572656b612d73746174653a7175657374696f6e3a5131a873657175656e636501a76f7574636f6d6581aa5375706572736564656481a262799282a46b696e64a652756c696e67a26964b6657572656b612d73746174653a72756c696e673a523882a46b696e64a85175657374696f6ea26964b8657572656b612d73746174653a7175657374696f6e3a5131a9726174696f6e616c65a852756c656420412eab7265736f6c7665645f6f6eaa323032362d30392d3135 -resolution.fixed-by-none eureka-state:resolution:question.Q1.n1 epiphany.pipeline.resolution.v2 EpiphanyPipelineResolutionDocument 9185a77375626a65637482a46b696e64a85175657374696f6ea26964b8657572656b612d73746174653a7175657374696f6e3a5131a873657175656e636501a76f7574636f6d6581a5466978656482a6636f6d6d6974a83566393832323864a26279c0a9726174696f6e616c65a852756c656420412eab7265736f6c7665645f6f6eaa323032362d30392d3135 -resolution.fixed-by-some eureka-state:resolution:question.Q1.n1 epiphany.pipeline.resolution.v2 EpiphanyPipelineResolutionDocument 9185a77375626a65637482a46b696e64a85175657374696f6ea26964b8657572656b612d73746174653a7175657374696f6e3a5131a873657175656e636501a76f7574636f6d6581a5466978656482a6636f6d6d6974a83566393832323864a2627982a46b696e64a94375745265706f7274a26964d921657572656b612d73746174653a6375745f7265706f72743a6375742d33612e6831a9726174696f6e616c65a852756c656420412eab7265736f6c7665645f6f6eaa323032362d30392d3135 -resolution.deferred eureka-state:resolution:question.Q1.n1 epiphany.pipeline.resolution.v2 EpiphanyPipelineResolutionDocument 9185a77375626a65637482a46b696e64a85175657374696f6ea26964b8657572656b612d73746174653a7175657374696f6e3a5131a873657175656e636501a76f7574636f6d6581a8446566657272656481a2746f82a46b696e64a8466f6c6c6f775570a26964bb657572656b612d73746174653a666f6c6c6f775f75703a46552d34a9726174696f6e616c65a852756c656420412eab7265736f6c7665645f6f6eaa323032362d30392d3135 -resolution.recorded eureka-state:resolution:question.Q1.n1 epiphany.pipeline.resolution.v2 EpiphanyPipelineResolutionDocument 9185a77375626a65637482a46b696e64a85175657374696f6ea26964b8657572656b612d73746174653a7175657374696f6e3a5131a873657175656e636501a76f7574636f6d6581a85265636f7264656481a6726561736f6ea64e6f7465642ea9726174696f6e616c65a852756c656420412eab7265736f6c7665645f6f6eaa323032362d30392d3135 -resolution.withdrawn eureka-state:resolution:question.Q1.n1 epiphany.pipeline.resolution.v2 EpiphanyPipelineResolutionDocument 9185a77375626a65637482a46b696e64a85175657374696f6ea26964b8657572656b612d73746174653a7175657374696f6e3a5131a873657175656e636501a76f7574636f6d6581a957697468647261776e81a6726561736f6ea94d697374616b656e2ea9726174696f6e616c65a852756c656420412eab7265736f6c7665645f6f6eaa323032362d30392d3135 -ruling.authority-standing eureka-state:ruling:R8 epiphany.pipeline.ruling.v2 EpiphanyPipelineRulingDocument 918aa863616d706169676eac657572656b612d7374617465a56c6162656ca25238a57469746c65b9416e20696e7374616e6365206f776e7320697473206d696e64a7616e7377657273b8657572656b612d73746174653a7175657374696f6e3a5131a663686f696365a141a672756c696e67ba416e20696e7374616e6365206f776e7320697473206d696e642eae6f70657261746f725f71756f7465bd616c6c207265636f6d6d656e646174696f6e732c20676f206168656164a872756c65645f6f6eaa323032362d30392d3135aa707265636564656e74739185a47265706fb147616d6543756c742f4165746865726961a6636f6d6d6974d92861616161616161616161616161616161616161616161616161616161616161616161616161616161a46b696e64a652756c696e67a26964b363756c7463616368653a72756c696e673a5231ae7061796c6f61645f736861323536d94062626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262a9617574686f72697479a85374616e64696e67 -ruling.authority-defaulted eureka-state:ruling:R8 epiphany.pipeline.ruling.v2 EpiphanyPipelineRulingDocument 918aa863616d706169676eac657572656b612d7374617465a56c6162656ca25238a57469746c65b9416e20696e7374616e6365206f776e7320697473206d696e64a7616e7377657273b8657572656b612d73746174653a7175657374696f6e3a5131a663686f696365a141a672756c696e67ba416e20696e7374616e6365206f776e7320697473206d696e642eae6f70657261746f725f71756f7465bd616c6c207265636f6d6d656e646174696f6e732c20676f206168656164a872756c65645f6f6eaa323032362d30392d3135aa707265636564656e74739185a47265706fb147616d6543756c742f4165746865726961a6636f6d6d6974d92861616161616161616161616161616161616161616161616161616161616161616161616161616161a46b696e64a652756c696e67a26964b363756c7463616368653a72756c696e673a5231ae7061796c6f61645f736861323536d94062626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262a9617574686f72697479a944656661756c746564 -ruling.options-none eureka-state:ruling:R8 epiphany.pipeline.ruling.v2 EpiphanyPipelineRulingDocument 918aa863616d706169676eac657572656b612d7374617465a56c6162656ca25238a57469746c65b9416e20696e7374616e6365206f776e7320697473206d696e64a7616e7377657273c0a663686f696365c0a672756c696e67ba416e20696e7374616e6365206f776e7320697473206d696e642eae6f70657261746f725f71756f7465c0a872756c65645f6f6eaa323032362d30392d3135aa707265636564656e747390a9617574686f72697479a84f70657261746f72 -question.raised-in-none eureka-state:question:Q1 epiphany.pipeline.question.v2 EpiphanyPipelineQuestionDocument 9189a863616d706169676eac657572656b612d7374617465a56c6162656ca25131a57469746c65b357686f206f776e73207468652073746174653fa87175657374696f6eb357686f206f776e73207468652073746174653fa76f7074696f6e739282a56c6162656ca141a474657874ab616e20696e7374616e636582a56c6162656ca142a474657874a661207265706fab7265636f6d6d656e646564a141a7646570656e647391a6437574203361a97261697365645f696ec0a861736b65645f6f6eaa323032362d30392d3135 -cut_spec.authority-map-none eureka-state:cut_spec:cut-3a.r1 epiphany.pipeline.cut_spec.v2 EpiphanyPipelineCutSpecDocument 91de0012a863616d706169676eac657572656b612d7374617465a3637574a23361a87265766973696f6e01a57469746c65b2506970656c696e6520646f63756d656e7473a47265706fb147616d6543756c742f4570697068616e79a66272616e6368bb636f6465782f657572656b612d706970656c696e652d7374617465a462617365a83566393832323864aa646570656e64735f6f6e91a132a5666972737491ae526561642074686520737065632ea764656c657465739183a470617468a66f6c642e7273a56c696e657303a46e6f7465a464656164ab6b656570735f6d6f76657391ac636f6d6d6974206f776e6572a46164647391b5706970656c696e655f646f63756d656e74732e7273ac66696c655f6368616e6765739182a86c6f636174696f6e83a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509a66368616e6765a3616464ad617574686f726974795f6d6170c0ac766572696669636174696f6e84a66275696c647391ab636172676f20636865636ba574657374739182a46e616d65a46b657973a470696e73af6f6e652064657269766564206b6579a86e656761746976659182a77061747465726ea75665633c75383ea573636f7065a9646f63756d656e7473a86f70657261746f7291a46e6f6e65a8657374696d61746588ab6c696e65735f6164646564cd0384ad6c696e65735f72656d6f76656400b2646570656e64656e636965735f616464656491a8736368656d617273b4646570656e64656e636965735f72656d6f76656490ad666f726d6174735f616464656491b66570697068616e792e706970656c696e652e2a2e7631af666f726d6174735f72656d6f76656490ad746172676574735f616464656490af746172676574735f72656d6f76656490a772756c696e677391b6657572656b612d73746174653a72756c696e673a5238a97175657374696f6e7391b8657572656b612d73746174653a7175657374696f6e3a5131 -verdict.claim-holds-promise-none eureka-state:verdict:cut-3a.s2 epiphany.pipeline.verdict.v2 EpiphanyPipelineVerdictDocument 9185a863616d706169676eac657572656b612d7374617465aa6375745f7265706f7274d921657572656b612d73746174653a6375745f7265706f72743a6375742d33612e6831a47061737302a572616e676582a462617365a83566393832323864a468656164a83566393832323864a6636c61696d739186a5636c61696dbe4120636f6d706f736564206b657920686173206f6e6520736f757263652ea76f7574636f6d65a5486f6c6473a865766964656e63659183a46b696e64a454657374a76c6f6361746f72aa636172676f2074657374a6726573756c74a26f6ba866696e64696e677391d921657572656b612d73746174653a66696e64696e673a6375742d33612e73322e4634a770726f6d697365c0a96d75746174696f6e7391a24d31 -verdict.claim-unproven-promise-none eureka-state:verdict:cut-3a.s2 epiphany.pipeline.verdict.v2 EpiphanyPipelineVerdictDocument 9185a863616d706169676eac657572656b612d7374617465aa6375745f7265706f7274d921657572656b612d73746174653a6375745f7265706f72743a6375742d33612e6831a47061737302a572616e676582a462617365a83566393832323864a468656164a83566393832323864a6636c61696d739186a5636c61696dbe4120636f6d706f736564206b657920686173206f6e6520736f757263652ea76f7574636f6d65a8556e70726f76656ea865766964656e63659183a46b696e64a454657374a76c6f6361746f72aa636172676f2074657374a6726573756c74a26f6ba866696e64696e677391d921657572656b612d73746174653a66696e64696e673a6375742d33612e73322e4634a770726f6d697365c0a96d75746174696f6e7391a24d31 -finding.plausible-blocker-preexisting-kinds eureka-state:finding:cut-3a.s2.F4 epiphany.pipeline.finding.v2 EpiphanyPipelineFindingDocument 918da863616d706169676eac657572656b612d7374617465a776657264696374be657572656b612d73746174653a766572646963743a6375742d33612e7332a56c6162656ca24634a572616e676582a462617365a83566393832323864a468656164a83566393832323864aa636f6e666964656e6365a9506c61757369626c65a87365766572697479a7426c6f636b6572a5636c61696dd9214120646f74746564206c6162656c20636f6d706f7365732074776f206b6579732eaa696e76617269616e747391ab6d696e642d61646d697473a96c6f636174696f6e739183a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e65c0b06661696c7572655f7363656e6172696fbc54776f20646f63756d656e747320636c61696d206f6e65206b65792ea865766964656e63659583a46b696e64a7436f6d6d616e64a76c6f6361746f72a178a6726573756c74a17983a46b696e64a84d75746174696f6ea76c6f6361746f72a178a6726573756c74a17983a46b696e64a550726f6265a76c6f6361746f72a178a6726573756c74a17983a46b696e64aa536f7572636552656164a76c6f6361746f72a178a6726573756c74a17983a46b696e64a743617074757265a76c6f6361746f72a178a6726573756c74a179aa707265636564656e747390a66f726967696eab5072654578697374696e67 -finding.severity-medium eureka-state:finding:cut-3a.s2.F4 epiphany.pipeline.finding.v2 EpiphanyPipelineFindingDocument 918da863616d706169676eac657572656b612d7374617465a776657264696374be657572656b612d73746174653a766572646963743a6375742d33612e7332a56c6162656ca24634a572616e676582a462617365a83566393832323864a468656164a83566393832323864aa636f6e666964656e6365a9436f6e6669726d6564a87365766572697479a64d656469756da5636c61696dd9214120646f74746564206c6162656c20636f6d706f7365732074776f206b6579732eaa696e76617269616e747391ab6d696e642d61646d697473a96c6f636174696f6e739183a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509b06661696c7572655f7363656e6172696fbc54776f20646f63756d656e747320636c61696d206f6e65206b65792ea865766964656e63659183a46b696e64a454657374a76c6f6361746f72aa636172676f2074657374a6726573756c74a26f6baa707265636564656e747390a66f726967696eaa496e74726f6475636564 -finding.severity-low eureka-state:finding:cut-3a.s2.F4 epiphany.pipeline.finding.v2 EpiphanyPipelineFindingDocument 918da863616d706169676eac657572656b612d7374617465a776657264696374be657572656b612d73746174653a766572646963743a6375742d33612e7332a56c6162656ca24634a572616e676582a462617365a83566393832323864a468656164a83566393832323864aa636f6e666964656e6365a9436f6e6669726d6564a87365766572697479a34c6f77a5636c61696dd9214120646f74746564206c6162656c20636f6d706f7365732074776f206b6579732eaa696e76617269616e747391ab6d696e642d61646d697473a96c6f636174696f6e739183a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509b06661696c7572655f7363656e6172696fbc54776f20646f63756d656e747320636c61696d206f6e65206b65792ea865766964656e63659183a46b696e64a454657374a76c6f6361746f72aa636172676f2074657374a6726573756c74a26f6baa707265636564656e747390a66f726967696eaa496e74726f6475636564 -ruling.authority-mind eureka-state:ruling:R8 epiphany.pipeline.ruling.v2 EpiphanyPipelineRulingDocument 918aa863616d706169676eac657572656b612d7374617465a56c6162656ca25238a57469746c65b9416e20696e7374616e6365206f776e7320697473206d696e64a7616e7377657273c0a663686f696365c0a672756c696e67ba416e20696e7374616e6365206f776e7320697473206d696e642eae6f70657261746f725f71756f7465c0a872756c65645f6f6eaa323032362d30392d3135aa707265636564656e74739185a47265706fb147616d6543756c742f4165746865726961a6636f6d6d6974d92861616161616161616161616161616161616161616161616161616161616161616161616161616161a46b696e64a652756c696e67a26964b363756c7463616368653a72756c696e673a5231ae7061796c6f61645f736861323536d94062626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262a9617574686f72697479a44d696e64 -cut_spec.reads-and-symbol eureka-state:cut_spec:cut-3a.r1 epiphany.pipeline.cut_spec.v2 EpiphanyPipelineCutSpecDocument 91de0013a863616d706169676eac657572656b612d7374617465a3637574a23361a87265766973696f6e01a57469746c65b2506970656c696e6520646f63756d656e7473a47265706fb147616d6543756c742f4570697068616e79a66272616e6368bb636f6465782f657572656b612d706970656c696e652d7374617465a462617365a83566393832323864aa646570656e64735f6f6e91a132a5666972737491ae526561642074686520737065632ea764656c657465739183a470617468a66f6c642e7273a56c696e657303a46e6f7465a464656164ab6b656570735f6d6f76657391ac636f6d6d6974206f776e6572a46164647391b5706970656c696e655f646f63756d656e74732e7273ac66696c655f6368616e6765739182a86c6f636174696f6e84a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509a673796d626f6cab76616c75655f7479706573a66368616e6765a3616464a572656164739282a86c6f636174696f6e84a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e650aa8656e645f6c696e6514a673796d626f6caf506970656c696e6543757453706563a3776879b274686520646f63756d656e7420736861706582a86c6f636174696f6e83a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e651ea8656e645f6c696e65c0a3776879a86f6e65206c696e65ad617574686f726974795f6d617087a56f776e6572a4636f7265a6696e7075747391af747970656420646f63756d656e7473a76f75747075747391a9656e76656c6f706573ad646572697665645f737461746591ac64657269766564206b657973b1666f7262696464656e5f7772697465727391a34d4350ac7368617265645f706174687391a961646d697373696f6ead64656c6574696f6e5f6c696e65a36e2f61ac766572696669636174696f6e84a66275696c647391ab636172676f20636865636ba574657374739182a46e616d65a46b657973a470696e73af6f6e652064657269766564206b6579a86e656761746976659182a77061747465726ea75665633c75383ea573636f7065a9646f63756d656e7473a86f70657261746f7291a46e6f6e65a8657374696d61746588ab6c696e65735f6164646564cd0384ad6c696e65735f72656d6f76656400b2646570656e64656e636965735f616464656491a8736368656d617273b4646570656e64656e636965735f72656d6f76656490ad666f726d6174735f616464656491b66570697068616e792e706970656c696e652e2a2e7631af666f726d6174735f72656d6f76656490ad746172676574735f616464656490af746172676574735f72656d6f76656490a772756c696e677391b6657572656b612d73746174653a72756c696e673a5238a97175657374696f6e7391b8657572656b612d73746174653a7175657374696f6e3a5131 -finding.location-symbol eureka-state:finding:cut-3a.s2.F4 epiphany.pipeline.finding.v2 EpiphanyPipelineFindingDocument 918da863616d706169676eac657572656b612d7374617465a776657264696374be657572656b612d73746174653a766572646963743a6375742d33612e7332a56c6162656ca24634a572616e676582a462617365a83566393832323864a468656164a83566393832323864aa636f6e666964656e6365a9436f6e6669726d6564a87365766572697479a448696768a5636c61696dd9214120646f74746564206c6162656c20636f6d706f7365732074776f206b6579732eaa696e76617269616e747391ab6d696e642d61646d697473a96c6f636174696f6e739184a470617468d9216372617465732f657572656b612d706970656c696e652f7372632f6c69622e7273a46c696e6501a8656e645f6c696e6509a673796d626f6cab2631313533303930343938b06661696c7572655f7363656e6172696fbc54776f20646f63756d656e747320636c61696d206f6e65206b65792ea865766964656e63659183a46b696e64a454657374a76c6f6361746f72aa636172676f2074657374a6726573756c74a26f6baa707265636564656e747390a66f726967696eaa496e74726f6475636564 -target.repos eureka-state:target:r2 epiphany.pipeline.target.v2 EpiphanyPipelineTargetDocument 9187a863616d706169676eac657572656b612d7374617465a87265766973696f6e02aa696e76617269616e74739182a56c6162656cab6d696e642d61646d697473a973746174656d656e74b64f6e6c792061646d697373696f6e207772697465732eac6e6f745f696e5f73636f706591ac4576652062726f7773696e67b963616e6f6e6963616c5f696d706c656d656e746174696f6e7391a743756c744c6962a57265706f7392b147616d6543756c742f4570697068616e79af47616d6543756c742f487567696e6ea3646f6384a470617468d9256e6f7465732f657572656b612d706970656c696e652d73746174652d7461726765742e6d64aa73746172745f6c696e6501a8656e645f6c696e6509a6636f6d6d6974a83566393832323864 diff --git a/crates/eureka-pipeline/src/lib.rs b/crates/eureka-pipeline/src/lib.rs deleted file mode 100644 index cb5aad3..0000000 --- a/crates/eureka-pipeline/src/lib.rs +++ /dev/null @@ -1,3988 +0,0 @@ -//! Eureka pipeline documents: the typed shape of a Eureka campaign's state. -//! -//! This is a leaf type library, and deliberately nothing else. It owns document -//! shape, field bounds, formats, key derivation and the JSON schemas published -//! under `schemas/cultnet`; it owns no storage, no admission, no process and no -//! network. That is the whole reason it is a package: the organ that will admit -//! these documents depends on these types without depending on the harness -//! that used to hold them. -//! -//! Every kind is a plain `serde` + `JsonSchema` value inside a one-slot -//! `DatabaseEntry` wrapper, always prepared with `prepare_entry_named`, so the -//! stored payload is `[value]` and the value is the named map the published -//! schema describes. Keys are semantic: `pipeline_key` derives them from the -//! value, and the write validator refuses any envelope whose key differs. -//! -//! Every key is `::`, three segments for every kind with -//! none excused: the root is a `Slug`, the kind is the literal kind name, and -//! the local is `Label`s joined by `.`, so no local part carries a dot and a -//! reader recovers the parts by splitting. A root's local is the constant -//! `self`; a resolution's local is its subject's kind and local. A -//! resolution's local ends in its per-subject sequence, `n`, and a -//! stewardship's in its per-repo sequence, so a subject's resolutions and a -//! repo's assignments each share a prefix. -//! -//! **Validation follows the type.** `value_types!` is the single field list: it -//! emits the struct and its `Bounded` impl from the same tokens, so a field -//! cannot be declared without being validated. Format rules live in the field's -//! type (`Label`, `Slug`, `OrgRepo`, `Sha`, `Sha256Hex`, `Date`), never in a -//! hand-written impl that a later field can slip past. A `Vec` field must carry -//! a maximum, because `Vec` has no `Bounded` impl of its own. A field added -//! at the epoch carries the `= absent` marker, which defaults it on read and -//! omits it on write when empty. -//! -//! The wrappers are crate-private: outside code registers, prepares and -//! decodes them through `register_pipeline_document_types`, -//! `PipelineDocument::prepare` and `PipelineDocument::decode`, and validates a -//! write through `validate_pipeline_write_envelope`. - -// `anyhow` is the cache's own error type, which `prepare` and the registrar -// pass through; every refusal this crate decides is a `PipelineRefusal`. -use anyhow::Result; -use cultcache_rs::{CultCache, CultCacheEnvelope, DatabaseEntry}; -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; - -/// Typed refusals of the pipeline documents: bounds, formats and key identity -/// (D2's document half), and `ForeignStore`, raised by `decode` for an -/// envelope of any other type. This is every refusal the leaf decides; a -/// store's identity and its schema epoch are not decided here, since this -/// crate owns no store, and belong to the organ that will admit these -/// documents. -/// -/// Serialised externally tagged, serde's default for an enum: each variant is -/// a one-key map from the variant's name to its named fields, so `field` and -/// `value` are on the wire under their own names and a reader of a refusal -/// carried over a wire reads the same parts a local caller matches on. No -/// attribute buys that, which is why there is none: an internal or adjacent -/// tag would move the fields under a content key without making any of them -/// more visible. -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] -pub enum PipelineRefusal { - FieldBound { field: String, limit: u32, actual: u32 }, - InvalidFormat { field: String, value: String }, - InvalidIdentity { kind: PipelineKind, key: String, expected: String }, - DuplicateRepo { field: String, repo: String }, - ForeignStore { r#type: String }, -} - -impl std::fmt::Display for PipelineRefusal { - fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "pipeline refusal: {self:?}") - } -} - -impl std::error::Error for PipelineRefusal {} - -pub(crate) trait Bounded { - fn validate(&self, field: &str) -> Result<(), PipelineRefusal>; -} - -impl Bounded for Option { - fn validate(&self, field: &str) -> Result<(), PipelineRefusal> { - self.as_ref().map_or(Ok(()), |value| value.validate(field)) - } -} - -/// A value with an empty spelling. The `= absent` marker on a `value_types!` -/// field requires it, and the field is then omitted on write when it is absent. -pub(crate) trait Absent { - fn absent(&self) -> bool; -} - -impl Absent for Option { - fn absent(&self) -> bool { - self.is_none() - } -} - -impl Absent for bool { - fn absent(&self) -> bool { - !*self - } -} - -impl Absent for Vec { - fn absent(&self) -> bool { - self.is_empty() - } -} - -macro_rules! unbounded_scalars { - ($($ty:ty),* $(,)?) => {$( - impl Bounded for $ty { - fn validate(&self, _field: &str) -> Result<(), PipelineRefusal> { - Ok(()) - } - } - )*}; -} - -unbounded_scalars!(u16, u32, u64, bool); - -fn bound(field: &str, limit: usize, actual: usize) -> Result<(), PipelineRefusal> { - if actual > limit { - return Err(PipelineRefusal::FieldBound { - field: field.into(), - limit: limit as u32, - actual: actual as u32, - }); - } - Ok(()) -} - -/// List maximums only. Minimum counts are admission rules with their own -/// refusals (Cut 3b), so a bounds pass never pre-empts them. -fn list(field: &str, items: &[T], max: usize) -> Result<(), PipelineRefusal> { - bound(field, max, items.len())?; - for (index, item) in items.iter().enumerate() { - item.validate(&format!("{field}[{index}]"))?; - } - Ok(()) -} - -fn format_error(field: &str, value: &str) -> PipelineRefusal { - PipelineRefusal::InvalidFormat { - field: field.into(), - value: value.into(), - } -} - -fn hex(field: &str, value: &str, lengths: std::ops::RangeInclusive) -> Result<(), PipelineRefusal> { - let lower_hex = value.bytes().all(|byte| matches!(byte, b'0'..=b'9' | b'a'..=b'f')); - if !lengths.contains(&value.len()) || !lower_hex { - return Err(format_error(field, value)); - } - Ok(()) -} - -/// A key label: `[A-Za-z0-9_-]{1,64}`. Dots are excluded so that a composed key -/// segments unambiguously; see `local`. -fn label_text(field: &str, value: &str) -> Result<(), PipelineRefusal> { - let valid = value - .bytes() - .all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'-')); - if !valid || value.is_empty() || value.len() > 64 { - return Err(format_error(field, value)); - } - Ok(()) -} - -/// A dotted key segment: label parts joined by `.`, at most 64 bytes. Every -/// part must be a label, so `..`, a leading or trailing dot, and an empty part -/// are all refused. -fn dotted_text(field: &str, value: &str) -> Result<(), PipelineRefusal> { - dotted_within(field, value, 64) -} - -/// `dotted_text`'s grammar with the bound as a parameter: the one place a -/// dotted segment is parsed, whoever owns the bound. -fn dotted_within(field: &str, value: &str, max: usize) -> Result<(), PipelineRefusal> { - if value.is_empty() || value.len() > max { - return Err(format_error(field, value)); - } - for part in value.split('.') { - label_text(field, part)?; - } - Ok(()) -} - -/// GitHub's own grammar for `owner/repo`, exactly one `/`: the owner is -/// `[A-Za-z0-9-]`, 1 to 39 bytes, with no leading or trailing hyphen; the repo -/// is `[A-Za-z0-9._-]`, 1 to 100 bytes, is never `.` or `..`, and does not end -/// in `.git`, ASCII-case-insensitively (`a/b.GIT` is refused exactly as -/// `a/b.git` is), so the suffix rule cannot be dodged by a case variant whose -/// `identity()` is refused. The repo's own byte alphabet excludes `/`, so a -/// second `/` inside it is already refused by the byte check; no separate -/// `contains('/')` check is needed. -fn org_repo_text(field: &str, value: &str) -> Result<(), PipelineRefusal> { - let valid = value.split_once('/').is_some_and(|(owner, repo)| { - (1..=39).contains(&owner.len()) - && owner.bytes().all(|byte| byte.is_ascii_alphanumeric() || byte == b'-') - && !owner.starts_with('-') - && !owner.ends_with('-') - && (1..=100).contains(&repo.len()) - && repo.bytes().all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'.' | b'_' | b'-')) - && repo != "." - && repo != ".." - && !(repo.len() >= 4 && repo[repo.len() - 4..].eq_ignore_ascii_case(".git")) - }); - if valid { - Ok(()) - } else { - Err(format_error(field, value)) - } -} - -macro_rules! bounded_text { - ($($(#[$doc:meta])* $name:ident = $limit:literal, $check:expr;)*) => {$( - #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema)] - #[serde(transparent)] - #[schemars(extend("maxLength" = $limit))] - $(#[$doc])* - pub struct $name(pub String); - impl Bounded for $name { - fn validate(&self, field: &str) -> Result<(), PipelineRefusal> { - let check: fn(&str, &str) -> Result<(), PipelineRefusal> = $check; - check(field, &self.0) - } - } - impl From<&str> for $name { - fn from(value: &str) -> Self { - Self(value.into()) - } - } - )*}; -} - -fn within(limit: usize) -> impl Fn(&str, &str) -> Result<(), PipelineRefusal> { - move |field: &str, value: &str| bound(field, limit, value.len()) -} - -/// A title holds at least one `char::is_alphanumeric()` character, no -/// `char::is_control()` character, no U+2028 LINE SEPARATOR or U+2029 -/// PARAGRAPH SEPARATOR (both `Zl`/`Zp`, so `is_control()` does not reach -/// them, and a one-line field should carry no hard line break), and no bidi -/// control character: `U+061C`, `U+200E`, `U+200F`, `U+202A`-`U+202E`, -/// `U+2066`-`U+2069`. No denylist of individual zero-width or format -/// characters is maintained here; a character not covered by one of these -/// tests is allowed, so ZWJ and ZWNJ still work. -fn title_text(field: &str, value: &str) -> Result<(), PipelineRefusal> { - let alphanumeric = value.chars().any(|character| character.is_alphanumeric()); - let control = value - .chars() - .any(|character| character.is_control() || matches!(character, '\u{2028}' | '\u{2029}')); - let bidi = value.chars().any(|character| { - matches!( - character, - '\u{061C}' | '\u{200E}' | '\u{200F}' | '\u{202A}'..='\u{202E}' | '\u{2066}'..='\u{2069}' - ) - }); - if !alphanumeric || control || bidi { - return Err(format_error(field, value)); - } - within(200)(field, value) -} - -/// A symbol is 1 to 128 bytes with no whitespace and no control character. -fn symbol_text(field: &str, value: &str) -> Result<(), PipelineRefusal> { - if value.is_empty() || value.chars().any(|character| character.is_whitespace() || character.is_control()) { - return Err(format_error(field, value)); - } - within(128)(field, value) -} - -bounded_text! { - /// Text of at most 200 UTF-8 bytes. - Short = 200, |field, value| within(200)(field, value); - /// A title: 1 to 200 UTF-8 bytes, enforced by admission; JSON Schema - /// length counts characters. Holds at least one alphanumeric character, - /// no control character, and no bidi control character (`U+061C`, - /// `U+200E`, `U+200F`, `U+202A`-`U+202E`, `U+2066`-`U+2069`). - #[schemars(extend("minLength" = 1))] - Title = 200, title_text; - /// Text of at most 1,000 UTF-8 bytes. - Line = 1000, |field, value| within(1000)(field, value); - /// A name the location's lines must contain as written there (an - /// identifier or a YAML `&fileID`); not an identity. 1 to 128 bytes, no - /// whitespace and no control character. - #[schemars(extend("minLength" = 1))] - Symbol = 128, symbol_text; - /// Text of at most 4,000 UTF-8 bytes; longer narrative is cited by `DocRef`. - Para = 4000, |field, value| within(4000)(field, value); - /// A key label: `[A-Za-z0-9_-]{1,64}`. - Label = 64, label_text; - /// A campaign slug or key segment: label parts joined by `.`. - Slug = 64, dotted_text; - /// A git commit id: 7-40 lowercase hex characters. - Sha = 40, |field, value| hex(field, value, 7..=40); - /// A full git commit id: exactly 40 lowercase hex characters. - FullSha = 40, |field, value| hex(field, value, 40..=40); - /// A SHA-256 digest: exactly 64 lowercase hex characters. - Sha256Hex = 64, |field, value| hex(field, value, 64..=64); -} - -impl Sha { - /// The type's identity rule: two spellings name one commit when one is a - /// prefix of the other, so a 7-character abbreviation and the full id of - /// the same commit are equal here though not `==`. Both are already 7-40 - /// lowercase hex. Two distinct commits that share a 7-character prefix are - /// git's ambiguity, not the mind's. - pub fn names_same_commit(&self, other: &Sha) -> bool { - self.0.starts_with(&other.0) || other.0.starts_with(&self.0) - } -} - -impl Slug { - /// The public door onto the slug grammar, for a caller outside this crate - /// that holds a bare `Slug` and no way to reach `Bounded`, which is - /// crate-private. On the pattern of `PipelineRef::validate_ref`: it - /// delegates so the grammar keeps one owner, and it applies exactly the - /// `dotted_text` check that every `Slug` field in this crate is held to, - /// so a caller that validates a declared name this way and a document - /// field of the same type refuse the same inputs. Named `validate_slug` - /// rather than a bare `validate`, because an inherent `validate` would - /// shadow `Bounded`'s for every in-crate caller holding a `Slug`. - pub fn validate_slug(&self) -> Result<(), PipelineRefusal> { - Bounded::validate(self, "slug") - } -} - -/// A GitHub repository as `Org/Repo`, at most 140 UTF-8 bytes (39 + 1 + -/// 100). The owner is 1 to 39 `[A-Za-z0-9-]` bytes with no leading or -/// trailing hyphen; the repo is 1 to 100 `[A-Za-z0-9._-]` bytes, is never -/// `.` or `..`, and does not end in `.git`, ASCII-case-insensitively. -/// Identity is case-insensitive: `GameCult/Epiphany` and `gamecult/epiphany` -/// are the same repository. -// -// The raw string is display-only. `OrgRepo` is not generated by -// `bounded_text!`: that macro derives `PartialEq`, `Eq`, `Hash`, `PartialOrd` -// and `Ord` on the raw string, with no per-member override, so a type built -// from it compares and keys on spelling. `OrgRepo` instead carries -// hand-written impls of those five traits, every one of them over -// `identity()` (the ASCII-lowercased value), so `==`, a `BTreeMap` key and a -// `HashMap` key are all case-insensitive by construction: `GameCult/Epiphany` -// and `gamecult/epiphany` compare equal, hash equal, order together and -// collapse to one map entry, and a caller cannot reach the case-sensitive -// behaviour by accident. `Hash` and `Eq` agree because both are defined over -// the same `identity()` string. Every other bounded type keeps the macro's -// derives untouched. This reasoning is a source comment, not a doc comment, -// so it does not enter the published schema description (RS-L closing fix 2): -// a consumer needs the grammar, the bound and the case-insensitivity, not the -// Rust-macro justification for how that got built. -#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)] -#[serde(transparent)] -#[schemars(extend("maxLength" = 140))] -pub struct OrgRepo(pub String); - -impl Bounded for OrgRepo { - fn validate(&self, field: &str) -> Result<(), PipelineRefusal> { - org_repo_text(field, &self.0) - } -} - -impl From<&str> for OrgRepo { - fn from(value: &str) -> Self { - Self(value.into()) - } -} - -impl PartialEq for OrgRepo { - fn eq(&self, other: &Self) -> bool { - self.identity() == other.identity() - } -} - -impl Eq for OrgRepo {} - -impl std::hash::Hash for OrgRepo { - fn hash(&self, state: &mut H) { - self.identity().hash(state); - } -} - -impl PartialOrd for OrgRepo { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} - -impl Ord for OrgRepo { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.identity().cmp(&other.identity()) - } -} - -impl OrgRepo { - /// The public door onto the `org_repo` grammar, for a caller outside this - /// crate that holds a bare `OrgRepo` (the organ's `repo` alias, RS-3) and - /// no way to reach `Bounded`. On the pattern of `Slug::validate_slug`: it - /// delegates to `org_repo_text` through `Bounded::validate`, so the - /// grammar keeps one owner and a declared name checked this way refuses - /// exactly what a document's own `OrgRepo` field refuses. - pub fn validate_org_repo(&self) -> Result<(), PipelineRefusal> { - Bounded::validate(self, "org_repo") - } - - /// The one canonical key for an `OrgRepo`: the value, ASCII-lowercased. - /// Every comparison, hash, ordering and lookup keyed by repository - /// identity goes through this — `PartialEq`, `Hash` and `Ord` above are - /// all defined in terms of it — so `GameCult/Epiphany` and - /// `gamecult/epiphany` are the same repository everywhere, not only where - /// a caller remembers to ask. - pub fn identity(&self) -> String { - self.0.to_ascii_lowercase() - } -} - -impl Label { - /// The public door onto the label grammar, for a caller outside this - /// crate that holds a bare `Label` (the organ's `cut` alias, RS-3) and no - /// way to reach `Bounded`. On the pattern of `Slug::validate_slug`: it - /// delegates to `label_text` through `Bounded::validate`, so the grammar - /// keeps one owner and a declared name checked this way refuses exactly - /// what a document's own `Label` field refuses. - pub fn validate_label(&self) -> Result<(), PipelineRefusal> { - Bounded::validate(self, "label") - } -} - -/// A calendar date, `YYYY-MM-DD`. -#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema)] -#[serde(transparent)] -#[schemars(extend("maxLength" = 10))] -pub struct Date(pub String); - -impl Bounded for Date { - fn validate(&self, field: &str) -> Result<(), PipelineRefusal> { - match chrono::NaiveDate::parse_from_str(&self.0, "%Y-%m-%d") { - Ok(_) if self.0.len() == 10 => Ok(()), - _ => Err(format_error(field, &self.0)), - } - } -} - -macro_rules! bounded_field { - ($value:expr, $field:expr) => { - Bounded::validate(&$value, $field)? - }; - ($value:expr, $field:expr, $max:literal) => { - list($field, &$value, $max)? - }; -} - -/// The single field list: one invocation emits the value struct and its -/// `Bounded` impl, so a field can never be left out of validation. -macro_rules! value_types { - ($($(#[$attr:meta])* pub struct $name:ident { $($field:ident: $ty:ty $([$max:literal])? $(= $marker:ident)?),* $(,)? } $(=> $extra:path)?)*) => {$( - $(#[$attr])* - #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] - pub struct $name { - $( - $(#[schemars(extend("maxItems" = $max))])? - // `= absent`: defaulted on read, omitted on write when absent. - // The `cfg_attr(any(), ..)` is a no-op that binds `$marker` to the group. - $(#[serde(default, skip_serializing_if = "Absent::absent")] #[cfg_attr(any(), $marker)])? - pub $field: $ty - ),* - } - - impl Bounded for $name { - fn validate(&self, at: &str) -> Result<(), PipelineRefusal> { - $( - $(let _: fn(&$ty) -> bool = <$ty as Absent>::$marker;)? - bounded_field!(self.$field, &format!("{at}.{}", stringify!($field)) $(, $max)?); - )* - $($extra(self, at)?;)? - Ok(()) - } - } - )*}; -} - -macro_rules! unit_enums { - ($($name:ident { $($variant:ident),* $(,)? })*) => {$( - #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema)] - pub enum $name { $($variant),* } - impl $name { - /// The variants' spellings, in declaration order: the names the wire and - /// `Debug` use. - pub const NAMES: &'static [&'static str] = &[$(stringify!($variant)),*]; - } - impl Bounded for $name { - fn validate(&self, _field: &str) -> Result<(), PipelineRefusal> { - Ok(()) - } - } - )*}; -} - -/// RS-L closing fix 4: a repo list refuses two entries naming the same -/// repository by identity, not by raw spelling, so `GameCult/Epiphany` and -/// `gamecult/epiphany` in one list refuse exactly as one entry twice would. -/// This is a cross-element invariant on the lists alone, not a per-type format -/// rule any other `value_types!` struct shares, so it is wired in as the -/// `=> extra` hook of the two structs that carry a repo list -/// (`PipelineCampaign.repos` and `PipelineTarget.repos`) rather than folded -/// into `Bounded for OrgRepo` or the list bound in `bounded_field!`. -fn repos_are_distinct(repos: &[OrgRepo], at: &str) -> Result<(), PipelineRefusal> { - let mut seen = std::collections::HashSet::new(); - for repo in repos { - if !seen.insert(repo.identity()) { - return Err(PipelineRefusal::DuplicateRepo { - field: format!("{at}.repos"), - repo: repo.0.clone(), - }); - } - } - Ok(()) -} - -fn campaign_repos_are_distinct(campaign: &PipelineCampaign, at: &str) -> Result<(), PipelineRefusal> { - repos_are_distinct(&campaign.repos, at) -} - -fn target_repos_are_distinct(target: &PipelineTarget, at: &str) -> Result<(), PipelineRefusal> { - repos_are_distinct(&target.repos, at) -} - -/// The most lines one read anchor may span. -const READ_WINDOW_MAX_LINES: u32 = 100; - -/// A location starts at line 1 or later, ends no earlier than it starts, and a -/// read anchor spans at most `READ_WINDOW_MAX_LINES`. The bounds are on -/// `ReadAnchor` alone: `CodeLocation` elsewhere keeps its stored shape. -fn read_window_is_bounded(anchor: &ReadAnchor, at: &str) -> Result<(), PipelineRefusal> { - let location = &anchor.location; - if location.line < 1 { - return Err(format_error(&format!("{at}.location.line"), &location.line.to_string())); - } - if let Some(end_line) = location.end_line { - if end_line < location.line { - return Err(format_error(&format!("{at}.location.end_line"), &end_line.to_string())); - } - let span = end_line - location.line + 1; - if span > READ_WINDOW_MAX_LINES { - return Err(PipelineRefusal::FieldBound { - field: format!("{at}.location.end_line"), - limit: READ_WINDOW_MAX_LINES, - actual: span, - }); - } - } - Ok(()) -} - -/// A run claims work, never runs, rulings or campaigns: its claims are cut -/// specs, findings and follow-ups, the three kinds a Self takes on. And its -/// budget is a canonical decimal (`0`, `12`, `7.5`: no sign, no leading or -/// trailing zeros, no exponent), so one spend has one spelling. -fn run_is_well_formed(run: &PipelineRun, at: &str) -> Result<(), PipelineRefusal> { - for (index, claim) in run.claims.iter().enumerate() { - if !matches!(claim.kind, PipelineKind::CutSpec | PipelineKind::Finding | PipelineKind::FollowUp) { - return Err(format_error(&format!("{at}.claims[{index}].kind"), claim.kind.name())); - } - if run.claims[..index].contains(claim) { - return Err(format_error(&format!("{at}.claims[{index}]"), &claim.id.0)); - } - } - let (whole, fraction) = run.budget_usd.0.split_once('.').map_or((run.budget_usd.0.as_str(), None), |(whole, fraction)| (whole, Some(fraction))); - let digits = |text: &str| !text.is_empty() && text.bytes().all(|byte| byte.is_ascii_digit()); - let canonical = digits(whole) - && (whole == "0" || !whole.starts_with('0')) - && fraction.is_none_or(|fraction| digits(fraction) && !fraction.ends_with('0')); - if canonical { - Ok(()) - } else { - Err(format_error(&format!("{at}.budget_usd"), &run.budget_usd.0)) - } -} - -/// The longest and shortest beat a Mind may vote for, in seconds. -pub const TEMPO_VOTE_MIN_S: u32 = 60; -pub const TEMPO_VOTE_MAX_S: u32 = 86_400; -/// Urgency is in thousandths: 0 declares none, 1000 the most. -pub const URGENCY_MAX_PERMILLE: u16 = 1000; - -/// A pulse votes a tempo or declares an urgency, in bounds, or says nothing it -/// could be read for: an empty pulse is refused. -fn pulse_is_well_formed(pulse: &PipelinePulse, at: &str) -> Result<(), PipelineRefusal> { - if let Some(beat) = pulse.tempo_vote_beat_s - && !(TEMPO_VOTE_MIN_S..=TEMPO_VOTE_MAX_S).contains(&beat) - { - return Err(format_error(&format!("{at}.tempo_vote_beat_s"), &beat.to_string())); - } - if let Some(urgency) = pulse.urgency_permille - && urgency > URGENCY_MAX_PERMILLE - { - return Err(format_error(&format!("{at}.urgency_permille"), &urgency.to_string())); - } - if pulse.tempo_vote_withdrawn && pulse.tempo_vote_beat_s.is_some() { - return Err(format_error(&format!("{at}.tempo_vote_withdrawn"), "a pulse that votes a beat and withdraws the vote")); - } - if pulse.tempo_vote_beat_s.is_none() && !pulse.tempo_vote_withdrawn && pulse.urgency_permille.is_none() { - return Err(format_error(&format!("{at}.tempo_vote_beat_s"), "a pulse that votes and declares nothing")); - } - Ok(()) -} - -/// The most thousandths a memory's salience may carry. -pub const SALIENCE_MAX_PERMILLE: u16 = 1000; - -/// A memory says something (its text is not empty), its salience is in -/// thousandths, and it consolidates only memories. -fn memory_is_well_formed(memory: &PipelineMemory, at: &str) -> Result<(), PipelineRefusal> { - if memory.text.0.trim().is_empty() { - return Err(format_error(&format!("{at}.text"), "an empty memory")); - } - if let MemoryOrigin::Direct { with, .. } = &memory.origin - && with.is_empty() - { - return Err(format_error(&format!("{at}.origin.with"), "a direct memory that names no one she heard it from")); - } - if memory.salience_permille > SALIENCE_MAX_PERMILLE { - return Err(format_error(&format!("{at}.salience_permille"), &memory.salience_permille.to_string())); - } - for (index, entry) in memory.consolidates.iter().enumerate() { - if entry.kind != PipelineKind::Memory { - return Err(format_error(&format!("{at}.consolidates[{index}].kind"), entry.kind.name())); - } - } - Ok(()) -} - -unit_enums! { - EvidenceKind { Command, Test, Mutation, Probe, SourceRead, Capture } - ClaimOutcome { Holds, Falsified, Unproven } - FindingConfidence { Confirmed, Plausible } - FindingSeverity { Blocker, High, Medium, Low } - RulingAuthority { Operator, Standing, Defaulted, Mind } - FindingOrigin { Introduced, PreExisting } - RunOperator { Operator, Mind } - RunTurn { PersonaTurn, SelfRun } - MemorySort { Asked, Decided, Committed, Learned, Did, Idea, Rapport } -} - -value_types! { - pub struct CodeLocation { path: Short, line: u32, end_line: Option, symbol: Option = absent } - pub struct CommitRange { base: Sha, head: Sha } - pub struct Evidence { kind: EvidenceKind, locator: Line, result: Line } - /// A citation of a document in another repo's pipeline store (D6). - pub struct ForeignRef { repo: OrgRepo, commit: FullSha, kind: PipelineKind, id: Short, payload_sha256: Sha256Hex } - pub struct DocRef { path: Short, start_line: u32, end_line: u32, commit: Sha } - pub struct TargetInvariant { label: Label, statement: Line } - pub struct QuestionOption { label: Label, text: Line } - pub struct CutDelete { path: Short, lines: u32, note: Line } - pub struct FileChange { location: CodeLocation, change: Line } - /// Code Hands must see but not change, in the spec's repo at the spec's base. - pub struct ReadAnchor { location: CodeLocation, why: Short } => read_window_is_bounded - pub struct AuthorityMap { - owner: Line, inputs: Vec[16], outputs: Vec[16], derived_state: Vec[16], - forbidden_writers: Vec[16], shared_paths: Vec[16], deletion_line: Line, - } - pub struct VerificationTest { name: Short, pins: Line } - pub struct NegativeCheck { pattern: Short, scope: Line } - pub struct CutVerification { - builds: Vec[64], tests: Vec[64], - negative: Vec[64], operator: Vec[64], - } - pub struct ReportCommit { sha: Sha, subject: Line, builds: bool } - /// One mutation a report ran: a key-safe label a verdict claim can name, - /// the exact edit, and the tree it was applied to. - pub struct MutationRecord { label: Label, rule: Line, location: CodeLocation, before: Line, after: Line, commit: Sha, failed_as_expected: bool } - pub struct Deviation { what: Line, why: Line } - // D1 tables no maximum for these lists, so they take the shared list - // default of 64 rather than a number invented for this field alone. - pub struct StructuralDelta { - lines_added: u32, lines_removed: u32, - dependencies_added: Vec[64], dependencies_removed: Vec[64], - formats_added: Vec[64], formats_removed: Vec[64], - targets_added: Vec[64], targets_removed: Vec[64], - } - /// A name the cut landed, and where it lives. - pub struct LandedName { name: Short, path: Short } - /// A promise a report makes about what it landed. Not a document and not - /// resolvable: it is identified by its report's id and its label, as a - /// `TargetInvariant` is by its target's. Soul measures every one (ruling - /// A), and the rule that every one is measured is admission's. - pub struct Promise { label: Label, text: Line } - /// The promise this claim measured, and the report's mutations it ran. An - /// `Unproven` claim with a promise is one Soul could not reach. - pub struct VerdictClaim { - claim: Line, outcome: ClaimOutcome, evidence: Vec[8], findings: Vec[16], - promise: Option