8000 Show worktree boards before full aggregation finishes by rore · Pull Request #34 · rore/minimap · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ The UI never holds a second copy. Editing through the UI writes the markdown bac

When the repository has linked Git worktrees, the board's checkout picker can show **This checkout** or **Across worktrees**. Across is a read-only combined view: it identifies shared features from Git anc 8000 estry, keeps divergent checkout versions and their exact values visible, and marks unavailable sources as partial coverage. Choose a version in the item panel before editing; Save changes only that selected checkout and refuses a changed checkout or stale file. Across never synchronizes roadmap files or reorders multiple worktrees. The selected checkout version is retained in the URL on reload. If a checkout fails to open, Refresh or reselecting **This checkout** retries with fresh discovery.

Across shows the opened checkout first while other worktrees load, with an explicit incomplete-coverage label. Feature totals and In play are provisional; session information waits for the full scan. Refresh keeps the current board and editor usable, and failed reads retain the last usable view with a retry through Refresh.

Default layout:

```text
Expand Down
4 changes: 3 additions & 1 deletion package/minimap/CONTRACT.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Example config:

The board can show **This checkout** or a read-only **Across worktrees** projection. Discovery considers at most 16 registered linked Git worktrees in the opened repository's common Git directory. A separate clone is not a sibling. A source with an incompatible roadmap location, unreadable workspace, or uncertain identity is excluded or marked as partial coverage; it is never silently represented as empty. A checkout whose branch or HEAD changes during the read invalidates the combined snapshot and requires Refresh. Same item ID and path alone do not prove one logical feature: the shared ancestor must contain that identity, and a delete/re-add breaks it. Conflicting values stay source-specific. Different board-group memberships are disclosed on the cards; missing-file board references remain visible in coverage details even under metadata lenses. Line-ending-only differences do not produce a visual conflict, although raw file revisions remain exact for stale-write checks. Search, filters, In play, and metadata grouping evaluate each checkout version, not a fabricated merged item.

Across may first show a provisional opened-checkout-only snapshot while the full scan runs. Feature totals and In play are explicitly incomplete; participant counts and details remain unknown until full identity is resolved. Same-scope Refresh retains the existing board and editor during loading. Reconciliation preserves newer view/selection changes and unsaved editor context; a failed full read retains usable provisional or last-known content with an error and Refresh retry.

The source selector beside the repository heading opens immediately, reuses last-known choices, and refreshes Git discovery through `GET /api/worktree-sources` without parsing roadmaps or looking up participants. Discovery evidence is not edit context: opening a discovered checkout uses `GET /api/worktree-source-workspace` with its observed Git identity, revalidates the checkout and roadmap binding, and returns fresh context before source-bound item requests. Failed discovery retains choices with an unavailable cue; outdated responses cannot change the selected source or editor draft. A failed checkout open can be retried with Refresh or the current-source choice, using fresh discovery. Coverage distinguishes discovered checkouts, loaded roadmaps, repeated feature placements, exclusions, and participant availability. A failed board refresh retains a labeled last-known view only within the same repository and source scope.

Across does not edit board order or synchronize files. Opening an item exposes compact checkout-version controls near its title; expanded choices show full branch names, st 10BC8 atus and differences relative to the selected version, including a selected version filtered out of the board. Paths are secondary details. Switching version changes only the selected document. Edit/Raw requires explicit one-checkout confirmation. The selected version is pinned in the URL, and a missing or changed source must not silently fall back to another. Unsaved drafts cannot be silently discarded by Refresh or checkout navigation. Source-bound UI requests carry a source context checked against the live Git worktree and roadmap location; item, board, and scope writes additionally require an exact expected revision. Spec file paths in a source-bound request must stay inside that checkout. The ordinary agent CLI and unbound routes remain unchanged.
Expand All @@ -72,7 +74,7 @@ Configured metadata group order lives at `lenses.fields.<field>.order` and is in

Filters are intentionally curated. Common planning fields (`status`, `priority`, `commitment`, `kind`, `milestone`, `lane`, and `labels`) appear when they have two to eight distinct values. Add repo-specific frontmatter keys with `filters.fields`; fields configured under `lenses.fields` also remain filterable. Explicitly configured fields are not subject to the eight-value limit. `id` and `title` cannot become facets because search already covers them.

`defaultLens` is optional. A valid URL `lens` wins, including explicit `lens=board`; otherwise a valid configured default is used, then Board. Unknown URL or config values fall back safely and should be reported as warnings.
`defaultLens` is optional. A valid URL `lens` wins, including explicit `lens=board`; otherwise a valid configured default is used, then Board. Unknown URL or config values fall back safely and should be reported as warnings. Across defers validation of an explicit URL grouping until the full snapshot, since it may be absent from the provisional opened checkout; a newer grouping choice takes precedence.

## Optional live participants

Expand Down
11 changes: 9 additions & 2 deletions package/minimap/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,15 @@ async function handleWorktreeSourceWorkspace(request, response) {

async function handleWorktreeWorkspace(request, response) {
const repoRoot = await resolveRoadmapRepo(request);
const aggregate = await loadWorktreeAggregate(repoRoot);
aggregate.participantCounts = await lookupWorktreeParticipantCounts(request, response, repoRoot, aggregate);
const openedOnlyValues = new URL(request.url, "http://localhost").searchParams.getAll("openedOnly");
if (openedOnlyValues.length > 1 || (openedOnlyValues.length && openedOnlyValues[0] !== "1")) {
throw new AppError("Invalid openedOnly query parameter.", 400, "bad_request");
}
const openedOnly = openedOnlyValues.length === 1;
const aggregate = await loadWorktreeAggregate(repoRoot, { openedOnly });
aggregate.participantCounts = openedOnly
? { status: "loading", counts: [], partial: true, includeCompleted: true }
: await lookupWorktreeParticipantCounts(request, response, repoRoot, aggregate);
if (!response.destroyed) sendJson(response, 200, aggregate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ Use existing linked Pallium session controls for explicit association cleanup; M
The optional Minimap participant panel is read-only. With a validated loopback `MINIMAP_PALLIUM_ENDPOINT`, each visible roadmap board uses one bounded count request per refresh for up to 200 board items: Minimap `GET /api/board/participant-counts` calls Pallium `POST /relay/work-refs/participant-counts`. Done, shipped, superseded, cancelled, and canceled items are omitted by default. In play adds completed candidates only when its status filter permits them, using `?includeCompleted=1`; absent or `0` keeps the default, and invalid or repeated values are rejected. Successful completed-inclusive responses echo `includeCompleted: true`; a server ignoring the flag leaves results incomplete and needs an update. Completed-item board badges appear only in In play; session detail remains available on demand in the existing item panel. In play means normalized status `active` or `in-progress`, OR any confirmed attached, nonclosed session, including dormant sessions—not working right now. Overflow and error/unknown outcomes remain visibly incomplete, never zero; active and in-progress matches still appear. When the endpoint is disabled, Minimap makes no Pallium HTTP requests. Exact-session links separately require an explicitly configured, reviewed compatible `MINIMAP_PALLIUM_DASHBOARD_ENDPOINT`; without it, names remain plain text. These panel settings do not control whether an agent may use already-available Pallium MCP tools.

Across worktrees is a separate read-only board projection. Its `GET /api/worktree-workspace` snapshot includes one bounded participant-count batch for at most 200 unambiguous logical features across versions, including completed versions so In play can be evaluated without a second board scan. The UI still shows badges only where the current view permits them. Associations are feature-wide, never evidence that a particular checkout version is active. Independent features sharing an NFC-equivalent item ID receive no inferred count or participant detail; a partial/unknown result is not zero.

The provisional `?openedOnly=1` snapshot skips this batch and participant-detail reads until the full scan resolves feature identity. Its session status is loading/unknown, not zero, and feature totals and In play cover only the opened checkout. A failed full scan leaves this incomplete view usable with Refresh retry.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
3. If it does not exist, use `roadmap/`.
4. Do not guess alternate paths when the configured location is missing.

An optional top-level `defaultLens` in `roadmap.config.json` selects the initial metadata grouping. A valid URL `lens` wins, including explicit `lens=board`; without one, a valid `defaultLens` wins, then Board. Unknown URL or configured values fall back safely with a warning.
An optional top-level `defaultLens` in `roadmap.config.json` selects the initial metadata grouping. A valid URL `lens` wins, including explicit `lens=board`; without one, a valid `defaultLens` wins, then Board. Unknown URL or configured values fall back safely with a warning. Across validates an explicit URL grouping after the full snapshot, since it may be absent from the provisional opened checkout; a newer grouping choice wins.

Filters use the common planning fields `status`, `priority`, `commitment`, `kind`, `milestone`, `lane`, and `labels` when each has two to eight distinct values. Add repo-specific frontmatter keys with `filters.fields`; fields configured under `lenses.fields` are also filterable. Explicitly configured fields may have more than eight values. `id` and `title` remain search-only.

Expand Down
2 changes: 2 additions & 0 deletions package/minimap/skills/minimap-roadmap/references/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ The source menu separately reads `GET /api/worktree-sources`: this lists discove

## Optional Pallium participants

Across initially requests `GET /api/worktree-workspace?openedOnly=1` alongside the full aggregate. The opened-only response has `provisional: true`, `partial: true`, and `coverage.pending: true`: it validates and loads only the opened checkout, without sibling discovery, cross-checkout ancestry, or participant lookup. The only accepted query value is one `openedOnly=1`; other or repeated values return 400. Its feature totals and In play coverage are incomplete, not the final Across result. The full response replaces this provisional board without restoring older user selections, filters, grouping, or layout. Same-scope Refresh keeps the last board and editor available while updating; a failed full read keeps usable provisional or last-known content with an error and Refresh retry. Provisional participant counts and details remain unknown until full feature identity is resolved.

Set `MINIMAP_PALLIUM_ENDPOINT` on a supported start or restart command to enable read-only participant lookup. Set `MINIMAP_PALLIUM_DASHBOARD_ENDPOINT` separately, and only for a reviewed compatible Pallium dashboard, to enable exact-session participant links. Both values must be explicit local HTTP origins such as `http://127.0.0.1:19836`; Minimap rejects remote, credential-bearing, redirected, or path-bearing endpoints before changing a running server or its saved preference. A successful command saves the validated settings under `$MINIMAP_HOME`, so later starts and restarts preserve them. An explicit empty dashboard value disables links while retaining lookup; an explicit empty lookup value disables lookup and clears both.

If `start-server.mjs` finds a healthy server and the requested or saved effective settings do not exactly match the server's verified effective identity, or a legacy server cannot verify it, the script exits with restart guidance instead of silently reusing it. `status.mjs` reports participant lookup and participant links independently as enabled, disabled, or unknown without exposing either origin. Do not edit the private preference file by hand; use the lifecycle scripts and environment variables.
Expand Down
11 changes: 9 additions & 2 deletions package/minimap/skills/minimap-roadmap/runtime/server.js
10BC8
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,15 @@ async function handleWorktreeSourceWorkspace(request, response) {

async function handleWorktreeWorkspace(request, response) {
const repoRoot = await resolveRoadmapRepo(request);
const aggregate = await loadWorktreeAggregate(repoRoot);
aggregate.participantCounts = await lookupWorktreeParticipantCounts(request, response, repoRoot, aggregate);
const openedOnlyValues = new URL(request.url, "http://localhost").searchParams.getAll("openedOnly");
if (openedOnlyValues.length > 1 || (openedOnlyValues.length && openedOnlyValues[0] !== "1")) {
throw new AppError("Invalid openedOnly query parameter.", 400, "bad_request");
}
const openedOnly = openedOnlyValues.length === 1;
const aggregate = await loadWorktreeAggregate(repoRoot, { openedOnly });
aggregate.participantCounts = openedOnly
? { status: "loading", counts: [], partial: true, includeCompleted: true }
: await lookupWorktreeParticipantCounts(request, response, repoRoot, aggregate);
if (!response.destroyed) sendJson(response, 200, aggregate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,20 @@ async function conflicts(versions, displayRevisions) {
}

/** Read-only, opened-first projection of compatible linked worktrees. */
export async function loadWorktreeAggregate(openRepoRoot) {
const discovery = await discoverWorktreeSources(openRepoRoot);
export async function loadWorktreeAggregate(openRepoRoot, { openedOnly = false } = {}) {
let discovery;
if (openedOnly) {
const opened = await readWorktreeIdentity(openRepoRoot);
discovery = { sources: opened ? [opened] : [], excluded: [], partial: false,
unavailable: opened ? null : { reason: "not-git-or-unavailable" } };
} else discovery = await discoverWorktreeSources(openRepoRoot);
const result = { ...discovery, workspace: null, features: [], groups: [],
coverage: { loaded: 0, excluded: 0, missingBoardRefs: [], identityUncertain: [] } };
if (openedOnly) {
result.provisional = true;
result.partial = true;
result.coverage.pending = true;
}
if (!discovery.sources.length) return result;
if (discovery.unavailable) result.partial = true;

Expand Down
2 changes: 1 addition & 1 deletion package/minimap/skills/minimap-roadmap/runtime/ui/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function createApi({ fetch: fetchImpl, getRepo, getSource } = {}) {
return {
// Roadmap
loadWorkspace: () => request("/api/workspace"),
loadWorktreeWorkspace: () => request("/api/worktree-workspace", {}, { unbound: true }),
loadWorktreeWorkspace: ({ openedOnly = false } = {}) => request(`/api/worktree-workspace${openedOnly ? "?openedOnly=1" : ""}`, {}, { unbound: true }),
discoverWorktreeSources: () => request("/api/worktree-sources", {}, { unbound: true }),
loadSourceWorkspace: (identity) => request("/api/worktree-source-workspace", {
headers: { "X-Minimap-Source-Context": JSON.stringify(identity).replace(/[\u007f-\uffff]/g, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`) },
Expand Down
Loading
Loading
0