@@ -1075,6 +1075,26 @@ h2::before { content: ""; flex: 0 0 auto; width: 14px; height: 2px; border-radiu
10751075 .apply-health-action { grid-template-columns: 1fr; }
10761076}
10771077.worker-toolbar { margin-top: 12px; }
1078+ .public-reference-search {
1079+ display: flex;
1080+ align-items: center;
1081+ gap: 8px;
1082+ margin: 12px 0;
1083+ }
1084+ .public-reference-search input {
1085+ min-width: 260px;
1086+ border: 1px solid var(--line);
1087+ border-radius: 9px;
1088+ background: var(--surface);
1089+ color: var(--text);
1090+ padding: 8px 10px;
1091+ }
1092+ .public-reference-row mark {
1093+ border-radius: 4px;
1094+ background: color-mix(in srgb, var(--amber) 24%, transparent);
1095+ color: inherit;
1096+ padding: 1px 3px;
1097+ }
10781098.worker-filters {
10791099 display: inline-flex;
10801100 flex-wrap: wrap;
@@ -1763,6 +1783,17 @@ a.pill:hover { color: var(--claw); text-decoration: none; }
17631783 <span class="muted">Select a worker for its live step timeline.</span>
17641784 </div>
17651785 <div id="workers"></div>
1786+ <div class="workers-head">
1787+ <h2>Public GitHub work</h2>
1788+ <span class="muted" id="public-reference-summary"></span>
1789+ </div>
1790+ <form class="public-reference-search" id="public-reference-search" role="search">
1791+ <label class="sr-only" for="public-reference-input">Find a public issue or pull request</label>
1792+ <input id="public-reference-input" autocomplete="off" placeholder="Issue/PR number or owner/repo#number">
1793+ <button class="filter-button" type="submit">Find</button>
1794+ <button class="filter-button" id="public-reference-clear" type="button">Clear</button>
1795+ </form>
1796+ <div id="public-references"></div>
17661797 </section>
17671798 <h2 id="review-coverage-title">Fleet Review Coverage</h2>
17681799 <details class="review-coverage">
@@ -2012,6 +2043,34 @@ function dashboardStatusValue(value, field, depth) {
20122043 }
20132044 return result;
20142045}
2046+ function dashboardPublicBayReferences(value) {
2047+ if (value === undefined) return [];
2048+ if (!Array.isArray(value) || value.length > 124) return [];
2049+ const stages = new Set(["arriving", "setting-up", "reviewing", "publishing", "applying", "repairing"]);
2050+ const sources = new Set(["queue", "live"]);
2051+ const seen = new Set();
2052+ const references = [];
2053+ for (const entry of value) {
2054+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) return [];
2055+ const repository = typeof entry.repository === "string" ? entry.repository.trim().toLowerCase() : "";
2056+ const itemNumber = entry.item_number;
2057+ if (
2058+ repository.length > 200 ||
2059+ !/^[a-z0-9_.-]+\\/[a-z0-9_.-]+$/.test(repository) ||
2060+ typeof itemNumber !== "number" ||
2061+ !Number.isSafeInteger(itemNumber) ||
2062+ itemNumber <= 0 ||
2063+ itemNumber > 1000000000 ||
2064+ !stages.has(entry.stage) ||
2065+ !sources.has(entry.source)
2066+ ) return [];
2067+ const key = repository + "#" + itemNumber;
2068+ if (seen.has(key)) continue;
2069+ seen.add(key);
2070+ references.push({ repository, item_number: itemNumber, stage: entry.stage, source: entry.source });
2071+ }
2072+ return references;
2073+ }
20152074function dashboardStatusSnapshot(value) {
20162075 if (!value || typeof value !== "object" || Array.isArray(value)) return null;
20172076 const projected = dashboardStatusValue(value, "root", 0);
@@ -2027,6 +2086,29 @@ function dashboardStatusSnapshot(value) {
20272086 ? rawDiagnostics.error_count
20282087 : 0;
20292088 const errorCount = Math.max(rawErrorCount, declaredErrorCount);
2089+ const projectedQueue = source.exact_review_queue && typeof source.exact_review_queue === "object"
2090+ ? source.exact_review_queue
2091+ : null;
2092+ const projectedBay = projectedQueue?.bay_projection && typeof projectedQueue.bay_projection === "object"
2093+ ? projectedQueue.bay_projection
2094+ : null;
2095+ const projectedActivity = projectedBay?.activity && typeof projectedBay.activity === "object"
2096+ ? projectedBay.activity
2097+ : null;
2098+ const rawItems = value.exact_review_queue?.bay_projection?.activity?.items;
2099+ const publicReferences = dashboardPublicBayReferences(rawItems);
2100+ const exactReviewQueue = projectedQueue && projectedBay && projectedActivity
2101+ ? {
2102+ ...projectedQueue,
2103+ bay_projection: {
2104+ ...projectedBay,
2105+ activity: {
2106+ ...projectedActivity,
2107+ ...(publicReferences.length ? { items: publicReferences } : {})
2108+ }
2109+ }
2110+ }
2111+ : projectedQueue;
20302112 return {
20312113 schema_version: 1,
20322114 generated_at: source.generated_at,
@@ -2047,7 +2129,7 @@ function dashboardStatusSnapshot(value) {
20472129 error_count: errorCount,
20482130 },
20492131 dashboard_health: source.dashboard_health || { conclusion: "needs_attention", severity: "amber" },
2050- exact_review_queue: source.exact_review_queue ?? null ,
2132+ exact_review_queue: exactReviewQueue ,
20512133 recent_durable_publication_events: source.recent_durable_publication_events ?? null
20522134 };
20532135}
@@ -2058,6 +2140,7 @@ let activeAutomergeChart = "success";
20582140let lastAutomergeMetrics = null;
20592141let automergeMetricsRequestGeneration = 0;
20602142let activeWorkerFilter = "all";
2143+ let publicReferenceQuery = "";
20612144let workerIndex = new Map();
20622145let automaticIndex = new Map();
20632146let activeHealthRange = "6h";
@@ -3531,6 +3614,40 @@ function renderWorkers(rows) {
35313614 '</button>';
35323615 }).join("") + '</div>';
35333616}
3617+ function publicReferenceSearch(value) {
3618+ const query = String(value || "").trim().toLowerCase();
3619+ if (!query) return null;
3620+ const qualified = query.match(/^([a-z0-9_.-]+\\/[a-z0-9_.-]+)#(\\d+)$/);
3621+ const numberOnly = query.match(/^#?(\\d+)$/);
3622+ const itemNumber = Number(qualified ? qualified[2] : numberOnly?.[1]);
3623+ if (!Number.isSafeInteger(itemNumber) || itemNumber <= 0 || itemNumber > 1000000000) return false;
3624+ return { repository: qualified?.[1] || null, item_number: itemNumber };
3625+ }
3626+ function renderPublicReferences(data) {
3627+ const target = document.getElementById("public-references");
3628+ const summary = document.getElementById("public-reference-summary");
3629+ const rows = dashboardPublicBayReferences(data?.exact_review_queue?.bay_projection?.activity?.items);
3630+ const search = publicReferenceSearch(publicReferenceQuery);
3631+ const visible = search && search !== false
3632+ ? rows.filter(row => row.item_number === search.item_number && (!search.repository || row.repository === search.repository))
3633+ : search === false ? [] : rows;
3634+ summary.textContent = search === false
3635+ ? "Enter a number or owner/repo#number"
3636+ : publicReferenceQuery
3637+ ? visible.length + " match" + (visible.length === 1 ? "" : "es")
3638+ : rows.length + " verified public reference" + (rows.length === 1 ? "" : "s");
3639+ if (!visible.length) {
3640+ target.innerHTML = '<div class="empty">' + (publicReferenceQuery ? "No matching public reference in this snapshot." : "No verified public references are in the bounded Bay sample.") + '</div>';
3641+ return;
3642+ }
3643+ target.innerHTML = '<div class="work-list">' + visible.map(row => {
3644+ const key = row.repository + "#" + row.item_number;
3645+ const label = esc(key);
3646+ const display = publicReferenceQuery ? "<mark>" + label + "</mark>" : label;
3647+ const url = "https://github.com/" + row.repository + "/issues/" + row.item_number;
3648+ return '<article class="work-row public-reference-row"><div class="work-main"><div class="row-top"><span class="pill">' + esc(row.source) + '</span><a class="item-link" href="' + esc(url) + '" target="_blank" rel="noopener noreferrer">' + display + '</a></div><div class="muted work-title">Verified public repository and issue/PR reference only</div></div><div class="work-state"><div class="stage-block"><strong>' + esc(row.stage) + '</strong><span class="muted">Bay stage</span></div></div></article>';
3649+ }).join("") + '</div>';
3650+ }
35343651function renderAutomaticWork(rows) {
35353652 automaticIndex = new Map(rows.map((row, index) => [String(index), row]));
35363653 const active = rows.filter(row => row.active || ["queued", "running", "in_progress"].includes(row.status)).length;
@@ -3752,6 +3869,7 @@ function renderDashboard(data, note) {
37523869 renderApplyHealth(data);
37533870 renderAutomaticWork(data.automatic_work || []);
37543871 renderWorkers(data.workers || []);
3872+ renderPublicReferences(data);
37553873 openWorkerFromHash();
37563874 renderClusterRepair(data.recent?.cluster_repair);
37573875 renderPipeline(data.pipeline || []);
@@ -4245,6 +4363,16 @@ document.getElementById("worker-filters").addEventListener("click", event => {
42454363 activeWorkerFilter = button.dataset.workerFilter || "all";
42464364 renderWorkers(lastData?.workers || []);
42474365});
4366+ document.getElementById("public-reference-search").addEventListener("submit", event => {
4367+ event.preventDefault();
4368+ publicReferenceQuery = document.getElementById("public-reference-input").value;
4369+ renderPublicReferences(lastData || {});
4370+ });
4371+ document.getElementById("public-reference-clear").addEventListener("click", () => {
4372+ publicReferenceQuery = "";
4373+ document.getElementById("public-reference-input").value = "";
4374+ renderPublicReferences(lastData || {});
4375+ });
42484376document.getElementById("trend-ranges").addEventListener("click", event => {
42494377 const button = event.target.closest("button[data-trend-range]");
42504378 if (!button) return;
0 commit comments