Report.ts pr: install-relative diff cannot apply to upstream's LifeOS/install/ layout

未关闭
#2,890 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
57/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
git, typescript

调研方向

Read skills/LifeOS/Tools/Report.ts around lines 332, 633, and 670, plus Redact.ts around line 201. Trace how pr validates diff paths and applies them at the repository root; reproduce with a diff for LifeOS/install/skills/ISA/SKILL.md. Done means accepted diffs apply in the upstream layout and staged path validation still works; the optional existing-issue workflow is a separate change.

由索引模型根据 Issue 内容生成。

描述

Version

LifeOS 8.761.0 · attestation: not run

What is broken

Report.ts pr cannot open a pull request against the current upstream layout. Its diff gate (diffDenied, via diffAllowed) accepts only install-relative paths such as skills/... or LIFEOS/..., because SYSTEM_TREES lists the install tree. The public repo's main keeps those files under LifeOS/install/, and recent PRs there (for example #2860, #2870) touch LifeOS/install/... paths. So a diff that passes the gate is applied with git apply --index at the repository root, where skills/... does not exist, and pr --yes stops at patch does not apply. The reverse also fails: a diff with LifeOS/install/... paths is refused by the gate. A second, smaller point: pr requires a locally built issue report (build --kind issue) even when the issue already exists upstream, so a contributor answering an existing issue has to build a throwaway issue report and must remember never to run file, which would post a duplicate.

Where (file:line)

skills/LifeOS/Tools/Report.ts:670 (apply), Report.ts:332 + Redact.ts:201 (gate), Report.ts:633 (built issue required)

Repro on a clean tree
1. Fresh shallow clone of danielmiessler/LifeOS main.
2. Change any shipped skill file, e.g. append a line to LifeOS/install/skills/ISA/SKILL.md, and write the diff install-relative (git diff --relative=LifeOS/install), which is the only form the pr gate allows.
3. git apply --index --check that diff at the repository root, exactly as Report.ts pr does at step 3.
4. It fails: skills/ISA/SKILL.md does not exist in the index. Applying with --directory=LifeOS/install succeeds.
Negative control

Probe: export LC_ALL=C; W=$(mktemp -d) && git clone -q --depth 1 https://github.com/danielmiessler/LifeOS.git "$W/r" && cd "$W/r" && printf "x\n" >> LifeOS/install/skills/ISA/SKILL.md && git diff --relative=LifeOS/install > ../skills-relative.patch && git checkout -q . && echo "paths the pr gate allows:" && grep "^diff --git" ../skills-relative.patch && git apply --index --check ../skills-relative.patch · exit 1 · captured 2026-11-20T15:39:41.803Z

paths the pr gate allows:
diff --git a/skills/ISA/SKILL.md b/skills/ISA/SKILL.md

--- stderr ---
error: skills/ISA/SKILL.md: does not exist in index
Suggested fix

In pr, apply the gated install-relative diff under the upstream install root when it exists (git apply --index --directory=LifeOS/install if LifeOS/install/ is present in the clone), and keep running stagedDenied on the staged paths with that prefix stripped. Optionally let pr take --issue <number> instead of a locally built issue report, so answering an existing issue needs no throwaway build.

Environment
  • OS: macOS 26.6.2 (arm64)
  • Harness: claude-code
  • bun: 1.4.2 · git: 2.55.0
  • Doctor broken: none
主要语言
TypeScript
星标
19.9k
派生
2.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

danielmiessler/LifeOS 的其他 Issue

查看 danielmiessler/LifeOS 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。