UAT: TemporalService / revision-chain temporal queries not wired — UKOIndexer never populates TemporalBackend #6339

Open
opened 2026-04-09 20:11:49 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Spec Reference

docs/specification.md — ACMS > UKO > Revision-Aware RDF > Temporal Data Model (lines ~41940–42499)

"Every typed triple carries sourceResource, validFrom, isCurrent metadata. Revision chain enables temporal queries."

The spec requires that:

  1. When a resource is re-indexed, the previous UKO node is marked historical (isCurrent=False, valid_until set) and a new revision node is created, linked via uko:isRevisionOf.
  2. The RevisionChain model enables queries like "give me the context as it was 2 hours ago" (TemporalScope.RECENT) or full history (TemporalScope.ALL).

Code Locations

UKOIndexer pipeline: /app/src/cleveragents/application/services/uko_indexer.py
TemporalService: /app/src/cleveragents/application/services/temporal_service.py
InMemoryTemporalBackend: /app/src/cleveragents/domain/models/acms/temporal_stubs.py
DI Container: /app/src/cleveragents/application/container.py

Finding

The TemporalService and InMemoryTemporalBackend are fully implemented but are never connected to the indexing pipeline and are not registered in the DI container.

  1. UKOIndexer._index_resource_core() never calls TemporalService:
    The indexer stores provenance metadata as raw graph triples (uko:validFrom, uko:isCurrent, etc.) via index_graph(), but does not call temporal_service.store_initial_node() for new resources or temporal_service.create_revision() when re-indexing existing resources (lines ~175–280 in uko_indexer.py).

  2. TemporalService is absent from the DI container:
    Searching container.py for temporal_service returns no results. The container registers context_tier_service (line 715) but has no temporal_service provider. This means no code path can obtain a TemporalService instance via dependency injection.

  3. InMemoryTemporalBackend is only reachable from test exports:
    Found only in domain/models/acms/__init__.py (re-exported for test use) and the temporal_stubs.py module itself.

Impact

The spec-required "revision chain enables temporal queries" capability is completely non-functional:

  • temporal_service.get_revision_chain("uko-py:class/Foo") cannot be called from any production path.
  • temporal_service.get_history("uko-py:class/Foo", TemporalScope.RECENT) returns nothing because no TemporalNode objects are ever stored during indexing.
  • temporal_service.query_by_tier(ContextTier.WARM, TemporalScope.ALL, ...) returns empty results.
  • When a resource is re-indexed via UKOIndexer.reindex_resource(), the previous version's isCurrent flag is NOT set to False in the TemporalBackend — old revisions are simply overwritten in the graph backend without leaving a traceable historical chain.

Steps to Reproduce

  1. Index a resource: agents repo index local/my-repo
  2. Modify a file in the resource and re-index: agents repo index local/my-repo
  3. Attempt to query revision history via TemporalService.get_revision_chain() — no data available
  4. Confirm: temporal_service is not obtainable via container.temporal_service() (AttributeError)

Expected

  • UKOIndexer._index_resource_core() calls temporal_service.store_initial_node() for first-time indexing of each UKO node.
  • UKOIndexer.reindex_resource() calls temporal_service.create_revision() to mark old nodes historical and create new revision nodes with is_revision_of linkage.
  • The DI container registers a temporal_service singleton backed by InMemoryTemporalBackend (or a persistent backend).

Actual

TemporalService is never instantiated in production. Zero TemporalNode objects are ever stored during indexing. All temporal queries return empty results. The revision chain capability is fully dark.


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

## Bug Report ### Spec Reference `docs/specification.md` — ACMS > UKO > Revision-Aware RDF > Temporal Data Model (lines ~41940–42499) > "Every typed triple carries `sourceResource`, `validFrom`, `isCurrent` metadata. Revision chain enables temporal queries." The spec requires that: 1. When a resource is re-indexed, the previous UKO node is marked historical (`isCurrent=False`, `valid_until` set) and a new revision node is created, linked via `uko:isRevisionOf`. 2. The `RevisionChain` model enables queries like "give me the context as it was 2 hours ago" (`TemporalScope.RECENT`) or full history (`TemporalScope.ALL`). ### Code Locations **UKOIndexer pipeline**: `/app/src/cleveragents/application/services/uko_indexer.py` **TemporalService**: `/app/src/cleveragents/application/services/temporal_service.py` **InMemoryTemporalBackend**: `/app/src/cleveragents/domain/models/acms/temporal_stubs.py` **DI Container**: `/app/src/cleveragents/application/container.py` ### Finding The `TemporalService` and `InMemoryTemporalBackend` are fully implemented but are **never connected to the indexing pipeline** and are **not registered in the DI container**. 1. **`UKOIndexer._index_resource_core()` never calls `TemporalService`**: The indexer stores provenance metadata as raw graph triples (`uko:validFrom`, `uko:isCurrent`, etc.) via `index_graph()`, but does **not** call `temporal_service.store_initial_node()` for new resources or `temporal_service.create_revision()` when re-indexing existing resources (lines ~175–280 in `uko_indexer.py`). 2. **`TemporalService` is absent from the DI container**: Searching `container.py` for `temporal_service` returns no results. The container registers `context_tier_service` (line 715) but has no `temporal_service` provider. This means no code path can obtain a `TemporalService` instance via dependency injection. 3. **`InMemoryTemporalBackend` is only reachable from test exports**: Found only in `domain/models/acms/__init__.py` (re-exported for test use) and the `temporal_stubs.py` module itself. ### Impact The spec-required "revision chain enables temporal queries" capability is completely non-functional: - `temporal_service.get_revision_chain("uko-py:class/Foo")` cannot be called from any production path. - `temporal_service.get_history("uko-py:class/Foo", TemporalScope.RECENT)` returns nothing because no `TemporalNode` objects are ever stored during indexing. - `temporal_service.query_by_tier(ContextTier.WARM, TemporalScope.ALL, ...)` returns empty results. - When a resource is re-indexed via `UKOIndexer.reindex_resource()`, the previous version's `isCurrent` flag is NOT set to `False` in the `TemporalBackend` — old revisions are simply overwritten in the graph backend without leaving a traceable historical chain. ### Steps to Reproduce 1. Index a resource: `agents repo index local/my-repo` 2. Modify a file in the resource and re-index: `agents repo index local/my-repo` 3. Attempt to query revision history via `TemporalService.get_revision_chain()` — no data available 4. Confirm: `temporal_service` is not obtainable via `container.temporal_service()` (AttributeError) ### Expected - `UKOIndexer._index_resource_core()` calls `temporal_service.store_initial_node()` for first-time indexing of each UKO node. - `UKOIndexer.reindex_resource()` calls `temporal_service.create_revision()` to mark old nodes historical and create new revision nodes with `is_revision_of` linkage. - The DI container registers a `temporal_service` singleton backed by `InMemoryTemporalBackend` (or a persistent backend). ### Actual `TemporalService` is never instantiated in production. Zero `TemporalNode` objects are ever stored during indexing. All temporal queries return empty results. The revision chain capability is fully dark. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 21:09:36 +00:00
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#6339
No description provided.