feat(ai-autopilot): scale mode — self-maintaining CODE-OVERVIEW.md (#114)#129
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Child of #110. Help the agent navigate a large codebase fast.
Maintains a compact
CODE-OVERVIEW.md— a map of the repo (structure, key modules, entry points, conventions) the agent reads first, before working, so it stays oriented without re-scanning the whole tree and blowing the context budget.The hard part is not generating it once but keeping it current: a stale overview is worse than none. So the trigger is a material-change detector wired into the loop (#113), not on-demand-only and not on every edit.
detectMaterialChange(event)— deterministic, path-driven: build/config change (package.json,*.config.ts,turbo.json, ...), test-framework migration (vitest/jest/playwrightconfig), a directory restructure (summary keywords), or a large change spread across many areas. Cheap enough to run on every loop event.CodeOverviewMaintainer— owns the policy: refresh + persist on a material change, skip otherwise, seed the previous overview into regeneration so it revises rather than rewrites.agentOverview(agent)— the default regeneration, anai-sdkagent that reads the tree (via its tools) and returns a structured{ summary, sections }.overviewLoopPrompt(maintainer)— bridges the maintainer into aLoopPrompt, so adding its id to a rule (e.g. onmajor-change) makes the overview self-maintain.CODE-OVERVIEW.mdround-trips viaparseOverview/serializeOverview;loadOverview/saveOverviewpersist over anOverviewFs(a runner session'sfssatisfies it, same as the decisions store).Matches the landscape note on the issue (Cloudflare's "instructions rot fast" reviewer): auto-maintenance is the whole point, and the regen trigger is a material-change detector, not on-demand.
Regeneration is injected, so the whole policy is tested offline against a stub. Tests: markdown round-trip, the detector (build/test/restructure/many-files/threshold/extra-patterns + routine-edit skip), the maintainer (material refresh + persist, immaterial skip, previous seeding, on-demand generate, load, observer isolation), and
agentOverview+overviewLoopPromptagainst a real Loop. Full suite 189 green.Closes #114.