Skip to content

task: A-entry — canonical Apps entrypoints and application composition #408

Closed

Description

@Dong1017

Current delivery decision (2026-11-15)

Use canonical Apps entrypoints and retire old Python module paths in the same PR that moves their implementations. The final tracked package root contains only __init__.py and __main__.py; a build-generated _version.py is separate metadata. Preserve the normal inferrsi command and python -m inferrsi, not indefinite inferrsi.cli / inferrsi.arguments import aliases. This closes root-level scattering, old entrypoints and core dependency boundaries; it does not include a further internal refactor of existing subpackages.

Related architecture: #387 and #371. Shared contracts/resources: #451. Existing-path retirement/core closure: #412. MindIE-specific relocation is separate: #452.

PR checklist

  • A1 — Switch to canonical Apps CLI and delete the root CLI modules. Move implementation to the apps/cli/ package (apps/cli/__init__.py exposes the canonical main, apps/cli/arguments.py holds the parser); point the console script to inferrsi.apps.cli:main and make root __main__.py delegate only to that canonical entry. Update active plugins, DSH/Codex/WorkSwarm entrypoints, docs and current tests in this same PR; delete root cli.py and arguments.py. Do not add permanent forwarders or module-registry tricks. Remove the cli.py entry from APPLICATION_ENTRIES in tests/_gate_policy_support.py in this same PR (apps/cli/ is already classified as apps by its first path segment), so a reintroduced root cli.py is not admitted as Apps. Cover the PR Connect report Dashboard and trace to fixed attempt records #450 fixed surfaces in the migrated CLI: status/trace/report/dashboard --record-ref success paths and their error branches (missing --storage-config, fixed report/dashboard without --output, --live with --output, --port without --live), byte-comparing behavior with Connect report Dashboard and trace to fixed attempt records #450's head.
  • A2 — Move chart rendering and benchmark application composition. Move summary_chart to apps/views/summary_chart.py and benchmark_operations to apps/benchmark_operations.py. Update Dashboard/reporting/tool/CLI consumers and tests in this same PR; delete both old root files. Do not turn rendering into authoritative evaluation. Run tools/campaign_summary_chart.py as a real entry point in acceptance, remove benchmark_operations.py from APPLICATION_ENTRIES in tests/_gate_policy_support.py so the tuple ends empty, and update the gate tests without relaxing the rule.

Dependencies and incoming work

Preferred queue: C1, C2 (#451), then R1 (#412), then A1 and A2. R1 does not technically require C1/C2 or A1: it can update the current CLI consumers while retiring the existing paths. Keep those as preferred integration order, not artificial architecture blockers. A1 is scheduled after R1 to move an already-clean CLI once; A2 is based on A1's canonical Apps entrypoint. No implementation session starts merely because its read-only plan is complete.

PR #449 is merged. Retain its fixed-record status route and --record-ref, --storage-config, --assessment-ref validation. PR #450 currently adds fixed report/Dashboard/trace surfaces: if it merges first, migrate that actual implementation; if this migration lands first, #450 must target the canonical Apps entrypoints. Do not recreate or overwrite the ContextProvider/candidate-store work in #446/#448. Refresh this observation at implementation time rather than treating open PR code as main.

Acceptance

  • Preserve normal command behavior, exit codes and stdout/stderr bytes, including failure cases and the existing host matrix; retire old Python imports explicitly.
  • Verify console / python-module / plugin entrypoints and installed-wheel execution outside the checkout, including resources.
  • Keep the existing OBS reader/layout decision and evaluator/factual-record authority unchanged; no new evaluate command, warning layer or format retirement.
  • Update testing injection points to the canonical implementation while retaining real execution/inspection injection semantics and old-command behavioral comparisons; do not delete coverage to hide regressions.
  • Record exact root-file removals and a shrinking tracked-root inventory. Overall isolation_complete remains false until the complete closure in task: R01 — retire legacy root paths and close core dependencies #412 is actually proven.

Delivery discipline

  • One implementation Claude session handles only the current PR in an isolated worktree. A second Claude session may only plan the next PR in a separate planning worktree; it must not edit source.
  • Move implementation, update all active consumers/docs/tests, and delete the corresponding old root modules in the same PR. Do not introduce permanent compatibility shells or module-registry aliases.
  • Preserve CLI command behavior, original evidence bytes, record/format contracts and isolation/security checks. Announce retired Python import/serialization module paths; historical frozen evidence remains pinned to its original commit or wheel, not rewritten.
  • Before each implementation or review handoff, refresh main and confirmed dependencies. A completed plan is not implementation or approval. No automatic merge.

Historical context retained

The original scope, approved on 2026-11-12, depended on K01, #397 and OBS, preferably after B01, and required the three-host/installed-wheel matrix. Those prerequisites are now merged. The earlier permanent-forwarder decision for root CLI modules and the old “do not delete shells” restriction are superseded by the revised owner decision above; the command/format/fact/security acceptance requirements are not. #397 remains the standardized Apps output slice, not a vehicle for new migration scope. Existing issue discussion and review history are not rewritten by this checklist update.

Activity

  1. added
    kind:taskBounded delivery task with a delegated slice
    area:usabilityUsability and collaboration: issue navigation, templates, readable reports
    on Nov 12, 2026
  2. amy-why-3459 commented on Nov 12, 2026

    @amy-why-3459
    Collaborator

    谢谢,方向我同意:根 cli.py / arguments.py / __main__.py 作为永久精确转发,不计入兼容 allowlist。实施前有两点需要先对齐:

    1. 前置 Publish standardized Apps run output #397 仍是 Draft,task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 仍是 status:proposed。 我刚核对过,当前 main(e2f4cd1e)上还没有 src/inferrsi/apps/。apps/cli 这个路径和 Apps 包本身都依赖 task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 被接受。建议在正文的"前置"里把"task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 接受 Apps 路径"写成显式条件,和 task: B01 — 旧 run/evaluate 整链迁入最终归属 #414 的写法保持一致。
    2. "精确转发"请给出可测试的定义。 例如根模块只做 from inferrsi.apps.cli import main 这类再导出,加上 __main__ 的调用,不含其他逻辑。门禁规则按文件内容或 AST 判定,而不是只看 import 边。验收时可以对 console script、python -m inferrsi、DSH 和 Codex 插件这三类宿主各跑一次相同命令,比较退出码和 stdout/stderr 是否逐字节一致,这样更有说服力。

    另外,正文写了"建议也在 B01 之后"。如果 A-entry 先于 B01 合入,apps/cli 会暂时直接调用旧 harness.runner,这条 Apps→H 边本身合法,只是 B01 时要再改一次调用点。按依赖顺序安排更省返工。

  3. changed the title [-]task: A-entry — CLI 实现迁入 Apps 并保留永久精确转发[/-] [+]task: A-entry — canonical Apps entrypoints and application composition[/+] on Nov 15, 2026
  4. amy-why-3459 commented on Nov 15, 2026

    @amy-why-3459
    Collaborator

    看到正文按 2026-11-15 的交付决定更新了:根 cli.py / arguments.py 不再保留永久转发,A1 直接删除,另增加 A2。我之前提的前置条件已经满足:#371 设计已 Accepted,src/inferrsi/apps/ 也已在 main 上。针对新内容补几点:

    1. 根目录文件清单能完全对上。 当前 main(1373ef8e)的 27 个根文件,正好被 C1(4)、C2(2)、R1(11)、A1(cli、arguments)、A2(summary_chart、benchmark_operations)和 M1(4)全部覆盖。全部完成后只剩 __init__.py 和 __main__.py,与目标一致。建议把这张"文件 → 负责 PR"的对照表记在本 issue 或 rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387,作为 C1 根文件清单检查逐 PR 缩减的依据。
    2. Connect report Dashboard and trace to fixed attempt records #450 大概率先合入。 它在 d4c2936 上已有两份 LGTM Approve。这样 A1 要迁移的是 _fixed_attempt_command 和新的 trace 子命令。"stdout/stderr 逐字节一致"的对比建议覆盖 status / trace / report / dashboard 的 --record-ref 路径,以及它们的参数错误分支(例如缺 --storage-config、固定 report 缺 --output)。
    3. A2 的消费者范围。 summary_chart 和 benchmark_operations 目前被这些地方引用:apps/views/dashboard.py、apps/legacy/reporting.py、cli.py、tools/campaign_summary_chart.py,以及 tests/_gate_policy_support.py、test_target_module_import_gate.py、test_summary_chart.py、test_benchmark_operations.py 等测试。其中 tools/campaign_summary_chart.py 是可以直接运行的脚本入口,建议在验收里也跑一次。gate policy 测试里写死的精确路径也要一起更新,不要放宽规则。
  5. amy-why-3459 commented on Nov 15, 2026

    @amy-why-3459
    Collaborator

    更新后的 A1/A2 已经包含 #450 固定路径的对比,以及 tools/campaign_summary_chart.py 的验收,谢谢。还有一个小细节:

    tests/_gate_policy_support.py:22 的 APPLICATION_ENTRIES = ("cli.py", "benchmark_operations.py") 会把这两个根文件当作 apps importer 对待(第 143 行)。正文把更新它写在了 A2 里,但其中 cli.py 这一项属于 A1:A1 删除根 cli.py 时应该同步移除这一项。apps/cli/ 的第一级目录本来就是 apps,不需要这个特例。否则这个已经没有用的条目会让以后重新出现的根 cli.py 继续被当成 Apps 放行。A2 再移除 benchmark_operations.py,最终让 APPLICATION_ENTRIES 变为空。

  6. Dong1017 commented on Nov 16, 2026

    @Dong1017
    CollaboratorAuthor

    Both items are merged, so this issue is complete.

    Item PR Merge commit
    A1: canonical Apps CLI, root cli.py and arguments.py deleted #461 64f82039780375863d5864cd2c348e860d814d09
    A2: chart renderer and task launcher moved into Apps, both root files deleted #474 bebd4914d15e272b0c09a5b784a82f955f51a5e0

    Checked against main at bebd4914:

    • The four old root files are gone with no forwarder or alias, and the canonical modules exist: apps/cli/__init__.py, apps/cli/arguments.py, apps/views/summary_chart.py and apps/benchmark_operations.py. The console script is inferrsi.apps.cli:main.
    • The tracked package root holds six files: __init__.py, __main__.py and the four MindIE files that wait for task: consolidate existing MindIE adapters under Apps #452 (M1). It shrank 27 → 23 → 21 → 10 → 8 → 6 across C1, C2, R1, A1 and A2.
    • APPLICATION_ENTRIES is removed from tests/_gate_policy_support.py, so a root file that returns under a retired name fails. Fifteen root modules are now retired.
    • Command behavior: A1 compared nine real commands byte for byte against Connect report Dashboard and trace to fixed attempt records #450. A2 ran tools/campaign_summary_chart.py as a real entry on a valid specification, a broken one and --help, and exit codes, stdout, stderr, SVG bytes and Markdown bytes were identical before and after the move.
    • Hosted Windows and macOS: the host-compatibility job added by A1 runs the eight affected nodes and an installed-wheel check, and passed on both hosts in refactor(apps): canonicalize CLI and retire root entries (A1) #461 and again in refactor(apps): move the chart renderer and task launcher into Apps (A2) #474. Ready-lane full-check 3.10 and 3.11 passed on both PRs.

    Not claimed: isolation_complete is still false. The 12 Harness hits into Infra (R2) and the five runtime resource loaders (R3) remain, tracked in #412. Architecture approval of the manifest changes is not implied by merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:usabilityUsability and collaboration: issue navigation, templates, readable reportskind:taskBounded delivery task with a delegated slice

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions