feat: add pre-recon cache for incremental analysis#227
Open
jvinolas wants to merge 7 commits intoKeygraphHQ:mainfrom
Open
feat: add pre-recon cache for incremental analysis#227jvinolas wants to merge 7 commits intoKeygraphHQ:mainfrom
jvinolas wants to merge 7 commits intoKeygraphHQ:mainfrom
Conversation
- Fix delta agent execution: use PRE_RECON_DELTA_AGENT definition instead of invalid 'pre-recon-delta' AgentName lookup - Strip large payloads from Temporal event history: return lightweight CacheAction instead of CacheCheckResult with 170KB+ strings - Fix cache saving wrong commit hash: capture source HEAD before agent execution (which creates checkpoint commits that change HEAD)
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.
Disclaimer
We are using it to test the same code that evolves with new features and bugfixes, so we found interesting to avoid the long pre-recon phase and just update with diff. I used claude and build and we are using it, but feel free to discard it and instead take this as an improvement request issue if you prefer.
Summary
commit tracking
lightweight delta agent that updates the previous analysis based on the
git diff
diff generation fails
Changes
src/services/prerecon-cache.ts— Cache service withcheckPrereconCache()andsavePrereconCache()src/session-manager.ts—PRE_RECON_DELTA_AGENTdefinition (separatefrom
ALL_AGENTSto avoid breaking resume)src/temporal/activities.ts— Cache check, save, and delta agentactivities
src/temporal/workflows.ts— Phase 1 cache-aware logic (skip / delta /full)
src/services/agent-execution.ts— OptionalAgentDefinitionoverridefor delta execution
prompts/pre-recon-delta.txt— Delta agent prompt templateHow it works
checkPrereconCacheActivityreads.prerecon-cache.jsonfrom the repo's deliverables directoryprevious analysis + diff context
savePrereconCacheActivitywrites thesource commit hash (captured before agent execution to avoid checkpoint
commit interference)
Test plan
pre-recon-deltanot inALL_AGENTS)