Skip to content

feat(schema): carry the StepContract plugin_paths flag onto the wire (#1131) - #505

Merged
github-actions[bot] merged 1 commit into
mainfrom
charly-plugins/leg-b
Nov 13, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
charly-plugins/leg-b

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

A class:step plugin's StepContract is DECLARED by the plugin and acted on by the host: the host is what reads Scope, Venue, Gate and Emits off the declared capability. So every field has to survive the capability build, or a plugin declares a capability nobody can see.

PluginPaths — the opt-in added by opencharly/spec#308 for opencharly/charly#1131 — is the one that makes the host inject the connected plugin set into this step's input. Dropping it in this conversion is not a cosmetic loss: the plugin would declare the flag, the host would never receive it, and the step would go back to guessing where its plugin binaries are.

This PR is that one conversion plus its proof:

  • schema.go — BuildCapabilitiesWithRequires carries PluginPaths into pb.StepContract, next to Emits, for the same reason: the host acts on it.
  • step_contract_test.go (new) — drives the real BuildCapabilitiesWithRequires path and round-trips the result through protobuf, so it fails if the field is dropped and also pins that the contract's other fields did not drift with it.
  • go.mod / go.sum — adopt github.com/opencharly/spec v0.2026317.1755 (spec#308, merged and tagged), which is where the field is defined.

Head fa4eb69c381e786f34a2ec426e78cebde249196a

How tested

Change class: Contract / library module. This repo ships no disposable: true target, so no bed CAN exist here; per the R10 matrix for that class the gate is the repo's own committed CI green on the committed tree, genuinely EXECUTING the changed path. Every run below is on the tree that is pushed.

$ git rev-parse HEAD
fa4eb69c381e786f34a2ec426e78cebde249196a

$ go build ./... && echo BUILD_OK
BUILD_OK
exit=0

$ go test ./...
ok  	github.com/opencharly/sdk	(cached)
ok  	github.com/opencharly/sdk/agentkit	(cached)
ok  	github.com/opencharly/sdk/artifactkit	(cached)
ok  	github.com/opencharly/sdk/buildcache	(cached)
ok  	github.com/opencharly/sdk/buildkit	(cached)
ok  	github.com/opencharly/sdk/buildkitdrive	(cached)
ok  	github.com/opencharly/sdk/candywalk	(cached)
ok  	github.com/opencharly/sdk/charlylib	(cached)
ok  	github.com/opencharly/sdk/checkkit	(cached)
ok  	github.com/opencharly/sdk/cmd/charly-lib-gen	(cached)
ok  	github.com/opencharly/sdk/deploykit	(cached)
ok  	github.com/opencharly/sdk/enginekit	(cached)
?   	github.com/opencharly/sdk/internal/spectest	[no test files]
ok  	github.com/opencharly/sdk/kit	(cached)
ok  	github.com/opencharly/sdk/llmkit	(cached)
ok  	github.com/opencharly/sdk/loaderkit	(cached)
ok  	github.com/opencharly/sdk/packagekit	(cached)
ok  	github.com/opencharly/sdk/storekit	(cached)
ok  	github.com/opencharly/sdk/vmshared	(cached)
ok  	github.com/opencharly/sdk/workflowkit	(cached)

$ test -z "$(gofmt -l .)" && echo GOFMT_CLEAN
GOFMT_CLEAN
exit=0

$ go vet ./...
VET_OK
exit=0

$ GOTOOLCHAIN=go1.26.8 golangci-lint run ./...
0 issues.

$ for a in amd64 arm64 arm 386; do CGO_ENABLED=0 GOOS=linux GOARCH=$a go build ./... && echo "$a OK"; done
amd64 OK
arm64 OK
arm OK
386 OK

The GOTOOLCHAIN=go1.26.8 on the lint is this repo's own documented pin (go.mod declares go 1.26.8): golangci-lint v2.13.2's embedded type-checker reads export-data version 4, while a newer local toolchain writes version 5 and the lint then fails in an unrelated package with export data version 5 is greater than maximum supported version 4. Under the declared toolchain the run is clean.

The test executes the changed path, and dies without it:

$ go test ./ -run TestBuildCapabilitiesCarriesTheStepContractFlagOnTheWire -count=1 -v
=== RUN   TestBuildCapabilitiesCarriesTheStepContractFlagOnTheWire
--- PASS: TestBuildCapabilitiesCarriesTheStepContractFlagOnTheWire (0.01s)
PASS
ok  	github.com/opencharly/sdk	0.014s

Mutation proof — PluginPaths: c.StepContract.PluginPaths removed from the conversion, then restored (the tree is clean at the head above):

--- FAIL: TestBuildCapabilitiesCarriesTheStepContractFlagOnTheWire (0.01s)
    step_contract_test.go:50: PluginPaths did not survive the capability build: the host would never inject the plugin set
FAIL
FAIL	github.com/opencharly/sdk	0.014s

The "no disposable target" premise, executed on the head (the class gate requires it proven, not asserted):

$ git grep -nE "^[[:space:]]*disposable:" -- "*.yml" "*.yaml"; echo exit=$?
exit=1

$ grep -nE "^[[:space:]]*(box|deploy|check):" charly.yml; echo exit=$?
exit=1

Where the behaviour is observable at a CONSUMER's live boundary — named here because the bed rides the consumer change, never a library PR: opencharly/plugin-deploy-firecracker's check-plugin-tree-vm (a disposable vm: bed) is the bed that carries this flag end to end, and it is run by that plugin's own PR after this one is released. opencharly/plugin-firecracker#11 and opencharly/layer-fireactions-runner#2 are the two consumer PRs their beds unblock.

Rulebook compliance

  • R0 how: skills loaded before the first tool call — git-workflow, go, go-quality, plugin, check, disposable, strict-policy, root-cause-analyzer, plus this repo's own sdk/AGENTS.md, whose "schema and wire types are NOT here — bump the require" rule is exactly the shape of this PR.
  • R1 how: no unexpected failure or warning surfaced; module suite, gofmt, vet and golangci-lint are green with zero findings, so nothing needed an RCA or a filing. The one environment mismatch encountered (the newer-toolchain export-data error) is this repo's own documented condition, cured by running the lint under the toolchain go.mod declares — pasted above.
  • R2 how: the conversion stays ONE place (BuildCapabilitiesWithRequires); the flag and the wire field come from spec, so there is no second spelling of the contract in this repo. deploykit/loaderkit/kit stay untouched — the mechanism packages acquire no copy of the capability build.
  • R3 how: no sleep, retry, fallback or special case; one field is added to an existing literal.
  • R4 how: no documentation or command surface changed.
  • R5 how: nothing deleted; the new test file is the only addition beyond the conversion, and no identifier is removed from this repo or from spec.
  • R6 how: git status read before any git action; the change is committed on charly-plugins/leg-b off origin/main (e44f0ce); no force-push, no amend, no submodule touched.
  • R7 how: the new test drives the changed function and is mutation-proven above; the emitted artifact — the wire pb.StepContract — is validated at its own boundary by a protobuf marshal/unmarshal round trip inside the same test, not by an in-memory field read.
  • R8 how: the change crosses no live service; nothing was mocked.
  • R9 N/A — reason: this repo ships no binary; the module is the artifact, and it is built for four architectures above. The charly and plugin consumers carry their own R9 proof.
  • R10 how: the change class is Contract / library module: the repo's committed CI on the committed tree, pasted in full above, plus the executed proof that no disposable: true target exists here. The live-boundary bed rides the consumer PR named under How tested.

Change classification

  • Class: contract / library module (one field on an existing conversion, plus its test and a require bump).
  • Breaking change + rollback: none — the flag is additive and optional; every plugin that does not set it encodes the same bytes as before (PluginPaths false is the proto3 zero value). Rollback is git revert, which returns the module to spec v0.2026317.703.
  • Consumer ordering: producer-first. spec is merged and tagged (v0.2026317.1755); charly adopts the same tag before it populates or injects the field; the plugin and its bed come after that.

Agent: charly-plugins

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

A `class:step` plugin's StepContract is DECLARED by the plugin and ACTED ON by the host, so
every field has to survive the capability build. `PluginPaths` (opencharly/charly#1131) is the
opt-in that makes the host inject the connected plugin set into a step's input; without it in
this conversion, a plugin that declares it would be invisible to the very code the flag exists
for.

The test drives the real `BuildCapabilitiesWithRequires` path and round-trips the result through
protobuf, so it fails if the field is dropped here, and it asserts the contract's other fields
did not drift with it.

Adopts `github.com/opencharly/spec v0.2026317.1755` (opencharly/spec#308, merged and tagged),
which is where the field is defined.

Refs opencharly/charly#1131

Agent: charly-plugins
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: fa4eb69c381e786f34a2ec426e78cebde249196a (branch: charly-plugins/leg-b)

Security screen: PASS (diff matches the stated one-field conversion; no secrets, no scope creep, no guardrail or supply-chain weakening — the spec bump points at the tagged producer release the body names).
Checklist: All applicable rules PASS or NA.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 13, 2026 18:01
@github-actions
github-actions Bot merged commit 2ae35f4 into main Nov 13, 2026
8 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant