Fast fork signing mode + handshake summarizer#24
Open
svelderrainruiz wants to merge 7 commits into
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a "fast fork signing mode" with sampling capabilities for script signing, and adds a handshake summarizer to track Ubuntu/Windows local-CI run alignment. The changes optimize CI performance for fork builds while maintaining full signing for production builds.
Key Changes
- Added sampling modes (
First,Random,None) to the script signing batch tool to limit files signed in fork mode - Created a handshake summarizer to detect cross-runner parity issues and coverage mismatches
- Added a GitHub artifact downloader utility with gh CLI and REST API fallback support
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Invoke-ScriptSigningBatch.ps1 | Added MaxFilesPerBatch, SamplingMode, and EmitMetrics parameters; moved certificate loading earlier; added sampling logic and metrics emission |
| tools/Get-GitHubRunArtifacts.ps1 | New script for downloading GitHub Actions artifacts via gh CLI or REST API with flexible run ID parsing |
| tests/tools/Summarize-Handshakes.ps1 | New handshake summarizer that parses pointer.json, run metadata, stage logs, and coverage data to detect failures |
| tests/tools/Run-LvAddonLearningLoop.ps1 | Integrated handshake summarizer into the learning loop workflow |
| tests/tools/New-LvAddonLearningSnippet.ps1 | Added HandshakeSummaryPath to learning snippet with usage instructions |
| .github/workflows/ci-windows-signed.yml | Added FORK_SIGN_SAMPLE and FORK_SIGN_SAMPLING_MODE environment variables; wired up new parameters |
| src/tests/HandshakeSummary.Tests.ps1 | New Pester test validating handshake summarizer functionality |
| tests/results/_agent/icon-editor/* | Generated JSON artifacts (learning snippet, dev-mode summary, handshake summary) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 6 commits
November 15, 2025 15:58
…ntries are applied, and coverage gating is now meaningful/green.
svelderrainruiz
pushed a commit
that referenced
this pull request
Nov 17, 2025
feat(timing): add instrumentation toggle + tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feature/fork-codesign-fast-mode — PR outline
What this feature adds
tools/Invoke-ScriptSigningBatch.ps1now supports fork sampling via-MaxFilesPerBatch/-SamplingModeplus optional metrics emission..github/workflows/ci-windows-signed.ymlfeedsFORK_SIGN_SAMPLE=150so forks only sign a predictable slice while trusted runs still timestamp everything.tools/x-cli-develop(XCli.sln,scripts/*.ps1,tests/*) is consumed as a simulation provider fromsrc/tools/icon-editor/IconEditorDevMode.psm1and the handshake utilities (tests/tools/Run-HandshakeSim.ps1,tests/tools/Summarize-Handshakes.ps1). The subtree stays isolated as a vendor drop; our CI uses its command-line surface but never gates on its coverage.tools/Get-GitHubRunArtifacts.ps1fetches run artifacts viaghor REST, andtests/tools/Summarize-Handshakes.ps1materializes end-to-end handshake health intotests/results/_agent/icon-editor/handshake-summary.jsonso LvAddon agents can reason about parity issues faster.How to invoke it
pwsh tests/tools/Run-HandshakeSim.ps1 -Scenario ok -UbuntuManifestPath out/local-ci-ubuntu/<run>/ubuntu-run.jsonseedstools/x-cli-developto mimic GitHub handshake states without touching real assets.pwsh tests/tools/Collect-LvAddonLearningData.ps1 -Actions Both -Scenarios timeout,rogue -MaxRecords 20drivesXCliSimviatests/tools/Run-DevMode-Debug.ps1and refreshes learning snippets undertests/results/_agent/icon-editor/.CI coverage status
.github/workflows/coverage.ymlstill enforces the global ≥75 % line-rate gate plus per-file floors forsrc/Core.psm1andtools/Build.ps1only when those files exist. Uploads for Cobertura + JUnit artifacts remain wrapped inif: always()..github/workflows/docs-link-check.yml) is unmodified—lycheeverse/lychee-action@v1still runs on the ubuntu-latest matrix and uploads.lycheeunderif: always().tools/x-cli-develop/) is treated as vendor tooling: it is not part of the curated test set nor the coverage gate. Integration confidence now comes from lightweight Pester tests (tests/Scripts/IconEditorDevModeXCli.Tests.ps1) that mockdotnetand assert argument construction + failure handling without taking a dependency on the subtree itself.tests/results/_agent/icon-editor/handshake-summary.json) shows Ubuntu coverage at 100 % vs the 75 % floor, with per-stage diagnostics persisted for traceability.Diagnostics + readiness checklist
tests/results/_agent/icon-editor/handshake-summary.json(handshake parity),tests/results/_agent/icon-editor/xcli-learning-snippet.json(now links back to handshake summary), andtests/results/_agent/icon-editor/xcli-devmode-summary.jsonall consume the same vendor telemetry folder (tools/x-cli-develop/temp_telemetry).IconEditorDevMode.psm1throws whentools/x-cli-develop/src/XCli/XCli.csprojis missing, and the new tests validate both that guard and the safe fallback whendotnet run --projectfails.Invoke-ScriptSigningBatchemits JSON metrics into the runner summary so we can audit how many files were sampled, skipped, or timed-out during CI.tools/Get-GitHubRunArtifacts.ps1prefersgh run download, auto-discovers artifact names, and falls back to REST withInvoke-WebRequestwhen the CLI/token is unavailable.Risks & mitigations
tools/x-cli-develop) – treat as a pinned dependency. None of the new CI gates traverse it; we only depend on its CLI surface (dotnet run --project tools/x-cli-develop/src/XCli/XCli.csproj). Pester tests mock that hop so PRs do not need the actual vendor payload to pass.FORK_SIGN_SAMPLE/FORK_SIGN_SAMPLING_MODE. Trusted builds still force timestamping on the entireunsignedtree, and metrics plusMAX_SIGN_FILESwarnings make under-sampling visible.handshake/pointer.jsonorout/local-ci/*are absent, keeping the suite non-destructive. Agents can regenerate summaries by rerunningtests/tools/Run-LvAddonLearningLoop.ps1after a handshake capture.tools/Get-GitHubRunArtifacts.ps1defaults tologs-artifacts/beneathWORKSPACE_ROOT; callers can override-DestinationRootto sandbox writes when running outside CI.