lablup / lablup/backend.ai-webui

[bai-agent] Ship a webui-map snapshot in the CLI package with staleness degradation

Closed
#9,268 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133
Forks
81
Avg merge
1d 11h
Merged PRs (30d)
344

Description

## Parent

FR-3740 — step G. Lets a `bai-agent` without a checkout still answer "where is X".

## What to build

- Add `data/webui-map.json` (+ ids snapshot) to the package `files[]` at build time, stamped with `repoVersion` and `generatedAt`.
- Resolution order: checkout map (if `data/webui-map.json` exists) → shipped snapshot. `doctor` warns when the snapshot is older than `SCHEMA_META_STALE_DAYS` (reuse the schema.meta mechanism) or its `repoVersion` is behind the connected manager's WebUI version.
- When answering from a stale snapshot, `where`/`explain` **degrade**: assert the page path only, never the tab/setting id, and say so in the output (`source: snapshot (stale)`).

## Acceptance criteria

- [ ] `npm pack` output contains the snapshot; `where` works in an empty directory.
- [ ] Stale snapshot → tab-level answers are withheld with an explicit note; fresh checkout map wins when present.

## Blocked by

- Steps C, D.

JIRA Issue: FR-3779

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the CLI package's packaging configuration and the data/webui-map.json snapshot, then trace the doctor, where, and explain commands and the existing schema.meta staleness mechanism. Use npm pack to verify the snapshot is included and test resolution in an empty directory; done means checkout maps take precedence, stale snapshots withhold tab-level answers and report their source, and fresh snapshots resolve normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.