feat(resource): implement ResourceHandler CRUD and discovery methods #1054
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!1054
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/resource-handler-crud"
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
ResourceHandlerprotocol with six new content operations:read,write,delete,list_children,diff, anddiscover_childrenContent,WriteResult,DeleteResult,DiffResult) to the handler protocolGitCheckoutHandler(via git plumbing + filesystem),FsDirectoryHandler(via pathlib/os/difflib), and partial support forDevcontainerHandler(read/write/discover viadevcontainer exec)DatabaseResourceHandlerinheritsNotImplementedErrorstubs pending connection managementDetails
Protocol Extension (
protocol.py)Content— frozen dataclass withdata: bytes,encoding,content_hash,metadata, and a.textconvenience propertyWriteResult—success,bytes_written,content_hash,messageDeleteResult—success,messageDiffResult—has_changes,unified_diff,files_changed,insertions,deletionsResourceHandlerProtocol with full Google-style docstringsBase Handler (
_base.py)NotImplementedErrordefaults for all six methods so existing handlers remain valid_require_location()helper extracted for DRY location validation_derive_child_id()helper for generating ULID-valid child resource IDsHandler Implementations
read(git show + fs fallback),write(file write),delete(unlink + git rm --cached),list_children(git ls-tree),diff(git diff --no-index),discover_children(git ls-tree -d)read(pathlib),write(pathlib),delete(unlink/rmtree),list_children(os.listdir),diff(difflib unified),discover_children(os.scandir)read(devcontainer exec cat),write(devcontainer exec tee),discover_children(devcontainer exec ls)Tests
ISSUES CLOSED: #827
Code Review — PR #1054
feat(resource): implement ResourceHandler CRUD and discovery methodsComprehensive implementation across the full handler hierarchy. The architecture is clean: protocol layer defines 4 frozen dataclasses + 6 method signatures, base layer provides DRY helpers and
NotImplementedErrordefaults, and each handler implements what it can. Good design decisions:Content.textproperty with encoding-aware decode_derive_child_id()using SHA-256 → Crockford Base32 for ULID-compatible IDsGitCheckoutHandlerwith filesystem fallback for untracked filesDevcontainerHandlerimplementing read/write/discover viadevcontainer exec19 Behave scenarios + 2 Robot integration tests provide solid coverage. The
DatabaseResourceHandlercorrectly inheritsNotImplementedErrorstubs pending connection management — good boundary decision.Approved. No issues found.
Day 43 Review — Rebase Required
This PR has merge conflicts with
masterand cannot be merged in its current state. This is one of 9 Hamza PRs in the resource/LSP domain (v3.5.0-v3.6.0) that all have conflicts. These PRs likely share a common dependency chain and should be rebased sequentially.@hamza.khyari: Please rebase onto current
master. If multiple PRs depend on each other, start with the base PR in the chain and work upward.Rebase priority: HIGH — these PRs represent significant feature work that is blocked by merge conflicts. Every day they remain conflicted is a day they cannot be reviewed or merged.
7a73033970295b0aa19fNew commits pushed, approval review dismissed automatically according to repository settings
e7b5330a6b90e5bbb99c