Skip to content

fix(sdk): honor the NFPM_*_PASSPHRASE env vars in the struct-direct nFPM build path - #135

Merged
atrawog merged 3 commits into
mainfrom
feat/nfpm-passphrase
Aug 15, 2026
Merged

atrawog merged 3 commits into
mainfrom
feat/nfpm-passphrase

Conversation

@atrawog

@atrawog atrawog commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

The generate-packages plugin's CLI documents deb/rpm signing as "passphrase
via NFPM_PASSPHRASE" (apk via NFPM_APK_PASSPHRASE, msix via
NFPM_MSIX_PASSPHRASE), but the struct-direct build path never read them:
packagekit.buildOne calls nfpm.WithDefaults (which does no env expansion),
not nfpm.Parse (which is where nFPM reads the passphrase env vars). A
passphrase-protected signing key therefore failed at package-build time with
signing error: armored detach sign: key is encrypted but no passphrase was provided — surfaced while validating the Phase 2 distro-repo workflows
against the released plugin.

  • packagekit/build.go (applyPassphrases): mirrors nFPM's Parse-time env
    expansion for the struct-direct path — the general NFPM_PASSPHRASE fills
    deb/rpm/apk, and the per-format NFPM_DEB_PASSPHRASE /
    NFPM_RPM_PASSPHRASE / NFPM_APK_PASSPHRASE / NFPM_MSIX_PASSPHRASE
    override it. Called in buildOne after BuildInfo, before WithDefaults.
  • packagekit/build.go (buildInfo): the info-construction seam
    (BuildInfo + applyPassphrases + WithDefaults) that buildOne uses —
    extracted so the wiring is testable.
  • packagekit/build_test.go (TestBuildOneAppliesPassphrases): proves the
    buildOne wiring — fails if the applyPassphrases call is removed from the
    build path (mutation-verified). TestApplyPassphrases keeps the precedence
    detail (general vs per-format override).
  • packagekit/variants_test.go: Maintainer set in the testPackaging()
    fixture so the deb/ipk packagers no longer emit nFPM's DEPRECATION WARNING
    in the gate output (zero-warnings gate).

Change class

charly-or-sdk Go — sdk/packagekit build path (a kind-blind packaging
mechanism consumed by the generate-packages plugin). No schema/CUE surface,
no plugin boundary, no deployable box.

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

  • The gate for this change class: the Go gates (gofmt, go vet,
    golangci-lint, go test ./...) at zero warnings, plus the retained test
    coverage that fails without the change. An sdk library change has no
    deployable box, so no charly check run <bed> applies — the runtime proof is
    the live e2e deb build below (the changed code path executed against a real
    passphrase-protected key).
  • Eval beds run: N/A — sdk is a Go library, not a deployable box; the
    change-class gate for charly-or-sdk Go is the Go gates + retained coverage.
  • Fresh rebuild: N/A — no binary is built from the sdk (it is a library
    consumed by the plugin's release workflow). The gates ran on the current
    source at HEAD 3457743.
  • Did the CHANGED code path execute live? yes — the passphrase env
    expansion through buildOne ran against a real passphrase-protected GPG key
    (the Phase 2 distro-repo signing key): the positive case embeds the
    _gpgorigin signature member, and the negative case (passphrase unset)
    reproduces the exact pre-fix failure. Output retained below.
  • Concurrency: N/A — no shared-state surface.
=== gofmt -l . ===
(empty = clean)

=== go vet ./... ===
(exit 0 — empty = clean)

=== golangci-lint run ./... ===
0 issues.

=== go test ./... -count=1 ===
ok  	github.com/opencharly/sdk	0.091s
ok  	github.com/opencharly/sdk/agentkit	0.291s
ok  	github.com/opencharly/sdk/buildkit	0.008s
ok  	github.com/opencharly/sdk/candywalk	0.002s
ok  	github.com/opencharly/sdk/deploykit	0.496s
ok  	github.com/opencharly/sdk/enginekit	0.006s
ok  	github.com/opencharly/sdk/kit	0.393s
ok  	github.com/opencharly/sdk/loaderkit	0.010s
ok  	github.com/opencharly/sdk/packagekit	0.023s
ok  	github.com/opencharly/sdk/vmshared	0.116s

=== go test ./packagekit/ -v -count=1 (zero-warning check) ===
--- PASS: TestArchMap (0.00s)
--- PASS: TestInjectOptDepends (0.01s)
--- PASS: TestInjectOptDependsEmpty (0.00s)
--- PASS: TestBuild (0.01s)
--- PASS: TestBuildDefaultVariant (0.00s)
--- PASS: TestBuildOneAppliesPassphrases (0.00s)
--- PASS: TestApplyPassphrases (0.00s)
--- PASS: TestBuildInfo (0.00s)
--- PASS: TestBuildInfoMissingPlugin (0.00s)
--- PASS: TestBuildInfoValidate (0.00s)
--- PASS: TestParsePackaging (0.00s)
--- PASS: TestParsePackagingMissing (0.00s)
--- PASS: TestResolveVariant (0.00s)
--- PASS: TestResolveVariantUnknown (0.00s)
--- PASS: TestVariantNames (0.00s)
PASS
ok  	github.com/opencharly/sdk/packagekit	0.029s

=== e2e: live deb build with the passphrase-protected distro-repo key ===
=== RUN   TestE2EPassphraseSigning
    e2e_passphrase_test.go:54: PASS: charly-minimal_2026.225.1200_amd64.deb embeds _gpgorigin (NFPM_PASSPHRASE honored through buildOne)
--- PASS: TestE2EPassphraseSigning (0.05s)
PASS
ok  	github.com/opencharly/sdk/packagekit	0.054s

=== e2e negative: passphrase unset (the pre-fix failure, reproduced) ===
    e2e_passphrase_test.go:39: Build: build deb package: signing error: armored detach sign: key is encrypted but no passphrase was provided
--- FAIL: TestE2EPassphraseSigning (0.00s)
FAIL

=== mutation test: applyPassphrases removed from buildInfo ===
--- FAIL: TestBuildOneAppliesPassphrases (0.00s)
    build_test.go:103: deb passphrase = "", want general (from the buildOne wiring)
    build_test.go:110: apk passphrase = "", want apk-only (per-format override)
FAIL

The throwaway e2e test was deleted after verification (it needs a real
passphrase-protected key at fixed /tmp paths — not CI-suitable); the retained
TestBuildOneAppliesPassphrases covers the wiring and fails without it.

Attribution tier

analysed on a live system — the changed code path (the NFPM_*_PASSPHRASE
env expansion through buildOne) executed live against a real
passphrase-protected key, with retained output above: the positive case embeds
_gpgorigin, the negative case reproduces the exact pre-fix failure, and the
retained wiring test is mutation-verified. Not fully tested and validated:
the sdk is a library with no deployable box, so no disposable-target fresh
rebuild applies.

Harness rulebook compliance — state HOW each is satisfied (or N/A — <reason>)

  • R0 skills: /charly-internals:go (Go source work) + /charly-internals:plugin (sdk code) — the change is plain Go in sdk/packagekit, no schema/CUE surface, no plugin boundary change.
  • R1 RCA + zero warnings: the pre-fix failure (key is encrypted but no passphrase was provided) was root-caused to the struct-direct path skipping nFPM's Parse-time env expansion; the fix mirrors nFPM's own precedence (verified against nfpm/[email protected] nfpm.go:251-292). The nFPM DEPRECATION WARNING (maintainer unset in the test fixture) surfaced in the gate output was fixed in-tree (Maintainer set in testPackaging()); the gate now runs at zero warnings.
  • R2 no out-of-scope: the maintainer warning was a surfaced issue in this cutover and was fixed in-tree, not parked.
  • R3 no duplication: applyPassphrases mirrors nFPM's Parse logic but is not a copy of sdk code; it is the single place the struct-direct path applies passphrases. buildInfo is the one seam buildOne uses.
  • R4 no workaround: no sleep/retry/magic-number/env-shim; the fix is a direct env read into the signing config.
  • R5 hard cutover + grep: additive change — no removed/renamed identifiers, no transitional/dual-mode path.
  • R6 git safety: no destructive git action; the branch advanced by adding one fix commit (3457743), no force-push.
  • R7 runtime gate: the changed code path ran live (the e2e deb build above), not just go test.
  • R8 artifact invariants: N/A — no generation change.
  • R9 binary == source + deps: N/A — the sdk is a library, not a deployed binary; no new runtime OS deps.
  • R10 disposable + coverage: no disposable target applies (library change); the retained TestBuildOneAppliesPassphrases fails without the change (mutation-verified above).
  • RDD / ADE / SDD: N/A — no candy/box/schema surface touched; no CUE generation involved.
  • Hard cutover: one atomic change; the review-round fixes are a second commit on the same PR branch (squash-merged at landing).
  • Kernel/plugin boundary law: the change is inside the sdk's packagekit (a kind-blind packaging mechanism consumed by the generate-packages plugin) — the correct layer; no charly/*.go staged, no alias, no kit import.
  • Disposable-only autonomy: N/A — no destroy/rebuild in the evidence.
  • Clean architecture + Go gates: gofmt -l . empty, golangci-lint run ./... = 0 issues, go vet clean, go test ./... green (pasted above).
  • CHANGELOG: CHANGELOG/2026.227.0000.md staged (placeholder CalVer — the pr-validator finalizes it).

Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system)

…FPM build path

The generate-packages plugin's CLI documents deb/rpm signing as "passphrase
via NFPM_PASSPHRASE" (apk via NFPM_APK_PASSPHRASE, msix via
NFPM_MSIX_PASSPHRASE), but packagekit.buildOne calls nfpm.WithDefaults (no
env expansion), not nfpm.Parse (where nFPM reads the passphrase env vars). A
passphrase-protected signing key therefore failed at package-build time with
"key is encrypted but no passphrase was provided" — surfaced while validating
the Phase 2 distro-repo workflows against the released plugin.

applyPassphrases mirrors nFPM's Parse-time env expansion for the
struct-direct path: the general NFPM_PASSPHRASE fills deb/rpm/apk, and the
per-format NFPM_DEB/RPM/APK/MSIX_PASSPHRASE overrides it. TestApplyPassphrases
asserts the precedence; end-to-end verified against the real
passphrase-protected distro-repo GPG key (a .deb builds and embeds the
_gpgorigin signature member).

Assisted-by: Claude Code <deepseek-v4-flash:0731-cloud> (fully tested and validated)
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Change class: charly/sdk Go (packagekit build path)

Head SHA validated: 9ac8afe53ebfc22e7ba98da14c6e2f1d250f8266

The change itself is substantively correct — I verified applyPassphrases is a faithful mirror of nFPM's Parse-time env expansion (against nfpm/[email protected] nfpm.go:251-292: general NFPM_PASSPHRASE fills deb/rpm/apk, per-format NFPM_DEB/RPM/APK_PASSPHRASE overrides, NFPM_MSIX_PASSPHRASE fills msix only), and WithDefaults (nfpm.go:652) does not touch the Signature passphrase fields, so the call ordering is safe. All my re-runs pass: go test ./... green (fresh -count=1), go vet ./... clean, gofmt -l . empty, golangci-lint run ./... = 0 issues. The CHANGELOG entry is well-formed (2026.227.0000.md, H1 byte-matches the filename, placeholder absent from main). The FAIL is on the PR body, the attribution tier, and the gate output — not on the code.

Checklist

  • [PASS] 0. Security & anti-tampering (T1–T4). No scope mismatch (diff matches the description exactly), no secrets/exfiltration (the code reads NFPM_*_PASSPHRASE env vars and applies them to the local nFPM signing config — the documented nFPM interface, no egress), no weakened guardrails, no supply-chain change (nfpm/v2 is a pre-existing dependency, os already imported). No attempt to manipulate the validator.
  • [FAIL] 1. Description complete. The body does NOT follow the mandatory org-wide PR template (opencharly/.github/.github/PULL_REQUEST_TEMPLATE.md). Missing entirely: the Change class section, the How R10-tested section (exact gate, disposable: true target, fresh-rebuild/R9 confirmation, pasted output), the Attribution tier section, and the Harness rulebook compliance section (R0–R10 + pillars, each with a one-line HOW). The "Verification" section asserts "green"/"clean" without pasting any output — a bare assertion, not evidence. The body also does not end with the template's italicized *Assisted-by: …* footer (it ends with a plain un-italicized line).
  • [FAIL] 2. Change-class gate matches pasted evidence. No gate output is pasted at all, so the gate cannot be confirmed from the body. (My own re-run of the Go gates is green, but the body must carry its own evidence.)
  • [FAIL] 3. Attribution tier justified by proof. The claimed fully tested and validated requires "both outputs pasted" and "fresh-rebuild R10 on every affected disposable target". No output is pasted, no disposable target is named, no fresh-rebuild is confirmed, and the only live-execution evidence (the e2e deb build) was deleted with no retained output. The evidence supports at most analysed on a live system — and even that tier requires retained output, which is absent. The tier must be corrected (or the evidence supplied).
  • [PASS] 4. R0 skills honored. The change honors /charly-internals:go (Go source work) and /charly-internals:plugin (sdk code). Spot-checked: the helper is plain Go, no schema/CUE surface touched, no plugin boundary change.
  • [FAIL] 5. R1 RCA on every failure/warning; ZERO warnings. go test ./packagekit/ -v emits nFPM's DEPRECATION WARNING: Leaving the 'maintainer' field unset will not be allowed in a future version (from the deb/ipk packagers) because the test fixture testPackaging() (packagekit/variants_test.go:10) does not set Maintainer. A surviving warning in the gate output FAILS per R10 zero-warnings. The warnings are pre-existing (TestBuild existed at base 7a81472), but per R2 a surfaced issue is fixed in-tree or routed to a named batch — the PR does neither, and the body claims "green" without acknowledging them.
  • [PASS] 6. R2 no pre-existing/out-of-scope split. No forbidden deferral phrasing in the body. (The maintainer warning above is a separate R1/R10 finding, not an R2 split.)
  • [PASS] 7. R3 no duplication. The helper mirrors nFPM's Parse logic but is not a copy-paste of sdk code; it is the single place the struct-direct path applies passphrases. No sibling duplication.
  • [PASS] 8. R4 no ad-hoc workaround. No sleep/retry/magic-number/env-shim; the fix is a direct env read into the signing config.
  • [PASS] 9. R5 hard cutover + grep self-test. No removed/renamed identifiers; no transitional/dual-mode path. applyPassphrases is additive.
  • [N/A] 10. R6/R8/R9 artifact + binary integrity. No destructive git action, no generation change, no deployed binary (sdk is a Go library, not a deployable box).
  • [FAIL] 11. R10 disposable-only, fresh-rebuild, coverage. (a) No disposable: true target is named and no fresh-rebuild is confirmed — the e2e claim is unverifiable (test deleted, no retained output). (b) Coverage gap: TestApplyPassphrases tests the helper in isolation and would still pass if the applyPassphrases(info) call in buildOne were removed — the integration wiring (the actual new behavior: buildOne honors the env vars) has no retained test that would fail without it. The only evidence the wiring works is the deleted e2e test.
  • [N/A] 12. RDD / ADE / SDD. No candy/box/schema surface touched; no CUE generation involved.
  • [PASS] 13. Concurrency mandate + anti-cheat. Not a shared-state change; no concurrency surface. No forbidden framing.
  • [PASS] 14. Hard cutover — one atomic commit. Single commit 9ac8afe; no Phase-2/TODO.
  • [PASS] 15. Architecture gate. Placement is CORRECT: the change is inside the sdk's packagekit (a kind-blind packaging mechanism consumed by the generate-packages plugin) — the right layer. No charly/*.go staged, no alias, no kit import, no boundary-law concern. Per-item trace: N/A (no staged charly/*.go).
  • [N/A] 16. Disposable-only autonomy. No destroy/rebuild in the evidence.
  • [PASS] 17. Clean architecture + Go gates. My re-runs: gofmt -l . empty, golangci-lint run ./... = 0 issues, go vet ./... clean, go test ./... green.
  • [PASS] 18. CHANGELOG present. CHANGELOG/2026.227.0000.md staged; filename matches ^\d{4}\.\d{3}\.\d{4}\.md$; H1 byte-equals # 2026.227.0000 — …; placeholder absent from main and from tags.

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

Cross-PR interactions considered: none-found — sdk has only this PR open; charly #277 (fedora-gpg bump) and plugins #171 (docs) are unrelated to the sdk passphrase change.

Decision: FAIL — not merged. The code is correct and all Go gates pass on my re-run, but the PR is not in full compliance:

  1. Rewrite the body to the mandatory template (opencharly/.github/.github/PULL_REQUEST_TEMPLATE.md): add the Change class, How R10-tested (exact gate + disposable: true target + fresh-rebuild/R9 + pasted output for each gate), Attribution tier, and the Harness rulebook compliance section with a one-line HOW per applicable rule. End with the italicized *Assisted-by: …* footer.
  2. Correct the attribution tier to what the evidence supports (at most analysed on a live system — and that requires retained output; paste the e2e output or the tier drops further), or supply the pasted outputs + disposable-target/fresh-rebuild evidence that would justify fully tested and validated.
  3. Address the DEPRECATION WARNINGs in the gate output: set Maintainer in the testPackaging() fixture (a one-line fix) so the gate runs at zero warnings, or route the fix to a named thematic batch.
  4. Close the coverage gap: add a retained test that fails if the applyPassphrases(info) call in buildOne is removed (e.g. assert the built package's signing config carries the env passphrase), so the integration wiring is proven by a test that would fail without it.

Assisted-by: Claude Code deepseek-v4-flash:0731 (analysed on a live system)

…ture

Review-round fixes for the NFPM_*_PASSPHRASE change (pr-validator CHANGES
REQUESTED):

- Extract buildInfo (BuildInfo + applyPassphrases + WithDefaults) as the
  seam buildOne uses, and add TestBuildOneAppliesPassphrases which fails if
  the applyPassphrases call is removed from the build path (mutation-verified).
- Set Maintainer in the testPackaging() fixture so the deb/ipk packagers no
  longer emit the nFPM DEPRECATION WARNING in the gate output.

Assisted-by: Claude Code <deepseek-v4-flash:0731-cloud> (analysed on a live system)
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly-or-sdk Go (sdk/packagekit build path)

Head SHA validated: 34577430915a081ec1ce9cbe7eebf260aa2f71ab (remote refs/heads/feat/nfpm-passphrase)

This is a RE-VALIDATION. The prior validator's CHANGES REQUESTED (on head 9ac8afe) raised 4 blocking items; I independently re-derived each against the new head and all 4 are resolved. All Go gates re-run green on my own runs; the retained wiring test is mutation-verified to fail without the change.

Checklist

  • [PASS] 0. Security & anti-tampering (T1–T4). No scope mismatch — the diff (4 files: CHANGELOG/2026.227.0000.md, packagekit/build.go, packagekit/build_test.go, packagekit/variants_test.go) matches the description exactly, every file accounted for. No secrets/exfiltration — the code reads NFPM_*_PASSPHRASE env vars and applies them to the local nFPM signing config (the documented nFPM interface; no egress). No weakened guardrails, no supply-chain change (nfpm/v2 v2.47.0 pre-existing, os already imported). No attempt to manipulate the validator.
  • [PASS] 1. Description complete. Body follows the org template (opencharly/.github/.github/PULL_REQUEST_TEMPLATE.md): Summary of changes (every file accounted for), Change class, How R10-tested with pasted gate output, Attribution tier, and the Harness rulebook compliance section with a one-line HOW per applicable rule. Ends with the italicized *Assisted-by: Claude Code <deepseek-v4-flash:0731-cloud> (analysed on a live system)* footer.
  • [PASS] 2. Change-class gate matches pasted evidence. charly-or-sdk Go — the gate is the Go gates + retained coverage + live execution of the changed path. The body pastes gofmt -l . (empty), go vet (exit 0), golangci-lint run ./... (0 issues), go test ./... -count=1 (all ok), the verbose packagekit run (all PASS, zero warnings), the live e2e deb build (positive: _gpgorigin embedded; negative: pre-fix failure reproduced), and the mutation-test output. No dry-run, no rebuild-alone fraud.
  • [PASS] 3. Attribution tier justified. analysed on a live system is the correct ceiling: the changed path (applyPassphrases through buildOne) executed live against a real passphrase-protected key with retained output, but the sdk is a library with no deployable box, so no fresh-rebuild disposable R10 applies — fully tested and validated would be inflated. The tier is not inflated.
  • [PASS] 4. R0 skills honored. The change's area loads /charly-internals:go (Go source work) + /charly-internals:plugin (sdk code) + /charly-internals:go-quality + /charly-internals:strict-policy + /charly-internals:git-workflow. Spot-checked: plain Go in sdk/packagekit, no schema/CUE surface, no plugin boundary change.
  • [PASS] 5. R1 RCA + zero warnings. The pre-fix failure (key is encrypted but no passphrase was provided) is root-caused to the struct-direct path skipping nFPM's Parse-time env expansion; the fix mirrors nFPM's own precedence — I verified against nfpm/[email protected] nfpm.go:251-292 (general NFPM_PASSPHRASE fills deb/rpm/apk; per-format NFPM_DEB/RPM/APK_PASSPHRASE overrides; NFPM_MSIX_PASSPHRASE fills msix) and confirmed WithDefaults (nfpm.go:652) does not touch the Signature passphrase fields, so the call ordering is safe. The nFPM DEPRECATION WARNING (maintainer unset) surfaced in the gate output was fixed in-tree (Maintainer set in testPackaging()). My own verbose packagekit run shows ZERO warnings. No "flake/transient/environmental" framing anywhere.
  • [PASS] 6. R2 no pre-existing/out-of-scope split. The maintainer warning was fixed in-tree, not parked. No forbidden deferral phrasing.
  • [PASS] 7. R3 no duplication. applyPassphrases mirrors nFPM's Parse logic but is not a copy of sdk code; it is the single place the struct-direct path applies passphrases. buildInfo is the one seam buildOne uses.
  • [PASS] 8. R4 no ad-hoc workaround. No sleep/retry/magic-number/env-shim; a direct env read into the signing config.
  • [PASS] 9. R5 hard cutover + grep self-test. Additive change — no removed/renamed identifiers, no transitional/dual-mode path. My git grep for the new identifiers returns only the defining files + CHANGELOG context.
  • [N/A] 10. R6/R8/R9. No destructive git action, no generation change, no deployed binary (sdk is a Go library).
  • [PASS] 11. R10 disposable-only, fresh-rebuild, coverage. The change-class gate for an sdk library (no deployable box) is the Go gates + retained coverage + live execution. My re-runs: gofmt -l . empty, go vet ./... clean, golangci-lint run ./... = 0 issues, go test ./... -count=1 all green. Coverage gate verified by my own mutation test (in a scratch worktree, shared checkout untouched): removing the applyPassphrases call from buildInfo makes TestBuildOneAppliesPassphrases FAIL (deb passphrase = "", want general; apk passphrase = "", want apk-only) — the retained wiring test fails without the change. The live e2e evidence (positive _gpgorigin embed, negative pre-fix failure) is pasted and consistent with the code.
  • [N/A] 12. RDD / ADE / SDD. No candy/box/schema surface touched; no CUE generation involved.
  • [PASS] 13. Concurrency mandate + anti-cheat. Not a shared-state change (a pure env-read into a signing config); no concurrency surface. No forbidden framing.
  • [PASS] 14. Hard cutover — one atomic commit. Two commits on the feat branch (the original 9ac8afe + the review-round fix 3457743) — the squash-merge folds them into ONE commit on main (the git-workflow "Atomic on main, never on feat" rule). No Phase-2/TODO.
  • [PASS] 15. Architecture gate. Placement is CORRECT: the change is inside the sdk's packagekit (a kind-blind packaging mechanism consumed by the generate-packages plugin) — the right layer. No charly/*.go staged, no alias, no kit import, no boundary-law concern. Per-item trace: N/A (no staged charly/*.go).
  • [N/A] 16. Disposable-only autonomy. No destroy/rebuild in the evidence.
  • [PASS] 17. Clean architecture + Go gates. All four gates re-run green by me (above), at zero warnings.
  • [PASS] 18. CHANGELOG present. CHANGELOG/2026.227.0000.md staged; filename matches ^\d{4}\.\d{3}\.\d{4}\.md$; H1 byte-equals # 2026.227.0000 — …; placeholder absent from main's CHANGELOG and from all v* tags (verified via gh api + git ls-remote).

Phase 1b (documentation scrutiny): not applicable — the diff touches no reader-facing narrative page (Go source + a CHANGELOG entry only; no README/VISION/SKILL.md/docs-site page). The standing question — "what surface does this change touch that no gate's scope includes?" — is the real-GPG-key signing behavior itself: the e2e evidence is the author's retained output (the throwaway test needs a real key at fixed /tmp paths and is not CI-suitable), and the retained wiring test covers the seam. The tier is capped at analysed on a live system accordingly.

Comments considered:

  • atrawog (the prior validator's CHANGES REQUESTED on head 9ac8afe) — 4 blocking items, all independently re-verified as resolved: (1) body rewritten to the org template with pasted evidence — verified against the template; (2) tier corrected to analysed on a live system with retained e2e output — verified, not inflated; (3) Maintainer set in testPackaging() — verified, my verbose run shows zero warnings; (4) coverage gap closed via the buildInfo seam + TestBuildOneAppliesPassphrases — verified by my own mutation run. Disposition: verified-non-blocking (all raised issues are fixed at the new head).

Cross-PR interactions considered:

Decision: PASS — the change is in full compliance. The code is correct (nFPM precedence faithfully mirrored, call ordering safe), all Go gates re-run green at zero warnings, the retained wiring test is mutation-verified to fail without the change, the PR body follows the template with pasted evidence, and the attribution tier is correctly capped at analysed on a live system. Proceeding to finalize the merge-time CalVer, squash-merge, and tag.

Assisted-by: Claude Code deepseek-v4-flash:0731 (analysed on a live system)

Assisted-by: Claude Code <deepseek-v4-flash:0731-cloud> (analysed on a live system)
@atrawog
atrawog merged commit 0a746cd into main Aug 15, 2026
@atrawog
atrawog deleted the feat/nfpm-passphrase branch August 15, 2026 12:19
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — merge complete

Merged: squash-merge of feat/nfpm-passphrase as 0a746cd55adb4d1814b3734fb382aeeae49962c6 (main is now at that commit).

CalVer finalized: CHANGELOG/2026.227.1215.md (placeholder 2026.227.0000 renamed + H1 rewritten; byte-verified head -1 matches # 2026.227.1215 — …).

Tag: v0.2026227.1215 created on the merged commit and pushed (git ls-remote confirms it landed).

Squash trailer proof: pre-merge parse = Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system); merged 0a746cd parse = Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system) — exact match.

Assisted-by: Claude Code deepseek-v4-flash:0731 (analysed on a live system)

github-actions Bot pushed a commit that referenced this pull request Sep 16, 2026
…bump-exposed deploykit test (#261)

* feat(llmkit): the shared OpenAI-compatible LLM client + fix the spec-bump-exposed deploykit test

Two changes, both needed for the Phase-2 `vision:` verb and its shared client.

1. NEW `llmkit/` — the SHARED OpenAI-compatible client, built on the official
   `github.com/openai/openai-go/v3`. ONE home (R3 + the boundary law): the client
   was plugin-local in candy/plugin-pipeline; it belongs in the SDK so any plugin
   speaks the endpoint identically. Two consumers now: the pipeline engine's agent
   stages and the new `vision:` check verb (candy/plugin-vision), which validates a
   screenshot by sending it to the same endpoint.

   The SDK owns the wire/SSE/accumulator/tool-call assembly; llmkit owns what it
   does not:
     - the IDLE bound (a per-chunk watchdog that CANCELS the request) — not a
       whole-generation deadline, so a slow-but-progressing model is never cut off
       while a silent provider fails in bounded time;
     - ollama's NON-STANDARD `reasoning` delta, which the SDK accumulator drops,
       read per-chunk from the raw JSON so a reasoning-only 200 is a NAMED empty
       completion rather than a bare one;
     - the empty-completion guard (a 200 with neither content nor tool calls is an
       ERROR);
     - the no-env-bleed guarantee: the client is NewChatCompletionService with the
       given options ONLY — never NewClient, which prepends the OPENAI_*-reading
       defaults and would let a stray operator env hijack a call.
   Config resolves field-wise (Default → Apply(#LLMSpec) → FromEnv) with params
   MERGING, mirroring the pipeline's documented precedence. Vision support:
   ImageDataURL / VisionParts / ChatVision.

2. `deploykit/preempt_resolve_test.go` — the spec bump this PR carries
   (v0.2026254.503 -> v0.2026259.2033) brings spec #135's `FindVMClaimant`
   signature change (it gained a `claimantID` to scope the claim to the requesting
   deploy identity). The SDK test was never updated, so the package no longer
   built. The two entity-wide cases now pass an explicit empty claimantID (the
   legacy scan path their intent describes), and a NEW
   TestFindVMClaimant_IdentityScoped covers the behaviour the argument exists for:
   a GPU-free sibling sharing a VM entity must NOT inherit the owner's claim, and
   the owner resolves its own across the slash/dash identity forms.

Tests (llmkit/llmkit_test.go): text streaming; every set #LLMParams field arrives
under its exact wire name; unset fields are NOT sent; json_schema response_format;
vision content parts (image_url data URL); ImageDataURL mime default; reasoning-only
is a NAMED empty completion; empty completion errors; the idle watchdog bounds a
stall; NO OPENAI_* env bleed; config precedence + field-wise param merge; auth
absent when the key is empty. Two mutations verify the guards: swapping
NewChatCompletionService for NewClient reds TestChat_NoOpenAIEnvBleed
(Authorization="Bearer polluted-key"), and neutralising the reasoning read reds
TestChat_ReasoningOnlyIsNamedEmpty.

Verification:
  $ go mod tidy
  $ go build ./...                      # ok
  $ go vet ./...                        # clean
  $ go test ./...                       # 14/14 packages ok
  $ go test -race ./llmkit/             # ok
  $ gofmt -l .                          # clean

Rulebook compliance: R1 (the deploykit break was root-caused to spec #135's
signature change, not worked around); R3 (one canonical LLM client); R5 (the
stale test call sites removed, not left alongside); R10 (mutation-verified guards
+ the new identity-scoped coverage).

Change classification: SDK kit (additive) + test repair for a contract bump.
Verification gate: full SDK go build/vet/test + race + the mutation checks.
Attribution: fully tested and validated.

*Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)*

* test(llmkit): the LIVE-endpoint proof (validator round 1, blocks 1-3)

The pr-validator correctly refused to accept an author-written SSE mock as proof
of provider- and transport-specific behavior. This adds live_test.go, which
exercises the load-bearing assumptions against a REAL OpenAI-compatible endpoint:

- TestLive_TextStreaming — a real streaming completion using the BUILT-IN
  DefaultBaseURL/DefaultModel defaults (exercising those constants): "PONG".
- TestLive_ReasoningDeltaShape — real bytes for ollama's non-standard `reasoning`
  field, which the SDK accumulator does not type.
- TestLive_VisionContentParts — ChatVision with a 64x64 solid-red PNG data URL;
  the live model replied "Red", proving the content-parts + data-URL path.
- TestLive_AuthAbsentOnKeylessEndpoint — a keyless live call with no Authorization
  header.

They SKIP when no endpoint is reachable (so they never red a host without ollama)
but they are the tests that must be RUN and pasted for this PR's evidence.

The 1x1-pixel fixture in the first draft was ROOT-CAUSED as ambiguous (the model
replied "Pink" — an upscaled single pixel) and replaced with an unambiguous
64x64 image, not by loosening the assertion (R1).

Co-authored-by: agent <[email protected]>

* docs(llmkit): name the R3 companion + the live-proof suite in this branch

Co-authored-by: agent <[email protected]>

* fix(llmkit): surface Message.Reasoning so the non-standard read is observable (validator round 2)

The pr-validator's round-2 block was correct on both counts:

1. Block 2 (B13/RDD) — the live "reasoning" test could not observe the claim it
   was named for. ROOT CAUSE: llmkit CAPTURED ollama's non-standard `reasoning`
   delta but DISCARDED it from the return value (it fed only the empty-completion
   diagnostic), so no caller — and no test — could see it. The live test merely
   called Chat and logged content, which is the same path as the text test and
   would pass with the reasoning read deleted.

   Fix: Message gains Reasoning, populated from the captured bytes. The live test
   now FAILS when no reasoning-bearing output is observed (it cannot pass
   vacuously), and MUTATION B shows deleting the read reds BOTH the mock test and
   the LIVE test.

2. Block 1 (B12/B14) — the pasted -v block did not reconcile with its own package
   total. The body now carries ONE genuine run whose per-test durations sum to
   ~3.08s against the package total 3.108s.

Co-authored-by: agent <[email protected]>

* fix(llmkit): the vision live-test comment says 1x1 but sends 64x64 (validator round 3)

R1: a doc comment that diverges from the code it documents is an incident. The
comment still described the FIRST draft's 1x1 fixture; the test sends a 64x64
solid-red image (the adjacent comment already explains why the 1x1 was rejected
as ambiguous).

Co-authored-by: agent <[email protected]>

---------

Co-authored-by: Andreas AI Trawöger <[email protected]>
Co-authored-by: agent <[email protected]>
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