@lanework/contracts 0.4.0 → 0.4.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.
- package/package.json +3 -2
- package/src/tools/instructions.ts +67 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lanework/contracts",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The contract between the Lanework desktop app, its checkpoint hook, the Lanework API and their MCP servers: HTTP request and response shapes, the board, kit and control tool contracts (types, JSON Schema builders and run-time output shapes).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"//": "Types, JSON Schema builders and output shapes only, no runtime dependencies. The desktop app (open source) and the API and MCP (private) both build on it; neither half may be imported here.",
|
|
24
24
|
"scripts": {
|
|
25
|
-
"typecheck": "tsc --noEmit"
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"check:size": "bun scripts/check-size.ts"
|
|
26
27
|
},
|
|
27
28
|
"homepage": "https://github.com/lanework-dev/contracts#readme",
|
|
28
29
|
"bugs": {
|
|
@@ -23,62 +23,54 @@ const FIND_BOARD =
|
|
|
23
23
|
|
|
24
24
|
/** What a full session does when the repo has no board, or several. */
|
|
25
25
|
const NO_BOARD =
|
|
26
|
-
"None:
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"MOVES it (replace), it never adds a second. Several: ask the user. No " +
|
|
33
|
-
"git remote: ask the user. Never pick a board by its name. ";
|
|
26
|
+
"None: list_boards without repo and ask which board this repo belongs to, " +
|
|
27
|
+
"offering also a new one (suggest `owner/name` from the remote); then " +
|
|
28
|
+
"link_repo their pick, or create_board only if they asked. Linking a board " +
|
|
29
|
+
"that has another repo MOVES the link. Several, or no remote: ask. Never " +
|
|
30
|
+
"pick a board by its name. ";
|
|
31
|
+
("git remote: ask the user. Never pick a board by its name. ");
|
|
34
32
|
|
|
35
33
|
/** Creating a card: what every create_review must carry. */
|
|
36
34
|
const NEW_CARD =
|
|
37
|
-
"Before
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
"with the recommendation marked. Never invent a task id: the server " +
|
|
46
|
-
"mints it. After create_review, offer to review the new card right " +
|
|
47
|
-
"here. ";
|
|
35
|
+
"Before create_review, read board_summary and reuse its categories and " +
|
|
36
|
+
"tags (the category mints the task id; never invent one). Every " +
|
|
37
|
+
"create_review passes category, 1-3 tags and priority (high: blockers, " +
|
|
38
|
+
"release prerequisites; medium: planned work; low: polish). Body: context, " +
|
|
39
|
+
"out of scope, files touched. Checklist: decisions the user approves, " +
|
|
40
|
+
"verify steps that prove the work; a pick-ONE choice is boxes sharing a " +
|
|
41
|
+
"`group`, the recommendation marked. ";
|
|
42
|
+
("here. ");
|
|
48
43
|
|
|
49
44
|
/** The gate between a card's plan and its implementation. */
|
|
50
45
|
const REVIEW_GATE =
|
|
51
|
-
"Behavior-changing work starts only once every decision
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
46
|
+
"Behavior-changing work starts only once every decision is ticked; " +
|
|
47
|
+
"read-only requests, obvious one-file fixes and work whose exact shape the " +
|
|
48
|
+
"user gave need no card. toggle_item ticks boxes and notes (a verify tick " +
|
|
49
|
+
"sends evidence: the command and whether it passed), update_review edits " +
|
|
50
|
+
"metadata, set_status moves lanes. ";
|
|
51
|
+
("sends evidence (the command and whether it passed). ");
|
|
57
52
|
|
|
58
53
|
const CHECKPOINT_FLOW =
|
|
59
|
-
"While working a card, call checkpoint after each
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"check
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
"disk, so skip it. Re-run every check it claims passed, then " +
|
|
68
|
-
"continue from nextStep (or the summary). ";
|
|
54
|
+
"While working a card, call checkpoint after each item you finish and " +
|
|
55
|
+
"before you stop. To resume: get_review and read its checkpoint; if " +
|
|
56
|
+
"checkpoint.git.wipRef is set and this is not the checkout it came from " +
|
|
57
|
+
"(another host, a fresh clone, a sandbox), check out checkpoint.git.head " +
|
|
58
|
+
"and `git fetch origin <wipRef> && git cherry-pick --no-commit FETCH_HEAD " +
|
|
59
|
+
"&& git reset`. Re-run every check it claims passed, then continue from " +
|
|
60
|
+
"nextStep. ";
|
|
61
|
+
("continue from nextStep (or the summary). ");
|
|
69
62
|
|
|
70
63
|
const STALE =
|
|
71
|
-
"A card with `stale` set was left mid-task
|
|
72
|
-
"opening a
|
|
73
|
-
|
|
64
|
+
"A card with `stale` set was left mid-task: resume it from its checkpoint " +
|
|
65
|
+
"rather than opening a duplicate. ";
|
|
66
|
+
("its checkpoint. ");
|
|
74
67
|
|
|
75
68
|
const HAND_OFF =
|
|
76
|
-
"Finished
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
"user before writing any. ";
|
|
69
|
+
"Finished, verified work goes to the review-role lane via set_status; only " +
|
|
70
|
+
"a human moves it to done. A card sent back carries changesRequested.reason " +
|
|
71
|
+
"in get_review: read it first. When set_status returns retro, propose at " +
|
|
72
|
+
"most 3 lessons and ask before writing any. ";
|
|
73
|
+
("user before writing any. ");
|
|
82
74
|
|
|
83
75
|
/** Leading a card's streams (BE-19); also the `work` prompt's text. */
|
|
84
76
|
export const STREAMS_FLOW =
|
|
@@ -99,10 +91,10 @@ export const STREAMS_FLOW =
|
|
|
99
91
|
/** Splitting a new card into streams, when writing it. */
|
|
100
92
|
const WRITE_STREAMS =
|
|
101
93
|
"Split a card into streams only when it touches two or more independent " +
|
|
102
|
-
"write areas: each
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
|
|
94
|
+
"write areas: each has a key (W0…), goal, role, exact `owns` paths no " +
|
|
95
|
+
"other stream in its wave owns, and a verify item tagged with its key; " +
|
|
96
|
+
"shared types go in a W0 the others depend on; at most 4 per wave. ";
|
|
97
|
+
("on, at most 4 streams per wave. ");
|
|
106
98
|
|
|
107
99
|
/** Reviewing a card with the user (BE-14); also the `review` prompt's text. */
|
|
108
100
|
export const REVIEW_FLOW =
|
|
@@ -121,6 +113,30 @@ export const REVIEW_FLOW =
|
|
|
121
113
|
"review_card does not move the card, and work starts only once it answers " +
|
|
122
114
|
"ready: true.";
|
|
123
115
|
|
|
116
|
+
/**
|
|
117
|
+
* The streams and review flows, short, for the instructions. The full texts
|
|
118
|
+
* (STREAMS_FLOW, REVIEW_FLOW) stay the `work` and `review` prompts'.
|
|
119
|
+
*
|
|
120
|
+
* ⚠️ The instructions stay under 4,000 characters: Claude Code cuts a
|
|
121
|
+
* server's instructions at 4,096 (`… [truncated]`), and what falls past it
|
|
122
|
+
* is lost. `bun run check:size` in CI holds them to it.
|
|
123
|
+
*/
|
|
124
|
+
const RUN_STREAMS =
|
|
125
|
+
"A card with streams comes back from get_review with dispatch { waves, " +
|
|
126
|
+
"briefs }: you are its lead. Per wave, spawn one sub-agent per stream at " +
|
|
127
|
+
"once (own worktree unless shared) with its brief verbatim; sub-agents " +
|
|
128
|
+
"never call Lanework or commit. After the wave, merge, revert anything " +
|
|
129
|
+
"outside each stream's owns, re-run its checks, tick its verify items, " +
|
|
130
|
+
"checkpoint once. Then the untagged verify items. ";
|
|
131
|
+
|
|
132
|
+
const REVIEW_SHORT =
|
|
133
|
+
"To review a card with the user: get_review it and ask with your option " +
|
|
134
|
+
"picker, one single-select question per pick-ONE group (recommended " +
|
|
135
|
+
"first) and the other decisions as multi-select, at most 4 questions a " +
|
|
136
|
+
"turn; then call review_card ONCE with exactly what they picked (unpicked " +
|
|
137
|
+
"offered boxes false, Other text as the note). Never tick a decision they " +
|
|
138
|
+
"did not pick. Work starts only once it answers ready: true.";
|
|
139
|
+
|
|
124
140
|
/** Every board tool's rules: the full toolset's `initialize` instructions. */
|
|
125
141
|
export const BOARD_INSTRUCTIONS =
|
|
126
142
|
INTRO +
|
|
@@ -132,9 +148,8 @@ export const BOARD_INSTRUCTIONS =
|
|
|
132
148
|
STALE +
|
|
133
149
|
HAND_OFF +
|
|
134
150
|
WRITE_STREAMS +
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
REVIEW_FLOW;
|
|
151
|
+
RUN_STREAMS +
|
|
152
|
+
REVIEW_SHORT;
|
|
138
153
|
|
|
139
154
|
/**
|
|
140
155
|
* The worker toolset's instructions (BE-24): only what a session working
|
|
@@ -150,4 +165,4 @@ export const BOARD_WORKER_INSTRUCTIONS =
|
|
|
150
165
|
"its name. Do not start a card still in todo with decisions unticked. " +
|
|
151
166
|
CHECKPOINT_FLOW +
|
|
152
167
|
HAND_OFF +
|
|
153
|
-
|
|
168
|
+
RUN_STREAMS.trimEnd();
|