@pmelab/gtd 24.0.0 → 24.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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +31 -5
- package/claude/hooks/access.ts +1 -1
- package/dist/chunks/Schema-Dh-mkwkq.mjs +25353 -0
- package/dist/chunks/reserved-ejn-LVYO.mjs +1388 -0
- package/dist/chunks/rolldown-runtime-8H4AJuhK.mjs +14 -0
- package/dist/chunks/steering-D-PvRC5W.mjs +16296 -0
- package/dist/chunks/wire-DA7q2ikx.mjs +473 -0
- package/dist/flows.mjs +525 -0
- package/dist/gtd.bundle.mjs +43339 -55575
- package/dist/steering.mjs +2 -0
- package/dist/testkit.mjs +13006 -0
- package/dist/wire.mjs +2 -0
- package/dist/workflow-kit.mjs +352 -0
- package/dist/workflows/feature.mjs +315 -0
- package/dist/workflows/fix.mjs +40 -0
- package/dist/workflows/review.mjs +25 -0
- package/dist/workflows.mjs +8 -6
- package/package.json +69 -8
- package/src/cli/Cli.test.ts +1329 -0
- package/src/cli/Cli.ts +1348 -0
- package/src/cli/Program.test.ts +2262 -0
- package/src/cli/Program.ts +1331 -0
- package/src/cli/ToolCommands.ts +43 -0
- package/src/cli/index.ts +14 -0
- package/src/edge/Edge.test.ts +1016 -0
- package/src/edge/Edge.ts +1225 -0
- package/src/edge/index.ts +16 -0
- package/src/emit/Emit.test.ts +425 -0
- package/src/emit/Emit.ts +139 -0
- package/src/emit/GitScript.test.ts +260 -0
- package/src/emit/GitScript.ts +131 -0
- package/src/emit/ModeContradiction.test.ts +120 -0
- package/src/emit/ModeContradiction.ts +66 -0
- package/src/emit/OutcomeScript.test.ts +238 -0
- package/src/emit/OutcomeScript.ts +73 -0
- package/src/emit/SteeringMode.test.ts +274 -0
- package/src/emit/SteeringMode.ts +256 -0
- package/src/emit/index.ts +40 -0
- package/src/install/ConfigScaffold.ts +19 -0
- package/src/install/Install.test.ts +426 -0
- package/src/install/Install.ts +634 -0
- package/src/install/Version.ts +27 -0
- package/src/install/index.ts +3 -0
- package/src/platform/CommandRunner.ts +74 -0
- package/src/platform/Commentary.test.ts +126 -0
- package/src/platform/Commentary.ts +92 -0
- package/src/platform/Git.test.ts +50 -0
- package/src/platform/Git.ts +552 -0
- package/src/platform/Host.ts +42 -0
- package/src/platform/RetainedHistory.test.ts +65 -0
- package/src/platform/RetainedHistory.ts +34 -0
- package/src/platform/Workspace.test.ts +669 -0
- package/src/platform/Workspace.ts +631 -0
- package/src/platform/WorktreeState.test.ts +162 -0
- package/src/platform/WorktreeState.ts +50 -0
- package/src/platform/index.ts +22 -0
- package/src/replay/Access.test.ts +53 -0
- package/src/replay/Access.ts +46 -0
- package/src/replay/Format.test.ts +20 -0
- package/src/replay/Format.ts +14 -0
- package/src/replay/Replay.test.ts +887 -0
- package/src/replay/Replay.ts +669 -0
- package/src/replay/Trailers.test.ts +117 -0
- package/src/replay/Trailers.ts +213 -0
- package/src/replay/Tree.test.ts +25 -0
- package/src/replay/Tree.ts +45 -0
- package/src/replay/index.ts +11 -0
- package/src/steering/Blocks.fixture.ts +6 -0
- package/src/steering/Blocks.test.ts +167 -0
- package/src/steering/Blocks.ts +321 -0
- package/src/steering/CodeThreads.test.ts +127 -0
- package/src/steering/CodeThreads.ts +197 -0
- package/src/steering/Edits.test.ts +19 -0
- package/src/steering/Edits.ts +20 -0
- package/src/steering/Eol.test.ts +16 -0
- package/src/steering/Eol.ts +2 -0
- package/src/steering/FORMATS.md +58 -0
- package/src/steering/Footnotes.test.ts +977 -0
- package/src/steering/Footnotes.ts +661 -0
- package/src/steering/Inline.fixture.ts +7 -0
- package/src/steering/Inline.test.ts +227 -0
- package/src/steering/Inline.ts +195 -0
- package/src/steering/MarkdownTree.test.ts +247 -0
- package/src/steering/MarkdownTree.ts +260 -0
- package/src/steering/Outline.ts +19 -0
- package/src/steering/SteeringFormat.test.ts +91 -0
- package/src/steering/SteeringFormat.ts +267 -0
- package/src/steering/SteeringFormats.test.ts +163 -0
- package/src/steering/Threads.ts +163 -0
- package/src/steering/contract.test.ts +264 -0
- package/src/steering/fixtures/code-threads/cache.stripped.ts.txt +6 -0
- package/src/steering/fixtures/code-threads/cache.ts.md +15 -0
- package/src/steering/fixtures/free-form/notes.md +12 -0
- package/src/steering/fixtures/free-form/notes.read.json +42 -0
- package/src/steering/fixtures/qa/answered.md +23 -0
- package/src/steering/fixtures/qa/answered.read.json +119 -0
- package/src/steering/fixtures/qa/requirements.md +160 -0
- package/src/steering/fixtures/qa/requirements.read.json +475 -0
- package/src/steering/fixtures/review/review.md +76 -0
- package/src/steering/fixtures/review/review.read.json +237 -0
- package/src/steering/fixtures/review/ticked.md +23 -0
- package/src/steering/fixtures/review/ticked.read.json +99 -0
- package/src/steering/fixtures/review-notes/baseline.md +14 -0
- package/src/steering/fixtures/review-notes/noted.md +19 -0
- package/src/steering/freeform.test.ts +311 -0
- package/src/steering/freeform.ts +148 -0
- package/src/steering/index.test.ts +62 -0
- package/src/steering/index.ts +140 -0
- package/src/steering/qa.test.ts +2160 -0
- package/src/steering/qa.ts +1104 -0
- package/src/steering/review.test.ts +1829 -0
- package/src/steering/review.ts +1180 -0
- package/src/step/LandStep.ts +31 -0
- package/src/step/RepoSnapshot.ts +29 -0
- package/src/step/accessRefusal.test.ts +58 -0
- package/src/step/accessRefusal.ts +26 -0
- package/src/step/index.ts +5 -0
- package/src/step/planStart.test.ts +202 -0
- package/src/step/planStart.ts +167 -0
- package/src/step/planStep.test.ts +104 -0
- package/src/step/planStep.ts +89 -0
- package/src/step/snapshot.fixture.ts +28 -0
- package/src/testkit/EmittedScriptRecognizer.test.ts +639 -0
- package/src/testkit/EmittedScriptRecognizer.ts +642 -0
- package/src/testkit/FakeGitOperations.ts +95 -0
- package/src/testkit/GitTiers.test.ts +11 -0
- package/src/testkit/GitTiers.ts +1052 -0
- package/src/testkit/InMemRepo.ts +467 -0
- package/src/testkit/Layers.test.ts +58 -0
- package/src/testkit/Layers.ts +241 -0
- package/src/testkit/StrictGitOperations.ts +31 -0
- package/src/testkit/TestRepo.test.ts +119 -0
- package/src/testkit/TestRepo.ts +274 -0
- package/src/testkit/cliIo.ts +36 -0
- package/src/testkit/index.ts +9 -0
- package/src/testkit/steps.ts +177 -0
- package/src/testkit/testkit.feature +65 -0
- package/src/wire/BeatDocument.test.ts +419 -0
- package/src/wire/BeatDocument.ts +114 -0
- package/src/wire/BeatPlain.test.ts +113 -0
- package/src/wire/BeatPlain.ts +127 -0
- package/src/wire/BeatStatus.test.ts +59 -0
- package/src/wire/BeatStatus.ts +81 -0
- package/src/wire/Demand.test.ts +142 -0
- package/src/wire/Demand.ts +108 -0
- package/src/wire/ExitCodes.test.ts +21 -0
- package/src/wire/ExitCodes.ts +16 -0
- package/src/wire/Glob.ts +29 -0
- package/src/wire/Judge.ts +22 -0
- package/src/wire/Land.test.ts +120 -0
- package/src/wire/Land.ts +75 -0
- package/src/wire/Select.test.ts +148 -0
- package/src/wire/Select.ts +78 -0
- package/src/wire/Sessions.test.ts +59 -0
- package/src/wire/Sessions.ts +39 -0
- package/src/wire/WireSchema.test.ts +162 -0
- package/src/wire/constants.ts +22 -0
- package/src/wire/golden/1/beat-capture.json +34 -0
- package/src/wire/golden/1/beat-message.json +34 -0
- package/src/wire/golden/1/beat-prompt.json +44 -0
- package/src/wire/golden/1/beat-script.json +34 -0
- package/src/wire/golden/1/beat-stalled.json +34 -0
- package/src/wire/golden/1/judge.json +14 -0
- package/src/wire/golden/1/land-noop.json +10 -0
- package/src/wire/golden/1/land.json +10 -0
- package/src/wire/index.ts +12 -0
- package/src/wire/types.ts +46 -0
- package/src/workflow/Diagnostic.test.ts +93 -0
- package/src/workflow/Diagnostic.ts +54 -0
- package/src/workflow/SteeringFormats.test.ts +27 -0
- package/src/workflow/SteeringFormats.ts +6 -0
- package/src/workflow/Workflow.ts +77 -0
- package/src/workflow/compile.test.ts +53 -0
- package/src/workflow/compile.ts +56 -0
- package/src/workflow/discovery.ts +122 -0
- package/src/workflow/fingerprint.test.ts +52 -0
- package/src/workflow/fingerprint.ts +53 -0
- package/src/workflow/index.ts +33 -0
- package/src/workflow/load.test.ts +1017 -0
- package/src/workflow/load.ts +836 -0
- package/src/workflow/skills.test.ts +109 -0
- package/src/workflow/skills.ts +90 -0
- package/src/workflow/vars.ts +33 -0
- package/src/workflows/feature/feature.test.ts +27 -33
- package/src/workflows/feature/index.ts +10 -0
- package/src/workflows/fix/fix.feature +80 -0
- package/src/workflows/fix/fix.test.ts +58 -78
- package/src/workflows/fix/index.ts +6 -0
- package/src/workflows/index.ts +2 -10
- package/src/workflows/review/index.ts +6 -0
- package/src/workflows/review/review.test.ts +85 -29
- package/src/workflows/review/review.ts +3 -1
- package/src/workflows/shared/config.fixture.ts +12 -0
- package/src/workflows/shared/reserved.ts +11 -0
- package/src/workflows/shared/workflows.steps.ts +7 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import { eolOf } from "./Eol.js"
|
|
3
|
+
|
|
4
|
+
describe("eolOf", () => {
|
|
5
|
+
it("returns CRLF when the content contains any \\r\\n", () => {
|
|
6
|
+
expect(eolOf("a\r\nb\nc")).toBe("\r\n")
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
it("returns LF when the content has no \\r\\n", () => {
|
|
10
|
+
expect(eolOf("a\nb\nc")).toBe("\n")
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it("returns LF for content with no newlines at all", () => {
|
|
14
|
+
expect(eolOf("a single line")).toBe("\n")
|
|
15
|
+
})
|
|
16
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Steering formats
|
|
2
|
+
|
|
3
|
+
Steering files are committed into a process's history and read back on every
|
|
4
|
+
replay, so each format below is a contract with every file already written in
|
|
5
|
+
it. Each one is pinned by the files in `fixtures/` and the contract tests that
|
|
6
|
+
read them.
|
|
7
|
+
|
|
8
|
+
## The formats
|
|
9
|
+
|
|
10
|
+
- **`qa`**: open questions. `### Question` headings under `## Open Questions`,
|
|
11
|
+
each with `- [ ]` option checkboxes; an option may carry nested bullets, and
|
|
12
|
+
`- [ ] _your answer_` is the free-text slot. A ticked box is an answer.
|
|
13
|
+
- **`review`**: a review document. A `# Review: <sha>` title and a
|
|
14
|
+
`<!-- base: <sha> -->` comment, then `##` chunks with prose and `- [ ]` hunk
|
|
15
|
+
pointers (`./path`, `./path#start-end`), each optionally followed by
|
|
16
|
+
`— <note>`. A pointer note starting `Risk:` is a reviewer's risk. A ticked
|
|
17
|
+
pointer is a hunk the human has read.
|
|
18
|
+
- **Free-form**: any markdown, for a file with no mode or an unknown one. Only
|
|
19
|
+
its threads are validated.
|
|
20
|
+
- **Threads**, shared by all three: a footnote whose definition is a list of
|
|
21
|
+
alternating `- H:` / `- A:` entries. Any other footnote is a one-shot note.
|
|
22
|
+
- **Code threads**: `H:` / `A:` line comments (`//`, `#`, `--`, `;`, chosen by
|
|
23
|
+
file extension) in a changed code file. A comment run is a thread only when
|
|
24
|
+
its first line starts `H:`.
|
|
25
|
+
- **Review notes**: what a human added to a `review` document since the reviewer
|
|
26
|
+
wrote it — changed chunk prose, pointer notes, and new one-shot footnotes,
|
|
27
|
+
never threads. **This is the hand-off from the `review` workflow to the `fix`
|
|
28
|
+
workflow**: `review` leaves the annotated file beside the reviewer's own copy
|
|
29
|
+
(`.gtd/REVIEW.orig.md`), and `fix` reads its work from the notes between the
|
|
30
|
+
two and from the risks, so a file `review` wrote must read the same in any
|
|
31
|
+
`fix` that consumes it.
|
|
32
|
+
|
|
33
|
+
## What may change
|
|
34
|
+
|
|
35
|
+
Compatible — no format bump:
|
|
36
|
+
|
|
37
|
+
- Reading something new that was invalid before (a new optional field, a relaxed
|
|
38
|
+
rule), as long as no gtd writer produces it. Once a writer does, older gtd
|
|
39
|
+
cannot read the files it writes: that is breaking.
|
|
40
|
+
- A new or reworded validation finding for content that was already invalid.
|
|
41
|
+
- A change to how a file is shown (view, outline, editor actions) that reads the
|
|
42
|
+
same content out of it.
|
|
43
|
+
|
|
44
|
+
Breaking — committed files, or files an older gtd must read, are affected:
|
|
45
|
+
|
|
46
|
+
- A file that read clean before now has findings, or reads differently: other
|
|
47
|
+
questions, options, chunks, hunks, ticks, threads or notes.
|
|
48
|
+
- A writer (a tick, a note, a reply) produces text an older gtd cannot read.
|
|
49
|
+
- Renaming or removing a marker: `## Open Questions`, `_your answer_`,
|
|
50
|
+
`# Review:`, `<!-- base: -->`, `Risk:`, `H:` / `A:`.
|
|
51
|
+
|
|
52
|
+
## Format changes bump `Gtd-Format`
|
|
53
|
+
|
|
54
|
+
Steering files are part of the history format. A change that stops older files
|
|
55
|
+
from being read the way they were written is a new history format: bump the
|
|
56
|
+
`Gtd-Format` trailer, and keep reading the previous format. Never edit a fixture
|
|
57
|
+
to make a breaking change pass. Add a fixture in the new format beside the old
|
|
58
|
+
one instead.
|