Bc registry asset comments and issues

From breatheco-de/apiv2 · View interactive version

Bc registry asset comments and issues is an AI agent skill from the GitHub repository breatheco-de/apiv2. Use when academy staff need to manage registry asset comments (optional `academies=<id,id>` querystring on GET for multi-academy scope) and asset error issues end-to-end including deduping legacy duplicate error rows, and do NOT use for public asset browsing or non-registry workflows.

How to use this skill

Skill file

Skill: Manage Registry Asset Comments and Issues

When to Use

Use this skill when staff need to create, assign, review, resolve, update, or delete comments on registry assets, and when they need to list/update/delete asset error issues. Use it for academy-scoped moderation and QA workflows. Do NOT use this skill for public learner asset browsing or for editing syllabus/admissions entities outside registry.

Concepts

flowchart LR
    commentOpen[Comment resolved=false] -->|set resolved=true| commentResolved[Comment resolved=true]
    commentResolved -->|set resolved=false| commentOpen
flowchart LR
    errorState[ERROR] --> fixedState[FIXED]
    errorState --> ignoredState[IGNORED]
    fixedState --> errorState
    ignoredState --> errorState

Workflow

  1. Set request headers for all calls:
  1. For comment creation, resolve the target asset first:
  1. Create a comment:
  1. Review/filter comments:
  1. Manage comment lifecycle:
  1. Manage asset error issues:
  1. Confirm outcomes after writes:

Endpoints

Asset Comments

| Action | Method | Path | Required headers | Required body fields | Response notes |

|---|---|---|---|---|---|

| List comments | GET | /v1/registry/academy/asset/comment | Authorization, Academy | None | Paginated list (default sort: newest first). Supports sort=priority and sort=-priority. Use querystring academies=<id1,id2,...> for multi-academy read aggregation. |

| Create comment | POST | /v1/registry/academy/asset/comment | Authorization, Academy | asset, text | 201 comment object; author set from session user. |

| Update comment | PUT | /v1/registry/academy/asset/comment/<comment_id> | Authorization, Academy | None globally required; send fields to change | 200 updated comment object. |

| Delete comment | DELETE | /v1/registry/academy/asset/comment/<comment_id> | Authorization, Academy | None | 204 no content. |

Permissions

List scope and filters

Create comment request

{
  "asset": "javascript-arrays-intro",
  "text": "The instructions need clearer expected output examples."
}

Create comment response

{
  "id": 823,
  "text": "The instructions need clearer expected output examples.",
  "asset": {
    "id": 301,
    "slug": "javascript-arrays-intro",
    "title": "JavaScript Arrays Intro"
  },
  "resolved": false,
  "delivered": false,
  "priority": 0,
  "author": {
    "id": 17,
    "email": "reviewer@academy.io"
  },
  "owner": null,
  "created_at": "2026-04-02T12:15:10.103Z"
}

Update comment request (close + assign)

{
  "owner": 42,
  "resolved": true,
  "delivered": true,
  "urgent": false,
  "priority": 2
}

Update comment response

{
  "id": 823,
  "text": "The instructions need clearer expected output examples.",
  "asset": {
    "id": 301,
    "slug": "javascript-arrays-intro",
    "title": "JavaScript Arrays Intro"
  },
  "resolved": true,
  "delivered": true,
  "priority": 2,
  "author": {
    "id": 17,
    "email": "reviewer@academy.io"
  },
  "owner": {
    "id": 42,
    "email": "owner@academy.io"
  },
  "created_at": "2026-04-02T12:15:10.103Z"
}

Asset Error Issues

| Action | Method | Path | Required headers | Required body fields | Response notes |

|---|---|---|---|---|---|

| List issues | GET | /v1/registry/academy/asset/error | Authorization, Academy | None | Paginated list; supports issue filters and sort=priority|-priority. |

| Get issue catalog (legend) | GET | /v1/registry/academy/asset/error/catalog | Authorization, Academy | None | Returns dynamic catalog from AssetErrorLogType with descriptions and trigger hints. |

| Dedupe legacy duplicate issues | POST | /v1/registry/academy/asset/error/<error_id>/dedupe | Authorization, Academy | {} (empty JSON object) | 200 JSON with kept, deleted_ids, deleted_count. |

| Update issues (single or bulk) | PUT | /v1/registry/academy/asset/error | Authorization, Academy | id per object, plus fields to update | 200 list of updated issue objects. |

| Delete one issue | DELETE | /v1/registry/academy/asset/error/<error_id> | Authorization, Academy | None | 204 no content. |

| Delete many issues | DELETE | /v1/registry/academy/asset/error?<lookups> | Authorization, Academy | Query lookups | 204 no content. |

Permissions

Dedupe behavior (POST /v1/registry/academy/asset/error/<error_id>/dedupe)

Dedupe request

{}

Dedupe response (no duplicates)

{
  "kept": {
    "id": 911,
    "slug": "readme-syntax",
    "priority": 0,
    "status": "ERROR",
    "path": "README.md",
    "asset_type": "LESSON",
    "created_at": "2026-04-02T09:18:01.122Z"
  },
  "deleted_ids": [],
  "deleted_count": 0
}

Dedupe response (duplicates removed)

{
  "kept": {
    "id": 911,
    "slug": "readme-syntax",
    "priority": 3,
    "status": "ERROR",
    "path": "README.md",
    "asset_type": "LESSON",
    "created_at": "2026-04-02T09:18:01.122Z"
  },
  "deleted_ids": [912, 913],
  "deleted_count": 2
}

Catalog (legend) response fields

Catalog behavior

List filters (GET /v1/registry/academy/asset/error)

Filtering examples

Update issue request (single)

{
  "id": 911,
  "status": "FIXED"
}

Update issue request (bulk list)

[
  {
    "id": 911,
    "status": "FIXED"
  },
  {
    "id": 912,
    "status": "IGNORED"
  }
]

Update issue response

[
  {
    "id": 911,
    "slug": "readme-syntax",
    "priority": 0,
    "status": "FIXED",
    "path": "README.md",
    "asset_type": "LESSON",
    "created_at": "2026-04-02T09:18:01.122Z"
  }
]

Edge Cases

  1. Single or multiple academy IDs in header

Academy can be a single ID (Academy: 1) or a comma-separated list (Academy: 1,2,3) for GET aggregation. Mutating endpoints still expect a single academy scope.

  1. Comment text is immutable after creation

PUT for comments cannot update text, asset, or author; only lifecycle/assignment fields should be changed.

  1. Owner cannot self-resolve

If the current session user is the same as owner, changing resolved raises a validation error.

  1. Comment response does not expose all stored fields

urgent exists on the model, but the comment response serializer does not return it.

  1. Comment PUT status is not a supported lifecycle field

The view checks status=NOT_STARTED, but comment serializer logic excludes author; do not rely on status when updating comments.

  1. Error status updates can affect grouped rows

Updating status for one error can propagate to other rows with the same slug, asset_type, path, and asset.

  1. Error delete mode validation

Do not mix URL error_id with bulk lookup query params in the same delete request.

  1. Dedupe can change fields on the kept row

If duplicates disagree on status, priority, status_text, or user, the merge rules on the dedupe endpoint may update the kept row before deleting duplicates. Re-fetch the kept id after dedupe if the UI caches the old values.

  1. Recurring errors return to ERROR when re-logged

If an issue was marked FIXED/IGNORED but the underlying problem happens again, the system may upsert the same logical row back to ERROR with refreshed details.

Checklist

  1. Confirmed headers: Authorization and Academy are set on every /academy/ call.
  2. Used comment POST with asset + text, and verified author came from session.
  3. Used comment PUT only for assignment/lifecycle fields, not text.
  4. Closed or reopened comments using resolved flag and handled owner-resolve restriction.
  5. Listed and filtered comments/issues with proper query parameters and used multi-academy Academy header on GET when cross-academy aggregation was needed.
  6. Updated error issues with awareness of grouped status propagation.
  7. If duplicate identical issues were still visible, called POST /v1/registry/academy/asset/error/<keeper_id>/dedupe and verified deleted_count and the returned kept.id.
  8. Deleted comments/issues using the correct single or bulk endpoint pattern.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.