Skip to content

feat(config): allow for api to set clear bonds on boot - #209

Open
davidt315 wants to merge 2 commits into
mainfrom
david/clear-bonds-on-boot
Open

davidt315 wants to merge 2 commits into
mainfrom
david/clear-bonds-on-boot

Conversation

@davidt315

Copy link
Copy Markdown
Contributor

Prior to this change, the pstop remotes would hold their last configured machine bonds and there was no way to configure this behavior. That means that if a machine node in the field was in use, other remotes that turn on would immediately bond to those machines regardless of the intended use of the remotes.

This change allows for API to set that behavior to to clear the machine bonds on boot such that pstop remotes wake up with no active machine bonds

@graphify-labs graphify-labs 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.

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; formal verification proved 0 of 2 changed function(s) (2 not verified).

Formal verification. PR-changed functions: 0/2 verified (0 proven, 0 may-equivalent, 0 distinguished) · 2 not verified (2 unsupported).

Not verified on this run: dcs\_admin\_pages\_register (unsupported), dcs\_support\_init (unsupported).


Graphify review — findings

Adds an admin-authenticated /api/pstop_clear_bonds_on_boot GET/POST endpoint (remote builds only) that persists an NVS flag; when set, the remote erases all machine peer slots and the legacy ps_ip/ps_port mirror at boot, so it shows WHITE and bonds to nothing until reconfigured via /api/pstop_peers. The default stays off, so the remote still rebonds to its saved machines after a reboot, and the flag takes effect on the next boot. The docs now describe this: the HTTP API table, the multi-remote guide, the troubleshooting WHITE-ring entry, the host and HIL docs. The design doc drops the stale claim that /api/pstop_peer?clear=1 is broken, since it now clears slot 0 and no 127.0.0.1:1 dummy peer is needed to unbond.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 256 functions depend on the 213 functions this change touches.

Health — this change adds coupling hotspots:

  • worse: dcs_support_init() — 2 callers, 33 callees

Verification — 256 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 256 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

85 of 85 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety (noncode-change, uncovered-code) — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • archive/protective_stop_node/protective_stop_node/test_utils/base_test.py — full-run-safety
  • archive/protective_stop_node/test/launch.test.py — full-run-safety
  • archive/protective_stop_node/test/unmonitored_mode.test.py — full-run-safety
  • archive/protective_stop_remote/tests/test_app.py — full-run-safety
  • archive/protective_stop_remote_example/src/App.test.tsx — full-run-safety
  • archive/protective_stop_remote_example/src/client.test.ts — full-run-safety
  • firmware/test/test_dcs_health_logic.c — full-run-safety
  • firmware/test/test_estop_verdict.c — full-run-safety
  • firmware/test/test_lockstep_window.c — full-run-safety
  • host/test_aux_channel.c — full-run-safety
  • host/test_clock_guard.c — full-run-safety
  • host/test_coord_frame_budget.c — full-run-safety
  • host/test_crypto_kat.c — full-run-safety
  • host/test_demote_veto.c — full-run-safety
  • host/test_wg_regain_policy.c — full-run-safety
  • pstop_c/pstop/test/include/pstop/requirements/test_utils.h — full-run-safety
  • pstop_c/pstop/test/src/pstop/device_id_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/endian_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/machine_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/machine_timeout_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/protocol_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/pstop_application_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/pstop_msg_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/pstop_remote_data_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_2_01_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_2_02_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_2_03_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_2_06_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_2_07_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_2_08_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_01_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_02_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_03_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_04_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_05_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_06_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_07_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_08_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_09_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_10_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_11_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_12_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_13_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_14_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_15_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_16_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_17_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_18_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_19_test.c — full-run-safety
  • pstop_c/pstop/test/src/pstop/requirements/req_3_20_test.c — full-run-safety
  • … and 35 more

non-code file(s) changed (docs/design/multiple_remotes_single_machine.md, docs/developing/testing/hil.md, docs/guides/host.md, docs/guides/http_api.md, docs/guides/multiple_remotes_and_machines.md …) → running the full suite for safety (a code graph can't see config/fixture/data deps)

changed code file(s) with no mapped test (docs/design/multiple_remotes_single_machine.md, docs/developing/testing/hil.md, docs/guides/host.md, docs/guides/http_api.md, docs/guides/multiple_remotes_and_machines.md …) — a coverage gap or a missing link — running the full suite rather than only the selected tests

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

Formal verification

Could not verify: Could not verify dcs\_admin\_pages\_register.

The verifier did not have enough to check dcs\_admin\_pages\_register, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: unsupported return type: void

Could not verify: Could not verify dcs\_support\_init.

The verifier did not have enough to check dcs\_support\_init, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: unsupported return type: dcs_boot_state_t

· 1 more finding(s) on lines outside this diff (see the check run).

@claude claude 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.

Code review found no issues

No high-confidence issues detected in this change.

@iliabaranov iliabaranov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, agreed on default being off, so admin needs to explicitly set this behavior. In the future, I suspect Polyglot will trigger the connection

This branch has not been deployed

No deployments
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.

2 participants