agentops-accelerator 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentops/__init__.py +10 -0
- agentops/__main__.py +6 -0
- agentops/agent/__init__.py +12 -0
- agentops/agent/_legacy_ids.py +92 -0
- agentops/agent/analyzer.py +207 -0
- agentops/agent/checks/__init__.py +1 -0
- agentops/agent/checks/catalog.py +880 -0
- agentops/agent/checks/errors.py +279 -0
- agentops/agent/checks/foundry_config.py +75 -0
- agentops/agent/checks/latency.py +84 -0
- agentops/agent/checks/opex.py +157 -0
- agentops/agent/checks/opex_workspace.py +874 -0
- agentops/agent/checks/posture.py +36 -0
- agentops/agent/checks/posture_rules/__init__.py +53 -0
- agentops/agent/checks/posture_rules/content_filter.py +59 -0
- agentops/agent/checks/posture_rules/diagnostics.py +74 -0
- agentops/agent/checks/posture_rules/local_auth.py +55 -0
- agentops/agent/checks/posture_rules/managed_identity.py +59 -0
- agentops/agent/checks/posture_rules/network.py +68 -0
- agentops/agent/checks/regression.py +78 -0
- agentops/agent/checks/release_readiness.py +182 -0
- agentops/agent/checks/safety.py +247 -0
- agentops/agent/checks/spec_conformance.py +375 -0
- agentops/agent/cockpit.py +5159 -0
- agentops/agent/config.py +240 -0
- agentops/agent/findings.py +113 -0
- agentops/agent/history.py +142 -0
- agentops/agent/knowledge/__init__.py +182 -0
- agentops/agent/knowledge/waf-checklist.csv +39 -0
- agentops/agent/llm_assist/__init__.py +16 -0
- agentops/agent/llm_assist/_base.py +124 -0
- agentops/agent/llm_assist/_bundle_rule.py +154 -0
- agentops/agent/llm_assist/_client.py +347 -0
- agentops/agent/llm_assist/_dataset_rules.py +191 -0
- agentops/agent/llm_assist/_engine.py +106 -0
- agentops/agent/llm_assist/_prompt_rules.py +291 -0
- agentops/agent/llm_assist/_spec_rules.py +235 -0
- agentops/agent/production_telemetry.py +430 -0
- agentops/agent/report.py +207 -0
- agentops/agent/server/__init__.py +1 -0
- agentops/agent/server/app.py +84 -0
- agentops/agent/server/auth.py +94 -0
- agentops/agent/server/chat.py +44 -0
- agentops/agent/server/protocol.py +72 -0
- agentops/agent/sources/__init__.py +1 -0
- agentops/agent/sources/azure_monitor.py +523 -0
- agentops/agent/sources/azure_resources.py +602 -0
- agentops/agent/sources/foundry_control.py +174 -0
- agentops/agent/sources/results_history.py +494 -0
- agentops/agent/sources/spec_detectors/__init__.py +42 -0
- agentops/agent/sources/spec_detectors/_base.py +58 -0
- agentops/agent/sources/spec_detectors/agents_md.py +75 -0
- agentops/agent/sources/spec_detectors/spec_kit.py +172 -0
- agentops/agent/time_range.py +117 -0
- agentops/cli/__init__.py +1 -0
- agentops/cli/app.py +4823 -0
- agentops/core/__init__.py +1 -0
- agentops/core/agentops_config.py +592 -0
- agentops/core/config_loader.py +22 -0
- agentops/core/evaluators.py +480 -0
- agentops/core/release_evidence.py +56 -0
- agentops/core/results.py +117 -0
- agentops/mcp/__init__.py +10 -0
- agentops/mcp/server.py +232 -0
- agentops/pipeline/__init__.py +8 -0
- agentops/pipeline/cloud_results.py +189 -0
- agentops/pipeline/cloud_runner.py +901 -0
- agentops/pipeline/comparison.py +108 -0
- agentops/pipeline/diagnostics.py +51 -0
- agentops/pipeline/invocations.py +535 -0
- agentops/pipeline/official_eval.py +414 -0
- agentops/pipeline/orchestrator.py +775 -0
- agentops/pipeline/prompt_deploy.py +377 -0
- agentops/pipeline/publisher.py +121 -0
- agentops/pipeline/reporter.py +202 -0
- agentops/pipeline/runtime.py +409 -0
- agentops/pipeline/thresholds.py +84 -0
- agentops/services/__init__.py +1 -0
- agentops/services/cicd.py +720 -0
- agentops/services/eval_analysis.py +848 -0
- agentops/services/evidence_pack.py +757 -0
- agentops/services/initializer.py +86 -0
- agentops/services/preflight.py +470 -0
- agentops/services/setup_wizard.py +709 -0
- agentops/services/skills.py +643 -0
- agentops/services/trace_promotion.py +300 -0
- agentops/services/workflow_analysis.py +1129 -0
- agentops/templates/.gitignore +15 -0
- agentops/templates/__init__.py +1 -0
- agentops/templates/agent-server/Dockerfile +23 -0
- agentops/templates/agent-server/README.md +61 -0
- agentops/templates/agent-server/main.bicep +94 -0
- agentops/templates/agent.yaml +87 -0
- agentops/templates/agentops.yaml +58 -0
- agentops/templates/foundry.svg +71 -0
- agentops/templates/icon.png +0 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-dev-azd.yml +118 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-dev.yml +73 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-prod-azd.yml +141 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-prod.yml +94 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-prompt-agent.yml +167 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-qa-azd.yml +118 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-qa.yml +68 -0
- agentops/templates/pipelines/azuredevops/agentops-pr-prompt-agent.yml +210 -0
- agentops/templates/pipelines/azuredevops/agentops-pr.yml +155 -0
- agentops/templates/pipelines/azuredevops/agentops-watchdog.yml +106 -0
- agentops/templates/project.gitignore +36 -0
- agentops/templates/sample-traces.jsonl +3 -0
- agentops/templates/skills/agentops-agent/SKILL.md +137 -0
- agentops/templates/skills/agentops-config/SKILL.md +113 -0
- agentops/templates/skills/agentops-dataset/SKILL.md +84 -0
- agentops/templates/skills/agentops-eval/SKILL.md +189 -0
- agentops/templates/skills/agentops-report/SKILL.md +71 -0
- agentops/templates/skills/agentops-workflow/SKILL.md +471 -0
- agentops/templates/smoke.jsonl +3 -0
- agentops/templates/waf-checklist.README.md +84 -0
- agentops/templates/waf-checklist.csv +22 -0
- agentops/templates/workflows/agentops-deploy-dev-azd.yml +166 -0
- agentops/templates/workflows/agentops-deploy-dev.yml +187 -0
- agentops/templates/workflows/agentops-deploy-prod-azd.yml +183 -0
- agentops/templates/workflows/agentops-deploy-prod.yml +171 -0
- agentops/templates/workflows/agentops-deploy-prompt-agent.yml +197 -0
- agentops/templates/workflows/agentops-deploy-qa-azd.yml +156 -0
- agentops/templates/workflows/agentops-deploy-qa.yml +145 -0
- agentops/templates/workflows/agentops-pr-prompt-agent.yml +210 -0
- agentops/templates/workflows/agentops-pr.yml +148 -0
- agentops/templates/workflows/agentops-watchdog.yml +122 -0
- agentops/utils/__init__.py +1 -0
- agentops/utils/azd_env.py +435 -0
- agentops/utils/azure_endpoints.py +62 -0
- agentops/utils/colors.py +47 -0
- agentops/utils/dotenv_loader.py +105 -0
- agentops/utils/foundry_discovery.py +229 -0
- agentops/utils/logging.py +59 -0
- agentops/utils/telemetry.py +554 -0
- agentops/utils/yaml.py +36 -0
- agentops_accelerator-0.3.0.dist-info/METADATA +278 -0
- agentops_accelerator-0.3.0.dist-info/RECORD +142 -0
- agentops_accelerator-0.3.0.dist-info/WHEEL +5 -0
- agentops_accelerator-0.3.0.dist-info/entry_points.txt +2 -0
- agentops_accelerator-0.3.0.dist-info/licenses/LICENSE +21 -0
- agentops_accelerator-0.3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# AgentOps — PR evaluation gate
|
|
2
|
+
#
|
|
3
|
+
# Runs on pull requests targeting develop, release/**, or main and gates
|
|
4
|
+
# the merge on the AgentOps eval result. Posts the rendered Markdown
|
|
5
|
+
# report as an idempotent PR comment.
|
|
6
|
+
#
|
|
7
|
+
# Edit by:
|
|
8
|
+
# - Changing the run config under inputs.config (add a matrix if you
|
|
9
|
+
# have multiple scenarios).
|
|
10
|
+
# - Adjusting thresholds in the bundle, not here.
|
|
11
|
+
#
|
|
12
|
+
# Generated by `agentops workflow generate`.
|
|
13
|
+
|
|
14
|
+
name: AgentOps PR
|
|
15
|
+
|
|
16
|
+
on:
|
|
17
|
+
pull_request:
|
|
18
|
+
branches:
|
|
19
|
+
- develop
|
|
20
|
+
- "release/**"
|
|
21
|
+
- main
|
|
22
|
+
workflow_dispatch:
|
|
23
|
+
inputs:
|
|
24
|
+
config:
|
|
25
|
+
description: "Path to agentops.yaml (defaults to ./agentops.yaml at repo root)"
|
|
26
|
+
required: false
|
|
27
|
+
default: "agentops.yaml"
|
|
28
|
+
|
|
29
|
+
permissions:
|
|
30
|
+
contents: read
|
|
31
|
+
pull-requests: write
|
|
32
|
+
id-token: write
|
|
33
|
+
|
|
34
|
+
concurrency:
|
|
35
|
+
group: agentops-pr-${{ github.workflow }}-${{ github.ref }}
|
|
36
|
+
cancel-in-progress: true
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
eval:
|
|
40
|
+
name: AgentOps eval (PR gate)
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
# Run the PR gate against the dev environment so the OIDC token
|
|
43
|
+
# subject is `environment:dev` and `vars.*` resolves from there.
|
|
44
|
+
environment: dev
|
|
45
|
+
timeout-minutes: 30
|
|
46
|
+
steps:
|
|
47
|
+
- name: Checkout
|
|
48
|
+
uses: actions/checkout@v6
|
|
49
|
+
|
|
50
|
+
- name: Azure login (OIDC)
|
|
51
|
+
uses: azure/login@v3
|
|
52
|
+
with:
|
|
53
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
54
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
55
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
56
|
+
|
|
57
|
+
- name: Set up Python
|
|
58
|
+
uses: actions/setup-python@v6
|
|
59
|
+
with:
|
|
60
|
+
python-version: "3.11"
|
|
61
|
+
|
|
62
|
+
# uv is ~5-10x faster than pip on cold installs; the AgentOps stack
|
|
63
|
+
# (azure-* + opentelemetry-instrumentation-*) pulls dozens of small
|
|
64
|
+
# wheels so the speed-up is very visible in CI.
|
|
65
|
+
- name: Install uv
|
|
66
|
+
uses: astral-sh/setup-uv@v7
|
|
67
|
+
with:
|
|
68
|
+
enable-cache: false
|
|
69
|
+
|
|
70
|
+
- name: Install AgentOps Toolkit
|
|
71
|
+
run: |
|
|
72
|
+
# NOTE: pinned to GitHub main until the next package release includes this flow.
|
|
73
|
+
# Switch to `uv pip install --system "agentops-accelerator[foundry,agent]"` after release.
|
|
74
|
+
uv pip install --system "agentops-accelerator[foundry,agent] @ git+https://github.com/Azure/agentops.git@main"
|
|
75
|
+
|
|
76
|
+
__EVAL_STEPS__
|
|
77
|
+
|
|
78
|
+
- name: Generate release evidence
|
|
79
|
+
if: always()
|
|
80
|
+
env:
|
|
81
|
+
AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_FOUNDRY_PROJECT_ENDPOINT }}
|
|
82
|
+
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
|
|
83
|
+
AZURE_OPENAI_DEPLOYMENT: ${{ vars.AZURE_OPENAI_DEPLOYMENT }}
|
|
84
|
+
APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTION_STRING || vars.APPLICATIONINSIGHTS_CONNECTION_STRING }}
|
|
85
|
+
run: |
|
|
86
|
+
# Doctor gate severity is configured at workflow generation time via
|
|
87
|
+
# `agentops workflow generate --doctor-gate critical|warning|none`.
|
|
88
|
+
agentops doctor --workspace . --out .agentops/agent/report.md \
|
|
89
|
+
--severity-fail __DOCTOR_GATE__ --evidence-pack
|
|
90
|
+
|
|
91
|
+
- name: Upload AgentOps results
|
|
92
|
+
if: always()
|
|
93
|
+
uses: actions/upload-artifact@v7
|
|
94
|
+
with:
|
|
95
|
+
name: agentops-pr-results
|
|
96
|
+
path: |
|
|
97
|
+
__EVAL_ARTIFACT_PATHS__
|
|
98
|
+
.agentops/agent/report.md
|
|
99
|
+
.agentops/release/latest/evidence.json
|
|
100
|
+
.agentops/release/latest/evidence.md
|
|
101
|
+
if-no-files-found: warn
|
|
102
|
+
|
|
103
|
+
- name: Step summary
|
|
104
|
+
if: always()
|
|
105
|
+
run: |
|
|
106
|
+
{
|
|
107
|
+
echo "## AgentOps PR Eval"
|
|
108
|
+
echo
|
|
109
|
+
echo "Result: \`${{ steps.eval.outputs.result }}\` (exit code \`${{ steps.eval.outputs.exit_code }}\`)"
|
|
110
|
+
echo
|
|
111
|
+
if [ -f .agentops/results/latest/report.md ]; then
|
|
112
|
+
cat .agentops/results/latest/report.md
|
|
113
|
+
fi
|
|
114
|
+
if [ -f .agentops/release/latest/evidence.md ]; then
|
|
115
|
+
echo
|
|
116
|
+
echo "---"
|
|
117
|
+
echo
|
|
118
|
+
cat .agentops/release/latest/evidence.md
|
|
119
|
+
fi
|
|
120
|
+
} >> "$GITHUB_STEP_SUMMARY"
|
|
121
|
+
|
|
122
|
+
- name: Comment AgentOps report on PR
|
|
123
|
+
if: always() && github.event_name == 'pull_request'
|
|
124
|
+
uses: actions/github-script@v8
|
|
125
|
+
with:
|
|
126
|
+
script: |
|
|
127
|
+
const fs = require('fs');
|
|
128
|
+
const path = '.agentops/results/latest/report.md';
|
|
129
|
+
const marker = '<!-- agentops-pr-report -->';
|
|
130
|
+
let body = `${marker}\n## AgentOps PR Eval\n\nNo report produced.`;
|
|
131
|
+
if (fs.existsSync(path)) {
|
|
132
|
+
const md = fs.readFileSync(path, 'utf8');
|
|
133
|
+
body = `${marker}\n${md}`;
|
|
134
|
+
}
|
|
135
|
+
const evidencePath = '.agentops/release/latest/evidence.md';
|
|
136
|
+
if (fs.existsSync(evidencePath)) {
|
|
137
|
+
const evidence = fs.readFileSync(evidencePath, 'utf8');
|
|
138
|
+
body = `${body}\n\n---\n\n${evidence}`;
|
|
139
|
+
}
|
|
140
|
+
const { owner, repo } = context.repo;
|
|
141
|
+
const issue_number = context.payload.pull_request.number;
|
|
142
|
+
const { data: comments } = await github.rest.issues.listComments({ owner, repo, issue_number });
|
|
143
|
+
const existing = comments.find(c => c.body && c.body.startsWith(marker));
|
|
144
|
+
if (existing) {
|
|
145
|
+
await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
|
|
146
|
+
} else {
|
|
147
|
+
await github.rest.issues.createComment({ owner, repo, issue_number, body });
|
|
148
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# AgentOps — Scheduled doctor
|
|
2
|
+
#
|
|
3
|
+
# Runs `agentops doctor` on a daily cron and on manual dispatch.
|
|
4
|
+
# Uploads report.md, history.jsonl, and release evidence artifacts so
|
|
5
|
+
# production-readiness history persists across runners.
|
|
6
|
+
#
|
|
7
|
+
# When AZURE_AI_FOUNDRY_PROJECT_ENDPOINT is set as a repository variable,
|
|
8
|
+
# the analyzer auto-discovers the Foundry project's Application Insights
|
|
9
|
+
# and emits OpenTelemetry traces there in addition to the local artifacts.
|
|
10
|
+
# If discovery is not available in your tenant, set
|
|
11
|
+
# APPLICATIONINSIGHTS_CONNECTION_STRING as a GitHub secret or variable.
|
|
12
|
+
#
|
|
13
|
+
# Generated by `agentops workflow generate` (kind: doctor).
|
|
14
|
+
|
|
15
|
+
name: AgentOps doctor
|
|
16
|
+
|
|
17
|
+
on:
|
|
18
|
+
schedule:
|
|
19
|
+
# Daily at 06:00 UTC — adjust to taste.
|
|
20
|
+
- cron: "0 6 * * *"
|
|
21
|
+
workflow_dispatch:
|
|
22
|
+
inputs:
|
|
23
|
+
severity_fail:
|
|
24
|
+
description: "Severity that fails the run (info | warning | critical)"
|
|
25
|
+
required: false
|
|
26
|
+
default: "critical"
|
|
27
|
+
|
|
28
|
+
permissions:
|
|
29
|
+
contents: read
|
|
30
|
+
id-token: write
|
|
31
|
+
|
|
32
|
+
concurrency:
|
|
33
|
+
group: agentops-doctor-${{ github.workflow }}-${{ github.ref }}
|
|
34
|
+
cancel-in-progress: true
|
|
35
|
+
|
|
36
|
+
jobs:
|
|
37
|
+
analyze:
|
|
38
|
+
name: AgentOps doctor analyze
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
environment: dev
|
|
41
|
+
timeout-minutes: 30
|
|
42
|
+
steps:
|
|
43
|
+
- name: Checkout
|
|
44
|
+
uses: actions/checkout@v6
|
|
45
|
+
|
|
46
|
+
- name: Azure login (OIDC)
|
|
47
|
+
uses: azure/login@v3
|
|
48
|
+
with:
|
|
49
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
50
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
51
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
52
|
+
|
|
53
|
+
- name: Set up Python
|
|
54
|
+
uses: actions/setup-python@v6
|
|
55
|
+
with:
|
|
56
|
+
python-version: "3.11"
|
|
57
|
+
|
|
58
|
+
- name: Install uv
|
|
59
|
+
uses: astral-sh/setup-uv@v7
|
|
60
|
+
with:
|
|
61
|
+
enable-cache: false
|
|
62
|
+
|
|
63
|
+
- name: Install AgentOps Toolkit
|
|
64
|
+
run: |
|
|
65
|
+
uv pip install --system "agentops-accelerator[foundry,agent] @ git+https://github.com/Azure/agentops.git@main"
|
|
66
|
+
|
|
67
|
+
# First run has no prior artifact. Using `pattern:` instead of
|
|
68
|
+
# `name:` makes actions/download-artifact return success with zero
|
|
69
|
+
# downloads when the artifact does not exist yet, instead of
|
|
70
|
+
# surfacing a red error annotation on every first run.
|
|
71
|
+
- name: Restore Doctor history (if any)
|
|
72
|
+
uses: actions/download-artifact@v4
|
|
73
|
+
with:
|
|
74
|
+
pattern: agentops-doctor-history
|
|
75
|
+
path: .agentops/agent/
|
|
76
|
+
merge-multiple: true
|
|
77
|
+
|
|
78
|
+
- name: Run AgentOps doctor
|
|
79
|
+
id: analyze
|
|
80
|
+
env:
|
|
81
|
+
AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_FOUNDRY_PROJECT_ENDPOINT }}
|
|
82
|
+
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
|
|
83
|
+
AZURE_OPENAI_DEPLOYMENT: ${{ vars.AZURE_OPENAI_DEPLOYMENT }}
|
|
84
|
+
APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTION_STRING || vars.APPLICATIONINSIGHTS_CONNECTION_STRING }}
|
|
85
|
+
run: |
|
|
86
|
+
set +e
|
|
87
|
+
agentops doctor --workspace . --out .agentops/agent/report.md \
|
|
88
|
+
--severity-fail "${{ inputs.severity_fail || 'critical' }}" \
|
|
89
|
+
--evidence-pack
|
|
90
|
+
echo "exit_code=$?" >> "$GITHUB_OUTPUT"
|
|
91
|
+
|
|
92
|
+
- name: Upload Doctor artifacts
|
|
93
|
+
if: always()
|
|
94
|
+
uses: actions/upload-artifact@v7
|
|
95
|
+
with:
|
|
96
|
+
name: agentops-doctor-history
|
|
97
|
+
path: |
|
|
98
|
+
.agentops/agent/report.md
|
|
99
|
+
.agentops/agent/history.jsonl
|
|
100
|
+
.agentops/release/latest/evidence.json
|
|
101
|
+
.agentops/release/latest/evidence.md
|
|
102
|
+
if-no-files-found: warn
|
|
103
|
+
retention-days: 90
|
|
104
|
+
|
|
105
|
+
- name: Step summary
|
|
106
|
+
if: always()
|
|
107
|
+
run: |
|
|
108
|
+
{
|
|
109
|
+
echo "## AgentOps doctor"
|
|
110
|
+
echo
|
|
111
|
+
if [ -f .agentops/agent/report.md ]; then
|
|
112
|
+
cat .agentops/agent/report.md
|
|
113
|
+
else
|
|
114
|
+
echo "No report.md produced."
|
|
115
|
+
fi
|
|
116
|
+
if [ -f .agentops/release/latest/evidence.md ]; then
|
|
117
|
+
echo
|
|
118
|
+
echo "---"
|
|
119
|
+
echo
|
|
120
|
+
cat .agentops/release/latest/evidence.md
|
|
121
|
+
fi
|
|
122
|
+
} >> "$GITHUB_STEP_SUMMARY"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Utility helpers package."""
|