Skip to content

push: 5 explicit update actions, drop auto-detect prompt language#243

Merged
moshe-kabala merged 6 commits into
masterfrom
update-actions-explicit
Jun 1, 2026
Merged

push: 5 explicit update actions, drop auto-detect prompt language#243
moshe-kabala merged 6 commits into
masterfrom
update-actions-explicit

Conversation

@moshe-kabala
Copy link
Copy Markdown
Contributor

Summary

Mirrors engine PR #2326 (and node-server PR for update-actions-explicit). The CLI now asks the user to pick exactly what changed instead of leaning on engine auto-detect:

  • 5 explicit options in AskForEvaluatePlan (no more "(auto-detected: …)" hint, no more "Auto-detect …" tail in PrintEvaluatePlan).
  • survey.Required validator — empty submit isn't valid anymore; a push without an eval intent should drop --eval.
  • -u / --update gains metric_direction / metric-direction / direction aliases, mapping to the new UPDATEACTION_UPDATE_METRIC_DIRECTION enum value.
  • metadata and metric still trigger a full re-evaluation (server-side resetEvaluate delegation).

Prompt before → after

Before:

? What did you change in your code? (auto-detected: added meta/viz, metric-direction, insight-config)
  [ ] Edited an existing metadata
  [ ] Edited an existing visualization
  [ ] Added or edited a metric
  [ ] Force re-run insights

After:

? What did you change in your code?
  [ ] Added or edited a metadata             — triggers full re-evaluation
  [ ] Added or edited a metric               — triggers full re-evaluation
  [ ] Edited metric direction or insight-config — cheap update
  [ ] Added or edited a visualization        — regenerate all visualizations
  [ ] Reinforce insights                     — regenerate insights from scratch

Files

  • pkg/tensorleapapi/model_update_action.go — add UPDATEACTION_UPDATE_METRIC_DIRECTION
  • pkg/model/evaluate.go — 5-option ChangeKey enum + table-driven planUpdateEvaluate, survey.Required validator, dropped auto-detect language, updated FormatEvaluatePlan / PrintEvaluatePlan
  • cmd/root_cmd/push.go--update help lists all five values + notes metadata/metric trigger full re-eval; Long help removes "(auto-detects changes)" phrasing
  • docs/push-examples.md — matches new prompt + plan output, adds metric_direction row

Test plan

  • leap push -o <name> -e → prompt shows 5 options, empty submit rejected
  • leap push -o <name> -u metric_direction → "Update metric direction" plan, no full re-eval
  • leap push -o <name> -u visualization -u insights → both bullets shown
  • leap push -o <name> -u metric → "Re-evaluate (full)" plan, dispatches resetEvaluate
  • leap push -o <name> -u metedata → typo errors with allowed-values hint
  • Legacy -u update_visualization long-form still parses

Rollout

Depends on engine PR #2326 landing + @tensorleap/engine-contract@0.0.408 published (so the node-server route is live and accepts the new action value).

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor

@asafyehezkel asafyehezkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Mirrors engine PR #2326. The interactive --eval prompt now lists five
explicit options the user picks from — no engine-side auto-detect, so
the message no longer claims "(auto-detected: added meta/viz,
metric-direction, insight-config)" and the printed plan no longer tails
an "Auto-detect …" bullet:

  [ ] Added or edited a metadata             — triggers full re-evaluation
  [ ] Added or edited a metric               — triggers full re-evaluation
  [ ] Edited metric direction or insight-config — cheap update
  [ ] Added or edited a visualization        — regenerate all visualizations
  [ ] Reinforce insights                     — regenerate insights from scratch

AskForEvaluatePlan now requires at least one selection (survey.Required)
since there's nothing for the engine to "auto-detect" anymore — pushes
without an eval intent should drop --eval rather than submit empty.

--update / -u gains metric_direction / metric-direction / direction
aliases routing to UPDATEACTION_UPDATE_METRIC_DIRECTION (added to the
Go enum). metadata and metric still trigger a full re-evaluation (the
node-server delegates to resetEvaluate).

push-examples.md updated to match the new prompt + plan output and to
list metric_direction in the alias table.
@moshe-kabala moshe-kabala force-pushed the update-actions-explicit branch from 9d7ab3f to e3cb83c Compare June 1, 2026 13:31
Two related changes folded together (the tensorleapapi parts that
previously lived in this work now come from the dedicated
"Update node server api" commit):

1. Prompt copy reworded as "What do you want to update?" with shorter
   noun-led options and a slimmer plan summary in PrintEvaluatePlan.
2. The overwrite branch now ALWAYS asks the multi-select prompt, even
   without --eval — the picked actions are persisted onto the version
   doc via PersistUpdateActions so the UI dialog and any later
   evaluation see the user's recorded intent.

Dispatch logic in triggerEvaluate routes the persisted-only case to
the new endpoint; --eval keeps the existing update_evaluate /
resetEvaluate branching.
GetSlimActiveVersions returns versions in mongo insertion order, which
leaves a long-lived project showing brand-new pushes at the bottom of
the picker. Sort by `UpdatedAt` descending so the version the user
just touched is the first option below "Create new".
@moshe-kabala moshe-kabala force-pushed the update-actions-explicit branch from e3cb83c to 4f9b031 Compare June 1, 2026 13:55
@moshe-kabala moshe-kabala merged commit 3de12b2 into master Jun 1, 2026
2 checks passed
@moshe-kabala moshe-kabala deleted the update-actions-explicit branch June 1, 2026 15:22
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.

2 participants