[Grid agent] Build deterministic fake-grid, fake-LLM, and adversarial test infrastructure #133

Closed
opened 2026-08-17 19:31:38 +00:00 by hugo · 1 comment
Owner

Objective

Provide deterministic, credential-free infrastructure that exercises the complete agent orchestration against scripted grid and LLM peers, including adversarial security and bounded-load scenarios.

Harnesses

  • Extend/reuse the repository's fake-grid patterns to script login, readiness, chat, IM, inventory offers, avatars/objects, movement, teleports, object creation, capability replies, disconnects, maintenance, delays, duplicates, malformed packets, and partial failures.
  • Implement a local fake OpenAI-compatible HTTP endpoint that records redacted requests and scripts text, tool calls, malformed/oversized responses, rate limits, slow streams, disconnects, duplicate IDs, and multimodal acceptance/rejection.
  • Drive the real service orchestration, policy, storage, control protocol, and optional TUI reducer with paused/injectable clocks and seeded randomness. Fakes must implement the same backend traits used in production.
  • Add adversarial corpora for prompt injection through every untrusted field, authorization spoofing, session cross-talk, approval replay, tool-loop exhaustion, reconnect races, event/log flooding, corrupt persistence, and secret canaries.

Required scenarios

  • A multi-avatar social session with exact public/IM timeout behavior and fair inference scheduling.
  • Maintenance disconnect/reconnect during inference and during each mutating workflow, proving generation fencing and cleanup.
  • Public LSL request success plus attempts to escalate into teleport/build/admin actions.
  • Authorized landmark roaming, build approval/cancel, visual fallback, operator control, journal replay, and graceful shutdown.
  • Bounded load sufficient to measure queue depth, memory high-water, response/control latency, dropped-event accounting, and zero leaked tasks/sockets.

Acceptance criteria

  • All tests run offline, without credentials, external network, wall-clock sleeps, nondeterministic randomness, or platform services.
  • Test failures print redacted seeds/scripts and correlation IDs sufficient to reproduce locally.
  • Every production world mutation and policy route has fake protocol evidence, not only mocked method-call assertions.
  • CI integration uses the existing consolidated Gitea gate on ubuntu-latest only and respects its runtime budget; longer soak scenarios are explicit non-routine jobs if needed.

Dependencies

Start the base fakes after architecture and grow them alongside every feature. Completion depends on all functional issues except packaging and final live validation.

## Objective Provide deterministic, credential-free infrastructure that exercises the complete agent orchestration against scripted grid and LLM peers, including adversarial security and bounded-load scenarios. ## Harnesses - Extend/reuse the repository's fake-grid patterns to script login, readiness, chat, IM, inventory offers, avatars/objects, movement, teleports, object creation, capability replies, disconnects, maintenance, delays, duplicates, malformed packets, and partial failures. - Implement a local fake OpenAI-compatible HTTP endpoint that records redacted requests and scripts text, tool calls, malformed/oversized responses, rate limits, slow streams, disconnects, duplicate IDs, and multimodal acceptance/rejection. - Drive the real service orchestration, policy, storage, control protocol, and optional TUI reducer with paused/injectable clocks and seeded randomness. Fakes must implement the same backend traits used in production. - Add adversarial corpora for prompt injection through every untrusted field, authorization spoofing, session cross-talk, approval replay, tool-loop exhaustion, reconnect races, event/log flooding, corrupt persistence, and secret canaries. ## Required scenarios - A multi-avatar social session with exact public/IM timeout behavior and fair inference scheduling. - Maintenance disconnect/reconnect during inference and during each mutating workflow, proving generation fencing and cleanup. - Public LSL request success plus attempts to escalate into teleport/build/admin actions. - Authorized landmark roaming, build approval/cancel, visual fallback, operator control, journal replay, and graceful shutdown. - Bounded load sufficient to measure queue depth, memory high-water, response/control latency, dropped-event accounting, and zero leaked tasks/sockets. ## Acceptance criteria - [ ] All tests run offline, without credentials, external network, wall-clock sleeps, nondeterministic randomness, or platform services. - [ ] Test failures print redacted seeds/scripts and correlation IDs sufficient to reproduce locally. - [ ] Every production world mutation and policy route has fake protocol evidence, not only mocked method-call assertions. - [ ] CI integration uses the existing consolidated Gitea gate on `ubuntu-latest` only and respects its runtime budget; longer soak scenarios are explicit non-routine jobs if needed. ## Dependencies Start the base fakes after architecture and grow them alongside every feature. Completion depends on all functional issues except packaging and final live validation.
hugo added this to the 14 - metacrate grid agent milestone 2026-08-17 19:31:38 +00:00
hugo added the enhancement label 2026-08-17 19:31:38 +00:00
Author
Owner

Implemented in fe8d011. Added metacrate-grid-agent::testing with a unified deterministic FakeGrid implementing the production session, perception, embodiment, build, landmark, script-inventory, interaction, and authorized policy backend traits. It scripts lifecycle and grid protocol inputs (chat/IM/offers/avatar/object/movement/teleport/create/capability/delay/duplicate/malformed/partial failure), emits content-free SHA-256 protocol evidence, enforces generation/resource accounting, and reports redacted seed/script/correlation reproduction context. Added an injectable clock, seeded behavior/roaming randomness, adversarial corpus, bounded-load/leak metrics, and a loopback OpenAI-compatible peer scripting text/tools/malformed/oversize/rate-limit/slow/disconnect/multimodal paths while retaining only redacted request metadata. Replaced the policy counter mock with the unified protocol peer. Namespace constraints remain enforced: all infrastructure is metacrate-grid-agent; no new libremetaverse crate or compatibility-facade reexport. Verification: new harness 4/4, policy integration 3/3, dependency policy 7/7, full related metacrate-grid-agent suite 135 unit tests plus every integration/doc test, all-feature all-target clippy -D warnings, rustdoc, formatting/diff checks. The existing consolidated Gitea gate automatically discovers the integration test and all workflows remain ubuntu-latest only.

Implemented in fe8d011. Added metacrate-grid-agent::testing with a unified deterministic FakeGrid implementing the production session, perception, embodiment, build, landmark, script-inventory, interaction, and authorized policy backend traits. It scripts lifecycle and grid protocol inputs (chat/IM/offers/avatar/object/movement/teleport/create/capability/delay/duplicate/malformed/partial failure), emits content-free SHA-256 protocol evidence, enforces generation/resource accounting, and reports redacted seed/script/correlation reproduction context. Added an injectable clock, seeded behavior/roaming randomness, adversarial corpus, bounded-load/leak metrics, and a loopback OpenAI-compatible peer scripting text/tools/malformed/oversize/rate-limit/slow/disconnect/multimodal paths while retaining only redacted request metadata. Replaced the policy counter mock with the unified protocol peer. Namespace constraints remain enforced: all infrastructure is metacrate-grid-agent; no new libremetaverse crate or compatibility-facade reexport. Verification: new harness 4/4, policy integration 3/3, dependency policy 7/7, full related metacrate-grid-agent suite 135 unit tests plus every integration/doc test, all-feature all-target clippy -D warnings, rustdoc, formatting/diff checks. The existing consolidated Gitea gate automatically discovers the integration test and all workflows remain ubuntu-latest only.
hugo closed this issue 2026-08-18 10:14:54 +00:00
Sign in to join this conversation.