feat(model): tan model edge-AI lifecycle surface (check/zoo/add/prep/run/ab) — consolidated - #58
feat(model): tan model edge-AI lifecycle surface (check/zoo/add/prep/run/ab) — consolidated#58alpCaner wants to merge 13 commits into
Conversation
… envelope - model::run: JSON + wrappable sub (build/list/info/doctor) captures the child spawn and wraps stdout in tan's envelope; text mode and non-wrappable subs (run/help/unknown) still delegate to sdk_cli's streaming forwarder. - sdk_cli: extract prepare_alp_cli (SDK-root/python-guard/PYTHONPATH resolution) so both the streaming forwarders and model's captured spawn share one resolution path instead of re-deriving it. - wrap_model_json now returns the effective ExitCode alongside the JSON: a child that exits 0 but prints unparseable stdout is downgraded to InternalFailure so ok stays reliable for a JSON consumer. - main.rs: tan model routes to commands::model::run instead of straight to sdk_cli::run.
…any position `Model(WestForwardArgs)` was a trailing-var-arg passthrough, so any global flag placed after `model` (notably `--format json`) was swallowed into the forwarded argv instead of being parsed as GlobalArgs::format. The vscode extension calls `tan --sdk-root <X> model list --format json` (global appended at the end), so it got no envelope back. Replace it with a real clap subcommand group (ModelArgs/ModelSub) mirroring alp_cli's own model.py option surface (--board/--out/--metadata-root per sub); globals now parse regardless of position. model::run maps the structured sub to the alp_cli argv tail and dispatches exactly as before (streaming forward in text mode / for the still-passthrough `run` sub, captured+wrapped envelope for build/list/info/doctor under --format json).
B1 (e2e verification): the vscode panel builds a single model via `tan model build --model <name>`, but ModelBuildArgs had no --model, so clap rejected the real per-model build call. Add the option and forward it to the alp_cli argv (--model <name>) alongside --board/--out/--metadata-root. alp_cli's own --model is landing in Plan A in parallel; tan just forwards it.
|
Heads-up: this went to CONFLICTING after #60 and #63 landed on Only CHANGELOG.md actually conflicts — verified with
What landed, for context:
Sorry for the churn — merged in that order because the flash fix was blocking local bring-up. |
|
Parked until the release chain is out. Please do not rebase this in the interim. This is one leg of a three-repo trio that has to land atomically:
They cannot land separately: #366 shells Current state of all three: CONFLICTING. #366 is additionally author-declared not ready, and #58 is four days stale with checks to match. Why parking beats rebasing right nowThe release chain is alp-sdk v0.14.0 -> tan-cli v0.4.1 -> alp-sdk-vscode v0.4.0, and it is in flight — alp-sdk v0.14.0 is gating now. Rebasing a conflicting three-repo feature into a live release chain is how releases slip. Every rebase re-runs three CI suites, and a trio that must land atomically cannot land at all while two of its legs are red — so the rebases buy nothing and cost review attention that the release needs. tan-cli PlanPick all three up as a unit, with a single coordinated rebase, once the three tags are cut. At that point Nothing here is a judgement on the work — it is a sequencing call about when the rebase is worth spending. |
Summary
Consolidated
tan modeledge-AI lifecycle surface — the executor side ofthe ALP SDK model pipeline.
tanwrapsalp_cli model --format jsonpayloadsin the standard
{command, ok, exitCode, project, data, issues}envelope, andadds the structured
ModelSubsubcommand group: check · zoo · add · prep ·run · ab (plus the existing build / list / info / doctor). Single integration
branch so the whole surface lands on
devas one testable PR.crates/tan-cli/src/cli.rs—ModelSubvariants + per-subcommand arg structs(
--board, etc.).crates/tan-cli/src/commands/model.rs—sub_argvmapping to thealp_cli modelargv tail;is_wrappable; module-doc header.--boardforwarded through every board-scoped subcommand.CHANGELOG.md[Unreleased]entry.Scope
Rust CLI (
tan-cli) — build-plan/envelope consumer only; notan-coredomainchange. Follows the build-plan CONSUMER contract; keeps the envelope byte-stable.
Test plan (run on this branch)
cargo fmt --all --check: cleancargo clippy --all-targets -- -D warnings: cleancargo test: green (see below)cargo build --all-targets: buildsSupersedes
Folds the previously-stacked slice PRs (all closed): #47 (envelope), #50 (check),
#51 (zoo), #53 (prep), #54 (measure). Companion branches:
alp-sdk+alp-sdk-vscodeintegration/model-edge-ai.