Skip to content

bugfix(dagger): align ktx2/e2e CLI names with engine kebab-case (#240)#256

Merged
gerchowl merged 1 commit intodevfrom
bugfix/240-dagger-ktx2-naming
Apr 30, 2026
Merged

bugfix(dagger): align ktx2/e2e CLI names with engine kebab-case (#240)#256
gerchowl merged 1 commit intodevfrom
bugfix/240-dagger-ktx2-naming

Conversation

@gerchowl
Copy link
Copy Markdown
Contributor

Summary

Fixes #240. dagger call derive-ktx2 was failing in .github/workflows/derive.yml with Error: unknown command "derive-ktx2". Root cause: dagger's Go-side CLI splits letter↔digit boundaries when converting camelCase to kebab, so the Python @function async def derive_ktx2 is exposed as derive-ktx-2 (with split digit), not derive-ktx2.

I confirmed empirically by running dagger functions -m .dagger on engine v0.20.6:

derive               Per-file derive: resize an existing per-file tier into a smaller one (#204).
derive-ktx-2         Per-file derive: transcode an existing per-file PNG tier to KTX2 (#204).
...
test-e-2-e           Run the live MAT_VIS_E2E=1 round-trip suite against mat-vis-tst (#193).

The same drift was hiding in e2e.yml (test-e2e → actually test-e-2-e) — fixed in the same commit since it's the identical root cause.

Option chosen

Option B from the issue: keep the Python @function names as-is, update the workflow CLI invocations + header comments to match what dagger actually exposes. Rationale:

  • Renaming derive_ktx2derive_ktx_2 (Option A) is uglier in Python with no upside.
  • Dagger's @function(name=...) override is passed straight through to the engine's GraphQL surface, then re-kebab-converted by the same Go rule — so it can't produce derive-ktx2 either. Option C isn't actually available without engine-level support.
  • Option B is a 2-character workflow edit + a contract test that prevents future drift.

Changes

  • .github/workflows/derive.yml — ternary now emits 'derive-ktx-2'; header comment + new #240 note documents the conversion rule.
  • .github/workflows/e2e.yml — step now invokes test-e-2-e; same #240 doc note.
  • .dagger/src/mat_vis_ci/main.py — module docstring updated to the canonical kebab names; added a docstring note on derive_ktx2 explaining the engine's CLI surface.
  • tests/test_dagger_function_names.py (new) — contract test that parses every @function from main.py, derives the kebab CLI name with the same rule the engine uses, and asserts both workflows reference the canonical names. Future renames that desync from the workflow trip a unit test instead of a CI dispatch.

The kebab heuristic in the test was cross-checked against the live dagger functions output for all 22 currently-decorated @function methods — every prediction matches.

Test plan

  • uv run pytest tests/test_dagger_function_names.py tests/test_dagger_bake_argv.py (17 passed)
  • python3 scripts/check-dagger-shell-safety.py (passed)
  • ruff check tests/test_dagger_function_names.py (passed)
  • Pre-commit / pre-push hooks (yamllint, ruff format, typos, dagger-shell-safety) all green
  • Smoke dispatch on gerchowl/mat-vis-tst@v0.0.0-phase7-smoke (next step — will paste run URL into this PR once it lands)

dagger's Go-side CLI converts the camelCase function name from the
Python SDK to kebab-case, splitting on every letter↔digit and
lower→upper boundary. So `derive_ktx2` → `deriveKtx2` →
`derive-ktx-2` (not `derive-ktx2`), and `test_e2e` → `testE2E` →
`test-e-2-e` (not `test-e2e`). The derive.yml ternary and the e2e.yml
step were both invoking the un-split form and failing with
`unknown command "derive-ktx2"` / `"test-e2e"`.

Option B from the issue: keep the Python @function names as-is and
update the workflows + header comments to match what dagger actually
exposes. A new contract test (tests/test_dagger_function_names.py)
parses every @function in main.py, derives the kebab CLI name with
the same rule the engine uses, and asserts both workflows reference
the canonical names. Future @function renames that drift from the
workflow break in unit tests instead of CI dispatches.
@github-actions github-actions Bot added area:testing Test infrastructure, BATS, pytest area:baker Baker pipeline, Dagger, data fetchers labels Apr 30, 2026
@gerchowl
Copy link
Copy Markdown
Contributor Author

Smoke dispatch

Triggered: https://github.com/MorePET/mat-vis/actions/runs/25175351995

Load-bearing verification already in: the Derive (per-file substrate, ADR-0012) step — which invokes dagger call derive-ktx-2 ... — reached in_progress (it would have errored fast with the previous unknown command failure mode if the kebab name were still wrong). The dagger CLI accepted the new kebab name and is now executing the actual KTX2 transcode.

End-to-end smoke (full transcode of all 3 sources at 1k → ktx2-1k) is still running; will update with conclusion.

@gerchowl gerchowl merged commit 3a97b22 into dev Apr 30, 2026
8 checks passed
@gerchowl gerchowl deleted the bugfix/240-dagger-ktx2-naming branch April 30, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:baker Baker pipeline, Dagger, data fetchers area:testing Test infrastructure, BATS, pytest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(dagger): derive-ktx2 CLI command not exposed despite @function decoration

1 participant