Skip to content

fix: correctness bugs in collector, evaluator, and model - #62

Merged
jayelbotvibe-web merged 1 commit into
mainfrom
fix/correctness-bugs
Jul 19, 2026
Merged

fix: correctness bugs in collector, evaluator, and model#62
jayelbotvibe-web merged 1 commit into
mainfrom
fix/correctness-bugs

Conversation

@jayelbotvibe-web

Copy link
Copy Markdown
Owner

Fixes

Bug 1 — WazuhCollector timestamp parsing (highest priority)
parseTimestamp() replaces fragile inline time.Parse with an ordered list of 3 layouts covering Wazuh's actual formats (ms+numeric offset, RFC3339, RFC3339Nano). Added 9-case table test + window-match test.

Bug 2 — 1 of them / all of them silently wrong
evalOneOf/evalAllOf now expand empty Names to all search-identifiers. 1 of them correctly requires at least N matches; all of them correctly requires all identifiers to match. Added them_test.go.

Bug 3 — * wildcards unsupported
matchField now delegates *-containing values to matchWildcard(), which splits on * and matches segments in order (case-insensitive). Works with all existing modifiers. Added 14-case wildcard_test.go.

Doc fix — PARTIAL verdict removed
Deleted model.Partial (never emitted by Evaluator). Removed all references from Go code, DESIGN.md, docs/index.html.

Verification

  • make build: pass
  • make vet: pass
  • go test ./internal/...: pass (all packages, 10-rule regression intact)
  • gofmt: clean on all changed directories

Bug 1 — WazuhCollector timestamp parsing (highest priority):
  parseTimestamp() replaces inline time.Parse with an ordered list of 3 layouts
  covering Wazuh's actual formats (ms+numeric offset, RFC3339, RFC3339Nano).
  Added table test (9 cases) + window-match test in timestamp_test.go.

Bug 2 — "1 of them" / "all of them" silently wrong:
  evalOneOf/evalAllOf now expand empty Names to all search-identifiers when
  the condition uses "them". 1 of them now requires at least N matches
  (was always false); all of them now requires all identifiers to match
  (was vacuous truth).  Added them_test.go with both positive and negative cases.

Bug 3 — * wildcards unsupported:
  matchField now detects * in values and delegates to matchWildcard(),
  which splits on * and matches segments in order (case-insensitive).
  Wildcard works with all existing modifiers.  Added 14-case wildcard_test.go.

Doc fix — PARTIAL verdict removed:
  Deleted const model.Partial (never emitted by Evaluator).  Removed all
  references from main.go, report.go, dashboard.go, DESIGN.md, docs/index.html.
  Verdict states now 4: DETECTED, MISSED, NO_TELEMETRY, INCONCLUSIVE.

All existing tests pass (10-rule regression, collector, evaluator, normalizer).
gofmt applied.  make build && make vet clean.
@jayelbotvibe-web
jayelbotvibe-web merged commit 418a198 into main Jul 19, 2026
2 of 3 checks passed
@jayelbotvibe-web
jayelbotvibe-web deleted the fix/correctness-bugs branch July 19, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant