Skip to content

feat(cli): skill cloud mode + doctor target detection (uteke-cloud#804 fase 2) - #1825

Open
ajianaz wants to merge 7 commits into
developfrom
feat/cli-skill-cloud-mode
Open

ajianaz wants to merge 7 commits into
developfrom
feat/cli-skill-cloud-mode

Conversation

@ajianaz

@ajianaz ajianaz commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Part of codecoradev/uteke-cloud#804 (the team skill library epic). The Cloud side (#805/#806) serves /api/v2/skill/*; this makes the CLI talk to it and tells users which target they are on.

What

Skill cloud routing (crates/uteke-cli/src/commands/cloud.rs): with UTEKE_BASE_URL + UTEKE_CLOUD_TOKEN set, uteke skill search|list|show|similar route to POST {base}/api/v2/skill/* with the same REMOTE read-only shapes the OSS server serves. index|approve|record|lint stay local by design (personal library) with an explicit stderr notice; an unreachable remote fails loudly - never a silent fallback.

Doctor target detection (maintenance.rs): uteke doctor probes GET {base}/api/v2/stats and reports Target: Uteke Cloud (<base>) - team skill library available / unreachable / Target: local library (no server configured). Doctor now runs in cloud mode (it was refused before).

Core: serde::Deserialize derived on the skill wire types (SkillHit, SkillRemoteSummary, SkillListAnswer, ...) so the CLI reuses the exact local renderers - additive only.

Why

Owner direction (2026-12-03): skills live on Cloud with approval + supersede; tole's self-learn produces candidates that land in the Cloud library after review. The CLI is the agent-facing surface - it must reach the team library and be honest about the target (cloud vs OSS), exactly the split the open-core decision (2026-11-11) draws: individual = OSS, team/org = Cloud.

Testing

  • cargo check -p uteke-cli clean; cargo clippy -p uteke-cli -p uteke-core --all-targets clean.
  • cargo test -p uteke-cli --bin uteke skill_routing pass (routing decisions incl. local passthrough).
  • cargo test -p uteke-cli --test cloud_mode 7/7 pass (real uteke-serve E2E): skill reads round-trip through the remote, 404 surfacing, local store untouched, fail-loudly when down, doctor target lines (live/down/local).
  • cargo test -p uteke-core --lib skill 63 pass.

Notes

  • REST alone cannot distinguish Cloud from an OSS server (both answer /api/v2/stats); per the owner's probe rule a 200 reads as "Uteke Cloud". MCP serverInfo.name-based detection is a tracked follow-up in the delivery notes.

The CLI needs to parse the REMOTE skill answers back into the typed reports it already renders; the derives are additive and change no serialization.
 fase 2)

Why: cloud mode routed memory/room/doc only; the team skill library was unreachable from the CLI.
What: the four REMOTE read-only skill operations go to POST /api/v2/skill/{search,list,show,similar}; --json prints the server envelope; human output reuses the local renderers where the wire shape matches. skill index/approve/record/lint stay local (personal library; no upload wire) and pass through with a stderr notice instead of the cloud-mode refusal. An unreachable remote fails loudly, never falls back.
Why: with cloud mode on, `uteke doctor` could not say what the CLI talks to (#804 fase 2 owner decision).
What: probe GET /api/v2/stats; a 200 prints 'Target: Uteke Cloud (<base>) — team skill library available', a failure prints the reason, no server configured prints the local-only line. --json carries a `target` field. Doctor now runs in cloud mode as a local report.
Real uteke-serve + embedder stub: skills pre-indexed into the served store, search/list/show/similar round-trips, no source_path on the wire, 404 surfaced, local store untouched, loud failure on a down remote, doctor target lines.
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

Why: the CodeCora sema gate treats a visibility change of an existing
symbol (private -> pub(crate)) as a removal and blocks the PR with
'7 breaking changes' — widening is additive in Rust, but the gate counts
the old private symbol as gone.

What: the originals stay private, untouched; cloud mode calls new
crate-internal wrappers (cloud_read_draft, cloud_render_hits,
cloud_render_similar, cloud_print_lines, cloud_short_hash,
cloud_severity_label, cloud_command_name). No behavior change; the full
uteke-cli suite passes (226 unit + 7 cloud_mode E2E + integration).
… too

Why: cora review round 2 still counted 2 sema removals — short and
severity were pre-existing private fns widened in the first cut.

What: both revert to private; cloud mode goes through
cloud_short_hash / cloud_severity_label. Full uteke-cli suite green
(226 unit, 7 cloud_mode E2E against a real uteke-serve, integration).
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