Skip to content

feat(model): tan model edge-AI lifecycle surface (check/zoo/add/prep/run/ab) — consolidated - #58

Draft
alpCaner wants to merge 13 commits into
devfrom
integration/model-edge-ai
Draft

feat(model): tan model edge-AI lifecycle surface (check/zoo/add/prep/run/ab) — consolidated#58
alpCaner wants to merge 13 commits into
devfrom
integration/model-edge-ai

Conversation

@alpCaner

Copy link
Copy Markdown
Contributor

Summary

Consolidated tan model edge-AI lifecycle surface — the executor side of
the ALP SDK model pipeline. tan wraps alp_cli model --format json payloads
in the standard {command, ok, exitCode, project, data, issues} envelope, and
adds the structured ModelSub subcommand group: check · zoo · add · prep ·
run · ab
(plus the existing build / list / info / doctor). Single integration
branch so the whole surface lands on dev as one testable PR.

  • crates/tan-cli/src/cli.rsModelSub variants + per-subcommand arg structs
    (--board, etc.).
  • crates/tan-cli/src/commands/model.rssub_argv mapping to the
    alp_cli model argv tail; is_wrappable; module-doc header.
  • --board forwarded through every board-scoped subcommand.
  • CHANGELOG.md [Unreleased] entry.

Scope

Rust CLI (tan-cli) — build-plan/envelope consumer only; no tan-core domain
change. Follows the build-plan CONSUMER contract; keeps the envelope byte-stable.

Test plan (run on this branch)

  • cargo fmt --all --check: clean
  • cargo clippy --all-targets -- -D warnings: clean
  • cargo test: green (see below)
  • cargo build --all-targets: builds

Supersedes

Folds the previously-stacked slice PRs (all closed): #47 (envelope), #50 (check),
#51 (zoo), #53 (prep), #54 (measure). Companion branches: alp-sdk +
alp-sdk-vscode integration/model-edge-ai.

Alp Lab AB added 13 commits July 24, 2026 17:13
… 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.
@alpCaner alpCaner added the enhancement New feature or request label Jul 25, 2026
@alpCaner alpCaner self-assigned this Jul 25, 2026
@hkngln

hkngln commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Heads-up: this went to CONFLICTING after #60 and #63 landed on dev just now (dev is at 7660036).

Only CHANGELOG.md actually conflicts — verified with git merge-tree --write-tree origin/dev origin/integration/model-edge-ai:

Auto-merging CHANGELOG.md
CONFLICT (content): Merge conflict in CHANGELOG.md
Auto-merging crates/tan-cli/src/cli.rs      <- clean
Auto-merging crates/tan-cli/src/main.rs     <- clean

cli.rs and main.rs are shared but merge cleanly: #63 added RenodeArgs.core (a different struct from ModelArgs) and #60 added mod venv; to the module list, both away from this PR's hunks. So it is a one-file, ## [Unreleased]-section resolution — keep both your ### Added entry and the two that landed.

What landed, for context:

Sorry for the churn — merged in that order because the flash fix was blocking local bring-up.

@alpCaner

Copy link
Copy Markdown
Contributor Author

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:

  • alplabai/alp-sdk#933
  • alplabai/tan-cli#58
  • alplabai/alp-sdk-vscode#366

They cannot land separately: #366 shells tan model subcommands that only exist once #58 lands, so merging the extension leg first ships a command surface calling into a binary that does not have it.

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 now

The 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 dev has moved substantially this week (the workspace guard #185, the launch.json splice #184, the contract-code registration #209, the first-blink CI job #215), so a rebase today would be superseded again before the trio is mergeable.

Plan

Pick all three up as a unit, with a single coordinated rebase, once the three tags are cut. At that point dev on each side is stable, the conflicts are resolved once rather than per-leg, and the trio can land atomically the way it has to.

Nothing here is a judgement on the work — it is a sequencing call about when the rebase is worth spending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants