UAT: PythonDecorator UKO class incorrectly extends uko-code:TypeDefinition — spec requires uko:Annotation as parent #5921

Open
opened 2026-04-09 11:49:45 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

What Was Tested

PythonDecorator class definition in src/cleveragents/acms/uko/layer3_py.py — the UKO Layer 3 class representing Python decorator chain entries.

Expected Behavior (from spec)

Per docs/specification.md §44180–44182, the UKO Layer 0 ontology defines:

uko:Annotation a owl:Class ;
    rdfs:subClassOf uko:InformationUnit ;
    rdfs:comment "Metadata attached to another information unit (comment, docstring, attribute)." .

Python decorators (@property, @staticmethod, @classmethod, custom decorators) are metadata attached to functions and classes — they are annotations in the ontological sense. The spec's Layer 3 Python TTL file (docs/ontology/uko-py.ttl) shows Python-specific annotation classes extending uko:Annotation.

Actual Behavior

PythonDecorator is defined as extending uko-code:TypeDefinition:

# src/cleveragents/acms/uko/layer3_py.py, lines 81-91
# Intentionally parallel to JavaAnnotation; pending
# uko-code:Annotation base (see #576 review).
PythonDecorator = UKOClass(
    uri=f"{UKO_PY_IRI}PythonDecorator",
    label="PythonDecorator",
    comment=(
        "A decorator chain entry (@property, @staticmethod, "
        "@classmethod, custom decorators)."
    ),
    subclass_of=(f"{UKO_CODE_IRI}TypeDefinition",),  # WRONG PARENT
)

uko-code:TypeDefinition is for type definitions (classes, interfaces, type aliases) — not for metadata annotations. A Python decorator is not a type definition; it is metadata attached to a function or class.

The code comment acknowledges this is a known issue: "Intentionally parallel to JavaAnnotation; pending uko-code:Annotation base (see #576 review)." Issue #576 is now closed, but this fix was not included.

Correct Parent

PythonDecorator should extend uko:Annotation (Layer 0), consistent with how JavaAnnotation is defined in layer3_java.py.

Code Location

  • src/cleveragents/acms/uko/layer3_py.py, lines 81–91 (PythonDecorator)

Impact

  • UKO graph queries that filter by uko:Annotation type will miss Python decorators
  • The breadth-depth-navigator strategy may incorrectly classify decorators as type definitions, affecting context assembly quality
  • The ontology hierarchy is semantically incorrect, which may confuse downstream consumers of the UKO graph

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report ### What Was Tested `PythonDecorator` class definition in `src/cleveragents/acms/uko/layer3_py.py` — the UKO Layer 3 class representing Python decorator chain entries. ### Expected Behavior (from spec) Per `docs/specification.md` §44180–44182, the UKO Layer 0 ontology defines: ```turtle uko:Annotation a owl:Class ; rdfs:subClassOf uko:InformationUnit ; rdfs:comment "Metadata attached to another information unit (comment, docstring, attribute)." . ``` Python decorators (`@property`, `@staticmethod`, `@classmethod`, custom decorators) are metadata attached to functions and classes — they are annotations in the ontological sense. The spec's Layer 3 Python TTL file (`docs/ontology/uko-py.ttl`) shows Python-specific annotation classes extending `uko:Annotation`. ### Actual Behavior `PythonDecorator` is defined as extending `uko-code:TypeDefinition`: ```python # src/cleveragents/acms/uko/layer3_py.py, lines 81-91 # Intentionally parallel to JavaAnnotation; pending # uko-code:Annotation base (see #576 review). PythonDecorator = UKOClass( uri=f"{UKO_PY_IRI}PythonDecorator", label="PythonDecorator", comment=( "A decorator chain entry (@property, @staticmethod, " "@classmethod, custom decorators)." ), subclass_of=(f"{UKO_CODE_IRI}TypeDefinition",), # WRONG PARENT ) ``` `uko-code:TypeDefinition` is for type definitions (classes, interfaces, type aliases) — not for metadata annotations. A Python decorator is not a type definition; it is metadata attached to a function or class. The code comment acknowledges this is a known issue: "Intentionally parallel to JavaAnnotation; pending uko-code:Annotation base (see #576 review)." Issue #576 is now closed, but this fix was not included. ### Correct Parent `PythonDecorator` should extend `uko:Annotation` (Layer 0), consistent with how `JavaAnnotation` is defined in `layer3_java.py`. ### Code Location - `src/cleveragents/acms/uko/layer3_py.py`, lines 81–91 (`PythonDecorator`) ### Impact - UKO graph queries that filter by `uko:Annotation` type will miss Python decorators - The `breadth-depth-navigator` strategy may incorrectly classify decorators as type definitions, affecting context assembly quality - The ontology hierarchy is semantically incorrect, which may confuse downstream consumers of the UKO graph --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-09 12:21:06 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5921
No description provided.