Skip to content

JasonColapietro/suede-creator-skills / skills/suede-rights-passport

suede-rights-passport

Flagged

Audit rights gaps in ownership, contributors, splits, samples, licenses, provenance, and AI involvement, or assemble a hashed offline handoff package with a validated manifest. Use when asked to "prepare a rights handoff" or assess release, licensing, or royalty-routing evidence. Keeps confirmed facts separate from open questions. NOT FOR: release file linting (use suede-release-linter), sync pitching (use suede-sync-packaging), or rollout campaigns (use suede-campaign-in-a-box).

FileKindSize
CARD.mdmarkdown5.1 KB
SKILL.mdskill md14.5 KB
agents/openai.yamlconfig638 B
assets/credits-and-splits.template.mdmarkdown533 B
assets/license-notes.template.mdmarkdown488 B
assets/missing-info-report.template.mdmarkdown882 B
assets/optimization-brief.template.mdmarkdown823 B
assets/provenance.template.mdmarkdown485 B
assets/rights-passport.template.mdmarkdown898 B
assets/suede-intake.schema.jsonconfig15.2 KB
assets/suede-intake.template.jsonconfig2.0 KB
references/audit-lanes.mdmarkdown7.2 KB
references/creator-questions.mdmarkdown2.0 KB
references/ddex-c2pa-crosswalk.mdmarkdown6.6 KB
references/intake-schema.mdmarkdown6.5 KB
references/optimization-checklist.mdmarkdown1.9 KB
references/package-standard.mdmarkdown3.9 KB
references/passport-context.mdmarkdown831 B
references/worked-handoff.mdmarkdown1.8 KB
scripts/create_transfer_package.pyexecutablescript58.8 KB
scripts/fixtures/README.mdmarkdown1.6 KB
scripts/fixtures/sample-blocked-package/RIGHTS_PASSPORT.mdmarkdown2.0 KB
scripts/fixtures/sample-blocked-package/assets/audio/Neon Static - Rough Mix.mp3binary2.8 KB
scripts/fixtures/sample-blocked-package/assets/docs/metadata.jsonconfig1.6 KB
scripts/fixtures/sample-blocked-package/assets/docs/notes-do-not-share.txtmarkdown320 B
scripts/fixtures/sample-blocked-package/assets/lyrics/lyrics-draft.txtmarkdown244 B
scripts/fixtures/sample-blocked-package/credits-and-splits.mdmarkdown772 B
scripts/fixtures/sample-blocked-package/license-notes.mdmarkdown665 B
scripts/fixtures/sample-blocked-package/missing-info-report.mdmarkdown1.7 KB
scripts/fixtures/sample-blocked-package/optimization-brief.mdmarkdown1.4 KB
scripts/fixtures/sample-blocked-package/provenance.mdmarkdown1.5 KB
scripts/fixtures/sample-blocked-package/suede-intake.jsonconfig6.8 KB
scripts/fixtures/sample-complete-package/RIGHTS_PASSPORT.mdmarkdown2.3 KB
scripts/fixtures/sample-complete-package/assets/artwork/cover-artwork.pngbinary960 B
scripts/fixtures/sample-complete-package/assets/audio/Golden Hour Reprise - Master.wavbinary2.9 KB
scripts/fixtures/sample-complete-package/assets/docs/metadata.jsonconfig1.5 KB
scripts/fixtures/sample-complete-package/assets/docs/split-sheet.txtmarkdown376 B
scripts/fixtures/sample-complete-package/assets/lyrics/lyrics.txtmarkdown213 B
scripts/fixtures/sample-complete-package/assets/stems/Golden Hour Reprise - Instrumental Stem.wavbinary1.8 KB
scripts/fixtures/sample-complete-package/assets/stems/Golden Hour Reprise - Vocals Stem.wavbinary1.6 KB
scripts/fixtures/sample-complete-package/credits-and-splits.mdmarkdown685 B
scripts/fixtures/sample-complete-package/license-notes.mdmarkdown658 B
scripts/fixtures/sample-complete-package/missing-info-report.mdmarkdown549 B
scripts/fixtures/sample-complete-package/optimization-brief.mdmarkdown1.2 KB
scripts/fixtures/sample-complete-package/provenance.mdmarkdown1.9 KB
scripts/fixtures/sample-complete-package/suede-intake.jsonconfig5.4 KB
scripts/migrate_intake_v1_to_v2.pyexecutablescript6.6 KB
scripts/validate_json_schema.pyscript7.1 KB
scripts/validate_transfer_package.pyexecutablescript30.0 KB

scripts/validate_json_schema.py

View on GitHub
#!/usr/bin/env python3
"""Dependency-free validator for the JSON Schema keywords used by this skill.

This module executes the bundled Draft 2020-12 schema rather than maintaining a
second hand-written shape contract. It intentionally supports the complete
keyword subset present in `assets/suede-intake.schema.json`; adding another
schema keyword requires adding support here and a regression test.
"""

from __future__ import annotations

import re
from datetime import date, datetime
from typing import Any


SUPPORTED_KEYWORDS = {
    "$schema",
    "$id",
    "$defs",
    "$ref",
    "title",
    "description",
    "type",
    "additionalProperties",
    "required",
    "properties",
    "items",
    "const",
    "enum",
    "pattern",
    "minLength",
    "minimum",
    "maximum",
    "format",
}


def _pointer(root: dict[str, Any], reference: str) -> dict[str, Any]:
    if not reference.startswith("#/"):
        raise ValueError(f"Only local JSON Schema references are supported: {reference}")
    value: Any = root
    for raw_part in reference[2:].split("/"):
        part = raw_part.replace("~1", "/").replace("~0", "~")
        if not isinstance(value, dict) or part not in value:
            raise ValueError(f"Unresolvable JSON Schema reference: {reference}")
        value = value[part]
    if not isinstance(value, dict):
        raise ValueError(f"JSON Schema reference does not resolve to an object: {reference}")
    return value


def _is_type(value: Any, expected: str) -> bool:
    if expected == "object":
        return isinstance(value, dict)
    if expected == "array":
        return isinstance(value, list)
    if expected == "string":
        return isinstance(value, str)
    if expected == "integer":
        return isinstance(value, int) and not isinstance(value, bool)
    if expected == "number":
        return isinstance(value, (int, float)) and not isinstance(value, bool)
    if expected == "boolean":
        return isinstance(value, bool)
    if expected == "null":
        return value is None
    raise ValueError(f"Unsupported JSON Schema type: {expected}")


def _validate_format(value: str, format_name: str) -> bool:
    try:
        if format_name == "date":
            date.fromisoformat(value)
            return True
        if format_name == "date-time":
            parsed = datetime.fromisoformat(value.replace("Z", "+00:00"))
            return parsed.tzinfo is not None
    except ValueError:
        return False
    raise ValueError(f"Unsupported JSON Schema format: {format_name}")


def _join(path: str, child: str | int) -> str:
    return f"{path}/{child}" if path else f"/{child}"


def assert_supported_schema(schema: dict[str, Any], path: str = "#") -> None:
    """Fail closed if the published schema introduces an unsupported keyword."""
    unsupported = sorted(set(schema) - SUPPORTED_KEYWORDS)
    if unsupported:
        raise ValueError(f"{path}: unsupported JSON Schema keyword(s): {', '.join(unsupported)}")
    for container_key in ("$defs", "properties"):
        container = schema.get(container_key, {})
        if not isinstance(container, dict):
            raise ValueError(f"{path}/{container_key}: must be an object")
        for name, child in container.items():
            if not isinstance(child, dict):
                raise ValueError(f"{path}/{container_key}/{name}: must be an object")
            assert_supported_schema(child, f"{path}/{container_key}/{name}")
    if "items" in schema:
        child = schema["items"]
        if not isinstance(child, dict):
            raise ValueError(f"{path}/items: must be an object")
        assert_supported_schema(child, f"{path}/items")


def validate_instance(
    instance: Any,
    schema: dict[str, Any],
    *,
    root_schema: dict[str, Any] | None = None,
    path: str = "",
) -> list[str]:
    """Return human-readable schema violations for one JSON value."""
    root = root_schema or schema
    unsupported = sorted(set(schema) - SUPPORTED_KEYWORDS)
    if unsupported:
        raise ValueError(f"Unsupported JSON Schema keyword(s): {', '.join(unsupported)}")
    if "$ref" in schema:
        target = _pointer(root, str(schema["$ref"]))
        return validate_instance(instance, target, root_schema=root, path=path)

    label = path or "/"
    errors: list[str] = []
    expected = schema.get("type")
    if expected is not None:
        allowed_types = expected if isinstance(expected, list) else [expected]
        if not any(_is_type(instance, str(type_name)) for type_name in allowed_types):
            errors.append(f"{label}: expected type {' or '.join(map(str, allowed_types))}")
            return errors

    if "const" in schema and instance != schema["const"]:
        errors.append(f"{label}: must equal {schema['const']!r}")
    if "enum" in schema and instance not in schema["enum"]:
        errors.append(f"{label}: value is not in the allowed enum")

    if isinstance(instance, str):
        if len(instance) < int(schema.get("minLength", 0)):
            errors.append(f"{label}: string is shorter than minLength {schema['minLength']}")
        if "pattern" in schema and re.search(str(schema["pattern"]), instance) is None:
            errors.append(f"{label}: string does not match pattern {schema['pattern']!r}")
        if "format" in schema and not _validate_format(instance, str(schema["format"])):
            errors.append(f"{label}: string is not a valid {schema['format']}")

    if isinstance(instance, (int, float)) and not isinstance(instance, bool):
        if "minimum" in schema and instance < schema["minimum"]:
            errors.append(f"{label}: number is below minimum {schema['minimum']}")
        if "maximum" in schema and instance > schema["maximum"]:
            errors.append(f"{label}: number is above maximum {schema['maximum']}")

    if isinstance(instance, dict):
        required = schema.get("required", [])
        for key in required:
            if key not in instance:
                errors.append(f"{_join(path, key)}: required property is missing")
        properties = schema.get("properties", {})
        if not isinstance(properties, dict):
            raise ValueError(f"{label}: schema properties must be an object")
        for key, value in instance.items():
            if key in properties:
                child_schema = properties[key]
                if not isinstance(child_schema, dict):
                    raise ValueError(f"{label}: schema for property {key!r} must be an object")
                errors += validate_instance(
                    value, child_schema, root_schema=root, path=_join(path, key)
                )
            elif schema.get("additionalProperties") is False:
                errors.append(f"{_join(path, key)}: additional property is not allowed")

    if isinstance(instance, list) and "items" in schema:
        item_schema = schema["items"]
        if not isinstance(item_schema, dict):
            raise ValueError(f"{label}: schema items must be an object")
        for index, value in enumerate(instance):
            errors += validate_instance(
                value, item_schema, root_schema=root, path=_join(path, index)
            )
    return errors
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall