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

Aperta
#2,890 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
19.9k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di danielmiessler/LifeOS

Tutte le issue di danielmiessler/LifeOS

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.