Skip to content

Headless bootstrap: skip file scan, watcher, scheduler and runtime installs on one-shot runs #148

Open

Description

@byapparov

Context

InstanceBootstrap (project/bootstrap.ts:16-31) starts the same subsystems for a one-shot headless run as for a long-lived interactive session.

Subsystem What it does at startup Needed for run?
File.init() full Ripgrep.files scan of the repo (file/index.ts:334-412), for autocomplete no
FileWatcher.init() @parcel/watcher on .git. Skipped only when AICTRL_HEADLESS=true (file/watcher.ts:123), which only headless.ts sets no
Snapshot.init() / Truncate.init() Scheduler.register runs each task immediately (scheduler/index.ts:46): git gc --prune=7.days on the snapshot dir, and a glob plus unlink over tool output no
ShareNext.init() bus subscription that syncs to the share endpoint once a share exists only with --share
Config deps runs bun install in any .aictrl dir that has a package.json and no node_modules (config/config.ts:152-158, 246-283). In fresh CI containers this is a network install on every run rarely
Plugin.init() config plugins go through BunProc.install. An unpinned (latest) plugin triggers a registry check or bun add (plugin/index.ts:56-71) only if configured

Proposal

  • Add a headless bootstrap path for run. It initialises Plugin, Format and only what tools need, and skips the File scan, watcher, Vcs, share (unless --share) and scheduler.
  • Defer the first scheduler run by one interval, or skip the scheduler entirely for one-shot runs.
  • For the bun install and unpinned-plugin installs, log a warning event in headless mode. Consider failing closed when a network install would happen mid-run, in line with the security rationale in Remove the LSP subsystem (executor-only harness; no measured benefit, security + noise cost) #144.

Acceptance

Activity

  1. added
    enhancementNew feature or request
    P2Could have - Medium
    securitySecurity vulnerabilities and hardening
    performancePerformance optimization
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Could have - MediumenhancementNew feature or requestperformancePerformance optimizationsecuritySecurity vulnerabilities and hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions