forked from roger/k3s-cluster
agents fix language and time zone
This commit is contained in:
@@ -174,10 +174,17 @@ data:
|
|||||||
run (Hermes disables that). Do not try.
|
run (Hermes disables that). Do not try.
|
||||||
7. **Talk like a concierge.** Short, concrete, with entity_ids and values.
|
7. **Talk like a concierge.** Short, concrete, with entity_ids and values.
|
||||||
No filler. When you did something, say what in one line.
|
No filler. When you did something, say what in one line.
|
||||||
8. **Respect time of day and presence.** Don't run noisy routines (loud
|
8. **Language: Catalan by default.** Address Roger in Catalan in *all*
|
||||||
|
interactions — briefings, watchdog alerts, Discord DMs, and any other
|
||||||
|
message you produce. This is the default regardless of the language the
|
||||||
|
cron prompt or instruction is written in (those are just instructions
|
||||||
|
to you, not the output language). Only switch away from Catalan if Roger
|
||||||
|
writes to you in another language or explicitly asks you to. Never
|
||||||
|
default to English or Italian.
|
||||||
|
9. **Respect time of day and presence.** Don't run noisy routines (loud
|
||||||
media, vacuum robots) at night. Check presence (`zone.*` /
|
media, vacuum robots) at night. Check presence (`zone.*` /
|
||||||
`binary_sensor.*`) and the time before acting.
|
`binary_sensor.*`) and the time before acting.
|
||||||
9. **Absence of presence entities ≠ nobody home.** This Home Assistant
|
10. **Absence of presence entities ≠ nobody home.** This Home Assistant
|
||||||
instance has **no presence/device-tracker sensors configured**. Do NOT
|
instance has **no presence/device-tracker sensors configured**. Do NOT
|
||||||
infer "nobody is home" from the absence of `zone.*`, `device_tracker.*`,
|
infer "nobody is home" from the absence of `zone.*`, `device_tracker.*`,
|
||||||
or presence `binary_sensor.*` entities, from `zone.home` being missing /
|
or presence `binary_sensor.*` entities, from `zone.home` being missing /
|
||||||
|
|||||||
@@ -13,8 +13,14 @@
|
|||||||
# Schedule (4 jobs):
|
# Schedule (4 jobs):
|
||||||
# 1. energy-anomaly — every 4h (silent unless power draw is too high)
|
# 1. energy-anomaly — every 4h (silent unless power draw is too high)
|
||||||
# 2. comfort-check — every 4h (silent unless a room is out of range)
|
# 2. comfort-check — every 4h (silent unless a room is out of range)
|
||||||
# 3. morning-briefing — 0 8 * * * (always delivered)
|
# 3. morning-briefing — 0 6 * * * (always delivered)
|
||||||
# 4. evening-briefing — 0 0 * * * (always delivered)
|
# 4. evening-briefing — 0 22 * * * (always delivered)
|
||||||
|
# NOTE: Hermes' cron runs in UTC (no TZ set on the container). The cluster is
|
||||||
|
# at UTC+2, so every fixed daily time below is expressed in UTC and shifted
|
||||||
|
# back 2h from the intended local wall-clock time:
|
||||||
|
# 08:00 local -> 0 6 (morning briefing)
|
||||||
|
# 00:00 local -> 0 22 (evening briefing, i.e. midnight local)
|
||||||
|
# Relative schedules (every 4h) are timezone-independent.
|
||||||
# None of these act autonomously on climate/energy — they report and ask Roger.
|
# None of these act autonomously on climate/energy — they report and ask Roger.
|
||||||
---
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
@@ -87,12 +93,12 @@ spec:
|
|||||||
create "comfort-check" "every 4h" "discord" \
|
create "comfort-check" "every 4h" "discord" \
|
||||||
"Check the Home Assistant REST API as documented in your SOUL.md. Read indoor temperature and humidity sensors in each room (sensor.*temperature, sensor.*humidity). Comfortable range: temperature between 18C and 26C, humidity between 30 and 65 percent. For any room that is outside that range, report to Roger on Discord: the room name (entity_id), the reading, and whether it is too high or too low. Ask Roger what he wants to do about it. Do NOT change climate/HVAC, fans, or any entity yourself — only report and ask. If every room is within the comfortable range, reply with exactly [SILENT]."
|
"Check the Home Assistant REST API as documented in your SOUL.md. Read indoor temperature and humidity sensors in each room (sensor.*temperature, sensor.*humidity). Comfortable range: temperature between 18C and 26C, humidity between 30 and 65 percent. For any room that is outside that range, report to Roger on Discord: the room name (entity_id), the reading, and whether it is too high or too low. Ask Roger what he wants to do about it. Do NOT change climate/HVAC, fans, or any entity yourself — only report and ask. If every room is within the comfortable range, reply with exactly [SILENT]."
|
||||||
|
|
||||||
# ---- 3. Morning briefing (daily at 08:00, always delivered) ----
|
# ---- 3. Morning briefing (daily at 08:00 local = 06:00 UTC, always delivered) ----
|
||||||
create "morning-briefing" "0 8 * * *" "discord" \
|
create "morning-briefing" "0 6 * * *" "discord" \
|
||||||
"Produce a morning home briefing for Roger using the Home Assistant REST API as documented in your SOUL.md. Include, in short bullet form: (1) today's calendar events from calendar.* entities for today (time + title); (2) open tasks from todo.* task lists; (3) overnight energy use — total energy consumed overnight from energy / utility_meter sensors, plus the current power draw; (4) outdoor and indoor temperature and humidity, and the current weather from weather.*; (5) occupancy status from zone.home — report its state if it exists; if zone.home is missing or unavailable, state 'occupancy: unknown — zone.home not configured' rather than claiming no one is home; (6) any sensors currently in an alert or unavailable state. Keep the message under 1800 chars. Always deliver (no [SILENT])."
|
"Produce a morning home briefing for Roger using the Home Assistant REST API as documented in your SOUL.md. Include, in short bullet form: (1) today's calendar events from calendar.* entities for today (time + title); (2) open tasks from todo.* task lists; (3) overnight energy use — total energy consumed overnight from energy / utility_meter sensors, plus the current power draw; (4) outdoor and indoor temperature and humidity, and the current weather from weather.*; (5) occupancy status from zone.home — report its state if it exists; if zone.home is missing or unavailable, state 'occupancy: unknown — zone.home not configured' rather than claiming no one is home; (6) any sensors currently in an alert or unavailable state. Keep the message under 1800 chars. Always deliver (no [SILENT])."
|
||||||
|
|
||||||
# ---- 4. Evening briefing (daily at midnight, always delivered) ----
|
# ---- 4. Evening briefing (daily at midnight local = 22:00 UTC, always delivered) ----
|
||||||
create "evening-briefing" "0 0 * * *" "discord" \
|
create "evening-briefing" "0 22 * * *" "discord" \
|
||||||
"Produce an evening home status report for Roger using the Home Assistant REST API as documented in your SOUL.md. Report on: (1) lights currently turned on (light.* with state 'on'); (2) sockets and switches currently turned on (switch.* with state 'on'); (3) current energy use / power draw; (4) indoor temperature and humidity per room. List the specific entity_ids and their values. Then ask Roger which of the on devices/lights he wants turned off. Do NOT turn anything off yourself — only report and ask. Keep the message under 1800 chars. Always deliver (no [SILENT])."
|
"Produce an evening home status report for Roger using the Home Assistant REST API as documented in your SOUL.md. Report on: (1) lights currently turned on (light.* with state 'on'); (2) sockets and switches currently turned on (switch.* with state 'on'); (3) current energy use / power draw; (4) indoor temperature and humidity per room. List the specific entity_ids and their values. Then ask Roger which of the on devices/lights he wants turned off. Do NOT turn anything off yourself — only report and ask. Keep the message under 1800 chars. Always deliver (no [SILENT])."
|
||||||
|
|
||||||
echo "Done. Listing all cron jobs:"
|
echo "Done. Listing all cron jobs:"
|
||||||
|
|||||||
@@ -178,7 +178,14 @@ data:
|
|||||||
run (Hermes disables that). Do not try.
|
run (Hermes disables that). Do not try.
|
||||||
7. **Talk like an engineer.** Short, concrete, with resource names and
|
7. **Talk like an engineer.** Short, concrete, with resource names and
|
||||||
queries. No filler. When you fixed something, say what you did in one line.
|
queries. No filler. When you fixed something, say what you did in one line.
|
||||||
8. **Respect GitOps.** If an app is `OutOfSync`/`Degraded`, check whether a
|
8. **Language: Catalan by default.** Address Roger in Catalan in *all*
|
||||||
|
interactions — daily reports, watchdog alerts, Discord DMs, and any
|
||||||
|
other message you produce. This is the default regardless of the
|
||||||
|
language the cron prompt or instruction is written in (those are just
|
||||||
|
instructions to you, not the output language). Only switch away from
|
||||||
|
Catalan if Roger writes to you in another language or explicitly asks
|
||||||
|
you to. Never default to English or Italian.
|
||||||
|
9. **Respect GitOps.** If an app is `OutOfSync`/`Degraded`, check whether a
|
||||||
commit is stuck. Don't hand-edit resources — fix the source repo.
|
commit is stuck. Don't hand-edit resources — fix the source repo.
|
||||||
|
|
||||||
## How you reach Roger
|
## How you reach Roger
|
||||||
|
|||||||
@@ -98,14 +98,21 @@ spec:
|
|||||||
create "argocd-sync-health" "every 6h" "discord" \
|
create "argocd-sync-health" "every 6h" "discord" \
|
||||||
"Check ArgoCD app health using the API documented in your SOUL.md. If every app is Synced and Healthy, reply [SILENT]. Otherwise list the OutOfSync or Degraded apps with their status. If an app is OutOfSync and you believe a recent git push caused it, you may trigger a sync via the API. Do NOT hand-edit resources to fix them — fix the source repo."
|
"Check ArgoCD app health using the API documented in your SOUL.md. If every app is Synced and Healthy, reply [SILENT]. Otherwise list the OutOfSync or Degraded apps with their status. If an app is OutOfSync and you believe a recent git push caused it, you may trigger a sync via the API. Do NOT hand-edit resources to fix them — fix the source repo."
|
||||||
|
|
||||||
create "cert-expiry" "0 9 * * *" "discord" \
|
create "cert-expiry" "0 7 * * *" "discord" \
|
||||||
"Check certificate expiry using the Prometheus API documented in your SOUL.md. Alert on any certificate expiring in under 21 days, with its name and namespace. If none, reply [SILENT]."
|
"Check certificate expiry using the Prometheus API documented in your SOUL.md. Alert on any certificate expiring in under 21 days, with its name and namespace. If none, reply [SILENT]."
|
||||||
|
|
||||||
create "node-resource-drift" "every 1d" "discord" \
|
create "node-resource-drift" "every 1d" "discord" \
|
||||||
"Check node resources using the Prometheus API documented in your SOUL.md. Alert if any node is NotReady, or if any node has CPU over 90 percent or memory over 90 percent. Otherwise reply [SILENT]."
|
"Check node resources using the Prometheus API documented in your SOUL.md. Alert if any node is NotReady, or if any node has CPU over 90 percent or memory over 90 percent. Otherwise reply [SILENT]."
|
||||||
|
|
||||||
# ---- Daily report (always delivered) ----
|
# ---- Daily report (always delivered) ----
|
||||||
create "daily-cluster-report" "0 8 * * *" "discord" \
|
# NOTE: Hermes' cron runs in UTC (no TZ set on the container). The
|
||||||
|
# cluster is at UTC+2, so fixed daily times are expressed in UTC and
|
||||||
|
# shifted back 2h from the intended local wall-clock time:
|
||||||
|
# 08:00 local -> 0 6 (daily cluster report)
|
||||||
|
# 09:00 local -> 0 7 (cert expiry check)
|
||||||
|
# Relative schedules (every 6h / every 1h / every 1d) are
|
||||||
|
# timezone-independent.
|
||||||
|
create "daily-cluster-report" "0 6 * * *" "discord" \
|
||||||
"Produce a daily cluster report for Roger using the HTTP APIs documented in your SOUL.md. Include: (1) node count and Ready/NotReady status per node, (2) top 5 pods by CPU and by memory, (3) count of pods not Running grouped by namespace, (4) any ArgoCD apps that are OutOfSync or Degraded, (5) any certificates expiring within 30 days, (6) recent error/crash activity: IMPORTANT context discipline — do NOT fetch raw log lines across the cluster over 24h — that overflows your context window. First run a LogQL aggregation that returns only counts: sum by (namespace, pod) (count_over_time({namespace=~\".+\"} |~ \"(?i)error|panic|crash|oom|backoff\" [24h])). Parse the counts with jq and summarize the top few noisiest pods by namespace/pod:count. If one stands out, fetch at most 5 sample lines for THAT pod only (limit=5) to identify the cause. Never paste more than a handful of lines total. Keep the whole report under 1800 chars. Always deliver (no [SILENT])."
|
"Produce a daily cluster report for Roger using the HTTP APIs documented in your SOUL.md. Include: (1) node count and Ready/NotReady status per node, (2) top 5 pods by CPU and by memory, (3) count of pods not Running grouped by namespace, (4) any ArgoCD apps that are OutOfSync or Degraded, (5) any certificates expiring within 30 days, (6) recent error/crash activity: IMPORTANT context discipline — do NOT fetch raw log lines across the cluster over 24h — that overflows your context window. First run a LogQL aggregation that returns only counts: sum by (namespace, pod) (count_over_time({namespace=~\".+\"} |~ \"(?i)error|panic|crash|oom|backoff\" [24h])). Parse the counts with jq and summarize the top few noisiest pods by namespace/pod:count. If one stands out, fetch at most 5 sample lines for THAT pod only (limit=5) to identify the cause. Never paste more than a handful of lines total. Keep the whole report under 1800 chars. Always deliver (no [SILENT])."
|
||||||
|
|
||||||
echo "Done. Listing all cron jobs:"
|
echo "Done. Listing all cron jobs:"
|
||||||
|
|||||||
Reference in New Issue
Block a user