lablup / lablup/backend.ai-webui

[bai-agent] `webui-map.json` projection — `--map-out` on the FR-3558 search-index extractor

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

Description

## Parent

FR-3740 — step C. Layer A (derived) of the page→feature map.

## What to build

Extend `react/scripts/build-search-index.mjs` (FR-3558, PR #8811) with a `--map-out` flag that writes a second artifact from the same run: `data/webui-map.json`. Keep the file name and the palette artifact (`react/src/generated/searchIndex.json`) untouched — the palette contract and the agent contract are separate outputs of one extractor.

- Entry id is the URL itself: `page:/admin/agent`, `tab:/admin/agent?tab=resourceGroup`, `setting:/usersettings?tab=general&setting=`. Fields: `id`, `kind`, `path`, `params`, `labelKey`, `label` (en), `parent`, `menuKey`, `adminOnly`.
- Lives in `data/` because `data/schema.graphql` is already a `REQUIRED_SOURCES` entry of the CLI (`packages/backend.ai-agent-cli/src/repo-context.ts`) — the CLI must not learn about `react/src`.
- Also emit `data/webui-map.ids.txt` (sorted ids) as the snapshot the doctor compares against (id removed → fail, added → warn).
- Extend `scripts/verify.sh` `check_search_index_drift()` to rebuild both artifacts and diff. Update `.gitattributes` (linguist-generated), `.prettierignore` and `.claude/rules/search-index-conflicts.md`.

## Acceptance criteria

- [ ] `pnpm --prefix ./react run search-index` writes both files; `verify.sh` fails when either is stale.
- [ ] Every palette entry has exactly one map id and vice versa (test).
- [ ] No new runtime dependency in `react/`.

## Blocked by

- FR-3558 stack (#8811) merged.

JIRA Issue: FR-3775

Contributor guide

No contributing guide indexed for this repository

Research direction

First confirm the FR-3558 stack in PR #8811, then read react/scripts/build-search-index.mjs and the existing search-index command. Trace scripts/verify.sh check_search_index_drift() and packages/backend.ai-agent-cli/src/repo-context.ts, then update the named metadata files. Done means pnpm --prefix ./react run search-index writes both artifacts, verification detects stale output, and the palette/map id correspondence test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, shell
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.