Topolo Docs Topolo Platform
Open workspace

Check Feed completion threshold

Calculate the completion rate for a valid window and persist a new open anomaly only below the requested threshold. A null anomaly with an observed value is a valid HTTP 201 result.

Outcome

Calculate the completion rate for a valid window and persist a new open anomaly only below the requested threshold. A null anomaly with an observed value is a valid HTTP 201 result.

Before you start

  • Verify the authenticated identity, exact environment and pinned approved organization context before preparing an action.
  • Development stores content without encryption and uses scoped SHA-256 identifier hashes. Staging and production require envelope encryption and a provisioned application root; missing custody does not permit plaintext.
  • The published application permission is feed:write. Discover a granted Feed workspace and bind that exact resource. Supplied identifiers and query selectors do not grant access.
  • Authorize the documented mirror, security, external-fetch, reporting, privacy or archival effects before CLI --confirm or MCP confirm:true. A GET request can initialize a local mirror.

Discover the target

topolo whoami --json
topolo actions get app_topolo_feed.analytics.anomaly.check --detail --json
topolo resources topolo-feed --json
topolo workspaces list topolo-feed --json
  • Select the exact granted workspace id as FEED_WORKSPACE_ID. Fixture ids authorize no live operation.

Request

POST /api/analytics/anomaly-checks

Save action input as payload.json. Inspect the plan for the exact path, query and body. Set FEED_WORKSPACE_ID from granted resource discovery.

Inspect and test this action in the signed action console, then perform the verification below.

Input fields

FieldRequiredTypeConstraints
windowStartRequiredintegerInclusive reporting-window start in Unix milliseconds, a non-negative integer.; {"minimum":0,"maximum":9007199254740991}
windowEndRequiredintegerInclusive reporting-window end in Unix milliseconds, a positive integer strictly greater than windowStart.; {"maximum":9007199254740991}
minimumCompletionRateRequirednumberCompletion-rate threshold from 0 to 100 inclusive. A rate at or above it returns anomaly:null without persisting a new finding.; {"minimum":0,"maximum":100}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "windowStart": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Inclusive reporting-window start in Unix milliseconds, a non-negative integer."
    },
    "windowEnd": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "Inclusive reporting-window end in Unix milliseconds, a positive integer strictly greater than windowStart."
    },
    "minimumCompletionRate": {
      "type": "number",
      "minimum": 0,
      "maximum": 100,
      "description": "Completion-rate threshold from 0 to 100 inclusive. A rate at or above it returns anomaly:null without persisting a new finding."
    }
  },
  "required": [
    "windowStart",
    "windowEnd",
    "minimumCompletionRate"
  ],
  "additionalProperties": false
}

Effects

  • Resolves the workspace through platform grants and can insert its identity-only local mirror before the route permission check. GET is therefore a mutation for action planning; it does not create a canonical workspace or change its name.
  • Zero starts produce a 0 completion rate. At or above threshold, returns anomaly:null and stores no new anomaly.
  • Below threshold, stores a new open anomaly and attempts configured notification transport. Repeated below-threshold calls create new anomalies; they do not deduplicate or resolve old ones.

Interpret the response

This action can return no new resource identifier. Follow the specific response verification and do not invent a target id.

Inspect observedValue and anomaly. Retain anomaly.id only when anomaly is non-null; null is not a missing-resource failure. A successful response is not a notification delivery receipt. Review the threshold and exact time bounds before another check.

The success schema below was checked against captured handler responses. Polymorphic configuration and protected device assignment fields vary; exact envelope and SQL row fields are source-reviewed. Error examples retain their actual refusal shapes.

Success schema:

{
  "type": "object",
  "properties": {
    "anomaly": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "observedValue": {
              "type": "number"
            },
            "thresholdValue": {
              "type": "number"
            },
            "createdAt": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "observedValue",
            "thresholdValue",
            "createdAt"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "observedValue": {
      "type": "number"
    }
  },
  "required": [
    "anomaly",
    "observedValue"
  ],
  "additionalProperties": false
}

Worked examples

Actual Feed Worker response using synthetic Auth, workspace grants, in-memory D1/KV and simulated source/notification transport. No live provider, encryption audit, device enrollment or external delivery is established. Credentials are excluded or explicitly redacted. SQL result shapes are also reviewed against migrations and handlers; empty captures do not exercise every populated export store. Live publication and read-back are separate environment evidence. Refused examples demonstrate boundaries and must not be executed as successful workflows.

Successful request

Actual Feed Worker response using synthetic Auth, workspace grants, in-memory D1/KV and simulated source/notification transport. No live provider, encryption audit, device enrollment or external delivery is established. Credentials are excluded or explicitly redacted. Captured scenario: digest and anomaly actions persist workspace-scoped terminal state.

Input · payload.json:

{
  "windowStart": 0,
  "windowEnd": 100,
  "minimumCompletionRate": 75
}

CLI:

topolo actions validate app_topolo_feed.analytics.anomaly.check --data @payload.json --json
topolo actions plan app_topolo_feed.analytics.anomaly.check --resource-type workspace --resource-id "$FEED_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_feed.analytics.anomaly.check --resource-type workspace --resource-id "$FEED_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_feed.analytics.anomaly.check",
    "input": {
      "windowStart": 0,
      "windowEnd": 100,
      "minimumCompletionRate": 75
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "anomaly": {
    "id": "anomaly_06b5b369-bb7a-4d13-a9a8-bc66d1ccf5eb",
    "observedValue": 0,
    "thresholdValue": 75,
    "createdAt": "2026-10-04T04:12:42.925Z"
  },
  "observedValue": 0
}

HTTP 201. Inspect observedValue and anomaly. Retain anomaly.id only when anomaly is non-null; null is not a missing-resource failure. A successful response is not a notification delivery receipt. Review the threshold and exact time bounds before another check.

Another supported request

Actual Feed Worker response using synthetic Auth, workspace grants, in-memory D1/KV and simulated source/notification transport. No live provider, encryption audit, device enrollment or external delivery is established. Credentials are excluded or explicitly redacted. Captured scenario: zero anomaly threshold does not create an anomaly for an empty reporting window.

Input · payload.json:

{
  "windowStart": 0,
  "windowEnd": 10,
  "minimumCompletionRate": 0
}

CLI:

topolo actions validate app_topolo_feed.analytics.anomaly.check --data @payload.json --json
topolo actions plan app_topolo_feed.analytics.anomaly.check --resource-type workspace --resource-id "$FEED_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_feed.analytics.anomaly.check --resource-type workspace --resource-id "$FEED_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_feed.analytics.anomaly.check",
    "input": {
      "windowStart": 0,
      "windowEnd": 10,
      "minimumCompletionRate": 0
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "anomaly": null,
  "observedValue": 0
}

HTTP 201. Inspect observedValue and anomaly. Retain anomaly.id only when anomaly is non-null; null is not a missing-resource failure. A successful response is not a notification delivery receipt. Review the threshold and exact time bounds before another check.

Verify the result

  • Inspect observedValue and anomaly. Retain anomaly.id only when anomaly is non-null; null is not a missing-resource failure.
  • A successful response is not a notification delivery receipt. Review the threshold and exact time bounds before another check.

Errors and recovery

  • forbidden (HTTP 403): Use the published permission in the approved credential scope. Do not switch contexts to bypass a denial.
  • invalid_reporting_window (HTTP 400): For reporting mutations select windowEnd greater than windowStart. Query reads use their separately declared filter constraints.

Auth, action-input validation and platform resource resolution can refuse a request before its handler. Retain the exact error, request id and context; requesting another context is not a legitimate way to bypass a refusal.

Recovery boundary

No published action resolves or removes an existing anomaly. Keep the original finding and use a separately authorized later check; an uncertain below-threshold call must not be blindly repeated.

  • Export Feed organization data: Export all local Feed stores for the authenticated organization, including readable protected fields and per-workspace KV configuration and assignments. This operation is organization-wide and is not limited by a workspace header.

Evidence

Actual Feed Worker response using synthetic Auth, workspace grants, in-memory D1/KV and simulated source/notification transport. No live provider, encryption audit, device enrollment or external delivery is established. Credentials are excluded or explicitly redacted. SQL result shapes are also reviewed against migrations and handlers; empty captures do not exercise every populated export store. Live publication and read-back are separate environment evidence. Capture digests and test scenarios are retained in the source fixture records.