Skip to content

test: add C portable fault classifier module#79

Merged
div0rce merged 1 commit into
mainfrom
test/c-portable-fault-classifier
May 26, 2026
Merged

test: add C portable fault classifier module#79
div0rce merged 1 commit into
mainfrom
test/c-portable-fault-classifier

Conversation

@div0rce

@div0rce div0rce commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a small deterministic pure-C fault classifier module with host-native Unity coverage. This change is software-only and does not add new hardware evidence.

Changes

  • Added fault_classifier.h / fault_classifier.c under components/app_core.
  • Added native Unity tests for invalid config, ADC low/high faults, stale samples, valid samples, and boundary behavior.
  • Wired the module into ESP-IDF app-core CMake and PlatformIO native source filtering, and documented it in the evidence map.

Validation Tasks

  • git status --short --branch
  • git diff --check
  • platformio test -e native
  • scripts/check_app_core_includes.sh
  • ESP-IDF RTOS backend build
  • ESP-IDF cooperative backend build
  • Claim-safety grep contains only explicit non-claim boundary wording

@div0rce div0rce merged commit 24e6b20 into main May 26, 2026
7 checks passed
@div0rce div0rce deleted the test/c-portable-fault-classifier branch May 26, 2026 02:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 14eccf3113

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return FAULT_CLASSIFIER_INVALID_CONFIG;
}

if (sample_age_ms > config->stale_timeout_ms) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Classify timeout-boundary samples as stale

Use >= for the stale-age check so samples at exactly stale_timeout_ms are treated as stale; with the current > condition, sample_age_ms == stale_timeout_ms returns FAULT_CLASSIFIER_OK, which is inconsistent with the existing watchdog timeout semantics (elapsed_ms_u32 uses >= and backend fault checks trigger at the configured timeout). In scenarios where age lands exactly on the boundary, this delays stale-fault detection by one tick.

Useful? React with 👍 / 👎.

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