Configure the managed template
This example adapts the repository deployment’s weekly settings and pins its managed role to@auto/agents@1.11.0/customer-health.yaml. Set followupAgent to an installed agent and slackChannel to your reporting channel. Choose cohort and activity definitions that your sources can actually measure.
.auto/agents/customer-health.yaml
Importing the role does not grant production database access. Without a tenant-approved aggregate source, the report must mark production aggregates
not configured rather than inventing results.Schedule and coverage
The example runs at 08:30 every Monday inAmerica/Los_Angeles, with a seven-local-calendar-day reporting window. The template anchors its window on heartbeat.scheduledAt, records explicit local and UTC boundaries, and uses half-open intervals for the current and adjacent prior window. Local-calendar arithmetic preserves the reporting clock across daylight-saving changes; a week is not always 168 hours.
The report must record each source independently as complete, partial, unavailable, or not configured, with an as-of time and a content-free reason. Missing data is never zero. A healthy source with no matching activity is complete, zero activity, and still produces a report. If either the activity denominator or reliability numerator is incomplete, the overall verdict is coverage incomplete, not healthy.
With the example settings, a cohort needs at least five accounts to be published. Smaller cohorts are rolled into other/suppressed. A high-error cohort needs at least five error events and an error rate of at least 10 percent of meaningful activity; a newly regressed Sentry issue may be flagged separately below that floor.
Durable reports and delivery
The template instructs the agent to derive a report key from the time zone and exact UTC window bounds, then reconcile existing Notion reports and customer-health sessions before querying. A completed key with confirmed Slack delivery is a silent no-op; an incomplete report resumes only the missing source work. The detailed report includes scope, coverage, product activity, reliability, approved production aggregates, current/prior comparisons, findings, source gaps, delivery state, dispatch history, and predecessor status. It remains the final auto session response, with Notion as the preferred additional artifact when available. For each report key, send one top-level Slack summary linking that artifact, not the full report. The artifact URL is the only permitted link in the summary. Both destinations exclude names, emails, customer or organization identifiers, raw events, message content, stack traces, and provider evidence links. An explicit pre-send Slack failure permits one bounded retry. A timeout or ambiguous outcome isdelivery unknown and requires human reconciliation; it must not trigger an automatic resend. Delivery is confirmed only after Slack returns the canonical thread identifier.
Follow up in the report thread
Replies return to the reporting agent through itschat.thread binding. The agent can answer aggregate questions or re-query a requested slice within the same privacy and window rules.
Dispatch requires an explicit human request. The agent uses auto.sessions.spawn for the configured followupAgent, with an idempotency key derived from the Slack thread and task. Its brief contains the artifact URL, report key, content-free finding identifiers, acceptance criteria, and authority limits, not raw customer evidence. If the target agent is missing or dispatch is refused, it reports the blocker rather than selecting a more privileged agent.
The report records dispatched sessions and their originating threads. Completion or failure produces one evidence-backed reply in the original thread; a completed child session does not establish that a change is ready or merged.
Repository production policy
Thefractal-works/auto deployment layers its repository runtime and a read-only main checkout onto the managed role. Its prompt permits production queries only through scripts/debug/auto-prod psql from /workspace/repo, requires read-only statements beginning with SELECT, and directs access diagnostics through scripts/debug/doctor-prod-debug. Access denial makes the source unavailable; it is not permission to bypass the wrapper or inspect credentials.
Final query results are restricted to counts, rates, date buckets, bounded spend totals, and approved lifecycle labels. The approved metrics include external signups, activity after Day 0, self-initiated sessions, operator commands, lifecycle activity buckets, model-spend cohorts with no attended activity, and agent-opened pull requests. Organization and lifecycle buckets below the configured minimum are suppressed, organizations are never named, and schema drift makes the affected metric unavailable rather than permitting row-level discovery.
These are repository-specific instructions, not permissions inherited by another tenant that copies the minimal example.