Check if a project has changes. Returns true if reindex needed. * Must NOT mutate the committed baselines (last_head, last_dirty_sig): * poll_project commits them only after a SUCCESSFUL reindex so that * busy-skips and failed runs retry instead of silently losing the change * (#937). Observations are staged in the pending_* fields. */ Non-git leg of check_changes (#1948). A failed walk report
| 1433 | /* Non-git leg of check_changes (#1948). A failed walk reports "no verdict" |
| 1434 | * (false) so the committed baseline is kept and a later poll retries. */ |
| 1435 | static bool check_tree_changes(project_state_t *s, bool *changed_out) { |
| 1436 | uint64_t sig = 0; |
| 1437 | int file_count = 0; |
| 1438 | if (!tree_signature(s->root_path, &sig, &file_count)) { |
| 1439 | cbm_log_warn("watcher.tree_walk_failed", "project", s->project_name, "path", s->root_path); |
| 1440 | /* Retry at the regular cadence, not on every run-loop tick. */ |
| 1441 | s->next_poll_ns = now_ns() + ((int64_t)s->interval_ms * US_PER_MS); |
| 1442 | return false; |
| 1443 | } |
| 1444 | s->pending_tree_sig = sig; |
| 1445 | s->file_count = file_count; |
| 1446 | s->interval_ms = cbm_watcher_poll_interval_ms(file_count); |
| 1447 | *changed_out = sig != s->last_tree_sig; |
| 1448 | return true; |
| 1449 | } |
| 1450 | |
| 1451 | static bool check_changes(cbm_watcher_t *w, project_state_t *s, bool *changed_out) { |
| 1452 | if (!changed_out) { |
no test coverage detected