@@ -47,11 +47,22 @@ validate_path_within() {
4747}
4848
4949# --- Configuration ---
50+ # Hypatia's local data store is the primary source for dispatch manifests.
51+ # Falls back to central verisimdb-data if HYPATIA_DATA is not set.
52+ HYPATIA_DATA=" ${HYPATIA_DATA:-/ var/ mnt/ eclipse/ repos/ hypatia/ data/ verisimdb} "
5053VERISIMDB_DATA=" ${VERISIMDB_DATA:-/ var/ mnt/ eclipse/ repos/ verisimdb-data} "
5154REPOS_BASE=" ${REPOS_BASE:-/ var/ mnt/ eclipse/ repos} "
5255FLEET_SCRIPTS=" ${FLEET_SCRIPTS:-/ var/ mnt/ eclipse/ repos/ gitbot-fleet/ scripts} "
53- RRA_BIN=" ${RRA_BIN:-/ var/ mnt/ eclipse/ repos/ robot-repo-automaton/ target/ release/ robot-repo-automaton} "
54- MANIFEST_PATH=" ${VERISIMDB_DATA} /dispatch/pending.jsonl"
56+ RRA_BIN=" ${RRA_BIN:-/ var/ mnt/ eclipse/ repos/ gitbot-fleet/ robot-repo-automaton/ target/ release/ robot-repo-automaton} "
57+
58+ # Try hypatia's data first, then fall back to central verisimdb-data
59+ if [[ -f " ${HYPATIA_DATA} /dispatch/pending.jsonl" ]]; then
60+ MANIFEST_PATH=" ${HYPATIA_DATA} /dispatch/pending.jsonl"
61+ elif [[ -f " ${VERISIMDB_DATA} /dispatch/pending.jsonl" ]]; then
62+ MANIFEST_PATH=" ${VERISIMDB_DATA} /dispatch/pending.jsonl"
63+ else
64+ MANIFEST_PATH=" ${HYPATIA_DATA} /dispatch/pending.jsonl"
65+ fi
5566
5667DRY_RUN=false
5768FILTER_TIER=" "
@@ -105,7 +116,9 @@ echo " Dry run: $DRY_RUN"
105116echo " "
106117
107118# --- Outcome recording ---
108- OUTCOME_FILE=" ${VERISIMDB_DATA} /outcomes/$( date -u +%Y-%m) .jsonl"
119+ # Write outcomes to hypatia's local store (primary) and central store (backup)
120+ OUTCOME_FILE=" ${HYPATIA_DATA} /outcomes/$( date -u +%Y-%m) .jsonl"
121+ OUTCOME_FILE_CENTRAL=" ${VERISIMDB_DATA} /outcomes/$( date -u +%Y-%m) .jsonl"
109122mkdir -p " $( dirname " $OUTCOME_FILE " ) "
110123
111124record_outcome () {
@@ -131,6 +144,10 @@ record_outcome() {
131144 ' {pattern_id: $pid, recipe_id: $rid, repo: $repo, file: $file, outcome: $outcome, timestamp: $ts, bot: $bot}' )
132145
133146 echo " $json " >> " $OUTCOME_FILE "
147+ # Also write to central store if it exists
148+ if [[ -d " $( dirname " $OUTCOME_FILE_CENTRAL " ) " ]] || mkdir -p " $( dirname " $OUTCOME_FILE_CENTRAL " ) " 2> /dev/null; then
149+ echo " $json " >> " $OUTCOME_FILE_CENTRAL "
150+ fi
134151}
135152
136153# --- Execute a single manifest entry ---
@@ -324,3 +341,30 @@ if [[ "$DRY_RUN" == "true" ]]; then
324341 echo " "
325342 echo " (Dry run — no changes were made)"
326343fi
344+
345+ # --- Kin Protocol: write heartbeat ---
346+ KIN_DIR=" ${HOME} /.hypatia/kin"
347+ mkdir -p " $KIN_DIR "
348+
349+ HEARTBEAT_STATUS=" healthy"
350+ [[ " $FAILED " -gt 0 ]] && HEARTBEAT_STATUS=" degraded"
351+
352+ cat > " ${KIN_DIR} /gitbot-fleet.heartbeat.json" << HEARTBEAT
353+ {
354+ "kin_id": "gitbot-fleet",
355+ "role": "executor",
356+ "timestamp": "$( date -u +%Y-%m-%dT%H:%M:%SZ) ",
357+ "status": "${HEARTBEAT_STATUS} ",
358+ "version": "0.2.0",
359+ "last_run": {
360+ "total_processed": ${TOTAL} ,
361+ "executed": ${EXECUTED} ,
362+ "succeeded": ${SUCCEEDED} ,
363+ "failed": ${FAILED} ,
364+ "skipped": ${SKIPPED} ,
365+ "dry_run": ${DRY_RUN}
366+ },
367+ "errors": [],
368+ "capabilities": ["dispatch", "fix_execute", "pr_create", "review", "advisory"]
369+ }
370+ HEARTBEAT
0 commit comments