feat(acms): implement builtin/context skill for CRP #1149
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!1149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/m5-crp-context-skill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements the
builtin/contextskill for the Context Request Protocol (CRP), wiring the three existing tool stubs to the ACMS pipeline and ContextTierService.Closes #873
Changes
src/cleveragents/skills/builtins/context_ops.pyrequest_context: Sources fragments fromContextTierService(all tiers), filters by query/focus keywords, and delegates toACMSPipeline.assemble()for budget-constrained context assembly. Accepts optionalplan_idfor actor-context invocation.query_history: Searches across hot/warm/cold tiers for fragments matching the query string via case-insensitive substring matching. Returns results sorted by last-accessed timestamp.get_context_budget: Returns current token budget state (max, reserved, available, used) computed fromContextBudgetdefaults and hot-tier fragment token counts.build_context_skill_definition(): New factory function that creates aSkillDefinitionforbuiltin/contextwith all 3 resolved tool entries, ready forSkillRegistryregistration at startup.plan_idas optional parameter torequest_contextinput schema.src/cleveragents/application/container.pyACMSPipelineas aproviders.Singletonin the DI container, wired withsettingsandunit_of_work.src/cleveragents/skills/builtins/__init__.pybuild_context_skill_definition()factory.features/crp_models.featureNotImplementedErrorstub test scenarios with 8 new functional BDD scenarios:request_contextreturns assembled context with fragmentsrequest_contextreturns empty result with no stored fragmentsrequest_contextfilters fragments by queryrequest_contextfilters fragments by focus targetsquery_historyreturns entries / empty entriesget_context_budgetreturns budget state / reports used tokensbuiltin/context SkillDefinitioncan be builtfeatures/steps/crp_models_steps.pyContextTierServiceinstances and verify handler outputs.Motivation
The specification defines CRP as the structured vocabulary through which actors declare needed information, accessed "via builtin/context skill." The CRP domain models and ACMS pipeline were already implemented, but no skill existed to expose them. Actors had no way to programmatically request context during plan execution.
Design Decisions
get_container()at invocation time to avoid circular imports and enable test overrides.Quality Gates
context_ops.pyReview: APPROVED
Good implementation replacing 3
NotImplementedErrorstubs with real implementations wired to the ACMS pipeline andContextTierService. Thebuild_context_skill_definition()factory is clean, structured helpers like_tiered_to_pipeline_fragmentand_fragment_to_dictare well-named, and properstructloglogging is used throughout. 11 new BDD scenarios cover the main paths.Items to Note
Direct access to private tier attributes. The code accesses
tier_service._hot,_warm,_colddirectly — this creates fragile coupling to the internal tier service implementation. Consider adding a public method liketier_service.all_fragments()to theContextTierServiceAPI instead.No Robot Framework integration tests present in this diff. Noted for consistency with the multi-level testing mandate.
_scopeparameter inquery_historyis accepted but unused (dead code path). Either implement it or remove the parameter to keep the interface honest.69c9e46afb1a7db9b0f2New commits pushed, approval review dismissed automatically according to repository settings
1a7db9b0f2d10a83c5c0Addressed the minor follow-up review notes in this update:
builtin/contexthandlers to use new publicContextTierServiceaccessors (get_all_fragments()/get_hot_fragments()) instead of reaching into private tier stores.scopeinput fromquery_historyso the tool schema matches current runtime behavior.I also rebased the branch on latest
masterand pushed the update.Rebased onto origin/master, resolved conflicts. Already approved, Merging.
d10a83c5c01e4b6d5be3