@domandigital/craft 0.24.2 → 0.24.3
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/CHANGELOG.md +6 -0
- package/README.md +11 -0
- package/art-direction.schema.json +41 -0
- package/dist/{chunk-ULKNMH7J.js → chunk-BYSFLGK2.js} +3 -3
- package/dist/{chunk-UQ5M2VOR.js → chunk-O5O4P5TL.js} +18 -7
- package/dist/{chunk-WNEB6XC3.js → chunk-QP67OMYY.js} +1 -1
- package/dist/{chunk-2L5EHB4T.js → chunk-T2BTEWW6.js} +2 -2
- package/dist/{chunk-UJOPE6BR.js → chunk-TQTTWANV.js} +9 -9
- package/dist/{cli-IWLNAH53.js → cli-2OWOJNIX.js} +1 -1
- package/dist/{cli-E27L6BTE.js → cli-A7UFMLAV.js} +2 -2
- package/dist/{cli-GFXSHG4E.js → cli-CJJD5KCB.js} +2 -2
- package/dist/{cli-DGF7WWX4.js → cli-QA4LXX6L.js} +2 -2
- package/dist/{cli-WKX6J56Y.js → cli-UKON4D6S.js} +5 -5
- package/dist/{cli-2FZS3P6P.js → cli-YVBNA2TT.js} +4 -4
- package/dist/{cli-PRCDIFCV.js → cli-ZIFKW5FO.js} +3 -3
- package/dist/cli.js +1 -1
- package/dist/index.cjs +18 -7
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +18 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @domandigital/craft
|
|
2
2
|
|
|
3
|
+
## 0.24.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 30eb1c2: Allow an explicitly recorded founder-reviewed hypothesis as a provisional job basis. Require a named reviewer, dated decision, founder source and untested limitations. Keep customer evidence warnings visible and all other direction checks active.
|
|
8
|
+
|
|
3
9
|
## 0.24.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -455,3 +455,14 @@ explicitly marked publication assets while reporting `publicationReady: false`.
|
|
|
455
455
|
See CHARACTER.md, “Context and learning from a later result”.
|
|
456
456
|
|
|
457
457
|
Opening photographs are selected as a rendered sequence: compare their quality and crop before filling a slide count or covering every service. See [Select photographs for their position in the sequence](./CHARACTER.md#select-photographs-for-their-position-in-the-sequence) for the follow-up on one client's opening photographs and its limits.
|
|
458
|
+
|
|
459
|
+
### Explicitly accepted provisional jobs
|
|
460
|
+
|
|
461
|
+
When a human reviewer authorises proceeding without direct customer research,
|
|
462
|
+
`job.evidenceBasis` can record `kind: "founder-reviewed-hypothesis"`, `reviewer`,
|
|
463
|
+
`acceptedAt` (YYYY-MM-DD), a substantive `decision`, a founder `source` ID and
|
|
464
|
+
non-empty `limitations`. The caller must obtain and record that decision; this
|
|
465
|
+
field is not an automatic permission mechanism. The job remains provisional and
|
|
466
|
+
validation always reports its untested limitations. Default customer-voice
|
|
467
|
+
requirements remain unchanged, and source, reason, hierarchy and visual checks
|
|
468
|
+
still apply. Leave `language` empty when there are no actual customer quotes.
|
|
@@ -106,6 +106,47 @@
|
|
|
106
106
|
"items": {
|
|
107
107
|
"type": "string"
|
|
108
108
|
}
|
|
109
|
+
},
|
|
110
|
+
"evidenceBasis": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"additionalProperties": false,
|
|
113
|
+
"required": [
|
|
114
|
+
"kind",
|
|
115
|
+
"reviewer",
|
|
116
|
+
"acceptedAt",
|
|
117
|
+
"decision",
|
|
118
|
+
"source",
|
|
119
|
+
"limitations"
|
|
120
|
+
],
|
|
121
|
+
"properties": {
|
|
122
|
+
"kind": {
|
|
123
|
+
"const": "founder-reviewed-hypothesis"
|
|
124
|
+
},
|
|
125
|
+
"reviewer": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"minLength": 1
|
|
128
|
+
},
|
|
129
|
+
"acceptedAt": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
|
|
132
|
+
},
|
|
133
|
+
"decision": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"minLength": 1
|
|
136
|
+
},
|
|
137
|
+
"source": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"minLength": 1
|
|
140
|
+
},
|
|
141
|
+
"limitations": {
|
|
142
|
+
"type": "array",
|
|
143
|
+
"minItems": 1,
|
|
144
|
+
"items": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"minLength": 1
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
109
150
|
}
|
|
110
151
|
},
|
|
111
152
|
"additionalProperties": false,
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
formatDirectionMatches,
|
|
5
5
|
summariseDirection,
|
|
6
6
|
validateDirection
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-O5O4P5TL.js";
|
|
8
8
|
import {
|
|
9
9
|
loadNull
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QP67OMYY.js";
|
|
11
11
|
import {
|
|
12
12
|
parseFlags
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TQTTWANV.js";
|
|
14
14
|
import {
|
|
15
15
|
toJson
|
|
16
16
|
} from "./chunk-QIEDBL4J.js";
|
|
@@ -565,7 +565,18 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
565
565
|
return { problems, decided: false };
|
|
566
566
|
}
|
|
567
567
|
const j = job;
|
|
568
|
-
const
|
|
568
|
+
const sourcesById = new Map(sources.map((s) => [s.id, s]));
|
|
569
|
+
let provisional = false;
|
|
570
|
+
if (j.evidenceBasis !== void 0) {
|
|
571
|
+
const b = j.evidenceBasis;
|
|
572
|
+
const decisionSource = b && typeof b === "object" ? sourcesById.get(b.source) : void 0;
|
|
573
|
+
if (!b || b.kind !== "founder-reviewed-hypothesis" || typeof b.reviewer !== "string" || !b.reviewer.trim() || typeof b.acceptedAt !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(b.acceptedAt) || !Number.isFinite(Date.parse(b.acceptedAt)) || typeof b.decision !== "string" || words(b.decision).length < 8 || !decisionSource || decisionSource.kind !== "founder" || !Array.isArray(b.limitations) || !b.limitations.length || b.limitations.some((x) => typeof x !== "string" || words(x).length < 3)) {
|
|
574
|
+
err(".evidenceBasis", "a provisional job needs a named reviewer, dated decision, founder source and explicit untested limitations");
|
|
575
|
+
} else {
|
|
576
|
+
provisional = true;
|
|
577
|
+
warn(".evidenceBasis", `Provisional hypotheses accepted by ${b.reviewer} on ${b.acceptedAt}; customer research remains untested: ${b.limitations.join("; ")}`);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
569
580
|
const st = j.statement;
|
|
570
581
|
if (!st || typeof st !== "object") err(".statement", "a job statement is verb, object and context");
|
|
571
582
|
else {
|
|
@@ -585,13 +596,13 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
585
596
|
continue;
|
|
586
597
|
}
|
|
587
598
|
if (typeof p.value !== "string" || words(p.value).length < 6) err(`.${part}.value`, "a sentence: what they need, in the terms they would use");
|
|
588
|
-
else problems.push(...checkReason({ at: `job.${part}`, because: p.value, evidence: p.evidence, sources, tie: "customer" }).map((x) => ({ ...x, at: x.at.replace(/\.because$/, ".value") })));
|
|
599
|
+
else problems.push(...checkReason({ at: `job.${part}`, because: p.value, evidence: p.evidence, sources, tie: provisional ? "source" : "customer" }).map((x) => ({ ...x, at: x.at.replace(/\.because$/, ".value") })));
|
|
589
600
|
}
|
|
590
601
|
const c = j.consideration;
|
|
591
602
|
if (!c || typeof c !== "object") err(".consideration", `how long and how carefully they decide: ${CONSIDERATION.join(", ")}`);
|
|
592
603
|
else {
|
|
593
604
|
if (!CONSIDERATION.includes(c.value)) err(".consideration.value", `one of ${CONSIDERATION.join(", ")}`);
|
|
594
|
-
problems.push(...checkReason({ at: "job.consideration", because: c.because, evidence: c.evidence, sources, tie: "customer" }));
|
|
605
|
+
problems.push(...checkReason({ at: "job.consideration", because: c.because, evidence: c.evidence, sources, tie: provisional ? "source" : "customer" }));
|
|
595
606
|
}
|
|
596
607
|
const objections = Array.isArray(j.objections) ? j.objections : [];
|
|
597
608
|
if (objections.length === 0) err(".objections", "what stops them: the worries they bring to the page");
|
|
@@ -599,11 +610,11 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
599
610
|
if (typeof o !== "string" || words(o).length < 3) err(`.objections[${i}]`, "an objection is a few words: what they worry about");
|
|
600
611
|
});
|
|
601
612
|
const evidence = Array.isArray(j.evidence) ? j.evidence : [];
|
|
602
|
-
const voice = evidence.map((id) =>
|
|
603
|
-
if (evidence.length === 0 || voice.length === 0) err(".evidence", "cite the reviews, enquiries or conversations the job comes from");
|
|
604
|
-
for (const id of evidence) if (!
|
|
613
|
+
const voice = evidence.map((id) => sourcesById.get(id)).filter(isCustomerVoice);
|
|
614
|
+
if (evidence.length === 0 || !provisional && voice.length === 0) err(".evidence", "cite the reviews, enquiries or conversations the job comes from");
|
|
615
|
+
for (const id of evidence) if (!sourcesById.has(id)) err(".evidence", `no source called "${id}"`);
|
|
605
616
|
const language = Array.isArray(j.language) ? j.language : [];
|
|
606
|
-
if (language.length === 0) err(".language", "quote the customer: the words they use for the problem");
|
|
617
|
+
if (!provisional && language.length === 0) err(".language", "quote the customer: the words they use for the problem");
|
|
607
618
|
const texts = voice.map((s) => normalise(`${s.note} ${ctx.readSource?.(s) ?? ""}`));
|
|
608
619
|
language.forEach((q, i) => {
|
|
609
620
|
if (typeof q !== "string" || !q.trim()) return err(`.language[${i}]`, "an empty quote");
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
describeTypicality,
|
|
7
7
|
loadNull
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QP67OMYY.js";
|
|
9
9
|
import {
|
|
10
10
|
SOURCE_FILE,
|
|
11
11
|
finish,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
parseFlags,
|
|
15
15
|
prepareReport,
|
|
16
16
|
readPaths
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TQTTWANV.js";
|
|
18
18
|
import {
|
|
19
19
|
toJson
|
|
20
20
|
} from "./chunk-QIEDBL4J.js";
|
|
@@ -633,7 +633,7 @@ async function briefFor(flags, cwd) {
|
|
|
633
633
|
if (typeof brief === "string" && brief.trim()) return brief;
|
|
634
634
|
} else if (flags.direction) throw new Error(`no such file: ${flags.direction}`);
|
|
635
635
|
if (flags.null) {
|
|
636
|
-
const { loadNull } = await import("./cli-
|
|
636
|
+
const { loadNull } = await import("./cli-A7UFMLAV.js");
|
|
637
637
|
return loadNull(flags.null, cwd).brief;
|
|
638
638
|
}
|
|
639
639
|
return void 0;
|
|
@@ -659,37 +659,37 @@ async function compareWithCompetitor(flags, io) {
|
|
|
659
659
|
function run(argv, io) {
|
|
660
660
|
const [command, ...rest] = argv;
|
|
661
661
|
if (command === "direction") {
|
|
662
|
-
return import("./cli-
|
|
662
|
+
return import("./cli-CJJD5KCB.js").then((m) => m.runDirection(rest, io));
|
|
663
663
|
}
|
|
664
664
|
if (command === "report" || command === "retrofit") {
|
|
665
|
-
return import("./cli-
|
|
665
|
+
return import("./cli-UKON4D6S.js").then((m) => m.runReport(command, rest, io));
|
|
666
666
|
}
|
|
667
667
|
if (command === "register") {
|
|
668
668
|
return import("./cli-TDTCURZS.js").then((m) => m.runRegister(rest, io));
|
|
669
669
|
}
|
|
670
670
|
if (command === "estate") {
|
|
671
|
-
return import("./cli-
|
|
671
|
+
return import("./cli-YVBNA2TT.js").then((m) => m.runEstate(rest, io));
|
|
672
672
|
}
|
|
673
673
|
if (command === "null") {
|
|
674
|
-
return import("./cli-
|
|
674
|
+
return import("./cli-A7UFMLAV.js").then((m) => m.runNull(rest, io));
|
|
675
675
|
}
|
|
676
676
|
if (command === "calibrate") {
|
|
677
|
-
return import("./cli-
|
|
677
|
+
return import("./cli-QA4LXX6L.js").then((m) => m.runCalibrate(rest, io));
|
|
678
678
|
}
|
|
679
679
|
if (command === "tells" && rest[0] === "harvest") {
|
|
680
|
-
return import("./cli-
|
|
680
|
+
return import("./cli-A7UFMLAV.js").then((m) => m.runHarvest(rest, io)).catch((error) => {
|
|
681
681
|
io.err(`craft: ${error.message}`);
|
|
682
682
|
return 2;
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
685
|
if (command === "phone-first") {
|
|
686
|
-
return import("./cli-
|
|
686
|
+
return import("./cli-2OWOJNIX.js").then((m) => m.runPhoneFirst(rest, io));
|
|
687
687
|
}
|
|
688
688
|
if (command === "viewports") {
|
|
689
689
|
return import("./viewports-cli-5UMLK7I7.js").then((m) => m.runViewports(rest, io));
|
|
690
690
|
}
|
|
691
691
|
if (command === "snapshot" || command === "audit") {
|
|
692
|
-
return import("./cli-
|
|
692
|
+
return import("./cli-ZIFKW5FO.js").then((m) => m.runAudit(command, rest, io));
|
|
693
693
|
}
|
|
694
694
|
if (!command || command === "help" || command === "--help" || command === "-h") {
|
|
695
695
|
io.out(HELP);
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
runHarvest,
|
|
10
10
|
runNull,
|
|
11
11
|
serveDir
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QP67OMYY.js";
|
|
13
13
|
import "./chunk-OQXTQQAU.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-TQTTWANV.js";
|
|
15
15
|
import "./chunk-QIEDBL4J.js";
|
|
16
16
|
import "./chunk-WUACK2HX.js";
|
|
17
17
|
import "./chunk-LYQKEC7Q.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
checkReason,
|
|
20
20
|
researchPrompt,
|
|
21
21
|
validateDirection
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-O5O4P5TL.js";
|
|
23
23
|
import {
|
|
24
24
|
parseFlags
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-TQTTWANV.js";
|
|
26
26
|
import {
|
|
27
27
|
toJson
|
|
28
28
|
} from "./chunk-QIEDBL4J.js";
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
expandNullTargets,
|
|
6
6
|
loadNull
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QP67OMYY.js";
|
|
8
8
|
import "./chunk-OQXTQQAU.js";
|
|
9
9
|
import {
|
|
10
10
|
parseFlags
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TQTTWANV.js";
|
|
12
12
|
import {
|
|
13
13
|
toJson
|
|
14
14
|
} from "./chunk-QIEDBL4J.js";
|
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
} from "./chunk-OKVHWXYV.js";
|
|
4
4
|
import {
|
|
5
5
|
merge
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-T2BTEWW6.js";
|
|
7
7
|
import "./chunk-5UFG75N4.js";
|
|
8
8
|
import "./chunk-JYNXGCYZ.js";
|
|
9
9
|
import {
|
|
10
10
|
SIBLING_AT,
|
|
11
11
|
compareToEstate,
|
|
12
12
|
loadEstate
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BYSFLGK2.js";
|
|
14
14
|
import {
|
|
15
15
|
PAGE_TYPES,
|
|
16
16
|
validateDirection
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-O5O4P5TL.js";
|
|
18
18
|
import {
|
|
19
19
|
loadNull
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QP67OMYY.js";
|
|
21
21
|
import "./chunk-OQXTQQAU.js";
|
|
22
22
|
import {
|
|
23
23
|
COPY_FILE,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
loadExceptions,
|
|
29
29
|
parseFlags,
|
|
30
30
|
readPaths
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TQTTWANV.js";
|
|
32
32
|
import {
|
|
33
33
|
toJson
|
|
34
34
|
} from "./chunk-QIEDBL4J.js";
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
formatPairs,
|
|
5
5
|
loadEstate,
|
|
6
6
|
runEstate
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-BYSFLGK2.js";
|
|
8
|
+
import "./chunk-O5O4P5TL.js";
|
|
9
|
+
import "./chunk-QP67OMYY.js";
|
|
10
10
|
import "./chunk-OQXTQQAU.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-TQTTWANV.js";
|
|
12
12
|
import "./chunk-QIEDBL4J.js";
|
|
13
13
|
import "./chunk-WUACK2HX.js";
|
|
14
14
|
import "./chunk-LYQKEC7Q.js";
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
merge,
|
|
5
5
|
resolvePages,
|
|
6
6
|
runAudit
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-T2BTEWW6.js";
|
|
8
8
|
import "./chunk-5UFG75N4.js";
|
|
9
9
|
import "./chunk-JYNXGCYZ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-QP67OMYY.js";
|
|
11
11
|
import "./chunk-OQXTQQAU.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-TQTTWANV.js";
|
|
13
13
|
import "./chunk-QIEDBL4J.js";
|
|
14
14
|
import "./chunk-WUACK2HX.js";
|
|
15
15
|
import "./chunk-LYQKEC7Q.js";
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -9252,7 +9252,18 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
9252
9252
|
return { problems, decided: false };
|
|
9253
9253
|
}
|
|
9254
9254
|
const j = job;
|
|
9255
|
-
const
|
|
9255
|
+
const sourcesById = new Map(sources.map((s) => [s.id, s]));
|
|
9256
|
+
let provisional = false;
|
|
9257
|
+
if (j.evidenceBasis !== void 0) {
|
|
9258
|
+
const b = j.evidenceBasis;
|
|
9259
|
+
const decisionSource = b && typeof b === "object" ? sourcesById.get(b.source) : void 0;
|
|
9260
|
+
if (!b || b.kind !== "founder-reviewed-hypothesis" || typeof b.reviewer !== "string" || !b.reviewer.trim() || typeof b.acceptedAt !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(b.acceptedAt) || !Number.isFinite(Date.parse(b.acceptedAt)) || typeof b.decision !== "string" || words2(b.decision).length < 8 || !decisionSource || decisionSource.kind !== "founder" || !Array.isArray(b.limitations) || !b.limitations.length || b.limitations.some((x) => typeof x !== "string" || words2(x).length < 3)) {
|
|
9261
|
+
err(".evidenceBasis", "a provisional job needs a named reviewer, dated decision, founder source and explicit untested limitations");
|
|
9262
|
+
} else {
|
|
9263
|
+
provisional = true;
|
|
9264
|
+
warn(".evidenceBasis", `Provisional hypotheses accepted by ${b.reviewer} on ${b.acceptedAt}; customer research remains untested: ${b.limitations.join("; ")}`);
|
|
9265
|
+
}
|
|
9266
|
+
}
|
|
9256
9267
|
const st = j.statement;
|
|
9257
9268
|
if (!st || typeof st !== "object") err(".statement", "a job statement is verb, object and context");
|
|
9258
9269
|
else {
|
|
@@ -9272,13 +9283,13 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
9272
9283
|
continue;
|
|
9273
9284
|
}
|
|
9274
9285
|
if (typeof p.value !== "string" || words2(p.value).length < 6) err(`.${part}.value`, "a sentence: what they need, in the terms they would use");
|
|
9275
|
-
else problems.push(...checkReason({ at: `job.${part}`, because: p.value, evidence: p.evidence, sources, tie: "customer" }).map((x) => ({ ...x, at: x.at.replace(/\.because$/, ".value") })));
|
|
9286
|
+
else problems.push(...checkReason({ at: `job.${part}`, because: p.value, evidence: p.evidence, sources, tie: provisional ? "source" : "customer" }).map((x) => ({ ...x, at: x.at.replace(/\.because$/, ".value") })));
|
|
9276
9287
|
}
|
|
9277
9288
|
const c = j.consideration;
|
|
9278
9289
|
if (!c || typeof c !== "object") err(".consideration", `how long and how carefully they decide: ${CONSIDERATION.join(", ")}`);
|
|
9279
9290
|
else {
|
|
9280
9291
|
if (!CONSIDERATION.includes(c.value)) err(".consideration.value", `one of ${CONSIDERATION.join(", ")}`);
|
|
9281
|
-
problems.push(...checkReason({ at: "job.consideration", because: c.because, evidence: c.evidence, sources, tie: "customer" }));
|
|
9292
|
+
problems.push(...checkReason({ at: "job.consideration", because: c.because, evidence: c.evidence, sources, tie: provisional ? "source" : "customer" }));
|
|
9282
9293
|
}
|
|
9283
9294
|
const objections = Array.isArray(j.objections) ? j.objections : [];
|
|
9284
9295
|
if (objections.length === 0) err(".objections", "what stops them: the worries they bring to the page");
|
|
@@ -9286,11 +9297,11 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
9286
9297
|
if (typeof o !== "string" || words2(o).length < 3) err(`.objections[${i}]`, "an objection is a few words: what they worry about");
|
|
9287
9298
|
});
|
|
9288
9299
|
const evidence = Array.isArray(j.evidence) ? j.evidence : [];
|
|
9289
|
-
const voice = evidence.map((id) =>
|
|
9290
|
-
if (evidence.length === 0 || voice.length === 0) err(".evidence", "cite the reviews, enquiries or conversations the job comes from");
|
|
9291
|
-
for (const id of evidence) if (!
|
|
9300
|
+
const voice = evidence.map((id) => sourcesById.get(id)).filter(isCustomerVoice);
|
|
9301
|
+
if (evidence.length === 0 || !provisional && voice.length === 0) err(".evidence", "cite the reviews, enquiries or conversations the job comes from");
|
|
9302
|
+
for (const id of evidence) if (!sourcesById.has(id)) err(".evidence", `no source called "${id}"`);
|
|
9292
9303
|
const language = Array.isArray(j.language) ? j.language : [];
|
|
9293
|
-
if (language.length === 0) err(".language", "quote the customer: the words they use for the problem");
|
|
9304
|
+
if (!provisional && language.length === 0) err(".language", "quote the customer: the words they use for the problem");
|
|
9294
9305
|
const texts = voice.map((s) => normalise2(`${s.note} ${ctx.readSource?.(s) ?? ""}`));
|
|
9295
9306
|
language.forEach((q, i) => {
|
|
9296
9307
|
if (typeof q !== "string" || !q.trim()) return err(`.language[${i}]`, "an empty quote");
|
package/dist/index.d.cts
CHANGED
|
@@ -2482,6 +2482,15 @@ type Consideration = (typeof CONSIDERATION)[number];
|
|
|
2482
2482
|
* trade do" as the starting point.
|
|
2483
2483
|
*/
|
|
2484
2484
|
interface JobMap {
|
|
2485
|
+
/** Explicit human acceptance of provisional hypotheses; never customer validation. */
|
|
2486
|
+
evidenceBasis?: {
|
|
2487
|
+
kind: "founder-reviewed-hypothesis";
|
|
2488
|
+
reviewer: string;
|
|
2489
|
+
acceptedAt: string;
|
|
2490
|
+
decision: string;
|
|
2491
|
+
source: string;
|
|
2492
|
+
limitations: string[];
|
|
2493
|
+
};
|
|
2485
2494
|
/** Verb + object + context: "find" / "an electrician they can trust with a dangerous fault" / "today, without being overcharged". */
|
|
2486
2495
|
statement: {
|
|
2487
2496
|
verb: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -2482,6 +2482,15 @@ type Consideration = (typeof CONSIDERATION)[number];
|
|
|
2482
2482
|
* trade do" as the starting point.
|
|
2483
2483
|
*/
|
|
2484
2484
|
interface JobMap {
|
|
2485
|
+
/** Explicit human acceptance of provisional hypotheses; never customer validation. */
|
|
2486
|
+
evidenceBasis?: {
|
|
2487
|
+
kind: "founder-reviewed-hypothesis";
|
|
2488
|
+
reviewer: string;
|
|
2489
|
+
acceptedAt: string;
|
|
2490
|
+
decision: string;
|
|
2491
|
+
source: string;
|
|
2492
|
+
limitations: string[];
|
|
2493
|
+
};
|
|
2485
2494
|
/** Verb + object + context: "find" / "an electrician they can trust with a dangerous fault" / "today, without being overcharged". */
|
|
2486
2495
|
statement: {
|
|
2487
2496
|
verb: string;
|
package/dist/index.js
CHANGED
|
@@ -8933,7 +8933,18 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
8933
8933
|
return { problems, decided: false };
|
|
8934
8934
|
}
|
|
8935
8935
|
const j = job;
|
|
8936
|
-
const
|
|
8936
|
+
const sourcesById = new Map(sources.map((s) => [s.id, s]));
|
|
8937
|
+
let provisional = false;
|
|
8938
|
+
if (j.evidenceBasis !== void 0) {
|
|
8939
|
+
const b = j.evidenceBasis;
|
|
8940
|
+
const decisionSource = b && typeof b === "object" ? sourcesById.get(b.source) : void 0;
|
|
8941
|
+
if (!b || b.kind !== "founder-reviewed-hypothesis" || typeof b.reviewer !== "string" || !b.reviewer.trim() || typeof b.acceptedAt !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(b.acceptedAt) || !Number.isFinite(Date.parse(b.acceptedAt)) || typeof b.decision !== "string" || words2(b.decision).length < 8 || !decisionSource || decisionSource.kind !== "founder" || !Array.isArray(b.limitations) || !b.limitations.length || b.limitations.some((x) => typeof x !== "string" || words2(x).length < 3)) {
|
|
8942
|
+
err(".evidenceBasis", "a provisional job needs a named reviewer, dated decision, founder source and explicit untested limitations");
|
|
8943
|
+
} else {
|
|
8944
|
+
provisional = true;
|
|
8945
|
+
warn(".evidenceBasis", `Provisional hypotheses accepted by ${b.reviewer} on ${b.acceptedAt}; customer research remains untested: ${b.limitations.join("; ")}`);
|
|
8946
|
+
}
|
|
8947
|
+
}
|
|
8937
8948
|
const st = j.statement;
|
|
8938
8949
|
if (!st || typeof st !== "object") err(".statement", "a job statement is verb, object and context");
|
|
8939
8950
|
else {
|
|
@@ -8953,13 +8964,13 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
8953
8964
|
continue;
|
|
8954
8965
|
}
|
|
8955
8966
|
if (typeof p.value !== "string" || words2(p.value).length < 6) err(`.${part}.value`, "a sentence: what they need, in the terms they would use");
|
|
8956
|
-
else problems.push(...checkReason({ at: `job.${part}`, because: p.value, evidence: p.evidence, sources, tie: "customer" }).map((x) => ({ ...x, at: x.at.replace(/\.because$/, ".value") })));
|
|
8967
|
+
else problems.push(...checkReason({ at: `job.${part}`, because: p.value, evidence: p.evidence, sources, tie: provisional ? "source" : "customer" }).map((x) => ({ ...x, at: x.at.replace(/\.because$/, ".value") })));
|
|
8957
8968
|
}
|
|
8958
8969
|
const c = j.consideration;
|
|
8959
8970
|
if (!c || typeof c !== "object") err(".consideration", `how long and how carefully they decide: ${CONSIDERATION.join(", ")}`);
|
|
8960
8971
|
else {
|
|
8961
8972
|
if (!CONSIDERATION.includes(c.value)) err(".consideration.value", `one of ${CONSIDERATION.join(", ")}`);
|
|
8962
|
-
problems.push(...checkReason({ at: "job.consideration", because: c.because, evidence: c.evidence, sources, tie: "customer" }));
|
|
8973
|
+
problems.push(...checkReason({ at: "job.consideration", because: c.because, evidence: c.evidence, sources, tie: provisional ? "source" : "customer" }));
|
|
8963
8974
|
}
|
|
8964
8975
|
const objections = Array.isArray(j.objections) ? j.objections : [];
|
|
8965
8976
|
if (objections.length === 0) err(".objections", "what stops them: the worries they bring to the page");
|
|
@@ -8967,11 +8978,11 @@ function validateJob(job, sources, ctx = {}) {
|
|
|
8967
8978
|
if (typeof o !== "string" || words2(o).length < 3) err(`.objections[${i}]`, "an objection is a few words: what they worry about");
|
|
8968
8979
|
});
|
|
8969
8980
|
const evidence = Array.isArray(j.evidence) ? j.evidence : [];
|
|
8970
|
-
const voice = evidence.map((id) =>
|
|
8971
|
-
if (evidence.length === 0 || voice.length === 0) err(".evidence", "cite the reviews, enquiries or conversations the job comes from");
|
|
8972
|
-
for (const id of evidence) if (!
|
|
8981
|
+
const voice = evidence.map((id) => sourcesById.get(id)).filter(isCustomerVoice);
|
|
8982
|
+
if (evidence.length === 0 || !provisional && voice.length === 0) err(".evidence", "cite the reviews, enquiries or conversations the job comes from");
|
|
8983
|
+
for (const id of evidence) if (!sourcesById.has(id)) err(".evidence", `no source called "${id}"`);
|
|
8973
8984
|
const language = Array.isArray(j.language) ? j.language : [];
|
|
8974
|
-
if (language.length === 0) err(".language", "quote the customer: the words they use for the problem");
|
|
8985
|
+
if (!provisional && language.length === 0) err(".language", "quote the customer: the words they use for the problem");
|
|
8975
8986
|
const texts = voice.map((s) => normalise2(`${s.note} ${ctx.readSource?.(s) ?? ""}`));
|
|
8976
8987
|
language.forEach((q, i) => {
|
|
8977
8988
|
if (typeof q !== "string" || !q.trim()) return err(`.language[${i}]`, "an empty quote");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domandigital/craft",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Doman Digital house craft standard as numbers: OKLCh colour ramps that snap to existing anchors, derived semantic tokens with measured WCAG and APCA contrast, one shared motion vocabulary for CSS and JS, and a base stylesheet. Zero dependencies.",
|
|
6
6
|
"license": "Apache-2.0",
|