@x12i/made-easy 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +57 -2
- package/dist/analysis.d.ts +19 -0
- package/dist/analysis.d.ts.map +1 -0
- package/dist/analysis.js +90 -0
- package/dist/analysis.js.map +1 -0
- package/dist/build.d.ts +36 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +260 -0
- package/dist/build.js.map +1 -0
- package/dist/contracts/api.d.ts +447 -0
- package/dist/contracts/api.d.ts.map +1 -0
- package/dist/contracts/api.js +152 -0
- package/dist/contracts/api.js.map +1 -0
- package/dist/contracts/blocks.d.ts +221 -0
- package/dist/contracts/blocks.d.ts.map +1 -0
- package/dist/contracts/blocks.js +392 -0
- package/dist/contracts/blocks.js.map +1 -0
- package/dist/contracts/diagnostics.d.ts +111 -0
- package/dist/contracts/diagnostics.d.ts.map +1 -0
- package/dist/contracts/diagnostics.js +122 -0
- package/dist/contracts/diagnostics.js.map +1 -0
- package/dist/contracts/index.d.ts +11 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +11 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/json-schema.d.ts +5 -0
- package/dist/contracts/json-schema.d.ts.map +1 -0
- package/dist/contracts/json-schema.js +41 -0
- package/dist/contracts/json-schema.js.map +1 -0
- package/dist/contracts/recipe.d.ts +535 -0
- package/dist/contracts/recipe.d.ts.map +1 -0
- package/dist/contracts/recipe.js +380 -0
- package/dist/contracts/recipe.js.map +1 -0
- package/dist/contracts/schemas.d.ts +413 -0
- package/dist/contracts/schemas.d.ts.map +1 -0
- package/dist/contracts/schemas.js +205 -0
- package/dist/contracts/schemas.js.map +1 -0
- package/dist/draft.d.ts +157 -0
- package/dist/draft.d.ts.map +1 -0
- package/dist/draft.js +254 -0
- package/dist/draft.js.map +1 -0
- package/dist/emit-assets.d.ts +2 -0
- package/dist/emit-assets.d.ts.map +1 -0
- package/dist/emit-assets.js +27 -0
- package/dist/emit-assets.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown-doc.d.ts +59 -0
- package/dist/markdown-doc.d.ts.map +1 -0
- package/dist/markdown-doc.js +187 -0
- package/dist/markdown-doc.js.map +1 -0
- package/dist/model.d.ts +54 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +244 -0
- package/dist/model.js.map +1 -0
- package/dist/normalize.d.ts +63 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/normalize.js +54 -0
- package/dist/normalize.js.map +1 -0
- package/dist/npm.d.ts +24 -0
- package/dist/npm.d.ts.map +1 -0
- package/dist/npm.js +51 -0
- package/dist/npm.js.map +1 -0
- package/dist/render/blocks.d.ts +17 -0
- package/dist/render/blocks.d.ts.map +1 -0
- package/dist/render/blocks.js +384 -0
- package/dist/render/blocks.js.map +1 -0
- package/dist/render/brief.d.ts +77 -0
- package/dist/render/brief.d.ts.map +1 -0
- package/dist/render/brief.js +62 -0
- package/dist/render/brief.js.map +1 -0
- package/dist/render/context.d.ts +43 -0
- package/dist/render/context.d.ts.map +1 -0
- package/dist/render/context.js +88 -0
- package/dist/render/context.js.map +1 -0
- package/dist/render/html.d.ts +19 -0
- package/dist/render/html.d.ts.map +1 -0
- package/dist/render/html.js +178 -0
- package/dist/render/html.js.map +1 -0
- package/dist/render/markdown-out.d.ts +11 -0
- package/dist/render/markdown-out.d.ts.map +1 -0
- package/dist/render/markdown-out.js +121 -0
- package/dist/render/markdown-out.js.map +1 -0
- package/dist/render/pdf.d.ts +23 -0
- package/dist/render/pdf.d.ts.map +1 -0
- package/dist/render/pdf.js +138 -0
- package/dist/render/pdf.js.map +1 -0
- package/dist/render/prose.d.ts +15 -0
- package/dist/render/prose.d.ts.map +1 -0
- package/dist/render/prose.js +110 -0
- package/dist/render/prose.js.map +1 -0
- package/dist/scaffold.d.ts +13 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +393 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/sdk.d.ts +56 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +238 -0
- package/dist/sdk.js.map +1 -0
- package/dist/source.d.ts +57 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +289 -0
- package/dist/source.js.map +1 -0
- package/dist/theme/book.d.ts +10 -0
- package/dist/theme/book.d.ts.map +1 -0
- package/dist/theme/book.js +198 -0
- package/dist/theme/book.js.map +1 -0
- package/dist/util.d.ts +14 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +69 -0
- package/dist/util.js.map +1 -0
- package/dist/validate.d.ts +36 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +986 -0
- package/dist/validate.js.map +1 -0
- package/dist/verify.d.ts +35 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +112 -0
- package/dist/verify.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/dist/yamlfile.d.ts +22 -0
- package/dist/yamlfile.d.ts.map +1 -0
- package/dist/yamlfile.js +129 -0
- package/dist/yamlfile.js.map +1 -0
- package/package.json +64 -4
- package/recipes/index.json +282 -0
- package/recipes/shared-1.0.0.json +456 -0
- package/schemas/artifact.v1.json +36 -0
- package/schemas/assets.v1.json +61 -0
- package/schemas/block.v1.json +27 -0
- package/schemas/blocks/brief.v1.json +20 -0
- package/schemas/blocks/callout.v1.json +25 -0
- package/schemas/blocks/code.v1.json +21 -0
- package/schemas/blocks/decision.v1.json +80 -0
- package/schemas/blocks/evidence-comparison.v1.json +33 -0
- package/schemas/blocks/example.v1.json +52 -0
- package/schemas/blocks/figure.v1.json +22 -0
- package/schemas/blocks/human-action.v1.json +42 -0
- package/schemas/blocks/job-map.v1.json +170 -0
- package/schemas/blocks/pause.v1.json +25 -0
- package/schemas/blocks/reference-profile.v1.json +41 -0
- package/schemas/blocks/review-checklist.v1.json +19 -0
- package/schemas/blocks/table.v1.json +59 -0
- package/schemas/brief.v1.json +157 -0
- package/schemas/build-request.v1.json +173 -0
- package/schemas/build-result.v1.json +171 -0
- package/schemas/checks.v1.json +149 -0
- package/schemas/create-request.v1.json +47 -0
- package/schemas/diagnostic.v1.json +50 -0
- package/schemas/draft-request.v1.json +196 -0
- package/schemas/guide.v1.json +172 -0
- package/schemas/job.v1.json +107 -0
- package/schemas/preview-request.v1.json +153 -0
- package/schemas/preview-result.v1.json +84 -0
- package/schemas/problem.v1.json +78 -0
- package/schemas/recipe-definition.v1.json +673 -0
- package/schemas/source-ref.v1.json +111 -0
- package/schemas/sources.v1.json +158 -0
- package/schemas/validate-request.v1.json +135 -0
- package/schemas/validate-result.v1.json +110 -0
- package/schemas/verification.v1.json +77 -0
- package/themes/book/1.0.0/theme.css +190 -0
- package/themes/book/1.0.0/theme.json +5 -0
package/dist/scaffold.js
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { stringify } from 'yaml';
|
|
2
|
+
import { CreateGuideRequestSchema, MadeEasyError, SCHEMA_VERSION, getGuideRecipe, } from './contracts/index.js';
|
|
3
|
+
import { normalizeText, sha256Digest, slugify } from './util.js';
|
|
4
|
+
import { memorySource } from './source.js';
|
|
5
|
+
import { readGuide } from './model.js';
|
|
6
|
+
import { BOOK_THEME } from './theme/book.js';
|
|
7
|
+
const todo = (text) => `[[TODO: ${text}]]`;
|
|
8
|
+
const yml = (value) => stringify(value, { lineWidth: 0 }).trimEnd();
|
|
9
|
+
function block(id, type, props) {
|
|
10
|
+
return `\`\`\`made-easy\n${yml({ id, type, props })}\n\`\`\``;
|
|
11
|
+
}
|
|
12
|
+
/** Stock text plus a TODO guidance paragraph (counts toward the preset's word minimum, blocks release). */
|
|
13
|
+
function prose(c, stock, guidance, expanded) {
|
|
14
|
+
return `${stock}\n\n${todo(guidance)}${c.handbook ? `\n\n${todo(expanded)}` : ''}`;
|
|
15
|
+
}
|
|
16
|
+
function humanFiles(c) {
|
|
17
|
+
const s = c.subject;
|
|
18
|
+
const hb = c.handbook;
|
|
19
|
+
const opt = (id, kind, label, decidedBy, consequence, evidence) => ({
|
|
20
|
+
id,
|
|
21
|
+
kind,
|
|
22
|
+
label,
|
|
23
|
+
decidedBy,
|
|
24
|
+
consequence,
|
|
25
|
+
evidence,
|
|
26
|
+
});
|
|
27
|
+
const files = {};
|
|
28
|
+
files['human/01-decision.md'] = `# The decision {#decision}
|
|
29
|
+
|
|
30
|
+
${prose(c, `This guide makes one job easy: **${s}**. One person owns the decision at the end; an operator does the work in between.`, 'State the one concrete job in a sentence a stranger could repeat. Name the question the reader must be able to answer when the job is done, the person who owns that decision, and the specific facts the decision depends on. Keep it to one job: if two jobs appear, split the guide.', 'Add the situations in which this decision is made, the cost of deciding late or wrongly, and what the reader should do when the question cannot be answered yet. Explain the options the owner really has and why each one exists.')}
|
|
31
|
+
|
|
32
|
+
${block('decision-main', 'decision', {
|
|
33
|
+
job: todo(`the one concrete job: ${s}`),
|
|
34
|
+
question: todo('the question this decision answers'),
|
|
35
|
+
owner: todo('who owns the decision'),
|
|
36
|
+
dependsOn: [todo('the first fact the decision depends on'), todo('the second fact the decision depends on')],
|
|
37
|
+
...(hb
|
|
38
|
+
? {
|
|
39
|
+
options: [
|
|
40
|
+
{ id: 'proceed', label: todo('proceed on the evidence'), consequence: todo('what changes if the owner proceeds') },
|
|
41
|
+
{ id: 'hold', label: todo('hold until more is known'), consequence: todo('what the delay costs') },
|
|
42
|
+
],
|
|
43
|
+
}
|
|
44
|
+
: {}),
|
|
45
|
+
})}
|
|
46
|
+
`;
|
|
47
|
+
files['human/02-working-model.md'] = `# How the job works {#working-model}
|
|
48
|
+
|
|
49
|
+
${prose(c, 'The operator works through a short sequence of stages. Each stage takes inputs, produces outputs, and can fail in a way that changes how you read the result.', 'Describe the inputs, the operator stages in order, the outputs, any side effects, and the points where the job can fail. For each failure point say how the reader should interpret it, not only how to fix it. Keep the diagram and the words consistent with each other.', 'Explain every mechanism that can change the decision: a definition that shifts a number, a sampling rule, a timing effect, a ranking or caching behaviour. For each one say what it changes and how the reader should adjust their judgment when it applies.')}
|
|
50
|
+
|
|
51
|
+
${block('job-map-main', 'job-map', {
|
|
52
|
+
inputs: [
|
|
53
|
+
{ id: 'subject-input', label: todo('the first input'), description: todo('where it comes from') },
|
|
54
|
+
{ id: 'scope-input', label: todo('the second input') },
|
|
55
|
+
],
|
|
56
|
+
stages: [
|
|
57
|
+
{ id: 'collect', label: todo('collect'), actor: 'operator', description: todo('what the operator gathers') },
|
|
58
|
+
{ id: 'compare', label: todo('compare'), actor: 'operator', description: todo('what is checked against what') },
|
|
59
|
+
{ id: 'report', label: todo('report back'), actor: 'operator', description: todo('what is returned') },
|
|
60
|
+
],
|
|
61
|
+
outputs: [{ id: 'findings', label: todo('the findings returned to the reader') }],
|
|
62
|
+
sideEffects: [{ id: 'none', label: todo('state any side effects, or write "none"'), reversible: true }],
|
|
63
|
+
failurePoints: [
|
|
64
|
+
{
|
|
65
|
+
id: 'evidence-gap',
|
|
66
|
+
stage: 'collect',
|
|
67
|
+
description: todo('what goes missing or contradicts'),
|
|
68
|
+
interpretation: todo('how the reader should interpret it'),
|
|
69
|
+
recovery: todo('what the operator does next'),
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
...(hb
|
|
73
|
+
? {
|
|
74
|
+
mechanisms: [
|
|
75
|
+
{
|
|
76
|
+
id: 'definition-shift',
|
|
77
|
+
name: todo('a mechanism that changes a decision'),
|
|
78
|
+
explanation: todo('how it works'),
|
|
79
|
+
decisionImpact: todo('how it changes the reader\u2019s judgment'),
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
}
|
|
83
|
+
: {}),
|
|
84
|
+
})}
|
|
85
|
+
`;
|
|
86
|
+
files['human/03-ownership.md'] = `# Who does what {#ownership}
|
|
87
|
+
|
|
88
|
+
${prose(c, 'A human decides; an operator carries out delegated work; and some moments call for a pause so a person can decide before work continues.', 'Assign every human decision, every exact personal step the reader must perform, and every piece of delegated work to a named role. For each pause rule give the trigger, the decision owner, what work may keep going meanwhile, and the condition for resuming.', 'List the exceptions that change who decides: absent owners, conflicting instructions, evidence that arrives late, and requests outside the authorized scope. Say who can authorize each exception and how it is recorded.')}
|
|
89
|
+
|
|
90
|
+
${block('action-decide', 'human-action', {
|
|
91
|
+
kind: 'decision',
|
|
92
|
+
actor: todo('who decides'),
|
|
93
|
+
action: todo('the decision this person makes'),
|
|
94
|
+
})}
|
|
95
|
+
|
|
96
|
+
${block('action-do', 'human-action', {
|
|
97
|
+
kind: 'action',
|
|
98
|
+
actor: todo('who performs this step'),
|
|
99
|
+
action: todo('the exact personal step'),
|
|
100
|
+
steps: [todo('first step'), todo('second step')],
|
|
101
|
+
})}
|
|
102
|
+
|
|
103
|
+
${block('action-delegate', 'human-action', {
|
|
104
|
+
kind: 'delegated',
|
|
105
|
+
actor: 'Operator',
|
|
106
|
+
action: todo('the work delegated to the operator'),
|
|
107
|
+
})}
|
|
108
|
+
|
|
109
|
+
${block('pause-stop-on-ambiguity', 'pause', { rule: 'stop-on-ambiguity' })}
|
|
110
|
+
${hb ? `\n${block('exception-absent-owner', 'callout', { variant: 'exception', title: todo('exception'), text: todo('what happens when the decision owner is unavailable') })}\n` : ''}`;
|
|
111
|
+
files['human/04-operator-brief.md'] = `# The operator brief {#operator-brief}
|
|
112
|
+
|
|
113
|
+
${prose(c, 'Hand the operator this brief. It states the goal, the inputs, what the operator may read and change, when to stop, how success is checked, and what to return.', 'Check that the brief is complete without this book: goal, inputs with placeholders, authority, limits, pause rules, acceptance checks and the report-back fields. Do not prescribe procedures; leave the choice of method inside the authorized scope to the operator.', 'Explain how to fill the template for a new run, which inputs change between runs, which never do, and how the pinned operator-reference revision is refreshed when the reference changes.')}
|
|
114
|
+
|
|
115
|
+
${block('brief-main', 'brief', { view: 'both' })}
|
|
116
|
+
`;
|
|
117
|
+
files['human/05-evidence-review.md'] = `# Reviewing the evidence {#evidence-review}
|
|
118
|
+
|
|
119
|
+
${prose(c, 'Two results from the same job follow: one you can use and one you should not. Both are checked against the same acceptance checks.', 'Show the usable result and a plausible failure side by side. Name the decisive checks, say what makes a result partial, what makes it invalid, and what the reader does to recover. The failure must look believable: it should be the kind of result you could be tempted to accept.', 'Walk through the failure check by check. Explain why it can look right at first glance, which single observation exposes it, and which neighbouring checks would not have caught it.')}
|
|
120
|
+
|
|
121
|
+
${block('comparison-main', 'evidence-comparison', {
|
|
122
|
+
usable: 'result-usable',
|
|
123
|
+
flawed: 'result-flawed',
|
|
124
|
+
decisiveChecks: ['check-comparability'],
|
|
125
|
+
partialWhen: todo('what makes a result partial'),
|
|
126
|
+
invalidWhen: todo('what makes a result invalid'),
|
|
127
|
+
recovery: todo('the recovery action'),
|
|
128
|
+
})}
|
|
129
|
+
|
|
130
|
+
${block('checklist-main', 'review-checklist', { title: 'Before you accept a result' })}
|
|
131
|
+
`;
|
|
132
|
+
files['human/06-next-decision.md'] = `# The next decision {#next-decision}
|
|
133
|
+
|
|
134
|
+
${prose(c, 'With the evidence reviewed, the owner chooses one of a small set of next steps. Each choice names who decides and which evidence supports it.', 'List the choices that apply: accept, request a targeted rerun, authorize a next action, or escalate. For each choice state who decides and cite the checks or results that support it. Leave out choices that do not apply to this job.', 'Describe what each choice sets in motion, what it costs, and how to undo it. Add the conditions under which a rerun is targeted rather than complete.')}
|
|
135
|
+
|
|
136
|
+
${block('decision-next', 'decision', {
|
|
137
|
+
question: todo('what should happen next?'),
|
|
138
|
+
owner: todo('who decides'),
|
|
139
|
+
options: [
|
|
140
|
+
opt('accept', 'accept', todo('accept the result'), todo('decision owner'), todo('what accepting means'), ['check:check-primary', 'result:result-usable']),
|
|
141
|
+
opt('rerun', 'rerun', todo('request a targeted rerun'), todo('decision owner'), todo('what a rerun costs'), ['check:check-comparability', 'result:result-flawed']),
|
|
142
|
+
opt('authorize', 'authorize', todo('authorize the next action'), todo('decision owner'), todo('what the next action changes'), ['check:check-primary']),
|
|
143
|
+
opt('escalate', 'escalate', todo('escalate'), todo('who receives the escalation'), todo('what escalation involves'), ['result:result-flawed']),
|
|
144
|
+
],
|
|
145
|
+
})}
|
|
146
|
+
`;
|
|
147
|
+
return files;
|
|
148
|
+
}
|
|
149
|
+
function profileFields(c) {
|
|
150
|
+
switch (c.recipe.profile) {
|
|
151
|
+
case 'market':
|
|
152
|
+
return {
|
|
153
|
+
audience: todo('who was measured'),
|
|
154
|
+
market: todo('which market'),
|
|
155
|
+
timeframe: todo('the period covered'),
|
|
156
|
+
method: todo('how it was measured'),
|
|
157
|
+
sampleFrame: todo('the sample frame'),
|
|
158
|
+
comparability: todo('the rules that make two results comparable'),
|
|
159
|
+
};
|
|
160
|
+
case 'product':
|
|
161
|
+
return {
|
|
162
|
+
modelOrRelease: todo('model or release'),
|
|
163
|
+
platform: todo('platform'),
|
|
164
|
+
configuration: todo('the configuration to apply'),
|
|
165
|
+
resultingStateEvidence: todo('the evidence of the resulting state'),
|
|
166
|
+
};
|
|
167
|
+
case 'service':
|
|
168
|
+
return {
|
|
169
|
+
region: todo('region'),
|
|
170
|
+
plan: todo('plan'),
|
|
171
|
+
eligibility: todo('who is eligible'),
|
|
172
|
+
effectiveTerms: todo('effective terms, where relevant'),
|
|
173
|
+
confirmationEvidence: todo('the provider confirmation or delivery evidence'),
|
|
174
|
+
};
|
|
175
|
+
case 'sdk':
|
|
176
|
+
return {
|
|
177
|
+
distribution: 'npm',
|
|
178
|
+
package: todo('package name'),
|
|
179
|
+
requested: todo('requested range'),
|
|
180
|
+
version: todo('exact version resolved from the registry'),
|
|
181
|
+
integrity: todo('registry integrity (sha512-...)'),
|
|
182
|
+
registry: 'https://registry.npmjs.org/',
|
|
183
|
+
runtime: todo('runtime and version'),
|
|
184
|
+
interface: todo('the interface the job uses'),
|
|
185
|
+
testEnvironment: todo('the test environment'),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function operatorFiles(c) {
|
|
190
|
+
const files = {};
|
|
191
|
+
files['operator/01-scope.md'] = `# Scope and profile {#scope}
|
|
192
|
+
|
|
193
|
+
Facts the operator must honour for this ${c.recipe.profile} job. ${todo('Replace each placeholder with an exact value.')}
|
|
194
|
+
|
|
195
|
+
${block('profile-main', 'reference-profile', { profile: c.recipe.profile, fields: profileFields(c) })}
|
|
196
|
+
`;
|
|
197
|
+
files['operator/02-procedure.md'] = `# Procedure {#procedure}
|
|
198
|
+
|
|
199
|
+
${todo('Exact commands, procedures and supported versions go here. Keep personal steps for the reader in the human guide.')}
|
|
200
|
+
|
|
201
|
+
${block('procedure-main', 'code', { language: 'sh', caption: 'Commands', code: '# add the exact commands the operator runs\n' })}
|
|
202
|
+
`;
|
|
203
|
+
const order = ['scope', 'procedure'];
|
|
204
|
+
if (c.recipe.profile === 'sdk') {
|
|
205
|
+
files['operator/03-interface.md'] = `# Interface {#interface}
|
|
206
|
+
|
|
207
|
+
${todo('API shapes and example output for the interface the job uses.')}
|
|
208
|
+
|
|
209
|
+
${block('interface-main', 'code', { language: 'ts', caption: 'Interface', code: '// the calls the job makes\n' })}
|
|
210
|
+
`;
|
|
211
|
+
files['operator/04-example.md'] = `# Runnable example {#example}
|
|
212
|
+
|
|
213
|
+
A complete example the operator can run, with its expected result.
|
|
214
|
+
|
|
215
|
+
${block('example-main', 'example', {
|
|
216
|
+
title: 'Smallest complete run',
|
|
217
|
+
language: 'js',
|
|
218
|
+
runtime: 'Node.js 22 or later',
|
|
219
|
+
fixture: 'operator/fixtures/quickstart',
|
|
220
|
+
files: ['example.mjs'],
|
|
221
|
+
run: ['node example.mjs'],
|
|
222
|
+
expected: 'ok\n',
|
|
223
|
+
executable: true,
|
|
224
|
+
})}
|
|
225
|
+
`;
|
|
226
|
+
files['operator/fixtures/quickstart/example.mjs'] = `console.log('ok');\n`;
|
|
227
|
+
order.push('interface', 'example');
|
|
228
|
+
}
|
|
229
|
+
files['operator/05-recovery.md'] = `# Recovery {#recovery}
|
|
230
|
+
|
|
231
|
+
${todo('For each failure point in the job map, the exact recovery steps.')}
|
|
232
|
+
`;
|
|
233
|
+
order.push('recovery');
|
|
234
|
+
return files;
|
|
235
|
+
}
|
|
236
|
+
/** Scaffold a complete two-track bundle from a recipe, without any model. */
|
|
237
|
+
export function scaffoldGuide(input) {
|
|
238
|
+
const parsed = CreateGuideRequestSchema.safeParse(input);
|
|
239
|
+
if (!parsed.success) {
|
|
240
|
+
throw new MadeEasyError('SCHEMA_INVALID', parsed.error.issues.map((i) => `${i.path.join('.') || 'request'}: ${i.message}`).join('; '));
|
|
241
|
+
}
|
|
242
|
+
const req = parsed.data;
|
|
243
|
+
const recipe = getGuideRecipe(req.recipe);
|
|
244
|
+
const subject = req.subject.name.trim();
|
|
245
|
+
const guideId = req.guideId ?? slugify(subject);
|
|
246
|
+
const jobId = req.jobId ?? `${guideId}-job`;
|
|
247
|
+
const c = { recipe, subject, handbook: recipe.preset === 'handbook' };
|
|
248
|
+
const human = humanFiles(c);
|
|
249
|
+
const operator = operatorFiles(c);
|
|
250
|
+
const files = { ...human, ...operator };
|
|
251
|
+
const operatorEntries = [
|
|
252
|
+
{ id: 'scope', role: 'scope', path: 'operator/01-scope.md' },
|
|
253
|
+
{ id: 'procedure', role: 'procedure', path: 'operator/02-procedure.md' },
|
|
254
|
+
...(recipe.profile === 'sdk'
|
|
255
|
+
? [
|
|
256
|
+
{ id: 'interface', role: 'interface', path: 'operator/03-interface.md' },
|
|
257
|
+
{ id: 'example', role: 'example', path: 'operator/04-example.md' },
|
|
258
|
+
]
|
|
259
|
+
: []),
|
|
260
|
+
{ id: 'recovery', role: 'recovery', path: 'operator/05-recovery.md' },
|
|
261
|
+
];
|
|
262
|
+
files['guide.yaml'] = `${yml({
|
|
263
|
+
schemaVersion: SCHEMA_VERSION,
|
|
264
|
+
guideId,
|
|
265
|
+
jobId,
|
|
266
|
+
locale: req.locale ?? 'en',
|
|
267
|
+
subject: {
|
|
268
|
+
type: recipe.profile,
|
|
269
|
+
name: subject,
|
|
270
|
+
...(req.subject.subtitle ? { subtitle: req.subject.subtitle } : {}),
|
|
271
|
+
scope: req.subject.scope ?? todo('what this guide covers, and what it does not'),
|
|
272
|
+
},
|
|
273
|
+
recipe: { id: recipe.id, version: recipe.version },
|
|
274
|
+
theme: { id: BOOK_THEME.id, version: BOOK_THEME.version },
|
|
275
|
+
tracks: {
|
|
276
|
+
human: [
|
|
277
|
+
{ id: 'decision', role: 'decision', path: 'human/01-decision.md' },
|
|
278
|
+
{ id: 'working-model', role: 'working-model', path: 'human/02-working-model.md' },
|
|
279
|
+
{ id: 'ownership', role: 'ownership', path: 'human/03-ownership.md' },
|
|
280
|
+
{ id: 'operator-brief', role: 'operator-brief', path: 'human/04-operator-brief.md' },
|
|
281
|
+
{ id: 'evidence-review', role: 'evidence-review', path: 'human/05-evidence-review.md' },
|
|
282
|
+
{ id: 'next-decision', role: 'next-decision', path: 'human/06-next-decision.md' },
|
|
283
|
+
],
|
|
284
|
+
operator: operatorEntries,
|
|
285
|
+
},
|
|
286
|
+
})}\n`;
|
|
287
|
+
files['brief.yaml'] = `${yml({
|
|
288
|
+
schemaVersion: SCHEMA_VERSION,
|
|
289
|
+
outcome: todo(`the outcome the operator must deliver for: ${subject}`),
|
|
290
|
+
inputs: [
|
|
291
|
+
{ id: 'subject-input', label: 'Subject input', placeholder: '<subject input>', example: todo('a worked example value'), required: true },
|
|
292
|
+
{ id: 'scope-input', label: 'Scope input', placeholder: '<scope input>', example: todo('a worked example value'), required: true },
|
|
293
|
+
],
|
|
294
|
+
authority: { reads: [todo('what the operator may read')], changes: [todo('what the operator may change, or "nothing"')] },
|
|
295
|
+
limits: [todo('time, cost and scope limits')],
|
|
296
|
+
pauseRules: [
|
|
297
|
+
{
|
|
298
|
+
id: 'stop-on-ambiguity',
|
|
299
|
+
trigger: todo('the situation that makes the operator stop'),
|
|
300
|
+
owner: todo('who decides'),
|
|
301
|
+
mayContinue: todo('work that may continue meanwhile'),
|
|
302
|
+
resumeWhen: todo('the condition for resuming'),
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
acceptanceChecks: ['check-primary', 'check-comparability'],
|
|
306
|
+
reportBack: [
|
|
307
|
+
{ id: 'findings', label: 'Findings', description: todo('what the operator returns') },
|
|
308
|
+
{ id: 'gaps', label: 'Gaps', description: 'Anything that could not be established, stated as a gap rather than guessed.' },
|
|
309
|
+
],
|
|
310
|
+
operatorReference: {
|
|
311
|
+
entries: operatorEntries.map((e) => ({ id: e.id, digest: sha256Digest(normalizeText(files[e.path])) })),
|
|
312
|
+
},
|
|
313
|
+
})}\n`;
|
|
314
|
+
const check = (id, what) => ({
|
|
315
|
+
id,
|
|
316
|
+
observable: todo(`what is observed for ${what}`),
|
|
317
|
+
evidenceSource: todo('where the evidence comes from'),
|
|
318
|
+
passCondition: todo('what counts as a pass'),
|
|
319
|
+
onMissing: todo('what to do when the evidence is missing'),
|
|
320
|
+
onContradictory: todo('what to do when the evidence contradicts'),
|
|
321
|
+
});
|
|
322
|
+
files['checks.yaml'] = `${yml({
|
|
323
|
+
schemaVersion: SCHEMA_VERSION,
|
|
324
|
+
checks: [check('check-primary', 'the main result'), check('check-comparability', 'comparability')],
|
|
325
|
+
results: [
|
|
326
|
+
{
|
|
327
|
+
id: 'result-usable',
|
|
328
|
+
label: 'A usable result',
|
|
329
|
+
kind: 'usable',
|
|
330
|
+
verdict: 'usable',
|
|
331
|
+
summary: todo('why this result can be used'),
|
|
332
|
+
checks: [
|
|
333
|
+
{ check: 'check-primary', outcome: 'pass', observation: todo('what was observed'), evidence: ['source:source-1'] },
|
|
334
|
+
{ check: 'check-comparability', outcome: 'pass', observation: todo('what was observed'), evidence: ['source:source-1'] },
|
|
335
|
+
],
|
|
336
|
+
completedActions: [todo('what the operator completed')],
|
|
337
|
+
observations: [todo('what the operator observed')],
|
|
338
|
+
gaps: [],
|
|
339
|
+
nextSteps: [todo('the recommended next step')],
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
id: 'result-flawed',
|
|
343
|
+
label: 'A plausible failure',
|
|
344
|
+
kind: 'flawed',
|
|
345
|
+
verdict: 'invalid',
|
|
346
|
+
summary: todo('why this result looks right but is not'),
|
|
347
|
+
checks: [
|
|
348
|
+
{ check: 'check-primary', outcome: 'pass', observation: todo('what was observed'), evidence: ['source:source-1'] },
|
|
349
|
+
{ check: 'check-comparability', outcome: 'fail', observation: todo('what exposes the problem'), evidence: ['source:source-1'] },
|
|
350
|
+
],
|
|
351
|
+
completedActions: [todo('what the operator completed')],
|
|
352
|
+
observations: [todo('what the operator observed')],
|
|
353
|
+
gaps: [todo('what could not be established')],
|
|
354
|
+
nextSteps: [todo('the recommended next step')],
|
|
355
|
+
recovery: todo('how to recover'),
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
})}\n`;
|
|
359
|
+
files['sources.yaml'] = `${yml({
|
|
360
|
+
schemaVersion: SCHEMA_VERSION,
|
|
361
|
+
sources: [
|
|
362
|
+
{
|
|
363
|
+
id: 'source-1',
|
|
364
|
+
title: todo('source title'),
|
|
365
|
+
kind: 'document',
|
|
366
|
+
version: todo('version or retrieval date'),
|
|
367
|
+
locator: todo('URL, path or citation'),
|
|
368
|
+
synthetic: true,
|
|
369
|
+
visibility: 'private',
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
claims: [
|
|
373
|
+
{ id: 'claim-1', text: todo('a material claim the guide makes'), status: 'supported', evidence: [{ source: 'source-1', locator: todo('where in the source') }] },
|
|
374
|
+
],
|
|
375
|
+
checkEvidence: [
|
|
376
|
+
{ check: 'check-primary', evidence: [{ source: 'source-1', locator: todo('where in the source') }] },
|
|
377
|
+
{ check: 'check-comparability', evidence: [{ source: 'source-1', locator: todo('where in the source') }] },
|
|
378
|
+
],
|
|
379
|
+
})}\n`;
|
|
380
|
+
files['assets.yaml'] = `${yml({ schemaVersion: SCHEMA_VERSION, assets: [] })}\n`;
|
|
381
|
+
return {
|
|
382
|
+
guideId,
|
|
383
|
+
recipe: recipe.id,
|
|
384
|
+
files: Object.fromEntries(Object.entries(files).sort(([a], [b]) => (a < b ? -1 : 1))),
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
/** Create a bundle and report its revision, computed by the same reader every adapter uses. */
|
|
388
|
+
export async function createGuide(input) {
|
|
389
|
+
const created = scaffoldGuide(input);
|
|
390
|
+
const model = await readGuide(memorySource(created.files, created.guideId));
|
|
391
|
+
return { ...created, revision: model.revision };
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,cAAc,GAGf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAU7C,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,IAAI,IAAI,CAAC;AACnD,MAAM,GAAG,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;AAE7E,SAAS,KAAK,CAAC,EAAU,EAAE,IAAY,EAAE,KAA8B;IACrE,OAAO,oBAAoB,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC;AAChE,CAAC;AAQD,2GAA2G;AAC3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AAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;IAEjF,OAAO;QACL,OAAO;QACP,MAAM,EAAE,MAAM,CAAC,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACtF,CAAC;AACJ,CAAC;AAED,+FAA+F;AAC/F,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAyB;IACzD,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5E,OAAO,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;AAClD,CAAC"}
|
package/dist/sdk.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type BuildOptionsInput, type BuildResult, type PreviewRequest, type PreviewResult, type SourceRef, type ValidateResult, type ValidationMode } from './contracts/index.js';
|
|
2
|
+
import { type ArtifactBuild } from './build.js';
|
|
3
|
+
import { type GuideModel } from './model.js';
|
|
4
|
+
import { BundleFiles, type BundleLimits, type BundleSource } from './source.js';
|
|
5
|
+
import { sha256Digest } from './util.js';
|
|
6
|
+
/** Anything the SDK can read a bundle from. A string is a local directory path. */
|
|
7
|
+
export type GuideInput = string | BundleSource | BundleFiles | SourceRef;
|
|
8
|
+
export interface ReadOptions {
|
|
9
|
+
/** Allow `{ kind: 'path' }` references (local adapters only). Default true. */
|
|
10
|
+
allowPath?: boolean;
|
|
11
|
+
limits?: BundleLimits;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveInput(input: GuideInput, options?: ReadOptions): Promise<BundleSource | BundleFiles>;
|
|
14
|
+
/** Read and parse a bundle into the normalized model. Never throws for bad bundle content. */
|
|
15
|
+
export declare function loadGuide(input: GuideInput, options?: ReadOptions): Promise<GuideModel>;
|
|
16
|
+
export interface ValidateGuideOptions extends ReadOptions {
|
|
17
|
+
mode?: ValidationMode;
|
|
18
|
+
audience?: 'private' | 'public';
|
|
19
|
+
}
|
|
20
|
+
export declare function validateGuide(input: GuideInput, options?: ValidateGuideOptions): Promise<ValidateResult>;
|
|
21
|
+
export declare function previewGuide(input: GuideInput, request?: Partial<Omit<PreviewRequest, 'source'>> & ReadOptions): Promise<PreviewResult>;
|
|
22
|
+
export interface BuildGuideOptions extends BuildOptionsInput, ReadOptions {
|
|
23
|
+
/** Directory to deliver outputs to. Omit to keep the result in memory (see buildGuideArtifacts). */
|
|
24
|
+
out?: string;
|
|
25
|
+
overwrite?: boolean;
|
|
26
|
+
browserPath?: string;
|
|
27
|
+
signal?: AbortSignal;
|
|
28
|
+
}
|
|
29
|
+
/** Build and keep every output in memory. Used by the hosted service. */
|
|
30
|
+
export declare function buildGuideArtifacts(input: GuideInput, options?: BuildGuideOptions): Promise<ArtifactBuild & {
|
|
31
|
+
guideId?: string;
|
|
32
|
+
revision?: string;
|
|
33
|
+
referenceRevision?: string;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function buildGuide(input: GuideInput, options?: BuildGuideOptions): Promise<BuildResult>;
|
|
36
|
+
/** Write a bundle (relative path -> text) to a directory. Refuses unsafe paths; requires overwrite for non-empty targets. */
|
|
37
|
+
export declare function writeBundle(files: Record<string, string>, dir: string, options?: {
|
|
38
|
+
overwrite?: boolean;
|
|
39
|
+
}): Promise<string[]>;
|
|
40
|
+
export interface PinResult {
|
|
41
|
+
/** Updated brief.yaml text, or undefined if nothing changed. */
|
|
42
|
+
brief?: string;
|
|
43
|
+
entries: {
|
|
44
|
+
id: string;
|
|
45
|
+
digest: string;
|
|
46
|
+
changed: boolean;
|
|
47
|
+
}[];
|
|
48
|
+
}
|
|
49
|
+
/** Record the current digest of every pinned operator-reference entry in brief.yaml (keeps comments). */
|
|
50
|
+
export declare function pinGuide(input: GuideInput, options?: ReadOptions & {
|
|
51
|
+
all?: boolean;
|
|
52
|
+
}): Promise<PinResult>;
|
|
53
|
+
/** Add explicit `{#anchor}` to headings that lack one so links survive heading edits. Returns changed files. */
|
|
54
|
+
export declare function stabilizeAnchors(input: GuideInput, options?: ReadOptions): Promise<Record<string, string>>;
|
|
55
|
+
export { sha256Digest };
|
|
56
|
+
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgC,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAMnE,OAAO,EACL,WAAW,EAMX,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAiB,YAAY,EAAW,MAAM,WAAW,CAAC;AAEjE,mFAAmF;AACnF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,Y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