Repository navigation
[AI-2169] Import the whole machine from setup and hand off to an agent - #998
Conversation
The terminal step is the only surface in scope; the browser Import path is untouched. Scope widens from the current repository to every session on the machine. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Runtime Skipped joins the terminal partition, replay rows drive the spawn, the child pins the saved profile and drops KCAP_URL, one candidate order covers the cohort cut, and the skill gets an id grammar, a plan-denial degrade and truncation handling. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Unit eligibility keys on the parent's status, the detached child and the launched agent share one env pin, the child carries the foreground's visibility stamp, and truncation has one policy per cohort mode. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The runner returns selection, outcome and fault instead of an exit code, the handoff decision is one precedence table with a closed reason set, server binding fails closed, carried replay children leave the remainder, and both artifacts are owner-only on disk. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The skill queries only its own cohort and drops the tenant-wide count and heuristic mode, discovery is totalized at the runner, setup pre-creates both artifacts with CreateNew, the repo-less figure is named for what it counts, and per-category detail aggregates server-side. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
One joined query per cohort batch under a 20-query poll budget keeps a 500-id cohort inside the server's per-minute limit; a faulted pass carries no partition; publication never overwrites. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cursor children ride with their parent and never enter the cohort, the first poll starts at the budget floor instead of probing, and the skill reads the row cap and Retry-After from the text the analytics MCP already returns. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Carried children are whatever the existing routed plan admits, a correlated child is never a candidate whatever its status, the reported row cap rather than the truncation flag fails the first poll closed, and a ReportNothing exit publishes an empty selection. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cohort batches are dispatched serially: the server caps queries in flight per user as well as starts per minute, and the concurrency 429 carries no retry-after phrase to parse. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A parent whose own call is Skipped but whose carried child content was posted has landed work, so SentChildContent promotes it to Succeeded in the partition. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The handoff file's success list is the partition's SucceededIds verbatim, so a parent that landed only through its children is counted where the skill reads it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The partition and the Done grid answer different questions and diverge on one shape, a New parent landed only through a carried child; the spec names it instead of claiming agreement. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fifteen tasks, each ending in its own test cycle; the skill's acceptance is manual and says so. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…etup runner Neither ISetupImportRunner call throws: RunAsync catches whatever escapes HandleImport into Fault so setup never has to guard the wizard against it. SetupFacadeParityTests and SetupCommandTests updated for the new FakeImportRunner/ImportInvocation shapes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a WireMock + real-corpus test that drives SetupImportRunner.RunAsync end to end (credential resolution, hook uploads) to a completed pass with a populated Selection/Outcome/Partition, and tightens the pre-classification fault test to also pin Selection/Outcome null. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…pinned Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Also fixes SetupFacadeParityTests.cs for the constructor's new arity (constructs SetupCommand directly; not in the brief's file list but required for the build). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… a crash OwnerOnlyFile.CreateNew throws UnauthorizedAccessException, not IOException, when its directory denies write/search access — both guards caught only the latter, so a non-writable config dir would have escaped their documented never-throws contracts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PR Summary by QodoImport machine-wide session history and hand off eval monitoring
AI Description
Diagram
High-Level Assessment
Files changed (61)
|
Code Review by Qodo
1.
|
…ning, repo_hash link guard Splits five files that declared two top-level types, widens the --no-prompt import branch to warn on a zero-exit run with per-session or visibility failures, adds NotInParallel to a console-capturing test, validates eval-watch's repo_hash against a grammar before splicing it into a link, and drops step-number coordinates from three doc comments. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ows CI WriteLineAsync used Environment.NewLine, so the file read first\r\nsecond\r\n on Windows and failed the \n-based assertion.
setsid() alone does not stop the kernel from delivering SIGHUP to the detached child's session when the exiting setup process's controlling terminal goes away; SIGHUP's default action was killing the import. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
skill_not_installed and no_agent_detected left the user with only a plugin-install nag; they now also get the sessions link so the import and its evals stay watchable without an agent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…p exit A managed PosixSignalRegistration with Cancel does not suppress SIGHUP's terminating default for this AOT console process; a kernel-level SIG_IGN does. Verified live: the detached child now survives repeated SIGHUP mid-import.
The TTY wrappedEvents replaced OnSessionEnded/OnSessionErrored without the partition accounting, so an interactive setup under-counted succeeded/failed — mis-driving the handoff decision and the background-spawn guard.
…import The detached remainder import must outlive setup; InteractiveLifetime's parent-liveness watchdog would Environment.Exit(130) it within ~3s of setup returning, truncating the background import mid-scan.
…anscript as unknown Detaching before the import case's profile/repo resolution closes a window where a slow startup + parent exit could SIGHUP the child. A transcript missing at ordering time now reads as MinValue, not GetLastWriteTimeUtc's 1601 sentinel.
A session under multiple project/backup dirs left duplicate ids in the candidate/selected lists, wasting the 500-id cap and stalling eval-watch's all-complete stop (length vs unique analytics rows).
Closes #641 — AI-2169
What & why
kcap setup's terminal import step imported only the current repository, synchronously, in arbitrary order, then printed a prompt to paste — so the first value moment (evals landing on the user's own sessions) happened unseen after setup exited, and the rest of the machine's history never moved. Now the step imports the whole machine, most recent sessions prioritized: ~5 in the foreground with titles, the remainder in a detached background child, after showing discovery figures behind one yes/no prompt. It then writes a per-run handoff file and offers to launch any detected agent CLI (all nine) running a neweval-watchskill that follows the import and the evals over this run's own cohort. Plainkcap importis unchanged except newest-first dispatch order;kcap setup --no-promptnow imports the machine's whole history.Where to look
SetupCommand.RunImportStepAsync— the composed flow (discovery → prompt → foreground → background spawn → handoff file → picker → agent wait), and that no exception escapes the step.kcap/skills/eval-watch/SKILL.md— the session-id grammar is the SQL-safety boundary; every query is cohort-only underscope: 'global'; server binding fails closed.KCAP_URLremoved).Verification
dotnet publish -c ReleaseAOT analyzer:grep 'IL[23]…'→ no output (clean).Capacitor.Cli.Tests.Unit+OwnerOnlyFileTestsinCapacitor.Cli.Core.Tests.Unit), including real-corpus runner tests, polluted-environment env-pin tests, and chmod-based unwritable-config-dir degradation tests.eval-watchskill against a fixture tenant with recordedquery_analyticsresponses — the skill is a Markdown doc with no automated runtime coverage, so this is the only end-to-end check of its SQL-safety, cohort confinement and fail-closed binding.🤖 Generated with Claude Code