Skip to content

Commit 5503da9

Browse files
author
David Noble
committed
refactor(13.0(n) Phase 5): MethodMetadata + AnnounceProvider rewrite; plumb planner onto *op.Method; assert.{Nil,NotNil} generic
Introduces per-method metadata (parameter names + optional planner type) and plumbs the resolved planner instance onto each registered *op.Method. Plan doc updated to capture the planner-dispatch model in D12 and a rewritten Phase 5 section. Tightens pkg/assert's nil contract via generics. pkg/op/method.go - New MethodMetadata struct: ParameterNames []string ordered to match the Go method's parameter slots; Planner reflect.Type, nil for default. - Method gains a planner Planner field with Planner() accessor and SetPlanner setter. Nil for resource methods; provider methods get the announcement-declared planner or ActionPlanner by default. pkg/op/planner.go - plannerForType(reflect.Type) Planner resolves the declared planner type to its singleton instance via reflection. Handles both value-receiver and pointer-receiver planner implementations; nil returns ActionPlanner. pkg/op/receiver_type.go - NewProviderReceiverType and newReceiverType accept a planners map[string]Planner. newReceiverType calls method.SetPlanner per provider method during construction; resource and bare-type paths skip it. - NewResourceReceiverType, NewReceiverType, AnnounceType pass nil planners. pkg/op/receiver_registry.go - AnnounceProvider's fourth parameter is now map[string]MethodMetadata. The body extracts ParameterNames per entry for parseParameters and resolves each entry's Planner reflect.Type into a Planner instance via plannerForType. star/extensions/com.noblefactor.devlore.Actions/templates/provider.gen.go.template - Map literal emitted by codegen switches from map[string][]string to map[string]op.MethodMetadata, each entry as {ParameterNames: []string{...}}. star/extensions/com.noblefactor.devlore.Actions/commands/generate.star - node_builder_test emission retired alongside NodeBuilder; the test surface will be reintroduced when plan.Provider.Invocation lands. - node_builder.gen_test.go.template deleted. 28 provider.gen.go files regenerated to the new shape (no per-provider planner declarations yet; every method defaults to ActionPlanner). docs/plans/extract-starlark-from-op/phase-8/13.0-n.md - D12 added: planner-dispatch model. op.Planner / PlanInvocator / ActionPlanner; flow's specialized planners; MethodMetadata; the shim at plan.<X>; full call-flow trace; method-level vs provider-level rationale. - Phase 5 rewritten end-to-end around the planner-shim model. Current state bullets re-anchored to actual landed code. Tests section names the new unit-test surfaces. - D8 surgical updates: reserved-kwargs table adds label= flat (options= wrapper retired). Orphan-check re-anchored to SubgraphPlanner. - Phase 5 landed / removed lists added. Front-matter updated. Also retires the node_builder_test codegen emission (generate.star + template deletion). The prior commit removed the 14 already-checked-in node_builder.gen_test.go files; codegen kept regenerating them. With the emission gone, the regeneration stops and the deletions stick. pkg/assert - Nil and NotNil become generic on *T: Nil[T any](name, *T) / NotNil[T any](name, *T). The compiler enforces pointer-only at the call site; isNil + reflection helper deleted. - Truef signature reordered to message-first: Truef(format string, condition bool, args ...any). Matches True's "claim first" ordering. - Call sites updated: cmd/star/star/application.go (error nil-check uses assert.True == nil), pkg/op/resource_catalog.go (factory func nil-check uses assert.True != nil), pkg/op/subgraph.go (Truef argument order). pkg/op/provider/plan/provider.go - ResolveAttr's Tier 3 path returns nil instead of asserting Unimplemented. The planner shim that will live at plan.<X> lands in a follow-up commit. Mutex field and sync/assert imports removed (no longer used). Known-red tests in this commit (documented gap; not silently hidden): The .star integration tests below exercise Tier 3 lookups (plan.shell, plan.file, etc.) and will stay red until the planner shim lands: - cmd/devlore-test: TestCLI_ScriptFirst / ScriptMiddle / ScriptLast, TestCLI_DefaultAllToStdout, TestCLI_SummaryOnly, TestCLI_GraphOnly, TestCLI_ReceiptOnlyYAML / ReceiptOnlyJSON, TestCLI_RoutToFiles, TestCLI_JSONReceiptToFile, TestCLI_DryRun, TestCLI_Trace, TestCLI_Silent - cmd/devlore-test/devloretest: TestRunCmd_BasicExecution, TestRunCmd_DryRun, TestRunCmd_Trace, TestRunCmd_ReceiptJSON, TestRunCmd_OutputRouting - cmd/star/star: TestSourceFile_StarlarkIntegration, TestLintCopyright_* (all variants) Build: make build green. make vet green. make test green. Issue: #283
1 parent 295ccc5 commit 5503da9

57 files changed

Lines changed: 608 additions & 1652 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎cmd/star/provider/commands/gen/provider.gen.go‎

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/config/gen/provider.gen.go‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/goast/gen/provider.gen.go‎

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/lint/gen/provider.gen.go‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/setup/gen/provider.gen.go‎

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/shellcheck/gen/provider.gen.go‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/staranalysis/gen/provider.gen.go‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/starcode/gen/provider.gen.go‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/starcomplexity/gen/provider.gen.go‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cmd/star/provider/starindex/gen/provider.gen.go‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)