v0.20.2 harden antigravity research workflow

This commit is contained in:
Deep Research System
2026-05-07 12:57:11 +08:00
parent 68e45bcf41
commit e991b26af9
11 changed files with 532 additions and 33 deletions
@@ -0,0 +1,34 @@
# Deep Research Antigravity Rule
When operating this repository from Google Antigravity, use Antigravity as the primary Deep Research executor and use the repository as the method, artifact, and validation framework.
## Non-Negotiables
- Use Antigravity's model quota for main research work.
- Do not default to Python core model-worker commands such as `run`, `research --execute-packets`, or `research --assemble-chapters`, because they may route work through ZenMux/API credits.
- It is acceptable to write phase artifacts directly in Antigravity when following the project skills and evidence schema.
- Use `.agents/skills/antigravity-surface-adapter/SKILL.md` whenever the user asks for Antigravity usage, phase execution, model planning, or quota planning.
- Keep all research outputs under `projects/<slug>/`.
- Use Python scripts only for scaffolding, deterministic checks, citation/report rendering, status, and local material processing unless the user explicitly approves external model/API usage.
## Anti-Hallucination Contract
- No tool receipt, no search claim. The agent may not write that it has searched, checked, verified, or confirmed anything unless a search/browser/terminal/MCP tool call actually happened and the result is logged.
- No source ID, no factual claim. Every concrete fact in drafts must map to a `source_id` in `sources.jsonl` or the current phase ledger.
- No snippet laundering. Search result snippets, AI summaries, and memory are only leads; they cannot support final claims.
- Failed access must be explicit. If a page, PDF, registry, patent, or filing cannot be opened, mark it as inaccessible and do not quote exact values from it.
- Each phase must maintain `phaseX/search_log.md` or `phaseX/search_log.jsonl`.
- Each evidence packet must include `search_receipts`, `sources`, `counter_evidence`, and `unsupported_claims`.
- When evidence is thin, write "该观点证据不足,待进一步验证" rather than smoothing over the gap.
## Quota Discipline
- Surface manager: Gemini 3 Flash.
- Phase 0-1: Claude Opus 4.6 (Thinking).
- Phase 2: Gemini 3.1 Pro (Low).
- Phase 3: Gemini 3.1 Pro (High), with fallback to another model only if quality is inadequate.
- Phase 4: Claude Opus 4.6 (Thinking).
## Pause Points
Pause after Phase 1 and Phase 3. Ask the user to confirm the framework or critique decision before moving to the next major phase.
@@ -0,0 +1,140 @@
---
name: antigravity-surface-adapter
description: Guides Google Antigravity to run Deep Research natively with Antigravity model quotas, while using this repository's skills, source standards, artifacts, and optional Python utilities for validation/rendering.
---
# Antigravity Deep Research Adapter
Use this skill when the user asks to run, plan, review, or finalize a Deep Research project from Google Antigravity.
## Core Rule
Antigravity is the research operator. Use Antigravity's own model selector and task execution to perform the research phases. Python core is an auxiliary toolbox for project scaffolding, deterministic checks, citation/report rendering, and status inspection; do not let it silently route the main research through ZenMux unless the user explicitly asks.
The Deep Research method still comes from this repo:
- Follow `AGENTS.md` for evidence, source tiers, word budgets, pause points, and output hygiene.
- Load project skills from `.agents/skills/*` as needed.
- Write all artifacts under `projects/<slug>/`.
- Keep claims traceable to source IDs in `sources.jsonl`.
## Anti-Hallucination Contract
This project treats Gemini-family research as high risk for false confidence. Follow these rules mechanically:
1. No tool receipt, no search claim. Do not write "I searched", "confirmed", "official data shows", or similar unless the tool call happened and is recorded.
2. No source ID, no factual claim. Every concrete fact needs a `source_id`.
3. Search snippets are leads, not evidence. Open the original paper, filing, registry, patent, guideline, or company disclosure before citing.
4. Failed access is a finding. Write that the source could not be opened; do not infer exact numbers from inaccessible pages.
5. Log all searches in `phaseX/search_log.md` or `phaseX/search_log.jsonl`.
6. Keep an `unsupported_claims` list. It is better to expose uncertainty than to make the report look complete.
7. Before finishing each phase, sample at least 10 factual claims and verify that each has a source ID and opened source.
## Antigravity Model Plan
Switch the Antigravity conversation model by phase:
| Phase | Model | Purpose |
|---|---|
| Surface management | Gemini 3 Flash | Read skills, maintain task list, move phase by phase, run light shell commands, collect artifacts. |
| Phase 0-1 | Claude Opus 4.6 (Thinking) | Material interpretation, strategic framing, research method choice, bold hypotheses, chapter architecture. |
| Phase 2 | Gemini 3.1 Pro (Low) | Evidence collection, chapter research packets, first-pass chapter drafts. |
| Phase 3 | Gemini 3.1 Pro (High) | Independent critique, counter-evidence review, logic and evidence gap analysis. |
| Phase 4 | Claude Opus 4.6 (Thinking) | Final Chinese editorial integration, executive summary, wording quality, final consistency pass. |
Gemini 3 Flash should remain the phase manager. It can ask the user to switch to the phase model before heavy thinking, then resume management after the phase artifact is written.
## Python Core Boundary
Use Python core only when it helps without taking over the research model budget:
- Good: scaffold folders, parse local materials, validate sources/citations, render PDF/DOCX, show status.
- Risky: `research --execute-packets`, `run`, or any command that calls model workers through `configs/models.yaml`.
- If a command would call model workers, ask the user first and state that it may use ZenMux/API credits instead of Antigravity quota.
Safe utility examples:
```bash
uv run python scripts/dr.py init "研究主题" --slug <slug> --method <method>
uv run python scripts/dr.py status <slug>
uv run python scripts/dr.py skills validate
uv run python scripts/dr.py finalize <slug> --no-pdf --no-docx
```
## Native Runbook
1. Open the repository root in Antigravity.
2. Start with Gemini 3 Flash as phase manager. Load this skill, `AGENTS.md`, `mckinsey-method`, `search-strategy`, `source-quality`, `evidence-table`, `citation-manager`, `length-budget`, and `output-hygiene`.
3. Create or confirm `projects/<slug>/` and the phase folders. Use Python `init` only for scaffolding if helpful.
4. Phase 0-1: ask the user to switch to Claude Opus 4.6 (Thinking). Produce:
- `phase1/material_brief.md`
- `phase1/framework.md`
- `phase1/research_brief.md`
- `phase1/research_brief.json`
- `phase1/search_log.md`
- `phase1/unsupported_claims.md`
5. Pause for user confirmation.
6. Phase 2: ask the user to switch to Gemini 3.1 Pro (Low). Build evidence packets and chapter drafts without Python model workers:
- `phase2/task_cards.json`
- `phase2/packets/*.json`
- `phase2/sources.jsonl`
- `phase2/chapter_briefs/*.json`
- `phase2/compressed_findings/*.json`
- `phase2/drafts/chXX.md`
- `phase2/search_log.jsonl`
- `phase2/unsupported_claims.md`
7. Phase 3: ask the user to switch to Gemini 3.1 Pro (High). Produce `phase3/critique.md`, with explicit go/rework/fail decision and a source-audit table for at least 10 core facts.
8. Pause for user decision.
9. Phase 4: ask the user to switch to Claude Opus 4.6 (Thinking). Produce `phase4/final_zh.md`, `phase4/editorial_notes.md`, and `phase4/final_fact_check.md`. Use deterministic renderers afterward for PDF/DOCX.
## Search Strategy
If the `search` CLI from `paperfoot/search-cli` is installed, prefer it as the Antigravity-native search front door:
```bash
search agent-info
search search -q "CRISPR clinical trial 2025" -m academic --json
search search -q "BRCA1 gene patent" -m patents --json
search search -q "FDA warning letter CAPA pharmaceutical" -m general --json
search search -q "biotech market update 2026" -m news --json
```
Useful modes for this repo: `academic`, `scholar`, `patents`, `news`, `deep`, `extract`, `similar`, and `general`.
Do not treat synthesized search answers as evidence. Every important claim still needs source IDs, tier rating, source score, and preferably original PDFs/pages or official records.
If `search` is not installed, use the existing project search tools or Antigravity browser, but keep the same source-tier discipline.
## Suggested Antigravity Permissions
Within this workspace, the user may allow:
- `read_file(<workspace>)`
- `write_file(<workspace>)`
- `command(uv run python scripts/)`
- `command(search)`
- `command(pandoc)`
Keep these as Ask/Deny unless the user explicitly allows them:
- writes outside the workspace
- global Antigravity/Gemini settings
- destructive git commands
- reading `secrets.env`
- broad downloads or package installs
## What To Report Back
Always report concrete artifact paths:
- `projects/<slug>/phase1/research_brief.md`
- `projects/<slug>/phase2/task_cards.json`
- `projects/<slug>/phase2/packet_errors/` if present
- `projects/<slug>/phase3/critique.md`
- `projects/<slug>/phase4/*.pdf` and `*.docx`
If a phase fails, report the failing artifact and the rework plan. Do not hide model switches, quota-sensitive steps, or missing evidence.
+55
View File
@@ -0,0 +1,55 @@
# Deep Research Native Workflow
Description: Run a biomedical Deep Research project in Antigravity using Antigravity model quota, with explicit anti-hallucination gates and source receipts.
## Step 0: Load Context
- Load `AGENTS.md`.
- Load `.agents/rules/deep-research-antigravity.md`.
- Load `.agents/skills/antigravity-surface-adapter/SKILL.md`.
- Load skills: `mckinsey-method`, `search-strategy`, `source-quality`, `evidence-table`, `citation-manager`, `length-budget`, `output-hygiene`.
- Confirm topic, slug, report type, target audience, method, output length, and allowed search tools.
Gate: do not proceed if the topic, slug, and report purpose are unclear.
## Step 1: Phase 0-1 With Opus
- Ask the user to switch the conversation model to Claude Opus 4.6 (Thinking).
- Create project folders under `projects/<slug>/`.
- Read user materials and write `phase1/material_brief.md`.
- Run real searches and log them in `phase1/search_log.md`.
- Write `phase1/framework.md`, `phase1/research_brief.md`, and `phase1/research_brief.json`.
- Write `phase1/unsupported_claims.md` for hypotheses not yet evidenced.
Gate: pause for user confirmation. Do not enter Phase 2 before approval.
## Step 2: Phase 2 With Gemini 3.1 Pro Low
- Ask the user to switch the conversation model to Gemini 3.1 Pro (Low).
- Build `phase2/task_cards.json`.
- For each task card, run real searches and append `phase2/search_log.jsonl`.
- Write `phase2/packets/*.json`; every packet must contain `search_receipts`, `sources`, `counter_evidence`, and `unsupported_claims`.
- Build `phase2/chapter_briefs/*.json` and `phase2/compressed_findings/*.json`.
- Write `phase2/drafts/chXX.md` only from chapter briefs and compressed findings.
Gate: do not draft a chapter from memory or snippets. Every concrete claim needs a source ID.
## Step 3: Phase 3 With Gemini 3.1 Pro High
- Ask the user to switch the conversation model to Gemini 3.1 Pro (High).
- Review framework, packets, sources, chapter briefs, and drafts.
- Write `phase3/critique.md`.
- Include a source-audit table for at least 10 core facts.
- Mark decision as `go`, `rework`, or `fail`.
Gate: pause for user decision after critique.
## Step 4: Phase 4 With Opus
- Ask the user to switch the conversation model to Claude Opus 4.6 (Thinking).
- Write `phase4/final_zh.md` from approved drafts and sources only.
- Write `phase4/editorial_notes.md`.
- Write `phase4/final_fact_check.md`, listing any unresolved or downgraded claims.
- Use deterministic renderer tools afterward for PDF/DOCX.
Gate: final output cannot introduce new facts without adding sources and search logs first.