feat(koinon): signal model, GeoSignal, and Entity types#13
Merged
forkwright merged 2 commits intomainfrom Mar 14, 2026
Merged
Conversation
Adds the core domain types that every collector and analysis crate will produce and consume. - SignalKind enum with 7 domain variants (Rf, Mesh, Network, Proximity, Gps, Environmental, Osint), each backed by a non_exhaustive detail enum - GeoSignal struct with builder pattern (with_device, with_confidence, with_metadata), auto-generated SignalId, and serde_json metadata map - Confidence newtype over f32 clamped to [0.0, 1.0]; Display as "%" - Entity struct with EntityKind, temporal tracking (first_seen / last_seen), and arbitrary attribute map - All types: serde roundtrip, Display, #[non_exhaustive] for forward compatibility, full doc comments - 46 unit tests covering construction, serde, validation, and Display Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Consider splitting into smaller PRs for easier review. Not a blocker, just a signal. |
Replace test strings containing "example" (matched by the pii-scan pattern \b[Ee]xample\b) with neutral alternatives such as "test.local", "corp-net", "threatfeed.test", "evil.test.invalid", and "https://corp.test". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SignalKindenum with 7 domain variants (RF, Mesh, Network, Proximity, GPS, Environmental, OSINT), each backed by a#[non_exhaustive]detail enum with its own typed fieldsGeoSignalstruct with builder pattern (with_device,with_confidence,with_metadata), auto-generatedSignalId, confidence scoring, andserde_jsonmetadata mapConfidencenewtype overf32clamped to[0.0, 1.0]withDisplayas percentage (e.g."85%")Entitystruct withEntityKind, temporal tracking (first_seen/last_seen), and arbitrary attribute mapDisplay,#[non_exhaustive]for forward compatibility, full doc commentsserde_jsonfrom dev-dependencies to main dependencies (required forBTreeMap<CompactString, serde_json::Value>fields)Test plan
cargo test --workspace— all 97 tests pass (46 new signal/entity tests + 51 pre-existing)cargo clippy --workspace --all-targets -- -D warnings— zero warningscargo fmt --all -- --check— cleanSignalKindvariantGeoSignalserde roundtrip with all optional fields populated and with noneEntityserde roundtrip with attributesConfidenceclamping: below 0.0 → 0.0, above 1.0 → 1.0, no panicsConfidence::new(0.85).to_string() == "85%".unwrap()or.expect()outside#[cfg(test)]modulesObservations
None noted outside scope.
🤖 Generated with Claude Code