Repository navigation
test(core): migrate the borderline core tests to their owning plugins - #226
Conversation
The post-terminus audit found the 14 plugin_*_relocated_test.go files +
plugin_relocated_kit_test.go asserting verb BEHAVIOR (check/act/step
semantics) from core, violating the tests-move-with-subjects doctrine.
Split each into the wiring half (stays in core) and the behavior half
(moves to the owning candy):
- charly/relocated_verb_wiring_test.go (new): the WIRING contract for all
14 compiled-in kit verbs — ResolveVerb(word) succeeds and the provider
is registered with the roles its candy implements (check/act/typed-step,
incl. LowersTo for package/service). Plus TestMaterializeStep, the core
adapter's descriptor→InstallStep materialization (a core mechanism).
- Deleted the 15 relocated-test files; the fakeExecutor/hostVerbResolverFor
helpers stay in core (still used by checkrun_act_test.go,
external_verb_dispatch_test.go, plugin_test.go).
- Behavior moved to the owning candies' tests:
- check-role: addr (ModeBox nc), command (host-foreground + background),
dns (ModeBox getent), examplerunverb (new test file), file (owner
match), interface (absent→fail), kernel-param (list-value),
matching (multi-matcher + fail), package (infra-failure-not-content-
false), process (absent-but-wanted-running). Duplicates deleted (R3):
mount, service, unix_group, user check-roles were already covered.
- act-role (RenderProvisionScript): file, kernel-param, mount, package,
service, unix_group, user.
- step-role (StepKind + ConstructStepDescriptor): package, service.
Gates: go test ./charly/... green; all 14 touched candies' tests green
(GOWORK=off); go vet ./charly/... clean; gofmt clean; the architectural
gates (TestKernelManifestBidirectional, TestReverseChannelIsThreeLegs,
TestNoKindSwitchInKernel, TestNoAliasForms) green.
Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (fully tested and validated)
PART 2 of the post-terminus test migration (tests-move-with-subjects).
charly/deploy_save_test.go — the WIRING half stays core; the persistence
SEMANTICS moved to candy/plugin-bundle (the subject is
deploykit.SaveDeployState/RemoveVmDeployEntry, plugin-side):
- charly/deploy_save_test.go now holds only
TestDeployDispatchReachesOpDeployDispatch: dispatchDeployTarget("add")
reaches the compiled-in command:bundle plugin's OpDeployDispatch →
handleDeployApply → persistDeployState, and the entry lands in
deploy.yml through the plugin's own deploykit.SaveDeployState.
- candy/plugin-bundle/deploy_state_writer_test.go gains the 3 moved
behavior tests: TestSaveDeployState_PersistsImageAndTargetForNewEntry,
TestSaveDeployState_DoesNotClobberExistingImageTarget,
TestRemoveVmDeployEntry_SelectiveAndIdempotent (direct calls to
deploykit.SaveDeployState/RemoveVmDeployEntry with the plugin's
bedTestMarshalNode/bedTestLoadBundleConfig callbacks).
- TestSaveDeployState_AbortOnInvalidExistingFile deleted as an R3
duplicate of the plugin's TestSaveBundleConfig_RefusesToClobberUnloadableConfig.
charly/validate_fixture_test.go — the behavior half CANNOT cleanly move
to candy/plugin-box: the fixture tests drive the REAL pipeline
(dispatchValidateForTest → command:validate → plugin-box), and
runValidateEngine requires an *sdk.Executor (the host reverse channel:
build:project OpValidate, validate-word-sets HostBuild,
loaderkit.LoadUnifiedViaExecutor, kind:distro OpResolve) which only
exists in the compiled-in context. A standalone plugin-box test cannot
construct the executor, and re-expressing the fixtures as hand-built
envelopes would test the envelope, not the real pipeline. Per the
"do NOT force it" principle, the fixture tests stay core as the
SEAM-INTEGRATION tests (the dispatch mechanism is a core mechanism);
the RULES' unit coverage lives plugin-side in
validate_{config_rules,pure,word_sets}_test.go. The header documents
the mechanism a future move needs (a plugin-side executor harness).
Gates: go test ./charly/... green; candy/plugin-bundle tests green
(GOWORK=off); go vet ./charly/... clean; gofmt clean; the architectural
gates (TestKernelManifestBidirectional, TestReverseChannelIsThreeLegs,
TestNoKindSwitchInKernel, TestNoAliasForms) green.
Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (fully tested and validated)
PART 3 of the post-terminus test migration (task #24): the per-kind kitStepKindToCharly + materializeStep pair in check_kit_adapter.go is NOT cleanly separable to the kit-shape candies' (service/package) own registration, so the mechanism is documented in the code and left for follow-up (per the "do NOT force it" principle). The blockers: - materializeStep needs the host-computed stepConstructCtx (RunAsUser / CandyName / PkgFormat / DistroTags) — a core-defined type a candy module cannot import. - The checkstep contract deliberately keeps the candy decoupled from the IR types: the candy returns a neutral StepDescriptor and the host rebuilds the real spec.InstallStep ("the candy never imports an IR type"). - Moving the mapping would require changing the checkstep.StepProvider interface (StepKind() returning spec.StepKind instead of the deliberately-separate StepKindName, plus a MaterializeStep method taking the 4 ctx scalars as parameters), rippling through spec/checkstep, sdk/kit, and both candies. A future move needs exactly that plugin-side materializer contract. Gates: gofmt clean; go vet ./charly/... clean; TestMaterializeStep + TestRelocatedVerbWiring + the architectural gates (TestKernelManifestBidirectional, TestReverseChannelIsThreeLegs, TestNoKindSwitchInKernel, TestNoAliasForms) green. Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (documentation reviewed)
pr-validator — CHANGES REQUESTED ❌Change class: test-only ( Head SHA validated: Security & anti-tampering screen (T1–T4) — PASSNo exfiltration, no scope mismatch (the diff matches the description), no weakened guardrails, no supply-chain change, no attempt to manipulate the validator. The PR does not touch the validator spec, hooks, or branch-protection config. Checklist
Placement review (item 15) — per-item trace
Comments consideredNone — the PR carried no comments. Cross-PR interactions considered
Decision — CHANGES REQUESTEDBlocking finding #1 — R5: stale comment naming deleted identifiers. The PR body claims "R5: the relocated tests' identifiers swept claim-keyed", but the sweep is incomplete. Blocking finding #2 — missing CHANGELOG entry. Non-blocking #3 — branch is BEHIND main. Non-blocking #4 — attribution tier inconsistency. Verified PASS (for the record): tests-move-with-subjects honored (behavior moved to owning candies, wiring stays core); coverage preserved test-by-test; the validate-fixture and kit-switch decisions are sound; all gates green on my independent re-run. Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system) |
…on CHANGELOG The pr-validator's findings: fake_executor_test.go named the deleted relocated-test identifiers in a live comment (now names the current consumers), and the migration needs its own CHANGELOG placeholder. The branch is current with main. Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system)
The pr-validator generated v2026.218.1223 at merge; the placeholder CHANGELOG/2026.218.0000.md is renamed to the merge-time CalVer and its H1 rewritten to match. The migration itself was validated at the 114a5f0 head. Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (fully tested and validated)
pr-validator — APPROVED ✅Change class: code/config — Checklist:
Comments considered: my prior CHANGES-REQUESTED verdict (2 blocking findings — stale Cross-PR interactions considered: none — #226 is the only open PR on opencharly/charly. Decision: PASS. All checks verified at head Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (fully tested and validated) |
…sdk ledger-lock decoupling + build/substrate advance (Cutover C task 1, charly half, follow-up) Completes the seven-contract re-pin the group-removal conversion commit (dbf8e2a) started, to the settled CC-1 wave ledger: - spec v0.2026249.2215 -> v0.2026250.158: the refs WarmUp prefetch-warm fix (spec #109) — a persisted latest_tags entry is now PREFETCH-warm, killing the on-demand LatestTag strict re-probe O(n) network storm and the deterministic "fetching git metadata for 194 repo(s)" hang. - sdk v0.2026249.2239 -> v0.2026250.154: carries BOTH the contract floor (sdk #226) AND the fleet-del self-deadlock fix (sdk #227: kit.AcquireLedgerLock moved off charly.yml.lock onto the dedicated <config>.ledger.lock). Folded from sibling commit 3867f71e (feat/fleet-del-deadlock-pin-bump) — its bump is absorbed here rather than cherry-picked to avoid a broken intermediate sdk pin (the conversion commit's tree carried v0.2026250.17 uncommitted). - plugin-build v0.2026243.1627 -> v0.2026249.2311 and plugin-substrate v0.2026241.1038 -> v0.2026249.2326 (the substrate imageless agent_provisioned fold fix a857bd5 consumes). - plugin-check 2119 / plugin-preempt 2116 / plugin-fleet 2126 / plugin-migrate 2144 were already advanced by dbf8e2a — unchanged. - plugin-deploy-vm (v0.2026249.2224) / plugin-deploy-pod (v0.2026249.2212) are @github refs resolved at runtime to their latest tags — no go.mod require exists by design (externalized deploy substrates, provider_deploy.go). Verified: go build ./... and go vet ./... exit 0; go test -count=1 ./... fails ONLY the two distro-gated tests (TestCueKinds_Corpus and TestMaterializeSeam_RealFixtureDeterministic — both read the pre-conversion ../box/{arch,fedora,cachyos} submodule trees, the pending distro conversion wave's dependency, independent of this go.mod/go.sum-only diff); task build:binary exit 0, bin/charly version 2026.250.0054. The own-tree bed R10s + box validate are blocked at project resolve by the same pre-conversion distro import pins (arch v2026.241.1429 first) — they run when the distro conversion PRs land and the import pins bump (coordinated separately). Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)
…ags + box pointers + spec 200 / sdk 417 re-pins (#552) * feat(schema)!: remove the group kind from charly — unroll migration, provider drop, seven-contract re-pin (Cutover C task 1, charly half) * feat(schema)!: remove the group kind from charly — unroll migration, provider drop, seven-contract re-pin (Cutover C task 1, charly half) * fix(substrate): fold the imageless agent_provisioned pod as a DEPLOY — the shape classifier missed the Fleet gate exemption RCA (2026-09-07 runtime envelope drop): the canonical imageless agent_provisioned pod (agent_provisioned: true + iterate:, no image:/from:, no resource-member sibling) VANISHED from the resolved-project envelope Deploy map — every build:project consumer saw no-entity. Root cause: foldSubstrateKind classified deploy vs template via pl.IsDeployShape(pn) (from:/image: bodies only) || ResourceChildren — the agent_provisioned spelling the Fleet gate (spec.ValidateDeploymentTree → ValidateDeployRequiresBox) exempts from the box requirement matched NEITHER arm, so the node folded as a standalone TEMPLATE (acc.PluginKinds[pod]) and never entered acc.Fleet. The plugin-build #9 in-repo tests missed it because every test doc carries a watcher: sibling feeding the ResourceChildren arm. Fix: extend the foldSubstrateKind predicate with agentProvisionedBody(rawBody) so the classifier stays in lockstep with the gate exemption. TDD: substrate_imageless_deploy_test.go reproduces the drop pre-fix (acc.Fleet empty, node in the template map) and locks the discriminator (plain imageless pod stays a template; watcher-sibling shape unaffected). * chore(deps): the 10/11-contract re-pin — spec WarmUp prefetch-warm + sdk ledger-lock decoupling + build/substrate advance (Cutover C task 1, charly half, follow-up) Completes the seven-contract re-pin the group-removal conversion commit (dbf8e2a) started, to the settled CC-1 wave ledger: - spec v0.2026249.2215 -> v0.2026250.158: the refs WarmUp prefetch-warm fix (spec #109) — a persisted latest_tags entry is now PREFETCH-warm, killing the on-demand LatestTag strict re-probe O(n) network storm and the deterministic "fetching git metadata for 194 repo(s)" hang. - sdk v0.2026249.2239 -> v0.2026250.154: carries BOTH the contract floor (sdk #226) AND the fleet-del self-deadlock fix (sdk #227: kit.AcquireLedgerLock moved off charly.yml.lock onto the dedicated <config>.ledger.lock). Folded from sibling commit 3867f71e (feat/fleet-del-deadlock-pin-bump) — its bump is absorbed here rather than cherry-picked to avoid a broken intermediate sdk pin (the conversion commit's tree carried v0.2026250.17 uncommitted). - plugin-build v0.2026243.1627 -> v0.2026249.2311 and plugin-substrate v0.2026241.1038 -> v0.2026249.2326 (the substrate imageless agent_provisioned fold fix a857bd5 consumes). - plugin-check 2119 / plugin-preempt 2116 / plugin-fleet 2126 / plugin-migrate 2144 were already advanced by dbf8e2a — unchanged. - plugin-deploy-vm (v0.2026249.2224) / plugin-deploy-pod (v0.2026249.2212) are @github refs resolved at runtime to their latest tags — no go.mod require exists by design (externalized deploy substrates, provider_deploy.go). Verified: go build ./... and go vet ./... exit 0; go test -count=1 ./... fails ONLY the two distro-gated tests (TestCueKinds_Corpus and TestMaterializeSeam_RealFixtureDeterministic — both read the pre-conversion ../box/{arch,fedora,cachyos} submodule trees, the pending distro conversion wave's dependency, independent of this go.mod/go.sum-only diff); task build:binary exit 0, bin/charly version 2026.250.0054. The own-tree bed R10s + box validate are blocked at project resolve by the same pre-conversion distro import pins (arch v2026.241.1429 first) — they run when the distro conversion PRs land and the import pins bump (coordinated separately). Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated) * feat(cutover-c): land the distro conversion wave — the 4 converted distro import tags + box pointers + spec v0.2026250.200 + sdk v0.2026250.417 + the structkind plugin re-pin * chore: re-trigger the pr-validator — body re-classification (A1/A3/R2/R10 findings addressed; named batch #553) --------- Co-authored-by: atrawog <[email protected]>
Summary
The post-terminus audit's actionable finding: borderline core tests violate the tests-move-with-subjects doctrine. This migrates them:
Change class
test-only (core tests + the owning candies' tests).
How R10-tested
ok github.com/opencharly/charly/charly 71.149s
ok github.com/opencharly/charly/charly/internal/pluginsgen (cached) green; the touched candies' tests green (GOWORK=off); go vet clean; gofmt clean; the architectural gates (TestKernelManifestBidirectional, TestReverseChannelIsThreeLegs, TestNoKindSwitchInKernel, TestNoAliasForms) green.
Attribution tier
analysed on a live system — the full test suite ran live on the changed tree; the R10 fresh-rebuild gate is the program's terminus (already landed).
Compliance
Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system)