# OpenCode ↔ Research67 桥接说明 本目录让 OpenCode 客户端作为 Research67 的本地交互入口。OpenCode 侧只负责选择门面、调用 `agentpaas_run`,真正的科研模型、CEK、Guard、知识库、工具调用、预算和 workspace 都在 LambdaAgentPaaS / Research67 侧执行。 ## 一句话架构 ```text OpenCode CLI → .opencode/agent/research67.md → .opencode/tool/agentpaas_run.ts → AgentPaaS /api/v1/agents/{agent}/run/stream → Research67 统一科研闭环 ``` Research67 统一工作流为: ```text 科学问题 → 本体构建 → 本体审计与知识补全 → 可证伪假设生成 → 研究计划与 Action DAG → 实验规划 / 授权包 / 可执行实验 → 结果分析 → 论文写作 → 数据与主张核验 → 论文评审 → 反馈合成 → 本体再审计与下一轮迭代 ``` ## 使用方式 在 `opencode-bridge` 根目录启动: ```bash bun run --cwd packages/opencode dev -- --agent research67 ``` 之后直接在 OpenCode 中输入科学问题、125 Questions 题号或继续追问即可。同一 OpenCode session 会自动复用远端 AgentPaaS thread 和上一轮 workspace。 ## 推荐入口 - `research67`:完整 Research67 对话式入口,推荐默认使用。 - `research-67-orchestrator`:需要显式调用科研主编排器时使用。 - `research-67-pipeline`:旧三阶段 Lite 流水线。 - `research-67-ontology-auditor` / `research-67-ontology-enricher` / `research-67-hypothesis-builder`:本体飞轮相关门面。 - `research-67-plan-builder` / `research-67-action-reasoner`:研究计划和 Action DAG 推理门面。 - `research-67-exp-planner` / `research-67-exp-executor` / `research-67-result-analyzer`:实验规划、授权执行和结果分析门面。 - `research-67-paper-writer` / `research-67-data-verifier` / `research-67-paper-reviewer` / `research-67-review-feedback`:论文写作、核验、评审和反馈迭代门面。 ## 配置 `agentpaas_run` 从以下位置读取 AgentPaaS 地址和租户 API Key: ```bash export AGENTPAAS_URL=http://127.0.0.1:8000 export AGENTPAAS_API_KEY=你的_AgentPaaS_API_Key ``` 或写入用户目录: ```json { "server": "http://127.0.0.1:8000", "api_key": "你的 AgentPaaS API Key" } ``` 路径:`~/.agentpaas/config.json` 注意:这里是 AgentPaaS 租户凭证,不是 Qwen/DashScope token。Qwen/DashScope token 仍由 AgentPaaS 服务端配置管理,不应写入本目录或 Git。 ## 边界 - OpenCode 不直接生成科研产物,只展示远端返回结果和实时进度。 - 每个门面单回合只调用一次 `agentpaas_run`,失败后不得自动重试或改调其他 Agent。 - 真实湿实验、人体/动物实验和硬件实验需要远端授权门禁;未授权时只能生成实验协议和 `external_authorization_package.json`,不能声称实验验证完成。