Repository navigation
feat(schema): add CliRequest.env + ProvidedCapability.interactive - #154
Conversation
Thread per-call child env on the cli host-builder envelope as explicit data (placement-invariant cli reentry), and declare a command capability's terminal need so command dispatch can route non-interactive commands through the broker-backed Invoke(OpRun) path in both placements. Additive only: no #SchemaVersion bump, no migration. Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)
Beds()/ResolveBed()/BedScope() add namespace-aware bed enumeration + resolution (the replacement for the local-only CheckBeds()). Ships the coverage that fails without it. Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config ( Security screen: T3 finding — scope mismatch (code does materially more than the description claims). See Block 1. Blocks
Minor (confirm before merge): A3 — the footer names Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Assisted-by: opencode deepseek-v4.1-flash (documentation reviewed)
Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — T1/T2 clean (no embedded directives; PR body/diff are data only); T3 clean (no secrets, no egress/network, no new deps, no guardrail weakening; scope matches the body's three declared changes); T4 N/A (spec schema/Go contract only, not security machinery). Comments considered:
Checklist: All applicable rules PASS or NA. Cross-checked the regenerated Non-blocking note (B15): 4 commits for one coherent change (schema, test, body re-freeze, lint fix); the Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary of changes
The spec-side legs of the plugin-native check-bed roster cutover. THREE changes, two additive wire additions and one namespace-aware resolver replacement.
schema/seam.cue—#CliRequestgainsenv?: {[string]: string}. Theclihost-builder (M4) forks acharlychild; the caller passes per-call environment variables as EXPLICIT DATA instead of mutating its own process env. This is what makes the cli host-builder placement-invariant: a compiled-in caller thatos.Setenvs isolation vars (CHARLY_REPO_OVERRIDE/CHARLY_DEPLOY_CONFIG/CHARLY_PREEMPT_LEASE) only reaches the forked child when caller and child share a process; an out-of-process caller'sos.Setenvlands in the WRONG process. Threading the vars on the request makes the child receive them identically in both placements. ADDITIVE.protocol/schema/plugin.cue+capability/capability.go—ProvidedCapabilitygainsinteractive(proto field 14; Go field on the authoring struct). Aclass=commandcapability sets it when it needs a real terminal (shell,logs -f,mcp serve --stdio). Such a command keeps the process-replacing exec lane; every non-interactive command can dispatch through the broker-backedInvoke(OpRun)path, so a command behaves identically compiled-in and runtime-loaded. ADDITIVE.spec/loadmodel.go— replaces the local-onlyUnifiedFile.CheckBeds()with the ONE namespace-aware bed resolver:Beds()(recursive local +ns.nameenumeration viacollectBeds),ResolveBed(ref)(local orns.bed), andBedScope(ref)(returns the owningUnifiedFileso a namespaced bed's barefrom:resolves against its own namespace). This fixes a real defect: a namespaced bed (main.check-*) currently VALIDATES (loaderkit.bedRefsupportsns.bed) but CANNOT RUN (the run path looked it up locally only).CheckBeds()had three disagreeing consumers; this is the single replacement. RENAME/REMOVAL (see R5).Regenerated:
proto/plugin.proto,proto/plugin.pb.go,spec/cue_types_gen.go(viatask wire:gen+task cue:gen).New coverage:
spec/loadmodel_beds_test.gocoversBeds()/ResolveBed()/BedScope().Additive wire fields only for items 1–2; item 3 is a rename (
CheckBeds→Beds) with NO#SchemaVersionbump (the authoredcharly.ymlschema surface is unchanged — this is a Go API change, not a config-format change). No migration.Closes / relates to: none (first legs of a cross-repo cutover; sdk + charly + plugin-check consumers follow). The rename's consumer updates are in the sdk leg (
ValidateCheckBeds/ResolveEntityRefuseBeds()/ResolveBed()) and land AFTER this is merged + tagged.Breaking change + rollback:
CheckBeds()is removed/renamed toBeds()— a Go API break for out-of-tree consumers ofspec.UnifiedFile. Recovery: switchuf.CheckBeds()touf.Beds()(the new names are namespace-qualified; a local-only caller gets the same local keys plusns.*keys). Rollback is a revert of this PR.Change class
charly-or-sdk Go(the spec contract module). Consumer legs land after this is merged + tagged (SDK-first order).How R10-tested — exact gate, commands, and pasted output
task cue:genreproducibility +go test ./..., AND the newspec/loadmodel_beds_test.gowhich directly exercises the changed bed-resolution logic and FAILS without it.N/A (contract module)for deployable beds; the changed bed-logic path is executed by the new unit test, not a bed.N/A— no binary.go test(pasted below).task wire:gen/task cue:genexecuted the generation paths against the edited CUE.N/A.1. Fresh-rebuild gate output:
2. Each changed code path executing:
3. Docs-only evidence:
N/A.Attribution tier
fully tested and validated— the changed resolver paths ran live under test; the full module battery (incl. theTestGenReproduciblegeneration-drift gate) passed.Harness rulebook compliance — state HOW each is satisfied (or
N/A — <reason>)/charly-internals:go(schema change recipe) and/charly-internals:plugin(capability/wire contract).main.check-*); it is in scope, not deferred.resolve_entity_ref_test.go) now route through it.Beds()is the explicit-data/one-path fix; no shim.origin/main(not a sibling branch) still referencesCheckBeds/bedRef:#SchemaVersionis unchanged (the authored config surface is unaffected).git statuschecked before commits; no destructive action.N/A— contract module; the changed logic is unit-gated (see *2).proto/plugin.proto+cue_types_gen.go;TestGenReproducibleproves a clean regeneration is a no-op.N/A— no binary, no runtime OS deps.N/A (contract module)for beds;spec/loadmodel_beds_test.goships the coverage that fails without the resolver change.task cue:genregenerated,TestGenReproduciblegreen.spec.UnifiedFilemethod (no concrete-kind schema/switch/map).N/A.gofmtclean;go test ./...green.N/A— this repo'sCHANGELOG/<CalVer>.mdis written post-merge bytag-on-mergefrom THIS body.Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)