Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/package-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
- "tests/test_core_issue_fix_distribution.py"
- "tests/test_core_standard_distribution.py"
- "tests/control_plane/test_installed_core_context.py"
- "tests/test_core_research_distribution.py"
- "tests/capabilities/test_external_evidence_cli.py"
- "loopx/extensions/runtime.py"
- "loopx/capabilities/decision_context/extension_provider.py"
- "pyproject.toml"
Expand All @@ -33,6 +35,10 @@ on:
- "tests/test_core_issue_fix_distribution.py"
- "tests/test_core_standard_distribution.py"
- "tests/control_plane/test_installed_core_context.py"
- "tests/test_core_research_distribution.py"
- "tests/capabilities/test_external_evidence_cli.py"
- "loopx/extensions/runtime.py"
- "loopx/capabilities/decision_context/extension_provider.py"
- "pyproject.toml"
schedule:
- cron: "47 20 * * *"
Expand Down Expand Up @@ -125,6 +131,20 @@ jobs:
LOOPX_STANDARD_TEST_WHEELHOUSE="$RUNNER_TEMP/core-dist" uv run --extra test python -m pytest -q \
tests/test_core_standard_distribution.py

- name: Qualify research availability, Explore primary workflow, ledger recovery and removal
env:
LOOPX_USAGE_PING: "0"
run: |
uv run --extra test python -m pytest -q tests/test_core_research_distribution.py
uv run --extra test python packages/loopx-core/prepare.py --distribution loopx-capability-research --output "$RUNNER_TEMP/research-source"
uv build --wheel "$RUNNER_TEMP/research-source" --out-dir "$RUNNER_TEMP/research-dist"
uv pip install --python "$LOOPX_CORE_TEST_PYTHON" "$RUNNER_TEMP"/research-dist/loopx_capability_research-*.whl
LOOPX_RESEARCH_TEST_ENABLED=1 uv run --extra test python -m pytest -q tests/test_core_research_distribution.py
LOOPX_RESEARCH_TEST_PYTHON="$LOOPX_CORE_TEST_PYTHON" uv run --extra test python -m pytest -q tests/capabilities/test_external_evidence_cli.py -k preserves_receipt_clocks_and_idempotent_ledger
uv pip uninstall --python "$LOOPX_CORE_TEST_PYTHON" loopx-capability-research
uv run --extra test python -m pytest -q tests/test_core_research_distribution.py
LOOPX_CORE_TEST_PYTHON="$LOOPX_CORE_TEST_PYTHON" uv run --extra test python -m pytest -q tests/test_core_distribution.py -k 'identity_help_and_unavailable_workspace or defers_explore_evaluation'

- name: Build the matching Workspace wheel
run: |
uv run --extra test python scripts/chat_bundle.py build --install
Expand Down
26 changes: 26 additions & 0 deletions docs/architecture/rfcs/monorepo-distribution-split-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,24 @@ readback must also retain their existing distinct evidence.

### Product and benchmark execution

For standalone Core, `loopx-capability-research` takes **Explore** as its
primary optional workflow (moving heavy Explore orchestration, multi-branch/frontier
planning, harness/episode replay, source reconciliation, and the `explore` CLI
surface out of Core) together with the standalone `deepresearch` evidence ledger
and `external-evidence` commands. Core retains only Explore's canonical
result-event contract, lightweight projection, machine/goal configuration
adapters, and Goal permission and settlement validation (`loopx-core` keeps
ordinary turns lazy and independent of `loopx-capability-research`). Installing
the wheel grants no extra Goal write authority. Parent-admitted
`external-evidence` projects sanitized public-safe references into enabled same-goal
Explore nodes without automatic provider execution, and `deepresearch` citation
reports expose a one-way, idempotent, read-only export (`explore import-citations`)
so local paths, private sources, and report prose stay inside
`.loopx/deepresearch/` while standalone `deepresearch` commands continue reading
existing ledgers unchanged. The Core catalog binds `explore`, `deep-research`,
and `external-evidence-research` to `loopx-capability-research` and reports
readiness, missing-file/version diagnostics, and install hints passively.

Follow the [long-horizon research program](long-horizon-harness-benchmark-research-program-v0.md):
native/plain controls, passive observation, governed execution and ablations
have explicit identities. A native control receives no LoopX instructions or
Expand Down Expand Up @@ -653,6 +671,14 @@ lease. Rollback uses the same reconciliation and retains durable state.
Any later irreversible data change needs a separate migration/export gate.

Rollback of these structural/composition changes requires no data migration.
For existing standalone `.loopx/deepresearch/` ledgers, active runs keep their
existing read, continuation, close, archive, and rollback semantics in
`loopx-capability-research`; open sessions can close in place or project
sanitized citation references one-way into an enabled Goal's Explore graph
without mutating `.loopx/deepresearch/`. Uninstalling
`loopx-capability-research` preserves Goal Explore logs, Goal permissions, and
standalone research ledgers so the environment can roll back to bare
`loopx-core` cleanly or resume by reinstalling the matching wheel.
Default changes need explicit owner decisions and release notes; this proposal
changes no current default.

Expand Down
20 changes: 18 additions & 2 deletions docs/architecture/rfcs/monorepo-distribution-split-v0.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,18 @@ Operation provider 必须说明某个 effect 能否核对、能否安全重试

### 产品与 benchmark 执行

在独立 Core 中,`loopx-capability-research` 以 **Explore** 为主工作流(将
Explore 重编排、多分支/前沿规划、harness 与回放运行时、来源对账及 `explore` CLI 移出
Core),并与独立 `deepresearch` 证据账本和 `external-evidence` 取证命令一并发行。Core
仅保留 Explore 的结果事件契约、轻量投影、机器/Goal 配置适配与既有 Goal 权限和结算校验
(裸 Core 常规 Turn 保持惰性加载、不依赖该包),且研究包不增加新的 Goal 写入权限。已获父级
明确采纳的 `external-evidence` 可通过显式证据插件入口向已启用的同 Goal Explore 节点写入
经净化的公共安全引用(不自动执行外部 provider);`deepresearch` 引用报告提供单向、幂等、
只读导出(`explore import-citations`),已保存的本地路径、私有来源与报告正文留在
`.loopx/deepresearch/` 原权限边界内,进入 Goal 图谱的内容仅限净化引用,且原账本完全不被
反写。Core 目录将 `explore`、`deep-research` 与 `external-evidence-research` 绑定到
`loopx-capability-research`,复用现有包归属、惰性命令发现与安装诊断接口暴露版本/缺件状态。

遵守 [长程研究计划](long-horizon-harness-benchmark-research-program-v0.zh-CN.md):
native/plain 对照、被动观测、受治理执行与 ablation 具有明确身份。
原生对照不接受 LoopX 指令或 hook。被动观测须验证无干扰。
Expand Down Expand Up @@ -457,8 +469,12 @@ parsing、global options、输出、错误与 exit code 合格;不兼容版本
继续前验证新 owner 与解析后的装配;不能跨活跃 lease 热切换。回滚同样先核对并保留持久状态。
后续不可逆数据变化须另设迁移/导出门槛。

这些结构/装配变化的回滚不需要数据迁移。默认值变化须有明确 owner 决策与 release notes;
本提案不改变现有默认值。
这些结构/装配变化的回滚不需要数据迁移。对于已有的独立 `.loopx/deepresearch/` 账本,
未结束的研究会话可继续使用原有 `deepresearch status|add-source|resolve-question|close|report`
命令完成闭环与归档,也可按需通过只读单向导出把已授权引用投影为同 Goal Explore 的净化引用,
原账本与报告保留可读与完整回滚路径。卸载 `loopx-capability-research` 后保留 Goal
权限、Explore 事件日志与独立研究账本,可平滑回退至裸 Core,重装同版本包即可续作。
默认值变化须有明确 owner 决策与 release notes;本提案不改变现有默认值。

## 9. 验证与验收

Expand Down
49 changes: 45 additions & 4 deletions loopx/capabilities/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Any

from ..extensions.runtime import extension_catalog_entries
from ..python_install_owner import RESEARCH_DISTRIBUTION
from .benchmark_toolkit.catalog_entry import BENCHMARK_TOOLKIT_CATALOG_ENTRY
from .integration_branch.catalog_entry import INTEGRATION_BRANCH_CATALOG_ENTRY
from .repository_change_window.catalog_entry import (
Expand All @@ -31,7 +32,11 @@
from .content_ops.catalog_entry import CONTENT_OPS_CATALOG_ENTRY
from .value_connectors.catalog_entry import VALUE_CONNECTORS_CATALOG_ENTRY
from .explore.catalog_entry import EXPLORE_CATALOG_ENTRY
from .deep_research.catalog_entry import DEEP_RESEARCH_CATALOG_ENTRY
from .deep_research.catalog_entry import (
DEEP_RESEARCH_CATALOG_ENTRY,
RESEARCH_INSTALL_HINT,
inspect_research_workflow_distribution,
)
from .public_safe_outbound.catalog_entry import PUBLIC_SAFE_OUTBOUND_CATALOG_ENTRY
from .connector_registry.catalog_entry import CONNECTOR_REGISTRY_CATALOG_ENTRY
from .external_research.catalog_entry import EXTERNAL_RESEARCH_CATALOG_ENTRY
Expand Down Expand Up @@ -190,10 +195,46 @@ def build_capability_registry(
}
)
builtin_cli_present = find_spec("loopx.cli") is not None
research_state = (
inspect_research_workflow_distribution(builtin_cli_present=False)
if not builtin_cli_present
else None
)
research_ready = bool(research_state and research_state["ready"])
if not builtin_cli_present and research_state is not None:
optional_fields = {
key: value
for key, value in (
("version", research_state["version"]),
("core_version", research_state["core_version"]),
("unavailable_reason", research_state["reason"]),
)
if value is not None
}
registry.register_provider(
{
"id": RESEARCH_DISTRIBUTION,
"origin": "builtin",
"installed": bool(research_state["installed"]),
"enabled": bool(research_state["installed"]),
"ready": research_ready,
**optional_fields,
}
)
for record in BUILTIN_CAPABILITIES:
registry.register_capability(_record_for_installed_capability(
registry, record, builtin_cli_present=builtin_cli_present,
))
if not builtin_cli_present and (
record is EXPLORE_CATALOG_ENTRY
or record is DEEP_RESEARCH_CATALOG_ENTRY
or record is EXTERNAL_RESEARCH_CATALOG_ENTRY
):
adapted = dict(record) | {"provider_id": RESEARCH_DISTRIBUTION}
if not research_ready:
adapted["next_real_step"] = RESEARCH_INSTALL_HINT
registry.register_capability(adapted)
else:
registry.register_capability(_record_for_installed_capability(
registry, record, builtin_cli_present=builtin_cli_present,
))
for record in BUILTIN_CAPABILITIES:
_register_declared_implementation_providers(registry, record)
for manifest in extension_catalog_entries(
Expand Down
60 changes: 60 additions & 0 deletions loopx/capabilities/deep_research/catalog_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,66 @@

from typing import Any

from ...python_install_owner import (
RESEARCH_DISTRIBUTION,
inspect_builtin_capability_distribution,
)


RESEARCH_INSTALL_HINT = (
"Install the matching loopx-capability-research wheel into this Core environment "
"for Explore orchestration, evidence ledgers, and external evidence workflows."
)
RESEARCH_MODULES = (
"loopx.cli_commands.explore",
"loopx.cli_commands.explore_planning_commands",
"loopx.cli_commands.explore_feishu_commands",
"loopx.capabilities.explore.adaptive_replay_planner",
"loopx.capabilities.explore.child_replay_runtime",
"loopx.capabilities.explore.counterfactual_runtime",
"loopx.capabilities.explore.episode_runtime",
"loopx.capabilities.explore.harness_checkpoint",
"loopx.capabilities.explore.harness_frontier",
"loopx.capabilities.explore.harness_queue",
"loopx.capabilities.explore.harness_runtime",
"loopx.capabilities.explore.replay_metrics",
"loopx.capabilities.explore.replay_runtime",
"loopx.capabilities.explore.research_bridge",
"loopx.capabilities.explore.research_snapshot_host",
"loopx.capabilities.explore.resource_portfolio",
"loopx.capabilities.explore.router_state",
"loopx.capabilities.explore.source_history_reconcile",
"loopx.capabilities.explore.speculative_scheduler",
"loopx.capabilities.explore.todo_branch_plan",
"loopx.capabilities.explore.todo_evidence",
"loopx.capabilities.explore.trace_runtime",
"loopx.capabilities.explore.worker_branch_plan",
"loopx.capabilities.deep_research.runtime",
"loopx.capabilities.external_research.cli",
"loopx.capabilities.external_research.projection",
"loopx.capabilities.external_research.provider_probe",
"loopx.cli_commands.deepresearch",
"loopx.extensions.public_github_research",
)
RESEARCH_RESOURCES = ("loopx/control_plane/capabilities/external_evidence.ts",)


def inspect_research_workflow_distribution(
*, builtin_cli_present: bool | None = None,
) -> dict[str, Any]:
return inspect_builtin_capability_distribution(
RESEARCH_DISTRIBUTION,
RESEARCH_MODULES,
builtin_cli_present=builtin_cli_present,
resources=RESEARCH_RESOURCES,
)


def research_workflows_installed(*, builtin_cli_present: bool | None = None) -> bool:
return bool(
inspect_research_workflow_distribution(builtin_cli_present=builtin_cli_present)["ready"]
)


DEEP_RESEARCH_CATALOG_ENTRY: dict[str, Any] = {
"id": "deep-research",
Expand Down
10 changes: 10 additions & 0 deletions loopx/capabilities/explore/catalog_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
"purpose": "Fold canonical result events into the bounded operator projection.",
"write_boundary": "read-only projection over the goal result log",
},
{
"command": "loopx explore observe-external --goal-id <goal-id> --node <node-id> --plan-json <plan.json> --receipt-json <receipt.json> --admission-json <admission.json> --format json",
"purpose": "Preview or record sanitized external-evidence admissions onto an existing same-goal Explore node without auto-executing providers.",
"write_boundary": "read-only preview unless --execute; writes sanitized refs to the goal result log only",
},
{
"command": "loopx explore import-citations --goal-id <goal-id> --node <node-id> --project <project> --format json",
"purpose": "Preview or export sanitized references from authorized answered deepresearch citations without mutating the source ledger.",
"write_boundary": "read-only deepresearch read; writes sanitized citation refs to the goal result log only when --execute is set",
},
],
"implemented_protocols": [
{
Expand Down
Loading
Loading