Work with ops dashboard
Use ops dashboard when you need to local operations dashboard — workflow runner with per-feature scope picker, persisted run history, clickable workflow chaining, and live sse log streaming.
Prerequisites
- Access to the project source code
- Familiarity with the files under src/attune/ops/**
Steps
-
Understand the current behavior. Read the entry points to see what ops dashboard does today before making changes. The primary functions are:
create_app()insrc/attune/ops/__init__.py— Lazy-import the FastAPI factory so importing attune doesn't pull FastAPI.build_config()insrc/attune/ops/__init__.py— Lazy import of the config builder.clear_cache()insrc/attune/ops/anthropic_cost.py— Empty the in-memory cache. Test-only convenience.load_admin_key()insrc/attune/ops/anthropic_cost.py— Return the admin API key, orNoneif unavailable.fetch_summary()insrc/attune/ops/anthropic_cost.py— Return the current cost summary or a categorized error.
-
Locate the right function to change. Each function has a single responsibility. Read its docstring, parameters, and return type to confirm it owns the behavior you need to modify.
-
Make your change. Follow existing patterns in the file — naming conventions, error handling style, and logging.
-
Run the related tests. This catches regressions before they reach other developers. Target with
pytest -k "ops-dashboard".
Key files
src/attune/ops/**
Common modifications
Functions you are most likely to modify:
create_app()insrc/attune/ops/__init__.pybuild_config()insrc/attune/ops/__init__.pyclear_cache()insrc/attune/ops/anthropic_cost.pyload_admin_key()insrc/attune/ops/anthropic_cost.pyfetch_summary()insrc/attune/ops/anthropic_cost.pyadd_subparser()insrc/attune/ops/cli.pycmd_ops()insrc/attune/ops/cli.pymain()insrc/attune/ops/cli.py