ForgeSight registry — declared agent ownership auto-stamped onto runs; chargeback + catalogue rollups.
Project description
forgesight-registry
Declared agent ownership auto-stamped onto every run — plus offline chargeback and catalogue rollups — for ForgeSight. The last mile from per-run cost to org-level FinOps: declare an agent once instead of tagging it every run, everywhere, inconsistently.
pip install forgesight-registry
# agents.yaml — one source of truth
agents:
- name: invoice-parser
version: "2.3.0"
owner: "fin-platform@acme.com"
team: "finance-platform"
repo: "acme/invoice-agents"
lifecycle: "ga"
sla_tier: "tier-1"
- name: nightly-summariser
version: "*"
owner: "growth@acme.com"
team: "growth"
lifecycle: "beta"
import forgesight
from forgesight_registry import Registry
reg = Registry.from_file("agents.yaml")
forgesight.configure(run_metadata_provider=reg.ownership_metadata) # stamp ownership at run start
# Agent author writes nothing extra — every run now carries team/owner/repo/... on the
# root span and every child (FR-5):
with forgesight.telemetry.agent_run("invoice-parser", version="2.3.0") as run:
...
How it works
- Stamp at run start. The registry resolves
(name, version)— exact →"*"wildcard → unmatched — and merges the agent's ownership fields into the run's metadata. Caller-set keys win (a one-offenvironment=stagingsurvives). Undeclared agents are counted (on_unmatched=warn|ignore|error), so the registry doubles as a "what's running but undeclared" detector. - Chargeback is a group-by.
ChargebackReport.from_records(records, dimensions=["team", "environment"])sumscost_usd/ tokens / runs / failures per group — clean, because the dimensions were stamped at source. An absent dimension groups under<unattributed>so cost never vanishes. - Catalogue = declared ∪ observed.
AgentCatalogue.from_records(records, registry=reg, now_unix_nanos=…)joins the declared registry (owner / lifecycle / SLA) with observed telemetry (last-seen / run count / windowed cost), surfacing declared-but-silent and active-but-undeclared agents.
Configuration
registry:
enabled: true # master switch (default false — install does nothing until on)
source: "file" # file | http | <custom>
path: "agents.yaml"
on_unmatched: "warn" # warn | ignore | error
stamp:
fields: ["team", "owner", "repo", "lifecycle", "sla_tier"]
prefix: "" # e.g. "org." → org.team, org.owner
Non-blocking: stamping is an in-memory dict merge (P6). No vendor SDK (P1) — the HTTP source
uses stdlib urllib. Attribution, not control — budget enforcement on these same dimensions
is forgesight-governance (feat-020).
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forgesight_registry-0.1.1.tar.gz.
File metadata
- Download URL: forgesight_registry-0.1.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0212e21df1520eef3c3c2f847744c5c8e0809fb688da4c6d057b4cc8cfd341b4
|
|
| MD5 |
acd95f133facaa8e7aea0aff09e80946
|
|
| BLAKE2b-256 |
655f9e8fb475f1cd21b0950c9e33adbe647ab835a47d989907197db1324dc7f4
|
File details
Details for the file forgesight_registry-0.1.1-py3-none-any.whl.
File metadata
- Download URL: forgesight_registry-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b8a252305b47dd2897d45927ac886df1ac0a5a2f36afb04be4abe24f30977fb
|
|
| MD5 |
f223b397a9921b83e6a8c53068e5a654
|
|
| BLAKE2b-256 |
a7ab046bec1b99d248e13c467fe8070e1f6d698a26c7923ac8bf32fadfdbcf13
|