Repository navigation
refactor(spec)!: #55 import-purity — capability/matcher/value-type relocations + testkit + exec-hang fix - #13
Conversation
… to spec (import-purity) - spec/capability: new cuelang-free slice — ProvidedCapability + StepContract (from sdk/schema.go) + CLISubcommand (from spec/climodel/validate.go; plain authoring struct decoupled from ValidateGenerated's cuelang per Rule 2). imports only spec/spec (stdlib-only) → no cuelang/grpc/go-plugin, leaf → no cycle. - spec/climodel/validate.go: CLISubcommand definition → re-export alias (type CLISubcommand = capability.CLISubcommand); cuelang confined to ValidateGenerated. Existing consumers (sdk/schema.go alias, sdk/kong_reflect.KongSubcommands, TestCLISubcommandFields) compile UNCHANGED. - spec/spec/matchers.go: MatchAll + matchOne + matchNumeric + MatchValueString(s) relocated from sdk/matchers.go alongside spec.Matcher (union_types.go); stdlib-only (regexp/strconv/fmt/strings), no heavy dep. 2 private-matchOne tests moved to spec/spec/matchers_test.go (private symbol cannot be reached cross-package). - spike-proven: spec/capability compiles standalone, drags NO heavy dep, no import cycle. spec/exec test timeout pre-existing (RCA'd: identical on clean base bedcec9, unrelated to this change). - sdk re-export (leg 2) + super repoint of 2 charly root-test files (leg 3) follow. Assisted-by: Claude Code glm-5.2:cloud (analysed on a live system)
…regression test
TestStartProcessWaitMonitorNeverClosesConsumerPipes read stdout to EOF
before touching stderr, but its fixture script ("head -c 1048576
/dev/zero; head -c 65536 /dev/zero >&2") runs both commands under one
sh, so sh's stdout fd stays open across both. Once the second head's
65536-byte write fills the (default-64KiB) stderr pipe with nothing
draining it, head blocks in write(), sh blocks waiting on head, and
stdout's write end never closes -- io.ReadAll(p.Stdout()) then never
sees EOF. Live-reproduced via `/proc` (head parked in anon_pipe_write,
sh in do_wait) and a genuine `FAIL github.com/opencharly/spec/exec
369.895s` before a SIGQUIT goroutine dump was taken, matching the
reported startCommandProcess ~600s hang (Go's default -timeout is
exactly 10m). Fix: drain stdout and stderr concurrently, mirroring the
pump pattern testkit.StartSSHProcessServer already uses for the same
reason. Verified clean over 3 fresh full-suite gate runs, 30x under
-race, and 100x at -count=100 with zero recurrence.
Also bound TestSSHProcessExecutorsPreserveRemoteLaunchAndPipes's real
OpenSSH subprocess with a context deadline: it was the only
real-subprocess test in the module with none, unlike its siblings
(TestGRPCOverRealOpenSSH, TestGRPCOverProcessTransports), so a stalled
handshake there had nothing to unblock it either.
Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system)
…out-of-process plugin e2e tests Extracted from charly/plugin_kind_prescan_e2e_test.go (the #55 decoupling cone, Batch D): the helper stages a candy module tree into a temp project, rewriting its go.mod sdk/spec replace directives to absolute repo-submodule paths so an out-of-process plugin build resolves them. It spells the sdk/spec import paths as string literals (go.mod text rewriting, not a Go import), which is why it lives in spec/testkit rather than charly/ — keeping it in charly/ would defeat the decoupling gate's "no charly/*.go source spells the sdk import path as a literal" requirement even though the file makes no actual Go import of either module.
…/ledger records/CloudInitRuntimeParams RDD-spiked additive move (spec leg of a 3-repo B2): four plain value/contract types relocate to spec/spec ahead of their sdk-side aliasing. Every field on each type already resolved to a spec.* type before this change, so each move is a verbatim, zero-behavior relocation: - BuildResolvedBox: the render-time embedding wrapper over the generated ResolvedBox (was sdk/buildkit.ResolvedBox) — its 9 host-render-cache fields (DistroConfig/DistroDef/BuilderConfig/InitSystem/InitDef/CandyCaps/ BakedMetadata/RenderCandyOrder/ActiveInits) are all spec.* types already; it carries zero buildkit-only content and zero methods. - BundleConfig (was sdk/deploykit.BundleConfig) + its two PURE methods (Lookup/LookupKey, plain map access). The three methods that reach sdk/kit (DeployedContainerNames/OccupiedHostPorts/GlobalEnvForImage) do NOT move — spec can never import sdk/kit; they become deploykit free functions in the sdk leg. - DeployRecord/CandyRecord/StepRecord + LedgerSchemaVersion (was sdk/kit's install-ledger record shapes) — every field already resolved to spec.StepKind/Scope/Venue/ReverseOp. - CloudInitRuntimeParams (was sdk/vmshared) — a plain 4-field struct with zero methods; RenderCloudInit (the render function, genuine behavior) stays in vmshared unchanged. Verified: spec builds standalone, full spec test suite green (including TestGenReproducible), gofmt/vet clean. This is the first leg of a 3-repo B2 (spec -> sdk -> super); sdk aliases onto these types next. Assisted-by: Claude Code claude-sonnet-5 (analysed on a live system)
…K3 cone2) TestLocalPkgInstallStepIR asserted charly/localpkg_test.go's copy against a pure spec.LocalPkgInstallStep with zero charly-core dependency. Relocated verbatim to spec/spec/install_step_vocab_test.go (its owning package) as part of the K3 render/build-engine test-import-purity closure; no duplicate existed anywhere in the tree before this move. Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system)
…step 7) The provider_carriers.go header cited the charly/kernel_manifest_floor_test.go tables (kernelFloor/residueOwner) as the classification method that moved this content out of charly/install_plan.go — those tables are deleted in the companion #55 step-7 cutover (replaced by an import-surface assertion), so the reference is reworded to name the boundary-law classification generically instead of the now-removed identifiers (R5 claim-keyed sweep). Assisted-by: Claude Code claude-sonnet-5 (documentation reviewed)
pr-validator — CHANGES REQUESTED ❌Change class: charly-or-sdk Go (spec contract module — a pure-Go value-type relocation + a test-hang fix, no candy/box config, no direct deploy/check-bed surface of its own). Independently re-cloned What I verified directly (all green)
Blocking findings
Comments consideredNone — the PR carries zero comments. Cross-PR interactions considered
DecisionFAIL. The underlying code change is sound (verified independently: build/test/vet/lint clean, the race-condition fix is a genuine root-cause synchronization fix proven under Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system) |
…writes at merge) Assisted-by: Claude Code Claude Fable 5 (documentation reviewed)
pr-validator — CHANGES REQUESTED ❌ (round 2)Change class: charly-or-sdk Go (spec contract module — pure-Go value-type relocations + a test-hang fix; no candy/box config, no deploy/check-bed surface of its own). Independently re-cloned What I verified directly (all green)
Blocking findings
Comments considered
Cross-PR interactions considered
DecisionFAIL. The underlying code is sound — build/vet/gofmt/test/lint all independently clean, the exec deadlock fix is a genuine root-cause synchronization fix verified under Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system) |
…al title (round-2 validator finding) Assisted-by: Claude Code Claude Fable 5 (documentation reviewed)
pr-validator — APPROVED ✅ (round 3)Change class: charly-or-sdk Go (spec contract module — pure-Go value-type relocations + a test-hang fix; no candy/box config, no deploy/check-bed surface of its own). Independently re-cloned Round-2 blocking findings — both verified fixed
What I verified directly, this round (all green)
Comments considered
Cross-PR interactions considered
DecisionPASS. Both round-2 blocking findings are verified fixed at Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system) |
pr-validator Phase 3: rename the placeholder CHANGELOG entry to the merge-time CalVer and rewrite its H1 to match byte-for-byte. Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system)
|
Merged + tagged. Squash-merged as This unblocks Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system) |
… entry Round-1 review findings, all three mine. deploy_executor.go:207 said "the host target's --yes". There is no --yes flag — `charly bundle add --yes` exits 80. The field is EmitOpts.AssumeYes and its flag is --assume-yes. This is the SAME misconception the PR exists to correct, about the SAME field, in the SAME repo: my sweep fixed the sentence I was looking at and never asked where else the belief lived. The neighbouring --dry-run is accurate, since DryRun derives to --dry-run under either tag form. Re-swept claim-keyed over all eight known-wrong spellings, instrument asserting what it read: 276 files enumerated, 276 read, 0 failures. Two hits remain, both inside the corrected comment itself, both stating that --yes/--force are NOT accepted — correct negatives rather than surviving claims. Added CHANGELOG/2026.216.0717.md. This repo keeps 14 tags and 14 entries; the immediately preceding link in this same chain shipped one for a change of the same class and size, and task #13 already tracks a missing spec entry. Landing another would compound a known problem. Corrected the tag count: 326 -> 328. The tree says 328 (`git grep -o 'long:"' main | wc -l`), which is what the tracking task recorded; I carried 326 from a report without re-deriving it. It appears only in narrative, but a squash body inherits it. Assisted-by: Claude Code Anthropic Claude Opus 5 (documentation reviewed)
Summary of changes
The producer leg of the #55 "charly imports ONLY spec" program: feat/55-import-purity-spec (bedcec9→715fafb). Per-commit accounting (files enumerated in CHANGELOG/2026.215.1928.md, placeholder CalVer, H1 filename-matched):
4b5d145fix(exec): Wait-monitor test pipe deadlock — concurrent stdout/stderr drain (sync.WaitGroup) + a 30s bound on the one unbounded subprocess test (exec/deploy_executor_process_race_test.go, exec/deploy_executor_process_test.go).05af668feat(testkit): CopyCandyFixReplace (testkit/candy_fixture.go).001efeefeat(spec): value types — BuildResolvedBox, BundleConfig (+Lookup/LookupKey), DeployRecord/CandyRecord/StepRecord, LedgerSchemaVersion, CloudInitRuntimeParams (additive; all fields already spec-native).2332bb6test: LocalPkgInstallStep IR-contract test relocated from charly (spec/install_step_vocab_test.go).09e8dabfeat: spec/capability (ProvidedCapability + StepContract + CLISubcommand, cuelang-free) + spec/spec/matchers.go{,_test.go} + climodel CLISubcommand re-export.ec589dcdocs: kernelFloor/residueOwner comment sweep.58fc499+715fafb: the CHANGELOG entry + its H1 format fix.Change class
charly-or-sdk Go (cross-repo producer leg). Chain: spec (this) → sdk#118 → plugins#123 (MERGED v2026.215.1738) / pkg-arch#6 (MERGED v2026.215.1737) → charly#204.
How R10-tested — exact gate, commands, and pasted output
task build:binarycompiled charly against this spec content (R9); the module itself builds from the fresh clone below.Attribution tier
analysed on a live system — the relocated/changed code executed live (fresh-clone suite + -race runs + the super roster's live beds);
fully tested and validatedis claimed only by charly#204, which owns the fresh-rebuild bed evidence.Harness rulebook compliance
Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
https://claude.ai/code/session_015CXB8CkzwZeXPzbqKjsuYj