docs(test): LIM-1322 non-finite ingress qualification evidence

Merged
RM
2d ago
+214-25

User description

Summary

Core non-finite ingress protection for v0.3.0 is already on main (#72, #73, with #76 for run_tick cohesion). This PR closes the remaining acceptance-evidence gaps called out on LIM-1322:

  • Regression tests that a finite packet after rejection is accepted on both the backend StimulusSource path and the direct BoundedIngress enqueue path.
  • User-facing documentation of fail-closed NaN/±Inf handling and the intentional backend vs drained-path tick distinction (zero-fill step vs skip step for that tick).

Review dispositions (already on main)

  • Freshness: observes_ingress requires a finite payload, so rejected non-finite packets never emit IngressObserved / refresh input_freshness (#73).
  • Single count: Already-rejected non-finite backend frames increment rejected_batches once in account_and_admit_backend_packet and are not re-admitted.

Test plan

  • cargo fmt --check
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo test --locked (153 passed)

Evidence: /opt/cursor/artifacts/lim-1322-verification.md

Fixes Limen-Neural/brainstem-daemon#66 (implementation history)

Linear Issue: LIM-1322

Open in Web Open in Cursor 

Summary by cubic

Adds regression tests and documentation proving that a finite packet is accepted after a non-finite ingress is rejected, with a documented fail-closed path for NaN/±Inf across every runtime entry point.

  • Tests cover the backend StimulusSource path, the direct BoundedIngress enqueue path, and a hybrid case where a queued finite sensory packet survives a non-finite backend drop.
  • Documents the tick distinction: a rejected backend packet drains anything already queued and zero-fills only the channels the drained vector does not cover, while drained-path rejection skips network.step for that tick.
  • Rejections bump rejected_batches once, never refresh input_freshness, and leave the daemon live; rate-limited diagnostics apply to the daemon finite gates, with typed source warnings and held-modulator replays called out separately.
  • Shared TickFixture harness deduplicates run_tick setup across repetition, sequence, and direct-enqueue tests, with the sequence case now ticking the fixture directly.

CodeAnt-AI Description

Document and verify non-finite input rejection and recovery

What Changed

  • Documented that NaN and infinite stimuli or modulators are rejected across runtime input paths and do not refresh input freshness.
  • Clarified that a rejected backend packet still allows a zero-filled simulation tick, while a rejected directly queued packet skips that tick’s simulation and spike output.
  • Added regression tests confirming finite input is accepted after a non-finite packet is rejected.

Impact

✅ Clearer NaN and infinity handling
✅ Verified recovery after rejected input
✅ Documented when invalid input skips a simulation tick

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.