Repository navigation
feat(sdk): one namespace-aware bed resolver + adopt spec v0.2026267.2121 - #281
Conversation
Collapse the three disagreeing bed lookups (spec.CheckBeds local-only, loaderkit.bedRef bool-only, and the run path's local lookup) into the ONE spec.UnifiedFile.Beds()/ResolveBed()/BedScope() surface; ValidateCheckBeds and ResolveEntityRef now use it, so a namespaced bed validates, resolves, and runs identically to a local one. Add ProvidedCapability.Interactive pass-through to BuildCapabilities. Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)
Adopt the merged spec tag carrying CliRequest.env + ProvidedCapability.interactive + the namespace-aware bed resolver (Beds/ResolveBed/BedScope). Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: charly-or-sdk Go (contract module). Blocks
Minor / for the squash (B15): the feat commit Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Add ValidateCheckBeds tests on a namespaced bed whose bare from: resolves only in its OWN namespace (FAILS without the BedScope threading). Fix the stale uf.CheckBeds() comment in the deploy-hop test. Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)
Assisted-by: opencode deepseek-v4.1-flash (documentation reviewed)
Review — BLOCKHead SHA: Change class: Security screen: no T1–T4 finding (no secrets, no egress, no guardrail weakening, dep is a version bump of an existing pinned module with matching Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
- Correct the beds_test.go header (it exercises the spec-provided resolver as the sdk's consumer sees it; the sdk's own ValidateCheckBeds logic is covered by the namespaced test). - Resolve the pre-change-behavior contradiction: CheckBeds() is local-only, so a namespaced bed was never enumerated; the namespaced-reject test FAILS without the change (proven by reverting to a local-only enumeration shim). - Add TestBuildCapabilitiesCarriesInteractive locking the Interactive pass-through. Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)
Assisted-by: opencode deepseek-v4.1-flash (documentation reviewed)
Review — PASSHead SHA: Security screen: PASS — no T1–T4 finding. No secrets/egress/obfuscation; the Checklist: All applicable rules PASS or NA. Change class = Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary of changes
The sdk leg of the plugin-native check-bed roster cutover. Depends on the merged producer opencharly/spec#154 (tag
v0.2026267.2121).loaderkit/resolve_entity_ref.go—ResolveEntityRef's bed-hop arm calls the ONEspec.UnifiedFile.ResolveBed(ref)(namespace-aware) instead of the local-onlybedRef;bedRefis DELETED.loaderkit/validate_check_beds.go—ValidateCheckBedsiteratesuf.Beds()(local + namespace-qualified) instead of the local-onlyuf.CheckBeds(), and validates each bed'sfrom:against its OWNING namespace (uf.BedScope(name)).schema.go—BuildCapabilitiespassesProvidedCapability.Interactive(defined inspec/capability/capability.go, merged in spec#154) through to the proto.loaderkit/beds_test.go— NEW: exercises the spec-providedBeds()/ResolveBed()/BedScope()as the sdk's consumer sees them.loaderkit/validate_check_beds_namespace_test.go— NEW:ValidateCheckBedson namespaced beds;_NamespacedFromRejectedWhenUndefinedFAILS without the change (proof below).loaderkit/validate_deploy_hop_test.go— staleuf.CheckBeds()comment corrected.schema_capabilities_test.go— NEWTestBuildCapabilitiesCarriesInteractivelocks the pass-through.go.mod/go.sum— bumpgithub.com/opencharly/spectov0.2026267.2121.Pre-change behavior (resolving the earlier contradiction):
uf.CheckBeds()was LOCAL-ONLY, so a namespaced bed was never enumerated byValidateCheckBeds— not rejected, simply unvalidated. The change enumerates it and validates against its owning namespace.Closes / relates to: producer opencharly/spec#154 (MERGED, tagged v0.2026267.2121).
Breaking change + rollback: none in sdk's public surface (
ResolveEntityRef/ValidateCheckBedssignatures unchanged). Rollback is a revert.Change class
charly-or-sdk Go(contract module).How R10-tested — exact gate, commands, and pasted output
GOWORK=off go mod verify && GOWORK=off go build ./... && GOWORK=off go test ./....N/A (contract module, no deployable beds).N/A— no binary.go test(pasted below).N/A.1. Full gate output (verbatim):
2. Changed code paths executing (verbatim
-v):3. Coverage FAILS without the change (proof): reverting
validate_check_beds.goto a local-only enumeration + root-scope resolve:Attribution tier
fully tested and validated— changed paths ran live under test; the fail-without-change proof is pasted.Harness rulebook compliance — state HOW each is satisfied (or
N/A — <reason>)/charly-internals:go,/charly-internals:plugin.bedRefDELETED; one resolver.BedScope..CheckBeds/bedRefgone). The second's hits are ALL the VALIDATOR FUNCTION NAMEValidateCheckBedsand comments naming it — noUnifiedFile.CheckBeds()method call remains.git statuschecked; agit pull(no-rebase) aftergh pr update-branch; no force.N/A— contract module; changed logic unit-gated (§2/§3).N/A.N/A.N/Afor beds; §3 pastes the fail-without-change proof.N/A.gofmtclean;go test ./...green.N/A— post-merge bytag-on-mergefrom this body.Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)