Skip to content

investigate(worktrees): .git 内隔离 checkout 与外部副本的 lint/UI 验证结果不一致 #663

Closed

Description

@tt-a1i

已观察,根因未知

本次 writing child worktree 位于 repository .git/pi-worktrees/。多个保留 receipt 记录同一份 scoped source + 同一依赖下:

  • worktree bun run check 在 untouched Web files 报 9 条 unused suppression warnings;冻结副本移到 .git 外后 candidate/base check 都通过。
  • worktree UI 测试出现 72 个 import-resolution failures(例如 /tests/web/... 无法找到);外部 candidate copy 的 UI suite 79 files / 1120 tests 通过。

这是验证环境差异的真实观察,不是已经证明 .git、Biome 或 Vite 某一个是根因。还要控制 Git presence、cwd/root、配置、symlink/realpath、依赖版本与文件指纹。git archive 的非 Git 副本会让 Git-dependent fixture 额外失败,不能当作完全等价环境。

影响

每个 implementer 反复导出 candidate/base、分析相同失败,延长交付并降低验证可信度。保持隔离是必要的,不应退回共享 Git index 来获得表面速度。

调查/修复方向

建立保留 Git 语义的最小 paired checkout,逐项改变路径/realpath/配置发现;定位实际工具边界,优先 scoped 兼容修复。若需调整 worktree 存放位置,先核对 handoff path ownership、Trust、replay fingerprint、清理和迁移影响,不草率把目录移到任意外部路径。

验收

  • 对相同源码、依赖、Git state 的 inside/outside checkouts 有可重复差异测试并确认根因。
  • 获得一致的配置发现、lint 和 UI test import 行为,或诚实说明不支持的布局并提供稳定验证方式。
  • 根因未确证前不删除 suppression、放宽测试或把失败标成 baseline 已解决。
  • 若改变 placement,保留 owner 安全边界、dirty/untracked/ignored 数据及旧 worktree 恢复。
  • 不改变 parallel-writer isolation 默认策略(feat(isolation): 降低并行写入委派的隔离成本,研究默认 worktree 策略 #653),不扩权、不改 live config/install。

关联 #73 工程验证合同和 #424 workspace reliability。

边界

本议题来自两轮 Workflow 轨迹复盘(41 次调用,约 122 分钟)。重复全套验证、未经裁决地执行冲突审查意见和过晚升级设计阻塞属于父 Agent 编排问题,不作为本议题的平台缺陷证据;未证明调度器排队或模型/provider 延迟是主因。用户授权开 Issue;后续另授权对确证的项目问题做有界改进。不要因此新增固定审查流水线、第二套 Session/控制面或隐藏模型调用,不修改用户安装/配置,不自动合并。

Activity

  1. tt-a1i commented on Oct 4, 2026

    @tt-a1i
    CollaboratorAuthor

    补充:父 Agent 已执行保留 Git 语义的 paired repro。两个 detached Git worktrees 同为 c7862b8,源码/lockfile/配置指纹、安装版本、node_modules realpath 一致。inside .git 的 Biome lint 仍报9条 React相关 unused suppression;outside 为0。使用真实 cwd 与同一相对 filter 跑 Vitest web-store 单文件:inside 无法解析 /tests/web/web-store.spec.ts,outside182/182通过。最初绝对 /tmp filter 的一次尝试受 /private/tmp alias 影响,已排除,不作为此结论依据。这消除了此前“非 Git archive + 依赖不同”的主要混杂因素,但 React-domain/config/resolver 的具体根因和安全修复仍在定位。已交直接子代理做小型 red/green 修复,不搬迁 runtime worktree,不放宽全局 lint 或文件访问权限。详细原始证据仅留本地,未上传 Session/个人路径。

  2. tt-a1i commented on Oct 4, 2026

    @tt-a1i
    CollaboratorAuthor

    Published draft PR #667 at exact HEAD 2b80444bcc2e28674df409ec82af3a279d7c0e10 on main 94f6dfb.

    • [Implemented] Explicit React-domain inference and test-only root-relative Vite denial restore paired inside/outside worktree validation. Production Web server configuration and strict allowlist remain unchanged; missing private hook fails closed.
    • [Fixed/re-reviewed] Independent review identified a lexical symlink bypass. A parent synthetic HTTP probe reproduced baseline 403 versus old-candidate 200 for an alias to a sensitive target. The correction checks lexical and real paths: final regression returns 403/no marker, while ordinary files, linked modules and the React dependency still work. Final exact-HEAD re-review found no new concrete security/access/portability findings.
    • [Validation] Two final focused regressions and scoped lint/typecheck pass. Previous revision's check and full UI 1120 tests passed; previous full Node suite had seven failures and one cancellation, not baseline-classified. No broad rerun. Windows junction fixtures are implemented but not executed here; privileged file-symlink coverage is limited. Post-publication review/CI pending; no merge or installation.

    Durable investigation and limitations: WORKTREE_VALIDATION_663.md. Issue remains open pending acceptance.

  3. added a commit that references this issue on Oct 4, 2026
  4. tt-a1i commented on Oct 4, 2026

    @tt-a1i
    CollaboratorAuthor

    复核完成:PR #667 已合并到 main。本轮真实 inside/outside Git worktree + HTTP sensitive-target 拒绝回归再次通过;与完成收据测试合并运行 14/14,约 3.54 秒。既有最终跨平台 CI 已通过。实现保留 test-only resolver 边界,不调整 production Web allowlist 或 worktree placement。

    可复用记录。旧记录中 parent review/CI pending 已被后续验证解决;Windows privileged file-symlink fixture 的范围限制仍保留。按源代码/工具边界验收完成关闭。

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions