Repository navigation
feat(antigravity): add planner subagent, turn-1 manifest, and 200k subagent cap - #127
Merged
Merged
Conversation
…bagent cap - Extend build_subagent_context.py pre-code with --touch and --skills-dir to emit canonical macOS-safe absolute paths for active v4 catalog skills (plus explicit <skill>/SKILL.md references) and in-root product/brief/ design docs under ## Turn-1 Parallel Read Manifest without pasting skill bodies or matching bare prose orchestration slugs. - Extend breaker_rules.classify_swarm_steps to recognize anchored Antigravity <SYSTEM_MESSAGE> swarm board assignments pre-post_message when no USER_INPUT exists, and refactor autonomous_breaker.py into an exhaustive 3-way BATON partition (is_swarm_worker 235k / is_subagent SUBAGENT_TOKEN_CAP=200000 / Coordinator 205k-235k) with dotdot and leaf-symlink guards that preserve symlinked dotfile HOME ancestors. - Ship agents/planner.md in antigravity-subagents v1.3.0 (all 7 agents verified in E2E), wire Turn-1 Parallel Read Manifest across Antigravity, Claude, OpenCode, and shared implementers, and document Stage-1 planner dispatch (3+ files) and Stage-3 ~120k hybrid wrap-up.
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
3+-file Phase 2–3 codebase tracing and planning in Antigravity to a dedicatedplannersubagent (antigravity-subagentsv1.3.0) and define a Stage-3~120k-token (plus observable multi-stream /5+-caller) hybrid Phase 10–12 wrap-up rule so the Root Supervisor stays lean across multi-task sessions.build_subagent_context.py pre-codewith--touchand--skills-dirto deterministically emit canonical absolute paths for matching active v4 catalog skills, explicit<skill>/SKILL.mdreferences, and in-root product/brief/design docs under## Turn-1 Parallel Read Manifestwithout pasting skill bodies into/tmp/subagent-context-*.md.autonomous_breaker.pyandbreaker_rules.pyinto an exhaustive 3-wayBATONpartition (is_swarm_worker235k/is_subagentSUBAGENT_TOKEN_CAP=200000/ Coordinator205k–235k) that recognizes<SYSTEM_MESSAGE>swarm board assignments pre-post_messageand enforces leaf-symlink /..-free.mdwrap-up writes while preserving symlinked dotfileHOMEancestors.Background
Context
In Antigravity multi-phase sessions, Root Supervisor context grows primarily during wide Phase 2–3 file tracing and late Phase 10–12 blast-radius checks, while
invoke_subagenthelpers previously lacked a pre-compaction token guard (if not is_subagent:skippedBATONentirely) and had to discover domain skills ad hoc rather than receiving exact resolvedSKILL.mdpaths in their Turn-1 read batch.The problem
3+-file planning and late wrap-up: Running wide caller traces and untouched-caller audits inline in Root consumes context budget needed for multi-stream supervision and user-voice synthesis.workspace: "share"or isolated worktrees could miss relevant domain skills or uncommitted Phase 0/0½ product/design docs unless pointed at canonical absolute paths on Turn 1.invoke_subagenthelpers vs.SYSTEM_MESSAGEswarm workers: Simply enabling a200kBATONcap onis_subagentwould misclassifyswarmworkers before their firstpost_message(when transcripts contain only<SYSTEM_MESSAGE>board assignments and zeroUSER_INPUTsteps), while ancestor symlink checks on handoff paths would deadlock users whose~/.geminidotfiles live behind a symlink.The fix
plannersubagent & Stage-3~120khybrid wrap-up: Addedagents/planner.md(tools: [read_file, write_file, edit_file, run_command], forbidden from mutating source/test files or guessing UX ambiguity — returns### Open Questions for User, writes git-ignoreddocs/plans/<slug>.md+/tmp/plan-*.md, and runsbuild_subagent_context.py pre-code). Documented lean (<~120k) vs. warm (>=~120kor observable multi-stream/>=25-turn/5+-caller proxies) Phase 10–12 wrap-up routing across Antigravity guides and lifecycle skills.## Turn-1 Parallel Read Manifest:build_subagent_context.py pre-codemaps--slice,--touch, and safe in-rootPLAN.mdpaths to active v4 catalog skills (excluding bare prose mentions of orchestration/meta skills unless written<skill>/SKILL.md) plus in-root product/brief/design docs (cappingdocs/decisions/*.mdto 4), resolving paths withPath.resolve(strict=True)for macOS/private/varcompatibility and wiring manifest batch reads across Antigravity, Claude, OpenCode, and shared implementer prompts.BATONpartition:breaker_rules.classify_swarm_stepsdetects anchored<SYSTEM_MESSAGE>[swarm]/[board]/ board-assignment headers (stopping at the firstcontent=token to prevent prompt spoofing) whennot has_user_input, feeding an exhaustiveif is_swarm_worker(235k) /elif is_subagent(SUBAGENT_TOKEN_CAP=200000) /elseCoordinator (205k/235k) partition with_is_safe_leaf_md_pathvalidation.Pre-existing fixes
_is_h2_handoff_pathand_is_temp_or_brain_md_pathinautonomous_breaker.pyto require.mdsuffixes, reject..segments and leaf symlinks (closingsrc/handoff.pyand/tmp/ctx.md -> src/secret.go), and verify resolved temp-root containment while still permitting symlinkedHOME/~/.geminidotfile ancestors.test_baton_helper_agent_exempt(test_autonomous_breaker.py) from an800k-byte (~200k-token) fixture to test195khelper exemption from the150kCoordinator warning alongside205kenforcement ofSubagent Context Cap.Test plan
make test-python—768 passed):test_build_subagent_context.py:autouseHOMEisolation fixture;--touch+--skills-dirmacOS/private/varresolution; Go/TSX/SQL/SKILL.md/Datadog skill mapping;docs/prd.md,docs/decisions/*.mdcap,docs/point-of-view/*.md, anddirection-approved.mddiscovery; bare orchestration slug exclusion vs. explicit<skill>/SKILL.mdinclusion; symlink escape and..--touchrejection;post-codemanifest preservation; zerotokenize.COMMENTtokens.test_breaker_rules.py,test_autonomous_breaker.py,test_replay_breaker.py: real<SYSTEM_MESSAGE>envelope swarm worker classification pre-post_message(205kallowed,240khits235kworker cap); double-content=prompt-spoof resistance on Coordinator andinvoke_subagent;SUBAGENT_TOKEN_CAP=200000(199kallowed;205kdeniesread_file,run_command,src/handoff.py,.., and leaf symlinks while allowing non-symlinkPLAN.md,docs/plans/*.md,/tmp/*.md, brain.md, andsend_message); symlinkedHOMEdotfileACTIVE_CONTEXT.mdunlock;STRIKESwrap-up.mdedit exemption.go test -race ./...&go test -tags=e2e ./e2e):TestAntigravityThinSupervisorPlannerAndManifestCatalogInvariantsininternal/catalog/catalog_test.go(plugin1.3.0,planner.mdfrontmatter/grants, cross-harnessimplementer.mdmanifest wiring, zero comments, zero harness/retired-v3 leaks).e2e/e2e_test.goto verify all 7 installedantigravity-subagentsagent files and exercise live>=200ksubagentautonomous-breaker.shdeny/allow behavior in the sandbox.skill-installer -t antigravity -g --track opinionated --backup --force -y, ran./scripts/sync-antigravity-from-local.sh(including PII scrubber), and verifiedgit diff --exit-code(0).Rollback plan
Revert this PR and re-run
skill-installer -t antigravity -g --track opinionated --force -y(orskill-installer restore -t antigravity -g -y).