Files
archie/internal/plugin/pluginextract/github_com-samcharles93-archie-core-internal-plugin.go
T
sam 3d37a437ff fix(extract): regenerate stale Yaegi symbol tables; fix wfextract directive
Two pre-existing issues discovered while scoping the Module-position slice
(archie-core-e7bo), unrelated to the playbook engine work:

1. wfextract's //go:generate directive still targeted
   internal/workflow, a path gone since the domain migration -- the
   committed generated file was hand-patched for imports only, never
   regenerated. 'go generate ./...' failed repo-wide, silently.

2. Regeneration surfaced real drift on three surfaces:
   - wfextract: the committed table predated the migration and was
     missing everything added since -- routing YAML loaders (t2db.9/.10/
     .11), the review types, and the Forger/Reviewer/Trees interfaces
     that TaskContext exposes to every interpreted stage plugin. A stage
     plugin referencing tc.Trees or the review types could not resolve
     them.
   - pluginextract: internal/plugin/host.go (f73b2d1) added the
     Host/Module/Manifest/Permission/Health/CapabilityKind/LifecycleState
     /ModuleStatus types and NewHost/AdaptLegacy/HostAPIVersion, none of
     which were ever extracted. A daemon plugin written against the
     capability-host API (bootstrap.go:707 LoadDir) silently had no way
     to reference them.
   - secretextract: symbol exports were current; only the hand-applied
     nil-guards and comments differ from raw generator output.

Fix: update the wfextract directive to internal/domain/workflow and
regenerate all four extract surfaces via 'go generate ./...'. Re-apply
the documented hand-written nil-guards on interface wrappers (Yaegi
wrappers omit them natively), restating the IMPORTANT note in wfextract's
package doc (it now has interface wrappers for the first time). Delete
the stale hand-patched wfextract generated file in favour of the
correctly-named regeneration.

Regression coverage (the previously-missing types are now reachable from
interpreted code, proven by tests that fail against the old tables):
- wfextract/reachability_test.go: interprets a stage plugin referencing
  Trees/Reviewer/LoadPlaybookDirs and calls it; plus a Go-side nil-guard
  test on the three wrappers.
- pluginextract/reachability_test.go: interprets a daemon plugin building
  a Host from a Go-side Module and calls it end to end; plus nil-guard
  tests on the _Module/_Plugin wrappers.
- secretextract keeps its existing wrapper nil-guard tests.

Verified red-then-green: after a fresh 'go generate ./...' wipes the
guards, the guard tests fail with nil-pointer panics; after re-applying,
they pass. task check clean (113/113 UI, exit 0).
2026-09-03 03:30:23 +10:00

103 lines
3.7 KiB
Go

// Code generated by 'yaegi extract github.com/samcharles93/archie-core/internal/plugin'. DO NOT EDIT.
package pluginextract
import (
"context"
"github.com/samcharles93/archie-core/internal/plugin"
"go/constant"
"go/token"
"reflect"
)
func init() {
Symbols["github.com/samcharles93/archie-core/internal/plugin/plugin"] = map[string]reflect.Value{
// function, constant and variable definitions
"AdaptLegacy": reflect.ValueOf(plugin.AdaptLegacy),
"HealthDegraded": reflect.ValueOf(plugin.HealthDegraded),
"HealthHealthy": reflect.ValueOf(plugin.HealthHealthy),
"HealthUnhealthy": reflect.ValueOf(plugin.HealthUnhealthy),
"HealthUnknown": reflect.ValueOf(plugin.HealthUnknown),
"HostAPIVersion": reflect.ValueOf(constant.MakeFromLiteral("\"1.0.0\"", token.STRING, 0)),
"LoadDir": reflect.ValueOf(plugin.LoadDir),
"NewHost": reflect.ValueOf(plugin.NewHost),
"StateFailed": reflect.ValueOf(plugin.StateFailed),
"StateRegistered": reflect.ValueOf(plugin.StateRegistered),
"StateRunning": reflect.ValueOf(plugin.StateRunning),
"StateStarting": reflect.ValueOf(plugin.StateStarting),
"StateStopped": reflect.ValueOf(plugin.StateStopped),
"StateStopping": reflect.ValueOf(plugin.StateStopping),
// type definitions
"CapabilityKind": reflect.ValueOf((*plugin.CapabilityKind)(nil)),
"Health": reflect.ValueOf((*plugin.Health)(nil)),
"HealthStatus": reflect.ValueOf((*plugin.HealthStatus)(nil)),
"Host": reflect.ValueOf((*plugin.Host)(nil)),
"LifecycleState": reflect.ValueOf((*plugin.LifecycleState)(nil)),
"Manifest": reflect.ValueOf((*plugin.Manifest)(nil)),
"Module": reflect.ValueOf((*plugin.Module)(nil)),
"ModuleStatus": reflect.ValueOf((*plugin.ModuleStatus)(nil)),
"Permission": reflect.ValueOf((*plugin.Permission)(nil)),
"Plugin": reflect.ValueOf((*plugin.Plugin)(nil)),
"Registry": reflect.ValueOf((*plugin.Registry)(nil)),
// interface wrapper definitions
"_Module": reflect.ValueOf((*_github_com_samcharles93_archie_core_internal_plugin_Module)(nil)),
"_Plugin": reflect.ValueOf((*_github_com_samcharles93_archie_core_internal_plugin_Plugin)(nil)),
}
}
// _github_com_samcharles93_archie_core_internal_plugin_Module is an interface wrapper for Module type
type _github_com_samcharles93_archie_core_internal_plugin_Module struct {
IValue interface{}
WHealth func(a0 context.Context) plugin.Health
WManifest func() plugin.Manifest
WStart func(a0 context.Context) error
WStop func(a0 context.Context) error
}
func (W _github_com_samcharles93_archie_core_internal_plugin_Module) Health(a0 context.Context) plugin.Health {
if W.WHealth == nil {
return plugin.Health{}
}
return W.WHealth(a0)
}
func (W _github_com_samcharles93_archie_core_internal_plugin_Module) Manifest() plugin.Manifest {
if W.WManifest == nil {
return plugin.Manifest{}
}
return W.WManifest()
}
func (W _github_com_samcharles93_archie_core_internal_plugin_Module) Start(a0 context.Context) error {
if W.WStart == nil {
return nil
}
return W.WStart(a0)
}
func (W _github_com_samcharles93_archie_core_internal_plugin_Module) Stop(a0 context.Context) error {
if W.WStop == nil {
return nil
}
return W.WStop(a0)
}
// _github_com_samcharles93_archie_core_internal_plugin_Plugin is an interface wrapper for Plugin type
type _github_com_samcharles93_archie_core_internal_plugin_Plugin struct {
IValue interface{}
WName func() string
WVersion func() string
}
func (W _github_com_samcharles93_archie_core_internal_plugin_Plugin) Name() string {
if W.WName == nil {
return ""
}
return W.WName()
}
func (W _github_com_samcharles93_archie_core_internal_plugin_Plugin) Version() string {
if W.WVersion == nil {
return ""
}
return W.WVersion()
}