AI Agents Workflow for Library Integrators#
This page defines the minimum contract so AI agents can safely consume SMonitor signals from your host library without breaking human workflows.
Why this matters#
If your team uses agents for triage, QA, or patch proposals, the agent needs:
stable machine-readable identifiers (
code,signal),stable grouping/correlation identifiers (
fingerprint,run_id,session_id, optionalcorrelation_id),deterministic structure in events,
reproducible artifacts (bundles),
explicit safety limits.
Without this, agent output is noisy and difficult to trust.
Required operational contract in the host library#
Keep
codevalues stable once published.Keep
signalnames stable and descriptive.Emit actionable
hintfor human users inuserprofile.Ensure
agentprofile keeps compact, structured output.Enable local bundle export in support flows.
Keep strict validation enabled in CI:
strict_signals=Truestrict_schema=True
Preserve both explicit machine and handoff views:
normalizedhuman_summary
Recommended profile usage#
user: clear natural language, actionable next step.dev: richer context for implementation debugging.qa: strict checks + explicit contract failures.agent: concise machine-oriented payload with low ambiguity.
CI pattern for agent-readiness#
Add these checks in CI:
tests run with strict signal/schema settings,
a smoke test that exports a bundle,
snapshot/assertions for representative emitted events.
This ensures agents always receive a stable data contract.
Copy-paste checklist for onboarding a new agent#
Use this checklist in any new host-library repo:
read
standards/SMONITOR_GUIDE.mdfirst;verify
_smonitor.py+mylib/_private/smonitor/catalog.pyare present;avoid adding hardcoded warning/error strings outside catalog;
validate representative events under
profile="agent";validate representative events include
fingerprint,normalized, andhuman_summary;confirm bundle export works in CI smoke path;
confirm
smonitor compare ...gives meaningful diffs for representative runs;include test evidence before proposing fixes.
Guardrails for autonomous tooling#
Never auto-merge fixes produced from agent triage.
Require human review for any patch suggested from SMonitor output.
Prefer deterministic triage keys (
code,fingerprint) before free-text matching.Redact sensitive fields before sharing bundles externally.
Practical flow#
User or CI run emits SMonitor events.
Bundle is exported locally.
Agent inspects
triage,normalized, andhuman_summary.If needed, agent compares against a previous bundle.
Agent proposes diagnosis.
Human reviews diagnosis and proposed patch.
Fix is validated with tests and strict checks.