Skip to content

Agent usability: docs, imports, REVIEW log level - #74

Merged
chiruu12 merged 1 commit into
devfrom
fix/agent-usability
Jul 20, 2026
Merged

Agent usability: docs, imports, REVIEW log level#74
chiruu12 merged 1 commit into
devfrom
fix/agent-usability

Conversation

@chiruu12

@chiruu12chiruu12 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix Guard.init() docstring — it described auto-instrumentation that does not exist; now documents the process-wide singleton.
  • Standardize import guidance across primary docs: apps/agents use from unplug import ...; server/MCP dependents use unplug.api.*; unplug.core.* is internal.
  • Downgrade routine REVIEW pipeline outcome logs from WARNING to INFO (scanner errors / ML degradation warnings unchanged).
  • ML degradation warnings in guard.py were already unified in Harden model store and guard ML init #72 — both load-failure paths cite pip install "unplug-ai[ml]" plus unplug-models download; no code change needed.

Changed files

ItemFiles
1. Guard.init() docstringsdk/src/unplug/guard.py
2. Import-style docsREADME.md, sdk/README.md, sdk/docs/GETTING_STARTED.md, sdk/docs/PUBLIC_API.md, sdk/docs/AGENT_ACTIONS.md
3. REVIEW log levelsdk/src/unplug/pipelines/base.py, sdk/tests/unit/pipelines/test_pipelines.py
4. Degradation warningsAlready done (#72) — verified only

Test plan

  • make check (ruff, mypy, pytest)
  • make test-cov85.59% total coverage (80% gate)
  • New TestPipelineLogging.test_review_outcome_logs_at_info asserts REVIEW logs at INFO via caplog

Note

Low Risk
Documentation and logging-only changes; no scan policy, auth, or enforcement behavior changes beyond log level for REVIEW.

Overview
Agent usability polish: correct Guard.init() docs, standardize import guidance, and quiet routine REVIEW pipeline logs.

Guard.init() no longer claims auto-instrumentation; the docstring now describes creating the process-wide singleton used with Guard.get().

Primary docs (README, GETTING_STARTED, PUBLIC_API, AGENT_ACTIONS) now spell out import paths: apps/agents use top-level from unplug import ...; server/MCP dependents use unplug.api.*; unplug.core.* is internal.

In BasePipeline, normal REVIEW outcomes log at INFO instead of WARNING (mid-risk scores no longer elevate REVIEW to warning). Scanner errors and other degradation warnings are unchanged.

Adds TestPipelineLogging.test_review_outcome_logs_at_info and a CHANGELOG entry under Fixed.

Reviewed by Cursor Bugbot for commit 4a7fc6d. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

Copy link
Copy Markdown

Greptile Summary

This PR updates agent-facing docs and quiets routine review logging.

  • Clarifies Guard.init() as a process-wide singleton.
  • Standardizes public import guidance across README and SDK docs.
  • Logs routine REVIEW pipeline outcomes at INFO.
  • Adds test coverage for the new review log level.

Confidence Score: 5/5

The changed code looks mergeable after small cleanup to diagnostics and docs.

  • Review events can disappear from warning-based monitoring unless operators update log routing.
  • The main README gives mixed import guidance in the Quickstart.
  • No blocking runtime, build, or security issues were found in the changed paths.

sdk/src/unplug/pipelines/base.py, README.md

Important Files Changed

FilenameOverview
sdk/src/unplug/pipelines/base.pyRoutes Action.REVIEW pipeline outcome logs to INFO while leaving error logs and non-review risk-band logging unchanged.
sdk/tests/unit/pipelines/test_pipelines.pyAdds a regression test that triggers a review tool-call outcome and checks its log level.
sdk/src/unplug/guard.pyUpdates the Guard.init() docstring to describe singleton creation.
README.mdAdds import-style guidance, with one adjacent Quickstart example still using the server-style import path.
sdk/README.mdAdds SDK import-style guidance for top-level app imports and unplug.api.* dependent imports.
sdk/docs/PUBLIC_API.mdAdds an audience-based import-path table for top-level and unplug.api.* usage.

Fix All in Claude Code

Reviews (1): Last reviewed commit: "Clarify imports and quiet REVIEW logs" | Re-trigger Greptile

Comment threadsdk/src/unplug/pipelines/base.py
Comment threadREADME.md
@github-actions

Copy link
Copy Markdown

coverage

SDK Coverage •
FileStmtsMissCoverMissing
src/unplug
guard.py3432891%127, 194–195, 197, 213–214, 288, 301, 304, 309, 417, 449, 451, 453, 490, 509, 512, 517, 552, 599, 684–685, 687–690, 696, 715
src/unplug/pipelines
base.py88297%100, 166
TOTAL7164101785%

TestsSkippedFailuresErrorsTime
114825 💤0 ❌0 🔥40.043s ⏱️

@chiruu12
chiruu12 merged commit 4ada24f into devJul 20, 2026
6 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@chiruu12