Skip to content

feat(spec,deploykit,loaderkit): CandyReader agent/terminal-profile accessors - #75

Merged
atrawog merged 4 commits into
mainfrom
feat/w9-loader-cone
Jul 20, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/w9-loader-cone

Conversation

@atrawog

@atrawog atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Adds agent_provide/terminal_profile support to spec.CandyReader — closing a gap
discovered while merging origin/main's federated control-plane commit into the charly
consumer branch feat/w9-loader-cone (the W9 Candy→CandyReader/CandyModel/CandyView
retype). Pre-existing state: #CandyView already carried an agent_provide field (added by
the earlier W9 sdk work, b24b168) but no terminal_profiles field, and spec.CandyReader
exposed neither through its interface — so charly/render_baked_metadata.go's per-box
agent/terminal-profile OCI-label aggregation (added by the control-plane commit, which reads
these off a live *Candy) has nothing to call once the retype removes the concrete *Candy
type.

Concrete edits:

  • schema/resolvedproject.cue: add terminal_profiles?: {[string]: #TerminalProfile} to
    #CandyView (mirrors the existing agent_provide field + the identical field already on
    #BoxMetadata/#BakedLabelSet).
  • spec/candy_reader.go: add AgentProvide() []AgentRuntimeCapability,
    HasAgentProvides() bool, TerminalProfiles() map[string]TerminalProfile to the
    CandyReader interface (regular already-methods naming, matching the pre-retype
    *Candy.AgentProvide()/HasAgentProvides() methods these replace).
  • deploykit/spec_candy_adapter.go: implement all three on specCandyAdapter, reading
    directly off the wrapped CandyView.
  • loaderkit/scan_candy.go: populateFromYAML now carries ly.AgentProvide/
    ly.TerminalProfiles (the authored spec.CandyYAML fields) onto the CandyView at scan
    time.
  • deploykit/spec_candy_adapter_test.go + loaderkit/scan_candy_test.go: new regression
    tests for both the wrap-time accessors and the scan-time population (see R10 below).
  • Also folds in origin/main's independent advance (sdk#72 F-CLI-NEST: the CUE-generated
    Kong reflection surface + protocol-schema field additions) via a clean merge — no
    conflicts, this PR's own files (resolvedproject.cue/candy_reader.go/
    spec_candy_adapter.go/scan_candy.go) don't overlap feat(proto,spec): F-CLI-NEST — declared subcommand catalogs for command-class plugins #72's (protocol/schema/plugin.cue,
    schema.go, kong_reflect.go).

Change class

charly-or-sdk Go (a schema/interface addition to the sdk contract module, consumed by the
charly cutover feat/w9-loader-cone, currently pinned in-tree via the module replace
directive — no other consumer yet).

How R10-tested — exact gate, commands, and pasted output

  • The gate for this change class: sdk is a standalone-consumed contract module with no
    disposable check bed of its own (it has no charly.yml) — its gate is the full standalone
    Go battery (build/vet/test/lint/tidy/verify) plus CUE-generation reproducibility, per
    /charly-internals:git-workflow "Per-module verification". The consuming charly cutover
    (feat/w9-loader-cone) will separately prove this surface through its own bed roster once
    this PR merges and its go.mod require is bumped to the merged tag (B6 producer→consumer
    sequencing).
  • Eval beds run: N/A — no charly.yml bed exists for the sdk module itself; see gate above.
  • Fresh rebuild: GOWORK=off go build ./... from a clean git status after git merge origin/main — zero warnings.
  • Did the CHANGED code path execute live? Yes — both new tests directly call the new
    accessors/population and assert on real (non-zero) values, not just compile-safety. Verified
    each test FAILS when the fix is reverted (see below) — proving the tests are not vacuous.
  • Concurrency: N/A — this change touches no shared-state path (loader/deploy-ledger/podman
    store/resource-arbiter/VM-pod-lifecycle); it's a pure additive interface/schema surface.
$ git merge origin/main --no-edit
Merge made by the 'ort' strategy.
 CHANGELOG/2026.201.0542.md |  38 ++++
 CHANGELOG/2026.201.0603.md |  28 +++
 Taskfile.yml               |  34 ++--
 kong_reflect.go            | 103 +++++++++++
 kong_reflect_test.go       |  39 ++++
 proto/plugin.pb.go         | 453 ++++++++++++++++++++++++++-------------------
 proto/plugin.proto         |  13 ++
 protocol/schema/plugin.cue |  30 +++
 schema.go                  |  19 ++
 schema/README.md           |  82 ++++----
 spec/gen_repro_test.go     |   5 +-
 11 files changed, 598 insertions(+), 246 deletions(-)
(no conflicts)

$ GOWORK=off go mod tidy && GOWORK=off go mod verify
all modules verified

$ GOWORK=off go build ./...
(clean)

$ GOWORK=off go vet ./...
(clean)

$ GOWORK=off go test ./...
ok  	github.com/opencharly/sdk	0.155s
ok  	github.com/opencharly/sdk/agentkit	0.031s
ok  	github.com/opencharly/sdk/deploykit	0.031s (0.025s on re-run)
ok  	github.com/opencharly/sdk/enginekit	(cached)
ok  	github.com/opencharly/sdk/internal/wiregen	0.019s
ok  	github.com/opencharly/sdk/kit	(cached)
ok  	github.com/opencharly/sdk/loaderkit	0.006s
ok  	github.com/opencharly/sdk/spec	0.294s      (includes TestGenReproducible)
ok  	github.com/opencharly/sdk/targetkit	0.164s
ok  	github.com/opencharly/sdk/vmshared	(cached)
(buildkit/internal-schemagen/proto/schema/schemaconcat/sshx/testkit: no test files)

$ gofmt -l .
(empty)

$ golangci-lint run
0 issues.

$ task cue:gen        # also chains wire:gen
... (regenerates spec/{cue_types_gen.go,vocab_gen.go,version_gen.go} + proto/*)
$ git status --short
(empty — reproducible, no drift)

# Test-fails-without-fix proof (temporarily reverted the loaderkit population lines):
$ GOWORK=off go test ./loaderkit/... -run AgentProvide -v
=== RUN   TestScanInlineCandy_AgentProvideAndTerminalProfiles
    scan_candy_test.go:26: CandyView.AgentProvide = [], want [{Provider: pi}]
    scan_candy_test.go:30: CandyView.TerminalProfiles["claude-code"] = {...}, ok=false, want ...
--- FAIL: TestScanInlineCandy_AgentProvideAndTerminalProfiles (0.00s)
FAIL
# (fix restored immediately after, full battery re-run green — see above)

Attribution tier

fully tested and validated — the new code paths (both interface methods + scan-time
population) executed against non-trivial fixture data in the new tests, and each test was
independently proven to fail without its corresponding fix.

Harness rulebook compliance

  • R0 skills: /charly-internals:go (SDD / CUE generation pipeline) and
    /charly-internals:git-workflow (multi-repo B2/B6 sequencing, per-module verification) —
    both loaded and followed for the schema-then-generate-then-implement order and the
    producer-before-consumer landing order.
  • R1 RCA + zero warnings: the missing TerminalProfiles field/accessor was found by
    reading the actual render_baked_metadata.go consumer code (not assumed) after the charly
    merge surfaced a broken build; gate output above has zero warnings.
  • R2 no out-of-scope: the only issue this PR's scope surfaced (missing coverage) was fixed
    in the same branch before push, not deferred.
  • R3 no duplication: the three new methods mirror the exact existing pattern
    (GetStatus/GetDescription/IsPluginCandy/…) already on CandyReader — no new
    abstraction invented.
  • R4 no workaround: N/A — no sleep/retry/magic-number/shim in this diff.
  • R5 hard cutover + grep: N/A — this diff is purely additive (new field, new interface
    methods, new adapter methods, new population lines, new tests); nothing renamed or removed,
    so there is no <removed-id> to grep for.
  • R6 git safety: git status/git diff --stat checked before and after every merge/commit
    step; no destructive git action taken.
  • R7 runtime gate: N/A for the sdk module itself (no bed of its own); the consuming
    charly cutover's own R10 bed roster is the runtime gate for this surface, run separately by
    the orchestrator after this PR merges.
  • R8 artifact invariants: N/A — no Containerfile/OCI-label generation touched in sdk
    itself (the charly consumer's render_baked_metadata.go is what emits the
    ai.opencharly.agent_provide/terminal_profiles labels from this data; that's charly-side).
  • R9 binary == source + deps: N/A — sdk ships no binary; no new runtime OS dependency.
  • R10 disposable + coverage: the change ships test coverage that FAILS without it — see the
    "Test-fails-without-fix proof" above.
  • RDD / ADE / SDD: SDD — the CUE schema (resolvedproject.cue) was edited FIRST, then
    task cue:gen regenerated cue_types_gen.go (diff = exactly the intended 2 lines), then the
    Go interface/adapter/population code was written against the generated type; task cue:gen
    reruns as a no-op. RDD — this is a low-risk additive schema change (not a
    composition-at-latest-versions unknown), so no bed spike was needed; ADE/N/A (sdk ships no
    candy plan).
  • Hard cutover: two commits on one branch (interface/schema/adapter/population, then its
    test coverage) — both will squash into ONE commit on sdk main at merge; no
    Phase-2/deferred scope left.
  • Kernel/plugin boundary law: N/A — this is an sdk contract-module addition, not a
    charly/ core change; doesn't touch the kernel/plugin boundary.
  • Disposable-only autonomy: N/A — no destroy/rebuild of any deployed target in this PR.
  • Clean architecture + Go gates: gofmt -l . empty, golangci-lint run = 0 issues,
    go vet clean, go test ./... green — all pasted above.
  • CHANGELOG: CHANGELOG/2026.200.2200.md staged (placeholder CalVer; the pr-validator
    finalizes it at merge).

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)

atrawog added 3 commits July 20, 2026 08:02
…cessors

Closes a gap surfaced while merging origin/main's federated control-plane
commit (56b1a6b) into the W9 loader-cone retype: render_baked_metadata.go's
per-box agent/terminal aggregation needs the candy-declared agent_provide/
terminal_profile data through spec.CandyReader, which the W9 retype's
CandyView carried AgentProvide for but never TerminalProfiles, and never
exposed either through the interface. Adds terminal_profiles to #CandyView,
regenerates, adds AgentProvide()/HasAgentProvides()/TerminalProfiles() to
CandyReader + specCandyAdapter, and populates them in loaderkit.scanFromParsed.

Verified via GOWORK=off go build/test/vet + golangci-lint (0 issues) on the
sdk module standalone; go.mod tidy is a no-op.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…ccessors

The prior commit (de7e8ae) added AgentProvide()/HasAgentProvides()/
TerminalProfiles() with no coverage exercising them — a change whose new
functionality has no test that would fail without it isn't landable.
Add adapter-level and scan-level regression tests; verified both fail
(nil slice, InSystems-lookup miss) when the population fix is reverted.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly-or-sdk Go — sdk contract-module addition (spec/deploykit/loaderkit), no disposable check bed of its own (standalone-consumed Go module, no charly.yml).

Head verified: e854ce1573dde6d215680bb1f13f48de133f14d2 (via git ls-remote, matches gh pr view).

Checklist

# Item Verdict
0 Security & anti-tampering (T1–T4) PASS — diff exactly matches the described scope (8 files: schema, generated types, interface, adapter, scan-populator, 2 test files, CHANGELOG); no secrets/exfiltration/network calls; no weakened guardrails; no supply-chain change; no embedded instruction to the validator anywhere in body/commits/code
1 Description complete PASS — full template: summary, exact gate + pasted commands/output, attribution tier + justification, rule-by-rule compliance section
2 Change-class gate matches evidence PASS — sdk has no bed; the standalone Go battery is the correct/only gate per /charly-internals:git-workflow "Per-module verification". I independently re-ran the full battery from a fresh disposable worktree (git worktree add … e854ce1 --detach), not trusting the pasted output: GOWORK=off go mod tidy (no-op, clean status), go mod verify (all modules verified), go build ./... (clean), go vet ./... (clean), go test -count=1 ./... (all packages green, incl. spec which carries TestGenReproducible), gofmt -l . (empty), GOWORK=off golangci-lint run ./... (0 issues, isolated GOLANGCI_LINT_CACHE). No dry-run/rebuild-alone fraud.
3 Attribution tier justified PASS — fully tested and validated earned: I independently reproduced the non-vacuity proof myself (see R10 below), not merely trusting the author's paste
4 R0 skills honored PASS — /charly-internals:go (SDD pipeline: schema/*.cue → task cue:gen → Go) and /charly-internals:git-workflow (B6 producer-before-consumer sequencing — this PR must merge before the charly consumer leg bumps its go.mod require) both correctly loaded and followed
5 R1 RCA / zero warnings PASS — zero warnings anywhere in my own re-run; no flake/transient framing present
6 R2 no pre-existing/out-of-scope split PASS — the one issue this PR's scope surfaced (missing CandyReader coverage for a pre-existing CandyView.AgentProvide field + a new terminal_profiles field) is fixed in the same branch, not deferred
7 R3 no duplication PASS — the three new methods (AgentProvide/HasAgentProvides/TerminalProfiles) are byte-for-byte the same shape as the existing EnvProvides/MCPProvide/HasEnvProvides/HasMCPProvides pattern already on CandyReader — no new abstraction invented
8 R4 no ad-hoc workaround N/A — no sleep/retry/magic-number/ad-hoc-podman anywhere in this diff (confirmed by reading every changed line)
9 R5 hard cutover + grep self-test N/A — purely additive (new CUE field, new interface methods, new adapter methods, new population lines, new tests); nothing renamed/removed, so no <removed-id> to grep
10 R6/R8/R9 R6 PASS (I checked git status before/after my own destructive local revert-test, see R10); R8 N/A (no Containerfile/OCI-label generation touched in sdk itself); R9 N/A (sdk ships no binary, no new runtime OS dep)
11 R10 disposable/fresh-rebuild/coverage PASS — disposable-target requirement N/A (no bed for this module class, per matrix). I independently proved non-vacuity myself, not trusting the author's paste: in my disposable worktree I removed the two loaderkit/scan_candy.go population lines (v.AgentProvide = ly.AgentProvide / v.TerminalProfiles = ly.TerminalProfiles), ran GOWORK=off go test ./loaderkit/... -run AgentProvideAndTerminalProfiles -v → FAILS exactly as claimed (CandyView.AgentProvide = [], want [{Provider: pi}]), confirmed the sibling deploykit wrap-time test still passes untouched (proving it tests a genuinely different layer), then git checkout -- restored the file and git status confirmed clean. Coverage genuinely fails without the fix.
12 RDD/ADE/SDD PASS — RDD N/A (low-risk additive, not a composition-at-latest-versions unknown); ADE N/A (sdk ships no candy plan). SDD verified myself, not from the author's claim: schema/resolvedproject.cue line 167 is the single source; I ran GOWORK=off task cue:gen (chains wire:gen) in the disposable worktree from a clean tree — git status --short was empty afterward (byte-identical regen, true no-op); spec/cue_types_gen.go's CandyView.TerminalProfiles is 100% generated, no hand-edit; the type is a plain map field (no disjunction, no @go(-)), matching the CAN list in /charly-internals:go; #TerminalProfile/#AgentRuntimeCapability are pre-existing CUE defs (schema/agent_control.cue) already used identically on #BoxMetadata/#BakedLabelSet/#CandyYAML — this PR only extends the SAME pre-existing defs onto #CandyView, so it introduces no new hand-written schema-shaped code at all
13 Concurrency mandate N/A — confirmed from the diff: no shared-state path (loader walk/deploy-ledger/podman-store/arbiter/VM-pod-lifecycle) touched; this is a pure additive struct-field/interface-accessor/copy-assignment change
14 Hard cutover — one atomic phase PASS — two commits on the branch (feature + tests) squash to ONE commit on sdk main; no Phase-2/deferred scope
15 Architecture gate — placement PASS. placement: CORRECT. No charly/*.go files in this diff (sdk-repo-only PR), so the alias/kit-import mechanical sub-checks and the per-item trace are N/A — no charly/*.go changes in this diff. Layer judgment: CandyReader lives in spec (the shared wire-contract home, per its own doc comment) — the new methods are a plain data-read accessor mirroring the pre-existing EnvProvides/MCPProvide pattern exactly; deploykit/loaderkit are sdk mechanism kits implementing/populating that contract. This is squarely the correct layer (a wire SHAPE + its mechanism-kit implementation, CUE-first) — no capability code, no core dependency, nothing that would be better one layer further out.
16 Disposable-only autonomy N/A — no destroy/rebuild of any deployed target in this PR
17 Clean architecture + Go gates PASS — gofmt -l . empty, GOWORK=off golangci-lint run ./... = 0 issues (isolated GOLANGCI_LINT_CACHE per this worktree), go vet ./... clean, go test ./... green — all independently re-run by me from a fresh worktree, not copied from the PR body
18 CHANGELOG present PASS — CHANGELOG/2026.200.2200.md: filename matches ^\d{4}\.\d{3}\.\d{4}\.md$; head -1 byte-equals # 2026.200.2200 — CandyReader agent/terminal-profile accessors (W9 follow-on); confirmed the placeholder CalVer does NOT already exist as a file or tag on origin/main (I will rewrite this to the real merge-time CalVer in Phase 3)

Comments considered: none — the PR carries no comments (comments: []).

Cross-PR interactions considered:

Decision: PASS. Every rule verified from my own independent re-derivation (fresh disposable worktree, full battery, reproducibility regen, and a live revert-test proving the new coverage is non-vacuous) rather than the author's paste. Proceeding to Phase 3: finalize the merge-time CalVer, merge (squash), tag v0.<…>.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)

@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Status POST: charly/pr-validator = success on e854ce1573dde6d215680bb1f13f48de133f14d2 — ALLOWED, zero denials.

Proceeding to CalVer finalization + merge.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)

pr-validator merge-time version stamp for PR #75 (CandyReader
agent/terminal-profile accessors).

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
@atrawog
atrawog merged commit db63ef1 into main Jul 20, 2026
@atrawog
atrawog deleted the feat/w9-loader-cone branch July 20, 2026 06:39
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Merge: gh pr merge --squash --delete-branch — ALLOWED, zero denials. Merged as db63ef1e79652fce2d37f1057ff4740b9c4a884e on main.

Proceeding to tag v0.2026201.636.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)

@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Tag: v0.2026201.636 — pushed and verified live (git ls-remote --tags origin v0.2026201.636 → non-empty) on merged main HEAD db63ef1e79652fce2d37f1057ff4740b9c4a884e.

Landing complete. Disposable validator worktree removed.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)

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