@pmelab/gtd 64.1.2 → 64.3.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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +28 -16
- package/dist/chunks/{steering-CQzL-lX1.mjs → steering-DEh_MS40.mjs} +57 -0
- package/dist/chunks/{testkit-D539mnDI.mjs → testkit-BUX-47TD.mjs} +61 -18
- package/dist/gtd.bundle.mjs +144 -51
- package/dist/gtd.core.mjs +110 -109
- package/dist/steering.mjs +1 -1
- package/dist/testkit/gherkin.mjs +1 -1
- package/dist/testkit.mjs +1 -1
- package/dist/web/main.js +81 -14
- package/dist/workflow-kit.mjs +1 -1
- package/package.json +1 -1
- package/src/cli/Cli.test.ts +1 -0
- package/src/cli/Cli.ts +17 -2
- package/src/cli/Program.ts +6 -0
- package/src/cli/ToolCommands.ts +1 -0
- package/src/edge/Edge.test.ts +22 -0
- package/src/edge/Edge.ts +22 -0
- package/src/edge/index.ts +1 -0
- package/src/platform/Git.ts +33 -10
- package/src/steering/SteeringFormat.ts +4 -1
- package/src/steering/freeform.test.ts +51 -1
- package/src/steering/freeform.ts +38 -0
- package/src/twins/FakeGitOperations.ts +2 -0
- package/src/twins/GitTiers.ts +26 -1
- package/src/twins/InMemRepo.ts +5 -0
package/src/twins/GitTiers.ts
CHANGED
|
@@ -131,7 +131,12 @@ export interface GitTier {
|
|
|
131
131
|
const noopNarratorLayer = Narrator.layer(() => {}, false)
|
|
132
132
|
|
|
133
133
|
const gitExecIn = (dir: string, ...args: string[]): string =>
|
|
134
|
-
execSync(`git ${args.join(" ")}`, {
|
|
134
|
+
execSync(`git ${args.join(" ")}`, {
|
|
135
|
+
cwd: dir,
|
|
136
|
+
encoding: "utf8",
|
|
137
|
+
stdio: "pipe",
|
|
138
|
+
maxBuffer: 1 << 28,
|
|
139
|
+
}).trim()
|
|
135
140
|
|
|
136
141
|
const makeLiveTier = (initialCommit = true): GitTier => {
|
|
137
142
|
// realpath'd once here so `t.root` matches `git rev-parse --show-toplevel`'s
|
|
@@ -150,6 +155,7 @@ const makeLiveTier = (initialCommit = true): GitTier => {
|
|
|
150
155
|
cwd: root,
|
|
151
156
|
env: commitEnv(),
|
|
152
157
|
stdio: "pipe",
|
|
158
|
+
maxBuffer: 1 << 28,
|
|
153
159
|
})
|
|
154
160
|
gitExec("init")
|
|
155
161
|
gitExec(`config user.email "test@test.com"`)
|
|
@@ -432,6 +438,7 @@ export const CONTRACT_COVERED_OPERATIONS: ReadonlySet<keyof GitOperations> = new
|
|
|
432
438
|
"subjectHistory",
|
|
433
439
|
"readFileAtRef",
|
|
434
440
|
"changedPaths",
|
|
441
|
+
"untrackedPaths",
|
|
435
442
|
"stagedPaths",
|
|
436
443
|
"diffPaths",
|
|
437
444
|
"authorIdent",
|
|
@@ -1098,6 +1105,24 @@ export const runGitServiceContract = (makeTier: () => GitTier): void => {
|
|
|
1098
1105
|
expect(await runGit(t, (g) => g.changedPaths())).toEqual([])
|
|
1099
1106
|
})
|
|
1100
1107
|
|
|
1108
|
+
it("classifies an untracked set far past the argument limit, against an older base", async () => {
|
|
1109
|
+
const long = "d".repeat(200)
|
|
1110
|
+
const paths = Array.from({ length: 4000 }, (_, i) => `${long}/${long}/${long}/f${i}.txt`)
|
|
1111
|
+
t.seed.commit("chore: seed", { "kept.txt": "seed" })
|
|
1112
|
+
const seed = t.observe.resolveRef("HEAD")
|
|
1113
|
+
t.seed.commit(
|
|
1114
|
+
"chore: files",
|
|
1115
|
+
Object.fromEntries(paths.map((p, i) => [p, i % 2 === 0 ? "same" : "old"])),
|
|
1116
|
+
)
|
|
1117
|
+
const head = t.observe.resolveRef("HEAD")
|
|
1118
|
+
t.seed.mixedReset(seed)
|
|
1119
|
+
paths.forEach((p, i) => t.seed.writeFile(p, i % 2 === 0 ? "same" : "new"))
|
|
1120
|
+
const changed = await runGit(t, (g) => g.changedPaths(head))
|
|
1121
|
+
expect(changed.length).toBe(2000)
|
|
1122
|
+
expect(changed.every((c) => c.status === "M")).toBe(true)
|
|
1123
|
+
expect((await runGit(t, (g) => g.untrackedPaths())).length).toBe(4000)
|
|
1124
|
+
})
|
|
1125
|
+
|
|
1101
1126
|
it("ignores an edit staged and then reverted in the worktree", async () => {
|
|
1102
1127
|
t.seed.commit("chore: seed", { "a.txt": "1" })
|
|
1103
1128
|
t.seed.writeFile("a.txt", "2")
|
package/src/twins/InMemRepo.ts
CHANGED
|
@@ -298,6 +298,11 @@ export class InMemRepo {
|
|
|
298
298
|
return diffTrees(baseTree, worktreeTree)
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
/** Worktree paths the index does not carry. */
|
|
302
|
+
untrackedPaths(): string[] {
|
|
303
|
+
return [...this.worktree.keys()].filter((k) => !this.index.has(k))
|
|
304
|
+
}
|
|
305
|
+
|
|
301
306
|
/** The index vs HEAD — the port's `stagedPaths`. */
|
|
302
307
|
stagedPaths(): Array<{ path: string; status: string }> {
|
|
303
308
|
return diffTrees(this.treeAt(undefined), this.index)
|