diff --git a/tools/anaf-monitor/monitor_v2.py b/tools/anaf-monitor/monitor_v2.py index 6d5742a..4d87c22 100644 --- a/tools/anaf-monitor/monitor_v2.py +++ b/tools/anaf-monitor/monitor_v2.py @@ -364,9 +364,16 @@ def main(): update_dashboard_status(len(all_changes) > 0, len(all_changes), all_changes) log("=== Monitor complete ===") - + + num_changes = len(all_changes) print(json.dumps({"changes": all_changes}, ensure_ascii=False, indent=2)) - return len(all_changes) + # GSTACK-CRON marker: contract with Echo-Core scheduler (report_on="changes"). + # The shell-kind scheduler parses the last line matching + # ^GSTACK-CRON: changes=\d+$ to decide whether to forward stdout. + # A successful run (even with N>0 changes) must exit 0 — the scheduler + # reports non-zero exit codes as errors unconditionally. + print(f"GSTACK-CRON: changes={num_changes}") + return 0 if __name__ == "__main__": exit(main())