Repository navigation
feature(op): Resource management — Phases 9-11, epic complete - #187
Merged
David-Noble-at-work merged 2 commits intoMar 6, 2026
Merged
Conversation
added 2 commits
March 6, 2026 00:44
Complete the resource management epic: Phases 9, 10, 11, Phase 5g fix, design document updates, housekeeping. ## Phase Status | Phase | Description | Status | |-------|-------------|--------| | 0 | Test harness (star devlore test) | ~85% done (#164, #170, #171) | | 1 | ResourceCatalog (append-only ledger + URI→ID namespace) | Done | | 2 | Graph integration (Catalog field, FillSlot implicit edges) | Done | | 3 | File provider migration (all methods accept Resource) | Done | | 4 | Type system (Resource/Tombstone sealed interfaces, ResourceBase) | Done | | 5 | Executor catalog integration (shadow/resolve, pre-flight) | Done | | 6 | Provider context (ProviderBase, git/service/pkg Resource types) | Done | | 7 | Remaining provider migration (all providers, coerceSlice) | Done | | 8 | Generated bridge tests (actions_gen_test.go via star codegen) | Done | | 9 | Resource lifecycle — Decision #10 (infallible constructors) | Done | | 10 | Purl package URIs — Decision #11 (ECMA-427 for pkg.Resource) | Done | | 11 | Action interface unification (three types, unified Do) | Done | ## Phase 9: Infallible constructors (Decision #10) - file.NewResource returns Resource (no error, no I/O) - Resolve() on Resource interface; ResourceBase default is no-op - file.Resource.Resolve() does filepath.Abs + os.Stat - git.Resource.Resolve() does filepath.Abs - Refresh() and RefreshWith() replace RefreshMetadata/RefreshMetadataWith - Single constructor registry (planTimeConstructorRegistry eliminated) - Path() returns raw path before Resolve(), absolute path after ## Phase 10: Purl package URIs (Decision #11) - Type, Version fields on pkg.Resource - Host() returns Type as URI authority (pkg://brew/jq) - Purl() method returns canonical purl (pkg:brew/[email protected]) - Winget namespace handling (Microsoft.VSCode → pkg:winget/Microsoft/VSCode) - NewResource() and NewTypedResource() constructors - Type propagated from resolved manager in Install/Remove/Upgrade ## Phase 11: Action interface unification - Three action types: Action (pure), FallibleAction, CompensableAction - Unified Do(ctx, slots) → (Result, Complement, error) across all types - Complement type replaces former undo state type throughout - DoAction() type-switch dispatcher eliminated - reflectedPureAction/reflectedFallibleAction/reflectedCompensableAction with shared actionBase (coerceArgs, dryRunLog, Params) - classifyActionReturn split into classifyFallibleReturn + classifyCompensableReturn - validateSlotType for plan-time type checking - Pure actions (file.name, file.parent, file.join) registered as graph nodes - Codegen includes all action types in generated bridge tests - Flow actions (Choose, Gather, Elevate, WaitUntil) gain Params() ## Phase 5g fix - shadowOutputParam guard: <2 → ==0 Resource params - Single-Resource compensable methods now shadowed at plan time ## Other changes - file.Exists/IsDir/IsFile return (bool, error) instead of bool - Lore builder tests: packages param corrected to []string - Architecture doc: Action Type Model section, expanded migration table - Superseded drafts deleted (emergent-system-model, structural-deps, subscriber-model) - Relocated strategy doc deleted (docs/01-strategy.md)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete the resource management epic. This PR delivers Phases 9, 10, 11,
a Phase 5g fix, and design document updates.
star devlore test)Catalogfield,FillSlotimplicit edges)Resource)Resource/Tombstonesealed interfaces)ProviderBase, git/service/pkg Resource types)coerceSlice)actions_gen_test.govia star codegen)pkg.Resource)Do)Phase 9 — Infallible constructors
file.NewResourcereturnsResource(no error, no I/O)Resolve()method onResourceinterface;file.Resource.Resolve()doesfilepath.Abs+os.StatRefresh()/RefreshWith()replaceRefreshMetadata/RefreshMetadataWithplanTimeConstructorRegistryeliminated)Phase 10 — Purl package URIs
Type,Versionfields onpkg.ResourcePurl()method with winget namespace handling (ECMA-427)Install/Remove/UpgradePhase 11 — Action interface unification
Action(pure),FallibleAction,CompensableActionDo(ctx, slots) → (Result, Complement, error)replaces per-type signaturesDoAction()dispatcher eliminated; each reflected type normalizes internallyfile.name,file.parent,file.join) registered as graph nodesPhase 5g fix
shadowOutputParamnow shadows single-Resource compensable methods at plan timeHousekeeping
file.Exists/IsDir/IsFilereturn(bool, error)instead ofbool48 files changed, ~2573 insertions, ~2955 deletions.
Test plan
make build— compiles cleanlymake test— all tests pass (pre-existing WrapReceiver does not expose WalkTree — callback params unsupported #170 walk_tree failure only)make vet— cleanfile.NewResourcereturns single value (no error)pkg.ResourcehasType/Version/Purl()planTimeConstructorRegistry— zero hitsRefreshMetadata[^W]— zero hits in codeNodeAction\|DoAction— zero hits in non-generated GoComplementinpkg/op/action.go— confirms rename landedactions_gen_test.go(file.name,file.parent,file.join)