Repository navigation
test(bt): pin the advertise refusal and stop guard exits - #97
Merged
Merged
Conversation
PR-14 remediation (PLAN §18): PR #93's squash merge dropped fix-lane commit a67b115, so on main all three guard-exit deletions passed the host suite undetected (M1 gate-refusal return, M2 non-OK-classification return, M3 unconditional stop latch -- each verified passing pre-pin). Port a67b115's brace-matched if_body() extractor and checks 3b/4c onto the evolved suite (now with the compiled editor-mapping harness): - 3b: the gate-refusal block must contain 'return ERROR;' and never 'bt_cmd_process('; the non-OK-reply block must contain 'return ERROR;' and never set g_bt_adv_active. - 4c: 'stopped = 1U' appears exactly once, only inside the brace-matched classify == M1_BT_ADV_REPLY_OK condition of bt_adv_exec_stop, with no '||' bypass. Mutation verification: baseline 92/92 green; M1/M2/M3 applied in isolation each fail the suite (1 FAIL each); source reverted clean.
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.
Why
PR #93 (BT adv editor, PLAN unit PR-12) was squash-merged to main without fix-lane commit
a67b115(reset away by a concurrent session pre-merge). That commit carried guard-exit regression pins; without them, three safety-exit mutations were verified to pass the entire host suite on main undetected — the existing ordering/polarity pins see the guard's condition but not its body:mainreturn ERROR;(m1_bt.c:1809)return ERROR;(m1_bt.c:1827)stopped = 0U;→1U;(m1_bt.c:1845)Concretely: M1 sends the
advcommand on firmware the gate just refused; M2 latchesg_bt_adv_activeafter anADV:FAILreply; M3 reports "stopped" without ever consulting the console.What
Test-only hardening of
m1_csrc/test/m1_bt_adv_test.py(adaptsa67b115's pins onto the suite as it exists on main, which has since gained the compiled editor-mapping harness — 85 → 92 checks; no existing check weakened or duplicated; reuses the suite's existingfunction()extractor style):if_body()extractor — brace-matched, string/comment-aware body of anif (<cond>) { ... }(same token discipline asfunction()/switch_block()); extraction anchored in thebt_adv_exec_start/bt_adv_exec_stopfunction bodies.if (!esp_feature_gate_allows(gate.state))) must containreturn ERROR;and neverbt_cmd_process(; the non-OK block (if (m1_bt_adv_classify_reply(g_bt_scratch) != M1_BT_ADV_REPLY_OK)) must containreturn ERROR;and never setg_bt_adv_active.stopped = 1U;appears exactly once inbt_adv_exec_stop, only inside the brace-matched condition chaining build ∧ send-success ∧m1_bt_adv_classify_reply(...) == M1_BT_ADV_REPLY_OK, with no||bypass.[Unreleased]entry.Mutation evidence (with these pins)
return ERROR;gate refusal block returns ERRORreturn ERROR;non-OK reply block returns ERRORstopped = 0U;→1U;stopped is assigned exactly onceEach mutation applied in isolation, source reverted (
git checkout -- m1_csrc/m1_bt.c) between runs. Full wired host suite (sh scripts/run_host_tests.sh) green.Scope