Skip to content

refactor(cli): demand-load registry inspection commands - #8233

Merged
loopx-agent merged 2 commits into
mainfrom
codex/small-kernel-registry-inspection-20261107
Nov 7, 2026
Merged

loopx-agent merged 2 commits into
mainfrom
codex/small-kernel-registry-inspection-20261107

Conversation

@cocolord

@cocolord cocolord commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

registry --help and registry-boundary --help currently load the full CLI and 1,158 LoopX modules. This proposal selects their existing registry inspection grammar and handler directly, reducing help to 9 modules while preserving successful/rejected request semantics. It also shares the grammar and inspection transport adapter with the full CLI, retaining the existing support-control inspection and renderer patch points.

  • Outcome basis: accepted small-kernel RFC, R0/V1/V3 selected-route isolation and V10 CLI measurement.
  • Goal/source and gap: monorepo-distribution-split-v0 at ac62962255322cd80a5b701a4187c6f47bc17d8c; unrelated execution owners are loaded by two read-only inspection callers.
  • Observable result: source and independently installed wheel consoles pass the same 20 request cases; help/read module and resource costs are measured below. The loading exclusion fails on the immutable baseline and passes on the candidate through the same public entrypoint.
  • Intended base: loopx-project/loopx:main; baseline ac62962255322cd80a5b701a4187c6f47bc17d8c. Related M1 public-status proposal: refactor(chat): move public status owner with identity-compatible imports #8011; this change does not depend on its merge.

Author Declaration

  • Written by: model_agent — TRAE (GPT-6 via TRAE).
  • Specification and revision: the RFC above at the stated baseline; relevant clauses are scoped to the existing inspection callers.
Criterion Disposition Owning path Evidence
R0/V1/V3: demand loading and unselected-component isolation implemented for registry inspection loopx/cli_runtime.py Help/result loading exclusions, baseline sensitivity and independent wheel consoles; missing Node parity
I3: compatibility retained for at least one minor release implemented, no expiry decision loopx/cli_commands/support_control.py and existing registry owner Parser/output/exit, unknown/empty/omitted arguments, original inspection and renderer patch points
V10: comparable repeated CLI measurement implemented for four CLI workloads existing source/wheel console entries 30 interleaved pairs per distribution/workload; median/p95, CPU/RSS, I/O and activation observations
Full R0/V10, M1, R1 managed Turn and split installation deferred to their existing RFC owners unchanged boundaries This proposal does not establish those program-wide qualifications
  • Self-check: immutable source characterization before edits, full relevant CLI/support suite, real Git boundary smoke on both revisions, independent wheel build/install/provenance, parser negatives, missing Node and module-loading sensitivity. The registrar/adapter consolidation is the applied bounded refactor. No registry/TypeScript decision owner or generic framework is added. The local command set reuses existing CLI vocabulary; the supported diff advisory reports zero new carriers, with its dynamic-form limitation retained.

Scope And Continuation

  • Complete within the two existing inspection callers: selection, full CLI compatibility, error paths and scoped source/wheel cost evidence. Revert the route and adapter changes together to roll back.
  • Remaining: full R0/V10 census, M1/refactor(chat): move public status owner with identity-compatible imports #8011, managed minimal Turn/restart/readback, context/model composition, split installation, adoption and total costs stay open. Larger support/control extraction is outside this slice. No installed-host upgrade or new default, authority or D2/D5/D6/D3 decision is made.
  • Author proposal is complete. Review and required CI remain separate gates; no merge is performed.

Validation

  • Tested revision: d54cdef3a3a7042225417f4e23f8c618fa1f19ca. Source/wheel measurements use its unchanged production files; final RFC-only edits do not change them.
  • Run state: finished. Inputs: synthetic registries, disposable runtime namespaces and real temporary Git repositories.
Check kind Result Public-safe evidence / limitation
unit passed uv run --extra test python -m pytest -q tests/test_cli_entrypoint.py tests/test_support_control_update_ownership.py tests/test_support_control_promotion_ownership.py --no-cov: 197 pass. New inspection cases: 26 pass, plus two help cases. Original CLI baseline: 152 pass before edits.
regression_parity passed 20 identical request cases on source base/head and independently installed wheel base/head, including malformed/missing registries, canonical parser diagnostics, invalid/unknown/empty/omitted options and require flags. Full-CLI loading exclusion fails before the change and passes afterward.
real_entrypoint passed Actual source and monolithic-wheel console scripts outside source shadowing, matching Python/dependency versions; all four help/read workloads also preserve results with Node absent.
real_backend passed uv run --extra test python examples/project/registry-boundary-contract-smoke.py on base/head with disposable temporary Git repositories; examples/cli-support-control-command-modularization-smoke.py passes. Registry files and fixtures remain unchanged.
real_backend failed Initial boundary smoke under an ignored private ancestor selected the existing private classification. Both revisions pass from a neutral temporary directory. The initial failure is retained; production classification was not changed.
static passed Changed-file Ruff, configured mypy (17 files on base/head), diff hygiene, diff-scoped/full semantic inventories and committed bilingual RFC checks. No lockfile, generated bundle, raw measurement data, local paths or private state is staged.
static failed Initial quick canary lacked root TypeScript dev dependencies; npm ci --ignore-scripts repairs that environment gap. An archived baseline scan lacked an independent Git index and produced stale classification diagnostics; the corrected detached baseline and candidate scans pass with matched locked dependencies. Initial failed probes are retained separately.
static failed CI lint scope still fails baseline-existing F841 at tests/control_plane/test_goal_create_completion.py:184; separate fixes #8210/#8174 already exist. Base/head diagnostics match. Broader ruff check loopx tests also has the same five diagnostics on both revisions.
integration passed Executed exact-head quick premerge plus the full relevant suite/real-path evidence above. Aggregate: 6 direct checks, 0 direct failures; 4 selected checks, 0 failures. Failures/advisories are disclosed below.
integration failed Python Tests run fails at kernel-static-checks on the same baseline F841. Stage 2C, backend, pytest and merge aggregators reject the resulting skipped/failed qualification; those required lanes are unqualified. Other artifact workflows were still running at readback. No failure or skip is waived.

The relevant suite preserves normal and rejected paths, full-parser fallback, support ownership, Git guard precedence and read-only fixture state. Registry authority/provider semantics and shared persisted state are unchanged; this slice does not need a PostgreSQL authority migration rehearsal. Incremental coverage generation returned no applicable threshold; the existing full-suite CI coverage gate is unqualified after upstream lint failure and skipped shards.

Cost measurements compare immutable base with the unchanged candidate on macOS arm64/Python 3.13.5, identical dependency versions/fixtures, precompiled bytecode, warmed filesystem caches and a fresh interpreter per sample. AB/BA alternates and workload/distribution order rotates. /usr/bin/time -l wraps the actual console; parent monotonic wall timing is uninstrumented. Audit/loading probes are separate from timing samples. There are 480 samples; sampling took 416.7s within the frozen 1,200s limit. Measurement setup/compatibility/profiling took 278.1s; environment and wheel preparation and earlier tests are separate costs. The 197-case source suite took 236.49s and the original 152-case characterization took 197.28s. Full preparation, agent/model and human-attention costs are unmeasured.

Distribution / workload Wall median / p95, ms (base → head) RSS median / p95, MiB (base → head) CPU median, ms (base → head) LoopX modules
source / registry-help 1565.9 / 1762.5 → 99.8 / 109.4 91.5 / 93.0 → 16.4 / 17.4 670 → 30 1158 → 9
source / registry-read 1584.2 / 1790.0 → 309.5 / 367.4 91.2 / 94.6 → 30.1 / 31.4 700 → 100 1158 → 148
source / registry-boundary-help 1561.4 / 1809.5 → 99.6 / 112.7 91.6 / 93.5 → 16.4 / 17.9 705 → 30 1158 → 9
source / registry-boundary-read 1541.6 / 1838.4 → 221.8 / 237.7 91.6 / 94.2 → 25.0 / 26.3 665 → 100 1158 → 44
wheel / registry-help 1608.8 / 1903.7 → 101.8 / 115.2 91.3 / 94.4 → 16.2 / 16.9 725 → 30 1158 → 9
wheel / registry-read 1630.6 / 1748.4 → 301.4 / 342.5 91.2 / 93.2 → 29.6 / 32.8 720 → 100 1158 → 148
wheel / registry-boundary-help 1536.5 / 1780.0 → 102.7 / 113.1 91.5 / 94.3 → 16.1 / 18.1 660 → 30 1158 → 9
wheel / registry-boundary-read 1611.7 / 1828.4 → 224.7 / 252.5 91.8 / 93.9 → 24.8 / 26.8 725 → 100 1158 → 44
Workload File-open observations, source (base → head) File-open observations, wheel (base → head) Output bytes
registry-help 1292 → 33 1299 → 40 83
registry-read 1293 → 223 1300 → 230 2900
registry-boundary-help 1292 → 33 1299 → 40 624
registry-boundary-read 1299 → 107 1306 → 114 762

Separate audit probes observe no Node starts/IPC or socket events. Boundary reads retain the same three Git subprocess queries; other workloads start none. Time reports zero block-input/block-output operations with warm filesystem caches. Audit open counts and summed opened-file sizes describe loading footprint, not exact bytes consumed; native subprocess/socket activity outside Python audit and exact logical read bytes remain unknown. Output byte counts and hashes match across revisions. These are local CLI cost reductions, not portable D6 thresholds or whole-kernel/long-horizon/adoption gains.

Frontend / Visual Evidence

  • UI impact: none. Existing inspection CLI commands and diagnostics are preserved; no caller-facing capability, frontend operation or presentation chrome is added. Before/after viewport, source data and attention/craft screenshots: N/A.

Type of Change / LoopX Area

  • Refactoring (no inspection decision changes)
  • Documentation update
  • Test update
  • Control plane / CLI transport

Shared-authority RFC fixture impact

N/A: no shared authority, provider or TypeScript decision semantics change.

Boundary Checklist

  • Public/private scan clean; no credentials, raw traces, private state, internal links or local machine paths in diff/body.
  • Scoped to existing registry inspection; no duplicate maintainer-owned benchmark or F841 repair.
  • English/Chinese RFC checkpoints both changed; staged and exact-head bilingual checks passed.
  • UI impact marked none.
  • DCO Signed-off-by trailer included.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
loopx-agent
loopx-agent previously approved these changes Nov 7, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机 / Motivation

维护者或自动化通过 registry 查看登记的 Goal,或者用 registry-boundary 判断文件能否安全纳入 Git。

此前这两个只读命令连帮助也会加载完整 CLI。现在有效请求只加载检查所需的解析和读取代码,错误请求仍走既有完整解析器。

源码和独立安装的 wheel 各 32 组对照通过。两个 help 入口的 LoopX 模块数从 1,158 降至 9,真实 Git 边界和拒绝诊断保留。

本片验收范围是两个既有 CLI 入口及显式完整解析器。实测使用 macOS 上的源码与单体 wheel,并在隔离目录中提供 Git 和合成 registry。

完整 R0/V10 清点、M1、真实受管 Turn、拆包安装、活跃宿主采用和完整成本继续由既有 RFC 验收。

改动思路 / Approach

在既有 selected dispatcher 中注册两个读命令,复用 registry owner。显式完整 CLI 也使用同一组参数及检查适配器,保留原检查函数和 renderer 注入点。 当前 PR 的边界是这两个现有检查命令的加载成本和相同结果。

沿用既有 selected route 就能减少每次检查的启动工作。操作者仍用原命令和原选项完成检查。保留完整解析器负责拒绝路径,也保留明确的回调入口。

具体改动 / Changes

两条 help 的模块数由 1,158 降至 9,registry 和 boundary 读取分别降至 148 和 44。真实 Git boundary 两版都执行 3 个 Git 查询。独立 audit 没有观察到写入、socket 或额外子进程。另做每条路径、每种分发 5 对交替进程计时,源码 registry help 中位数 606→50 ms,registry read 为 623→143 ms。作者的 30 对每路径大样本单独保留。此处计时只描述当前 macOS/Python 3.14.8 条件下的中位数,模块数和打开文件计数来自独立 audit。

预变更规格为 docs/architecture/rfcs/monorepo-distribution-split-v0.md,版本 ac62962255322cd80a5b701a4187c6f47bc17d8c。R0=implemented、V1=implemented、V3=implemented、I3=implemented、V10=implemented。中英文 RFC 增量记录相同边界和未验收项。#8011 的公开 Chat status 迁移使用不同生产路径。 预变更规格

关键代码讲解

对主干的风险 / Risks

独立构建两版单体 wheel,从仓库外调用各自安装的控制台。源码与 wheel 各对照 32 个输入,涵盖省略和显式 registry、空 path、损坏文件、真实 Git 以及缺少 Node。原解析错误逐字一致。异常比较保留类型和消息,调用栈随实现位置变动。对同一文件撤去 Git 后,require 拒绝。恢复 Git 后重试成功。另在一次性 repo 只新增目标 ignore,再次执行原命令也成功,registry 和索引未改。

当前源码 197 项测试通过,基线 169 项。两个版本绑定到隔离 registry 后均通过真实 Git smoke。首次无绑定 smoke 遇到既有默认路由冲突,首次 wheel 构建缺少生成的 dashboard bundle。原失败保留,并以显式隔离路径和正常前端构建复验。配置的 17 项 Mypy、bilingual RFC、6 个直接和 4 个选择检查均通过。

必检 Ruff 在两个不可变版本中都报同一个 F841,位置为未改动的 tests/control_plane/test_goal_create_completion.py:184。独立对照覆盖了本 PR 改动的入口。严格质量回执 cqr_1307f444ef9e1fc6f9af 仍为失败,合并门保留。

语义与 CI 对齐

两条有效读取走同一 registry owner。原 require 分支、现有授权语义、完整解析器和显式支持层回调仍生效。基线与当前头的加载对照使用同一真实入口,未知参数在两版都走完整解析器。审查未查询或触发 CI。

我的整体评价 / Verdict

没有阻塞性代码发现。两条只读 CLI 的加载减少及结果兼容经独立验证,支持当前头的源码切片。 当前头 d54cdef3a3a7042225417f4e23f8c618fa1f19ca。

在既有 selected dispatcher 中注册两个读命令,复用 registry owner。显式完整 CLI 也使用同一组参数及检查适配器,保留原检查函数和 renderer 注入点。 当前 PR 的边界是这两个现有检查命令的加载成本和相同结果。 检查了两个现有 CLI 的 help、Markdown、JSON 和拒绝输出,内容保持一致,改动没有涉及渲染页面,视觉审阅不适用。 独立证据覆盖 macOS 的源码和单体 wheel。Windows、实际宿主升级、拆包部署、完整 CI 和长期运行成本未验证。

English verdict: APPROVE — The two read-only routes preserve CLI semantics while reducing the import closure. The unchanged required Ruff failure keeps strict merge qualification on hold.

@mergify

mergify Bot commented Nov 7, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @cocolord.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 7, 2026
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE — exact head 93998797cd2fc04fc91bf3b196bd8c71e141c71e.

Re-reviewed after integrating current main b9faf8da.

  • The only conflicts were independent English/Chinese RFC checkpoint insertions; both records are preserved.
  • The CLI implementation and tests are unchanged from the previously approved exact code revision.
  • Exact-head verification: the three CLI/support ownership suites pass 197 passed; changed-file Ruff and diff checks pass; the merge commit carries DCO.

This approval is limited to merge readiness at the exact head above.

@loopx-agent
loopx-agent merged commit 1175fc0 into main Nov 7, 2026
4 of 7 checks passed
@loopx-agent
loopx-agent deleted the codex/small-kernel-registry-inspection-20261107 branch November 7, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Mergify: the pull request has merge conflicts with its base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants