mini-trellis 0.1.0

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 (186) hide show
  1. package/COPYRIGHT +20 -0
  2. package/LICENSE +235 -0
  3. package/README.md +66 -0
  4. package/bin/mini-trellis.js +3 -0
  5. package/dist/cli/index.d.ts +3 -0
  6. package/dist/cli/index.d.ts.map +1 -0
  7. package/dist/cli/index.js +153 -0
  8. package/dist/cli/index.js.map +1 -0
  9. package/dist/commands/init.d.ts +19 -0
  10. package/dist/commands/init.d.ts.map +1 -0
  11. package/dist/commands/init.js +401 -0
  12. package/dist/commands/init.js.map +1 -0
  13. package/dist/commands/mem.d.ts +30 -0
  14. package/dist/commands/mem.d.ts.map +1 -0
  15. package/dist/commands/mem.js +412 -0
  16. package/dist/commands/mem.js.map +1 -0
  17. package/dist/commands/migrate.d.ts +40 -0
  18. package/dist/commands/migrate.d.ts.map +1 -0
  19. package/dist/commands/migrate.js +272 -0
  20. package/dist/commands/migrate.js.map +1 -0
  21. package/dist/commands/uninstall.d.ts +11 -0
  22. package/dist/commands/uninstall.d.ts.map +1 -0
  23. package/dist/commands/uninstall.js +135 -0
  24. package/dist/commands/uninstall.js.map +1 -0
  25. package/dist/commands/upgrade.d.ts +28 -0
  26. package/dist/commands/upgrade.d.ts.map +1 -0
  27. package/dist/commands/upgrade.js +84 -0
  28. package/dist/commands/upgrade.js.map +1 -0
  29. package/dist/configurators/claude.d.ts +3 -0
  30. package/dist/configurators/claude.d.ts.map +1 -0
  31. package/dist/configurators/claude.js +62 -0
  32. package/dist/configurators/claude.js.map +1 -0
  33. package/dist/configurators/codex.d.ts +3 -0
  34. package/dist/configurators/codex.d.ts.map +1 -0
  35. package/dist/configurators/codex.js +21 -0
  36. package/dist/configurators/codex.js.map +1 -0
  37. package/dist/configurators/index.d.ts +24 -0
  38. package/dist/configurators/index.d.ts.map +1 -0
  39. package/dist/configurators/index.js +80 -0
  40. package/dist/configurators/index.js.map +1 -0
  41. package/dist/configurators/opencode.d.ts +2 -0
  42. package/dist/configurators/opencode.d.ts.map +1 -0
  43. package/dist/configurators/opencode.js +62 -0
  44. package/dist/configurators/opencode.js.map +1 -0
  45. package/dist/configurators/pi.d.ts +2 -0
  46. package/dist/configurators/pi.d.ts.map +1 -0
  47. package/dist/configurators/pi.js +18 -0
  48. package/dist/configurators/pi.js.map +1 -0
  49. package/dist/configurators/shared.d.ts +147 -0
  50. package/dist/configurators/shared.d.ts.map +1 -0
  51. package/dist/configurators/shared.js +377 -0
  52. package/dist/configurators/shared.js.map +1 -0
  53. package/dist/configurators/workflow.d.ts +15 -0
  54. package/dist/configurators/workflow.d.ts.map +1 -0
  55. package/dist/configurators/workflow.js +46 -0
  56. package/dist/configurators/workflow.js.map +1 -0
  57. package/dist/constants/paths.d.ts +74 -0
  58. package/dist/constants/paths.d.ts.map +1 -0
  59. package/dist/constants/paths.js +83 -0
  60. package/dist/constants/paths.js.map +1 -0
  61. package/dist/constants/version.d.ts +9 -0
  62. package/dist/constants/version.d.ts.map +1 -0
  63. package/dist/constants/version.js +15 -0
  64. package/dist/constants/version.js.map +1 -0
  65. package/dist/index.d.ts +9 -0
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/index.js +9 -0
  68. package/dist/index.js.map +1 -0
  69. package/dist/templates/claude/index.d.ts +11 -0
  70. package/dist/templates/claude/index.d.ts.map +1 -0
  71. package/dist/templates/claude/index.js +17 -0
  72. package/dist/templates/claude/index.js.map +1 -0
  73. package/dist/templates/claude/settings.json +40 -0
  74. package/dist/templates/codex/config.toml +39 -0
  75. package/dist/templates/codex/hooks.json +15 -0
  76. package/dist/templates/codex/index.d.ts +11 -0
  77. package/dist/templates/codex/index.d.ts.map +1 -0
  78. package/dist/templates/codex/index.js +22 -0
  79. package/dist/templates/codex/index.js.map +1 -0
  80. package/dist/templates/common/bundled-skills/mini-trellis-session-insight/SKILL.md +37 -0
  81. package/dist/templates/common/bundled-skills/mini-trellis-session-insight/references/cli-quick-reference.md +36 -0
  82. package/dist/templates/common/bundled-skills/mini-trellis-session-insight/references/triggering-patterns.md +93 -0
  83. package/dist/templates/common/commands/remember.md +22 -0
  84. package/dist/templates/common/index.d.ts +48 -0
  85. package/dist/templates/common/index.d.ts.map +1 -0
  86. package/dist/templates/common/index.js +104 -0
  87. package/dist/templates/common/index.js.map +1 -0
  88. package/dist/templates/common/skills/update-spec.md +16 -0
  89. package/dist/templates/extract.d.ts +40 -0
  90. package/dist/templates/extract.d.ts.map +1 -0
  91. package/dist/templates/extract.js +106 -0
  92. package/dist/templates/extract.js.map +1 -0
  93. package/dist/templates/markdown/agents.md +15 -0
  94. package/dist/templates/markdown/index.d.ts +10 -0
  95. package/dist/templates/markdown/index.d.ts.map +1 -0
  96. package/dist/templates/markdown/index.js +18 -0
  97. package/dist/templates/markdown/index.js.map +1 -0
  98. package/dist/templates/markdown/research-readme.md +9 -0
  99. package/dist/templates/markdown/spec/guides/index.md.txt +5 -0
  100. package/dist/templates/markdown/spec/guides/mini-memory.md.txt +30 -0
  101. package/dist/templates/markdown/workspace-index.md +23 -0
  102. package/dist/templates/opencode/lib/context-visibility.js +148 -0
  103. package/dist/templates/opencode/lib/session-utils.js +394 -0
  104. package/dist/templates/opencode/lib/trellis-context.js +627 -0
  105. package/dist/templates/opencode/package.json +5 -0
  106. package/dist/templates/opencode/plugins/session-start.js +65 -0
  107. package/dist/templates/pi/extensions/mini-trellis/index.ts.txt +170 -0
  108. package/dist/templates/pi/index.d.ts +4 -0
  109. package/dist/templates/pi/index.d.ts.map +1 -0
  110. package/dist/templates/pi/index.js +9 -0
  111. package/dist/templates/pi/index.js.map +1 -0
  112. package/dist/templates/pi/settings.json +9 -0
  113. package/dist/templates/shared-hooks/index.d.ts +13 -0
  114. package/dist/templates/shared-hooks/index.d.ts.map +1 -0
  115. package/dist/templates/shared-hooks/index.js +26 -0
  116. package/dist/templates/shared-hooks/index.js.map +1 -0
  117. package/dist/templates/shared-hooks/session-start.py +676 -0
  118. package/dist/templates/template-utils.d.ts +26 -0
  119. package/dist/templates/template-utils.d.ts.map +1 -0
  120. package/dist/templates/template-utils.js +64 -0
  121. package/dist/templates/template-utils.js.map +1 -0
  122. package/dist/templates/trellis/config.yaml +34 -0
  123. package/dist/templates/trellis/gitattributes.txt +9 -0
  124. package/dist/templates/trellis/gitignore.txt +32 -0
  125. package/dist/templates/trellis/index.d.ts +8 -0
  126. package/dist/templates/trellis/index.d.ts.map +1 -0
  127. package/dist/templates/trellis/index.js +16 -0
  128. package/dist/templates/trellis/index.js.map +1 -0
  129. package/dist/templates/trellis/scripts/__init__.py +5 -0
  130. package/dist/templates/trellis/scripts/add_session.py +1545 -0
  131. package/dist/templates/trellis/scripts/common/__init__.py +94 -0
  132. package/dist/templates/trellis/scripts/common/active_task.py +855 -0
  133. package/dist/templates/trellis/scripts/common/cli_adapter.py +950 -0
  134. package/dist/templates/trellis/scripts/common/config.py +482 -0
  135. package/dist/templates/trellis/scripts/common/developer.py +192 -0
  136. package/dist/templates/trellis/scripts/common/git.py +203 -0
  137. package/dist/templates/trellis/scripts/common/git_context.py +106 -0
  138. package/dist/templates/trellis/scripts/common/io.py +160 -0
  139. package/dist/templates/trellis/scripts/common/log.py +45 -0
  140. package/dist/templates/trellis/scripts/common/packages_context.py +238 -0
  141. package/dist/templates/trellis/scripts/common/paths.py +543 -0
  142. package/dist/templates/trellis/scripts/common/safe_commit.py +322 -0
  143. package/dist/templates/trellis/scripts/common/session_context.py +708 -0
  144. package/dist/templates/trellis/scripts/common/task_context.py +470 -0
  145. package/dist/templates/trellis/scripts/common/task_queue.py +188 -0
  146. package/dist/templates/trellis/scripts/common/task_store.py +1930 -0
  147. package/dist/templates/trellis/scripts/common/task_utils.py +498 -0
  148. package/dist/templates/trellis/scripts/common/tasks.py +122 -0
  149. package/dist/templates/trellis/scripts/common/trellis_config.py +239 -0
  150. package/dist/templates/trellis/scripts/common/types.py +110 -0
  151. package/dist/templates/trellis/scripts/common/workflow_phase.py +242 -0
  152. package/dist/templates/trellis/scripts/get_context.py +16 -0
  153. package/dist/templates/trellis/scripts/init_developer.py +51 -0
  154. package/dist/types/ai-tools.d.ts +30 -0
  155. package/dist/types/ai-tools.d.ts.map +1 -0
  156. package/dist/types/ai-tools.js +89 -0
  157. package/dist/types/ai-tools.js.map +1 -0
  158. package/dist/utils/atomic-write.d.ts +12 -0
  159. package/dist/utils/atomic-write.d.ts.map +1 -0
  160. package/dist/utils/atomic-write.js +30 -0
  161. package/dist/utils/atomic-write.js.map +1 -0
  162. package/dist/utils/cwd-guard.d.ts +38 -0
  163. package/dist/utils/cwd-guard.d.ts.map +1 -0
  164. package/dist/utils/cwd-guard.js +62 -0
  165. package/dist/utils/cwd-guard.js.map +1 -0
  166. package/dist/utils/file-writer.d.ts +36 -0
  167. package/dist/utils/file-writer.d.ts.map +1 -0
  168. package/dist/utils/file-writer.js +204 -0
  169. package/dist/utils/file-writer.js.map +1 -0
  170. package/dist/utils/managed-paths.d.ts +5 -0
  171. package/dist/utils/managed-paths.d.ts.map +1 -0
  172. package/dist/utils/managed-paths.js +51 -0
  173. package/dist/utils/managed-paths.js.map +1 -0
  174. package/dist/utils/managed-removal.d.ts +42 -0
  175. package/dist/utils/managed-removal.d.ts.map +1 -0
  176. package/dist/utils/managed-removal.js +223 -0
  177. package/dist/utils/managed-removal.js.map +1 -0
  178. package/dist/utils/posix.d.ts +13 -0
  179. package/dist/utils/posix.d.ts.map +1 -0
  180. package/dist/utils/posix.js +15 -0
  181. package/dist/utils/posix.js.map +1 -0
  182. package/dist/utils/uninstall-scrubbers.d.ts +66 -0
  183. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
  184. package/dist/utils/uninstall-scrubbers.js +417 -0
  185. package/dist/utils/uninstall-scrubbers.js.map +1 -0
  186. package/package.json +80 -0
@@ -0,0 +1,322 @@
1
+ """
2
+ Safe git-add helpers for Trellis-owned paths.
3
+
4
+ Why this module exists
5
+ ----------------------
6
+ A real user incident: a project's `.gitignore` listed `.trellis/` (company-wide
7
+ template / personal habit). When `add_session.py` and `task.py archive` ran
8
+ their auto-commit and `git add` failed with `ignored by .gitignore`, the AI
9
+ agent driving the workflow "fixed" it by retrying with
10
+ `git add -f .trellis/` — which fan-out-included every ignored subtree
11
+ (`.trellis/.backup-*/`, `.trellis/worktrees/`, `.trellis/.template-hashes.json`,
12
+ `.trellis/.runtime/`), committing 548 files / 83474 lines of caches/backups.
13
+
14
+ Design
15
+ ------
16
+ - Scripts only stage SPECIFIC product paths (journal files, index.md, the
17
+ current task dir, the archive dir). Never the whole `.trellis/` tree.
18
+ - If plain `git add <specific>` fails with "ignored by", DO NOT retry with
19
+ ``-f``. The presence of `.trellis/` in `.gitignore` is treated as user
20
+ intent ("keep .trellis/ local-only"). The script warns and skips the
21
+ auto-commit; users who want auto-staging can either fix their `.gitignore`
22
+ or set ``session_auto_commit: false`` and manage git themselves.
23
+ - The warning includes a negative example: ``Do NOT use `git add -f .trellis/` ...``
24
+ so any AI rereading the log doesn't reinvent the bug.
25
+
26
+ History note: 0.5.10 introduced an automatic ``git add -f`` retry on the
27
+ specific paths. That was reverted in 0.5.11 — auto-forcing into a tree the
28
+ user had gitignored violates user intent even when the path list is narrow.
29
+ The wider-grain forbidden command stays forbidden, and the narrow-grain auto
30
+ ``-f`` is gone too.
31
+ """
32
+
33
+ from __future__ import annotations
34
+
35
+ import sys
36
+ from pathlib import Path
37
+
38
+ from .git import run_git, run_git_retry_index_lock
39
+ from .paths import (
40
+ DIR_ARCHIVE,
41
+ DIR_TASKS,
42
+ DIR_WORKFLOW,
43
+ DIR_WORKSPACE,
44
+ FILE_JOURNAL_PREFIX,
45
+ get_developer,
46
+ )
47
+
48
+
49
+ # Paths under .trellis/ that must NEVER be auto-staged. Listed here so the
50
+ # warning to the user can show concrete subpaths to ignore individually
51
+ # instead of ignoring the whole `.trellis/` tree.
52
+ TRELLIS_IGNORED_SUBPATHS = (
53
+ ".trellis/.backup-*",
54
+ ".trellis/worktrees/",
55
+ ".trellis/.template-hashes.json",
56
+ ".trellis/.runtime/",
57
+ ".trellis/.cache/",
58
+ )
59
+
60
+
61
+ def safe_trellis_paths_to_add(
62
+ repo_root: Path,
63
+ task_name: str | None = None,
64
+ ) -> list[str]:
65
+ """Return the list of repo-relative paths the auto-commit should stage.
66
+
67
+ Only includes paths that exist on disk so callers don't pass non-existent
68
+ arguments to git. The caller is responsible for `git diff --cached`
69
+ checking afterwards.
70
+
71
+ Included:
72
+ - .trellis/workspace/<developer>/journal-*.md
73
+ - .trellis/workspace/<developer>/index.md
74
+ - .trellis/tasks/<task_name>/ (ONLY the current task dir when
75
+ ``task_name`` is passed; plus its archive location if the task
76
+ already lives under archive/)
77
+
78
+ Excluded (intentionally — these must not be staged):
79
+ - .trellis/.backup-*, .trellis/worktrees/,
80
+ .trellis/.template-hashes.json, .trellis/.runtime/, .trellis/.cache/
81
+
82
+ Scope contract (see #303 / break-loop analysis): when ``task_name`` is
83
+ passed, the task segment stages ONLY that task directory — it never walks
84
+ ``tasks_dir.iterdir()`` over all active tasks. This mirrors
85
+ :func:`safe_archive_paths_to_add` and prevents dirty changes in OTHER
86
+ parallel-window task dirs from being bundled into the session auto-commit.
87
+
88
+ Backwards-compat: with no ``task_name``, the function walks every active
89
+ task directory (+ the archive subtree) the old wide way. New callers
90
+ should always pass ``task_name``.
91
+ """
92
+ paths: list[str] = []
93
+
94
+ # Workspace journal files + index.md
95
+ developer = get_developer(repo_root)
96
+ if developer:
97
+ ws = repo_root / DIR_WORKFLOW / DIR_WORKSPACE / developer
98
+ if ws.is_dir():
99
+ for f in sorted(ws.glob(f"{FILE_JOURNAL_PREFIX}*.md")):
100
+ if f.is_file():
101
+ paths.append(
102
+ f"{DIR_WORKFLOW}/{DIR_WORKSPACE}/{developer}/{f.name}"
103
+ )
104
+ index_md = ws / "index.md"
105
+ if index_md.is_file():
106
+ paths.append(
107
+ f"{DIR_WORKFLOW}/{DIR_WORKSPACE}/{developer}/index.md"
108
+ )
109
+
110
+ tasks_dir = repo_root / DIR_WORKFLOW / DIR_TASKS
111
+ if not tasks_dir.is_dir():
112
+ return paths
113
+
114
+ if task_name is not None:
115
+ # Narrow scope — ONLY the current task directory (active or archived).
116
+ # Never iterdir() all tasks: parallel-window dirty task dirs must not
117
+ # leak into the session auto-commit.
118
+ active_task = tasks_dir / task_name
119
+ if active_task.is_dir():
120
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{task_name}")
121
+ archived_task = tasks_dir / DIR_ARCHIVE / task_name
122
+ if archived_task.is_dir():
123
+ paths.append(
124
+ f"{DIR_WORKFLOW}/{DIR_TASKS}/{DIR_ARCHIVE}/{task_name}"
125
+ )
126
+ return paths
127
+
128
+ # Legacy wide scope (no task_name): each direct child of tasks/ that is a
129
+ # directory and not the archive root, plus the whole archive subtree.
130
+ for child in sorted(tasks_dir.iterdir()):
131
+ if not child.is_dir():
132
+ continue
133
+ if child.name == DIR_ARCHIVE:
134
+ continue
135
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{child.name}")
136
+
137
+ archive_dir = tasks_dir / DIR_ARCHIVE
138
+ if archive_dir.is_dir():
139
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{DIR_ARCHIVE}")
140
+
141
+ return paths
142
+
143
+
144
+ def safe_archive_paths_to_add(
145
+ repo_root: Path,
146
+ task_name: str | None = None,
147
+ modified_children: list[str] | None = None,
148
+ ) -> list[str]:
149
+ """Return paths to stage after `task.py archive`.
150
+
151
+ Scoped to ONLY the paths the archive operation actually touched:
152
+
153
+ - the archive subtree (where the freshly-moved task lives)
154
+ - the source task directory (for source-side deletes; caller pairs
155
+ this with `git rm --cached` since `git add` won't stage deletes
156
+ for a path that no longer exists in the working tree)
157
+ - any child task directories whose `task.json` was edited to drop
158
+ the archived parent (parent-children relationship update)
159
+
160
+ This narrow scope avoids "scope creep" — dirty changes in OTHER
161
+ active task dirs (parallel-window edits) are NOT bundled into the
162
+ archive commit. Callers handle each kind of change in its own
163
+ commit boundary.
164
+
165
+ Backwards-compat: with no arguments, the function walks the whole
166
+ `.trellis/tasks/` subtree the old way (active tasks + archive). New
167
+ callers should always pass `task_name`.
168
+ """
169
+ paths: list[str] = []
170
+ tasks_dir = repo_root / DIR_WORKFLOW / DIR_TASKS
171
+ if not tasks_dir.is_dir():
172
+ return paths
173
+
174
+ archive_dir = tasks_dir / DIR_ARCHIVE
175
+
176
+ if task_name is not None:
177
+ # Narrow scope — only paths that still exist on disk (so
178
+ # `git add` doesn't choke on the moved-away source). The caller
179
+ # handles the source-side deletes via `git rm --cached`
180
+ # explicitly.
181
+ if archive_dir.is_dir():
182
+ paths.append(
183
+ f"{DIR_WORKFLOW}/{DIR_TASKS}/{DIR_ARCHIVE}"
184
+ )
185
+ for child_name in modified_children or []:
186
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{child_name}")
187
+ return paths
188
+
189
+ # Legacy wide scope (no task_name): preserve old behavior so callers
190
+ # that have not been updated keep working.
191
+ if archive_dir.is_dir():
192
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{DIR_ARCHIVE}")
193
+ for child in sorted(tasks_dir.iterdir()):
194
+ if not child.is_dir():
195
+ continue
196
+ if child.name == DIR_ARCHIVE:
197
+ continue
198
+ paths.append(f"{DIR_WORKFLOW}/{DIR_TASKS}/{child.name}")
199
+ return paths
200
+
201
+
202
+ def _stderr_indicates_ignored(stderr: str) -> bool:
203
+ """git add error indicates the path is excluded by .gitignore."""
204
+ if not stderr:
205
+ return False
206
+ lowered = stderr.lower()
207
+ return "ignored by" in lowered
208
+
209
+
210
+ def safe_git_add(
211
+ paths: list[str], repo_root: Path, retry_on_index_lock: bool = False
212
+ ) -> tuple[bool, bool, str]:
213
+ """Run `git add` on specific paths; never retry with -f.
214
+
215
+ Returns ``(success, used_force, stderr)``. The ``used_force`` field is
216
+ kept for signature compatibility with the 0.5.10 implementation but is
217
+ always ``False`` — we never auto-force.
218
+
219
+ Behavior:
220
+ - No paths passed → success, no force, empty stderr.
221
+ - Plain ``git add -- <paths>`` succeeds → return success.
222
+ - Plain fails (any reason — ignored or otherwise) → return failure with
223
+ the stderr. Callers should inspect the stderr (see
224
+ :func:`print_gitignore_warning`) and skip the auto-commit.
225
+
226
+ ``retry_on_index_lock`` opts into the bounded backoff-retry for a held
227
+ ``.git/index.lock`` (see :func:`~.git.run_git_retry_index_lock`). It is
228
+ off by default: only the archive path, which has already moved the task
229
+ directory on disk by the time it stages, needs to wait out a transient
230
+ lock rather than fail.
231
+ """
232
+ if not paths:
233
+ return True, False, ""
234
+
235
+ runner = run_git_retry_index_lock if retry_on_index_lock else run_git
236
+ rc, _, err = runner(["add", "--", *paths], cwd=repo_root)
237
+ if rc == 0:
238
+ return True, False, ""
239
+ return False, False, err
240
+
241
+
242
+ def print_gitignore_warning(paths: list[str]) -> None:
243
+ """Explain to the user (and any AI reading the log) what to do.
244
+
245
+ CRITICAL: includes the negative example
246
+ ``Do NOT use `git add -f .trellis/``` — agents reading the warning are
247
+ known to invent that command, which fans out to ignored caches/backups.
248
+ """
249
+ print(
250
+ "[WARN] git add failed because .trellis/ paths are ignored by your .gitignore.",
251
+ file=sys.stderr,
252
+ )
253
+ print(
254
+ "[WARN] Skipping auto-commit. The journal/task files were still written to disk;",
255
+ file=sys.stderr,
256
+ )
257
+ print(
258
+ "[WARN] git was not touched.",
259
+ file=sys.stderr,
260
+ )
261
+ print("[WARN]", file=sys.stderr)
262
+ print(
263
+ "[WARN] Trellis manages these specific paths and they should be tracked:",
264
+ file=sys.stderr,
265
+ )
266
+ if paths:
267
+ for p in paths:
268
+ print(f"[WARN] {p}", file=sys.stderr)
269
+ else:
270
+ print(
271
+ "[WARN] .trellis/workspace/<developer>/{journal-*.md,index.md}",
272
+ file=sys.stderr,
273
+ )
274
+ print(
275
+ "[WARN] .trellis/tasks/<task-dir>/",
276
+ file=sys.stderr,
277
+ )
278
+ print(
279
+ "[WARN] .trellis/tasks/archive/",
280
+ file=sys.stderr,
281
+ )
282
+ print("[WARN]", file=sys.stderr)
283
+ print(
284
+ "[WARN] Recommended: change your .gitignore from `.trellis/` to specific",
285
+ file=sys.stderr,
286
+ )
287
+ print(
288
+ "[WARN] subpaths that should remain ignored, e.g.:",
289
+ file=sys.stderr,
290
+ )
291
+ for sub in TRELLIS_IGNORED_SUBPATHS:
292
+ print(f"[WARN] {sub}", file=sys.stderr)
293
+ print("[WARN]", file=sys.stderr)
294
+ print(
295
+ "[WARN] Or, if you intentionally keep .trellis/ local-only, set in",
296
+ file=sys.stderr,
297
+ )
298
+ print(
299
+ "[WARN] .trellis/config.yaml:",
300
+ file=sys.stderr,
301
+ )
302
+ print(
303
+ "[WARN] session_auto_commit: false",
304
+ file=sys.stderr,
305
+ )
306
+ print(
307
+ "[WARN] so the scripts skip git entirely and you can review / commit",
308
+ file=sys.stderr,
309
+ )
310
+ print(
311
+ "[WARN] manually with `git status` / `git add` / `git commit`.",
312
+ file=sys.stderr,
313
+ )
314
+ print("[WARN]", file=sys.stderr)
315
+ print(
316
+ "[WARN] Do NOT use `git add -f .trellis/` — it pulls in backups, worktrees,",
317
+ file=sys.stderr,
318
+ )
319
+ print(
320
+ "[WARN] and runtime caches that should never be committed.",
321
+ file=sys.stderr,
322
+ )