Repository navigation
feat(loaderkit): the uniform ordered member tree — parse preserves the authored depth, the fold stamps position (Cutover C task 0, parse half) - #221
Merged
Conversation
…e authored depth, the fold stamps position (Cutover C task 0, parse half)
Review — PASSHead SHA: Security screen: PASS — no secrets/exfiltration, no scope mismatch (all 19 files accounted in the body), no weakened guardrails, no unexpected supply-chain change (spec re-pin is the intended #103 tag, consistent across go.mod/go.sum). Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
…ng is meaningful — the parent-disc guard (#222) The corpus regression (distro-arch check-agent-live, caught by charly's TestCueKinds_Corpus after #221): a GROUP body's iterate: block carries an agent: key — an external structural kind WORD colliding with a group-schema FIELD name. discEntityPairs/isEntityValue scanned EVERY disc-value body for kind words, so parseNode(iterate) classified agent as its disc; the remaining iterate schema fields became member pairs and the scalar sandbox hard-failed (node sandbox: expected a mapping value, got yaml kind 8). The design intent: member nesting = substrate bodies. In-body member detection now fires ONLY when the parent disc is a DEPLOY SUBSTRATE (t.DeploySubstrates) or an external STRUCTURAL kind (t.StructuralKinds) — never inside an arbitrary resource-kind body (group/check/candy/box) whose closed schema may define fields colliding with kind words; such bodies travel untouched as data and their members are deploy-level siblings only. The dead in-body error branch (unreachable under the guard) is removed in the same commit. New tests: the corpus fixture (group bed + iterate + agent + scalar sandbox) proves the collision shape parses with its full body intact and the only child being the deploy-level sibling; the structural positive arm proves an external structural body still nests in-body members (the 8a channel keeps working).
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
…d #Deploy fields — the deploy-declared-fields channel (sdk #221 class) (#225) The #222/#223 parent-disc + key-rule guards fixed the STRUCTURAL arm, but the SUBSTRATE arm (t.DeploySubstrates) still scanned disc values by VALUE SHAPE (discEntityPairs/isEntityValue): a declared #Deploy field whose value mapping carries a kind-word key classified as an IN-SUBSTRATE MEMBER. The proven repro (the canonical charly-cli ADE iterate-entity bed): a pod primary body with iterate: {sandbox: check-agent-pod, agent: [check-agent-live-claude], plateau_iteration: 1, ...} — `agent` is a kind word, so `iterate:` classified as a member named "iterate", parseNode("iterate") took `agent` as ITS disc, and the scalar `sandbox:` hard-failed "expected a mapping value, got yaml kind 8". Renaming the key to agentsX got past the raw parse (then CUE: field not allowed) — isolating the parse class. Same mechanism as #223, extended to deploy substrates: membership semantics live in the PARENT kind's declared schema — for substrates that is #Deploy's OWN CUE schema. The new spec.Threaded.DeployDeclaredFields channel (opencharly/spec#107, v0.2026249.2215 — the #104 StructuralDeclaredFields twin) is consulted by the substrate branch: a pair whose KEY is a declared #Deploy field is DATA — its value is never looked inside; every other entity-keyed value-shape member (web:/chrome:/sidecar:) stays a member. A substrate word with NO declared schema threaded keeps the plain value-shape scan (the documented no-declared-schema fallback). Zero hardcoded lists. Also pins spec v0.2026249.2215 (the channel's contract change). Gate: go build/vet/test ./... -count=1 green on the committed tree; the repro fixture + the full corpus (authored-depth, 8a external-structural, TestParse_StructuralDeclaredFieldStaysData, TestNoDualMapConstruction) green.
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
Cutover C task 0's PARSE half (the nested-capture plan): the sdk consumes spec #103's ONE uniform ordered member tree (
Deploy.Member []Member{Name, Position, Node}) end to end — the parse PRESERVES the authored depth, the FOLD stampsMember.Positionfrom it, and the dualChildren/Membersmap construction DIES from sdk. Re-pinsgithub.com/opencharly/spectov0.2026249.1948(the #103 tag).classifyKind'sasChildarm,parseNode's parent-allow check,IsResourceDisc's fold set) collapse into ONE Threaded-fed function,memberDisc(clause-D data: resource kinds ∪ threaded structural kinds ∪ threaded deploy substrates).classifyKind(asChild)now consultst.StructuralKinds— the external-structural-child-under-external-structural-parent parse bug dies.discValue/AssembleEntityBody/EntityBodyJSON) omits them — which is how substrate closedness stops rejecting resource-member keys.BuildFleetNode'sTarget == ""root-kind branch is DELETED;BuildResourceMemberChildrenreturns the ordered[]spec.Memberper the frozen spec seam, stampingPosition(in-substrate = named by a top-level key of the authored disc body; deploy-level = not). The dual-map construction is gone.loaderkit/fleet_load.go(FlattenFleetVenues/hoistVenueSubtree/FoldMembers/ValidateMembers over the ordered list — venue flattening now reads Position, not node kind),loaderkit/validate_check_beds.go(HasMembers),deploykit/deploy_nodeform.go(the overlay writer flattens the ONE ordered list;member/member_ofskip-keys),deploykit/deploy_state.go(FleetWalkPre/PostOrder recurse IN-SUBSTRATE members — the old Children-only semantics;FindFleetNodesearches BOTH positions at any depth),deploykit/deploy_tree.go(WalkDeploymentTree → in-substrate members),deploykit/fleet_members.go(BringUp/TearDownMembers overDeployLevelMembers; the newfleet.DeployNestedLocalChildren(parent, node, apply)signature),deploykit/member_dns_preflight.go(deploy-level member set),deploykit/deploy_fleet_ops_aliases.go(the deadSortedNestedKeysalias removed),kittests (descent recursion + VM domain lock over the Member tree).Deliberately untouched (accounting):
FleetNodeis NOT renamed (the fleet-vocabulary retirement rides a later task);spec.StructuralKindLoadEnv.Membersstays the plugin wire map per spec #103's accounting — charly'srunPluginKindcall site adapts in the charly PR of the wave (expected breaking surface, same as the spec PR declared).How tested
go build ./...— clean (no output).go vet ./...— clean (no output).go test -count=1 ./...(fresh, uncached):New tests (
loaderkit/member_tree_test.go):TestParseFold_PreservesAuthoredDepth— in-body member under a VM bed NESTS (Position: in-substrate), bare deploy-level sibling STAYS deploy-level, both under a workload root (the deleted root-kind branch used to collapse these); recursive depth proven (a member inside an in-body member nests).TestParse_MemberCarrierKeysStrippedFromBody— the authored body keeps the member key;EntityBodyJSON/AssembleEntityBodyemit it stripped (closedness clean), real data intact.TestMemberDisc_Unity— classifyKind(asChild), IsResourceDisc, and memberDisc agree over resource/structural/substrate/plain-kind/unknown probes.TestParse_ExternalStructuralChildUnderExternalStructuralParent— the 8a regression; a non-member kind still rejects members.TestDeployNodeHasNoDualMaps— reflect gate: noChildren/Members/Insidefield onspec.Deploy.TestNoDualMapConstruction— EXECUTED grep sweep (not prose) over every non-test Go file in the module forSortedMemberKeys,SortedNestedKeys,.HasChildren(, and the dual-map construction spellings. Real catch during authoring: the gate flagged the identifier surviving in a fleet_load.go comment — fixed (the gate works).Executed sweep claims (all paste-verified during authoring):
Rulebook compliance
/charly-internals:git-workflow,/charly-internals:go; sdk/CLAUDE.md signpost read; the nested-capture plan's Cutover C + spec feat(loaderkit)!: relocate LoadUnified/ApplyDiscover orchestration from charly core #103's PR body re-read before designing).memberDisc) consumed by parse-child, parse-parent-allow, and fold alike, ONE body-emit strip point (discValue).SortedNestedKeysalias,SortedMemberKeysforwarder), and the root-kind branch are deleted, no aliases; the missing-disposition lesson applied — every removed surface is named above with its replacement, and the one deliberately-kept surface (StructuralKindLoadEnv.Members, a plugin WIRE contract) is accounted.go test -count=1(uncached) over the committed tree; the grep-gate test re-executes the dead-code sweep inside the suite so it can never rot.groupkind removal, the fleet-vocabulary retirement, and charly core's consumer migration are the wave's next PRs (task 1/step 2 of the cutover), NOT residuals of this one.Change classification
Change class: mechanism migration + parse semantics fix (loaderkit/deploykit/kit, sdk module); verification gate:
go build ./... && go vet ./... && go test -count=1 ./...green on the final tree + the in-suite executed sweeps; attribution tier:fully tested and validated(changed paths executed live: parse, fold, member walks, overlay writer paths via the suite).Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)