Skip to content

feat(harness-ops): add a cost section to the morning brief #8343

Description

@kyle-sexton

Problem

The owner wants cost and credential signals in one place they already look at every day. /harness-ops:morning-brief reads only repo queues and lane telemetry with gh, so nothing shows GitHub private-repo Actions use, Azure spend, or the triggers that would narrow the Claude role secrets. GitHub's metered products stop at $0 and Azure has no hard stop, so a quiet failure there either blocks private CI until the 1st or accrues Azure charges.

Fix

Add a Cost section to /harness-ops:morning-brief, printed on every run whatever the repo, with no schedule:

  1. GitHub private-repo Actions minutes and artifact storage this month against the plan's included 3,000 min / 2 GB, flagged at 50%. Source: organizations/<org>/settings/billing/usage.
  2. Secret-narrowing triggers across org repos: a collaborator other than the owner, or a fork-triggered workflow (pull_request_target or similar) that reads a *_CLAUDE_* secret.
  3. Azure Log Analytics peak day against each workspace's daily cap, flagged at 50%.
  4. Azure month-to-date actual and Azure's own end-of-month forecast (budget forecastSpend) against the $200 budget, with the data timestamp; red when the forecast passes $50.
  5. Any of budget-subscription-monthly, budget-subscription-forecast or the daily-cost-anomaly rule missing, or expiring within 30 days.

Constraints:

  • Read only with the owner's existing gh (org admin) and az logins on their machine. Store no new credential.
  • A source that cannot be read prints UNREADABLE and the fix (for example az login), per the brief's degraded-section contract. Never print "clear".
  • A scheduled or CI run of this section needs a new owner decision first.
  • The org, subscription, budget names and thresholds come from config, not literals.

Acceptance

  • Every morning-brief run prints the Cost section with all five lines, or UNREADABLE per line.
  • With az logged out, the Azure lines say UNREADABLE and name az login, and the GitHub lines still print.

Basis: GitHub Security & Cost interview, tab 4, Q42, Q52, Q53, Q54, Q57, Q58, Q60, Q61, Q62 (2026-10-18). Billing usage needs an org administrator (https://docs.github.com/en/rest/billing/usage). Budget email timing and forecastSpend: https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-acm-create-budgets.

🤖 Generated with Claude Code

Activity

  1. added
    needs-triage
    on Oct 19, 2026
  2. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    Thanks for the report. Automated triage handed this issue to a maintainer.

    Proposed work class: work-class: scoped
    Basis: automated intake triage; a maintainer confirms or changes it.

    Automated triage. A maintainer reviews it.

  3. added
    needs-human
    and removed
    needs-triage
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-human

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions