UAT: ContextRequest CRP model missing spec-required include and exclude fields for UKO URI/relationship filtering #3512

Open
opened 2026-04-05 18:44:55 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/acms-crp-context-request-include-exclude-fields
  • Commit Message: fix(acms): add include, exclude, and keywords fields to ContextRequest CRP model
  • Milestone: None (backlog)
  • Parent Epic: #396

Backlog note: This issue was discovered during autonomous operation
on milestone v3.4.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Background

The spec defines the CRP (Context Request Protocol) ContextRequest structure with include and exclude fields for filtering by UKO URIs or relationship types. These fields are absent from the current implementation in src/cleveragents/domain/models/acms/crp.py.

Spec-defined CRP request structure:

- focus: <UKO_URI>
  depth: <integer | named_level>
  breadth: <integer>
  include:
    - <UKO_URI | relationship_type>
  exclude:
    - <UKO_URI | relationship_type>
  keywords:
    - <string>
  semantic_query: <string>

Current Behavior

The ContextRequest model has entities, uko_types, focus, query, and preferred_strategies fields but lacks the spec-defined include, exclude, and keywords fields. The semantic_query field is also absent (though query serves a similar purpose).

Strategies like breadth-depth-navigator and arce that traverse the UKO graph cannot receive explicit include/exclude relationship type filters from actors. This limits the expressiveness of context requests.

Steps to reproduce:

  1. Read src/cleveragents/domain/models/acms/crp.py
  2. Compare ContextRequest fields against the spec's CRP request structure
  3. Note the absence of include, exclude, and keywords fields

Expected Behavior

ContextRequest should have:

  • include: list[str] — UKO URIs or relationship types to explicitly include
  • exclude: list[str] — UKO URIs or relationship types to explicitly exclude
  • keywords: list[str] — keyword terms for text search (currently approximated by entities field)
  • semantic_query: str — natural language semantic query (currently approximated by query field)

Subtasks

  • Add include: list[str] field to ContextRequest in src/cleveragents/domain/models/acms/crp.py
  • Add exclude: list[str] field to ContextRequest in src/cleveragents/domain/models/acms/crp.py
  • Add keywords: list[str] field to ContextRequest in src/cleveragents/domain/models/acms/crp.py
  • Evaluate whether semantic_query: str should be a distinct field from query, or if query covers both use cases per spec intent
  • Update any strategies (breadth-depth-navigator, arce, etc.) that consume ContextRequest to respect the new include/exclude filters
  • Update serialisation/deserialisation (Pydantic validators, YAML/JSON schema) for the new fields
  • Tests (unit): Add tests verifying include, exclude, and keywords fields are accepted and passed through correctly
  • Tests (Behave): Add/update BDD scenarios covering include/exclude filtering in context requests
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/acms-crp-context-request-include-exclude-fields` - **Commit Message**: `fix(acms): add include, exclude, and keywords fields to ContextRequest CRP model` - **Milestone**: None (backlog) - **Parent Epic**: #396 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.4.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background The spec defines the CRP (Context Request Protocol) `ContextRequest` structure with `include` and `exclude` fields for filtering by UKO URIs or relationship types. These fields are absent from the current implementation in `src/cleveragents/domain/models/acms/crp.py`. **Spec-defined CRP request structure:** ```yaml - focus: <UKO_URI> depth: <integer | named_level> breadth: <integer> include: - <UKO_URI | relationship_type> exclude: - <UKO_URI | relationship_type> keywords: - <string> semantic_query: <string> ``` ## Current Behavior The `ContextRequest` model has `entities`, `uko_types`, `focus`, `query`, and `preferred_strategies` fields but lacks the spec-defined `include`, `exclude`, and `keywords` fields. The `semantic_query` field is also absent (though `query` serves a similar purpose). Strategies like `breadth-depth-navigator` and `arce` that traverse the UKO graph cannot receive explicit include/exclude relationship type filters from actors. This limits the expressiveness of context requests. **Steps to reproduce:** 1. Read `src/cleveragents/domain/models/acms/crp.py` 2. Compare `ContextRequest` fields against the spec's CRP request structure 3. Note the absence of `include`, `exclude`, and `keywords` fields ## Expected Behavior `ContextRequest` should have: - `include: list[str]` — UKO URIs or relationship types to explicitly include - `exclude: list[str]` — UKO URIs or relationship types to explicitly exclude - `keywords: list[str]` — keyword terms for text search (currently approximated by `entities` field) - `semantic_query: str` — natural language semantic query (currently approximated by `query` field) ## Subtasks - [ ] Add `include: list[str]` field to `ContextRequest` in `src/cleveragents/domain/models/acms/crp.py` - [ ] Add `exclude: list[str]` field to `ContextRequest` in `src/cleveragents/domain/models/acms/crp.py` - [ ] Add `keywords: list[str]` field to `ContextRequest` in `src/cleveragents/domain/models/acms/crp.py` - [ ] Evaluate whether `semantic_query: str` should be a distinct field from `query`, or if `query` covers both use cases per spec intent - [ ] Update any strategies (`breadth-depth-navigator`, `arce`, etc.) that consume `ContextRequest` to respect the new `include`/`exclude` filters - [ ] Update serialisation/deserialisation (Pydantic validators, YAML/JSON schema) for the new fields - [ ] Tests (unit): Add tests verifying `include`, `exclude`, and `keywords` fields are accepted and passed through correctly - [ ] Tests (Behave): Add/update BDD scenarios covering include/exclude filtering in context requests - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged**. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.4.0 milestone 2026-04-05 20:07:10 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — ContextRequest CRP model is missing spec-required include, exclude, and keywords fields. This limits the expressiveness of context requests — strategies like breadth-depth-navigator and arce cannot receive explicit include/exclude filters from actors.
  • Milestone: v3.4.0
  • Story Points: 3 — M — Add fields to the model, update serialization, and update consuming strategies to respect the new filters.
  • MoSCoW: Should Have — The CRP model completeness is important for the ACMS v1 pipeline. The spec defines these fields as part of the core CRP request structure. Without them, context filtering is limited.
  • Parent Epic: #396 (dependency link already exists)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — `ContextRequest` CRP model is missing spec-required `include`, `exclude`, and `keywords` fields. This limits the expressiveness of context requests — strategies like `breadth-depth-navigator` and `arce` cannot receive explicit include/exclude filters from actors. - **Milestone**: v3.4.0 - **Story Points**: 3 — M — Add fields to the model, update serialization, and update consuming strategies to respect the new filters. - **MoSCoW**: Should Have — The CRP model completeness is important for the ACMS v1 pipeline. The spec defines these fields as part of the core CRP request structure. Without them, context filtering is limited. - **Parent Epic**: #396 (dependency link already exists) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo removed this from the v3.4.0 milestone 2026-04-06 21:04:23 +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.

Blocks
#396 Epic: ACMS Context Pipeline
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3512
No description provided.