Skip to content

Correct SDK symbols and CLI commands against the API reference - #28

Merged
cosmicBboy merged 1 commit into
mainfrom
fix/api-reference-symbols
Jul 28, 2026
Merged

Correct SDK symbols and CLI commands against the API reference#28
cosmicBboy merged 1 commit into
mainfrom
fix/api-reference-symbols

Conversation

@cosmicBboy

Copy link
Copy Markdown
Collaborator

Follow-up to #25/#27. Audited every flyte.* symbol and flyte CLI command/option/arg used in the skills against the official SDK and CLI API references, cross-checked against the installed SDK. Found a batch of symbols/commands that don't exist or have the wrong shape — agents following them generate non-working code.

SDK symbols

Each corrected form was verified to import and instantiate against the SDK.

Skill Wrong Correct
optimize flyte.RetryPolicy(min_attempts=3) + retry_policy= @env.task(retries=flyte.RetryStrategy(count=3))
types flyte.TypeEngine.register flyte.types.TypeEngine.register
types from flyte.extend import TypeTransformer, DefaultMappingTypeTransformer from flyte.types import TypeTransformer (extend exports neither; DefaultMappingTypeTransformer doesn't exist)
app, ship, ml flyte.Image.from_image(...) ×14 flyte.Image.from_base(...)
app flyte.AppEndpoint("x") flyte.app.AppEndpoint(app_name="x") (kw-only)
app flyte.Parameter.mount(...) / .env_var(...) flyte.app.Parameter(name=..., mount=... / env_var=...) (those aren't factory methods — they're constructor kwargs)
app flyte.ScalingConfig(min_replicas=, max_replicas=, target_cpu_utilization=, idle_ttl=, scale_down_delay=) flyte.app.Scaling(replicas=(1, 10), scaledown_after=timedelta(minutes=10))
run flyte.abort(run) run.abort()
run flyte.logs(run) removed — no SDK equivalent; point to flyte get logs
run caching=flyte.CachingOptions(...) on with_runcontext removed — not a valid kwarg

CLI commands

The real tree is flyte <verb> <noun> (e.g. flyte get run), not flyte <noun> <verb>.

Skill Wrong Correct
run flyte run list / run get / run watch flyte get run [NAME]
run flyte run outputs / run download flyte get io RUN_NAME
run flyte logs (--no-system, --raw) flyte get logs (--filter-system; dropped nonexistent --raw)
run flyte abort <run> flyte abort run <run>
app flyte app get flyte get app
app flyte activate / flyte deactivate flyte update app <name> --activate / --deactivate
app flyte secret create flyte create secret
agent flyte trigger create <task> --cron flyte create trigger <task> <name> --schedule

Verification

  • Top-level and deeper-path flyte.* symbol audit across all 20 skills: clean.
  • Every corrected constructor instantiates against the installed SDK (RetryStrategy, Image.from_base, app.AppEndpoint, app.Parameter, app.Scaling, types.TypeEngine.register).
  • CLI corrections validated against the CLI reference's command/option tables.
  • Static-tier lint: 20/20 skills pass (all Python fences ast.parse).

Notes / not in scope

  • Deploy-skill hits like kubectl -n flyte logs are false positives (flyte is the k8s namespace), left as-is.
  • This pass targets symbol/command/option existence and shape. It does not re-derive every method-body contract (e.g. the custom TypeTransformer save/load interface, or the exact parameters= container shape for app envs) beyond making the referenced symbols correct — those would be a deeper semantic pass if desired.

🤖 Generated with Claude Code

Audited every flyte.* symbol and `flyte` CLI command/option/arg in the skills
against the official SDK and CLI API references (and the installed SDK). Fixes:

SDK symbols (verified: each corrected form imports/instantiates):
- flyte.RetryPolicy(min_attempts=) / retry_policy= -> flyte.RetryStrategy(count=)
  on @env.task(retries=...)                                 [flyte-sdk-optimize]
- flyte.TypeEngine.register -> flyte.types.TypeEngine.register, and
  `from flyte.extend import TypeTransformer, DefaultMappingTypeTransformer`
  -> `from flyte.types import TypeTransformer` (extend has neither) [flyte-sdk-types]
- flyte.Image.from_image(...) -> flyte.Image.from_base(...)  [app, ship, ml: 14x]
- flyte.AppEndpoint("x") -> flyte.app.AppEndpoint(app_name="x")     [flyte-sdk-app]
- flyte.Parameter.mount(...)/.env_var(...) (not real factories) ->
  flyte.app.Parameter(name=..., mount=.../env_var=...)             [flyte-sdk-app]
- flyte.ScalingConfig(min_replicas/max_replicas/target_cpu/...) ->
  flyte.app.Scaling(replicas=(1,10), scaledown_after=timedelta(...)) [flyte-sdk-app]
- flyte.abort(run) -> run.abort(); removed flyte.logs(run) and the invalid
  caching=flyte.CachingOptions(...) kwarg on with_runcontext        [flyte-sdk-run]

CLI commands/options (the real tree is `flyte <verb> <noun>`):
- flyte run list/get/watch -> flyte get run; flyte run outputs/download ->
  flyte get io; flyte logs -> flyte get logs (--no-system -> --filter-system,
  dropped nonexistent --raw); flyte abort <run> -> flyte abort run <run> [flyte-sdk-run]
- flyte app get -> flyte get app; flyte activate/deactivate ->
  flyte update app --activate/--deactivate; flyte secret create ->
  flyte create secret                                              [flyte-sdk-app]
- flyte trigger create <task> --cron -> flyte create trigger <task> <name>
  --schedule                                                       [flyte-sdk-agent]

Verified: top-level + deeper-path symbol audit clean, all corrected constructors
instantiate against the installed SDK, static lint 20/20.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cosmicBboy
cosmicBboy merged commit 4a800ac into main Jul 28, 2026
2 of 4 checks passed
@cosmicBboy
cosmicBboy deleted the fix/api-reference-symbols branch July 28, 2026 17:23
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