@formigio/fazemos-cli 0.10.24 → 0.10.26

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.
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Vendored copy of the FROZEN Runbook frontmatter / I/O-contract schema (F39).
3
+ *
4
+ * SOURCE OF TRUTH: the canonical artifact lives in the workspace at
5
+ * projects/fazemos/runbooks/runbook.schema.json
6
+ * (F39 tech spec §5.6, OQ-6). This vendored copy is a **cache** used only as
7
+ * the absent-canonical fallback: `loadRunbookSchema()` (checks.ts) loads the
8
+ * canonical file when run inside a workspace clone — the normal case, since the
9
+ * tool is validating files in that clone — and falls back to this copy only
10
+ * when the canonical file cannot be found.
11
+ *
12
+ * LOCKSTEP (F39 §9.2, AC#10): the vendored copy must be byte-identical to, or a
13
+ * strict superset of, the canonical schema. A unit test diffs the two and FAILS
14
+ * at ERROR severity on any drift (it may never define an enum value the
15
+ * canonical schema lacks, nor omit one it has). Because the canonical file is
16
+ * the source of truth and this is a cache, silent divergence would let the CLI
17
+ * accept/reject Runbooks differently from the contract F40 reads — so it is a
18
+ * hard CI failure, not a soft warning.
19
+ *
20
+ * Enum evolution is append-only within a major version (§5.2): new values may be
21
+ * ADDED via a minor bump (e.g. "1.0" -> "1.1"); any value REMOVAL is a breaking
22
+ * change requiring a major bump (e.g. "1.x" -> "2.0"). Bumped together with the
23
+ * CLI version; mirrors the established KNOWN_MANIFEST_VERSIONS pattern.
24
+ */
25
+ export const RUNBOOK_SCHEMA_VERSIONS = ['1.0'];
26
+ // FROZEN closed enums (F39 §5.2). Exported so checks.ts + tests reference one set.
27
+ export const RUNBOOK_TYPE_ENUM = ['text', 'number', 'boolean', 'url', 'filepath', 'json'];
28
+ export const RUNBOOK_FORMAT_ENUM = ['text', 'filepath', 'url', 'commit_sha', 'integer', 'markdown', 'json'];
29
+ export const RUNBOOK_SOURCE_HINT_ENUM = ['upstream', 'pipeline_param', 'dispatch_param', 'workspace_path'];
30
+ /**
31
+ * The vendored JSON-Schema (draft-07). Kept structurally identical to the
32
+ * canonical runbook.schema.json. The schema-drift unit test (§9.2, AC#10)
33
+ * compares the canonical file against this object and fails on any divergence.
34
+ */
35
+ export const runbookSchema = {
36
+ $schema: 'http://json-schema.org/draft-07/schema#',
37
+ $id: 'https://fazemos/schemas/runbook.json',
38
+ title: 'Runbook frontmatter / I/O-contract schema',
39
+ description: 'Frozen schema for the Runbook primitive\'s step-doc frontmatter (F39). The single source of truth that F39\'s CLI validator (`fazemos runbook validate`) AND F40\'s dispatch param-validation both read. Frozen at runbook_schema_version 1.0. Enum evolution is append-only within a major version (a minor bump, e.g. 1.0 -> 1.1); any enum value removal requires a major bump (e.g. 1.x -> 2.0). See specs/tech/platform/F39-runbook-substrate-authority-flip-tech-spec.md sections 5.1-5.3 + 5.6.',
40
+ type: 'object',
41
+ required: ['runbook_schema_version', 'runbook', 'title', 'description', 'role', 'contract'],
42
+ additionalProperties: false,
43
+ properties: {
44
+ runbook_schema_version: {
45
+ type: 'string',
46
+ description: 'The contract version. Required (F39 section 5.3): the Runbook contract is load-bearing for F40, so a missing version is a hard error. Frozen set for F39 is ["1.0"].',
47
+ },
48
+ runbook: {
49
+ type: 'string',
50
+ pattern: '^[a-z0-9]+(-[a-z0-9]+)*$',
51
+ description: 'Stable kebab-case id; the callable "function name" that F40\'s runbook_ref resolves. Library-unique. Replaces the legacy step:/playbook: keys. Independent of the resolver-mandated physical filename (which must equal the step name).',
52
+ },
53
+ title: { type: 'string', minLength: 1, description: 'Human label.' },
54
+ description: {
55
+ type: 'string',
56
+ minLength: 1,
57
+ description: 'Single-line, non-empty description. The F18 validateDescription contract enforces non-empty + no newline at render; the CLI re-applies it as runbook.description_invalid before a render.',
58
+ },
59
+ role: {
60
+ type: 'string',
61
+ minLength: 1,
62
+ description: 'Capability HINT (role-slug, post-F25). Overridable at dispatch. NEVER a hard filler pin (F39 section 6.4). A Runbook is what to do, never who.',
63
+ },
64
+ contract: {
65
+ type: 'object',
66
+ required: ['inputs', 'outputs'],
67
+ additionalProperties: false,
68
+ properties: {
69
+ inputs: {
70
+ type: 'array',
71
+ items: {
72
+ type: 'object',
73
+ required: ['name', 'type', 'required', 'source_hint'],
74
+ additionalProperties: false,
75
+ properties: {
76
+ name: {
77
+ type: 'string',
78
+ minLength: 1,
79
+ description: 'The name the PROCEDURE BODY uses. The binding maps the actual wire (section 5.5); the renamed wire name never leaks into the Runbook.',
80
+ },
81
+ type: {
82
+ type: 'string',
83
+ enum: ['text', 'number', 'boolean', 'url', 'filepath', 'json'],
84
+ description: 'FROZEN closed enum (F39 section 5.2). Closed at 6.',
85
+ },
86
+ required: { type: 'boolean' },
87
+ source_hint: {
88
+ type: 'string',
89
+ enum: ['upstream', 'pipeline_param', 'dispatch_param', 'workspace_path'],
90
+ description: 'FROZEN closed enum (F39 section 5.2). The shape of how this input is typically satisfied, NEVER the wire. Closed at 4.',
91
+ },
92
+ description: { type: 'string' },
93
+ },
94
+ },
95
+ },
96
+ outputs: {
97
+ type: 'array',
98
+ items: {
99
+ type: 'object',
100
+ required: ['name', 'type', 'required', 'success_criteria'],
101
+ additionalProperties: false,
102
+ properties: {
103
+ name: { type: 'string', minLength: 1 },
104
+ type: {
105
+ type: 'string',
106
+ enum: ['text', 'number', 'boolean', 'url', 'filepath', 'json'],
107
+ description: 'FROZEN closed enum (F39 section 5.2). Closed at 6.',
108
+ },
109
+ required: { type: 'boolean' },
110
+ format: {
111
+ type: 'string',
112
+ enum: ['text', 'filepath', 'url', 'commit_sha', 'integer', 'markdown', 'json'],
113
+ description: 'FROZEN closed enum (F39 section 5.2). Optional; refines type. Absent => unconstrained beyond type. Closed at 7.',
114
+ },
115
+ success_criteria: {
116
+ type: 'string',
117
+ minLength: 1,
118
+ description: 'What turns the contract into a real function signature (Ollie section 1: the single highest-value piece). What a pipeline evaluator, chat dispatcher, and inbox auto-wake all agree on for "did this Runbook return what it promised."',
119
+ },
120
+ },
121
+ },
122
+ },
123
+ },
124
+ },
125
+ defaults: {
126
+ type: 'object',
127
+ additionalProperties: false,
128
+ description: 'SUGGESTED defaults only; the binding override wins when present (section 5.5). Honors BUG36 (eval budget keys off step shape).',
129
+ properties: {
130
+ reviewer: { type: ['string', 'null'], description: 'role-slug or null.' },
131
+ eval_max_turns: { type: ['integer', 'null'], description: 'null => engine default.' },
132
+ },
133
+ },
134
+ },
135
+ };
136
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/runbook/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAK,CAAU,CAAC;AAExD,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AACrH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,CAAU,CAAC;AAEpH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,yCAAyC;IAClD,GAAG,EAAE,sCAAsC;IAC3C,KAAK,EAAE,2CAA2C;IAClD,WAAW,EACT,weAAwe;IAC1e,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,wBAAwB,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,CAAC;IAC3F,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,sBAAsB,EAAE;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,sK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F;KACF;CACO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formigio/fazemos-cli",
3
- "version": "0.10.24",
3
+ "version": "0.10.26",
4
4
  "description": "CLI for the Fazemos Team Accomplishment Platform",
5
5
  "type": "module",
6
6
  "license": "MIT",