Skip to content

AIContext 0.5.0

Pre-release
Pre-release

Choose a tag to compare

@mortylen mortylen released this 08 Nov 08:57
· 50 commits to main since this release

AIContext 0.5.0

AIContext 0.5.0 hardens the CLI and the export. It fixes problems that could delete or write files outside the intended place, and problems that let a mistyped or broken invocation pass silently in CI. Some of the fixes change behavior that scripts may have relied on, so read Changed and Upgrade notes before updating.

Highlights

  • Safer export.
    • Export never writes or deletes outside the project through a symlink or junction. A path that leaves the project is reported as Blocked, nothing is written and the command fails.
    • Exporting a project no longer deletes the generated AGENTS.md of an independent AIContext project in a subdirectory (a directory with its own .aicontext/ is now a project boundary).
    • export and status refuse what validate reports as an error, for example an unsupported specVersion, a wrong type or an unknown property in context.json.
  • Strict CLI arguments. Unknown options, missing values, repeated options and non-boolean values after a flag are errors before anything runs. Previously validate --strcit passed without --strict, export --chek wrote files instead of checking them, and init --path --force ran in the current directory. aicontext <command> --help prints the usage of one command.
  • Secret scan without a size limit. The scanner skipped every file above 512 KiB silently. Files are now read line by line, and a file that cannot be scanned completely is reported as a warning (an error with --strict).
  • Stable diagnostic codes and ExportService. Every validation, rule, secret-scan and export problem has a code (AIC1001 ... AIC4102), a message and a location, and the new ExportService (Plan, Apply, Status) is the safe way to export from your own tools. The CLI now only parses arguments and prints.

New

  • aicontext <command> --help (also -h).
  • aicontext status shows blocked for a target whose files would leave the project through a link.
  • Library: Diagnostic, DiagnosticCodes, ExportService, ExportRequest, ExportPlan, StatusReport, SecretScanner.ScanDirectoryReport, ExportFileStatus.Blocked, SyncState.Blocked, ContextSchema.CanonicalUrl. The codes are listed in the user manual.
  • User manual: monorepo section (independent projects), safety rules of export, troubleshooting rows and the table of diagnostic codes.
  • Tests run in the PR checks on Ubuntu and Windows, and the CLI is tested in-process (about 250 tests in total).

Changed

  • Invalid CLI arguments are rejected with exit code 1 (see above). Flags still accept an explicit true / false / 1 / 0.
  • export and status stop on the errors that validate reports. Warnings (missing recommended files, possible secrets, ...) never block them.
  • Errors on the option level (unsupported target, missing target, unsupported layout) now have the ERROR: prefix and end with No files were written.
  • Library: ContextValidationResult, RuleLoadResult and ContextLoadResult carry a list of diagnostics. Errors and Warnings remain as views with the same messages; only code that constructs these records needs an update.
  • SPEC 6.3, 6.4, 7 and 10 are clarified (no writes outside the project, separate projects, export applies validation errors, the secret lint is a heuristic). The schema and specVersion (0.1.0) are unchanged, so existing context.json files stay valid.

Upgrade notes

dotnet tool update --global AIContext.CLI
aicontext --version
  • Check your scripts and CI for mistyped or unsupported options. They fail now instead of being ignored, and the message lists the valid options of the command.
  • If export now fails with ERROR: context.json ..., the file was accepted before although validate reports the same error. Fix it as aicontext validate shows.
  • If export reports Blocked, a symlink or junction inside the project leads out of it (for example .github). Replace the link with a real directory or point it inside the project.
  • Running export in a monorepo is now safe for nested projects. Run it in each project separately (or add one export --check per project to CI).
  • Library users: update code that constructs ContextValidationResult, RuleLoadResult or ContextLoadResult; use Diagnostics and the codes for machine-readable handling.
  • In CI you can keep using aicontext validate --strict and aicontext export --target all --check.

Known limitations

  • The link checks and the new tests were verified on Windows (junctions) and Linux (symlinks); macOS was not verified.
  • On Windows, an absolute link target written with a different 8.3 short-name form than the project path could be reported as outside the project (it fails closed).
  • Secret detection is heuristic and does not replace a dedicated secret scanner. Only .md, .mdc, .json, .yml, .yaml and .txt files are scanned.
  • The CLI does not print the diagnostic codes yet; they are available to library users.