Files
crimson_leaf/templates/pulse_check.yml

78 lines
2.4 KiB
YAML

name: pulse_check
description: "Crimson Leaf holding company health scan -- Edgar checks all DB companies every 3 hours."
debug: true
model: power
system: agent_prompt
agent_prompt:
- "= identity.md"
sections:
- agent
- project
- rag
- message
- instructions
builders:
message: |
*** PORTFOLIO REPORT ***
{steps[0].text}
steps:
# Step 0: pull live data for ALL companies currently in the database
- type: tool
action: get_portfolio_report
output_key: portfolio_data
# Step 1: identify subsidiary company slugs (exclude crimson_leaf -- that is us)
- type: think
max_tokens: 600
hint: |
You are Edgar, CEO of Crimson Leaf Holdings.
The portfolio report above lists every company registered in the system database.
Extract the slug of every company EXCEPT "crimson_leaf" (that is the holding company -- us).
Output ONLY a JSON array of slug strings on a single line. No explanation. No markdown.
Example: ["crimson_leaf_publishing","crimson_leaf_marketing","crimson_leaf_research"]
If there are no subsidiary companies, output: []
# Step 2: package the array so foreach can source it
- type: package
schema: '{"company_slugs": "array"}'
hint: |
The previous step produced a JSON array of company slugs.
Package it as: {"company_slugs": [...array of slug strings...]}
# Step 3: dispatch a company_review task to the management project of each subsidiary
- type: foreach
source: company_slugs
step:
type: tool
action: enqueue_strategy
optional: true
params:
company_slug: "{loop.item}"
project_slug: "management"
task_type: "company_review"
content: "Pulse-check: Edgar requesting company review for all active projects."
# Step 4: brief health summary to Discord
- type: think
max_tokens: 150
hint: |
Write a 2-line status update for the Discord #general channel.
Line 1: "Pulse [HEALTHY/ATTENTION/IDLE] -- <N> subsidiaries reviewed"
Line 2: one sentence noting anything flagged (failures, idle companies, workers down) or "All systems nominal."
Use data from the portfolio report. 2 lines max. No extra commentary.
- type: reply
target: channel
channel_name: "crimson_leaf:general"
hint: |
Post the 2-line status summary above verbatim. No preamble.
adjudication:
enabled: false