Commit graph Huginn/crates/eureka-state/tests
Author SHA1 Message Date
Meta Vens
c46b0ec183 Rename the pipeline leaf to eureka-pipeline and take it as a path dependency
Package and lib become eureka-pipeline / eureka_pipeline; the crate joins the
workspace; huginn-mind's git dependency on GameCult/Epiphany is replaced by
the path, and Cargo.lock is regenerated (the Epiphany source entry is gone).
Every epiphany_pipeline mention in huginn-mind, huginn-daemon and eureka-state
is renamed. The schema-publication test reads ../../schemas/cultnet. The
leaf's license-file key (../LICENSE, which Huginn has no file for) is dropped.
Type ids, the epoch and every schema_id string are untouched. Schemas README
and the pipeline section of schemas/cultnet/README.md are rewritten for the
new home; README and AGENTS no longer say the leaf is pinned by git. New test:
the catalogue lists exactly the schema files beside it.

Not yet built or tested; verification follows on Yggdrasil.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:09:16 +02:00
Meta Vens
f29a7ce7f0 huginn-mind: tighten the refusal and read-back tests (Soul s1 findings)
snapshot_admits_and_reads_back now counts pipeline envelopes apart from the
loop, asserts validate() and pipeline_key == stored key for every one, admits
a resolution for every stuck finding and a withdrawal for every unwithdrawable
resolution, and fails with the id named on any refusal.

The refusal tests assert the exact leaf refusal (field and value from
pipeline_key) at Mind::admit and at the helper, and eureka-state gains a
tool-level test that the typed refusal reaches the result intact.

Tests only; no production code changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-01 12:10:19 +02:00
Meta Vens
cd3dfc0268 eureka-state: an encode failure is not retryable, and a non-UTF-8 endpoint is pinned
A request that fails to encode is a defect in this client, not a transport
failure, so it is ClientError::Unencodable, typed Unencodable at the tool,
instead of the retryable Unavailable. A test reports a non-UTF-8
HUGINN_ENDPOINT as such.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 04:55:05 +02:00
Meta Vens
c2b2952749 eureka-state tests: reach the limit through the source runtime id, seed the stewardship
The source runtime id adds its field name when present, so exact sizes are
searched over both paddings. The attribution test admits a campaign, which
needs its repo stewarded first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 03:04:04 +02:00
Meta Vens
db40a6647b eureka-state tests: size the oversize requests the way base64 allows
Request sizes step by four (the payload rides as base64), so a request of
exactly the limit is not reachable through the request. The client tests use
the largest request that fits and the smallest that does not; the raw-socket
test tops a message up with a source runtime id to reach the limit and one
byte past it, which pins the limit against the transport's own refusal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 02:54:54 +02:00
Meta Vens
890a00b0de eureka-state: typed TooLarge, typed InvalidInput, and the pins Soul found missing
- The client refuses a request whose encoded size exceeds what one RUDP send
  carries (65,507 less the 36-byte header and the 6-byte channel id), before
  connecting, as ClientError::TooLarge { bytes, limit }. It was reported as
  a retryable Unavailable ("Message too long"). The MCP tools surface it as
  isError with {"error":"TooLarge","bytes","limit"}.
- Arguments that fail to deserialize are still a tool error, now with the
  same typed body as every other one: {"error":"InvalidInput","detail"}.
- A non-UTF-8 EUREKA_INSTANCE or HUGINN_ENDPOINT is reported as not valid
  UTF-8 and not as unset.
- Tests: the schema walk asserts no $id or $schema below any tool's root; the
  15 s timeout is measured against a silent daemon; the semantic part of a
  query is observed on the wire; Internal's and TooLarge's bodies and the
  InvalidInput rewrite are pinned; attribution is refused through the MCP
  admit; oversize is TooLarge at and one past the limit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 02:51:50 +02:00
Meta Vens
120e0a6e5a eureka-state tests: initialize must advertise the tools capability
cargo-mutants on the Cut 13b diff: replacing get_info with Default::default()
survived, and a client that does not see a tools capability does not list tools.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 01:41:14 +02:00
Meta Vens
63ac5038c9 eureka-state tests: seed the stewardship, pin the schema path, malformed input is a tool error
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 01:01:22 +02:00
Meta Vens
295b602b2e eureka-state tests: common names PipelineRef
8041d82 did not build on its own: the moved Inert index names PipelineRef and
the import stayed behind in client.rs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 00:42:07 +02:00
Meta Vens
03eb670db3 eureka-state: drop the imports the fixture move left unused, and expect the router field
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 00:39:03 +02:00
Meta Vens
e0f07c3f53 eureka-state: the MCP server, four tools 1:1 with the wire
The eureka-state binary serves whoami, admit, view and query over stdio (rmcp
2.2.0), each one HuginnClient call. EUREKA_INSTANCE and HUGINN_ENDPOINT are
process configuration: the server fills in the instance and provenance.tool, so
input can name neither. Bad configuration never stops startup; whoami reports
it and every other tool refuses with the typed body. A mind's refusal is a
normal result; Unavailable, Rejected and Misconfigured are results with
isError. The query input schema bundles CultLib's selection schema into $defs
(vendored; a test pins it to the cultnet-rs revision).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 00:36:33 +02:00
Meta Vens
8041d82fe1 eureka-state tests: the in-process daemon fixtures move to tests/common
The daemon half of the client's fixtures (an in-process daemon over a temporary
mind on a loopback port, and the scripted server) becomes tests/common/mod.rs,
so the MCP binary's tests (Cut 13b) drive the same daemon instead of a second
copy of it. No behaviour change; client.rs shrinks by the moved lines.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 00:36:18 +02:00
Meta Vens
3dc50eec8e eureka-state: whole-call deadline, correlated answers, Rejected, disconnect
The timeout now bounds the whole call: one deadline at call start, every wait
gets what remains, so a chunk-by-chunk deferred body cannot outlive it. The
response's message id and operation are checked against the request. An
envelope-level OperationFailure is ClientError::Rejected, distinct from the
transport's Unavailable, so a retry on Unavailable cannot loop on a permanent
protocol mismatch. Every call disconnects its session, success or failure.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 00:16:33 +02:00
Meta Vens
26f4137d55 Pin the client's configured instance against a mutation that replaces it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:46:33 +02:00
Meta Vens
272dc09800 Add the eureka-state client core: HuginnClient::call
One call carries one HuginnMindRequest to a daemon over CultNet RUDP on the
operation connection and returns the mind's own HuginnMindResponse. Each call
is its own session and nothing survives it. A Deferred answer is fetched on
that session through cultnet-rs's fetch_content, capped at huginn-mind's
MAX_DEFERRED_BODY_BYTES, and decoded, so a caller never sees the deferral.
Refusals are answers. ClientError::Unavailable is the only error and names the
endpoint. The client opens no store and admits nothing.

Tests run a real daemon in-process on a loopback port over a temporary mind,
plus scripted servers for the failures a daemon cannot be made to produce.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 23:41:25 +02:00