@open-agent-toolkit/cli 0.3.16 → 0.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/assets/agents/oat-phase-implementer.md +26 -6
  2. package/assets/agents/oat-reviewer.md +51 -1
  3. package/assets/bundle-metadata.json +1 -1
  4. package/assets/docs/contributing/documentation.md +4 -0
  5. package/assets/docs/contributing/skills.md +3 -1
  6. package/assets/docs/getting-started/bootstrap.md +1 -1
  7. package/assets/docs/getting-started/index.md +0 -4
  8. package/assets/docs/getting-started/tool-packs.md +0 -7
  9. package/assets/docs/reference/cli-reference.md +42 -1
  10. package/assets/docs/reference/config-and-local-state.md +11 -2
  11. package/assets/docs/reference/project-artifacts.md +43 -8
  12. package/assets/docs/skills/repo-improve.md +9 -7
  13. package/assets/docs/workflows/advanced/autonomy.md +40 -0
  14. package/assets/docs/workflows/backlog-and-planning/backlog-lifecycle.md +25 -24
  15. package/assets/docs/workflows/backlog-and-planning/remote-project-management.md +0 -7
  16. package/assets/docs/workflows/ideas/lifecycle.md +2 -7
  17. package/assets/docs/workflows/projects/execution/project-log.md +22 -0
  18. package/assets/docs/workflows/projects/reviews/review-flavors.md +8 -0
  19. package/assets/public-package-versions.json +4 -4
  20. package/assets/skills/oat-agent-instructions-apply/SKILL.md +14 -4
  21. package/assets/skills/oat-brainstorm/SKILL.md +17 -13
  22. package/assets/skills/oat-docs-apply/SKILL.md +13 -3
  23. package/assets/skills/oat-doctor/SKILL.md +11 -1
  24. package/assets/skills/oat-explainer-kit/SKILL.md +1 -1
  25. package/assets/skills/oat-explainer-kit/references/lifecycle-contract.md +6 -3
  26. package/assets/skills/oat-pjm-review-backlog/SKILL.md +2 -2
  27. package/assets/skills/oat-pjm-update-repo-reference/SKILL.md +28 -3
  28. package/assets/skills/oat-project-autonomous/SKILL.md +60 -5
  29. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +44 -6
  30. package/assets/skills/oat-project-capture/SKILL.md +7 -3
  31. package/assets/skills/oat-project-complete/SKILL.md +39 -34
  32. package/assets/skills/oat-project-complete/scripts/execute-synced-archive-entry.mjs +106 -28
  33. package/assets/skills/oat-project-complete/scripts/parse-synced-archive-resume-fields.mjs +30 -3
  34. package/assets/skills/oat-project-design/SKILL.md +12 -9
  35. package/assets/skills/oat-project-discover/SKILL.md +8 -4
  36. package/assets/skills/oat-project-document/SKILL.md +14 -5
  37. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +44 -6
  38. package/assets/skills/oat-project-implement/SKILL.md +1 -1
  39. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +6 -6
  40. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +44 -6
  41. package/assets/skills/oat-project-implement/references/phase-execution.md +20 -6
  42. package/assets/skills/oat-project-import-plan/SKILL.md +20 -6
  43. package/assets/skills/oat-project-lite/SKILL.md +7 -5
  44. package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +44 -6
  45. package/assets/skills/oat-project-new/SKILL.md +6 -2
  46. package/assets/skills/oat-project-plan/SKILL.md +14 -6
  47. package/assets/skills/oat-project-pr-final/SKILL.md +1 -1
  48. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +44 -6
  49. package/assets/skills/oat-project-progress/SKILL.md +13 -1
  50. package/assets/skills/oat-project-promote-spec-driven/SKILL.md +7 -3
  51. package/assets/skills/oat-project-quick-start/SKILL.md +17 -12
  52. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +44 -6
  53. package/assets/skills/oat-project-reconcile/SKILL.md +8 -4
  54. package/assets/skills/oat-project-retro/SKILL.md +1 -1
  55. package/assets/skills/oat-project-retro/references/apply-procedure.md +6 -6
  56. package/assets/skills/oat-project-retro-file/SKILL.md +7 -3
  57. package/assets/skills/oat-project-review-provide/SKILL.md +23 -4
  58. package/assets/skills/oat-project-review-provide-remote/SKILL.md +19 -1
  59. package/assets/skills/oat-project-review-receive/SKILL.md +37 -12
  60. package/assets/skills/oat-project-review-receive-remote/SKILL.md +7 -3
  61. package/assets/skills/oat-project-revise/SKILL.md +13 -5
  62. package/assets/skills/oat-project-spec/SKILL.md +8 -4
  63. package/assets/skills/oat-project-summary/SKILL.md +11 -7
  64. package/assets/skills/oat-repo-knowledge-index/SKILL.md +54 -20
  65. package/assets/skills/oat-repo-knowledge-index/scripts/refresh-owned.mjs +118 -0
  66. package/assets/skills/oat-review-provide/SKILL.md +7 -3
  67. package/assets/skills/oat-review-receive-remote/SKILL.md +14 -4
  68. package/assets/skills/oat-wave-execute/SKILL.md +24 -11
  69. package/assets/skills/oat-wave-execute/assets/wrapper-plan-template.md +16 -2
  70. package/assets/skills/oat-worktree-bootstrap-auto/SKILL.md +45 -17
  71. package/assets/templates/pjm-agents.md +38 -8
  72. package/assets/templates/repo-agents.md +5 -0
  73. package/assets/templates/repo-readme.md +5 -0
  74. package/dist/commands/backlog/archive.d.ts +3 -0
  75. package/dist/commands/backlog/archive.d.ts.map +1 -1
  76. package/dist/commands/backlog/archive.js +63 -26
  77. package/dist/commands/backlog/index.d.ts.map +1 -1
  78. package/dist/commands/backlog/index.js +3 -0
  79. package/dist/commands/backlog/rewrite-references.d.ts +5 -0
  80. package/dist/commands/backlog/rewrite-references.d.ts.map +1 -1
  81. package/dist/commands/backlog/rewrite-references.js +39 -1
  82. package/dist/commands/init/index.d.ts.map +1 -1
  83. package/dist/commands/init/index.js +1 -0
  84. package/dist/commands/init/tools/shared/skill-script-references.d.ts.map +1 -1
  85. package/dist/commands/init/tools/shared/skill-script-references.js +8 -1
  86. package/dist/commands/internal/commit-paths.d.ts +3 -0
  87. package/dist/commands/internal/commit-paths.d.ts.map +1 -0
  88. package/dist/commands/internal/commit-paths.js +31 -0
  89. package/dist/commands/internal/index.d.ts.map +1 -1
  90. package/dist/commands/internal/index.js +2 -0
  91. package/dist/commands/pjm/init.d.ts.map +1 -1
  92. package/dist/commands/pjm/init.js +37 -8
  93. package/dist/commands/project/archive/archive-utils.d.ts +6 -3
  94. package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
  95. package/dist/commands/project/archive/archive-utils.js +510 -104
  96. package/dist/commands/project/archive/push-runner.d.ts.map +1 -1
  97. package/dist/commands/project/archive/push-runner.js +1 -0
  98. package/dist/commands/project/log/append.d.ts +2 -3
  99. package/dist/commands/project/log/append.d.ts.map +1 -1
  100. package/dist/commands/project/log/append.js +125 -111
  101. package/dist/commands/project/migrate/index.d.ts +1 -2
  102. package/dist/commands/project/migrate/index.d.ts.map +1 -1
  103. package/dist/commands/project/migrate/index.js +8 -2
  104. package/dist/commands/project/new/scaffold.d.ts.map +1 -1
  105. package/dist/commands/project/new/scaffold.js +4 -4
  106. package/dist/commands/project/promote/promote.d.ts +8 -0
  107. package/dist/commands/project/promote/promote.d.ts.map +1 -1
  108. package/dist/commands/project/promote/promote.js +37 -6
  109. package/dist/commands/project/status.d.ts.map +1 -1
  110. package/dist/commands/project/status.js +3 -0
  111. package/dist/commands/project/sync/ref-sync.d.ts +12 -1
  112. package/dist/commands/project/sync/ref-sync.d.ts.map +1 -1
  113. package/dist/commands/project/sync/ref-sync.js +347 -23
  114. package/dist/commands/shared/agents-md-lock.d.ts +3 -0
  115. package/dist/commands/shared/agents-md-lock.d.ts.map +1 -0
  116. package/dist/commands/shared/agents-md-lock.js +130 -0
  117. package/dist/commands/shared/agents-md.d.ts.map +1 -1
  118. package/dist/commands/shared/agents-md.js +26 -8
  119. package/dist/commands/shared/exact-path-commit.d.ts +32 -0
  120. package/dist/commands/shared/exact-path-commit.d.ts.map +1 -0
  121. package/dist/commands/shared/exact-path-commit.js +691 -0
  122. package/dist/validation/skills.d.ts.map +1 -1
  123. package/dist/validation/skills.js +138 -11
  124. package/package.json +3 -2
@@ -6,7 +6,7 @@ disable-model-invocation: false
6
6
  user-invocable: true
7
7
  allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task
8
8
  metadata:
9
- version: 1.9.6
9
+ version: 1.9.7
10
10
  ---
11
11
 
12
12
  # Execute a Wave of External Plans
@@ -25,6 +25,10 @@ Historical `DR-*` and `BL-*` slugs in this skill (including the provenance
25
25
  record above) are evidence citations in the source program's repository; they
26
26
  are not required artifacts in the consuming repo.
27
27
 
28
+ ## Hook-safe exact-path commits
29
+
30
+ Before a parent-branch commit, verify `oat internal commit-paths --help` succeeds. If unavailable, stop and update the OAT CLI; never fall back to a staged-index or pathspec-only commit. Set `COMMIT_IDENTITY` to a unique operation/artifact identity before the first attempt and retain it for every retry; use a new identity for a new operation. Pass only the exact produced file list, including tracked removals and both names of a rename. A blocked/failed result stops the workflow; retain its receipt and follow its diagnostics. Hooks remain enabled. Synced project artifacts continue through `oat project push`.
31
+
28
32
  ## Progress Indicators (User-Facing)
29
33
 
30
34
  Print this banner once when execution starts:
@@ -256,6 +260,12 @@ terminal state for gate rows (Orc operator-audit S8).
256
260
  Persist the gate artifact and its dispositions through the wrapper project's
257
261
  scope-aware bookkeeping route:
258
262
 
263
+ Before running the gate, initialize `WAVE_GATE_OUTPUT_PATHS=()` and append the
264
+ exact plan, state, implementation, review and receive-receipt files each gate
265
+ producer actually writes. Include tracked removals and both rename sides, omit
266
+ ignored outputs, and retain the list through retries. Do not discover ownership
267
+ from a project-directory or staged-index diff.
268
+
259
269
  ```bash
260
270
  PROJECT_PATH=$(oat config get activeProject 2>/dev/null || true)
261
271
  if [ -z "$PROJECT_PATH" ]; then
@@ -267,14 +277,9 @@ PROJECT_SCOPE=$(oat project scope "$PROJECT_PATH" --format value) || { echo "oat
267
277
  if [ "$PROJECT_SCOPE" = "synced" ]; then
268
278
  oat project push "$PROJECT_PATH" --message "chore(oat): record wave plan gate" || { echo "oat: project push failed; run oat project pull, resolve the reported state, and retry" >&2; exit 1; }
269
279
  else
270
- PROJECT_OUTPUT_PATHS=()
271
- while IFS= read -r output_path; do
272
- PROJECT_OUTPUT_PATHS+=("$output_path")
273
- done < <(git diff --name-only -- "$PROJECT_PATH")
274
- [ "${#PROJECT_OUTPUT_PATHS[@]}" -gt 0 ] || exit 1
275
- git add -- "${PROJECT_OUTPUT_PATHS[@]}"
276
- git diff --cached --quiet -- "${PROJECT_OUTPUT_PATHS[@]}" ||
277
- git commit --only -m "chore(oat): record wave plan gate" -- "${PROJECT_OUTPUT_PATHS[@]}"
280
+ : "${WAVE_GATE_OUTPUT_PATHS:?retain the exact gate producer file list}"
281
+ OWNED_COMMIT_PATHS=("${WAVE_GATE_OUTPUT_PATHS[@]}")
282
+ oat internal commit-paths --identity "${COMMIT_IDENTITY:?set once and retain for retries}:oat-wave-execute:1" --message "chore(oat): record wave plan gate" -- "${OWNED_COMMIT_PATHS[@]}" || exit 1
278
283
  fi
279
284
  ```
280
285
 
@@ -392,8 +397,16 @@ archive anything first.
392
397
  `summary.md`** (this is the "before any archive step" gate): convention
393
398
  verdicts with evidence, adjustments-as-rules for later waves, graduated-entries
394
399
  ledger, rolled into `summary.md` `## Workflow Observations`.
395
- 3. **Serialized backlog archival** — `oat backlog archive` with real summaries,
396
- one commit.
400
+ 3. **Serialized backlog archival** — run `oat backlog archive --json` for
401
+ each item with its real outcome summary. Union and deduplicate all returned
402
+ `affectedPaths`, including tracked old item deletions, new destinations,
403
+ ledger/index and rewritten references; append owned handoff filesystem
404
+ deletions. Format existing supported text with the repository command,
405
+ then use `oat internal commit-paths` for one exact-operation commit with
406
+ enabled hooks and the unique retained `COMMIT_IDENTITY`. Stop if the helper
407
+ is unavailable or blocked/failed; unrelated staged/unstaged work survives.
408
+ A settled noop returns only actual repairs; do not infer paths from every
409
+ archived link or commit only the old missing path.
397
410
  4. **Closeout gate run** — after the archival commit, and after ANY later commit
398
411
  that touches a gated surface (`.oat/repo/**`, `.agents/**`, `packages/**`,
399
412
  `apps/**`), re-run the integration DoD gates with cache bypass. The last
@@ -119,8 +119,16 @@ disposition every finding in the phase report. }
119
119
 
120
120
  **Step { N }: Commit**
121
121
 
122
+ Before task edits, initialize `TASK_OWNED_FILES=()` and append the exact files
123
+ at each source-plan producer, including created files, tracked removals and both
124
+ rename sides. Retain the complete list and a stable unique `COMMIT_IDENTITY`
125
+ for this wrapper task through retries; each task uses its own identity/suffix.
126
+ Never infer ownership from the staged index or pass directories. Verify
127
+ `oat internal commit-paths --help` first; if unavailable, stop and update the CLI.
128
+ A nonzero result stops with its receipt and diagnostic; hooks remain enabled.
129
+
122
130
  ```bash
123
- git commit -m "{type}(p{NN}-t01): { description }"
131
+ oat internal commit-paths --identity "${COMMIT_IDENTITY:?set once and retain for retries}:oat-wave-execute:wrapper-plan-template:p{NN}-t01" --message "{type}(p{NN}-t01): { description }" -- "${TASK_OWNED_FILES[@]}" || exit 1
124
132
  ```
125
133
 
126
134
  ---
@@ -144,7 +152,13 @@ git commit -m "{type}(p{NN}-t01): { description }"
144
152
  - [ ] { N }/{ N } phases, { M }/{ M } tasks complete
145
153
  - [ ] Every source plan's `## Done criteria` confirmed (recorded in `implementation.md`)
146
154
  - [ ] **Serialized backlog bookkeeping** (integration branch, after all merges):
147
- `oat backlog archive` with real outcome summaries for { backlog IDs }, one commit
155
+ `oat backlog archive --json` with real outcome summaries for { backlog IDs }.
156
+ Union complete returned `affectedPaths` (tracked old deletions, new
157
+ destinations, ledger/index/references), append owned handoff filesystem
158
+ deletions, format existing text with the repo command, and create one
159
+ `oat internal commit-paths` commit with enabled hooks and a retained unique
160
+ identity. Stop on unavailable/blocked/failed helper; preserve unrelated
161
+ staged/unstaged work.
148
162
  - [ ] Orchestration-log end-of-run synthesis written; roll-up into `summary.md`
149
163
  before any archive step
150
164
  - [ ] Full DoD gates green on the integration branch
@@ -6,7 +6,7 @@ disable-model-invocation: false
6
6
  user-invocable: false
7
7
  allowed-tools: Read, Write, Bash, Glob, Grep
8
8
  metadata:
9
- version: 1.6.2
9
+ version: 1.6.3
10
10
  ---
11
11
 
12
12
  # Autonomous Worktree Bootstrap
@@ -17,6 +17,10 @@ This skill is **model-invocable** (`disable-model-invocation: false`): orchestra
17
17
 
18
18
  > ⚠️ **When not to substitute.** This skill is the **only** supported mechanism for orchestrator-driven worktree creation in OAT skills. Host-native isolation primitives — Claude Code's `Agent({ isolation: "worktree" })`, Cursor's worktree-isolated agent invocations, and equivalents in other hosts — are **not** substitutes. They may use the primary repo's checkout (often `main`) as the base regardless of the caller's current branch, silently producing a worktree at the wrong base. OAT orchestrators dispatching mid-run from a feature branch MUST go through this skill with an explicit `--base` so the resulting worktree contains the orchestrator's prior commits.
19
19
 
20
+ ## Hook-safe exact-path commits
21
+
22
+ Before a parent-branch commit, verify `oat internal commit-paths --help` succeeds. If unavailable, stop and update the OAT CLI; never fall back to a staged-index or pathspec-only commit. Set `COMMIT_IDENTITY` to a unique operation/artifact identity before the first attempt and retain it for every retry; use a new identity for a new operation. Pass only the exact produced file list, including tracked removals and both names of a rename. A blocked/failed result stops the workflow; retain its receipt and follow its diagnostics. Hooks remain enabled. Synced project artifacts continue through `oat project push`.
23
+
20
24
  ## Relationship to oat-worktree-bootstrap
21
25
 
22
26
  This skill is the **autonomous companion** to `oat-worktree-bootstrap`. Key differences:
@@ -358,28 +362,52 @@ Create them if missing, run the `git_clean` baseline check, and then run sync:
358
362
  mkdir -p "{target-path}/.claude/skills"
359
363
  mkdir -p "{target-path}/.cursor/rules"
360
364
  git status --porcelain
361
- oat sync --scope all
365
+ SYNC_PLAN_JSON=$(oat sync --scope all --dry-run --json) || exit 1
366
+ SYNC_OUTPUT_FILES=()
367
+ # Populate the exact list from the producer evidence described below before apply.
368
+ SYNC_RESULT_JSON=$(oat sync --scope all --json) || exit 1
362
369
  ```
363
370
 
364
- After sync completes, commit sync-managed output if any scoped path is dirty:
371
+ Before the apply invocation, populate `SYNC_OUTPUT_FILES` from the supported
372
+ `SYNC_PLAN_JSON.plans[]` entries/removals for `scope: project`:
373
+
374
+ - `providerPath` is the planned target, and `canonical.isFile` identifies file
375
+ assets. Include that exact file for a mutating operation; include old tracked
376
+ paths for removals. Skip `operation: skip` unless the manifest was restamped.
377
+ - A symlink projection owns the single provider symlink path. A copy projection
378
+ of a directory owns concrete copied members: enumerate the canonical producer
379
+ files before applying and map each relative member to its provider destination.
380
+ Capture the exact existing tracked members with literal `git ls-files -z`
381
+ before a planned removal. Do not discover this list from the staged index.
382
+ - Include `.oat/sync/manifest.json` when the project manifest is written. Omit
383
+ ignored output files and user-scope paths, which are outside the worktree.
384
+ - `operationResults[]` reports scope/provider/contentKind/asset/action/status,
385
+ **not file paths**. Match those identities to the planned entries/removals and
386
+ require successful/current results before committing. Materialization
387
+ extensions expose their own `operations[].path`; include only verified
388
+ concrete project files. Collection/directory outcomes require complete
389
+ producer member evidence. Stop on unknown, failed, incomplete or changed
390
+ inventories; never pass a directory to the helper.
391
+
392
+ Append each exact planned output to `SYNC_OUTPUT_FILES` before mutation and
393
+ verify it against the actual result after sync. Include both rename sides and
394
+ retain the list and identity through a retry. The helper never expands a
395
+ provider directory or invents a producer inventory.
396
+
397
+ After sync completes, commit the retained exact list:
365
398
 
366
399
  ```bash
367
- SYNC_PATHS=(.oat/sync/manifest.json .claude .cursor .codex)
368
- SYNC_STAGE_PATHS=(existing-or-tracked sync paths)
369
- git status --porcelain -- "${SYNC_STAGE_PATHS[@]}"
370
- git add -A -- "${SYNC_STAGE_PATHS[@]}"
371
- STAGED_SYNC_FILES=(staged sync-managed files from git diff --cached)
372
- git commit -m "chore: run sync" -- "${STAGED_SYNC_FILES[@]}"
400
+ if [ "${#SYNC_OUTPUT_FILES[@]}" -gt 0 ]; then
401
+ oat internal commit-paths --identity "${COMMIT_IDENTITY:?set once and retain for retries}:oat-worktree-bootstrap-auto:1" --message "chore: run sync" -- "${SYNC_OUTPUT_FILES[@]}" || exit 1
402
+ else
403
+ echo "sync_commit: skip"
404
+ fi
373
405
  ```
374
406
 
375
- Use a staged-diff guard so no empty commit is created. After scoped staging,
376
- derive the concrete staged sync-managed files from
377
- `git diff --cached --name-only --no-renames -- "${SYNC_STAGE_PATHS[@]}"` and
378
- commit only those file paths. Do not pass provider directory pathspecs to
379
- `git commit`, because empty provider directories can make the commit fail. This
380
- file-list isolation is what keeps `chore: run sync` limited to sync-managed
381
- paths even if unrelated files were already staged. If no scoped path is dirty,
382
- or staging produces no diff, report `sync_commit: skip`.
407
+ A `nothing` result reports `sync_commit: skip`; blocked/failed results
408
+ stop bootstrap and retain the helper's resumable diagnostic. Never use directory
409
+ pathspecs, staged-diff discovery, or an empty broad commit. Smoke mode continues
410
+ to skip sync and this commit entirely.
383
411
 
384
412
  ### Step 5: Return Structured Status
385
413
 
@@ -31,15 +31,41 @@ Invariant: `backlog/items/` holds only active work (`status: open` or
31
31
  The agent or person shipping the work owns the close-out, in the same
32
32
  commit/PR as the work whenever practical.
33
33
 
34
- **Close-out (primary path).** Run `oat backlog archive <id>` — add `--wont-do`
35
- for abandoned work and `--summary "<text>"` to record the outcome. The command
34
+ **Close-out (primary path).** Run `oat backlog archive <id> --summary "<outcome>" --json`
35
+ for completed work; a nonblank summary is required. Add `--wont-do` for
36
+ abandoned work; that path may omit its summary and ledger entry. The command
36
37
  performs the whole close-out atomically: it flips `status` to the terminal
37
38
  value and bumps `updated`, appends the canonical `backlog/completed.md` entry
38
39
  (always for `closed`; for `wont_do` only when `--summary` is given), moves the
39
40
  item file from `backlog/items/` to `backlog/archived/`, rewrites inbound
40
41
  `.oat/repo` links and path references to the moved file (reporting each
41
- rewritten file), and regenerates `backlog/index.md`. Stage the resulting
42
- changes with the shipping commit/PR.
42
+ rewritten file), and regenerates `backlog/index.md`. Commit the resulting
43
+ changes through the exact-path close-out below with the shipping commit/PR.
44
+
45
+ Archive never stages files. Capture each successful `--json` result and retain
46
+ its complete `affectedPaths` array, including the old tracked item deletion,
47
+ the archived destination, completed ledger, index and rewritten references.
48
+ On retry use the returned operation paths; do not reconstruct ownership from
49
+ all files that mention the item. If this close-out owns a kickoff handoff,
50
+ remove it with a filesystem operation and append its tracked deletion path.
51
+ Convert returned absolute paths to literal repository-relative files using
52
+ the same repository root (avoiding checkout/scratch-path aliases).
53
+ Deduplicate the exact file list, format only existing supported text files
54
+ with the repository's documented formatter, and commit that list through
55
+ `oat internal commit-paths` with enabled hooks. Verify helper availability
56
+ first; if unavailable, stop and update the CLI. Set a unique `COMMIT_IDENTITY`
57
+ before the first attempt and retain the identity, message and literal paths
58
+ through retries; a blocked/failed helper result stops close-out. Unrelated
59
+ staged and unstaged work must remain intact. An empty settled-noop path list
60
+ needs no commit; omit a missing source path only if Git proves it was never
61
+ tracked, never omit a tracked old path or the new destination.
62
+
63
+ ```bash
64
+ oat internal commit-paths --help || exit 1
65
+ # ARCHIVE_OWNED_FILES is the literal affectedPaths union plus owned handoff deletion.
66
+ # Format the existing text members with the repository's documented write command.
67
+ oat internal commit-paths --identity "${COMMIT_IDENTITY:?set once and retain for retries}:backlog-closeout" --message "chore(pjm): archive completed backlog work" -- "${ARCHIVE_OWNED_FILES[@]}" || exit 1
68
+ ```
43
69
 
44
70
  **Manual fallback.** These are the steps the command automates — follow them, in
45
71
  order, only when closing out by hand:
@@ -48,13 +74,16 @@ order, only when closing out by hand:
48
74
  2. Append a summary entry to `backlog/completed.md` (newest first; entry format
49
75
  is documented at the top of that file). Add the entry for a `wont_do` item
50
76
  only when the abandonment itself is worth recording (an explicit summary).
51
- 3. `git mv` the item file from `backlog/items/` to `backlog/archived/`, then
77
+ 3. Move the item file with a filesystem rename (`mv`, without staging) from `backlog/items/` to `backlog/archived/`, then
52
78
  rewrite inbound `.oat/repo` links to `archived/` (plans, decision records,
53
79
  other items, and repository-root paths such as `oat_external_plan_sources`).
54
- 4. Run `oat backlog regenerate-index` and stage the regenerated
55
- `backlog/index.md`.
80
+ 4. Run `oat backlog regenerate-index`; include the regenerated
81
+ `backlog/index.md` in the exact owned path list.
56
82
  5. If the completion changes the operating picture, refresh
57
83
  `current-state.md` and the curated overview section of `backlog/index.md`.
84
+ 6. Collect both old/new item names, every written ledger/index/reference and
85
+ any owned handoff deletion, format existing text, then commit the complete
86
+ operation through `oat internal commit-paths` as above.
58
87
 
59
88
  A partial close-out (status flipped or `completed.md` updated, but the file
60
89
  left in `items/`) is how drift starts — finish all steps or none. `oat pjm
@@ -97,7 +126,8 @@ convention.
97
126
  - repo conventions and verification gates the item file does not restate;
98
127
  - a close-out section requiring (a) the **Backlog Lifecycle** above executed
99
128
  in the same PR that ships the item and (b) deletion of the handoff file
100
- (`git rm`) in that same PR.
129
+ (filesystem removal, included as an owned tracked deletion in
130
+ the same exact-path commit) in that same PR.
101
131
  - **Staleness:** if a later alignment pass drops an item from the kickoff
102
132
  stack, delete its handoff in that pass rather than letting it drift.
103
133
  - Every backlog item reference — in review output, alignment docs, and
@@ -15,3 +15,8 @@ Use this directory as the canonical OAT repo-reference root.
15
15
  `oat backlog archive <id>` in the same PR that ships the work.
16
16
  - `README.md` is the human-facing orientation for this directory; agent-facing
17
17
  rules live in the `AGENTS.md` files alongside each subdirectory.
18
+
19
+ Backlog archive is staging-neutral. Follow `pjm/AGENTS.md` Backlog Lifecycle:
20
+ consume the complete JSON `affectedPaths`, add any owned handoff deletion,
21
+ format existing text, and commit the exact operation through
22
+ `oat internal commit-paths`, preserving unrelated staged/unstaged work.
@@ -33,3 +33,8 @@ Agent-facing rules live in the `AGENTS.md` files alongside each directory.
33
33
  - **Close-out.** When work ships that satisfies a backlog item's acceptance
34
34
  criteria, the item is closed and archived in the same commit/PR — run
35
35
  `oat backlog archive <id>`. See the Backlog Lifecycle in `pjm/AGENTS.md`.
36
+
37
+ Backlog archive is staging-neutral. Follow `pjm/AGENTS.md` Backlog Lifecycle:
38
+ consume the complete JSON `affectedPaths`, add any owned handoff deletion,
39
+ format existing text, and commit the exact operation through
40
+ `oat internal commit-paths`, preserving unrelated staged/unstaged work.
@@ -13,6 +13,9 @@ export interface ArchiveBacklogItemResult {
13
13
  * repository root.
14
14
  */
15
15
  rewrittenReferences: string[];
16
+ /** Normalized absolute paths owned by this operation, including the old
17
+ * item deletion and retry outputs. Archive never stages any of these paths. */
18
+ affectedPaths: string[];
16
19
  warnings: string[];
17
20
  }
18
21
  export interface ArchiveBacklogItemOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../src/commands/backlog/archive.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,sBAAsB,CAAC;AAmB9B,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;IAC5B,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,cAAc,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IACrD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAEzB,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,CAAC,GAAG,CAAK,EAI/C;CACF;AAkID;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,wBAAwB,CAAC,CA4InC"}
1
+ {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../src/commands/backlog/archive.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,sBAAsB,CAAC;AAmB9B,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;IAC5B,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,cAAc,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IACrD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B;mFAC+E;IAC/E,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAEzB,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,CAAC,GAAG,CAAK,EAI/C;CACF;AAwJD;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,wBAAwB,CAAC,CA0LnC"}
@@ -1,6 +1,6 @@
1
1
  import { execFile } from 'node:child_process';
2
2
  import { access, readFile, rename, writeFile } from 'node:fs/promises';
3
- import { join } from 'node:path';
3
+ import { join, relative, resolve } from 'node:path';
4
4
  import { promisify } from 'node:util';
5
5
  import { getFrontmatterBlock } from '../shared/frontmatter.js';
6
6
  import YAML from 'yaml';
@@ -48,15 +48,6 @@ async function pathExists(path) {
48
48
  return false;
49
49
  }
50
50
  }
51
- async function isInsideGitWorkTree(cwd) {
52
- try {
53
- await execFileAsync('git', ['rev-parse', '--is-inside-work-tree'], { cwd });
54
- return true;
55
- }
56
- catch {
57
- return false;
58
- }
59
- }
60
51
  /**
61
52
  * Read the item `title` from its frontmatter. Parses the YAML block (rather
62
53
  * than a line regex) so a legitimate `#` inside a quoted title — e.g.
@@ -117,19 +108,37 @@ function insertCompletedEntry(completed, entryLine) {
117
108
  }
118
109
  return { content, scaffolded: false, warning: null };
119
110
  }
120
- async function moveItemFile(backlogRoot, fromPath, toPath, warnings) {
121
- if (await isInsideGitWorkTree(backlogRoot)) {
122
- try {
123
- await execFileAsync('git', ['mv', fromPath, toPath], {
124
- cwd: backlogRoot,
125
- });
126
- return;
127
- }
128
- catch {
129
- warnings.push(`\`git mv\` failed for ${fromPath}; falling back to a plain filesystem rename (the move is no longer staged).`);
130
- }
111
+ async function readHeadFile(backlogRoot, path) {
112
+ try {
113
+ const { stdout } = await execFileAsync('git', ['show', `HEAD:./${relative(resolve(backlogRoot), resolve(path))}`], { cwd: backlogRoot });
114
+ return stdout;
115
+ }
116
+ catch {
117
+ // No Git/HEAD or absent path gives no evidence of a prior operation.
118
+ return null;
131
119
  }
132
- await rename(fromPath, toPath);
120
+ }
121
+ function hasCompletedEntry(content, id) {
122
+ return (content !== null &&
123
+ content
124
+ .split('\n')
125
+ .some((line) => line.startsWith('- ') && line.includes(` — ${id} — `)));
126
+ }
127
+ function hasIndexEntry(content, id) {
128
+ return (content !== null &&
129
+ content
130
+ .split('\n')
131
+ .some((line) => line.startsWith('|') && line.split('|')[1]?.trim() === id));
132
+ }
133
+ function collectAffectedPaths(backlogRoot, id, references, changes) {
134
+ const paths = [...references];
135
+ if (changes.item)
136
+ paths.push(resolve(backlogRoot, 'items', `${id}.md`), resolve(backlogRoot, 'archived', `${id}.md`));
137
+ if (changes.completed)
138
+ paths.push(resolve(backlogRoot, 'completed.md'));
139
+ if (changes.index)
140
+ paths.push(resolve(backlogRoot, 'index.md'));
141
+ return [...new Set(paths)].sort();
133
142
  }
134
143
  /**
135
144
  * Atomic backlog close-out. Validates the current status, sets the terminal
@@ -143,6 +152,8 @@ export async function archiveBacklogItem(backlogRoot, id, options = {}) {
143
152
  const itemsPath = join(backlogRoot, 'items', `${id}.md`);
144
153
  const archivedPath = join(backlogRoot, 'archived', `${id}.md`);
145
154
  const warnings = [];
155
+ const completedPath = join(backlogRoot, 'completed.md');
156
+ const indexPath = join(backlogRoot, 'index.md');
146
157
  // Already archived: no status, completed-log, or move writes; only the
147
158
  // idempotent reference rewrite and index regeneration are retried.
148
159
  if (await pathExists(archivedPath)) {
@@ -165,7 +176,19 @@ export async function archiveBacklogItem(backlogRoot, id, options = {}) {
165
176
  // Retry the idempotent tail of a close-out: a run that failed during the
166
177
  // reference rewrite (or an item archived before the rewrite existed)
167
178
  // still gets its inbound links repointed and the index regenerated.
168
- const references = await rewriteInboundReferences(backlogRoot, itemsPath, archivedPath, { rebaseMovedItem: false });
179
+ const [headItem, headArchived, headCompleted, headIndex] = await Promise.all([
180
+ readHeadFile(backlogRoot, itemsPath),
181
+ readHeadFile(backlogRoot, archivedPath),
182
+ readHeadFile(backlogRoot, completedPath),
183
+ readHeadFile(backlogRoot, indexPath),
184
+ ]);
185
+ const pendingMove = headItem !== null && headArchived === null;
186
+ const indexBefore = await readFile(indexPath, 'utf8').catch((error) => {
187
+ if (error.code === 'ENOENT')
188
+ return null;
189
+ throw error;
190
+ });
191
+ const references = await rewriteInboundReferences(backlogRoot, itemsPath, archivedPath, { rebaseMovedItem: false, recoverPendingArchive: pendingMove });
169
192
  warnings.push(...references.warnings);
170
193
  const regeneration = await regenerateBacklogIndex(backlogRoot);
171
194
  warnings.push(...regeneration.warnings);
@@ -177,6 +200,20 @@ export async function archiveBacklogItem(backlogRoot, id, options = {}) {
177
200
  movedTo: archivedPath,
178
201
  indexRegenerated: true,
179
202
  rewrittenReferences: references.rewritten,
203
+ affectedPaths: collectAffectedPaths(backlogRoot, id, references.affectedPaths, {
204
+ item: pendingMove,
205
+ completed: pendingMove &&
206
+ hasCompletedEntry(await readFile(completedPath, 'utf8').catch((error) => {
207
+ if (error.code === 'ENOENT')
208
+ return '';
209
+ throw error;
210
+ }), id) &&
211
+ !hasCompletedEntry(headCompleted, id),
212
+ index: indexBefore !== (await readFile(indexPath, 'utf8')) ||
213
+ (pendingMove &&
214
+ hasIndexEntry(headIndex, id) &&
215
+ !hasIndexEntry(await readFile(indexPath, 'utf8'), id)),
216
+ }),
180
217
  warnings,
181
218
  };
182
219
  }
@@ -206,7 +243,6 @@ export async function archiveBacklogItem(backlogRoot, id, options = {}) {
206
243
  const shouldWriteEntry = targetStatus === 'closed' || summary.length > 0;
207
244
  if (shouldWriteEntry) {
208
245
  const entryLine = `- ${entryDate} — ${id} — ${title} — ${summary}`;
209
- const completedPath = join(backlogRoot, 'completed.md');
210
246
  let scaffoldedFile = false;
211
247
  let existing;
212
248
  if (await pathExists(completedPath)) {
@@ -224,8 +260,8 @@ export async function archiveBacklogItem(backlogRoot, id, options = {}) {
224
260
  completedEntry =
225
261
  scaffoldedFile || inserted.scaffolded ? 'scaffolded' : 'written';
226
262
  }
227
- // 6. Move items/<id>.md -> archived/<id>.md (git mv with rename fallback).
228
- await moveItemFile(backlogRoot, itemsPath, archivedPath, warnings);
263
+ // 6. Filesystem-only move: the caller owns staging the complete operation.
264
+ await rename(itemsPath, archivedPath);
229
265
  // 7. Rewrite inbound references so no `.oat/repo` link dangles at items/.
230
266
  const references = await rewriteInboundReferences(backlogRoot, itemsPath, archivedPath);
231
267
  warnings.push(...references.warnings);
@@ -240,6 +276,7 @@ export async function archiveBacklogItem(backlogRoot, id, options = {}) {
240
276
  movedTo: archivedPath,
241
277
  indexRegenerated: true,
242
278
  rewrittenReferences: references.rewritten,
279
+ affectedPaths: collectAffectedPaths(backlogRoot, id, references.affectedPaths, { item: true, completed: shouldWriteEntry, index: true }),
243
280
  warnings,
244
281
  };
245
282
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/backlog/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAu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,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,kBAAkB,EAAuB,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AA8B5D,UAAU,0BAA0B;IAClC,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;IACtD,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAChD;AA4ED,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAClD,OAAO,CAkST"}
@@ -210,6 +210,9 @@ export function createBacklogCommand(overrides = {}) {
210
210
  for (const path of result.rewrittenReferences) {
211
211
  context.logger.info(`Rewrote references in ${path}`);
212
212
  }
213
+ for (const path of result.affectedPaths) {
214
+ context.logger.info(`Affected path (caller-owned staging): ${path}`);
215
+ }
213
216
  }
214
217
  process.exitCode = 0;
215
218
  }
@@ -2,6 +2,9 @@
2
2
  export interface RewriteInboundReferencesResult {
3
3
  /** Files whose content was rewritten, relative to the repository root. */
4
4
  rewritten: string[];
5
+ /** Normalized absolute reference paths associated with this item, including
6
+ * links already repaired by an interrupted prior archive pass. */
7
+ affectedPaths: string[];
5
8
  /** One warning per reference that names the item but cannot be resolved. */
6
9
  warnings: string[];
7
10
  }
@@ -13,6 +16,8 @@ export interface RewriteInboundReferencesOptions {
13
16
  * because its links were rebased (or written) against `archived/` already.
14
17
  */
15
18
  rebaseMovedItem?: boolean;
19
+ /** True only when the archive caller proved an uncommitted old/new move in HEAD. */
20
+ recoverPendingArchive?: boolean;
16
21
  }
17
22
  /** A Markdown segment: prose, an inline code span, or a fenced code block. */
18
23
  export interface MarkdownSegment {
@@ -1 +1 @@
1
- {"version":3,"file":"rewrite-references.d.ts","sourceRoot":"","sources":["../../../src/commands/backlog/rewrite-references.ts"],"names":[],"mappings":"AAsCA,kDAAkD;AAClD,MAAM,WAAW,8BAA8B;IAC7C,0EAA0E;IAC1E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA0RD,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,EAAE,CA0EpE;AAmND;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,8BAA8B,CAAC,CAsCzC"}
1
+ {"version":3,"file":"rewrite-references.d.ts","sourceRoot":"","sources":["../../../src/commands/backlog/rewrite-references.ts"],"names":[],"mappings":"AAsCA,kDAAkD;AAClD,MAAM,WAAW,8BAA8B;IAC7C,0EAA0E;IAC1E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;sEACkE;IAClE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oFAAoF;IACpF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAqSD,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,EAAE,CA0EpE;AAmND;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,8BAA8B,CAAC,CAsEzC"}
@@ -204,15 +204,25 @@ function rewriteItemToken(token, context) {
204
204
  if (isRelativeTarget(token)) {
205
205
  const fromFile = resolve(context.baseDirectory, token);
206
206
  if (fromFile === itemsPath) {
207
+ context.affectedReference = true;
207
208
  return relativeFrom(context.currentDirectory, archivedPath, token);
208
209
  }
210
+ if (fromFile === archivedPath) {
211
+ context.affectedReference = true;
212
+ return null;
213
+ }
209
214
  // A token that already resolves to a different, existing file is a
210
215
  // working link: never repoint it through a fallback base.
211
216
  if (pathExistsSync(fromFile)) {
212
217
  return null;
213
218
  }
214
219
  for (const base of [layout.repoRoot, layout.scanRoot]) {
220
+ if (base !== null && resolve(base, token) === archivedPath) {
221
+ context.affectedReference = true;
222
+ return null;
223
+ }
215
224
  if (base !== null && resolve(base, token) === itemsPath) {
225
+ context.affectedReference = true;
216
226
  return toPosix(relative(base, archivedPath));
217
227
  }
218
228
  }
@@ -487,6 +497,7 @@ export async function rewriteInboundReferences(backlogRoot, itemsPath, archivedP
487
497
  const absoluteArchivedPath = resolve(archivedPath);
488
498
  const displayRoot = layout.repoRoot ?? layout.scanRoot;
489
499
  const rewritten = [];
500
+ const affectedPaths = [];
490
501
  const warnings = [];
491
502
  // The moved item goes first, so a failure on a later file never leaves its
492
503
  // own links half-rebased: a retry (which skips the rebase) stays correct.
@@ -505,12 +516,39 @@ export async function rewriteInboundReferences(backlogRoot, itemsPath, archivedP
505
516
  baseDirectory: moved ? dirname(absoluteItemsPath) : dirname(absoluteFile),
506
517
  currentDirectory: dirname(absoluteFile),
507
518
  warnings,
519
+ affectedReference: false,
508
520
  };
509
521
  const next = rewriteContent(content, context, moved);
510
522
  if (next !== content) {
511
523
  await replaceAtomically(absoluteFile, next, identity);
512
524
  rewritten.push(context.fileName);
513
525
  }
526
+ if (next !== content) {
527
+ affectedPaths.push(absoluteFile);
528
+ }
529
+ else if (options.recoverPendingArchive && context.affectedReference) {
530
+ // Existing archived links are not ownership evidence. Recover a prior
531
+ // repaired reference only when HEAD's same grammar still names the old
532
+ // item and this pending move has not yet been committed.
533
+ try {
534
+ const { stdout: headContent } = await execFileAsync('git', [
535
+ 'show',
536
+ `HEAD:./${toPosix(relative(layout.scanRoot, absoluteFile))}`,
537
+ ], { cwd: layout.scanRoot });
538
+ const historicalContext = {
539
+ ...context,
540
+ baseDirectory: dirname(absoluteFile),
541
+ warnings: [],
542
+ affectedReference: false,
543
+ };
544
+ if (rewriteContent(headContent, historicalContext, false) !== headContent) {
545
+ affectedPaths.push(absoluteFile);
546
+ }
547
+ }
548
+ catch {
549
+ // Without historical file bytes there is no proof of prior ownership.
550
+ }
551
+ }
514
552
  }
515
- return { rewritten, warnings };
553
+ return { rewritten, affectedPaths, warnings };
516
554
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAEnB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value: 'vitepress' },
272
272
  { label: 'Nextra', value: 'nextra' },
273
+ { label: 'Plain Markdown', value: 'markdown' },
273
274
  ];
274
275
  function trimDocsRoot(pathValue) {
275
276
  return pathValue.replace(/\/+$/, '').replace(/^\.\//, '').trim();
@@ -1 +1 @@
1
- {"version":3,"file":"skill-script-references.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/skill-script-references.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,KAAK,EAEV,cAAc,EACd,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AAiKzD,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qEAAqE;AACrE,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,+EAA+E;AAC/E,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,qBAAqB,CAAC;AAEvE,mEAAmE;AACnE,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,EAAE,CA4BvE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,GAAE,SAAS,cAAc,EAAkB,GAClD,MAAM,EAAE,CAUV;AAED,+CAA+C;AAC/C,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,QAAQ,EACd,QAAQ,GAAE,SAAS,cAAc,EAAkB,GAClD,MAAM,EAAE,CAQV;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,SAAS,cAAc,EAAkB,GAClD,sBAAsB,CAIxB;AAED,sDAAsD;AACtD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,GAAE,SAAS,cAAc,EAAkB,GAClD,+BAA+B,CAOjC;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,QAAQ,GAAE,SAAS,cAAc,EAAkB,GAClD,MAAM,EAAE,CAGV;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,SAAS,cAAc,EAAkB,GAClD,QAAQ,EAAE,CAgBZ;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,QAAQ,GAAE,SAAS,cAAc,EAAkB,GAClD,wBAAwB,EAAE,CAkB5B;AAED,gFAAgF;AAChF,wBAAgB,8BAA8B,CAAC,EAC7C,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,KAAK,EACL,OAAO,GACR,EAAE,wBAAwB,GAAG,MAAM,CAInC"}
1
+ {"version":3,"file":"skill-script-references.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/skill-script-references.ts"],"names":[],"mappings":"AAAA;;;;;;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