Skip to content

refactor(media): land post-transcode validation via sdk.LandArtifact (G-8/G-9) - #4

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/land-artifact
Sep 11, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/land-artifact

Conversation

@atrawog

@atrawog atrawog commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrate plugin-media's artifact handling to the shared sdk.LandArtifact write-then-validate tail (approved plan G-8/G-9).

  • Bump github.com/opencharly/sdk to v0.2026254.439 (the tag of sdk#249, which landed the LandArtifact host leg). go mod tidy also resolves spec to v0.2026250.2036 (MVS requirement of the new sdk — same PR, build-consistent).
  • sdk.VerbVerdict now runs the shared exit/stdout/stderr matchers only (artifact=false); the artifact validators no longer run inside the verdict pipeline.
  • The post-transcode write-then-validate tail is now the SAME sdk.LandArtifact(ctx, nil, "", out, &val) call every artifact-producing plugin uses — host leg (nil executor + blank venue path): nothing is pulled or written, sdk.RunArtifactValidators ALWAYS runs on the existing host path (artifact_min_bytes / min_dimensions / min_cast_events / contains_text). Validator failure returns the same transcode: transcode: <err> wire shape as before.
  • The plugin's own ffmpeg pipeline (runTranscode) is unchanged; the source-frame artifact_not_uniform check (RDD-3, pre-encode on the MJPEG) keeps its plugin-local binding and stays stripped from the copy handed to the shared validators.
  • No direct RunArtifactValidators call existed in the plugin (validation rode inside VerbVerdict's artifact=true leg); that leg is what this removes.

How tested

Host: ffmpeg/ffprobe present (/usr/bin/ffmpeg, ffmpeg version n9.0.1), so every ffmpeg-dependent test RAN live — none skipped.

$ gofmt -l .
FORMAT_OK
$ go build ./...
$ go test ./...   # after refactor
ok  	github.com/opencharly/plugin-media/candy/plugin-media	0.465s
?   	github.com/opencharly/plugin-media/candy/plugin-media/cmd/serve	[no test files]
?   	github.com/opencharly/plugin-media/candy/plugin-media/params	[no test files]

go test -v key results (live ffmpeg execution, PASS — zero SKIP):

  • TestTranscodeToMp4 — PASS (real MJPEG → ffmpeg → valid MP4, ffprobe-verified; artifact_min_bytes=100 passes through the new LandArtifact tail)
  • TestTranscodeSharedMatcherSelfEvaluation/artifact_min_bytes_failure — PASS (fails via sdk.LandArtifact → RunArtifactValidators, message names "min_bytes")
  • TestTranscodeSharedMatcherSelfEvaluation (exit_status equal/mismatch, stderr matchers) — PASS (matchers-only VerbVerdict)
  • TestTranscodeUniformSourceFailsHonestly — PASS (source-frame not-uniform still fails honestly)
  • TestTranscodeOddHeightSource, TestTranscodeSourceResolution, TestTranscodeDefaultOutputPath — PASS

Full output of go test -v ./...: 29 tests/subtests PASS, ok github.com/opencharly/plugin-media/candy/plugin-media 0.403s.

Rulebook compliance

  • R1/RCA: no failures surfaced; behavior preserved by construction (validator ordering unchanged: matchers → validators → source not-uniform; failure wire shape identical).
  • R3 (no duplication): the artifact-validator implementation now lives in ONE place for every producer — sdk.LandArtifact → sdk.RunArtifactValidators. The transcode plugin is a host-side producer and calls the same tail as venue-side producers.
  • R4 (no workarounds): no sleeps/retries; the shared SDK path is the sanctioned API, not a hand-rolled validator loop.
  • R6 (git safety): branch feat/land-artifact off current origin/main (eb1ec55); no force-push, no main push; commit verified with git show --stat + clean git status.

Change classification

  • Change class: refactor (no user-visible behavior change; the post-transcode validation semantics are identical, only routed through the shared tail).
  • Verification gate: locally R7/R10 — full go build ./... + go test ./... passed on the final committed tree, with live ffmpeg exercising the changed path.
  • Attribution tier: fully tested and validated (go suite passed on the committed tree with live execution).

Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)

…(G-8/G-9)

Bump sdk to v0.2026254.439 (the LandArtifact host leg landed in sdk#249,
tag of sdk#249) and route the write-then-validate tail through the ONE
shared call every artifact-producing plugin uses: VerbVerdict now runs the
exit/stdout/stderr matchers only (artifact=false) and the artifact
validators (artifact_min_bytes etc.) ALWAYS run via
sdk.LandArtifact(ctx, nil, "", out, &val) on the existing host path. The
source-frame artifact_not_uniform check keeps its RDD-3 pre-encode binding
on the MJPEG source. go mod tidy also pulls spec v0.2026250.2036 (MVS
requirement of the new sdk).
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 2561f5f2e5c319d9385a0e8bda6701e2bb493e26 (branch: feat/land-artifact)

Security screen: PASS — no scope mismatch (diff = go.mod/go.sum/provider.go, all accounted for in body); no secrets/exfiltration; dependency bumps are to the org's own sdk/spec modules with plausible version pins; no guardrail weakening.

Checklist: All applicable rules PASS or NA.

  • A1/A2/A3: Body accounts for every diff item; gate matches code-change class (fresh go build + go test on committed tree, pasted output, live ffmpeg exercising the changed path); fully tested and validated tier justified — the changed sdk.LandArtifact tail executed live in TestTranscodeToMp4 and .../artifact_min_bytes_failure; *Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)* footer present in exact form.
  • R1/R2: no failures/warnings surfaced; no forbidden framing.
  • R3/R4: change removes duplication (validator impl now single-sourced in sdk.LandArtifact); no ad-hoc workarounds.
  • R5/B15: single atomic commit; artifact=true leg cleanly removed, no transitional/backcompat path left in diff.
  • R6/R10: git-status checked; fresh build at zero warnings; coverage proves the new path — artifact_min_bytes_failure would fail if the LandArtifact tail were removed (VerbVerdict now runs matchers-only).
  • B16 placement: CORRECT — capability moves OUT of the plugin into the shared SDK tail, advancing the plugin-host end-state; no new aliases, no new core kit imports.
  • B13/B17/B18: no schema/cue/proto changes (SDD N/A); no autonomous destroy/rebuild (disposable N/A); diff gofmt-clean, no lint-visible issues.
  • Comment intake: no comments on thread.

Verdict: PASS


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

View action run

@github-actions

Copy link
Copy Markdown

[step: review]

Review — PASS

Head SHA: 2561f5f2e5c319d9385a0e8bda6701e2bb493e26 (branch: feat/land-artifact)

Security screen: PASS — no scope mismatch (diff = go.mod/go.sum/provider.go, all accounted for in body); no secrets/exfiltration; dependency bumps are to the org's own sdk/spec modules with plausible version pins; no guardrail weakening.

Checklist: All applicable rules PASS or NA.

  • A1/A2/A3: Body accounts for every diff item; gate matches code-change class (fresh go build + go test on committed tree, pasted output, live ffmpeg exercising the changed path); fully tested and validated tier justified — the changed sdk.LandArtifact tail executed live in TestTranscodeToMp4 and .../artifact_min_bytes_failure; *Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)* footer present in exact form.
  • R1/R2: no failures/warnings surfaced; no forbidden framing.
  • R3/R4: change removes duplication (validator impl now single-sourced in sdk.LandArtifact); no ad-hoc workarounds.
  • R5/B15: single atomic commit; artifact=true leg cleanly removed, no transitional/backcompat path left in diff.
  • R6/R10: git-status checked; fresh build at zero warnings; coverage proves the new path — artifact_min_bytes_failure would fail if the LandArtifact tail were removed (VerbVerdict now runs matchers-only).
  • B16 placement: CORRECT — capability moves OUT of the plugin into the shared SDK tail, advancing the plugin-host end-state; no new aliases, no new core kit imports.
  • B13/B17/B18: no schema/cue/proto changes (SDD N/A); no autonomous destroy/rebuild (disposable N/A); diff gofmt-clean, no lint-visible issues.
  • Comment intake: no comments on thread.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot merged commit 3e21049 into main Sep 11, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 11, 2026
@aitrawog
aitrawog deleted the feat/land-artifact branch September 25, 2026 19:32
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