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
49 changes: 49 additions & 0 deletions docs/architecture/rfcs/monorepo-distribution-split-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -3559,3 +3559,52 @@ costs remain open. Rollback the routing slice while retaining task authority and
reconciling original attempts. Existing exact-head review, premerge and bilingual
requirements, original failures, budgets and separate research/release authority
remain in force.

### 2026-11-13 — Startup metadata isolation and installed context recovery

Default goal-start help and preview previously imported issue-fix execution,
candidate preflight and repository analysis merely to render command hints.
The existing command templates now have a capability-owned metadata module;
bootstrap and catalog consumers use it, while the workflow module preserves
its existing Python import API and an explicit issue-fix route retains its complete preflight
contract. Independently installed base/head startup output is byte-identical;
default help/preview load 186→171 LoopX modules and the explicit route 186→179.
Module counts alone establish a narrower loading boundary, not a speed claim.

Thirty alternating installed base/head pairs per workload on macOS arm64,
Python 3.13.5 and ordinary OS/bytecode caches observe first-entry median/p95
of 314.73/362.55→181.25/303.01 ms for help and
542.36/670.44→311.08/572.66 ms for preview. Two subsequent calls per process
have warm medians 0.66→0.54 ms and 11.83→8.94 ms. Median peak RSS is
43.22→32.46 MB and 46.05→36.18 MB. All complete outputs match;
preview remains 52,727 bytes. Retain the head preview maximum 1,092.15 ms.
First entry includes imports; this is neither OS-cold nor full V10 qualification.
Source regression passes 348 checks with one native Windows/PowerShell skip;
the final installed wheel passes 20 checks. Earlier failed attempts remain.

Installed CLI qualification exercises the existing context-project/read/hook
owners with complete source or explicit recovery: off keeps original values,
partial delivery and lost ACK cannot establish a baseline, unchanged/revised
views preserve complete constraints, standalone PostCompact invalidates the
baseline, and a changed captured file is refused. Warm transport may choose
full when complete delta framing would cost more. The test runs against the
original installed core as well; it qualifies the existing installed protocol
and supplies a regression boundary rather than introducing another context
owner. Native events are fixtures, not evidence of model retention or adoption.

Instrumented SQLite/File Turn witnesses retain Python, actual Node-loader and
RPC observations. The selected Turn entry still loads 525 Python modules,
including 111 capability modules; its Node runtime retains eager shared typed
support. Complete work contracts and transport costs remain in the inventory.
This diagnostic does not qualify endpoint/network completeness, OS-cold cost,
model tokens or the full minimal composition. Keep earlier failed checks and
the separate startup/context boundary; full V1–V5/V10, R1/M3, independent
Standard/workspace packages, installed-host adoption and complete original-goal
regression remain open under their existing owners and acceptance.

The installation gate exposed a project-skill supporting-example link that left
the installed bundle. The link now resolves to the byte-verified public source
at an immutable revision; the procedure, consent and check-scope clauses remain
unchanged. It is an on-demand supporting reference, not a runtime fetch or new
authority. Preserve the earlier failed installation gate and disk-limited base
replays separately from the repaired-head validation.
38 changes: 38 additions & 0 deletions docs/architecture/rfcs/monorepo-distribution-split-v0.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2775,3 +2775,41 @@ V10 结论,也不批准 D2 或 minimal preset。
和完整成本仍未完成。回滚路由切片时保留 task authority 并协调原始尝试。
既有 exact-head 评审、premerge、双语要求、原始失败、预算及独立研究/发布授权
继续有效。

### 2026-11-13 — 启动元数据隔离与安装上下文恢复

默认目标启动的帮助和预览此前只是为了渲染命令提示,就导入 issue-fix 执行、
candidate preflight 和仓库分析。既有命令模板现在放在 capability 自有的元数据
模块;bootstrap 与 catalog 消费它,workflow 模块保留原 Python 导入接口,显式
issue-fix 路由仍带完整 preflight 契约。独立安装 base/head 的启动输出逐字节一致;
默认帮助/预览的 LoopX 模块加载为 186→171,显式路由为 186→179。
模块数量本身只证明加载边界缩小,不是速度收益结论。

macOS arm64、Python 3.13.5、普通 OS/bytecode 缓存下,每项 workload 运行
30 对交替的独立安装 base/head,首次入口的中位数/p95 为帮助
314.73/362.55→181.25/303.01 ms,预览 542.36/670.44→311.08/572.66 ms。
每进程随后两次调用的 warm 中位数为 0.66→0.54 ms 和 11.83→8.94 ms;
峰值 RSS 中位数为 43.22→32.46 MB 和 46.05→36.18 MB。全部完整输出一致,
预览仍为 52,727 字节。保留 head 预览最大值 1,092.15 ms。首次入口包含导入,
本记录不属于 OS-cold 或完整 V10 资格。源码回归通过 348 项,1 项因缺少原生
Windows/PowerShell 环境跳过;最终安装 wheel 通过 20 项。早期失败尝试仍保留。

安装 CLI 验证通过既有 context-project/read/hook owner 交付完整源或明确恢复:
关闭功能时保留原始值;部分交付和丢 ACK 不能建立基线;未变化/修订视图保留完整
约束;独立 PostCompact 使基线失效;捕获文件被修改时拒绝读取。完整 delta framing
更贵时,warm 传输可选择 full。同一测试也在原独立 core 安装上运行,资格化既有
安装协议并补充回归边界,不新增上下文 owner。原生事件为夹具,不证明模型保留
上下文或宿主采用。

带追踪的 SQLite/File Turn witness 保留 Python、真实 Node loader 和 RPC 观察。
选定 Turn 入口仍加载 525 个 Python 模块,其中 111 个 capability 模块;Node
runtime 仍保留 eager 的共享 typed 支持。完整 work contract 与传输成本继续保留
在清单中。本诊断不资格化 endpoint/网络完整性、OS-cold 成本、模型 token 或完整
最小组合。保留早期检查失败及独立的启动/上下文边界;完整 V1–V5/V10、R1/M3、
独立 Standard/workspace 包、安装宿主采用及覆盖原始目标的完整回归仍由既有
owner 和验收约束保持开放。

安装门暴露了 project skill 的支持示例链接离开安装包的问题。链接现在指向经字节
核验的公开源文件,并固定不可变 revision;原流程、同意边界和检查范围条款保持
原义。它是按需支持资料,不是 runtime fetch 或新 authority。早期安装门失败和
受磁盘限制的 base 重放,与修复 head 的验证分别保留。
7 changes: 3 additions & 4 deletions loopx/bootstrap_command_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
from .agent_registry import registered_agent_ids_for_goal
from .control_plane.projects.identity import default_goal_id
from .paths import registered_goal_state_file
from .capabilities.issue_fix.candidate_preflight import (
candidate_preflight_input_contract,
)
from .capabilities.issue_fix.workflow_plan import (
from .capabilities.issue_fix.command_templates import (
ISSUE_FIX_GOAL_CANDIDATE_DISCOVERY_COMMAND_TEMPLATE,
build_issue_fix_goal_command_templates,
)
Expand Down Expand Up @@ -760,6 +757,8 @@ def _selected_goal_capability_route(
"unsupported --capability-route; expected one of: "
+ ", ".join(START_GOAL_CAPABILITY_ROUTES)
)
from .capabilities.issue_fix.candidate_preflight import candidate_preflight_input_contract

return {
"schema_version": GOAL_CAPABILITY_ROUTE_SCHEMA_VERSION,
"capability_id": "issue-fix",
Expand Down
2 changes: 1 addition & 1 deletion loopx/capabilities/issue_fix/catalog_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Any

from .workflow_plan import build_issue_fix_pr_lifecycle_command
from .command_templates import build_issue_fix_pr_lifecycle_command


ISSUE_FIX_CATALOG_ENTRY: dict[str, Any] = {
Expand Down
94 changes: 94 additions & 0 deletions loopx/capabilities/issue_fix/command_templates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
"""Issue-fix command metadata without execution-provider imports."""
from __future__ import annotations

import shlex

ISSUE_FIX_GOAL_CANDIDATE_DISCOVERY_COMMAND_TEMPLATE = (
"gh issue list --repo "
'"$(gh repo view --json nameWithOwner --jq .nameWithOwner)" '
"--state open --limit 20 --json number,title,url,labels"
)


def _command_arg(value: str) -> str:
if value.startswith("<") and value.endswith(">"):
return value
return shlex.quote(value)


def build_issue_fix_pr_lifecycle_command(
*,
cli_bin: str,
goal_id: str,
agent_id: str,
project: str | None = None,
) -> str:
"""Build the canonical executable PR lifecycle reconciliation command."""

parts = [
shlex.quote(cli_bin),
"issue-fix",
"pr-lifecycle",
"--url",
"<github-pr-url>",
]
if project:
parts.extend(["--project", _command_arg(project)])
parts.extend(
[
"--goal-id",
_command_arg(goal_id),
"--claimed-by",
_command_arg(agent_id),
"--execute-transition",
"--format",
"json",
]
)
return " ".join(parts)


def build_issue_fix_goal_command_templates(
*, cli_bin: str, goal_id: str, agent_id: str = "<agent-id>"
) -> dict[str, str]:
"""Return the capability-owned commands projected into goal-start packets."""

cli = shlex.quote(cli_bin)
goal = (
goal_id
if goal_id.startswith("<") and goal_id.endswith(">")
else shlex.quote(goal_id)
)
return {
"issue_fix_workflow_plan_template": (
f"{cli} issue-fix workflow-plan "
"--url <github-issue-or-pr-url> "
"--repo-path <approved-repo> "
"--repository-context-json <compact-context.json> "
"--fetch-candidate-evidence "
"--validation-label '<validation command>' "
f"--goal-id {goal} "
"--format json"
),
"issue_fix_feasibility_template": (
f"{cli} issue-fix feasibility "
"--url <github-issue-or-pr-url> "
"--reproduction-status <confirmed|planned|missing|blocked> "
"--scope-class <bounded|uncertain|oversized> "
"--repository-context-json <compact-context.json> "
f"--goal-id {goal} "
"--format json"
),
"issue_fix_pr_lifecycle_template": build_issue_fix_pr_lifecycle_command(
cli_bin=cli_bin,
goal_id=goal_id,
agent_id=agent_id,
),
"issue_fix_reviewer_request_template": (
f"{cli} issue-fix reviewer-request "
"--url <github-pr-url> "
"--repo-path <approved-repo> "
"--base-ref <base-ref> "
"--execute --format json"
),
}
93 changes: 5 additions & 88 deletions loopx/capabilities/issue_fix/workflow_plan.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
from __future__ import annotations

import shlex
from collections.abc import Mapping, Sequence
from typing import Any

from .command_templates import (
ISSUE_FIX_GOAL_CANDIDATE_DISCOVERY_COMMAND_TEMPLATE as ISSUE_FIX_GOAL_CANDIDATE_DISCOVERY_COMMAND_TEMPLATE,
build_issue_fix_goal_command_templates as build_issue_fix_goal_command_templates,
build_issue_fix_pr_lifecycle_command as build_issue_fix_pr_lifecycle_command,
)
from .acceptance_loop import build_issue_fix_caller_repo_branch_packet
from .candidate_preflight import build_issue_fix_candidate_preflight_packet
from .intake_surface import build_content_ops_issue_fix_metadata_preview_packet
Expand All @@ -14,93 +18,6 @@
)

ISSUE_FIX_WORKFLOW_PLAN_PACKET_SCHEMA_VERSION = "issue_fix_workflow_plan_packet_v0"
ISSUE_FIX_GOAL_CANDIDATE_DISCOVERY_COMMAND_TEMPLATE = (
"gh issue list --repo "
'"$(gh repo view --json nameWithOwner --jq .nameWithOwner)" '
"--state open --limit 20 --json number,title,url,labels"
)
def _command_arg(value: str) -> str:
if value.startswith("<") and value.endswith(">"):
return value
return shlex.quote(value)


def build_issue_fix_pr_lifecycle_command(
*,
cli_bin: str,
goal_id: str,
agent_id: str,
project: str | None = None,
) -> str:
"""Build the canonical executable PR lifecycle reconciliation command."""

parts = [
shlex.quote(cli_bin),
"issue-fix",
"pr-lifecycle",
"--url",
"<github-pr-url>",
]
if project:
parts.extend(["--project", _command_arg(project)])
parts.extend(
[
"--goal-id",
_command_arg(goal_id),
"--claimed-by",
_command_arg(agent_id),
"--execute-transition",
"--format",
"json",
]
)
return " ".join(parts)


def build_issue_fix_goal_command_templates(
*, cli_bin: str, goal_id: str, agent_id: str = "<agent-id>"
) -> dict[str, str]:
"""Return the capability-owned commands projected into goal-start packets."""

cli = shlex.quote(cli_bin)
goal = (
goal_id
if goal_id.startswith("<") and goal_id.endswith(">")
else shlex.quote(goal_id)
)
return {
"issue_fix_workflow_plan_template": (
f"{cli} issue-fix workflow-plan "
"--url <github-issue-or-pr-url> "
"--repo-path <approved-repo> "
"--repository-context-json <compact-context.json> "
"--fetch-candidate-evidence "
"--validation-label '<validation command>' "
f"--goal-id {goal} "
"--format json"
),
"issue_fix_feasibility_template": (
f"{cli} issue-fix feasibility "
"--url <github-issue-or-pr-url> "
"--reproduction-status <confirmed|planned|missing|blocked> "
"--scope-class <bounded|uncertain|oversized> "
"--repository-context-json <compact-context.json> "
f"--goal-id {goal} "
"--format json"
),
"issue_fix_pr_lifecycle_template": build_issue_fix_pr_lifecycle_command(
cli_bin=cli_bin,
goal_id=goal_id,
agent_id=agent_id,
),
"issue_fix_reviewer_request_template": (
f"{cli} issue-fix reviewer-request "
"--url <github-pr-url> "
"--repo-path <approved-repo> "
"--base-ref <base-ref> "
"--execute --format json"
),
}


def _todo_preview(
Expand Down
10 changes: 10 additions & 0 deletions packages/loopx-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ The installed-only qualification in
exercises setup, independent result validation, process loss, replay and refusal.
No model service, credentials or paid task execution is supplied by this wheel.

Goal-start help and preview use issue-fix command metadata without importing
its execution providers. An explicit `--capability-route issue-fix` retains
the existing candidate-preflight contract. The installed context qualification
in [`test_installed_core_context.py`](../../tests/control_plane/test_installed_core_context.py)
executes the existing `quota context-project`, `context-read` and `context-hook`
commands: incomplete delivery cannot establish a baseline, revisions preserve
complete constraints, compaction requires recovery, and changed capture bytes
are refused. Its native events are protocol fixtures; they do not establish
model retention or installed-host adoption.

The candidate owns the same `loopx` import namespace and console command as the
ordinary distribution. Do not co-install or overlay them. Return to the ordinary
installation by switching back to its environment; preserve task state and
Expand Down
2 changes: 1 addition & 1 deletion skills/loopx-project/references/outcome-refinement.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ consequential meaning or authority is genuinely missing, not merely because the
user gave a correction.

For obsolete work covered by executable checks, follow the
[owner check-scope reconciliation example](../../../docs/reference/goal-acceptance-observations.md#owner-check-scope-reconciliation).
[owner check-scope reconciliation example](https://github.com/loopx-project/loopx/blob/ce69003c73378fdb067a6b86e7b60feb50cb1b77/docs/reference/goal-acceptance-observations.md#owner-check-scope-reconciliation).
It preserves accepted work and current/final checks in an explicit
`selected_work` replacement before lease-fenced supersession. Removing a binding
alone does not remove work from `all_advancement`. This owner configuration path
Expand Down
Loading
Loading