Repository navigation
Run component tests from the Sidekick - #986
Conversation
Preserve the reviewed REPL.Test implementation on corrected A and update its fixture to the supported explicit test host installer path.
PR #986: Run component tests from the Sidekick17 files, +1438 / -10 Scope🔴 PR has 1448 lines changed. Split into focused PRs. 🟡 1448 lines changed. PRs under 400 receive more thorough review. StructuralOxlint structural signals:
SlopOxlint slop signals:
Static AnalysisOxlint: 66 diagnostics across 8 files (16 rules) no-unused-vars (14): packages/cli/tests/fixtures/repl/issue-883/sidekick-harness.ts, packages/cli/src/repl/sidekick/admission.ts, packages/cli/src/repl/sidekick/controls.ts (+2) CorrectnessNo extraneous code patterns detected. |
| export function sidekickRequests( | ||
| root: RootReading, | ||
| submit: SubmitForReply, | ||
| test?: ReplTesting, |
There was a problem hiding this comment.
should this information come from context?
There was a problem hiding this comment.
Context would be reasonable if several consumers needed to select a scoped test service. Here, test is an already-wired callback: the root supplies the admission-checked runner, and the conversation wraps it with servingNow() so it belongs to the active response. Passing it explicitly keeps those owners visible and follows the nearby submit callback.
Context would save the argument, but add binding, lookup and absence handling; the root admission and response-lifetime checks would still be needed. If scoped substitution or more consumers become useful, selecting the runner from Context during trusted assembly could make sense.
Given this single composition site, I agree with your clarification: leaving it unchanged is reasonable and doesn't warrant a refactor here.
Why
A Sidekick can author reusable components, but needs a supported way to run their companion tests and receive the actual results. Refs #896. Loader prerequisite #983 is merged.
What changes
Before: the Sidekick has no REPL.Test request for a test document or directory.
After:
<REPL.Test path="components/Greeting.test.md" />runs one test document;<REPL.Test path="components" />runs the selected suite. Each document uses an isolated testing root. Structured reports reach the Sidekick even when captured; explicit Output controls person-facing display. Shipped guidance teaches authoring, testing, fixing and reuse.Review guide
Start with
specs/repl-spec.mdandpackages/cli/src/repl/sidekick/testing.ts, then the R1-R6 assertions inpackages/cli/tests/repl-sidekick-testing.test.ts.What must stay true
How to verify it
Focused combined-head evidence passes: the five affected CLI files report 36 tests/185 steps, and
packages/testing/tests/use-testing.test.tsreports one test/11 steps. Frozen R1-R6 cover Markdown author/fail/fix/reuse, same-path TypeScript edits, truthful reports, selection/isolation/display, admission/cancellation and cold recovery. Both original independent reviewers PASS signed feedback 8aa1d19. Exhaustive runtime verification belongs to remote CI.Scope
REPL.Test requests, response-owned execution, production root admission, detached reports, shipped Sidekick teaching and owning specifications. This adds no dependency or build-layout change relative to the merged loader. Existing CLI test selection remains unchanged.
Risks and limitations
This draft is not merge-ready. Required CI, this changed corpus's runner-measured weights, final-head reviews after any weight commit and original Planner metadata APPLY/independent VERIFY remain outstanding.
Scope confirmation