proomt

Search

Search posts, papers, and topics

All posts

SitePoint17 min readtutorialintermediate

Optimizing GitHub Actions for Agent PRs: Speculative Test Slicing and AST Impact Analysis

Summary

A step‑by‑step guide for handling the flood of pull requests generated by code‑generation agents. It builds a TypeScript CLI that uses ts‑morph to do AST‑level change‑impact analysis, maps affected symbols to tests, and runs only those tests in a “speculative” GitHub Actions job while a full‑suite verification runs in the background. The article includes concrete CLI code, dependency choices, con…

  • Agent‑authored PRs can generate dozens of narrow diffs per day, making full‑suite CI impractical.
  • AST impact analysis (via ts‑morph) can identify exported symbols changed in a diff and resolve their reverse dependency graph to find truly affected files.
  • Map impacted source files to test files (co‑located or glob‑matched) and run only that slice as the blocking CI check.
  • Run a full‑suite verification as a non‑blocking job to catch the rare false‑negative; if it fails, apply a label and alert the team.

CI cost and latency are major bottlenecks for teams that rely on autonomous coding agents. By slicing tests based on precise AST impact, teams can keep feedback loops fast, control cloud‑runner spend, and still retain safety via a background full‑suite run. The approach is reusable across TypeScrip…

6/10

Related reading

  1. Eliminating AI Code Hallucinations with TypeScript Compiler Diagnostics and TDD Loops

    The article shows how to replace raw TypeScript compiler output with a programmatic JSON feedback loop that merges diagnostics and Vitest test failures, feeding the structured data back to an LLM coding agent for self‑correction. It provides concrete code for extracting, enriching, validating, and de‑duplicating errors, and demonstrates token savings and deterministic iteration until compilation…

    SitePointsitepoint.com15 min
  2. Migrating the GitHub Copilot runtime to Rust, using Copilot

    The Copilot agent runtime was rewritten from a 130‑k‑line TypeScript/Node.js codebase into a native Rust library (~830 k lines of Rust) to reduce startup latency, memory use, and improve reliability. The migration was done incrementally (in‑place) across 128 PRs, with AI‑generated code handling most of the work. The new runtime exposes a C ABI for in‑process embedding by all six Copilot SDK langu…

    GitHub Oldgithub.blog65 minHN188
  3. Build a Typed Context Compaction Gate for AI Agents

    A step‑by‑step tutorial showing how to build a typed context‑compaction gate for AI agents in TypeScript using LangChain and Zod. It defines a discriminated‑union schema for keep/summarize/discard actions, implements a fast gpt‑4o‑mini classifier, validates decisions at runtime, and wires the gate as middleware in an agent loop, with testing and production‑grade tuning advice.

    SitePointsitepoint.com16 min
  4. Building Deterministic Multi-Agent State Machines in TypeScript

    The article shows how to build a deterministic, checkpoint‑backed finite state machine engine in TypeScript for orchestrating multi‑agent AI workflows. It uses Zod for schema validation, better‑sqlite3 for atomic persistence, and a pure transition function to make workflows traceable and recoverable in serverless environments.

    SitePointsitepoint.com18 min