Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(merge): the star line never makes the page list the boards [N26,H5]
Corey Olson8f27e4126d6c
diff --cc src/cockpit.jsindex b1eb175b,7962e477..97c13d28--- a/src/cockpit.js+++ b/src/cockpit.js@@@ -1041,129 -1045,21 +1053,139 @@@ async function jsonRequest(path, body,return json;}+/** Read only this machine's authenticated view, including when its page is hosted elsewhere. */+function sharingApi(body) {+ return jsonRequest('/api/v1/view-link', body, hosted.local ? localReadBase : connection.base,+ hosted.local ? localReadHeaders : connection.headers);+}++let sharingReady = null;+let sharingTask = Promise.resolve();+let sharing = { state: 'idle', intentId: null, popup: null, timer: null, closing: false, boards: [] };++/** Show the opt-in once after a real local read; quiet boards do not acquire another polling loop. */+async function sharingInvitation() {+ if (!$('share-note') || snapshot || (hosted.local ? !localSession : pageReadOnly || configuredTransportModule)) return;+ try { $('share-note').hidden = !(await sharingApi()).available; }+ catch { $('share-note').hidden = true; }+}++/** Render names and reasons as text, without exposing machine paths or private sign-in material. */+function sharingProgress(status) {+ sharing.state = status.state;+ sharing.boards = status.boards || [];+ const linked = sharing.boards.filter(board => board.outcome === 'linked');+ if (linked.length) $('share-note').hidden = true;+ const lines = sharing.boards.map(board => board.outcome === 'linked' ? 'Linked ' + board.name + '.'+ : 'Did not link ' + board.name + ': ' + board.reason);+ if (status.error) lines.push(status.error.message);+ else if (['cancelled', 'declined', 'expired'].includes(status.state)) lines.push('No boards were linked. You can sign in again whenever you want.');+ else if (status.state === 'pairing') lines.push('Your boards are linked. Pair a device to open them there, or close this step; the links stay in place.');+ else if (status.state === 'pairing-stopped') lines.push('Phone pairing stopped. Your boards remain linked.');+ else if (status.state === 'linking') lines.push('Linking every registered board…');+ else if (status.state === 'done' && !linked.length && !lines.length) lines.push('No boards were linked.');+ if (lines.length) $('share-status').textContent = lines.join('\\n');+ $('share-pair').hidden = status.state !== 'pairing';+ $('share-close').textContent = linked.length ? 'Close' : 'Cancel sign-in';+ if (status.state !== 'waiting') { sharing.popup?.close(); sharing.popup = null; }+}++/** Stop the one operation and await core cleanup; a linking batch is never described as rolled back. */+async function closeSharing() {+ clearTimeout(sharing.timer);+ sharing.closing = true;+ if (!sharing.intentId) return;+ try {+ const status = await sharingApi({ action: 'cancel', intentId: sharing.intentId });+ sharingProgress(status);+ sharing.popup?.close(); sharing.popup = null;+ $('share-start').disabled = false;+ sharingReady = sharingInvitation();+ } catch (error) {+ $('share-status').textContent = error.message;+ if (error.code === 'VIEW_SIGN_IN_LINKING') {+ sharing.closing = false;+ sharing.timer = setTimeout(() => { sharingTask = pollSharing(); }, 250);+ } else { sharing.popup?.close(); sharing.popup = null; $('share-start').disabled = false; }+ }+}++/** Poll public progress only while the person has an active sign-in or pairing step. */+async function pollSharing() {+ if (sharing.closing) return;+ if (sharing.state === 'waiting' && sharing.popup?.closed) { sharingTask = closeSharing(); return sharingTask; }+ try {+ const status = await sharingApi({ action: 'status', intentId: sharing.intentId });+ sharingProgress(status);+ if (['waiting', 'linking', 'pairing'].includes(status.state)) sharing.timer = setTimeout(() => { sharingTask = pollSharing(); }, 250);+ else { $('share-start').disabled = false; sharingReady = sharingInvitation(); }+ } catch (error) {+ $('share-status').textContent = error.message;+ $('share-start').disabled = false;+ }+}++/** Begin one existing all-board sign-in; open its browser window in the native click before awaiting the server. */+async function beginSharing(popup) {+ sharing = { state: 'waiting', intentId: null, popup, timer: null, closing: false, boards: [] };+ $('share-panel').hidden = false;+ $('share-start').disabled = true;+ $('share-status').textContent = 'Starting GitHub sign-in…';+ try {+ const instructions = await sharingApi({ action: 'start' });+ sharing.intentId = instructions.intentId;+ if (sharing.closing || popup?.closed) return await closeSharing();+ $('share-status').textContent = 'Enter ' + instructions.userCode + ' in the GitHub window. Closing this sign-in before linking leaves every board local.';+ popup.location.replace(instructions.verificationURL);+ sharing.timer = setTimeout(() => { sharingTask = pollSharing(); }, 250);+ } catch (error) {+ popup?.close();+ $('share-status').textContent = error.message;+ $('share-start').disabled = false;+ }+}++/** Open only core's transient device navigation in a separately authenticated HTML response, never a JSON URL. */+async function pairSharing(popup) {+ const base = hosted.local ? localReadBase : connection.base;+ const headers = hosted.local ? localReadHeaders : connection.headers;+ try {+ const html = await jsonRequest('/api/v1/view-link', { action: 'pairing', intentId: sharing.intentId }, base, headers, undefined, 'html');+ const destination = new DOMParser().parseFromString(html, 'text/html').querySelector('a')?.getAttribute('href');+ if (!destination) throw new Error('Phone pairing is no longer waiting. Read the sign-in status and start again if needed.');+ popup.location.replace(destination);+ } catch (error) { popup?.close(); $('share-status').textContent = error.message; }+}++$('share-start')?.addEventListener('click', () => {+ const popup = window.open('about:blank', '_blank');+ if (!popup) { $('share-panel').hidden = false; $('share-status').textContent = 'Allow this view to open the GitHub sign-in window, then try again.'; return; }+ popup.opener = null;+ sharingTask = beginSharing(popup);+});+$('share-close')?.addEventListener('click', () => { sharingTask = closeSharing(); });+$('share-pair')?.addEventListener('click', () => {+ const popup = window.open('about:blank', '_blank');+ if (!popup) { $('share-status').textContent = 'Allow this view to open the device-pairing window, then try again.'; return; }+ popup.opener = null;+ sharingTask = pairSharing(popup);+});+let relayEngine = null;/** The account's linked boards: a same-origin read that declares the relay's engine, as every relay request does. */+ // The account's last read and when it ended, answered or refused, for the star line, which reuses it rather than+ // asking again (#817): a refusal is an answer too, "not linked", and is not asked again straight away.+ let linkedSeen = null;async function linkedList() {relayEngine ??= await import('/relay/engine.js').then((engine) => String(engine.ENGINE_VERSION), () => '');- return jsonRequest('/api/v1/boards', undefined, '', relayEngine ? { 'x-pullboard-engine': relayEngine } : {}, 'no-store');+ try {+ const reply = await jsonRequest('/api/v1/boards', undefined, '', relayEngine ? { 'x-pullboard-engine': relayEngine } : {}, 'no-store');+ linkedSeen = { at: Date.now(), reply };+ return reply;+ } catch (error) {+ linkedSeen = { at: Date.now(), reply: null };+ throw error;+ }}/**