# Actor Quality Guard (`skilled_glee/actor-quality-guard`) Actor

Audit Apify Actors for contract integrity, machine discovery, execution readiness, pricing, safety, and Store readiness. Returns deterministic scores, blockers, rule IDs, and repair recommendations.

- **URL**: https://apify.com/skilled_glee/actor-quality-guard.md
- **Developed by:** [EchoEmpire LLC](https://apify.com/skilled_glee) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 quality report produceds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Actor Quality Guard

Evaluate whether an Apify Actor is structurally sound, machine-discoverable, commercially ready, and safe to publish — and get a machine-readable quality report, not vague advice.

**Give me:** one or more Actor assessments (manifest, schemas, capability card, README, pricing, examples, run evidence).
**I reliably return:** a deterministic quality report per Actor with per-dimension scores, severity-graded findings, blocking defects, and publication/pricing/discovery recommendations.

### What it evaluates

Six quality dimensions, 28 rules (rule set `aqg-rules-v0.1.1`):

| Dimension | Weight | What it checks |
|---|---|---|
| Contract integrity | 25% | Valid manifest/schemas, required fields, input/output compatibility, capability claims supported, no contradictions |
| Machine discovery | 15% | Clear title/description, categories/keywords, valid examples, supported vs unsupported behavior |
| Execution readiness | 20% | Runnable entrypoint, deterministic output structure, partial-failure isolation, stable identifiers |
| Commercial readiness | 15% | Explicit pricing, billing tied to useful stored output, no synthetic charges, price unknown without benchmark |
| Trust and safety | 15% | No embedded credentials, declared network behavior, provenance, unknowns reported as unknown |
| Store readiness | 10% | README completeness, examples, limitations, API guidance, buyer-facing value proposition |

#### Severity levels

- **BLOCKER** — must be resolved before publication. A blocker always forces status `BLOCKED`, regardless of the numerical score.
- **HIGH / MEDIUM / LOW** — graded findings that lower the score and produce repair actions.
- **INFO** — reported for transparency; never fails a check.

#### Assessment statuses

`PASS` · `PASS_WITH_WARNINGS` · `REPAIR_REQUIRED` · `BLOCKED` · `INSUFFICIENT_EVIDENCE` · `FAILED`

A numerical score never overrides a blocking defect. Missing evidence is reported as unknown — never interpreted as a pass.

### Intended users

- Foundry operators deciding whether an Actor is ready for Store publication.
- Machine pipelines that gate publication, pricing, or promotion on quality evidence.
- The Capability Contract Repair Bridge, which consumes this report's findings to generate repair bundles.

### Relationship to the bridges

- **Portfolio Activation Bridge** assembles portfolio-level activation inputs from canonical contracts. Quality Guard evaluates individual Actors against quality rules.
- **Capability Contract Repair Bridge** produces repair bundles for incomplete contracts. Quality Guard scores Actors and identifies findings; a repair bundle can be attached as evidence, and the Guard reports which findings the bundle actually resolves (and which it does not).
- No duplication: the Guard never rewrites contracts or generates repair patches — it measures and reports.

### Input example

```json
{
  "assessments": [
    {
      "actorRef": {"actorId": "abc123", "slug": "page-metadata-extractor", "name": "Page Metadata Extractor"},
      "correlationId": "batch-1",
      "manifest": {"name": "page-metadata-extractor", "title": "Page Metadata Extractor",
                   "description": "Turn public webpage URLs into structured metadata records."},
      "inputSchema": {"type": "object",
                      "properties": {"urls": {"type": "array", "items": {"type": "string"}}},
                      "required": ["urls"]},
      "outputSchema": {"type": "object",
                       "properties": {"url": {"type": "string"}, "title": {"type": "string"}}},
      "pricing": {"pricingModel": "PAY_PER_EVENT",
                  "events": {"page-processed": {"priceUsd": 0.001}}},
      "readme": "# Page Metadata Extractor\n\n## Input\n\n## Output\n\n## Limitations\n\n...",
      "exampleInput": {"urls": ["https://example.com"]},
      "exampleOutput": {"url": "https://example.com", "title": "Example"}
    }
  ]
}
```

Up to 25 assessments per run. Invalid items are isolated as `FAILED` records — the batch never fails wholesale. The `correlationId` you supply is preserved in the report.

### Output example

Each report contains:

```json
{
  "actorRef": {"actorId": "abc123", "slug": "page-metadata-extractor", "name": "Page Metadata Extractor"},
  "correlationId": "batch-1",
  "assessmentStatus": "REPAIR_REQUIRED",
  "qualityScore": 72,
  "qualityGrade": "C",
  "dimensionScores": {"contract_integrity": 100, "machine_discovery": 80, "...": 0},
  "passedChecks": ["CI-001", "CI-002"],
  "findings": [{"ruleId": "CR-001", "dimension": "commercial_readiness", "severity": "HIGH",
                "passed": false, "detail": "No pricing configuration", "evidenceRef": "pricing"}],
  "blockingDefects": [],
  "recommendedRepairs": [{"ruleId": "CR-001", "severity": "HIGH",
                          "action": "Pricing configuration explicit", "detail": "..."}],
  "missingEvidence": ["benchmarkEvidence"],
  "publicationRecommendation": "DO_NOT_PUBLISH — repair required findings before publication",
  "pricingRecommendation": "Price UNKNOWN — benchmark required before pricing",
  "discoveryRecommendation": "Improve discovery: add categories, add keywords",
  "reportId": "aqg-9f2c…",
  "digest": "sha256…",
  "contractVersion": "aqg-report-v0.1",
  "ruleSetVersion": "aqg-rules-v0.1.1",
  "generatedAt": "2026-10-12T…Z"
}
```

Reports are pushed to the default dataset; a run summary is stored as `SUMMARY` in the key-value store.

#### Score interpretation

| Grade | Score | Meaning |
|---|---|---|
| A | 90–100 | Meets the quality bar |
| B | 75–89 | Good, minor gaps |
| C | 60–74 | Usable with repairs |
| D | 40–59 | Significant gaps |
| F | 0–39 | Not ready |

#### Blocker behavior

Any `BLOCKER`-severity failure (missing manifest, missing input schema, synthetic-only billing, embedded credentials) forces status `BLOCKED` and a `DO_NOT_PUBLISH` recommendation — even if the numerical score is high. Blockers are listed in `blockingDefects` and each gets a repair action.

### Billing semantics

Pay-per-event: **`quality-report-produced`**.

- `quality-report-produced` is charged only **after** a valid quality report has been stored.
- `quality-report-produced` is never charged for `FAILED` or `BLOCKED` reports, malformed input, or unstored reports.
- The custom event price is **$0.001 per stored, non-blocked, non-failed quality report** ($1.00 per 1,000).
- Within one run, a report digest is charged `quality-report-produced` at most once.
- Two Apify synthetic events are also enabled. `apify-default-dataset-item` costs $0.00001 for **every** report written to the dataset, including `BLOCKED` and `FAILED` reports, so a stored `BLOCKED` report costs $0.00001 rather than $0. `apify-actor-start` costs $0.00005 per GB of run memory (minimum one event) once per run: $0.00005 at the default 1024 MB.
- Platform usage is included; the user does not pay separate compute charges.

### Limitations

- Evaluates **repository-recorded or caller-supplied evidence only**. It does not fetch live Store state.
- Credential scanning is pattern-based; it detects credential-like keys with secret-like values, not all exfiltration vectors.
- Example validation is structural (required fields, rough types), not full JSON Schema validation.
- Network/proxy behavior is assessed from documentation, not observed traffic.
- Scores are comparative within one rule set version; the rule set is re-versioned whenever weights or detection logic change. `aqg-rules-v0.1.1` (2026-10-24) keeps the v0.1 weights and adds recognition of standard Apify schema formats (see below).
- Output-contract recognition: `outputSchema` / `datasetSchema` pass as present when they are plain JSON Schemas (`type`), standard Apify dataset schemas (`actorSpecification` with `fields` or `views`), or standard Apify output schemas (`actorOutputSchemaVersion` with `properties`). Stable-identifier and provenance checks read record fields from the dataset schema's `fields.properties` (or view field lists), and accept names such as `*Id`, `*Sha256`, `url`, `sourceUrl`, `finalUrl`.
- Contradiction detection is limited to the specific checks in the rule set (for example example-input vs input schema). It does not compare README prose against pricing, so a README-vs-pricing contradiction can go unreported.

### API usage

```bash
curl -X POST "https://api.apify.com/v2/acts/<actor-id>/runs?token=<token>" \
  -H "Content-Type: application/json" \
  -d '{"assessments": [<assessment objects>]}'
```

Read results from the run's default dataset; read `SUMMARY` from the key-value store for counts.

### Python client usage

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("<actor-id>").call(run_input={"assessments": [assessment]})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
```

### MCP / agent consumption

The report is plain JSON with stable rule IDs (`CI-001`, `MD-003`, …), severity levels, and deterministic `reportId`/`digest` values. Agents can:

1. Call the Actor with assessment payloads.
2. Filter `blockingDefects` to gate publication.
3. Feed `recommendedRepairs` into the Capability Contract Repair Bridge.
4. Compare `digest` values to detect quality drift across runs.

### Lifecycle

**PUBLISHED** — locally tested, cloud benchmarked, priced, Store-listed, and verified through a public example task on 2026-10-12. Actor ID: `7Z3j9zAdh5XfR0DV9`.

# Actor input Schema

## `assessments` (type: `array`):

One to 25 actor assessments. Each must carry enough evidence for quality evaluation; missing evidence is reported as unknown, never invented.

## Actor input object example

```json
{
  "assessments": [
    {
      "actorRef": {
        "actorId": "example-actor-id",
        "slug": "page-metadata-extractor",
        "name": "Page Metadata Extractor"
      },
      "correlationId": "example-1",
      "manifest": {
        "name": "page-metadata-extractor",
        "title": "Page Metadata Extractor",
        "description": "Turn public webpage URLs into structured metadata records.",
        "version": "0.1"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "urls"
        ],
        "additionalProperties": false
      },
      "exampleInput": {
        "urls": [
          "https://example.com"
        ]
      },
      "pricing": {
        "pricingModel": "PAY_PER_EVENT",
        "events": {
          "page-processed": {
            "priceUsd": 0.001
          }
        }
      }
    }
  ]
}
```

# Actor output Schema

## `reports` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "assessments": [
        {
            "actorRef": {
                "actorId": "example-actor-id",
                "slug": "page-metadata-extractor",
                "name": "Page Metadata Extractor"
            },
            "correlationId": "example-1",
            "manifest": {
                "name": "page-metadata-extractor",
                "title": "Page Metadata Extractor",
                "description": "Turn public webpage URLs into structured metadata records.",
                "version": "0.1"
            },
            "inputSchema": {
                "type": "object",
                "properties": {
                    "urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "urls"
                ],
                "additionalProperties": false
            },
            "exampleInput": {
                "urls": [
                    "https://example.com"
                ]
            },
            "pricing": {
                "pricingModel": "PAY_PER_EVENT",
                "events": {
                    "page-processed": {
                        "priceUsd": 0.001
                    }
                }
            }
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("skilled_glee/actor-quality-guard").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "assessments": [{
            "actorRef": {
                "actorId": "example-actor-id",
                "slug": "page-metadata-extractor",
                "name": "Page Metadata Extractor",
            },
            "correlationId": "example-1",
            "manifest": {
                "name": "page-metadata-extractor",
                "title": "Page Metadata Extractor",
                "description": "Turn public webpage URLs into structured metadata records.",
                "version": "0.1",
            },
            "inputSchema": {
                "type": "object",
                "properties": { "urls": {
                        "type": "array",
                        "items": { "type": "string" },
                    } },
                "required": ["urls"],
                "additionalProperties": False,
            },
            "exampleInput": { "urls": ["https://example.com"] },
            "pricing": {
                "pricingModel": "PAY_PER_EVENT",
                "events": { "page-processed": { "priceUsd": 0.001 } },
            },
        }] }

# Run the Actor and wait for it to finish
run = client.actor("skilled_glee/actor-quality-guard").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "assessments": [
    {
      "actorRef": {
        "actorId": "example-actor-id",
        "slug": "page-metadata-extractor",
        "name": "Page Metadata Extractor"
      },
      "correlationId": "example-1",
      "manifest": {
        "name": "page-metadata-extractor",
        "title": "Page Metadata Extractor",
        "description": "Turn public webpage URLs into structured metadata records.",
        "version": "0.1"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "urls"
        ],
        "additionalProperties": false
      },
      "exampleInput": {
        "urls": [
          "https://example.com"
        ]
      },
      "pricing": {
        "pricingModel": "PAY_PER_EVENT",
        "events": {
          "page-processed": {
            "priceUsd": 0.001
          }
        }
      }
    }
  ]
}' |
apify call skilled_glee/actor-quality-guard --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,skilled_glee/actor-quality-guard"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7Z3j9zAdh5XfR0DV9/builds/4DwZicdD8UQAhdsOd/openapi.json
