@johngaynor/ocnus 2.0.1-next.7 → 2.0.1-next.9
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/README.md +15 -4
- package/cli/lib/linear.sh +156 -23
- package/cli/ocnus +8 -4
- package/herdr/README.md +36 -16
- package/package.json +1 -1
- package/skills/sdlc-breakdown/SKILL.md +62 -14
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Six skills do the work, one for each step an agent runs, and a seventh,
|
|
|
16
16
|
|---|---|
|
|
17
17
|
| `sdlc-define` | The define step: sets a card's type and writes its Specification |
|
|
18
18
|
| `sdlc-plan` | The plan step: reads the card and the code, and writes the Plan |
|
|
19
|
-
| `sdlc-breakdown` | The breakdown step: decides whether the card is one piece or several slices, then asks you to approve it, unless you have turned that approval off |
|
|
19
|
+
| `sdlc-breakdown` | The breakdown step: decides whether the card is one piece or several slices, then asks you to approve it, unless you have turned that approval off, and once it is approved records in Linear the other cards it waits on, and the cards in Todo that wait on it |
|
|
20
20
|
| `sdlc-build` | The build step: builds an approved card in its task, making the change the Plan describes, running the tests and committing, pushing nothing |
|
|
21
21
|
| `sdlc-review` | The review step: checks the build step's work against the card's Done when, writes what it found on the card as its Review, and sends what is not met back to the build step |
|
|
22
22
|
| `sdlc-pr` | The pr step: pushes a reviewed card's branch, opens its pull requests, moves the card to In Review and waits while you merge them, running no watch of its own: ocnus's watch records the merge and finishes the task. It never merges |
|
|
@@ -356,9 +356,9 @@ lists a key Linear rejects as a problem, which makes `status` exit non-zero.
|
|
|
356
356
|
For a key that works, it also checks whether the key can change cards, by
|
|
357
357
|
asking Linear to change a card that cannot exist, which changes nothing. A
|
|
358
358
|
key with Read permission alone lists cards, so `task ls` and the Cards panel
|
|
359
|
-
work with it, but `linear type`, `linear section`, `linear slices
|
|
360
|
-
`linear move` fail with it, and the card skills fall
|
|
361
|
-
Linear tools.
|
|
359
|
+
work with it, but `linear type`, `linear section`, `linear slices`,
|
|
360
|
+
`linear block` and `linear move` fail with it, and the card skills fall
|
|
361
|
+
back to the agent's own Linear tools.
|
|
362
362
|
`status` lists such a key as a problem too, and exits non-zero. `linear key`
|
|
363
363
|
checks the same before it saves a key: it saves one that cannot change cards,
|
|
364
364
|
then says so. Either way, the fix is a key with Write permission, saved with
|
|
@@ -385,6 +385,17 @@ running, `task new` starts it, without the variables of a Claude Code session
|
|
|
385
385
|
it was run from, so that a `claude` in its terminals still saves its
|
|
386
386
|
transcript. See [herdr/README.md](herdr/README.md#writing-the-card-up).
|
|
387
387
|
|
|
388
|
+
Before it asks you to approve, breakdown looks for the cards this one waits
|
|
389
|
+
on: every other card that the card, or one of its slices, needs merged
|
|
390
|
+
first, a slice of another card too, and any card already approved and in
|
|
391
|
+
Todo that needs this one first. The Breakdown and the summary you approve
|
|
392
|
+
from name them. Nothing is recorded before you approve. Once you do, the
|
|
393
|
+
agent records them in Linear with `ocnus linear block`, before `task start`
|
|
394
|
+
runs: each blocker on the card, or on the slice it blocks, and this card as
|
|
395
|
+
a blocker of each card in Todo that needs it, so that one is not started
|
|
396
|
+
first. `ocnus linear read <card>` shows the cards that block a card and
|
|
397
|
+
the cards it blocks, each with its status.
|
|
398
|
+
|
|
388
399
|
Recording your approval moves the card in Linear to its team's first
|
|
389
400
|
not-started status (Todo in Lab), and each of its sub-issues with it. When a
|
|
390
401
|
card cannot be moved, the approval is still recorded, and the agent tells you
|
package/cli/lib/linear.sh
CHANGED
|
@@ -169,7 +169,7 @@ WRITE_QUERY='mutation { issueUpdate(id: "00000000-0000-0000-0000-000000000000",
|
|
|
169
169
|
|
|
170
170
|
# What is said of a key that can read cards but not change them, by `status`
|
|
171
171
|
# as a problem and by `linear key` once it has saved such a key.
|
|
172
|
-
NO_WRITE_WHY="The key can read cards but not change them, so linear type, linear section, linear slices and linear move fail with it. Make a key with Write permission in $KEY_PLACE, then save it with: ocnus linear key"
|
|
172
|
+
NO_WRITE_WHY="The key can read cards but not change them, so linear type, linear section, linear slices, linear block and linear move fail with it. Make a key with Write permission in $KEY_PLACE, then save it with: ocnus linear key"
|
|
173
173
|
|
|
174
174
|
# How Linear's answer to WRITE_QUERY reads, as one word and what follows it:
|
|
175
175
|
# cannot a refusal: an error of type or code forbidden, or one whose
|
|
@@ -494,14 +494,18 @@ linear_key() {
|
|
|
494
494
|
# it. `task ls` uses it too.
|
|
495
495
|
PLAIN_DEF='def plain: explode | map(if . < 32 or (. > 126 and . < 160) then 32 else . end) | implode;'
|
|
496
496
|
|
|
497
|
-
# How many labels, comments
|
|
498
|
-
# with more than that is not printed, since what was read would
|
|
499
|
-
# whole of it.
|
|
497
|
+
# How many labels, comments, sub-issues and relations a read asks Linear
|
|
498
|
+
# for. A card with more than that is not printed, since what was read would
|
|
499
|
+
# pass for the whole of it. The relations are asked for each way: those from
|
|
500
|
+
# the card to another card, and those from another card to it.
|
|
500
501
|
READ_LABELS=100
|
|
501
502
|
READ_COMMENTS=100
|
|
502
503
|
READ_SUBS=50
|
|
504
|
+
READ_RELATIONS=50
|
|
503
505
|
|
|
504
|
-
# The question for linear read: the card whole.
|
|
506
|
+
# The question for linear read: the card whole. Its relations of the kind
|
|
507
|
+
# "blocks" name the cards it blocks, as their relatedIssue, and its inverse
|
|
508
|
+
# relations of that kind the cards that block it, as their issue.
|
|
505
509
|
READ_QUERY='query($team: String!, $number: Float!) {
|
|
506
510
|
issues(first: 1, filter: {team: {key: {eq: $team}}, number: {eq: $number}}) {
|
|
507
511
|
nodes {
|
|
@@ -512,29 +516,38 @@ READ_QUERY='query($team: String!, $number: Float!) {
|
|
|
512
516
|
project { name }
|
|
513
517
|
comments(first: '$READ_COMMENTS') { nodes { body createdAt user { name } botActor { name } } pageInfo { hasNextPage } }
|
|
514
518
|
children(first: '$READ_SUBS') { nodes { identifier title createdAt state { name type } } pageInfo { hasNextPage } }
|
|
519
|
+
relations(first: '$READ_RELATIONS') { nodes { type relatedIssue { identifier title state { name type } } } pageInfo { hasNextPage } }
|
|
520
|
+
inverseRelations(first: '$READ_RELATIONS') { nodes { type issue { identifier title state { name type } } } pageInfo { hasNextPage } }
|
|
515
521
|
}
|
|
516
522
|
}
|
|
517
523
|
}'
|
|
518
524
|
|
|
519
525
|
# From the answer to READ_QUERY, on stdin, print "none" when Linear has no
|
|
520
|
-
# such card, {"more": <what>} when it has more comments, sub-issues
|
|
521
|
-
# than were asked for, or {"card": <the card>}, the card as
|
|
522
|
-
# prints it. A comment's author is the app Linear credits
|
|
523
|
-
# the user who wrote it. Comments come oldest first, and so
|
|
524
|
-
# the order they were made, which is the order linear
|
|
525
|
-
# slices in, whatever order Linear lists them in; when
|
|
526
|
-
#
|
|
527
|
-
#
|
|
526
|
+
# such card, {"more": <what>} when it has more comments, sub-issues, labels
|
|
527
|
+
# or relations than were asked for, or {"card": <the card>}, the card as
|
|
528
|
+
# linear read --json prints it. A comment's author is the app Linear credits
|
|
529
|
+
# with it, or else the user who wrote it. Comments come oldest first, and so
|
|
530
|
+
# do sub-issues, in the order they were made, which is the order linear
|
|
531
|
+
# slices makes a card's slices in, whatever order Linear lists them in; when
|
|
532
|
+
# each was made is left out. blockedBy are the cards that block it and blocks
|
|
533
|
+
# the cards it blocks, from its relations of the kind "blocks" alone, done or
|
|
534
|
+
# not, each as a sub-issue is, in the order Linear lists them. An answer with
|
|
535
|
+
# a card in it that is not in this form did not come from Linear. $group is
|
|
536
|
+
# TYPE_GROUP.
|
|
528
537
|
READ_SHAPE='
|
|
529
538
|
def text: if type == "string" then . else error("unreadable") end;
|
|
530
539
|
def list: if (.nodes | type) == "array" then .nodes[] else error("unreadable") end;
|
|
531
540
|
def status: if type == "object" then {name: (.name | text), type: (.type | text)} else error("unreadable") end;
|
|
541
|
+
def other: if type == "object" then {id: (.identifier | text), title: (.title | text), status: (.state | status)}
|
|
542
|
+
else error("unreadable") end;
|
|
532
543
|
if (.issues.nodes | type) != "array" then error("no list of cards")
|
|
533
544
|
elif (.issues.nodes | length) == 0 then "none"
|
|
534
545
|
else .issues.nodes[0]
|
|
535
546
|
| if .comments.pageInfo.hasNextPage? == true then {more: "comments"}
|
|
536
547
|
elif .children.pageInfo.hasNextPage? == true then {more: "sub-issues"}
|
|
537
548
|
elif .labels.pageInfo.hasNextPage? == true then {more: "labels"}
|
|
549
|
+
elif .relations.pageInfo.hasNextPage? == true or .inverseRelations.pageInfo.hasNextPage? == true
|
|
550
|
+
then {more: "relations"}
|
|
538
551
|
else {card: {
|
|
539
552
|
id: (.identifier | text),
|
|
540
553
|
title: (.title | text),
|
|
@@ -543,6 +556,8 @@ READ_SHAPE='
|
|
|
543
556
|
type: ([.labels | list | select(.parent.name? == $group) | .name] | first),
|
|
544
557
|
labels: [.labels | list | .name | text],
|
|
545
558
|
parent: (if .parent == null then null else {id: (.parent.identifier | text), title: (.parent.title | text)} end),
|
|
559
|
+
blockedBy: [.inverseRelations | list | select((.type | text) == "blocks") | .issue | other],
|
|
560
|
+
blocks: [.relations | list | select((.type | text) == "blocks") | .relatedIssue | other],
|
|
546
561
|
project: (if .project == null then null else {name: (.project.name | text)} end),
|
|
547
562
|
description: (.description // "" | text),
|
|
548
563
|
comments: ([.comments | list
|
|
@@ -555,7 +570,8 @@ READ_SHAPE='
|
|
|
555
570
|
end
|
|
556
571
|
end'
|
|
557
572
|
|
|
558
|
-
# The card from READ_SHAPE, on stdin, laid out like the card: its head,
|
|
573
|
+
# The card from READ_SHAPE, on stdin, laid out like the card: its head, with
|
|
574
|
+
# a line for each card that blocks it and each card it blocks, the
|
|
559
575
|
# description as written, the comments, each with its body indented under who
|
|
560
576
|
# wrote it and when, and the sub-issues. Every field is made plain, but the
|
|
561
577
|
# description and the comments keep their line breaks, without the \r Linear
|
|
@@ -569,6 +585,8 @@ READ_TEXT=$PLAIN_DEF'
|
|
|
569
585
|
"Status: \(.status.name | plain)",
|
|
570
586
|
"Labels: \(if .labels == [] then "none" else .labels | map(plain) | join(", ") end)",
|
|
571
587
|
(.parent // empty | "Parent: \(.id | plain) \(.title | plain)"),
|
|
588
|
+
(.blockedBy[] | "Blocked by: \(.id | plain) \(.status.name | plain) \(.title | plain)"),
|
|
589
|
+
(.blocks[] | "Blocks: \(.id | plain) \(.status.name | plain) \(.title | plain)"),
|
|
572
590
|
(.project // empty | "Project: \(.name | plain)"),
|
|
573
591
|
"URL: \(.url | plain)",
|
|
574
592
|
"",
|
|
@@ -585,13 +603,17 @@ READ_TEXT=$PLAIN_DEF'
|
|
|
585
603
|
# Print a card whole, laid out like the card, or with --json as one line of
|
|
586
604
|
# JSON, for a mod:
|
|
587
605
|
# {"id":"ABC-122","title":"…","url":"…","status":{"name":"In Progress","type":"started"},
|
|
588
|
-
# "type":"feat","labels":["feat"],"parent":{"id":"ABC-100","title":"…"},
|
|
606
|
+
# "type":"feat","labels":["feat"],"parent":{"id":"ABC-100","title":"…"},
|
|
607
|
+
# "blockedBy":[{"id":"ABC-121","title":"…","status":{"name":"In Progress","type":"started"}}],
|
|
608
|
+
# "blocks":[{"id":"ABC-130","title":"…","status":{"name":"Todo","type":"unstarted"}}],
|
|
609
|
+
# "project":{"name":"…"},
|
|
589
610
|
# "description":"…",
|
|
590
611
|
# "comments":[{"author":"…","createdAt":"…","body":"…"}],
|
|
591
612
|
# "subIssues":[{"id":"ABC-123","title":"…","status":{"name":"Todo","type":"unstarted"}}]}
|
|
592
613
|
# type is the card's label in the Type group, or null; parent and project, the
|
|
593
|
-
# card's Linear project, are null for a card with none.
|
|
594
|
-
#
|
|
614
|
+
# card's Linear project, are null for a card with none. blockedBy are the
|
|
615
|
+
# cards that block it, and blocks the cards it blocks, done or not. When it
|
|
616
|
+
# fails it prints nothing on stdout.
|
|
595
617
|
# ocnus linear read <card> [--json]
|
|
596
618
|
linear_read() {
|
|
597
619
|
local card=${1:-} json=0 key vars data shape more=''
|
|
@@ -617,6 +639,7 @@ linear_read() {
|
|
|
617
639
|
'{"more":"comments"}') more="$READ_COMMENTS comments" ;;
|
|
618
640
|
'{"more":"sub-issues"}') more="$READ_SUBS sub-issues" ;;
|
|
619
641
|
'{"more":"labels"}') more="$READ_LABELS labels" ;;
|
|
642
|
+
'{"more":"relations"}') more="$READ_RELATIONS relations" ;;
|
|
620
643
|
*) die "Linear's answer was not one ocnus can read. Something between this machine and Linear may be answering for it." ;;
|
|
621
644
|
esac
|
|
622
645
|
[ -z "$more" ] ||
|
|
@@ -630,11 +653,12 @@ linear_read() {
|
|
|
630
653
|
|
|
631
654
|
# --- the card skills' writes ------------------------------------------------
|
|
632
655
|
#
|
|
633
|
-
# The card skills write
|
|
634
|
-
# description,
|
|
635
|
-
# is one command here, so that it goes the same
|
|
636
|
-
# reads back what Linear saved before it says it
|
|
637
|
-
#
|
|
656
|
+
# The card skills write four things: a card's type label, a section of its
|
|
657
|
+
# description, its slices, the sub-issues sdlc-breakdown makes of it, and the
|
|
658
|
+
# cards that block a card. Each is one command here, so that it goes the same
|
|
659
|
+
# way on every run, and each reads back what Linear saved before it says it
|
|
660
|
+
# is done. The slices and the blockers are the only things created; nothing
|
|
661
|
+
# else in Linear is changed, and nothing is removed.
|
|
638
662
|
|
|
639
663
|
# The types a card can have. Each is the start of the card's branch name.
|
|
640
664
|
CARD_TYPES='feat fix chore'
|
|
@@ -1116,6 +1140,114 @@ linear_slices() {
|
|
|
1116
1140
|
.others[] | "Left alone: \(.identifier | plain) \(.title | plain), a sub-issue of \($card) that is not one of its slices"'
|
|
1117
1141
|
}
|
|
1118
1142
|
|
|
1143
|
+
# --- recording blockers -----------------------------------------------------
|
|
1144
|
+
#
|
|
1145
|
+
# sdlc-breakdown records every other card a card or a slice depends on, in
|
|
1146
|
+
# another parent card too, as one that blocks it, so that the cards start in
|
|
1147
|
+
# the order the work needs: `task start` holds a card while a card that
|
|
1148
|
+
# blocks it is not done. A blocker is a relation of the kind "blocks", from
|
|
1149
|
+
# the blocker to the card, as linear slices makes between slices. Nothing
|
|
1150
|
+
# here ever removes one.
|
|
1151
|
+
|
|
1152
|
+
# The question for linear block: a card's id, and the cards that block it
|
|
1153
|
+
# now, by their ids. It finds each blocker's id too. A card with more
|
|
1154
|
+
# relations than are read may have a blocker among the rest; asking for it
|
|
1155
|
+
# again costs nothing, since Linear keeps one relation of a kind between two
|
|
1156
|
+
# cards (SLICE_RELATIONS).
|
|
1157
|
+
BLOCK_QUERY='query($team: String!, $number: Float!) {
|
|
1158
|
+
issues(first: 1, filter: {team: {key: {eq: $team}}, number: {eq: $number}}) {
|
|
1159
|
+
nodes { id identifier
|
|
1160
|
+
inverseRelations(first: '$CARD_RELATIONS') { nodes { type issue { id } } } }
|
|
1161
|
+
}
|
|
1162
|
+
}'
|
|
1163
|
+
|
|
1164
|
+
# From the answer to BLOCK_QUERY, on stdin, the card as {"state": "ok", id,
|
|
1165
|
+
# blockers}, blockers being the ids of the cards that block it, or
|
|
1166
|
+
# {"state": "none"} when Linear has no such card. An answer with a card in it
|
|
1167
|
+
# that is not in this form did not come from Linear.
|
|
1168
|
+
BLOCK_SHAPE='
|
|
1169
|
+
def text: if type == "string" then . else error("unreadable") end;
|
|
1170
|
+
if (.issues.nodes | type) != "array" then error("no list of cards")
|
|
1171
|
+
elif (.issues.nodes | length) == 0 then {state: "none"}
|
|
1172
|
+
else .issues.nodes[0]
|
|
1173
|
+
| {state: "ok", id: (.id | text),
|
|
1174
|
+
blockers: [.inverseRelations.nodes[]? | select(.type? == "blocks") | .issue.id? | strings]}
|
|
1175
|
+
end'
|
|
1176
|
+
|
|
1177
|
+
# Print a card as BLOCK_SHAPE has it, one line of JSON, or stop and say why.
|
|
1178
|
+
# block_card <key> <card ID, in upper case>
|
|
1179
|
+
block_card() {
|
|
1180
|
+
local key=$1 card=$2 vars data found
|
|
1181
|
+
vars=$(jq -cn --arg team "${card%-*}" --arg number "${card##*-}" '{team: $team, number: ($number | tonumber)}') ||
|
|
1182
|
+
die "'$card' is not a card ID like ABC-122. Nothing was recorded."
|
|
1183
|
+
data=$(linear_ask "$key" "$BLOCK_QUERY" "$vars") || exit 1
|
|
1184
|
+
# Judged by what jq prints: some versions exit zero on an empty answer.
|
|
1185
|
+
found=$(printf '%s' "$data" | jq -c "$BLOCK_SHAPE" 2>/dev/null) || found=
|
|
1186
|
+
case $(printf '%s' "$found" | jq -r '.state' 2>/dev/null) in
|
|
1187
|
+
ok) printf '%s\n' "$found" ;;
|
|
1188
|
+
none) die "Linear has no card $card that the saved key can see. Check the ID, then run this again. Nothing was recorded." ;;
|
|
1189
|
+
*) die "Linear's answer was not one ocnus can read. Something between this machine and Linear may be answering for it. Nothing was recorded." ;;
|
|
1190
|
+
esac
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
# Record in Linear that each blocker given blocks the card: a relation of the
|
|
1194
|
+
# kind blocks, from the blocker to the card. Every card is read before
|
|
1195
|
+
# anything is recorded, so an ID Linear does not have records nothing. A
|
|
1196
|
+
# blocker the card has already is skipped, one given twice is recorded once,
|
|
1197
|
+
# and each one recorded is read back before the next. A card never blocks
|
|
1198
|
+
# itself. Nothing is removed. It prints one line for each blocker:
|
|
1199
|
+
# <card> is now blocked by <blocker>
|
|
1200
|
+
# <card> is blocked by <blocker> already
|
|
1201
|
+
# A run that stopped partway is finished by running it again with the same
|
|
1202
|
+
# cards.
|
|
1203
|
+
# ocnus linear block <card> <blocker>...
|
|
1204
|
+
linear_block() {
|
|
1205
|
+
local card=${1:-} given blocker blockers='' key found card_id had ids='' id vars made
|
|
1206
|
+
[ "$#" -ge 2 ] ||
|
|
1207
|
+
die "usage: ocnus linear block <card> <blocker>..., like: ocnus linear block ABC-122 ABC-121, which records that ABC-121 blocks ABC-122"
|
|
1208
|
+
[[ $card =~ $CARD_RE ]] || die "'$card' is not a card ID like ABC-122. Nothing was recorded."
|
|
1209
|
+
card=$(printf '%s' "$card" | tr '[:lower:]' '[:upper:]')
|
|
1210
|
+
shift
|
|
1211
|
+
for given in "$@"; do
|
|
1212
|
+
[[ $given =~ $CARD_RE ]] || die "'$given' is not a card ID like ABC-121. Nothing was recorded."
|
|
1213
|
+
blocker=$(printf '%s' "$given" | tr '[:lower:]' '[:upper:]')
|
|
1214
|
+
[ "$blocker" != "$card" ] || die "$card cannot block itself. Nothing was recorded."
|
|
1215
|
+
in_list "$blocker" "$blockers" || blockers="$blockers $blocker"
|
|
1216
|
+
done
|
|
1217
|
+
linear_tools
|
|
1218
|
+
key=$(linear_saved_key) || exit 1
|
|
1219
|
+
found=$(block_card "$key" "$card") || exit 1
|
|
1220
|
+
card_id=$(printf '%s' "$found" | jq -r '.id')
|
|
1221
|
+
had=$(printf '%s' "$found" | jq -r '.blockers[]')
|
|
1222
|
+
# Each blocker's id, in the order given, before anything is recorded.
|
|
1223
|
+
for blocker in $blockers; do
|
|
1224
|
+
found=$(block_card "$key" "$blocker") || exit 1
|
|
1225
|
+
id=$(printf '%s' "$found" | jq -r '.id')
|
|
1226
|
+
[ "$id" != "$card_id" ] || die "$blocker is $card in Linear, and $card cannot block itself. Nothing was recorded."
|
|
1227
|
+
ids="$ids $id"
|
|
1228
|
+
done
|
|
1229
|
+
# The ids are Linear's, with no spaces in them, one for each blocker, in
|
|
1230
|
+
# the same order.
|
|
1231
|
+
# shellcheck disable=SC2086
|
|
1232
|
+
set -- $ids
|
|
1233
|
+
for blocker in $blockers; do
|
|
1234
|
+
id=$1
|
|
1235
|
+
shift
|
|
1236
|
+
if printf '%s\n' "$had" | grep -qxF -- "$id"; then
|
|
1237
|
+
say "$card is blocked by $blocker already"
|
|
1238
|
+
continue
|
|
1239
|
+
fi
|
|
1240
|
+
vars=$(jq -cn --arg from "$id" --arg to "$card_id" '{input: {issueId: $from, relatedIssueId: $to, type: "blocks"}}')
|
|
1241
|
+
made=$(linear_ask "$key" "$SLICE_BLOCK" "$vars" 2>&1) ||
|
|
1242
|
+
die "could not record $blocker as blocking $card: $(first_sentence "$made"). Run this again with the same cards to record the rest: it skips the blockers already there."
|
|
1243
|
+
[ "$(printf '%s' "$made" | jq -r --arg from "$id" --arg to "$card_id" '
|
|
1244
|
+
.issueRelationCreate.issueRelation | type == "object" and .type? == "blocks"
|
|
1245
|
+
and .issue.id? == $from and .relatedIssue.id? == $to' 2>/dev/null)" = true ] ||
|
|
1246
|
+
die "Linear did not record $blocker as blocking $card, as its answer shows. Look at $card in Linear, then run this again with the same cards to add it."
|
|
1247
|
+
say "$card is now blocked by $blocker"
|
|
1248
|
+
done
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1119
1251
|
# --- moving a card ----------------------------------------------------------
|
|
1120
1252
|
#
|
|
1121
1253
|
# ocnus moves a card at four points: the hand-off that records the
|
|
@@ -1414,9 +1546,10 @@ cmd_linear() {
|
|
|
1414
1546
|
type) shift; linear_type "$@" ;;
|
|
1415
1547
|
section) shift; linear_section "$@" ;;
|
|
1416
1548
|
slices) shift; linear_slices "$@" ;;
|
|
1549
|
+
block) shift; linear_block "$@" ;;
|
|
1417
1550
|
move) shift; linear_move_cmd "$@" ;;
|
|
1418
1551
|
read) shift; linear_read "$@" ;;
|
|
1419
1552
|
archive) shift; linear_archive_cmd "$@" ;;
|
|
1420
|
-
*) die "usage: ocnus linear key, or: ocnus linear read <card> [--json], or: ocnus linear type <card> <feat|fix|chore>, or: ocnus linear section <card> <Specification|Plan|Breakdown|Review> [--replace], or: ocnus linear slices <card>, or: ocnus linear move <card> <approved|started|review|done>, or: ocnus linear archive [on|off|--json] (see: ocnus help)" ;;
|
|
1553
|
+
*) die "usage: ocnus linear key, or: ocnus linear read <card> [--json], or: ocnus linear type <card> <feat|fix|chore>, or: ocnus linear section <card> <Specification|Plan|Breakdown|Review> [--replace], or: ocnus linear slices <card>, or: ocnus linear block <card> <blocker>..., or: ocnus linear move <card> <approved|started|review|done>, or: ocnus linear archive [on|off|--json] (see: ocnus help)" ;;
|
|
1421
1554
|
esac
|
|
1422
1555
|
}
|
package/cli/ocnus
CHANGED
|
@@ -53,8 +53,9 @@ Usage:
|
|
|
53
53
|
or with no card the cards that have hand-offs and where each stands
|
|
54
54
|
ocnus linear key save your Linear API key, so ocnus can read and write Linear cards
|
|
55
55
|
(it says when the key can read cards but not change them)
|
|
56
|
-
ocnus linear read <card> [--json] print a card whole: its head,
|
|
57
|
-
sub-issues
|
|
56
|
+
ocnus linear read <card> [--json] print a card whole: its head, with the cards that block it
|
|
57
|
+
and that it blocks, description, comments and sub-issues
|
|
58
|
+
(--json for programs)
|
|
58
59
|
ocnus linear type <card> <feat|fix|chore>
|
|
59
60
|
set a card's type, its label in the Type group
|
|
60
61
|
ocnus linear section <card> <Specification|Plan|Breakdown|Review> [--replace]
|
|
@@ -62,6 +63,9 @@ Usage:
|
|
|
62
63
|
ocnus linear slices <card> make a card's slices as its sub-issues, each with the card's
|
|
63
64
|
type and blocked by the one before; the slices on stdin,
|
|
64
65
|
and a run again makes only the ones still missing
|
|
66
|
+
ocnus linear block <card> <blocker>...
|
|
67
|
+
record in Linear that each blocker blocks the card, skipping
|
|
68
|
+
one it has already; it removes none
|
|
65
69
|
ocnus linear move <card> <approved|started|review|done>
|
|
66
70
|
move a card forward in Linear: to its team's first
|
|
67
71
|
not-started status (Todo) with its sub-issues, its first
|
|
@@ -109,8 +113,8 @@ status. It needs two things set once. `linear key` asks for a Linear API key
|
|
|
109
113
|
and saves it (make one in Linear, under Settings, Account, Security & access,
|
|
110
114
|
Personal API keys; Read permission is enough to list cards and for
|
|
111
115
|
`linear read`, which the card skills read a card with, and the card skills'
|
|
112
|
-
writes, `linear type`, `linear section`, `linear slices
|
|
113
|
-
need Write too).
|
|
116
|
+
writes, `linear type`, `linear section`, `linear slices`, `linear block` and
|
|
117
|
+
`linear move`, need Write too).
|
|
114
118
|
`linear key` and `status` check whether the key can change cards, by asking
|
|
115
119
|
Linear to change a card that cannot exist, which changes nothing. A key that
|
|
116
120
|
can read cards but not change them is still saved, and `linear key` says
|
package/herdr/README.md
CHANGED
|
@@ -170,7 +170,7 @@ opened, and links them with the app open or closed once it has.
|
|
|
170
170
|
| It says | When | Its exit code |
|
|
171
171
|
|---|---|---|
|
|
172
172
|
| `writes`, that the key can change cards | Linear said there is no such card. | not changed |
|
|
173
|
-
| `problem`, that the key can read cards but not change them | Linear refused the change for want of Write permission. `task ls`, the Cards panel and `linear read` work, but `linear type`, `linear section`, `linear slices` and `linear move` fail, and the card skills fall back to the agent's own Linear tools. Make a key with Write permission in Linear and save it with `ocnus linear key`. | non-zero |
|
|
173
|
+
| `problem`, that the key can read cards but not change them | Linear refused the change for want of Write permission. `task ls`, the Cards panel and `linear read` work, but `linear type`, `linear section`, `linear slices`, `linear block` and `linear move` fail, and the card skills fall back to the agent's own Linear tools. Make a key with Write permission in Linear and save it with `ocnus linear key`. | non-zero |
|
|
174
174
|
| `note`, that this was not checked, and why | Linear went out of reach, something between this machine and Linear answered for it, or Linear's answer said neither. It does not say the key cannot change cards. | not changed |
|
|
175
175
|
|
|
176
176
|
The key itself is never shown.
|
|
@@ -423,6 +423,22 @@ ocnus task new <space> <card>
|
|
|
423
423
|
runs `task start` as for your approval (see
|
|
424
424
|
[The breakdown approval](#the-breakdown-approval)). Edit that file to change
|
|
425
425
|
what the agent is told.
|
|
426
|
+
- **Breakdown records the cards a card waits on.** `sdlc-breakdown` looks
|
|
427
|
+
for every other card that the card, or one of its slices, needs merged
|
|
428
|
+
first: in the card's description, Specification and Plan, and among the
|
|
429
|
+
open cards of the space's teams (`task ls`), a slice of another card too.
|
|
430
|
+
The Breakdown names them under the slice they block, or below a card of
|
|
431
|
+
one piece; one the whole card needs goes on its first slice. It also
|
|
432
|
+
looks for cards already approved and not started, in Todo, that need this
|
|
433
|
+
card's work first, and the summary you approve from names both kinds.
|
|
434
|
+
Nothing is recorded before you approve. Once you do, before the approval
|
|
435
|
+
is recorded and `task start` runs, it records each with
|
|
436
|
+
`ocnus linear block` (see the table below): the card's own blockers on
|
|
437
|
+
the card, or on the slice they block, and this card, or its first slice
|
|
438
|
+
that the other card needs, as a blocker of each card in Todo that needs
|
|
439
|
+
it. Since `task start` holds a card while a card that blocks it is not
|
|
440
|
+
done, that keeps the work in the order it needs. `ocnus linear read`
|
|
441
|
+
shows a card's blockers, and the cards it blocks.
|
|
426
442
|
- **Your approval moves the card.** Once you approve it, and its sub-issues
|
|
427
443
|
exist when it was sliced, the agent records the approval, and recording it
|
|
428
444
|
moves the card in Linear to its team's first not-started status (Todo in
|
|
@@ -478,32 +494,36 @@ ocnus task new <space> <card>
|
|
|
478
494
|
not asked, and when Linear cannot be asked (the network, a rejected key, no
|
|
479
495
|
`curl` or `jq`), the card starts as before, with a note saying why.
|
|
480
496
|
- **The skills read and write the card through ocnus.** The agent reads
|
|
481
|
-
the card with one ocnus command, and sets the type, writes each section
|
|
482
|
-
|
|
483
|
-
writes go the same way on every run. A
|
|
484
|
-
pull requests are open, moves the
|
|
485
|
-
agent's own Linear tools are for
|
|
486
|
-
card, and for other reads, such as a
|
|
497
|
+
the card with one ocnus command, and sets the type, writes each section,
|
|
498
|
+
makes a sliced card's sub-issues and records the cards that block a card
|
|
499
|
+
with four more, so the read and the writes go the same way on every run. A
|
|
500
|
+
sixth, which `sdlc-pr` runs once its pull requests are open, moves the
|
|
501
|
+
card (see [Hand-offs](#hand-offs)). The agent's own Linear tools are for
|
|
502
|
+
when ocnus cannot read or write the card, and for other reads, such as a
|
|
503
|
+
related card:
|
|
487
504
|
|
|
488
505
|
| Command | What it does |
|
|
489
506
|
|---|---|
|
|
490
|
-
| `ocnus linear read <card> [--json]` | Prints the card whole: its ID and title, then its status, labels
|
|
507
|
+
| `ocnus linear read <card> [--json]` | Prints the card whole: its ID and title, then its status, labels and parent, a line for each card that blocks it, `Blocked by: <ID> <status> <title>`, and for each card it blocks, `Blocks: <ID> <status> <title>`, done or not, then its Linear project (each when it has one) and URL, the description with its sections as written, each comment with who wrote it and when, oldest first, and each sub-issue with its ID, status and title, oldest first, in the order they were made, which is the order `linear slices` makes a card's slices in. A comment an app made is the app's. Control characters become spaces, as in `task ls`, but the description and the comments keep their line breaks. `--json` prints the same as one line for programs such as a mod, with the text as Linear gave it: `{"id", "title", "url", "status": {"name", "type"}, "type", "labels", "parent": {"id", "title"}, "blockedBy": [{"id", "title", "status": {"name", "type"}}], "blocks": [{"id", "title", "status": {"name", "type"}}], "project": {"name"}, "description", "comments": [{"author", "createdAt", "body"}], "subIssues": [{"id", "title", "status": {"name", "type"}}]}`. `type` is the card's label in the `Type` group, `labels` the names of all its labels, and `type`, `parent` and the Linear project are `null` when the card has none. `blockedBy` and `blocks` come from the card's relations of the kind blocks alone, so a card only related to another is in neither. A card with more than 100 comments, 50 sub-issues, 100 labels, or 50 relations to other cards or from them, is not printed, since what was read would pass for the whole: the command says so and exits non-zero. When it fails it prints nothing on stdout. It needs only Read permission. |
|
|
491
508
|
| `ocnus linear type <card> <feat\|fix\|chore>` | Sets the card's type: its one label in the `Type` label group, the team's or else the workspace's. Any other type comes off; the card's other labels are never touched. A missing label is refused, never made. |
|
|
492
509
|
| `ocnus linear section <card> <Specification\|Plan\|Breakdown\|Review> [--replace]` | Adds the section, its body on stdin, below the description. Specification, Plan and Review are folded away, in the form Linear keeps them in, `+++ ## <name>` … `+++` (one written as `>>>` is read the same); the Breakdown is left open, because you read it to approve the card. The Review, which the review step writes, comes after the Breakdown, and each later round puts its own in the last one's place with `--replace`. A section of that name already there is refused, unless `--replace` puts the new one in its place; `--replace` with none there is refused too. A body is refused when a line in it would end the section early or start a second one: a fold line, and in the Breakdown a `#` or `##` heading. A line inside a fenced code block is never taken for a section. |
|
|
493
510
|
| `ocnus linear slices <card>` | Makes the card's slices, given on stdin, as its sub-issues, in order: for each slice a line `<n>. <name>`, and its description indented below it. Each is made in the card's team, with the name as its title, the description, and the card's type, its one label in the `Type` group; each but the first is marked as blocked by the slice before it. It prints a line for each slice, `Slice <n> of <total>: <ID> <name>`, saying whether it was made or was there already. A slice is there already when the card has a sub-issue with its name as its title, exactly: it is left as it is, and only its blocker is added when it lacks one. So a run that stopped partway, which says what it made and why it stopped, is finished by running it again with the same slices, and no slice is made twice. Any other sub-issue of the card is named, and left alone. It makes nothing when the slices are fewer than two, numbered out of order, of one name twice or without a description, or when the card has no type or more than one, is itself a sub-issue, has more than 50 sub-issues, or has two sub-issues of one slice's name. |
|
|
511
|
+
| `ocnus linear block <card> <blocker>...` | Records in Linear that each blocker given blocks the card: a relation of the kind blocks, from the blocker to the card, as `linear slices` makes between slices. Every card is read first, so an ID Linear does not have records nothing. A blocker the card has already is skipped, one given twice is recorded once, and nothing is ever removed. It prints a line for each blocker, `<card> is now blocked by <blocker>` or `<card> is blocked by <blocker> already`. A run that stopped partway says what it recorded and why it stopped, and is finished by running it again with the same cards. It records nothing when a card ID is not one, or when a blocker is the card itself. `sdlc-breakdown` runs it once the card is approved, for the cards a card or its slices depend on, and for a card in Todo that needs this one first. |
|
|
494
512
|
| `ocnus linear move <card> <approved\|started\|review\|done>` | Moves the card forward to its team's first not-started status (Todo in Lab, Ready for Dev in PHY), its first started status (In Progress), its last started one (In Review), or its first completed one (Done), picked by its kind and its place in the team's order, not by its name. `approved` moves each of the card's sub-issues after it the same way, by its own team's statuses, and is the move your approval makes. For a slice, `started` and `done` move the card it was sliced from after it the same way: `started` as `task start` does, and `done` as the merge does, only once the slice is closed and every other sub-issue of that card is closed too, done, canceled or a duplicate. While any is open the parent stays where it is, and the command names the open ones, as `ABC-100 stays in In Progress: 2 of its 3 slices are still open (ABC-123, ABC-124)`, and exits zero. A parent with more than 50 sub-issues is not moved, since one it did not read may be open, and neither is the parent of a slice that was not moved. In a team with one started status, `review` is that status. A card already there, further on, done or canceled stays where it is, and the command says so and exits zero. A move that cannot be made, such as with Linear out of reach or a key without Write permission, exits non-zero, saying which card was not moved and why; the other cards still move. |
|
|
495
513
|
|
|
496
|
-
The
|
|
514
|
+
The five that write read back what Linear saved before they say they are
|
|
497
515
|
done: one type, the one asked for; the section there once, and the text
|
|
498
516
|
above it as it was; each slice made a sub-issue of the card, with the
|
|
499
|
-
slice's name and the card's type, and each blocker added;
|
|
500
|
-
|
|
517
|
+
slice's name and the card's type, and each blocker added; each blocker
|
|
518
|
+
`linear block` records, from the blocker to the card; the card in the
|
|
519
|
+
status it was moved to. All five need your key to have Write permission.
|
|
501
520
|
With no key saved, or a key Linear rejects, the skills read the card, and
|
|
502
|
-
write the type and the sections
|
|
503
|
-
Linear tools instead, and say so in the hand-off's flags;
|
|
504
|
-
moved then, and `sdlc-pr` says so. `sdlc-review` writes
|
|
505
|
-
them, and `sdlc-breakdown` the Breakdown
|
|
506
|
-
the write with an error too, as it does
|
|
521
|
+
write the type and the sections, make the slices and record the blockers,
|
|
522
|
+
with the agent's Linear tools instead, and say so in the hand-off's flags;
|
|
523
|
+
the card is not moved then, and `sdlc-pr` says so. `sdlc-review` writes
|
|
524
|
+
the Review with them, and `sdlc-breakdown` the Breakdown, the slices and
|
|
525
|
+
the blockers, when Linear answers the write with an error too, as it does
|
|
526
|
+
for a key without Write permission.
|
|
507
527
|
|
|
508
528
|
### The Cards panel
|
|
509
529
|
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ The method is elephant carpaccio: cut the work into slices so thin that each one
|
|
|
11
11
|
|
|
12
12
|
Thin slices matter more when an agent is building. Each slice can be checked end to end as soon as it merges, a mistake stays inside one small pull request, and if the third slice never ships, the first two still work.
|
|
13
13
|
|
|
14
|
-
This skill has
|
|
14
|
+
This skill has three parts. Proposing, and the approval, happen on every card: the human approves it, unless they have turned the breakdown approval off and you have no doubt to raise. Creating sub-issues happens only once a card that was sliced is approved. Recording the blockers, the other cards the card waits on and the cards that wait on it, happens once any card is approved.
|
|
15
15
|
|
|
16
16
|
## Before you write anything
|
|
17
17
|
|
|
@@ -63,6 +63,19 @@ Some work has no cut that passes the checks. A refactor may have nothing to clic
|
|
|
63
63
|
|
|
64
64
|
Then the card stands as one piece, however large it is. Don't force a cut that fails a check. A horizontal slice is worse than a large card, because it merges something nobody can test. Say in one line why it can't be cut, and if it is large, say so when you ask the human to approve.
|
|
65
65
|
|
|
66
|
+
### Find the cards it depends on
|
|
67
|
+
|
|
68
|
+
A card often needs another card's work merged first, such as a command, a table or a screen that the other card makes. Linear records that as a blocker: a relation of the kind blocks, from the card that has to land first to the card that waits for it. `task start` goes by the blockers, and holds a card while a card that blocks it is not done. So find every such card now, for the card and for each slice. You record them once the card is approved, in part 3.
|
|
69
|
+
|
|
70
|
+
Look in two places:
|
|
71
|
+
|
|
72
|
+
- **This card.** Its description, Specification and Plan name the work it builds on, by card ID or by what that work makes. The `Blocked by:` lines of `ocnus linear read <card ID>` show the blockers it has already.
|
|
73
|
+
- **The open cards of the space's teams**, which `ocnus task ls <space> --json` lists under their statuses. Read each one whose title touches what this card changes or uses, with `ocnus linear read <ID>`.
|
|
74
|
+
|
|
75
|
+
A card is a dependency only when this card, or one of its slices, can't be built or merged until that card's work has merged. A card that is done already, one that is only related, and one that could land in either order are not. A dependency can be a slice of another card, a sub-issue of a card that was sliced: name that slice, by its own ID, not the card it was sliced from, since a card's slices merge one at a time and this card may need only the first.
|
|
76
|
+
|
|
77
|
+
Then look the other way, for cards already approved and not started that need this card first. They are the cards in a not-started status, Todo in Lab or Ready for Dev in PHY, which `task ls` lists under a status with `"type": "unstarted"`. Each was written up without this card, which may not have existed then, so nothing holds it while this card is built. For each one whose work needs this card's, note what it waits on: this card when it is one piece, or the first of its slices whose work the other card needs. A card in Backlog is not approved yet: its own breakdown finds this card when it is written up.
|
|
78
|
+
|
|
66
79
|
### Write it to the card
|
|
67
80
|
|
|
68
81
|
Append a Breakdown section below the Plan. Leave it open, not collapsible, because it is what the human reads to approve the card. Change nothing above it.
|
|
@@ -74,6 +87,8 @@ For one piece:
|
|
|
74
87
|
```
|
|
75
88
|
ocnus linear section <card ID> Breakdown <<'EOF'
|
|
76
89
|
One piece. <one line on why: already small, or why it can't be cut>
|
|
90
|
+
|
|
91
|
+
Blocked by: <ID and title of each other card it depends on>
|
|
77
92
|
EOF
|
|
78
93
|
```
|
|
79
94
|
|
|
@@ -84,11 +99,14 @@ ocnus linear section <card ID> Breakdown <<'EOF'
|
|
|
84
99
|
1. **<slice name: a short phrase for the behaviour>**
|
|
85
100
|
- [ ] <its Done when>
|
|
86
101
|
- [ ] …
|
|
102
|
+
- Blocked by: <ID and title of each other card this slice depends on>
|
|
87
103
|
2. **<slice name>**
|
|
88
104
|
- [ ] …
|
|
89
105
|
EOF
|
|
90
106
|
```
|
|
91
107
|
|
|
108
|
+
The `Blocked by:` line names the other cards it depends on, from Find the cards it depends on above. Leave it out where there are none. A dependency of the whole card goes on its first slice. The slice before each slice blocks it already, so don't name that one.
|
|
109
|
+
|
|
92
110
|
To change a Breakdown that is already on the card, run the same command with `--replace` after the section name.
|
|
93
111
|
|
|
94
112
|
Create nothing else in Linear yet. A proposal the human turns down should leave nothing behind to clean up.
|
|
@@ -100,8 +118,8 @@ Breakdown is the last step of the write-up phase, so it ends with the whole card
|
|
|
100
118
|
First read the breakdown approval, with `ocnus approval --json`. Read it when you get to the approval, not before: the human may turn it on or off while the card is written up, and the setting as it is now is the one that counts. It prints one line, such as `{"file":"…/settings.json","approval":{"breakdown":true}}`.
|
|
101
119
|
|
|
102
120
|
- **`"breakdown": true`**: ask the human, as below. With nothing set, no setting in the file or no file, it is `true`.
|
|
103
|
-
- **`"breakdown": false`, and you have no doubt to raise**: don't ask. The setting approves the card, which starts it as the human's approval does. When the card is sliced, go on to part 2, then hand off. When it is one piece, hand off.
|
|
104
|
-
- **`"breakdown": false`, and you have a doubt to raise**: ask the human, as below, and put the doubt in the summary. A doubt is what this skill says to raise when you ask the human to approve: a sub-issue that looks too big to stay one piece, more than six slices, which makes the card look like several cards,
|
|
121
|
+
- **`"breakdown": false`, and you have no doubt to raise**: don't ask. The setting approves the card, which starts it as the human's approval does. When the card is sliced, go on to part 2 and part 3, then hand off. When it is one piece, go on to part 3, then hand off. All are described below.
|
|
122
|
+
- **`"breakdown": false`, and you have a doubt to raise**: ask the human, as below, and put the doubt in the summary. A doubt is what this skill says to raise when you ask the human to approve: a sub-issue that looks too big to stay one piece, more than six slices, which makes the card look like several cards, a card that can't be cut and is large, or a card you can't tell whether to record as a blocker of this card, or as blocked by it.
|
|
105
123
|
- **The command fails, or prints anything else**, such as when the settings file is not valid settings or this machine's `ocnus` has no `approval` command: ask the human, as below, and say in the summary that the breakdown approval could not be read, and why, in the command's words.
|
|
106
124
|
|
|
107
125
|
The setting is for this approval alone. A question define or plan asked earlier in the write-up waited for the human's answer, and so does one this skill asks before it gets here, such as whether to revise a Breakdown the card already has.
|
|
@@ -112,6 +130,7 @@ When you ask, give them a summary they can answer from without opening Linear:
|
|
|
112
130
|
- The Done when list.
|
|
113
131
|
- The approach, in a sentence or two.
|
|
114
132
|
- Whether it is one piece or several, and why. If several, the slice names in order.
|
|
133
|
+
- The other cards it depends on, by ID and title, for the card or for each slice, and the cards in Todo that need it first, which it will be recorded as blocking. Say so when there are none.
|
|
115
134
|
|
|
116
135
|
Then ask them to approve or say what to change. Approving the card starts its build phase: once the approval is recorded, you run `task start` on it. Record the ask as a hand-off with this block, then end your message with the summary and, below it, the block the command printed:
|
|
117
136
|
|
|
@@ -130,8 +149,8 @@ Wait for their answer.
|
|
|
130
149
|
|---|---|
|
|
131
150
|
| Change the breakdown | Revise the Breakdown section, with `--replace`, and ask again |
|
|
132
151
|
| Change the Specification or the Plan | Make the change by that section's own skill, `sdlc-define` or `sdlc-plan`, as a revision the human asked for. That skill ends with its own `done` block, whose `next` does not apply here: come back to this step and re-check every section below the one that changed, because a new Done when item can make the Plan and the Breakdown wrong. Ask again |
|
|
133
|
-
| Approve, and the card is one piece | The card is ready to build.
|
|
134
|
-
| Approve, and the card is sliced | Go on to part 2 |
|
|
152
|
+
| Approve, and the card is one piece | The card is ready to build. Go on to part 3, then hand off, as described below |
|
|
153
|
+
| Approve, and the card is sliced | Go on to part 2, then part 3 |
|
|
135
154
|
|
|
136
155
|
Go by what they mean, not by the exact words: `approve`, `yes` or `go ahead` approves the card. An approval always starts the build phase: none holds it back. When they approve the card but want its start held back, in any words, such as not yet or I'll start it, tell them that approving starts it, and ask again: a card they want to hold stays unapproved, in Backlog, until they approve it. A card that another card blocks needs no holding back: `task start` holds it by itself until every card that blocks it, or the card it was sliced from, is done. An approval by the setting, with the breakdown approval off, starts the card in the same way, and since no one was asked, there is no answer to record.
|
|
137
156
|
|
|
@@ -150,7 +169,7 @@ Do this only when the card has been approved in this session, by the human or by
|
|
|
150
169
|
EOF
|
|
151
170
|
```
|
|
152
171
|
|
|
153
|
-
It makes each slice a sub-issue of the card, with the slice name as its title and the card's type, since slices don't get a type of their own, and marks it as blocked by the slice before it. The first slice is blocked by
|
|
172
|
+
It makes each slice a sub-issue of the card, with the slice name as its title and the card's type, since slices don't get a type of their own, and marks it as blocked by the slice before it. The first slice is blocked by no slice. The other cards a slice depends on are recorded in part 3. It reads back each one it makes, then prints a line for each slice, `Slice <n> of <total>: <sub-issue ID> <slice name>`, which gives you each sub-issue's ID. A slice that a run before has made already, a sub-issue of the card with the slice's name as its title, is left as it is, and only its blocker is added when it lacks one. It names any other sub-issue the card has, and leaves it alone.
|
|
154
173
|
2. **Write each sub-issue's sections**, in order, in the same form as any card, each with its own command and the sub-issue's ID, in this order:
|
|
155
174
|
- A Specification, with the parent's Why narrowed to this slice, and the slice's Done when: `ocnus linear section <sub-issue ID> Specification <<'EOF'`.
|
|
156
175
|
- A Plan, with the approach in a sentence or two, only the files this slice touches, and the Tests lines for its Done when items: `ocnus linear section <sub-issue ID> Plan <<'EOF'`.
|
|
@@ -158,20 +177,41 @@ Do this only when the card has been approved in this session, by the human or by
|
|
|
158
177
|
|
|
159
178
|
A sub-issue has to stand alone. The build step will open it in a fresh session and see only that card, so anything it needs from the parent goes into it.
|
|
160
179
|
|
|
161
|
-
Then update the parent's Breakdown list so each slice name carries its sub-issue's ID, with `ocnus linear section <card ID> Breakdown --replace`. The parent is not built. It stays as the record of the whole.
|
|
180
|
+
Then update the parent's Breakdown list so each slice name carries its sub-issue's ID, with `ocnus linear section <card ID> Breakdown --replace`. Keep each slice's `Blocked by:` line as it is. The parent is not built. It stays as the record of the whole.
|
|
181
|
+
|
|
182
|
+
Read the parent and each sub-issue back, then go on to part 3.
|
|
183
|
+
|
|
184
|
+
## Part 3: Record the blockers
|
|
185
|
+
|
|
186
|
+
Do this once the card is approved in this session, by the human or by the setting, whether it is one piece or sliced, and before you hand off: `task start` reads the blockers when it starts the card, so they have to be in Linear first. Record nothing before the approval: a proposal the human turns down should leave nothing behind to clean up.
|
|
187
|
+
|
|
188
|
+
1. **The cards this card depends on.** For the card, or each slice, that the Breakdown says other cards block, record them with one command: the card that waits first, then each card that blocks it.
|
|
162
189
|
|
|
163
|
-
|
|
190
|
+
```
|
|
191
|
+
ocnus linear block <card ID> <blocker ID>...
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
When the card is sliced, the card that waits is the slice, by the sub-issue ID `ocnus linear slices` printed for it. A dependency of the whole card goes on its first slice. A blocker that is a slice of another card is given by that slice's own ID, not by the card it was sliced from.
|
|
195
|
+
2. **The cards in Todo that need this one first.** For each, record this card as its blocker: the other card first, then this card, or the first of its slices that the other card needs.
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
ocnus linear block <other card ID> <card ID or slice ID>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The command reads every card it is given before it records anything, then records each blocker the card does not have yet, as a relation of the kind blocks from the blocker to the card, and reads each one back. It skips a blocker the card has already, and removes none, so running it again with the same cards is safe. It prints a line for each blocker, `<card> is now blocked by <blocker>` or `<card> is blocked by <blocker> already`. It refuses a card given as its own blocker, and records nothing then.
|
|
202
|
+
|
|
203
|
+
When no other card blocks the card or any of its slices, and no card in Todo needs it first, there is nothing to record. Either way, hand off next.
|
|
164
204
|
|
|
165
205
|
## Hand off
|
|
166
206
|
|
|
167
|
-
Breakdown is finished when the card is approved, by the human or by the setting,
|
|
207
|
+
Breakdown is finished when the card is approved, by the human or by the setting, its sub-issues exist if it was sliced, and its blockers are recorded. Then record the hand-off:
|
|
168
208
|
|
|
169
209
|
```
|
|
170
210
|
ocnus task handoff <space> <card ID> <<'EOF'
|
|
171
211
|
step: breakdown
|
|
172
212
|
status: done
|
|
173
213
|
next: start
|
|
174
|
-
summary: <that the card is approved, by the human or by the setting; whether it is one piece or sliced; if sliced, the sub-issues in order with their IDs, and which one is first>
|
|
214
|
+
summary: <that the card is approved, by the human or by the setting; whether it is one piece or sliced; if sliced, the sub-issues in order with their IDs, and which one is first; and each blocker you recorded, naming the card that waits and the card that blocks it, or that there was none to record>
|
|
175
215
|
flags: <anything that didn't go to plan, such as a blocking relation that couldn't be set>
|
|
176
216
|
EOF
|
|
177
217
|
```
|
|
@@ -185,7 +225,7 @@ ocnus task handoff <space> <card ID> <<'EOF'
|
|
|
185
225
|
step: breakdown
|
|
186
226
|
status: done
|
|
187
227
|
next: start
|
|
188
|
-
summary: Approved by the setting, with the breakdown approval off, to start now. <whether it is one piece or sliced; if sliced, the sub-issues in order with their IDs, and which one is first>
|
|
228
|
+
summary: Approved by the setting, with the breakdown approval off, to start now. <whether it is one piece or sliced; if sliced, the sub-issues in order with their IDs, and which one is first; and each blocker you recorded, naming the card that waits and the card that blocks it, or that there was none to record>
|
|
189
229
|
flags: <anything that didn't go to plan>
|
|
190
230
|
approved: setting
|
|
191
231
|
EOF
|
|
@@ -262,11 +302,11 @@ EOF
|
|
|
262
302
|
|---|---|
|
|
263
303
|
| The card ID doesn't resolve | Ask the human for the ID. Don't pick a card because its title looks similar |
|
|
264
304
|
| The Linear tools aren't available | Stop and say so. Show the finished section in the session so the work isn't lost. Don't save it somewhere else and report the step as done |
|
|
265
|
-
| `ocnus linear` says no Linear key is saved, that Linear rejected the key or that Linear answered with an error, or the command isn't there | Read the card, write the Breakdown, make the slices
|
|
305
|
+
| `ocnus linear` says no Linear key is saved, that Linear rejected the key or that Linear answered with an error, or the command isn't there | Read the card, write the Breakdown, make the slices, write their sections and record the blockers with the Linear tools instead, in the same form: the Breakdown under the heading `## Breakdown`; each slice a sub-issue of the card, with the slice name as its title and the card's type, blocked by the slice before it; a sub-issue's Specification and Plan each between `>>> ## <name>` and a closing `>>>`; and each blocker a relation of the kind blocks, from the card that blocks to the card that waits. Make only the slices the card has no sub-issue for yet. A key with Read permission alone reads the card and gets the error only at a write: make that write and the rest with them then. Say so in `flags` |
|
|
266
306
|
| `ocnus linear` says it could not reach Linear | Run it once more. It checks the card before it writes, so it can't add the section twice. If it then says the card already has a Breakdown, the first try got through |
|
|
267
307
|
| `ocnus linear section` says the text above the section changed | Put it back from what you read at the start of this run, with the Linear tools, and tell the human |
|
|
268
308
|
| Making the slices stops partway | Don't start over. Run `ocnus linear slices` again with the same list: it finds the slices already made by their names, makes only the missing ones, and adds any blocker that is missing. Then write any section a sub-issue lacks: `ocnus linear section` refuses one that is there |
|
|
269
|
-
|
|
|
309
|
+
| `ocnus linear block` stops, or a blocking relation can't be set | When it says it could not reach Linear, run it again with the same cards: it skips the blockers already there. When it says no Linear key is saved, that Linear rejected the key or that Linear answered with an error, record the rest with the Linear tools, as in the row above. A blocker you still can't record goes in `flags`, naming the card that waits and the card that blocks it, and in your message too: `task start` does not hold a card for a blocker Linear doesn't have. The Breakdown still names it, so it isn't lost |
|
|
270
310
|
| The human's answer isn't a clear yes | Treat it as a change request. Ask what they want changed, then ask for approval again |
|
|
271
311
|
|
|
272
312
|
If something fails that isn't on this list, stop and tell the human what happened. Don't work around it.
|
|
@@ -281,7 +321,7 @@ One piece. Four files and one behaviour, small enough for a single pull request.
|
|
|
281
321
|
EOF
|
|
282
322
|
```
|
|
283
323
|
|
|
284
|
-
**Sliced.** The card "Order notes" asks that staff can add notes to an order, edit and delete them, and mark some as visible to the customer. The plan touches the database, the API, the staff app and the customer app.
|
|
324
|
+
**Sliced.** The card "Order notes" asks that staff can add notes to an order, edit and delete them, and mark some as visible to the customer. The plan touches the database, the API, the staff app and the customer app. It checks who is staff by the roles that ABC-127, "Staff roles", adds: the first slice of another card, "Staff accounts", not merged yet. And ABC-135, "Notify the customer of a new note", is in Todo and needs the notes the customer sees, which slice 3 makes.
|
|
285
325
|
|
|
286
326
|
```
|
|
287
327
|
ocnus linear section ABC-130 Breakdown <<'EOF'
|
|
@@ -289,6 +329,7 @@ ocnus linear section ABC-130 Breakdown <<'EOF'
|
|
|
289
329
|
- [ ] On an order, a staff member can type a note and save it.
|
|
290
330
|
- [ ] Saved notes show on the order, newest first, with the author and time.
|
|
291
331
|
- [ ] Someone who is not staff can neither add nor see notes.
|
|
332
|
+
- Blocked by: ABC-127 Staff roles
|
|
292
333
|
2. **Staff can edit and delete their own notes**
|
|
293
334
|
- [ ] A staff member can edit a note they wrote, and the note shows it was edited.
|
|
294
335
|
- [ ] A staff member can delete a note they wrote, after confirming.
|
|
@@ -299,6 +340,13 @@ ocnus linear section ABC-130 Breakdown <<'EOF'
|
|
|
299
340
|
EOF
|
|
300
341
|
```
|
|
301
342
|
|
|
343
|
+
The summary the human approves from names ABC-127 as slice 1's blocker, and ABC-135 as a card in Todo that slice 3 will block. Once the card is approved, and its slices are made as ABC-131, ABC-132 and ABC-133, part 3 records both:
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
ocnus linear block ABC-131 ABC-127
|
|
347
|
+
ocnus linear block ABC-135 ABC-133
|
|
348
|
+
```
|
|
349
|
+
|
|
302
350
|
**The wrong cut** for the same card:
|
|
303
351
|
|
|
304
352
|
```
|