@mjasnikovs/pi-task 0.14.0 → 0.14.1

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.
@@ -74,6 +74,13 @@ export declare function classifyEnforceChildFailure(r: EnforceChildResult): stri
74
74
  * names of any new (untracked) files. Non-destructive — it does not touch the
75
75
  * index, so the later `git add -A` in gitCommitAll still stages everything
76
76
  * (including fixes the enforcement child makes).
77
+ *
78
+ * The `.pi-tasks/` directory is excluded from both git commands. Those task
79
+ * files are committable (tracked) by design, so they show up in `git diff HEAD`
80
+ * and `git ls-files --others` — git does not honor the fd/ripgrep `.ignore` that
81
+ * keeps them out of the worker's find/grep discovery. Without this pathspec the
82
+ * enforce child is handed its own TASK_*.md / TASK_AUTO_*.md bookkeeping as
83
+ * "changes to verify" and edits them, corrupting the front matter mid-run.
77
84
  */
78
85
  export declare function captureDiff(cwd: string, signal?: AbortSignal, spawnFn?: SpawnFn): Promise<string>;
79
86
  export interface EnforcementDeps {
@@ -20,6 +20,7 @@ import * as fsp from 'node:fs/promises';
20
20
  import * as path from 'node:path';
21
21
  import { runChildDefault } from '../shared/child-process.js';
22
22
  import { USER_CANCELLED } from './child-runner.js';
23
+ import { TASKS_DIR_NAME } from './task-types.js';
23
24
  /** Filenames discovered in the working directory (cwd only — no tree walk). */
24
25
  export const GUIDELINE_FILENAMES = ['AGENTS.md', 'CLAUDE.md'];
25
26
  /** Tools the fix pass is allowed: read/search to inspect, edit/write to fix. */
@@ -131,11 +132,28 @@ export function classifyEnforceChildFailure(r) {
131
132
  * names of any new (untracked) files. Non-destructive — it does not touch the
132
133
  * index, so the later `git add -A` in gitCommitAll still stages everything
133
134
  * (including fixes the enforcement child makes).
135
+ *
136
+ * The `.pi-tasks/` directory is excluded from both git commands. Those task
137
+ * files are committable (tracked) by design, so they show up in `git diff HEAD`
138
+ * and `git ls-files --others` — git does not honor the fd/ripgrep `.ignore` that
139
+ * keeps them out of the worker's find/grep discovery. Without this pathspec the
140
+ * enforce child is handed its own TASK_*.md / TASK_AUTO_*.md bookkeeping as
141
+ * "changes to verify" and edits them, corrupting the front matter mid-run.
134
142
  */
135
143
  export async function captureDiff(cwd, signal, spawnFn) {
144
+ // `:(exclude)<dir>` is a git pathspec that drops everything under the tasks
145
+ // directory from the result, leaving only real source changes to verify.
146
+ const excludeTasks = `:(exclude)${TASKS_DIR_NAME}`;
136
147
  const run = (args) => runChildDefault({ command: 'git', args }, cwd, signal, { mode: 'text' }, spawnFn);
137
- const tracked = await run(['diff', 'HEAD']);
138
- const untracked = await run(['ls-files', '--others', '--exclude-standard']);
148
+ const tracked = await run(['diff', 'HEAD', '--', '.', excludeTasks]);
149
+ const untracked = await run([
150
+ 'ls-files',
151
+ '--others',
152
+ '--exclude-standard',
153
+ '--',
154
+ '.',
155
+ excludeTasks
156
+ ]);
139
157
  const parts = [];
140
158
  if (tracked.exitCode === 0 && tracked.stdout.trim().length > 0)
141
159
  parts.push(tracked.stdout.trim());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjasnikovs/pi-task",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Deterministic spec-orchestration for local models, with a bundled real-time remote web view and web/docs/fetch/worker subagent tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",