Skip to content
VerificationWould you notice if your agent drifted in production?Explore the 5-stage harness›
Development & CLI

Fast Preflight Checks (aegil check)

This guide shows how to run instant, in-memory preflight validation on your Aegil project using aegil check.

Use preflight checks to validate configuration files, TypeSpec syntax, and build freshness without writing files to disk or requiring a running Docker daemon.

Run aegil check:

  • In Git pre-commit hooks to block invalid specs before committing.
  • Inside IDE file watchers or editor diagnostics.
  • As the fast-failing initial stage in CI/CD pipelines before heavy test matrices.
  • To confirm your workspace is fresh before running aegil verify.

When you run:

Terminal window
aegil check

Aegil performs the following checks purely in memory:

  1. Project Configuration (aegil.yaml):

    • Validates project name, reverse-DNS ID, and namespace.
    • Verifies pinned toolchain versions (Dart SDK, Flutter SDK, Serverpod).
  2. TypeSpec AST & Semantic Analysis:

    • Parses all files under specs/**/*.tsp.
    • Confirms the feature folder boundary rule: domain specs must reside in specs/<feature>/*.tsp (flags ERR_SPEC_MISPLACED).
    • Validates model entities, primary keys (@pk), relation targets, and foreign keys.
    • Enforces CEL policy syntax and ensures @public is not applied to protected entities.
    • Validates finite state machine transitions and initial states.
  3. Ownership Plan & Freshness:

    • Computes what aegil build would generate and compares it against current .aegil/ output.
    • Detects if specifications or hooks have changed since the last build (ERR_STALE_BUILD).

In --agent or --json mode:

Terminal window
aegil check --agent

Output on success:

{
"status": "VALID",
"project": "notes",
"features": ["notes"],
"models": ["Note"],
"operations": ["listNotes", "addNote"]
}

Output on syntax or configuration failure:

{
"status": "ERROR",
"code": "ERR_SPEC_MISPLACED",
"message": "Domain spec 'specs/notes.tsp' must be inside a feature folder: specs/notes/notes.tsp",
"file": "specs/notes.tsp"
}