@sublang/playbook 15.1.0 → 16.0.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/docs/embedding.md +2 -2
- package/package.json +1 -1
- package/reference/sdlc/branch.playbook/branch.fsm.d.ts +63 -33
- package/reference/sdlc/branch.playbook/branch.fsm.js +190 -108
- package/reference/sdlc/branch.playbook/branch.fsm.ts +269 -147
- package/reference/sdlc/branch.playbook/branch.gears.md +7 -17
- package/reference/sdlc/branch.playbook/branch.playbook.d.ts +12 -16
- package/reference/sdlc/branch.playbook/branch.playbook.js +112 -101
- package/reference/sdlc/branch.playbook/branch.playbook.ts +128 -171
- package/reference/sdlc/branch.playbook/branch.registry.d.ts +3 -2
- package/reference/sdlc/branch.playbook/branch.registry.ts +6 -2
- package/reference/sdlc/code.playbook/code.fsm.d.ts +143 -90
- package/reference/sdlc/code.playbook/code.fsm.introspect.d.ts +8 -8
- package/reference/sdlc/code.playbook/code.fsm.introspect.ts +13 -13
- package/reference/sdlc/code.playbook/code.fsm.js +609 -649
- package/reference/sdlc/code.playbook/code.fsm.ts +890 -821
- package/reference/sdlc/code.playbook/code.gears.md +39 -29
- package/reference/sdlc/code.playbook/code.playbook.d.ts +13 -16
- package/reference/sdlc/code.playbook/code.playbook.js +166 -147
- package/reference/sdlc/code.playbook/code.playbook.ts +180 -229
- package/reference/sdlc/code.playbook/code.registry.d.ts +3 -2
- package/reference/sdlc/code.playbook/code.registry.ts +6 -2
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +42 -0
- package/reference/sdlc/code.playbook/playbook-captain.js +829 -194
- package/reference/sdlc/code.playbook/playbook-captain.ts +1227 -220
- package/reference/sdlc/decide.md +1 -0
- package/reference/sdlc/decide.playbook/decide.fsm.d.ts +270 -154
- package/reference/sdlc/decide.playbook/decide.fsm.js +765 -732
- package/reference/sdlc/decide.playbook/decide.fsm.ts +1167 -945
- package/reference/sdlc/decide.playbook/decide.gears.md +28 -21
- package/reference/sdlc/decide.playbook/decide.playbook.d.ts +11 -59
- package/reference/sdlc/decide.playbook/decide.playbook.js +155 -3696
- package/reference/sdlc/decide.playbook/decide.playbook.ts +186 -5244
- package/reference/sdlc/decide.playbook/decide.registry.d.ts +8 -4
- package/reference/sdlc/decide.playbook/decide.registry.js +2 -2
- package/reference/sdlc/decide.playbook/decide.registry.ts +13 -6
- package/reference/sdlc/dev.playbook/dev.fsm.d.ts +113 -131
- package/reference/sdlc/dev.playbook/dev.fsm.js +517 -575
- package/reference/sdlc/dev.playbook/dev.fsm.ts +667 -787
- package/reference/sdlc/dev.playbook/dev.gears.md +52 -54
- package/reference/sdlc/dev.playbook/dev.playbook.d.ts +13 -10
- package/reference/sdlc/dev.playbook/dev.playbook.js +128 -120
- package/reference/sdlc/dev.playbook/dev.playbook.ts +143 -193
- package/reference/sdlc/dev.playbook/dev.registry.d.ts +3 -2
- package/reference/sdlc/dev.playbook/dev.registry.ts +6 -2
- package/reference/sdlc/pr.playbook/pr.fsm.d.ts +92 -85
- package/reference/sdlc/pr.playbook/pr.fsm.js +461 -518
- package/reference/sdlc/pr.playbook/pr.fsm.ts +533 -663
- package/reference/sdlc/pr.playbook/pr.gears.md +47 -63
- package/reference/sdlc/pr.playbook/pr.playbook.d.ts +13 -23
- package/reference/sdlc/pr.playbook/pr.playbook.js +118 -112
- package/reference/sdlc/pr.playbook/pr.playbook.ts +136 -190
- package/reference/sdlc/pr.playbook/pr.registry.d.ts +3 -2
- package/reference/sdlc/pr.playbook/pr.registry.ts +4 -2
- package/reference/sdlc/review.md +3 -3
- package/reference/sdlc/review.playbook/review.fsm.d.ts +150 -116
- package/reference/sdlc/review.playbook/review.fsm.js +479 -550
- package/reference/sdlc/review.playbook/review.fsm.ts +717 -662
- package/reference/sdlc/review.playbook/review.gears.md +32 -29
- package/reference/sdlc/review.playbook/review.playbook.d.ts +12 -12
- package/reference/sdlc/review.playbook/review.playbook.js +180 -155
- package/reference/sdlc/review.playbook/review.playbook.ts +190 -230
- package/reference/sdlc/review.playbook/review.registry.d.ts +6 -5
- package/reference/sdlc/review.playbook/review.registry.js +3 -3
- package/reference/sdlc/review.playbook/review.registry.ts +9 -5
- package/slc/gears2fsm.md +72 -3
- package/slc/link.md +50 -27
- package/slc/materialize-link.mjs +51 -13
- package/slc/optimize.md +4 -1
- package/slc/prefix-prompts.mjs +29 -28
- package/slc/prefix.md +27 -24
- package/slc/slc.pin-inputs.json +11 -2
- package/slc/text2gears.md +71 -11
- package/src/xstate-playbook-runtime.d.ts +54 -15
- package/src/xstate-playbook-runtime.js +1154 -248
- package/src/xstate-playbook-runtime.ts +1603 -317
|
@@ -3,32 +3,32 @@
|
|
|
3
3
|
|
|
4
4
|
# Decide
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Roles:
|
|
7
7
|
|
|
8
8
|
- Coder
|
|
9
9
|
- Reviewer
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The caller supplies the topic including any specific context.
|
|
12
|
+
No transition shall depend on a fixed presentation format of either player's reply.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
Coder and Reviewer receive the complete topic concurrently and independently.
|
|
15
|
-
Neither role's player receives the other role's proposal before both proposals are complete.
|
|
16
|
-
A proposal is complete only when its player affirmatively provides a complete design proposal; a progress report, status update, or promise of a later proposal supports no proposal outcome.
|
|
17
|
-
A Boss interrupt during the parallel proposal pair restarts the complete pair with the new `callerTopic`.
|
|
14
|
+
## Independent proposals
|
|
18
15
|
|
|
19
16
|
### DECIDE-1
|
|
20
17
|
|
|
21
18
|
Parallel group: independent-proposals
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
Captain shall not wait for Reviewer's proposal before requesting Coder's, and Coder's player shall not receive Reviewer's proposal until both proposals are complete.
|
|
21
|
+
A Boss interrupt during the parallel proposal pair restarts the whole pair so both players receive the same new topic and remain independent.
|
|
22
|
+
|
|
23
|
+
When the caller gives a topic, or when a Boss interrupt restarts the parallel proposal pair with a new topic, Captain shall relay the complete topic to Coder in quotes and prompt Coder:
|
|
24
24
|
|
|
25
|
-
> > Original topic: <caller-topic>
|
|
26
|
-
>
|
|
27
25
|
> Assess whether the topic is better expressed as a few spec items under @specs/packages/ or requires one or more DRs under @specs/decisions/.
|
|
28
26
|
> Propose your design.
|
|
29
27
|
> Keep your proposal coherent, focused, and concise.
|
|
30
28
|
> Consult @specs/map.md for relevant context and @specs/meta.md for spec requirements, if needed.
|
|
31
29
|
> Do not change any files.
|
|
30
|
+
>
|
|
31
|
+
> > Original topic: <caller-topic>
|
|
32
32
|
|
|
33
33
|
Results:
|
|
34
34
|
- `proposed`: Coder affirmatively provided a complete design proposal; a progress report, status update, or promise of a later proposal supports no proposal outcome. Output shall include `coderProposal: <verbatim final text>`.
|
|
@@ -37,15 +37,18 @@ Results:
|
|
|
37
37
|
|
|
38
38
|
Parallel group: independent-proposals
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
Captain shall not wait for Coder's proposal before requesting Reviewer's, and Reviewer's player shall not receive Coder's proposal until both proposals are complete.
|
|
41
|
+
A Boss interrupt during the parallel proposal pair restarts the whole pair so both players receive the same new topic and remain independent.
|
|
42
|
+
|
|
43
|
+
When the caller gives a topic, or when a Boss interrupt restarts the parallel proposal pair with a new topic, Captain shall relay the complete topic to Reviewer in quotes and prompt Reviewer:
|
|
41
44
|
|
|
42
|
-
> > Original topic: <caller-topic>
|
|
43
|
-
>
|
|
44
45
|
> Assess whether the topic is better expressed as a few spec items under @specs/packages/ or requires one or more DRs under @specs/decisions/.
|
|
45
46
|
> Propose your design.
|
|
46
47
|
> Keep your proposal coherent, focused, and concise.
|
|
47
48
|
> Consult @specs/map.md for relevant context and @specs/meta.md for spec requirements, if needed.
|
|
48
49
|
> Do not change any files.
|
|
50
|
+
>
|
|
51
|
+
> > Original topic: <caller-topic>
|
|
49
52
|
|
|
50
53
|
Results:
|
|
51
54
|
- `proposed`: Reviewer affirmatively provided a complete design proposal; a progress report, status update, or promise of a later proposal supports no proposal outcome. Output shall include `reviewerProposal: <verbatim final text>`.
|
|
@@ -54,7 +57,10 @@ Results:
|
|
|
54
57
|
|
|
55
58
|
### DECIDE-3
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
No transition shall depend on a fixed presentation format of Coder's reply.
|
|
61
|
+
Captain shall use the repository-effect receipt as the authoritative identity of Coder's new `decide`-owned commit.
|
|
62
|
+
|
|
63
|
+
When both proposals are complete, Captain shall relay the complete topic and Reviewer's complete proposal to Coder under their own labels in quotes and prompt Coder:
|
|
58
64
|
|
|
59
65
|
> Synthesize your independent proposal with Reviewer's proposal below.
|
|
60
66
|
> Keep to the original topic below and follow what it asks.
|
|
@@ -72,20 +78,21 @@ When both independent proposals are complete, Captain shall relay the complete t
|
|
|
72
78
|
> > Reviewer's independent proposal: <reviewer-proposal>
|
|
73
79
|
|
|
74
80
|
Results:
|
|
75
|
-
- `committed`: Coder synthesized
|
|
76
|
-
|
|
77
|
-
No transition depends on a fixed presentation format of either player's reply; the repository-effect receipt is the authoritative identity of Coder's new `decide`-owned commit.
|
|
81
|
+
- `committed`: Coder synthesized the proposals into the necessary DRs and/or spec items and committed the result as one new commit. Output shall include `coderOutput: <verbatim final text>` and `latestCommit: <commit identity>`.
|
|
78
82
|
|
|
79
83
|
## Review
|
|
80
84
|
|
|
81
85
|
### DECIDE-4
|
|
82
86
|
|
|
83
|
-
When Coder
|
|
87
|
+
When Coder has committed, Captain shall call playbook `review`:
|
|
84
88
|
|
|
85
89
|
> > Original intent: <caller-topic>
|
|
86
90
|
> > Review scope: the `decide`-owned commit <decide-commit> and its resulting repository state.
|
|
91
|
+
> > Coder's independent proposal: <coder-proposal>
|
|
87
92
|
> > Coder output: <coder-output>
|
|
88
93
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
The input is relayed to `review` in quotes (`>`); `<decide-commit>` is the `decide`-owned commit identified by the repository-effect receipt.
|
|
95
|
+
`decide` is complete only when `review` returns a result that applies to the supplied review scope, gives the exact evaluated repository revision, and affirmatively establishes that no unsettled findings remain.
|
|
96
|
+
It then returns the `decide`-owned commit and that evaluated revision to its caller.
|
|
97
|
+
When `review` returns an authored abort or failure, or a terminal result that does not establish those facts, `decide` shall report the failure and the last `decide`-owned commit to its caller.
|
|
98
|
+
When the nested `review` call fails outside that authored result contract, `decide` shall park as failed and retain the control-plane error instead of reporting an authored review outcome.
|
|
@@ -1,64 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { CaptainCallOptions, CaptainResult, JsonValue, NormalizedError, PlayerCallOptions, PlayerResult, PlayerSessionStore, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookControlAction, PlaybookControlReceipt, PlaybookControlView, PlaybookPendingCall, PlaybookPorts, PlaybookRunResult, PlaybookRuntime, PlaybookRuntimeFactory, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlaybookStateValue, PlaybookTraceEvent, PlaybookTraceType } from '@sublang/playbook/runtime';
|
|
5
|
-
export type { CaptainCallOptions, CaptainResult, JsonValue, NormalizedError, PlayerCallOptions, PlayerResult, PlayerSessionStore, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookControlAction, PlaybookControlReceipt, PlaybookControlView, PlaybookPendingCall, PlaybookPorts, PlaybookRunResult, PlaybookRuntime, PlaybookRuntimeFactory, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookState, PlaybookStateValue, PlaybookTraceEvent, PlaybookTraceType, };
|
|
6
|
-
type RoleId = 'coder' | 'reviewer';
|
|
7
|
-
export type PlaybookRuntimeOptions = DecideInput;
|
|
8
|
-
export type DecidePlaybookHostCapabilities = PlaybookHostConstructionCapabilities;
|
|
9
|
-
export interface DecidePlaybookRuntimeConstruction {
|
|
10
|
-
readonly configuredOptions: PlaybookRuntimeOptions;
|
|
11
|
-
readonly hostCapabilities: DecidePlaybookHostCapabilities;
|
|
1
|
+
import { type XStatePromptIdentity, type PlaybookPlayerInput, type XStatePlaybookRuntimeConstruction, type XStatePlaybookRuntimeFactory } from '@sublang/playbook/xstate-runtime';
|
|
2
|
+
export type { PlayerResult, PlayerCallOptions, PlayerSessionStore, CaptainResult, CaptainCallOptions, JsonValue, NormalizedError, PlaybookCallRequest, PlaybookCallResult, PlaybookCallStart, PlaybookStateValue, PlaybookState, PlaybookPendingCall, PlaybookRunResult, PlaybookRuntime, PlaybookRuntimeFactory, PlaybookRuntimeSnapshot, PlaybookSession, PlaybookPorts, PlaybookTraceEvent, PlaybookTraceType, PlaybookControlReceipt, PlaybookControlView, } from '@sublang/playbook/runtime';
|
|
3
|
+
export interface PlaybookRuntimeOptions {
|
|
12
4
|
}
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
declare function
|
|
17
|
-
declare function buildClassifierPrompt(text: string, ctx: {
|
|
18
|
-
state: PlaybookState;
|
|
19
|
-
pendingQuestions: readonly PendingBossQuestion[];
|
|
20
|
-
}): string;
|
|
21
|
-
declare function parseClassification(raw: string, text: string, pendingQuestionIds?: readonly string[]): DecideEvent | {
|
|
22
|
-
type: 'NO_ACTION';
|
|
23
|
-
} | null;
|
|
24
|
-
declare function buildAdjudicatorPrompt(input: PlayerInput, playerOutput: string, correction?: {
|
|
25
|
-
readonly reply: string;
|
|
26
|
-
readonly error: string;
|
|
27
|
-
}): string;
|
|
28
|
-
declare function combineSignals(a: AbortSignal | undefined, b: AbortSignal | undefined): AbortSignal;
|
|
29
|
-
declare function pendingQuestionsFromContext(context: Record<string, unknown>): PendingBossQuestion[];
|
|
30
|
-
declare function pendingQuestionsForState(state: PlaybookState, context: Record<string, unknown>): PendingBossQuestion[];
|
|
31
|
-
export declare const createPlaybookRuntime: PlaybookRuntimeFactory<DecidePlaybookRuntimeConstruction>;
|
|
5
|
+
export type PlaybookHostCapabilities = XStatePlaybookRuntimeConstruction<PlaybookRuntimeOptions, {
|
|
6
|
+
readonly authority: object;
|
|
7
|
+
}>['hostCapabilities'];
|
|
8
|
+
export declare function validateOptions(value: unknown): PlaybookRuntimeOptions;
|
|
32
9
|
export declare const _internal: {
|
|
33
|
-
composePlayerPrompt:
|
|
34
|
-
|
|
35
|
-
extractJson: typeof extractJson;
|
|
36
|
-
buildClassifierPrompt: typeof buildClassifierPrompt;
|
|
37
|
-
parseClassification: typeof parseClassification;
|
|
38
|
-
buildAdjudicatorPrompt: typeof buildAdjudicatorPrompt;
|
|
39
|
-
combineSignals: typeof combineSignals;
|
|
40
|
-
pendingQuestionsFromContext: typeof pendingQuestionsFromContext;
|
|
41
|
-
pendingQuestionsForState: typeof pendingQuestionsForState;
|
|
42
|
-
normalizeErrorCompact: typeof normalizeErrorCompact;
|
|
43
|
-
normalizeErrorFull: typeof normalizeErrorFull;
|
|
44
|
-
STATE_DESCRIPTIONS: Readonly<Record<string, string>>;
|
|
45
|
-
ROLE_STATES: readonly [{
|
|
46
|
-
readonly stateId: "askCoderProposal";
|
|
47
|
-
readonly role: "coder";
|
|
48
|
-
readonly sourceItem: "DECIDE-1";
|
|
49
|
-
}, {
|
|
50
|
-
readonly stateId: "askReviewerProposal";
|
|
51
|
-
readonly role: "reviewer";
|
|
52
|
-
readonly sourceItem: "DECIDE-2";
|
|
53
|
-
}, {
|
|
54
|
-
readonly stateId: "commitCoderProposal";
|
|
55
|
-
readonly role: "coder";
|
|
56
|
-
readonly sourceItem: "DECIDE-3";
|
|
57
|
-
}];
|
|
58
|
-
ROLE_STATE_IDS: ReadonlySet<string>;
|
|
59
|
-
VERBATIM_PAYLOAD_FIELDS: ReadonlySet<string>;
|
|
60
|
-
BOSS_INTERRUPT_TARGETS: readonly ["independentProposals"];
|
|
10
|
+
composePlayerPrompt: (input: PlaybookPlayerInput, promptIdentity: XStatePromptIdentity, resuming?: boolean) => string;
|
|
11
|
+
RESUMABLE_STATE_IDS: ReadonlySet<string>;
|
|
61
12
|
UNFINISHED_FINAL_STATE_IDS: ReadonlySet<string>;
|
|
62
|
-
|
|
13
|
+
VERBATIM_PAYLOAD_FIELDS: ReadonlySet<string>;
|
|
63
14
|
};
|
|
15
|
+
declare const createPlaybookRuntime: XStatePlaybookRuntimeFactory<XStatePlaybookRuntimeConstruction<PlaybookRuntimeOptions, PlaybookHostCapabilities>, 3>;
|
|
64
16
|
export default createPlaybookRuntime;
|