feat(verify): adopt grok-cli incremental compaction and app-verify workflow - #232
Merged
Conversation
…rkflow Two adoptions from a deep-dive of superagent-ai/grok-cli, restricted to the capabilities verified as genuinely missing from hawk/eyrie: Incremental compaction (internal/engine/compact): - New BuildIncrementalCompactPrompt merges NEW messages into a persisted prior summary instead of re-summarizing the whole transcript; ExtractPriorSummary/PriorSummaryPrefix locate the prior [Conversation summary] block. - generateSummary now detects a prior summary and feeds only post-summary messages through the update prompt. Split-turn handling already existed; only the incremental path was missing. App verification workflow (internal/appverify + AppVerify tool): - Deterministic recipe detection (go/node/python/rust) covering the part ProjectVerify does not: start command, port, and smoke kind (http/cli/none), plus strict Normalize for untrusted recipe JSON. - Manifest contract at .hawk/verify/environment.json: LoadOrDetect persists detection so repeat runs are reproducible; corrupt manifests error instead of silently shadowing detection. - Phased QA prompt (Setup -> Build/Test -> Boot -> Evidence -> Teardown) encoding the discipline that build success is not proof: the app must boot and evidence artifacts are mandatory even on failure. - AppVerify tool (detect | manifest | smoke) with bounded readiness polling, fixed argv execution (no shell), guaranteed teardown, registered in cmd/chat_tools.go with safety capabilities and permission aliases. Remaining grok-cli candidates were assessed out of scope for now: media generation and provider Batch API need provider-side endpoints; X search and Telegram voice STT need provider support; desktop computer-use needs a native accessibility backend. Verification: go build ./... clean; new tests green (appverify 11, compact incremental 5, AppVerify tool 4); engine, compact, tool, safety, cmd and testaudit suites pass; golangci-lint 0 issues; gofmt clean.
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.
Summary
Adopts the two implementable capabilities from a deep-dive of
superagent-ai/grok-cli, restricted to features verified as genuinely missing from hawk/eyrie.Changes
1. Incremental compaction (
internal/engine/compact/)BuildIncrementalCompactPrompt(priorSummary)— merges NEW messages into a persisted prior summary instead of re-summarizing the whole transcript.ExtractPriorSummary/PriorSummaryPrefix— locate the prior[Conversation summary]block.generateSummarynow detects a prior summary and feeds only post-summary messages through the update prompt, preserving already-captured context and saving tokens.2. App verification workflow (
internal/appverify/+AppVerifytool)recipe.go): deterministic go/node/python/rust detection covering whatProjectVerifydoes not — start command, port, and smoke kind (http/cli/none), with strictNormalizefor untrusted recipe JSON.manifest.go): persisted at.hawk/verify/environment.json;LoadOrDetectmakes repeat runs reproducible; corrupt manifests error rather than silently shadowing detection.prompt.go): Setup → Build/Test → Boot → Evidence → Teardown, encoding the discipline that a green build is not proof — the app must boot, and evidence artifacts are mandatory even on failure.AppVerifytool (detect | manifest | smoke): bounded HTTP readiness polling, fixed-argv execution (no shell), guaranteed teardown; registered incmd/chat_tools.gowith safety capabilities + permission aliases.Out of scope (need external provider/backend support)
Media generation, provider Batch API, X search, and Telegram voice STT require provider endpoints not present in eyrie; desktop computer-use requires a native macOS accessibility backend.
Testing
internal/appverify(11 tests), compact incremental (5 tests),AppVerifytool (4 tests)go testsuite (incl. engine, tool, safety, cmd, testaudit),go vetgolangci-lint0 issues,gofmtclean