') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Fix CI for semver checks by fetching `main` by jaybosamiya-ms · Pull Request #3 · microsoft/litebox · GitHub
Skip to content

Fix CI for semver checks by fetching main - #3

Merged
Jay Bosamiya (Microsoft) (jaybosamiya-ms) merged 1 commit into
mainfrom
jayb/push-qkotwzsqxpws
Feb 5, 2025
Merged

Fix CI for semver checks by fetching main#3
Jay Bosamiya (Microsoft) (jaybosamiya-ms) merged 1 commit into
mainfrom
jayb/push-qkotwzsqxpws

Conversation

@jaybosamiya-ms

Copy link
Copy Markdown
Member

No description provided.

@jaybosamiya-ms
Jay Bosamiya (Microsoft) (jaybosamiya-ms) deleted the jayb/push-qkotwzsqxpws branch February 5, 2025 23:52
Will Portnoy (willportnoy) added a commit that referenced this pull request May 22, 2026
Adds host-side identifiers to audit JSONL + broker connection log:
#1 host_tid (gettid, thread_local cached) on every shim audit entry
#4 SO_PEERCRED capture at broker control-socket accept; logged as
CONN OPEN: conn_id=N peer_pid=P peer_uid=U peer_gid=G
Enables host-PID ↔ guest-PID correlation when diagnosing cross-worker
issues. Diagnostic-only; no behavior change. Validated 199/199.
Subagent assessment of remaining audit improvements:
#2 migration handoff: medium, ~80-150 LOC, high value — land next
#3 broker_conn_id per RPC: medium-high, ~120-250 LOC — after #2#5 parent_host_pid: small, opportunistic
#6 guest_context_pid: defer (broad delayed-fork changes)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Will Portnoy (willportnoy) added a commit that referenced this pull request Jun 4, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Will Portnoy (willportnoy) added a commit that referenced this pull request Jun 4, 2026
…, broker-direct handles
Phase 3 of the legacy-pipes migration: every fd entering litebox becomes
a broker-held handle at the boundary; siblings reference it via handle-id
instead of socketpair fd-passing through a parent dispatcher thread.
Major changes:
- D2: AttachHostFd opcode + SubsystemTag::HostFd + broker HostFdState
dispatch + runner/control-listener wiring. Host fds inherited via
SCM_RIGHTS get a broker handle at attach time.
- D3: broker-global OFD registry (litebox_broker::ofd_registry).
RegisterOfd(parent_9p_fid)->open_file_id; CloneOfd(open_file_id, new_fid).
Both sides reference the same kernel Arc<File> for POSIX shared-position
inheritance over delayed-fork.
- D5: all five mux-stream kinds (host, vsocket, vpipe, vpty, fs) migrated
to direct broker handles in the delayed-fork commit path. Parent emits
--broker-fd-bridge specs; worker installs them before fork-restore ack.
- D6/D7: deleted parent mux dispatcher block, worker mux block,
multiplexer.rs, MuxParentStream/MuxPtySlaveFd/install_mux_pipe_fd*,
--mux-fd/--mux-stream CLI args, and the LITEBOX_NEW_MUX feature flag
(default-on, then deleted).
- Phase 5 deletion: litebox/src/pipes.rs (1083 LOC), RawFdRef::Pipes,
GlobalState.pipes, EpollDescriptor::Pipe, all dispatch arms.
Rubber-duck review surfaced 6 findings, all fixed test-first:
- #1 fork-restore install gap (install before ack on both 9P/non-9P).
- #2 UnixSocket install consume-list parity with Pipe/TcpConn.
- #3 OFD register/clunk race (write-lock serialization).
- #4 clone_ofd_into_fid metadata-error refcount leak.
- #5 fs_fid post-CloneOfd cleanup (Tclunk on every failure path).
- #6 dup_handle failures propagate as install failure across all kinds.
Validation: broad regression gate
litebox::{dropbear_bash, EPIPE, FORK, P1, FS., PB., NPIPE, BPIPE, CL3}
542/542 PASS at LITEBOX_TEST_JOBS=8 (first-run, zero flakes).
Net diff: ~5,145 insertions / ~5,012 deletions across 45 files.
Branch: wportnoy/legacy-pipes-phase-3 (tip 6691630)
36 individual commits across phases D2–D7 + Phase 5 deletion + review fixes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Will Portnoy (willportnoy) added a commit that referenced this pull request Jun 12, 2026
… fd-migration paths
Closes the class of bug that produced 68/99 hard FAILs when
epoll/inotify were added without matching emit loops in
exec_on_remote_host (fixed in 5387acc): no compile-time signal that
a new fd subsystem had silently been dropped by the worker-exec path.
Three layers added:
(1) Exhaustive RawFdRef match in new module
litebox_shim_linux/src/syscalls/migration_policy.rs.
migration_policies_for(&RawFdRef) returns
{ worker_exec, delayed_fork, independent_fork } policies. No
wildcard arms; no #[non_exhaustive]; the workspace-wide
clippy::wildcard_enum_match_arm = "deny" plus rustc E0004
enforce the gate. Verified during agent work by adding a
temporary GateProof variant — build failed at the gate.
(2) Shared enumeration function referenced by all three fork-path
entry points (do_fork, commit_delayed_fork,
exec_on_remote_host) via zero-cost reference_gate::<FS>()
calls. New variants cannot bypass the gate by being added to
RawFdRef without updating migration_policy.
(3) Test-discovery-time coverage gate in
litebox_test_harness/src/coordinator/inherit_matrix.rs:
InheritSubsystem::discriminant_index() (exhaustive match) +
EXPECTED_VARIANT_COUNT + ALL[] verified in coverage_gate
cfg(test) module. New InheritSubsystem variant without a
matching INHERIT.<kind>.*.{dng,snm} matrix family fails at
test discovery. Verified by removing a variant from ALL and
observing the loud assert.
The shim-side gate is a *policy declaration* gate: developers
declare which loop bridges a kind, but the linkage from
loop_name string → actual emit loop is not yet compiler-checked
(follow-up #3 in the sub-agent report: typed per-loop constants).
Combined with the test-discovery gate, the net effect is that the
exact bug pattern that produced 68 FAILs requires at least two
explicit human acts of mis-declaration plus a missing test family
to recur — versus zero gates before.
Acknowledged out-of-scope follow-ups:
* Collapse the 13 per-subsystem emit loops in exec_on_remote_host
into a single RawFdRef-driven dispatch (epoll-last ordering
constraint makes this its own refactor).
* Reconcile platform-side worker_exec_bridge_decision() (dead_code
with todo!() arms) with this gate.
* Promote loop_name strings to typed constants emitted by each
loop, so renaming a loop without updating the policy table is
itself a compile error.
Behavior-preserving: pure structural gate, zero runtime cost.
Coverage_gate unit tests: 2/2 pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jaybosamiya-ms