Skip to content

[AI-2169] Import the whole machine from setup and hand off to an agent - #998

Merged
realtonyyoung merged 39 commits into
mainfrom
tonyyoung/ai-2169-setup-import-eval-handoff
Sep 19, 2026
Merged

realtonyyoung merged 39 commits into
mainfrom
tonyyoung/ai-2169-setup-import-eval-handoff

Conversation

@realtonyyoung

Copy link
Copy Markdown
Collaborator

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 new eval-watch skill that follows the import and the evals over this run's own cohort. Plain kcap import is unchanged except newest-first dispatch order; kcap setup --no-prompt now 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 under scope: 'global'; server binding fails closed.
  • Owner-only handoff file / log (0600, no clobber) and the env pins on the detached child and launched agent (KCAP_URL removed).

Verification

  • dotnet publish -c Release AOT analyzer: grep 'IL[23]…' → no output (clean).
  • Targeted filters all pass (23 classes across Capacitor.Cli.Tests.Unit + OwnerOnlyFileTests in Capacitor.Cli.Core.Tests.Unit), including real-corpus runner tests, polluted-environment env-pin tests, and chmod-based unwritable-config-dir degradation tests.
  • Owed before enabling for real users: a manual acceptance run of the eval-watch skill against a fixture tenant with recorded query_analytics responses — 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

realtonyyoung and others added 29 commits September 17, 2026 20:40
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>
@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

AI-2169

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Import machine-wide session history and hand off eval monitoring

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Imports machine-wide history, prioritizing recent sessions before detached background processing.
• Securely hands each import cohort to a detected agent for eval monitoring.
• Adds comprehensive coverage for ordering, partitioning, process isolation, and failure handling.
Diagram

sequenceDiagram
    actor User
    participant Setup as Setup Command
    participant Import as Import Runner
    participant Child as Background Import
    participant File as Handoff File
    participant Agent as Agent CLI
    participant Analytics as Analytics MCP
    User->>Setup: Accept machine import
    Setup->>Import: Discover all sessions
    Import-->>Setup: Repositories and sessions
    Setup->>Import: Import recent cohort
    Import-->>Setup: Selection and outcome
    Setup->>Child: Spawn remaining import
    Setup->>File: Write secure cohort record
    Setup->>Agent: Launch eval-watch prompt
    Agent->>File: Validate run cohort
    Agent->>Analytics: Poll cohort-only evals
    Analytics-->>Agent: Import and eval progress
Loading
High-Level Assessment

The chosen design is appropriate: it reuses the existing import pipeline, adds internal selection/reporting seams instead of public flags, isolates long-running work in a detached child, and constrains agent analytics through a secure per-run cohort. A wholly separate setup importer would duplicate classification and routing logic, while keeping the full import synchronous would preserve the original onboarding delay.

Files changed (61) +6328 / -300

Enhancement (28) +1118 / -115
SKILL.mdAdd cohort-scoped eval-watch agent skill +187/-0

Add cohort-scoped eval-watch agent skill

• Introduces a fail-closed skill that validates handoff files, binds to the correct server, and polls analytics only for validated cohort session IDs.

kcap/skills/eval-watch/SKILL.md

AgentsSkillsInstaller.csRegister the eval-watch skill +2/-1

Register the eval-watch skill

• Adds eval-watch to the set of skills installed for supported coding agents.

src/Capacitor.Cli.Core/AgentsSkillsInstaller.cs

BackgroundImportLaunch.csModel detached import launch results +5/-0

Model detached import launch results

• Adds the status, log path, exit code, and error result returned by background import spawning.

src/Capacitor.Cli/Commands/BackgroundImportLaunch.cs

BackgroundImportSpawner.csSpawn remaining imports as detached children +60/-0

Spawn remaining imports as detached children

• Starts an all-session import with pinned profile and visibility settings, owner-only logging, detached streams, and startup-status detection.

src/Capacitor.Cli/Commands/BackgroundImportSpawner.cs

BackgroundImportStatus.csDefine background import states +3/-0

Define background import states

• Adds statuses for unnecessary, running, immediately successful, and failed background imports.

src/Capacitor.Cli/Commands/BackgroundImportStatus.cs

DetachedImportLog.csDefine the detached import logging contract +23/-0

Define the detached import logging contract

• Reads internal environment settings and appends detached import output to a pre-created log file.

src/Capacitor.Cli/Commands/DetachedImportLog.cs

ForegroundImportOutcome.csNormalize foreground import outcomes +31/-0

Normalize foreground import outcomes

• Converts runner selection, partition, and fault data into a complete or incomplete setup-level result.

src/Capacitor.Cli/Commands/ForegroundImportOutcome.cs

ForegroundSelection.csSelect recent foreground import units +61/-0

Select recent foreground import units

• Selects whole chains and routed parent-child units up to the foreground cap while recording candidates and remainder state.

src/Capacitor.Cli/Commands/ForegroundSelection.cs

HandoffAgentLauncher.csLaunch a profile-pinned coding agent +39/-0

Launch a profile-pinned coding agent

• Starts the selected agent interactively with the handoff prompt, removes ambient URL overrides, and detects fast launch failures.

src/Capacitor.Cli/Commands/HandoffAgentLauncher.cs

HandoffCohort.csDefine handoff cohort completeness +3/-0

Define handoff cohort completeness

• Adds exact, partial-exact, and unknown cohort classifications for handoff records.

src/Capacitor.Cli/Commands/HandoffCohort.cs

HandoffDecision.csCentralize eval handoff eligibility decisions +27/-0

Centralize eval handoff eligibility decisions

• Implements ordered suppression rules covering import results, background status, analytics entitlement, installed skills, and detected agents.

src/Capacitor.Cli/Commands/HandoffDecision.cs

HandoffLaunchRecipe.csDefine launch recipes for nine agent CLIs +22/-0

Define launch recipes for nine agent CLIs

• Maps each supported agent to its interactive command arguments while preserving the prompt as one argument.

src/Capacitor.Cli/Commands/HandoffLaunchRecipe.cs

HandoffLaunchResult.csModel agent launch outcomes +7/-0

Model agent launch outcomes

• Adds launch status, exit code, and error data for agent handoff attempts.

src/Capacitor.Cli/Commands/HandoffLaunchResult.cs

HandoffSuppressedReason.csDefine stable handoff suppression reasons +15/-0

Define stable handoff suppression reasons

• Adds the closed suppression-reason set and its serialized wire names.

src/Capacitor.Cli/Commands/HandoffSuppressedReason.cs

HandoffVendorEligibility.csResolve agents eligible for eval handoff +29/-0

Resolve agents eligible for eval handoff

• Filters detected agents by their vendor-specific eval-watch installation location and resolved executable.

src/Capacitor.Cli/Commands/HandoffVendorEligibility.cs

IBackgroundImportSpawner.csAdd background import spawning abstraction +7/-0

Add background import spawning abstraction

• Defines the request and injectable interface used to start the detached remainder import.

src/Capacitor.Cli/Commands/IBackgroundImportSpawner.cs

IHandoffAgentLauncher.csAdd agent handoff launcher abstraction +8/-0

Add agent handoff launcher abstraction

• Defines the profile-pinned launch request and blocking launcher interface.

src/Capacitor.Cli/Commands/IHandoffAgentLauncher.cs

ImportCommand.csAdd recent-first capped import selection and reporting +66/-24

Add recent-first capped import selection and reporting

• Orders imports newest-first, supports internal foreground caps, preserves routed units, and reports selected IDs plus per-session outcomes.

src/Capacitor.Cli/Commands/ImportCommand.cs

ImportHandoffFile.csPersist secure per-run import handoffs +92/-0

Persist secure per-run import handoffs

• Serializes bounded cohort metadata to owner-only, atomic, no-clobber files and prunes records older than seven days.

src/Capacitor.Cli/Commands/ImportHandoffFile.cs

ImportOrdering.csAdd deterministic newest-first import comparators +32/-0

Add deterministic newest-first import comparators

• Orders candidates, routed sessions, and chains by descending timestamps with stable session-ID tie-breaking.

src/Capacitor.Cli/Commands/ImportOrdering.cs

ImportRunPartition.csRecord per-session import results +10/-0

Record per-session import results

• Introduces succeeded, skipped, and failed ID partitions for capped import runs.

src/Capacitor.Cli/Commands/ImportRunPartition.cs

ImportRunSelection.csRecord capped import selection metadata +9/-0

Record capped import selection metadata

• Introduces candidate IDs, selected IDs, and remainder state captured before import execution.

src/Capacitor.Cli/Commands/ImportRunSelection.cs

RoutedUnit.csGroup routed parents with correlated children +33/-0

Group routed parents with correlated children

• Models routed sessions as parent-centered units so child sessions remain attached during foreground selection.

src/Capacitor.Cli/Commands/RoutedUnit.cs

SetupCommand.csOrchestrate machine-wide import and agent handoff +292/-62

Orchestrate machine-wide import and agent handoff

• Reworks setup’s terminal import into discovery, confirmation, capped foreground work, detached remainder processing, secure handoff creation, and agent selection. Unattended setup performs a synchronous uncapped import without handoff.

src/Capacitor.Cli/Commands/SetupCommand.cs

SetupDecisions.csRemove the repository gate from setup imports +8/-10

Remove the repository gate from setup imports

• Allows authenticated machine-wide imports from any directory while retaining authentication, opt-out, and prompt decisions.

src/Capacitor.Cli/Commands/SetupDecisions.cs

SetupImportDiscovery.csModel totalized setup discovery results +5/-0

Model totalized setup discovery results

• Adds a result wrapper that carries either discovered history or a captured fault.

src/Capacitor.Cli/Commands/SetupImportDiscovery.cs

SetupImportRun.csModel totalized setup import runs +10/-0

Model totalized setup import runs

• Adds a runner result containing exit status, selection, completed outcome, and any captured exception.

src/Capacitor.Cli/Commands/SetupImportRun.cs

Program.csHonor the detached import process contract +32/-18

Honor the detached import process contract

• Redirects detached import output to the designated log, detaches the terminal, and applies the foreground visibility stamp.

src/Capacitor.Cli/Program.cs

Refactor (3) +71 / -33
ISetupImportRunner.csExpand the setup import runner contract +7/-6

Expand the setup import runner contract

• Adds discovery and totalized run results so setup can consume selections, outcomes, and faults without exceptions escaping.

src/Capacitor.Cli/Commands/ISetupImportRunner.cs

ImportInvocation.csGeneralize setup import invocation parameters +8/-5

Generalize setup import invocation parameters

• Replaces the required repository scope with arbitrary scope, optional cap, current-repository hint, and title behavior.

src/Capacitor.Cli/Commands/ImportInvocation.cs

SetupImportRunner.csSupport discovery and detailed import outcomes +56/-22

Support discovery and detailed import outcomes

• Runs machine-wide discovery and imports through the existing command while capturing callbacks and converting exceptions into result data.

src/Capacitor.Cli/Commands/SetupImportRunner.cs

Tests (24) +1344 / -145
AgentsSkillsInstallerTests.csUpdate the expected installed skill set +1/-1

Update the expected installed skill set

• Includes eval-watch in the installer source-name contract.

test/Capacitor.Cli.Core.Tests.Unit/AgentsSkillsInstallerTests.cs

OwnerOnlyFileTests.csTest secure owner-only file creation +27/-0

Test secure owner-only file creation

• Verifies Unix permissions, no-clobber behavior, and refusal to write through existing symlinks.

test/Capacitor.Cli.Core.Tests.Unit/OwnerOnlyFileTests.cs

BackgroundImportSpawnerTests.csTest detached import process spawning +97/-0

Test detached import process spawning

• Covers arguments, environment isolation, visibility propagation, startup statuses, existing files, and unwritable directories.

test/Capacitor.Cli.Tests.Unit/Commands/BackgroundImportSpawnerTests.cs

DetachedImportLogTests.csTest detached logging behavior +37/-0

Test detached logging behavior

• Verifies environment parsing, visibility coupling, append semantics, and missing-file rejection.

test/Capacitor.Cli.Tests.Unit/Commands/DetachedImportLogTests.cs

FakeBackgroundImportSpawner.csAdd a background spawner test double +14/-0

Add a background spawner test double

• Captures spawn requests and supplies configurable running, exited, or failed results.

test/Capacitor.Cli.Tests.Unit/Commands/FakeBackgroundImportSpawner.cs

FakeHandoffAgentLauncher.csAdd an agent launcher test double +13/-0

Add an agent launcher test double

• Captures handoff launch requests and supplies successful or failed launch results.

test/Capacitor.Cli.Tests.Unit/Commands/FakeHandoffAgentLauncher.cs

FakeImportRunner.csExpand the setup import runner test double +30/-7

Expand the setup import runner test double

• Supports discovery, selection, partition, exit, and fault scenarios under the totalized runner contract.

test/Capacitor.Cli.Tests.Unit/Commands/FakeImportRunner.cs

ForegroundImportOutcomeTests.csTest foreground outcome normalization +54/-0

Test foreground outcome normalization

• Covers complete, incomplete, pre-selection fault, post-selection fault, and empty-run cases.

test/Capacitor.Cli.Tests.Unit/Commands/ForegroundImportOutcomeTests.cs

ForegroundSelectionTests.csTest capped foreground selection rules +120/-0

Test capped foreground selection rules

• Covers whole-chain selection, routed units, correlated children, replay rows, probe errors, remainder detection, and candidate ordering.

test/Capacitor.Cli.Tests.Unit/Commands/ForegroundSelectionTests.cs

HandoffAgentLauncherTests.csTest profile-pinned agent launches +71/-0

Test profile-pinned agent launches

• Verifies command construction, environment isolation, interactive streams, fast failures, and normal process exits.

test/Capacitor.Cli.Tests.Unit/Commands/HandoffAgentLauncherTests.cs

HandoffDecisionTests.csTest handoff decision precedence +50/-0

Test handoff decision precedence

• Exercises every suppression row, successful offers, unknown cohorts, and precedence over analytics entitlement.

test/Capacitor.Cli.Tests.Unit/Commands/HandoffDecisionTests.cs

HandoffLaunchRecipeTests.csTest all agent launch recipes +29/-0

Test all agent launch recipes

• Pins command arguments for all nine vendors and ensures complete harness-registry coverage.

test/Capacitor.Cli.Tests.Unit/Commands/HandoffLaunchRecipeTests.cs

HandoffVendorEligibilityTests.csTest vendor skill eligibility +48/-0

Test vendor skill eligibility

• Verifies detection, executable resolution, shared skill locations, and Kiro’s vendor-specific directory.

test/Capacitor.Cli.Tests.Unit/Commands/HandoffVendorEligibilityTests.cs

ImportChainTests.csTest deterministic recent-first chain ordering +48/-0

Test deterministic recent-first chain ordering

• Ensures newest chains dispatch first while continuation members retain ascending order and stable tie-breaking.

test/Capacitor.Cli.Tests.Unit/Commands/ImportChainTests.cs

ImportHandoffFileTests.csTest handoff serialization and secure publication +93/-0

Test handoff serialization and secure publication

• Pins the JSON schema, cohort truncation, unknown cohorts, owner-only permissions, retention, and no-clobber behavior.

test/Capacitor.Cli.Tests.Unit/Commands/ImportHandoffFileTests.cs

ImportOrderingTests.csTest import ordering comparators +52/-0

Test import ordering comparators

• Covers recent-first ordering, unresolved timestamps, deterministic ties, and routed-candidate consistency.

test/Capacitor.Cli.Tests.Unit/Commands/ImportOrderingTests.cs

ImportSelectionReportingTests.csTest capped import checkpoints end to end +122/-0

Test capped import checkpoints end to end

• Verifies selection precedes uploads, partitions capture success and failure, empty runs report correctly, and uncapped behavior remains unchanged.

test/Capacitor.Cli.Tests.Unit/Commands/ImportSelectionReportingTests.cs

PluginCommandSkillsTests.csTest eval-watch skill ownership +4/-0

Test eval-watch skill ownership

• Asserts that plugin installation recognizes eval-watch as a maintained skill.

test/Capacitor.Cli.Tests.Unit/Commands/PluginCommandSkillsTests.cs

RoutedUnitTests.csTest routed parent-child grouping +50/-0

Test routed parent-child grouping

• Covers correlated children, orphan handling, and ineligibility of already-loaded parents.

test/Capacitor.Cli.Tests.Unit/Commands/RoutedUnitTests.cs

SetupChosenServerTests.csProvide new setup process collaborators +1/-0

Provide new setup process collaborators

• Updates setup test construction with background spawner and handoff launcher doubles.

test/Capacitor.Cli.Tests.Unit/Commands/SetupChosenServerTests.cs

SetupCommandTests.csTest the complete setup import handoff flow +245/-87

Test the complete setup import handoff flow

• Adds coverage for discovery, foreground and background work, secure handoff failures, browser and unattended paths, prompt pinning, agent fallback, and next steps.

test/Capacitor.Cli.Tests.Unit/Commands/SetupCommandTests.cs

SetupDecisionsTests.csTest machine-wide setup import decisions +10/-49

Test machine-wide setup import decisions

• Replaces repository-gated expectations with authentication, opt-out, unattended, and declined-prompt cases.

test/Capacitor.Cli.Tests.Unit/Commands/SetupDecisionsTests.cs

SetupFacadeParityTests.csUpdate setup facade test dependencies +2/-1

Update setup facade test dependencies

• Adapts setup construction to the totalized import runner and new process collaborators.

test/Capacitor.Cli.Tests.Unit/Commands/SetupFacadeParityTests.cs

SetupImportRunnerTests.csTest totalized setup import execution +126/-0

Test totalized setup import execution

• Covers empty discovery, empty and real capped runs, complete partitions, and filesystem scan faults without exception propagation.

test/Capacitor.Cli.Tests.Unit/Commands/SetupImportRunnerTests.cs

Documentation (4) +3781 / -7
README.mdDocument machine-wide setup imports and eval handoff +8/-6

Document machine-wide setup imports and eval handoff

• Updates setup and unattended-mode documentation for machine-wide imports, recent-first prioritization, background processing, and agent handoff behavior.

README.md

2026-09-17-ai2169-setup-import-eval-handoff.mdAdd detailed implementation plan +2825/-0

Add detailed implementation plan

• Documents the task-by-task implementation, interfaces, tests, security constraints, and verification strategy for the setup import redesign.

docs/superpowers/plans/2026-09-17-ai2169-setup-import-eval-handoff.md

2026-09-17-ai2169-setup-import-eval-handoff-design.mdAdd machine-wide import and handoff design specification +946/-0

Add machine-wide import and handoff design specification

• Defines ordering, foreground selection, detached processing, handoff persistence, agent launch, eval-watch safety, and failure semantics.

docs/superpowers/specs/2026-09-17-ai2169-setup-import-eval-handoff-design.md

help-plugin.txtList eval-watch in plugin help +2/-1

List eval-watch in plugin help

• Updates plugin help output to include the newly installable eval-watch skill.

src/Capacitor.Cli.Core/Resources/help-plugin.txt

Other (2) +14 / -0
OwnerOnlyFile.csAdd secure no-clobber file creation +12/-0

Add secure no-clobber file creation

• Provides owner-only file creation on Unix using CreateNew semantics to reject existing files and symlinks.

src/Capacitor.Cli.Core/OwnerOnlyFile.cs

CommandServices.csRegister import handoff process services +2/-0

Register import handoff process services

• Registers the background import spawner and foreground agent launcher with dependency injection.

src/Capacitor.Cli/Commands/CommandServices.cs

@qodo-code-review

qodo-code-review Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Imported evaluations miss handoff window ✗ Dismissed 🔗 Cross-repo conflict ≡ Correctness
Description
The eval-watch skill stops polling ten minutes after its first snapshot, although kcap-server
normally handles historical imports through its hourly recovery scan rather than the live
auto-evaluation path. When setup imports sessions whose timestamps are more than five minutes old
shortly after a recovery pass, the server cannot enqueue their evaluations before the watcher
closes, so the handoff observes no results.
Code

kcap/skills/eval-watch/SKILL.md[147]

+4. 10 minutes since the first snapshot → stop. No new poll starts after the deadline, but a poll
Relevance

●●● Strong

Clear handoff timing bug; historical import recovery can exceed the watcher deadline.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR imposes a ten-minute deadline while acknowledging an hourly recovery sweep. kcap-server only
creates active registry entries for events within a five-minute live window, auto-evaluation
consumes removal signals from that registry, and the fallback recovery scan defaults to a 60-minute
interval.

kcap/skills/eval-watch/SKILL.md[140-170]
External repo: kurrent-io/kcap-server, src/Capacitor.Server.Services/ReadModels/SessionProjector.cs [42-53]
External repo: kurrent-io/kcap-server, src/Capacitor.Server.Services/ReadModels/SessionProjector.cs [688-700]
External repo: kurrent-io/kcap-server, src/Capacitor.Server/Evals/AutoEvalService.cs [68-82]
External repo: kurrent-io/kcap-server, src/Capacitor.Server/Evals/AutoEvalService.cs [153-195]
External repo: kurrent-io/kcap-server, src/Capacitor.Server.Services/Evals/AutoEvalConfig.cs [13-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The ten-minute eval-watch deadline is incompatible with kcap-server's evaluation scheduling for historical imports. Historical events do not enter the live-session registry, leaving the hourly recovery scan as their normal evaluation path.

## Fix Focus Areas
- kcap/skills/eval-watch/SKILL.md[140-170]
- /cross_repos/kcap-server/src/Capacitor.Server.Services/ReadModels/SessionProjector.cs[42-53]
- /cross_repos/kcap-server/src/Capacitor.Server/Evals/AutoEvalService.cs[153-195]
- /cross_repos/kcap-server/src/Capacitor.Server.Services/Evals/AutoEvalConfig.cs[13-22]

## Recommended Fix
Coordinate a kcap-server change that immediately enqueues newly projected historical session ends for auto-evaluation while retaining the existing eligibility and deduplication checks. Until that server behavior is available, extend or defer the watcher so its deadline spans the configured recovery interval rather than promising results within ten minutes.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Console capture tests can interfere ✓ Resolved 📘 Rule violation ▣ Testability
Description
An_unwritable_config_dir_warns_on_the_handoff_file_and_still_completes_the_step creates
SpectreCapture, which replaces the process-wide AnsiConsole.Console, without a bare
[NotInParallel] attribute. When another test writes through Spectre concurrently, either test can
capture the other test's output or restore the singleton while it is still in use.
Code

test/Capacitor.Cli.Tests.Unit/Commands/SetupCommandTests.cs[994]

+        using var capture = new SpectreCapture();
Relevance

●●● Strong

Console-global capture isolation is repeatedly accepted as requiring bare non-parallel protection.

PR-#751
PR-#656

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 2741710 requires every test that captures or asserts on console output, including through a
higher-level helper, to carry a bare [NotInParallel]. The changed test constructs
SpectreCapture, while that helper replaces and later restores the global AnsiConsole.Console.

Rule 2741710: Annotate console-output-capturing tests with bare [NotInParallel]
test/Capacitor.Cli.Tests.Unit/Commands/SetupCommandTests.cs[987-1005]
test/Capacitor.Cli.Tests.Unit/Commands/SetupCommandTests.cs[1040-1054]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A test replaces the process-wide Spectre console without the required bare `[NotInParallel]` attribute, allowing concurrent tests to interfere with its capture.

## Fix Focus Areas
- test/Capacitor.Cli.Tests.Unit/Commands/SetupCommandTests.cs[987-994]

## Recommended Fix
Add a bare `[NotInParallel]` attribute to the console-capturing test method, with no key or constructor argument.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Analytics can forge result links ✓ Resolved 🐞 Bug ⛨ Security
Description
The eval-watch skill filters analytics rows only by session_id but interpolates the unvalidated
repo_hash response field into its result-link template. When an analytics response contains a
malformed repo_hash, the agent can present a link with unintended path or URL syntax despite the
skill's rule never to splice unvalidated values into links.
Code

kcap/skills/eval-watch/SKILL.md[R180-181]

+2. Links: with a repo hash `<server_url>/repo/<repo_hash>/sessions/<session_id>?tab=evaluation`;
+   without one `<server_url>/sessions/<session_id>?tab=evaluation`; all results
Relevance

●●● Strong

Security finding matches the skill’s explicit fail-closed URL-safety requirement.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The skill's query explicitly requests s.repo_hash, but its response-processing rule only checks
whether session_id belongs to the cohort. The close instructions then place repo_hash directly
in a URL while the safety rule prohibits inserting unvalidated values into links.

kcap/skills/eval-watch/SKILL.md[27-34]
kcap/skills/eval-watch/SKILL.md[107-120]
kcap/skills/eval-watch/SKILL.md[176-184]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`repo_hash` is returned from `query_analytics` and is used to construct result links, but the skill defines no validation rule for it. This violates the skill's own no-unvalidated-values-in-links boundary and permits malformed response data to affect the link the agent shows.

## Fix Focus Areas
- kcap/skills/eval-watch/SKILL.md[22-34]
- kcap/skills/eval-watch/SKILL.md[107-120]
- kcap/skills/eval-watch/SKILL.md[176-184]

## Recommended Fix
Define a strict allowed grammar and length limit for `repo_hash`, validate each returned value before retaining it for link generation, and fall back to the session-only link whenever it is absent or invalid. State explicitly that invalid repository hashes must not be interpolated into links.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Antigravity handoff rejects its prompt ✗ Dismissed 🐞 Bug ≡ Correctness
Description
HandoffLaunchRecipe.All launches Antigravity with -i, while the repository’s Antigravity
integration defines headless prompting as agy -p <prompt>. Selecting Antigravity therefore causes
the handoff launch to reject or miss its initial prompt, falling back only if the process fails
within the launcher's two-second window.
Code

src/Capacitor.Cli/Commands/HandoffLaunchRecipe.cs[18]

+        [HarnessId.Antigravity] = new(HarnessId.Antigravity, ["-i"]),
Relevance

●●● Strong

Concrete CLI contract mismatch; accepted Antigravity precedents favor correcting vendor-specific
invocation behavior.

PR-#256

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new recipe passes -i unchanged through the launcher, but the existing Antigravity path
documentation identifies agy -p as the supported headless invocation.

src/Capacitor.Cli/Commands/HandoffLaunchRecipe.cs[18-21]
src/Capacitor.Cli/Commands/HandoffAgentLauncher.cs[18-21]
src/Capacitor.Cli.Core/Harness/Antigravity/AntigravityPaths.cs[47-51]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Antigravity handoff recipe passes `-i`, but this repository documents and uses `agy -p <prompt>` for headless prompting. As a result, the launched agent may reject the handoff or start without receiving it.

## Fix Focus Areas
- src/Capacitor.Cli/Commands/HandoffLaunchRecipe.cs[18-21]
- src/Capacitor.Cli.Core/Harness/Antigravity/AntigravityPaths.cs[47-51]

## Recommended Fix
Change Antigravity's leading argument from `-i` to `-p`, and update the launch-recipe test to assert the resulting argv is `-p` followed by the complete prompt as one argument.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (5)
5. Setup comments preserve phase labels ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The modified setup comments describe behavior as Step 6 and compare it with Step-4, while
another new comment attributes the foreground cap to the plan. These labels depend on external
planning coordinates rather than the current methods and conditions, so later reordering or removal
of setup stages leaves misleading documentation across the decision and execution paths.
Code

src/Capacitor.Cli/Commands/SetupDecisions.cs[R112-115]

+    /// The eligibility + policy decision for Step 6 (import past sessions machine-wide). Guard
+    /// order: auth requirements unsatisfied → skip; <c>--skip-import</c> → skip;
+    /// <c>--no-prompt</c> → run without prompting (mirrors the Step-4 unified-install auto-yes
+    /// under unattended setup); otherwise the caller's interactive yes/no prompt decides.
Relevance

●●● Strong

Recent precedent accepted removing drift-prone setup phase labels from comments.

PR-#765

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 2897915 prohibits task or phase labels and design-plan metadata in comments. The changed
comments explicitly use Step 6, Step-4, and the plan's chosen bound rather than describing
only the current behavioral constraints.

Rule 2897915: Avoid time-sensitive or process-reference metadata in code comments
src/Capacitor.Cli/Commands/SetupDecisions.cs[112-115]
src/Capacitor.Cli/Commands/SetupCommand.cs[1231-1232]
src/Capacitor.Cli/Commands/SetupCommand.cs[1258-1265]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Modified comments retain external setup-step and planning labels whose meaning can become stale independently of the code they document.

## Fix Focus Areas
- src/Capacitor.Cli/Commands/SetupDecisions.cs[112-115]
- src/Capacitor.Cli/Commands/SetupCommand.cs[1231-1232]
- src/Capacitor.Cli/Commands/SetupCommand.cs[1258-1261]

## Recommended Fix
Rewrite the comments in terms of the current machine-wide import decision, foreground cap, unattended behavior, and handoff flow; remove `Step 6`, `Step-4`, and references to an external plan.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Unattended failures lack retry guidance ✓ Resolved 🐞 Bug ◔ Observability
Description
RunImportStepAsync checks only SetupImportRun.Fault and ExitCode in the NoPrompt branch,
ignoring run.Outcome.AnythingFailed. Because HandleImport deliberately returns zero when
individual sessions or visibility updates fail, unattended setup omits its failure warning and retry
instructions for those partial or total failures.
Code

src/Capacitor.Cli/Commands/SetupCommand.cs[R1331-1333]

+            } else if (run.ExitCode != 0) {
+                AnsiConsole.MarkupLine(
+                    "  [yellow]⚠[/] Import of past sessions did not complete. Run [cyan]kcap import[/] manually to retry.");
Relevance

●●● Strong

Directly matches accepted setup-import precedent requiring structured partial-failure outcomes and
retry guidance.

PR-#675

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed no-prompt branch derives completion solely from Fault and ExitCode, while
ImportCommand explicitly states that its exit code cannot represent session-level success and
exposes AnythingFailed for callers to use.

src/Capacitor.Cli/Commands/SetupCommand.cs[1317-1336]
src/Capacitor.Cli/Commands/SetupImportRunner.cs[57-64]
src/Capacitor.Cli/Commands/ImportCommand.cs[648-670]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The unattended setup branch derives import success from faults and the exit code even though the import command returns zero for per-session failures. This prevents setup from displaying its retry warning for partial or total session failures.

## Fix Focus Areas
- src/Capacitor.Cli/Commands/SetupCommand.cs[1328-1336]
- src/Capacitor.Cli/Commands/ImportCommand.cs[648-670]

## Recommended Fix
After checking `Fault`, also treat a missing outcome or `run.Outcome.AnythingFailed` as an incomplete import and print the existing retry warning. Add coverage for a zero exit code accompanied by failed session or visibility counts.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Six files mix primary declarations ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
ForegroundSelection.cs, ForegroundImportOutcome.cs, HandoffVendorEligibility.cs,
HandoffLaunchResult.cs, IBackgroundImportSpawner.cs, and IHandoffAgentLauncher.cs each define
two top-level primary types without matching an allowed exception. Searching for or moving the
request, plan, status, and vendor types now requires knowing that their declarations live in files
named after another type.
Code

src/Capacitor.Cli/Commands/IBackgroundImportSpawner.cs[R3-5]

+internal sealed record BackgroundImportRequest(string RunId, string ProfileName, string DefaultVisibility, string WorkingDirectory);
+
+internal interface IBackgroundImportSpawner {
Relevance

●● Moderate

Recent precedent rejected broad one-type-per-file refactors, but this rule violation may be more
direct.

PR-#817

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3162234 permits only one primary type per file outside narrow exceptions. The cited files pair
independent records or enums with interfaces, records, or static service types, and these pairings
are neither enum-extension classes nor tiny implementation hierarchies nor registry-private
descriptor types.

Rule 3162234: One primary type per file, with only narrow documented exceptions
src/Capacitor.Cli/Commands/IBackgroundImportSpawner.cs[3-7]
src/Capacitor.Cli/Commands/IHandoffAgentLauncher.cs[3-8]
src/Capacitor.Cli/Commands/HandoffLaunchResult.cs[3-7]
src/Capacitor.Cli/Commands/ForegroundImportOutcome.cs[3-7]
src/Capacitor.Cli/Commands/HandoffVendorEligibility.cs[6-12]
src/Capacitor.Cli/Commands/ForegroundSelection.cs[3-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Six new source files contain multiple top-level primary types that do not fit the documented enum-extension, tiny hierarchy, or descriptor-registry exceptions.

## Fix Focus Areas
- src/Capacitor.Cli/Commands/IBackgroundImportSpawner.cs[3-7]
- src/Capacitor.Cli/Commands/IHandoffAgentLauncher.cs[3-8]
- src/Capacitor.Cli/Commands/HandoffLaunchResult.cs[3-7]
- src/Capacitor.Cli/Commands/ForegroundImportOutcome.cs[3-7]
- src/Capacitor.Cli/Commands/HandoffVendorEligibility.cs[6-12]
- src/Capacitor.Cli/Commands/ForegroundSelection.cs[3-10]

## Recommended Fix
Move each request, status, plan, certainty, and vendor type into its own file whose name exactly matches the type, leaving one primary top-level type in each existing file.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Three tests bypass temp injection ✗ Dismissed 📘 Rule violation ☼ Reliability
Description
OwnerOnlyFileTests, DetachedImportLogTests, and HandoffVendorEligibilityTests construct
disposable TempDir instances inside test methods instead of declaring an injected `[TempDir]
public required` property. Each test class therefore manages temporary-directory creation and
disposal independently of the framework lifecycle expected by the test suite.
Code

test/Capacitor.Cli.Core.Tests.Unit/OwnerOnlyFileTests.cs[R4-7]

+    [Test]
+    public async Task Creates_the_file_owner_only_and_refuses_an_existing_path() {
+        using var tmp = new TempDir();
+        var path = tmp.PathTo("new.log");
Relevance

●● Moderate

Evidence is mixed: recent TempDir injection findings were both accepted and rejected.

PR-#929
PR-#976

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rules 2767480 and 2808173 require framework-instantiated test classes to use an injected public
required [TempDir] property and prohibit manually managed new TempDir() instances. All three new
classes instantiate TempDir directly in their test methods.

Rule 2767480: Dispose TempDir fields outside test classes and prefer TempDir injection inside test classes
Rule 2808173: Use injected [TempDir] public required property in test classes instead of manual fields
test/Capacitor.Cli.Core.Tests.Unit/OwnerOnlyFileTests.cs[3-19]
test/Capacitor.Cli.Tests.Unit/Commands/DetachedImportLogTests.cs[26-30]
test/Capacitor.Cli.Tests.Unit/Commands/HandoffVendorEligibilityTests.cs[16-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Three new test classes manually construct `TempDir` even though test classes must receive it through the framework's `[TempDir]` property injection.

## Fix Focus Areas
- test/Capacitor.Cli.Core.Tests.Unit/OwnerOnlyFileTests.cs[3-19]
- test/Capacitor.Cli.Tests.Unit/Commands/DetachedImportLogTests.cs[5-28]
- test/Capacitor.Cli.Tests.Unit/Commands/HandoffVendorEligibilityTests.cs[6-43]

## Recommended Fix
Add a single `[TempDir] public required TempDir Tmp { get; init; }` property to each class, replace each `new TempDir()` local with that injected property, and remove manual disposal.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Subprocess tests bypass the shared limit ✗ Dismissed 📘 Rule violation ▣ Testability
Description
BackgroundImportSpawnerTests and HandoffAgentLauncherTests start real sleep, true, false,
and shell processes but use class-level [NotInParallel] instead of
[ParallelLimiter<SubprocessLimit>]. Running these suites therefore bypasses the shared subprocess
budget rather than coordinating their child-process load with other process-heavy tests.
Code

test/Capacitor.Cli.Tests.Unit/Commands/BackgroundImportSpawnerTests.cs[R8-11]

+/// <summary>Bare <c>[NotInParallel]</c>: <see cref="PollutedParent"/> seeds <c>KCAP_URL</c> in the
+/// process environment, which every spawned child inherits.</summary>
+[NotInParallel]
+public class BackgroundImportSpawnerTests {
Relevance

●● Moderate

Subprocess limiter findings have mixed outcomes, despite recent acceptance for real subprocess
classes.

PR-#977
PR-#869

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 2808212 requires subprocess-heavy test classes to use the shared subprocess limiter and
explicitly rejects [NotInParallel] as their sole control. Both classes carry [NotInParallel] and
directly start multiple operating-system processes.

Rule 2808212: Use ParallelLimiter<SubprocessLimit> for test classes running real subprocesses
test/Capacitor.Cli.Tests.Unit/Commands/BackgroundImportSpawnerTests.cs[8-11]
test/Capacitor.Cli.Tests.Unit/Commands/BackgroundImportSpawnerTests.cs[22-26]
test/Capacitor.Cli.Tests.Unit/Commands/HandoffAgentLauncherTests.cs[9-12]
test/Capacitor.Cli.Tests.Unit/Commands/HandoffAgentLauncherTests.cs[17-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Two new test classes launch real subprocesses but use `[NotInParallel]` as their only limiter, bypassing the suite-wide subprocess budget.

## Fix Focus Areas
- test/Capacitor.Cli.Tests.Unit/Commands/BackgroundImportSpawnerTests.cs[8-11]
- test/Capacitor.Cli.Tests.Unit/Commands/HandoffAgentLauncherTests.cs[9-12]

## Recommended Fix
Replace the class-level `[NotInParallel]` attributes with `[ParallelLimiter<SubprocessLimit>]`, then isolate any process-environment mutation at the narrowest safe scope without abandoning the shared subprocess limiter.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Cross-repo context — repo relationships
  Explored: repo: kurrent-io/cloud-meta (sha: 15782900)
  Explored: repo: kurrent-io/kcap-server (sha: 56082a8d)
Review mode: 🧠 Deep: This is a high-density cross-cutting change spanning setup orchestration, whole-machine imports, detached processes, handoff files, agent launching, environment/security boundaries, and an unautomated eval-watch skill, with many independent logic sites and substantial blast radius.

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread test/Capacitor.Cli.Tests.Unit/Commands/SetupCommandTests.cs
Comment thread test/Capacitor.Cli.Core.Tests.Unit/OwnerOnlyFileTests.cs
Comment thread src/Capacitor.Cli/Commands/IBackgroundImportSpawner.cs Outdated
Comment thread src/Capacitor.Cli/Commands/SetupDecisions.cs Outdated
Comment thread src/Capacitor.Cli/Commands/HandoffLaunchRecipe.cs
Comment thread src/Capacitor.Cli/Commands/SetupCommand.cs Outdated
Comment thread kcap/skills/eval-watch/SKILL.md Outdated
Comment thread kcap/skills/eval-watch/SKILL.md
realtonyyoung and others added 10 commits September 18, 2026 01:34
…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).
@realtonyyoung
realtonyyoung merged commit a0ad3f2 into main Sep 19, 2026
14 of 15 checks passed
@realtonyyoung
realtonyyoung deleted the tonyyoung/ai-2169-setup-import-eval-handoff branch September 19, 2026 01:45
Sign up for free to 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.

kcap setup: newest-first import, background remainder, and eval-watch agent handoff

1 participant