Repository navigation
feat(catalog): add context bundler, turn batching, and harness-tailored routing - #126
Merged
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.
Summary
build_subagent_context.py) and codify parallel read/edit batching rules across shared skills, Antigravity, Claude Code, and OpenCode.opsworker pattern (gemini-4-hydrogen-high,0.2x) with observablecum_turns=<N>rotation and strict untrusted-output/write-path guards while enforcing zero Antigravity-only mechanics leakage into Claude Code, Zed, or OpenCode assets.*wildcards that exposed mutating index/delete tools), seteffort: lowoncontext-finderandrunner, install skillscripts/*.{py,sh}as0755, and trackByteOffsetpagination in the Antigravity circuit-breaker hooks.Background
Context
Subagent-driven workflows across Antigravity, Claude Code, Zed, and OpenCode previously incurred avoidable token replay and wall-clock latency from three sources:
file:start-endslices and bounded unified-diff chunks in parallel batches.+58%Agentresume replay penalty and~7xmulti-session Agent Teams overhead).future-model-router,subagent-driven-development,comprehensive-code-review) carrying legacy4-sectionhandoff references or Antigravity-specific primitives (Hydrogen,swarm_wait,baton-pass,peer-pipeline-swarm,/start-small), alongside wildcard MCP tool grants (mcp__codebase-memory-mcp__*) on read-only reviewers.The problem
read_file's46,080-byte per-call limit, forcing extra pagination turns, whileByteOffsetpagination in Antigravity'sautonomous_breaker.pywas not differentiated from true repeated-slice loops.mcp__codebase-memory-mcp__*wildcards on Claude Code read-only reviewers implicitly granted mutatingindex_repositoryanddelete_projectMCP tools, and OpenCode reviewer definitions needed valid booleantools:maps enforcing read-only invariants.scripts/*.py,scripts/*.sh) were installed with0644permissions rather than0755.The fix
build_subagent_context.py): Supportspre-code(## Acceptance Criteriaextraction +--rootrealpath-containedfile:start-endnumbered slices) andpost-code(safe--no-ext-diff --no-textconv --unified diffs for both uncommitted<base>working trees and<base>...<head>ranges), computing a converged two-pass## Read Chunk Indexbounded to both<=700lines and<=38,000UTF-8 bytes with dynamic backtick fences and atomic0600non-symlink writes.internal/catalog/antigravity/): Documents observed Turn-1 floors (22.7k,24.8k,29.3k,45.0k), adds<185kpeak-context guard + parallel batching toimplementerand all 5 read-only reviewers, defines the optional sleepingopsworker (gemini-4-hydrogen-high,cum_turns=<N>rotation,/tmp/*-only writes, untrusted-log safety,baton-passteardown), and tracksByteOffsetinbreaker_rules.pyandautonomous_breaker.py.internal/catalog/claude/): Preserves fresh one-shotAgentdispatches (documenting the+58%resume replay penalty and experimental Agent Teams~7xmultiplier), setseffort: lowoncontext-finderandrunner, and locks all read-only reviewers to explicit read-only tool allowlists (Read, Grep, Glob, ToolSearch+ read-onlycodebase-memory-mcpquery tools only).internal/catalog/opencode/,internal/catalog/shared/): Strips Antigravity-only mechanics fromshared/skills/future-model-router, aligns all shared prompts and OpenCode agents on the5-sectionhandoff, and validates OpenCode YAML booleantools:maps inharness_efficiency_test.go.internal/installer/): Installs.pyand.shfiles under skillscripts/directories with executable mode0755.Test plan
internal/catalog/shared/skills/subagent-driven-development/scripts/test_build_subagent_context.pycoveringpre-codeslice extraction, two-passRead Chunk Indexbyte/line reconstruction, UTF-8 multibyte line splitting under--max-chunk-bytes,--roottraversal/symlink rejection,0600atomic non-symlink writes, dynamic backtick fences, canonicalgit diffflags, and invalid git ref rejection (wired intoMakefileand.github/workflows/test.yaml).internal/catalog/harness_efficiency_test.goverifying zero Antigravity-only mechanics or legacy4-section handoffstrings outsideinternal/catalog/antigravity/, explicit read-only Claude reviewer allowlists, valid OpenCode YAML booleantools:maps,effort: lowhelper frontmatter, PII/email hygiene, and Antigravity floor consistency.TestSkillScriptsInstalledExecutable0755ininternal/installer/installer_test.goandByteOffsetpagination loop tests ininternal/catalog/antigravity/hooks/{test_autonomous_breaker.py,test_breaker_rules.py}.bash scripts/sync-antigravity-from-local.sh,gofmt -l .,HOME=$(mktemp -d) go test -race ./...,make test-python(650shared +125Antigravity hook tests passed),make build, and./skill-installer -y --force --global -t claude --track opinionated.Rollback plan
Revert this PR and re-run
skill-installer(orskill-installer restore) to restore the previous global skill and agent definitions.