@llm4ts/shell 4.16.0 → 4.18.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/flows/lib/debt.js +2 -1
- package/flows/lib/epic-stories.js +23 -5
- package/flows/lib/red-phase.js +2 -1
- package/flows/lib/story-board.js +25 -19
- package/package.json +4 -4
package/flows/lib/debt.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Info } from "@llm4ts/flow/FlowEvents";
|
|
|
7
7
|
import { countNotPlanned } from "@llm4ts/flow/RefineRound";
|
|
8
8
|
import { settingValue } from "@llm4ts/flow/Settings";
|
|
9
9
|
import { lastStoryVerdict } from "@llm4ts/flow/Stories";
|
|
10
|
+
import { testsExcuseOf } from "@llm4ts/flow/StoryPlan";
|
|
10
11
|
import { evidenceSourceFromEnvironment } from "@llm4ts/flow/TestEvidence";
|
|
11
12
|
import { ScriptUsage } from "@llm4ts/runner";
|
|
12
13
|
import { deferringTestsJudge, epicUsage, loadRounds, rubricStoryJudge, unitStateDirs } from "./epic-stories.js";
|
|
@@ -34,7 +35,7 @@ export const testsDebtAfterUnit = (unit, report) => Effect.gen(function* () {
|
|
|
34
35
|
let stories = 0;
|
|
35
36
|
for (const story of unit.plan.stories) {
|
|
36
37
|
const merged = report.stories.some((outcome) => outcome.id === story.id && outcome.status === "done");
|
|
37
|
-
if (!merged || story
|
|
38
|
+
if (!merged || testsExcuseOf(story) !== undefined || paid.has(story.id)) {
|
|
38
39
|
continue;
|
|
39
40
|
}
|
|
40
41
|
const verdict = yield* lastStoryVerdict(unit.files, unit.stateDir, story.id);
|
|
@@ -41,7 +41,7 @@ import { makeLocalBoardSync } from "@llm4ts/flow/BoardSync";
|
|
|
41
41
|
import { estimatedUsageOptionsFromEnv, makeEstimatedUsageMeter } from "@llm4ts/flow/EstimatedUsage";
|
|
42
42
|
import { landEpic } from "@llm4ts/flow/Landing";
|
|
43
43
|
import { deferredPath, implementStoriesFlow } from "@llm4ts/flow/Stories";
|
|
44
|
-
import { validateStoryPlan } from "@llm4ts/flow/StoryPlan";
|
|
44
|
+
import { testsExcuseOf, validateStoryPlan } from "@llm4ts/flow/StoryPlan";
|
|
45
45
|
import { asReadOnly, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runNode, stage } from "@llm4ts/runner";
|
|
46
46
|
import { claude, judgmentConnectorFromEnvironment, pi, seatsFromEnvironment, withSeatSettings } from "@llm4ts/runner/Connectors";
|
|
47
47
|
import { FlowAborted, FlowLlmError, ReviewResult, ScriptUsage, lintCommand } from "@llm4ts/runner";
|
|
@@ -748,7 +748,8 @@ export const storyJsonSchema = {
|
|
|
748
748
|
acceptance: { type: "array", items: { type: "string" } },
|
|
749
749
|
provides: { type: "array", items: { type: "string" } },
|
|
750
750
|
testsChange: { type: "boolean" },
|
|
751
|
-
testsDeferred: { type: "string" }
|
|
751
|
+
testsDeferred: { type: "string" },
|
|
752
|
+
kind: { type: "string", enum: ["foundation"] }
|
|
752
753
|
},
|
|
753
754
|
required: [
|
|
754
755
|
"id",
|
|
@@ -799,6 +800,12 @@ orientation) => [
|
|
|
799
800
|
" cannot host in a test (IBM ACE message flows and ESQL, a mainframe transaction): one",
|
|
800
801
|
" sentence naming that runtime. The judge then does not ask it for tests. Never set it because",
|
|
801
802
|
" tests are hard to write; every other story leaves it out and owns its test files.",
|
|
803
|
+
'- `kind`: "foundation" only for a story that scaffolds the project and holds NO business',
|
|
804
|
+
" logic: build and package files, configuration (YAML, JSON, XML, properties), CI, folder",
|
|
805
|
+
" layout, empty wiring. Its acceptance criteria are what a build shows (the project installs,",
|
|
806
|
+
" compiles, starts; a file exists with a setting). It is not written test-first and is",
|
|
807
|
+
" reviewed lightly, so never set it on a story with behaviour of its own; every other story",
|
|
808
|
+
" leaves it out.",
|
|
802
809
|
"- `owned` sets are pairwise DISJOINT: no path prefix appears under two stories.",
|
|
803
810
|
"- Shared surfaces (the kit, the theme, house rules) are never edited by a feature story. A new",
|
|
804
811
|
" shared component is its own story, and every story using it depends on it.",
|
|
@@ -1040,7 +1047,7 @@ export const judgeSeverity = (name, score) => name === "provides" || score <= 0
|
|
|
1040
1047
|
*/
|
|
1041
1048
|
export const judgedDimensionsOf = (story, bar = {}) => storyDimensions
|
|
1042
1049
|
.map((dimension) => dimension.name)
|
|
1043
|
-
.filter((name) => name !== "tests" || (story
|
|
1050
|
+
.filter((name) => name !== "tests" || (testsExcuseOf(story) === undefined && bar.deferTests !== true));
|
|
1044
1051
|
const maxScoreOf = (name) => storyDimensions.find((dimension) => dimension.name === name)?.maxScore ?? 2;
|
|
1045
1052
|
const subBar = (scored, story, bar) => ReviewResult.make({
|
|
1046
1053
|
issues: scored.scores
|
|
@@ -1060,6 +1067,16 @@ export const testsDeferredLines = (reason) => reason === undefined
|
|
|
1060
1067
|
`Tests deferred by the plan: ${reason}`,
|
|
1061
1068
|
"No test file is expected; do not mark any dimension down for its absence."
|
|
1062
1069
|
];
|
|
1070
|
+
/** What a judge is told about a foundation story (ADR 0061); nothing for any other. */
|
|
1071
|
+
export const foundationLines = (kind) => kind !== "foundation"
|
|
1072
|
+
? []
|
|
1073
|
+
: [
|
|
1074
|
+
"This is a foundation story: it scaffolds and configures the project and holds no business",
|
|
1075
|
+
"logic. Score `provides` on whether what it promised exists and is wired so a build would",
|
|
1076
|
+
"pick it up. Hold configuration and build files (YAML, JSON, XML, properties, lockfiles) to",
|
|
1077
|
+
"being correct and consistent with each other, not to the house rules written for source",
|
|
1078
|
+
"code, and do not ask for abstractions, messages or structure a later story will add."
|
|
1079
|
+
];
|
|
1063
1080
|
/** What a judge is told under `--defer-tests` (ADR 0045): score tests, hold nothing else to them. */
|
|
1064
1081
|
export const deferTestsLines = [
|
|
1065
1082
|
"Tests may be deferred to a later round: score `tests` on what the diff shows,",
|
|
@@ -1095,8 +1112,9 @@ export const storyJudgeQuery = (story, plan, subject = "diff", bar = {}) => {
|
|
|
1095
1112
|
`Provides: ${story.provides.join(", ") || "(none)"}`,
|
|
1096
1113
|
`Owned paths: ${story.owned.join(", ")}`,
|
|
1097
1114
|
`Shared read-only: ${story.sharedReadOnly.join(", ") || "(none)"}`,
|
|
1098
|
-
...testsDeferredLines(story
|
|
1099
|
-
...(story.
|
|
1115
|
+
...testsDeferredLines(testsExcuseOf(story)),
|
|
1116
|
+
...foundationLines(story.kind),
|
|
1117
|
+
...(testsExcuseOf(story) === undefined && bar.deferTests === true ? deferTestsLines : []),
|
|
1100
1118
|
...(dependencies.length === 0
|
|
1101
1119
|
? []
|
|
1102
1120
|
: [
|
package/flows/lib/red-phase.js
CHANGED
|
@@ -10,6 +10,7 @@ import { FlowAborted, StoryFailed } from "@llm4ts/flow/FlowError";
|
|
|
10
10
|
import { CriterionChecked, Info, Parked } from "@llm4ts/flow/FlowEvents";
|
|
11
11
|
import { lintCommand, reviewWith } from "@llm4ts/flow/Review";
|
|
12
12
|
import { Reviewer } from "@llm4ts/flow/Reviewer";
|
|
13
|
+
import { testsExcuseOf } from "@llm4ts/flow/StoryPlan";
|
|
13
14
|
import { commandFor, criterionTags, parseJUnit, statusFromReport, testPaths } from "@llm4ts/flow/TestEvidence";
|
|
14
15
|
import { nodeProcessExecutor } from "@llm4ts/runner";
|
|
15
16
|
// ---- Evidence ---------------------------------------------------------------
|
|
@@ -173,7 +174,7 @@ export const redPhaseOf = (policy, unit) => (story, seats, workDir, system, even
|
|
|
173
174
|
* criteria to test, its plan does not excuse it from tests, and its job is
|
|
174
175
|
* not to rewrite existing tests.
|
|
175
176
|
*/
|
|
176
|
-
export const needsRedPhase = (story) => story.acceptance.length > 0 && story
|
|
177
|
+
export const needsRedPhase = (story) => story.acceptance.length > 0 && testsExcuseOf(story) === undefined && !story.testsChange;
|
|
177
178
|
/**
|
|
178
179
|
* epic-stories' test-first policy (ADR 0053): the red phase for every story
|
|
179
180
|
* that needs one, proved by the test gate, or per criterion when the
|
package/flows/lib/story-board.js
CHANGED
|
@@ -19,8 +19,8 @@ import { FlowLlmError } from "@llm4ts/flow/FlowError";
|
|
|
19
19
|
import { JudgmentObserved, publishJudgmentObserved } from "@llm4ts/flow/FlowEvents";
|
|
20
20
|
import { certaintyOf, Decision, decide, judgmentOf } from "@llm4ts/flow/Judgment";
|
|
21
21
|
import { ReviewIssue, ReviewResult } from "@llm4ts/flow/Review";
|
|
22
|
-
import { dependenciesOf } from "@llm4ts/flow/StoryPlan";
|
|
23
|
-
import { storyDimensions, testsDeferredLines } from "./epic-stories.js";
|
|
22
|
+
import { dependenciesOf, testsExcuseOf } from "@llm4ts/flow/StoryPlan";
|
|
23
|
+
import { storyDimensions, foundationLines, testsDeferredLines } from "./epic-stories.js";
|
|
24
24
|
export class StoryBrief extends Schema.Class("StoryBrief")({
|
|
25
25
|
id: Schema.String,
|
|
26
26
|
title: Schema.String,
|
|
@@ -30,25 +30,30 @@ export class StoryBrief extends Schema.Class("StoryBrief")({
|
|
|
30
30
|
owned: Schema.Array(Schema.String),
|
|
31
31
|
sharedReadOnly: Schema.Array(Schema.String),
|
|
32
32
|
dependencies: Schema.Array(Schema.Struct({ id: Schema.String, provides: Schema.Array(Schema.String) })),
|
|
33
|
-
testsDeferred: Schema.optionalKey(Schema.String)
|
|
33
|
+
testsDeferred: Schema.optionalKey(Schema.String),
|
|
34
|
+
kind: Schema.optionalKey(Schema.Literal("foundation"))
|
|
34
35
|
}) {
|
|
35
36
|
}
|
|
36
|
-
export const storyBriefOf = (story, plan) =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
})
|
|
37
|
+
export const storyBriefOf = (story, plan) => {
|
|
38
|
+
const excuse = testsExcuseOf(story);
|
|
39
|
+
return StoryBrief.make({
|
|
40
|
+
id: story.id,
|
|
41
|
+
title: story.title,
|
|
42
|
+
description: story.description,
|
|
43
|
+
acceptance: story.acceptance,
|
|
44
|
+
provides: story.provides,
|
|
45
|
+
owned: story.owned,
|
|
46
|
+
sharedReadOnly: story.sharedReadOnly,
|
|
47
|
+
dependencies: plan === undefined
|
|
48
|
+
? []
|
|
49
|
+
: dependenciesOf(plan, story.id).flatMap((id) => {
|
|
50
|
+
const dependency = plan.story(id);
|
|
51
|
+
return dependency === undefined ? [] : [{ id, provides: dependency.provides }];
|
|
52
|
+
}),
|
|
53
|
+
...(excuse === undefined ? {} : { testsDeferred: excuse }),
|
|
54
|
+
...(story.kind === undefined ? {} : { kind: story.kind })
|
|
55
|
+
});
|
|
56
|
+
};
|
|
52
57
|
// ---- Facts ------------------------------------------------------------------
|
|
53
58
|
export const storyBrief = makeKey("story.brief", StoryBrief);
|
|
54
59
|
export const storyDiff = makeKey("story.diff", Schema.String);
|
|
@@ -90,6 +95,7 @@ export const stateOf = (brief, diff, rules) => [
|
|
|
90
95
|
`Owned paths: ${brief.owned.join(", ")}`,
|
|
91
96
|
`Shared read-only: ${brief.sharedReadOnly.join(", ") || "(none)"}`,
|
|
92
97
|
...testsDeferredLines(brief.testsDeferred),
|
|
98
|
+
...foundationLines(brief.kind),
|
|
93
99
|
...(brief.dependencies.length === 0
|
|
94
100
|
? []
|
|
95
101
|
: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llm4ts/shell",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"description": "Interactive shell and CLI for llm4ts: flow discovery, run-a-flow, and view",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@effect/platform-node": "4.1.5",
|
|
48
48
|
"@effect/platform-node-shared": "4.1.5",
|
|
49
|
-
"@llm4ts/core": "4.
|
|
50
|
-
"@llm4ts/
|
|
51
|
-
"@llm4ts/
|
|
49
|
+
"@llm4ts/core": "4.18.0",
|
|
50
|
+
"@llm4ts/flow": "4.18.0",
|
|
51
|
+
"@llm4ts/runner": "4.18.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"effect": "4.1.5"
|