Repository navigation
test(vscode): add opt-in Inspect and Start controls for packaged repair (#4651) - #16243
EffortlessSteven wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new test journey, PACKAGED_REPAIR_START, along with integration and host setup tests to verify that the VS Code extension correctly distinguishes inspection from an enabled Start for a given gap. The review feedback suggests verifying that the test server path exists on disk before reading it, using an explicit TypeScript type guard when filtering undefined commands, and asserting that required environment variables are defined before passing them to fs.realpath.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Independent source review of the opt-in harness only. The existing Mocha guard requires the selected test to pass when Mocha runs. Two launcher/receipt questions remain before the resulting observation can safely travel as packaged evidence; no actual Electron execution is inferred.
EffortlessSteven
left a comment
There was a problem hiding this comment.
One distinct negative-oracle gap to fix in the same source harness pass.
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 45 minutes. View limit details
No actionable comments were generated in the recent review. Summary by CodeRabbit
WalkthroughThe change adds an opt-in packaged repair-Start test mode for VS Code. The runner validates its setup and selects the packaged repair-Start journey. Host setup tests check configuration failures and successful setup. An integration test checks the repair card’s inspection and Start actions. ChangesPackaged Repair Start
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant TestRunner
participant VSCodeHost
participant PackagedExtension
participant RustFixture
participant ArtifactDirectory
TestRunner->>VSCodeHost: Launch focused repair-Start run
VSCodeHost->>PackagedExtension: Open Rust fixture
PackagedExtension->>RustFixture: Produce repair diagnostic and card actions
VSCodeHost->>ArtifactDirectory: Write observed case, seam, command, and runtime details
Possibly related issues
Possibly related PRs
Merge Risk:
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
Independent successor source review for exact 61603c58f024fa00013e53bf4abecb9db6aee16e: no actionable source finding in this opt-in affordance harness. The launcher preserves prior evidence, requires a fresh attempt-bound observation after host success, and checks the canonical active server identity and digest. The staged fixture is clean and bound to the reported Git HEAD; the called case now checks proposed. The receipt correctly says source_harness_observation / package_admission: not_established. The owner’s TypeScript and 46 focused checks are distinct from this source review. Actual Electron and admitted paired VSIX/server/CLI evidence remains outstanding, so this is not a packaged qualification or a merge admission attestation.
|
Fresh source-built editor host evidence for exact extension/harness This closes the two source-built Linux host controls only. Keep the draft until the #4651 owner supplies the admitted VSIX/native server pair and the same cases pass on installed Linux and native Windows. This does not verify Finish, frozen package identity, or hosted required qualification. No tracked changes or CI dispatch. |
There was a problem hiding this comment.
REVIEW_READY for head 61603c5
Native Windows review of test(vscode): add opt-in Inspect and Start controls for packaged repair (#4651) at HEADPLACEHOLDERSHORT.
What changed
A new required journey PACKAGED_REPAIR_START (packaged_repair_start.test.ts, registered in requiredJourneys.ts) proving the packaged extension distinguishes inspection from an enabled Start for the current gap, bound to a fresh host invocation: runTest.ts validates the repair-Start fixture (clean worktree at a staged HEAD whose base matches staged main, 40-hex), the server binary against a supplied SHA-256 (64-hex), a trusted isolated profile, absolute paths for workspace/extension/server, a fresh artifact root containing no prior observation, and a fresh user-data dir per run; repairStartObservation.ts types and validates the recorded observation; a follow-up commit binds the observations to a fresh host invocation.
Source review (verified against source)
- The staging checks are fail-closed and shape-checked before any run: fixture HEAD must be exactly
[a-f0-9]{40}, the server digest exactly[a-f0-9]{64}, the server path must equal the packaged path, remain unchanged by path normalization, and the observation root must be fresh — a stale observation aborts before the editor opens. assertRepairStartFixturepins cleanliness (--porcelainempty), toplevel identity viarealpath, and thatrefs/heads/mainmatches the staged base, so the journey cannot silently analyze a moved or dirty workspace.- The distinction under test is the right UX guarantee for an agentic tool: an accidental Start would mutate user code, so inspection and Start are separately observed, and the required-journey registration makes the proof a merge-time obligation rather than documentation.
- The follow-up (
61603c58f0) binds observations to a fresh host invocation, closing the hole where a prior run's observation could satisfy the current one.
Native proof
Verified natively on Windows: npm ci clean and tsc -p tsconfig.json exits 0 in the PR tree (which includes the new repairStartObservation.ts and the runTest.ts staging changes). The packaged journey additionally needs the cargo-built server digest-pinned by the runner; the hosted vscode e2e leg on this PR is that proof route.
Residuals
None blocking. The packaged journey needs the cargo-built server and the hosted vscode e2e leg carries that full matrix; the native evidence below covers the compile and the Windows-reachable suite surface.
Summary
Adds an opt-in test to the existing Electron runner for the two cases in #2335 comment 7144637789. The called-but-unreached case must copy a current RepairCard with its proposed test target and expose zero enabled Start actions. The independently supported uncalled case must copy an enabled
--phase beforecommand for the same current seam. The launcher checks the configured path and digest before host acquisition and only publishes a nonce-matched observation after the child exits successfully. Ordinary editor runs keep their existing required journeys.Source-of-truth Links
Proposal: #2335 (comment)
Spec: #12427 (packaged parity receipt contract)
ADR: none
Plan item: #4651 packaged VSIX Inspect and Start controls
Governing issue or accepted claim: #4651
Acceptance delta (one sentence): The opt-in Electron test discriminates a current inspectable case with Start withheld from a separate current case that exposes the seam-bound Start command.
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
test/4651-vsix-repair-startStack parent or prerequisite PR (if any): landed #16241 source fixture and #12427 receipt contract
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): none
Scope and rollback
Test harness and test-only changes. Revert the single commit to remove the opt-in lane. Changelog exemption under CONTRIBUTING.md and CHANGELOG_POLICY.md applies to this test-only addition with no supported product behavior, hosted workflow configuration or public documentation delta.
Source proof
From
editors/vscode,./node_modules/.bin/tsc -p tsconfig.jsonexited 0../node_modules/.bin/mocha --ui tdd out/test/suite/{host_setup,required_journeys,run_outcome}.test.jsexited 0 with 46 passing. The real launcher under injected Electron boundaries rejects stale observations without altering them, normalized-path aliasing, missing or mismatched servers, dirty or moved Git fixtures, and zero-exit hosts with absent, stale or incomplete results. It requires a current called-case card whose target kind isproposed, the staged repository HEAD, and the configured direct executable observed by the running controller. Source checks exercised the host assertion callers with substituted clipboard/host observations. The compiled launcher also rejected a real whitespace-suffixed decoy file and a prior observation with exit 1 before acquisition.git diff --checkpassed.Electron UI on Linux/Xvfb and native Windows, admitted VSIX behavior, and cross-channel parity are
not_run. The launcher publishes observations labeledsource_harness_observationwithpackage_admission: not_established. The existing custody path owns admission and the parity receipt. Actual before execution, external edit, Finish, and CLI comparison remain under #4651.Review request and continuation
Please independently review the successor head
61603c58f024fa00013e53bf4abecb9db6aee16e. In particular, check stale receipt handling, zero-exit refusal, the resolved executable identity, the called-case target kind, and staged Git HEAD binding. Source review of the successor found no remaining material source defect. The overall disposition remainsREVIEW_INCOMPLETE.61603c58f024fa00013e53bf4abecb9db6aee16e, tree366d3352d29da022aff541e18d5a34a088ccf9f6, based on inspected main6329b0037c7af2db0a2fffe970b19b5f56773eac.Exact opt-in replay
The opt-in test extends the existing Electron runner reached by
npm run test:e2e. It covers the two deep, uncapped cases from #16241 as requested in #2335. The called-but-unreached case copies a current RepairCard with a proposed target and has zero enabled Start actions. The independently supported uncalled case copies a current card and copies an enabled before command for the same seam. Both are UI affordance checks. Execution of the before phase, external edit, Finish, CLI comparison, and the rest of #4651 remain separate evidence under the #12427 receipt contract.Inputs
server --versionoutput. Use the existing Windows packaged workflow's extraction and explicit-server setup, or the corresponding admitted package staging on Linux. SetRIPR_TEST_EXTENSION_PATHto that package's externally installed or extractedextensiondirectory. VS Code loads this directory through the existing test-host extension path.RIPR_TEST_SERVER_PATHandRIPR_TEST_PACKAGED_SERVER_PATH. Export the admitted lowercase SHA-256 asRIPR_TEST_PACKAGED_SERVER_SHA256. The launcher rejects path spelling that the resolver would trim and hashes the canonical direct executable. The host checks resource scope, product normalization, and the running controller’s direct executable path and digest. Archive-to-directory provenance, candidate selection and ambient filesystem isolation remain with the existing custody owner.stage-cases.pyreads the five literal inputs from the exact landed Rust fixture and creates separate clean Git histories. Its second argument must be a new directory below your private run root. Retain the two*-fixture.jsonfiles and supply each recordedheadasRIPR_TEST_REPAIR_START_HEAD. Run the two cases with the same frozen package and executable paths.Linux with Xvfb
From the isolated source tree containing the test patch, compile the harness with
npm --prefix editors/vscode ciandnpm --prefix editors/vscode run compile. On an executor without a warm xtask,editors/vscode/node_modules/.bin/tsc -p editors/vscode/tsconfig.jsonperforms the TypeScript compile used here.With the three admitted path/digest variables and
RIPR_TEST_EXTENSION_PATHalready exported, run the following from the source root. Sethandoff_dirto the absolute directory containing this file andstage-cases.py.After the TypeScript compile,
xvfb-run -a node editors/vscode/out/test/runTest.jsinvokes the same runner without building xtask. Use a separate new profile for each replay and keep the terminal exit alongside the report.Native Windows
Use the existing Windows packaged qualification artifact variables from its trusted editor step in a local PowerShell session. Set the same per-case variables shown above, point each case at its own fresh artifact directory, and invoke
npm --prefix editors/vscode run test:e2eornode editors/vscode/out/test/runTest.jsafter TypeScript compile. Check$LASTEXITCODEand the observation file for each case. Run the existing workflow's owned-orphan check for the qualification claim. Capture unavailable platform cases asnot_run.Attach both observations, the two fixture identities, terminal runner output and the original custody record to the existing journey. Each case needs a successful host exit and a nonce-matched observation file. The runner rejects a root with a prior observation and publishes only after checking the fixture and executable again. Observations carry
evidence: source_harness_observationandpackage_admission: not_established. The existing custody owner can join them with current candidate, package, server and fixture identities when producing the parity receipt. Record the installed CLI result separately for comparison on the same fixtures and artifact generation.Fixture staging script to save as stage-cases.py