unoverse 0.1.220 → 0.1.222
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/operator/.env.example +7 -0
- package/operator/lib/db-verify.sh +1 -1
- package/package.json +1 -1
- package/vendor/base/items/publish.js +9 -0
- package/vendor/base/lint/design/index.mjs +4 -1
- package/vendor/base/lint/design/vocabulary.mjs +1 -1
- package/vendor/base/lint/nodes/_schema/api.schema.json +9 -4
- package/vendor/base/lint/nodes/_schema/node.schema.json +10 -0
- package/vendor/base/lint/nodes/_schema/package.schema.json +1 -1
- package/vendor/base/lint/objects/_schema/agents/agent.schema.json +5 -0
- package/vendor/base/lint/objects/_schema/objects/dataset.schema.json +36 -0
- package/vendor/base/lint/objects/_schema/objects/object.schema.json +8 -1
- package/vendor/base/lint/objects/_schema/objects/props.schema.json +23 -0
- package/vendor/base/lint/objects/_schema/pipelines/layout.schema.json +212 -0
- package/vendor/base/lint/objects/_schema/pipelines/pipeline.schema.json +26 -1
- package/vendor/base/lint/objects/index.mjs +1 -1
- package/vendor/base/lint/objects/rules.mjs +83 -4
package/operator/.env.example
CHANGED
|
@@ -42,6 +42,13 @@ DOCR_TOKEN=
|
|
|
42
42
|
# Page intelligence (promote-page extraction)
|
|
43
43
|
HYPERBROWSER_API_KEY=
|
|
44
44
|
|
|
45
|
+
# The document engine (its own repo, unoverse-platform/document-engine), on Beam
|
|
46
|
+
# (docs/saas-architecture/DOCUMENT_ENGINE.md). Empty = a local one at localhost:5002.
|
|
47
|
+
# The token is your Beam workspace token (`beam config list`); the engine sends it on every
|
|
48
|
+
# call, because a Beam address is public.
|
|
49
|
+
DOCUMENTS_SERVICE_URL=
|
|
50
|
+
DOCUMENTS_SERVICE_TOKEN=
|
|
51
|
+
|
|
45
52
|
# Marketplace catalogue to install from (docs/architecture/authoring/MARKETPLACE.md).
|
|
46
53
|
# Empty = local items only. No default: a URL is never hardcoded.
|
|
47
54
|
UNOVERSE_MARKETPLACE_URL=
|
|
@@ -130,7 +130,7 @@ cmd_db_verify() {
|
|
|
130
130
|
],
|
|
131
131
|
dictionary_pieces: [
|
|
132
132
|
"parent_id", "part_id", "part_no", "kind", "org", "title", "page_from", "page_to",
|
|
133
|
-
"text", "content_hash", "split_version", "words", "updated_at", "embedding"
|
|
133
|
+
"text", "content_hash", "split_version", "words", "updated_at", "embedding", "cells"
|
|
134
134
|
],
|
|
135
135
|
dictionary_ingestion_configs: [
|
|
136
136
|
"id", "name", "description", "connector_type", "connector_config",
|
package/package.json
CHANGED
|
@@ -94,6 +94,15 @@ export async function lintOrg(home) {
|
|
|
94
94
|
result.problems.push(...lintPrompts(home.dir, { org }).problems);
|
|
95
95
|
return { problems: result.problems, errors: result.problems.filter((p) => p.level === "error") };
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Lint an org repo's objects and pipelines with some files as they WOULD be (`overlay`: absolute path ->
|
|
99
|
+
* text): a change is checked before it is written (an approved table wording, pipelines/tables.md).
|
|
100
|
+
*/
|
|
101
|
+
export async function lintOrgObjects(home, overlay = {}) {
|
|
102
|
+
const { lintObjects } = await import("../lint/objects/index.mjs");
|
|
103
|
+
const problems = lintObjects(home.dir, { org: { name: home.org, dir: home.dir }, overlay }).problems;
|
|
104
|
+
return { problems, errors: problems.filter((p) => p.level === "error") };
|
|
105
|
+
}
|
|
97
106
|
/**
|
|
98
107
|
* What publishing WOULD do, without doing it.
|
|
99
108
|
*
|
|
@@ -868,7 +868,10 @@ for (const orgDir of [DS, ...orgDirs]) {
|
|
|
868
868
|
// This was an org-blocking error until it stopped a yasisland deploy over a form
|
|
869
869
|
// nobody needed that day.
|
|
870
870
|
if (credentialDefs.size)
|
|
871
|
-
for (const
|
|
871
|
+
for (const entry of Array.isArray(readDef(mf).credentials) ? readDef(mf).credentials : [])
|
|
872
|
+
// `- googleApiCredential` or `- googleApiCredential: MapKey` (the saved name chooses
|
|
873
|
+
// between two of one type); the definition looked for is the TYPE either way.
|
|
874
|
+
for (const cname of typeof entry === "string" ? [entry] : entry && typeof entry === "object" ? Object.keys(entry) : [String(entry)])
|
|
872
875
|
if (!credentialDefs.has(String(cname)))
|
|
873
876
|
report(
|
|
874
877
|
"warn",
|
|
@@ -72,7 +72,7 @@ export const INTERFACE_FIELDS = new Set([
|
|
|
72
72
|
export const AUTHORED_CONTROLS = ["maxLength", "minItems", "maxItems", "enum"];
|
|
73
73
|
|
|
74
74
|
export const PRIMITIVE_PROPS = {
|
|
75
|
-
Box: ["children", "autoScroll", "revealOnStick", "selection", "appWidth"],
|
|
75
|
+
Box: ["children", "autoScroll", "revealOnStick", "selection", "appWidth", "pan"],
|
|
76
76
|
Stack: ["children", "autoScroll", "revealOnStick", "appWidth"],
|
|
77
77
|
Row: ["children", "autoScroll", "revealOnStick", "appWidth"],
|
|
78
78
|
Column: ["children", "autoScroll", "revealOnStick", "appWidth"],
|
|
@@ -48,9 +48,10 @@
|
|
|
48
48
|
"apiKeyHeader",
|
|
49
49
|
"apiKeyQuery",
|
|
50
50
|
"oauth2ClientCredentials",
|
|
51
|
+
"oauth2RefreshToken",
|
|
51
52
|
"awsSigV4"
|
|
52
53
|
],
|
|
53
|
-
"description": "IMPLEMENTED schemes only. Values are added here only WITH their implementation, never ahead of it.\n\noauth2ClientCredentials exchanges a client id and secret for a short-lived token, form-encoded, caches it per connected app until it expires, and refreshes once on a 401. What the exchange returned is in scope as `token`, so a url can reach `{{ token.instanceUrl }}` where the vendor tells you where to talk as well as how.\n\nawsSigV4 signs the request with AWS Signature Version 4, which is what turns every AWS service into a manifest: the signature is computation over the request (it hashes the exact bytes being sent), so it belongs to the executor, while the endpoint, operation and body are description and stay here. Name `service` and, if it is not on the credential, `region`; the keys come from `awsCredential` and are never written in a manifest. Unlike every other scheme this resolves LAST, after the url and body are final, because a signature covers them."
|
|
54
|
+
"description": "IMPLEMENTED schemes only. Values are added here only WITH their implementation, never ahead of it.\n\noauth2ClientCredentials exchanges a client id and secret for a short-lived token, form-encoded, caches it per connected app until it expires, and refreshes once on a 401. What the exchange returned is in scope as `token`, so a url can reach `{{ token.instanceUrl }}` where the vendor tells you where to talk as well as how.\n\noauth2RefreshToken is the same exchange with a refresh token as well, for vendors that only issue tokens a person approved once (LinkedIn): the refresh token is made once in the vendor's developer portal and kept on the credential.\n\nawsSigV4 signs the request with AWS Signature Version 4, which is what turns every AWS service into a manifest: the signature is computation over the request (it hashes the exact bytes being sent), so it belongs to the executor, while the endpoint, operation and body are description and stay here. Name `service` and, if it is not on the credential, `region`; the keys come from `awsCredential` and are never written in a manifest. Unlike every other scheme this resolves LAST, after the url and body are final, because a signature covers them."
|
|
54
55
|
},
|
|
55
56
|
"token": {
|
|
56
57
|
"$ref": "_defs.schema.json#/definitions/templateOrExpression"
|
|
@@ -82,19 +83,23 @@
|
|
|
82
83
|
},
|
|
83
84
|
"tokenUrl": {
|
|
84
85
|
"$ref": "_defs.schema.json#/definitions/templateOrExpression",
|
|
85
|
-
"description": "oauth2ClientCredentials: where the token is minted, e.g. https://your-org.my.salesforce.com/services/oauth2/token."
|
|
86
|
+
"description": "oauth2ClientCredentials, oauth2RefreshToken: where the token is minted, e.g. https://your-org.my.salesforce.com/services/oauth2/token."
|
|
86
87
|
},
|
|
87
88
|
"clientId": {
|
|
88
89
|
"$ref": "_defs.schema.json#/definitions/templateOrExpression",
|
|
89
|
-
"description": "oauth2ClientCredentials: the connected app's id. Not secret."
|
|
90
|
+
"description": "oauth2ClientCredentials, oauth2RefreshToken: the connected app's id. Not secret."
|
|
90
91
|
},
|
|
91
92
|
"clientSecret": {
|
|
92
93
|
"$ref": "_defs.schema.json#/definitions/templateOrExpression",
|
|
93
|
-
"description": "oauth2ClientCredentials: the connected app's secret."
|
|
94
|
+
"description": "oauth2ClientCredentials, oauth2RefreshToken: the connected app's secret."
|
|
94
95
|
},
|
|
95
96
|
"scope": {
|
|
96
97
|
"$ref": "_defs.schema.json#/definitions/templateOrExpression",
|
|
97
98
|
"description": "oauth2ClientCredentials: optional scope string, when the vendor wants one."
|
|
99
|
+
},
|
|
100
|
+
"refreshToken": {
|
|
101
|
+
"$ref": "_defs.schema.json#/definitions/templateOrExpression",
|
|
102
|
+
"description": "oauth2RefreshToken: the long-lived refresh token a person made once for the app."
|
|
98
103
|
}
|
|
99
104
|
},
|
|
100
105
|
"additionalProperties": false
|
|
@@ -83,6 +83,16 @@
|
|
|
83
83
|
"default": "public",
|
|
84
84
|
"description": "`internal` nodes load everywhere but never appear in the node library or palette. Used by harness and builder nodes."
|
|
85
85
|
},
|
|
86
|
+
"inbound": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"description": "How the service this node talks to proves a message it SENDS US is genuine (docs/auth-security/INBOUND.md). Name one of the platform's verifiers and the field of this node's credential that holds the secret. A node can never describe its own check: the platform's verifier decides, and refuses when the secret is missing.",
|
|
89
|
+
"properties": {
|
|
90
|
+
"verify": { "enum": ["slack"], "description": "The platform verifier for this service's signature." },
|
|
91
|
+
"secret": { "type": "string", "description": "The field of this node's credential holding the signing secret, e.g. signingSecret." }
|
|
92
|
+
},
|
|
93
|
+
"required": ["verify", "secret"],
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
},
|
|
86
96
|
"capabilities": {
|
|
87
97
|
"type": "object",
|
|
88
98
|
"description": "Engine-level behaviour of this node type. All optional.",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"items": {
|
|
82
82
|
"type": "string"
|
|
83
83
|
},
|
|
84
|
-
"description": "The credential SCHEMES this package's calls use (bearer, basic, apiKeyHeader, apiKeyQuery, oauth2ClientCredentials, awsSigV4). Named `auth` until 2026-07-28, renamed with the call key it mirrors so the package's promise and the call's spelling stay the same word. Nothing to do with node.yaml's `auth`, which is who may RUN a node."
|
|
84
|
+
"description": "The credential SCHEMES this package's calls use (bearer, basic, apiKeyHeader, apiKeyQuery, oauth2ClientCredentials, oauth2RefreshToken, awsSigV4). Named `auth` until 2026-07-28, renamed with the call key it mirrors so the package's promise and the call's spelling stay the same word. Nothing to do with node.yaml's `auth`, which is who may RUN a node."
|
|
85
85
|
},
|
|
86
86
|
"transport": {
|
|
87
87
|
"type": "array",
|
|
@@ -59,6 +59,25 @@
|
|
|
59
59
|
"type": "string"
|
|
60
60
|
},
|
|
61
61
|
"description": "The only values this column may hold. The database refuses anything else, so a word that IS the language (a measure, a unit, a side) cannot arrive misspelled and quietly become a second thing that never adds up with the first. Leave it off for a column that carries a document's own words, which are not ours to enumerate."
|
|
62
|
+
},
|
|
63
|
+
"wordings": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
66
|
+
"description": "For a column with `enum`: the words a table's title or headings print for each value (net return: [performance, returns]), so a table found by its shape is known by what it holds. Each key is one of `enum`. Grows by approval (pipelines/tables.md 3b)." },
|
|
67
|
+
"rowWordings": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
70
|
+
"description": "For a column with `enum`: the words a key-figures row's own label prints for each value (net asset value: [total net assets, fund size]), so one row of a label | value table is one figure. Each key is one of `enum`. Grows by approval (pipelines/tables.md 3b)."
|
|
71
|
+
},
|
|
72
|
+
"columnWordings": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
75
|
+
"description": "For a column with `enum`: the words a table's column prints for each value (exposure: [market value, of net assets]), so a number kept from any table is known by the column it sits under when its table's title names none. Each key is one of `enum`. Grows by approval (pipelines/tables.md 3f)."
|
|
76
|
+
},
|
|
77
|
+
"values": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
80
|
+
"description": "For a column with `enum`: the values of another column each of its values gathers (a dimension's own categories: fair value level: [Level 1, Level 2, Level 3]), so a number whose row or column names one is known to be sliced that way. Each key is one of `enum`. Grows by approval (pipelines/tables.md 3i)."
|
|
62
81
|
}
|
|
63
82
|
}
|
|
64
83
|
}
|
|
@@ -78,6 +97,23 @@
|
|
|
78
97
|
"asOf": {
|
|
79
98
|
"type": "string",
|
|
80
99
|
"description": "The column that says when these rows speak as of, so the handle can say it."
|
|
100
|
+
},
|
|
101
|
+
"whose": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"required": ["object", "column", "level"],
|
|
104
|
+
"description": "Whose a row is, as records (pipelines/tables.md 3i step 4): the object a row's subject is, its parts, how one sits inside another, and the `level` value each is filed under. The platform names no industry: the org says its subject is a fund, a store, a client.",
|
|
105
|
+
"properties": {
|
|
106
|
+
"object": { "type": "string", "description": "The object a row's subject is (fund)." },
|
|
107
|
+
"column": { "type": "string", "description": "The column its name goes in (fund)." },
|
|
108
|
+
"level": { "type": "string", "description": "The `level` value for the subject's own figures (fund)." },
|
|
109
|
+
"names": { "type": "string", "description": "The subject's field of other names (alsoKnownAs)." },
|
|
110
|
+
"compare": { "type": "string", "description": "The subject's field naming what it is compared with (benchmark)." },
|
|
111
|
+
"compareLevel": { "type": "string", "description": "The `level` value for that comparison's figures (index)." },
|
|
112
|
+
"within": { "type": "object", "required": ["link"], "properties": { "link": { "type": "string" }, "field": { "type": "string" } }, "description": "How a subject sits inside another: the link to its parent (subFundOf) and the field naming the parent (umbrella)." },
|
|
113
|
+
"part": { "type": "object", "required": ["object", "column", "level", "name", "of"], "properties": { "object": { "type": "string" }, "column": { "type": "string" }, "level": { "type": "string" }, "name": { "type": "string" }, "of": { "type": "string" } }, "description": "Its parts (a fund's share classes): their object, column, `level` value, name field and the field naming their subject." },
|
|
114
|
+
"none": { "type": "string", "description": "The `level` value for a document about no subject (market)." },
|
|
115
|
+
"terms": { "type": "array", "items": { "type": "string" }, "description": "The measures that are a record's standing terms, never figures over time (fee): a rate of one is a field of the subject's or part's record, read by the layout, and never a row; an amount of money of one (fees charged over a period) stays a row. Each is one of the measure column's `enum`." }
|
|
116
|
+
}
|
|
81
117
|
}
|
|
82
118
|
},
|
|
83
119
|
"additionalProperties": false
|
|
@@ -204,7 +204,11 @@
|
|
|
204
204
|
},
|
|
205
205
|
"minProperties": 1,
|
|
206
206
|
"maxProperties": 1,
|
|
207
|
-
"description": "One pair: this row's field naming that row's ({ manager: legalName })."
|
|
207
|
+
"description": "One pair: this row's field naming that row's ({ manager: legalName })." },
|
|
208
|
+
"carries": {
|
|
209
|
+
"type": "array",
|
|
210
|
+
"items": { "type": "string" },
|
|
211
|
+
"description": "Fields of this row each line keeps (a provider's role for the fund it serves). A line that carries is added, never replaced, and a second value for the same line joins its list (relationships-and-labels.md, Lines to another object)."
|
|
208
212
|
}
|
|
209
213
|
},
|
|
210
214
|
"oneOf": [
|
|
@@ -255,6 +259,9 @@
|
|
|
255
259
|
"properties": {
|
|
256
260
|
"instructions": { "type": "string", "description": "What to take and what to leave, in plain words: what this object is, and what it is not." },
|
|
257
261
|
"never": { "type": "array", "items": { "type": "string" }, "description": "Words that are never a name on their own: a name made only of these (\"Voting Shares\", \"Custodians\") is no record. A name with any other word stays." },
|
|
262
|
+
"notAlso": { "type": "array", "items": { "type": "string" }, "description": "Other objects a name is never also: a name one document's read gives as a row of one of these is not made a row of this one (a manager's notAlso: [fund], so a fund in an allocation table is never also its manager)." },
|
|
263
|
+
"notAlsoWhen": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "description": "Another object a name is never also when that object's row says so: { service-provider: { role: [administrator, custodian] } } — a name the same document's read gives as a service provider with one of those roles is not a row of this one; as one with another role, it may be." },
|
|
264
|
+
"notWhen": { "type": "array", "items": { "type": "string" }, "description": "Phrases of a notice or of another kind's role (issued by, representative, paying agent): a name every sentence of its chunk names only beside one of these, and beside none of this object's own field wordings, is not a row of this one." },
|
|
258
265
|
"examples": {
|
|
259
266
|
"type": "array",
|
|
260
267
|
"description": "Worked examples: a piece of text, and the right answer for it, a list of this object's input fields. An empty answer shows what to leave.",
|
|
@@ -80,6 +80,29 @@
|
|
|
80
80
|
"items": { "type": "string", "minLength": 1 },
|
|
81
81
|
"description": "The kinds of document that may answer this field (the reading document's choice, e.g. offering-memorandum). Each page of a document of one of these kinds is asked for the field while it is still empty, and a value stated is written with its page and words (docs/unoverse/data/pipelines/proved-before-built.md). On an object filled from documents, every input: true field names them."
|
|
82
82
|
},
|
|
83
|
+
"standard": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 1,
|
|
86
|
+
"description": "The field's id in the org's field list (one org's list is openfunds: OFST452010). A table's column or row named by this field's wordings, or by the standard field's own name, fills it (docs/unoverse/data/pipelines/tables.md)."
|
|
87
|
+
},
|
|
88
|
+
"format": {
|
|
89
|
+
"enum": ["date", "country"],
|
|
90
|
+
"description": "date: the field is a date, written yyyy-mm-dd. A date a document prints another way (31/Mar/2025, 21 October 2024) is written so; one that could be read two ways (03/04/2025) is left, never guessed. country: the field is a country, held by its one name from ISO 3166-1 (its code named by the CLDR English region names) however a document prints it (UK, GB and United Kingdom are United Kingdom); a value no country fits stays as printed."
|
|
91
|
+
},
|
|
92
|
+
"pattern": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"minLength": 1,
|
|
95
|
+
"description": "The regular expression a value must match (an ISIN: ^[A-Z]{2}[A-Z0-9]{9}[0-9]$). A value that does not match is never saved, whichever reader read it."
|
|
96
|
+
},
|
|
97
|
+
"wordings": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"minItems": 1,
|
|
100
|
+
"items": { "type": "string", "minLength": 1 },
|
|
101
|
+
"description": "The words documents print for this field (management related fees, mgmt fee), matched exactly after lower case. A new wording is proposed, approved by a person, then added here (docs/unoverse/data/pipelines/tables.md)."
|
|
102
|
+
},
|
|
103
|
+
"none": {
|
|
104
|
+
"description": "The value a table cell that states there is none (\"None\", \"N/A\", \"-\", \"Nil\") stands for (0 for a fee), kept as stated; without it such a cell fills nothing. Never a default: a field the documents do not state stays empty."
|
|
105
|
+
},
|
|
83
106
|
"reuse": {
|
|
84
107
|
"type": "boolean",
|
|
85
108
|
"description": "true: the read is shown the values this field already holds on the object's rows in the org, and gives one of them, spelled exactly, when it names the same thing. For a name many rows share: a subject, a series."
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://docs.unoverse.ai/schemas/pipelines/layout.schema.json",
|
|
4
|
+
"title": "Unoverse document layout",
|
|
5
|
+
"description": "pipelines/<pipeline>/documents/<type>.yaml, ONE per document type, never per house: the map of one document type (docs/unoverse/data/pipelines/document-map.md, 'Layouts'). How to recognise the type, its sections and how to find each, who each section is about, what reads it, what it gives, and what is never a record. A hint, never a gate: a section not found is read the general way and flagged. One small vocabulary of finders, the same in every layout. Field names are the objects' own props (props.yaml); the engine checks them against the org at load, a schema cannot.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["layout", "reportType", "recognise", "sections"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"unoverse": { "type": "string" },
|
|
11
|
+
"layout": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
|
14
|
+
"description": "Equals the file name."
|
|
15
|
+
},
|
|
16
|
+
"reportType": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
|
19
|
+
"description": "A value of fund-document.reportType (the org's REPORT_TYPES)."
|
|
20
|
+
},
|
|
21
|
+
"describe": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1,
|
|
24
|
+
"description": "What a document of this type is, in plain words, from its own definition: who writes it, its usual order, what in it is never the subject's. Given to the model before every section it reads. Names no fund, firm, index or term."
|
|
25
|
+
},
|
|
26
|
+
"recognise": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"description": "Signals that this document is of this type. `all` must every one match; `any` needs one. The first read's report type is a signal like any other. A document that matches no layout is read generally.",
|
|
30
|
+
"properties": {
|
|
31
|
+
"all": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/signal" } },
|
|
32
|
+
"any": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/signal" } }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"sections": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"minItems": 1,
|
|
38
|
+
"items": { "$ref": "#/definitions/section" }
|
|
39
|
+
},
|
|
40
|
+
"includes": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"items": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
|
|
43
|
+
"description": "Shared section files this layout takes in (documents/_shared/<name>.yaml), such as the country notices every retail document ends with."
|
|
44
|
+
},
|
|
45
|
+
"match": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "Local rules for the matcher, per kind: which keys decide a match for records this type gives, in order, and what a name with no candidate becomes. Never a name: aliases and same-as pairs live on records.",
|
|
48
|
+
"propertyNames": { "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "description": "An object kind of the org (its object's name), as the org declares it." },
|
|
49
|
+
"additionalProperties": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"required": ["by"],
|
|
53
|
+
"properties": {
|
|
54
|
+
"by": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"minItems": 1,
|
|
57
|
+
"items": { "type": "string", "enum": ["isin", "lei", "bloombergCode", "name", "name-within-fund", "name-within-firm", "alias", "class-isin"] },
|
|
58
|
+
"description": "Keys tried in order; the first that finds a record decides. `class-isin`: a fund found through the ISIN of one of its classes."
|
|
59
|
+
},
|
|
60
|
+
"noCandidate": { "type": "string", "enum": ["review", "make"], "description": "What happens when no key finds a record: `review` (default) holds it for a person; `make` creates it, only for a kind the type is the source of (a prospectus makes its funds)." }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"never": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": { "$ref": "#/definitions/never" },
|
|
67
|
+
"description": "Names this type prints that are never records. Structured so the confirm step can apply them."
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"definitions": {
|
|
71
|
+
"signal": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"minProperties": 1,
|
|
75
|
+
"properties": {
|
|
76
|
+
"text": { "type": "string", "minLength": 1, "description": "Words printed on the page (a regular expression)." },
|
|
77
|
+
"heading": { "type": "string", "minLength": 1, "description": "A heading printed on the page (a regular expression)." },
|
|
78
|
+
"page": { "type": "integer", "minimum": 1, "description": "The page the signal must be on; any page when absent." },
|
|
79
|
+
"reportType": { "type": "string", "description": "The first read said this type." }
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"section": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["kind", "find"],
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"properties": {
|
|
87
|
+
"kind": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
|
|
90
|
+
"description": "What this section is, in the layout's words (product, costs, directory, schedule, share-class-table, holdings, legal-notices)."
|
|
91
|
+
},
|
|
92
|
+
"find": { "$ref": "#/definitions/find" },
|
|
93
|
+
"each": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"enum": ["heading"],
|
|
96
|
+
"description": "`heading`: every heading the finder hits is its own section instance (one sub-fund's schedule each), running from its heading to the next hit of this section, else the first `find.until` heading, else the end; other sections' headings inside it do not end it. A section or table inside an instance is about the instance's record; a `kind.prop` field it gives for its own record's kind is that record's, and one for another kind (`share-class.<prop>`) applies to every record of that kind the instance holds. Two records of one kind and name within an instance (or of the instance's own kind anywhere) are one record. Without `each`, every hit is joined into one section."
|
|
97
|
+
},
|
|
98
|
+
"about": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"pattern": "^(document|umbrella|named|none|[a-z0-9]+(-[a-z0-9]+)*)$",
|
|
101
|
+
"description": "Who the section is about: the document's own subject (default), the umbrella, the fund, the share class, the entity the section's own title names (`named`, as a prospectus schedule: with `each`, the record the section's first record finder names, else the heading's words), or no one."
|
|
102
|
+
},
|
|
103
|
+
"read": { "$ref": "#/definitions/read" },
|
|
104
|
+
"gives": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"description": "What the section states, by rule. A key is an object kind (a record or a list of records: fund, share-class, manager, service-provider, person) or kind.prop (a field, the prop one of the object's own). `asOf` is the document's date.",
|
|
107
|
+
"propertyNames": { "pattern": "^(asOf|[a-z0-9]+(-[a-z0-9]+)*(\\.[a-zA-Z][a-zA-Z0-9]*)?)$" },
|
|
108
|
+
"additionalProperties": {
|
|
109
|
+
"oneOf": [
|
|
110
|
+
{ "$ref": "#/definitions/finder" },
|
|
111
|
+
{ "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/finder" }, "description": "Alternative finders for one field, tried in order: one per wording the type is printed in." },
|
|
112
|
+
{ "$ref": "#/definitions/record" },
|
|
113
|
+
{ "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/record" } }
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"find": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"additionalProperties": false,
|
|
122
|
+
"minProperties": 1,
|
|
123
|
+
"description": "How to find the section. Headings, tables and text are regular expressions, any one of a list; every match is part of the section (a facts block printed as two headings). `order` is the section's place among the layout's sections when headings differ (a translated document). `optional` sections are not flagged when missing.",
|
|
124
|
+
"properties": {
|
|
125
|
+
"heading": { "$ref": "#/definitions/oneOrMore" },
|
|
126
|
+
"table": { "$ref": "#/definitions/oneOrMore", "description": "A table title that marks the section." },
|
|
127
|
+
"text": { "$ref": "#/definitions/oneOrMore", "description": "Words that mark the section where it has no heading (a notice at the foot of a page); the section is that page." },
|
|
128
|
+
"page": { "type": "integer", "minimum": 1 },
|
|
129
|
+
"order": { "type": "integer", "minimum": 1 },
|
|
130
|
+
"optional": { "type": "boolean" },
|
|
131
|
+
"next": { "$ref": "#/definitions/oneOrMore", "description": "A heading counts only when the heading printed after it matches one of these (case ignored): a sub-fund's name known by the objective or the 'A Sub-Fund of' that follows it." },
|
|
132
|
+
"until": { "$ref": "#/definitions/oneOrMore", "description": "With `each`: headings that end an instance (the annex or exhibit after the last schedule); case ignored." }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"read": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"required": ["tool"],
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"description": "What reads the section's text. `model` is the pipeline's own read node (the page reader), given this section only, a fixed header (document, section, scope, defined terms) and `say`; it may return only `kinds`. `rules` means the finders under `gives` alone. `none` reads nothing (a glossary, a disclaimer).",
|
|
140
|
+
"properties": {
|
|
141
|
+
"tool": { "type": "string", "enum": ["model", "rules", "none"] },
|
|
142
|
+
"kinds": {
|
|
143
|
+
"type": "array",
|
|
144
|
+
"items": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" }
|
|
145
|
+
},
|
|
146
|
+
"say": { "type": "string", "minLength": 1, "description": "The instruction for this section, in plain words." }
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"finder": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"additionalProperties": false,
|
|
152
|
+
"minProperties": 1,
|
|
153
|
+
"description": "Where a value is, by rule. One of: `pattern` (a regular expression; group 1 is the value, or `group` says which); `line` (a line by position); `table` and `row` (a cell: the first non-empty cell after the row label, or `column`); or, as a record's field, `group` alone (that group of the record's own name match). `na` is the value when the page prints N/A or 'none'. `map` turns printed wording into the prop's enum value. A pattern is tried on the text as printed, then with runs of spaces made one.",
|
|
154
|
+
"properties": {
|
|
155
|
+
"pattern": { "type": "string", "minLength": 1 },
|
|
156
|
+
"group": { "type": "integer", "minimum": 1, "description": "The group of `pattern` that is the value; alone, in a record's `fields`, the group of the record's name match (\"Minimum Initial Subscription for (Class B) Shares: (250,000)\" gives the class and its minimum)." },
|
|
157
|
+
"case": { "type": "string", "enum": ["any"], "description": "`any`: the pattern matches whatever the case of the page's words (a heading in capitals, the same words in a sentence)." },
|
|
158
|
+
"scope": { "type": "string", "enum": ["section", "document"], "description": "Where the pattern is searched: the section (default) or the whole document, for a value printed outside its section (an umbrella named only in the notices)." },
|
|
159
|
+
"cell": { "type": "string", "enum": ["value", "label"], "description": "With `table` and `row`: take the value cell (default) or the row's label (a class named in the label, 'ISIN - Base Shares')." },
|
|
160
|
+
"line": { "type": "string", "enum": ["after-heading", "first-heading", "first", "last"] },
|
|
161
|
+
"table": { "type": "string", "minLength": 1 },
|
|
162
|
+
"row": { "type": "string", "minLength": 1 },
|
|
163
|
+
"column": { "type": "integer", "minimum": 1 },
|
|
164
|
+
"na": { "description": "The value when the page prints N/A or 'none'." },
|
|
165
|
+
"map": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"additionalProperties": { "type": "string" },
|
|
168
|
+
"description": "Printed wording to the prop's enum value ('Accumulation' to accumulating)."
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"record": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"additionalProperties": false,
|
|
175
|
+
"minProperties": 1,
|
|
176
|
+
"description": "A record given by rule: its name and fields, each a finder or a list of alternative finders. A record with no name finder is named by its identifier field (isin, lei): the matcher finds the record the identifier names, and never invents a name.",
|
|
177
|
+
"properties": {
|
|
178
|
+
"name": { "oneOf": [ { "$ref": "#/definitions/finder" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/finder" } } ] },
|
|
179
|
+
"role": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
|
|
180
|
+
"country": { "oneOf": [ { "type": "string" }, { "type": "object", "properties": { "group": { "type": "integer", "minimum": 1 } }, "required": ["group"], "additionalProperties": false } ], "description": "The country the provider serves: a word, or a group of the name pattern that prints it beside the name." },
|
|
181
|
+
"split": { "type": "string", "minLength": 1, "description": "Breaks one match into several records." },
|
|
182
|
+
"trim": { "type": "string", "minLength": 1, "description": "After `split`, a pattern applied to each part; group 1 is the name (the words before the address)." },
|
|
183
|
+
"fields": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"propertyNames": { "pattern": "^[a-zA-Z][a-zA-Z0-9]*$" },
|
|
186
|
+
"additionalProperties": { "oneOf": [ { "$ref": "#/definitions/finder" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/finder" } } ] }
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"never": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"additionalProperties": false,
|
|
193
|
+
"required": ["reason"],
|
|
194
|
+
"minProperties": 2,
|
|
195
|
+
"description": "A structural rule, never a list of names (owner, 2026-10-21): `in`, a name found inside sections of these kinds; `after`, a name printed right after this wording (\"regulated by\"); `pattern`, the shape of a name (a defined term, \"^the \\w+$\"). A layout never carries a document's own names.",
|
|
196
|
+
"properties": {
|
|
197
|
+
"kind": { "type": "string", "enum": ["fund", "share-class", "manager", "service-provider", "person", "deal", "any"] },
|
|
198
|
+
"in": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Section kinds: a name found inside one of them is never a record of this kind." },
|
|
199
|
+
"after": { "type": "string", "minLength": 1, "description": "A wording the name follows on the page: 'regulated by', 'compared against'." },
|
|
200
|
+
"pattern": { "type": "string", "minLength": 1, "description": "The shape of a name, never a particular name." },
|
|
201
|
+
"roles": { "type": "array", "minItems": 1, "items": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" }, "description": "Roles the rule spares: a record given with one of these roles (a country's representative or paying agent in the notices) is kept. A record with no role is held by the rule." },
|
|
202
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"oneOrMore": {
|
|
206
|
+
"oneOf": [
|
|
207
|
+
{ "type": "string", "minLength": 1 },
|
|
208
|
+
{ "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -137,7 +137,32 @@
|
|
|
137
137
|
"properties": {
|
|
138
138
|
"node": { "type": "string", "minLength": 1 },
|
|
139
139
|
"config": { "type": "object" },
|
|
140
|
-
"chunks": { "oneOf": [{ "type": "integer", "minimum": 1 }, { "const": "all" }], "description": "How many of the document's chunks it is handed: the best few by the object's words (default 4), or all of them." }
|
|
140
|
+
"chunks": { "oneOf": [{ "type": "integer", "minimum": 1 }, { "const": "all" }], "description": "How many of the document's chunks it is handed: the best few by the object's words (default 4), or all of them." },
|
|
141
|
+
"cacheable": { "type": "boolean", "description": "This read's answers may be reused, remembered under the version the called deployment reports at its /ready; a deployment that reports none is never remembered (pipelines README, A read may be remembered)." }
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"tables": {
|
|
145
|
+
"type": "object",
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"description": "Read from the document's tables too: a table's labels matched to the object's props by their wordings, a matched cell's value copied as printed (pipelines/tables.md).",
|
|
148
|
+
"properties": {
|
|
149
|
+
"whose": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"required": ["node"],
|
|
152
|
+
"additionalProperties": false,
|
|
153
|
+
"description": "The node that says which of the document's rows a table is about, when the document is linked to more than one.",
|
|
154
|
+
"properties": { "node": { "type": "string", "minLength": 1 }, "config": { "type": "object" } }
|
|
155
|
+
},
|
|
156
|
+
"subject": { "type": "boolean", "description": "The object is what the document is about: a label | value table fills the row of this kind the document is linked to." },
|
|
157
|
+
"labels": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"required": ["node"],
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"description": "The node that proposes a field for a table label no rule matched (column matching step 4): asked once per org, one call per document; a person approves it in Review. Absent: the step is off.",
|
|
162
|
+
"properties": { "node": { "type": "string", "minLength": 1 }, "config": { "type": "object" } }
|
|
163
|
+
},
|
|
164
|
+
"allocations": { "type": "string", "minLength": 1, "description": "The object's line an allocation table draws to each fund it holds, carrying the weight (pipelines/tables.md 3c)." },
|
|
165
|
+
"boards": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "The object's lines a board list may draw, each to whose board it is (the line whose kind the organisation is), carrying the role (pipelines/tables.md 3d)." }
|
|
141
166
|
}
|
|
142
167
|
},
|
|
143
168
|
"parts": {
|
|
@@ -22,7 +22,7 @@ import { problems, reset, report, state } from "../context.mjs";
|
|
|
22
22
|
import { validateAgainst, Validator } from "../nodes/schema.mjs";
|
|
23
23
|
import {
|
|
24
24
|
envelopeFindings, propsFindings, fromFindings, serviceFindings, makeFindings, rowKeyFindings, objectTestFindings,
|
|
25
|
-
pipelineFindings, pipelineFolderFindings,
|
|
25
|
+
pipelineFindings, pipelineFolderFindings, layoutFindings,
|
|
26
26
|
} from "./rules.mjs";
|
|
27
27
|
|
|
28
28
|
const require_ = createRequire(import.meta.url);
|
|
@@ -29,7 +29,9 @@ export const ELEMENTS = new Set(["purpose", "story", "content", "capability", "p
|
|
|
29
29
|
export const FACE_KEYS = ["title", "description", "whenToUse", "category", "version"];
|
|
30
30
|
|
|
31
31
|
/** The prop grammar of UNOVERSE_AUTHORING 3b plus the object's one word, `from` (README 4c). */
|
|
32
|
-
|
|
32
|
+
// `none` IS NO DEFAULT (2026-10-15): it is what a cell that STATES there is none ("None", "N/A") stands for, so a
|
|
33
|
+
// stated "no performance fee" is 0 and a fee nobody states stays empty.
|
|
34
|
+
export const PROP_KEYS = new Set(["type", "input", "description", "from", "hydrate", "enum", "oneOf", "minLength", "maxLength", "minItems", "maxItems", "items", "reuse", "answeredBy", "standard", "wordings", "format", "pattern", "none"]);
|
|
33
35
|
export const LIMIT_KEYS = ["minLength", "maxLength", "minItems", "maxItems"];
|
|
34
36
|
|
|
35
37
|
/** Words that left the object grammar and must not come back (README 11.7, 12.3, 12.4). */
|
|
@@ -96,7 +98,9 @@ export function envelopeFindings(name, envelope, file = `${name}.yaml`) {
|
|
|
96
98
|
if (pairs.length !== 1 || pairs.some(([a, b]) => typeof a !== "string" || typeof b !== "string" || !a || !b)) refuse(`object ${name}: link ${ln}: match is one pair, this row's field naming that row's ({ manager: legalName })`);
|
|
97
99
|
if (l.between != null || l.order != null) refuse(`object ${name}: link ${ln}: a line to another object says to and match, never between or order`);
|
|
98
100
|
if (l.alike != null && (!Array.isArray(l.alike) || l.alike.some((f) => typeof f !== "string" || !pairs.some(([a]) => a === f)))) refuse(`object ${name}: link ${ln}: alike lists this row's match field whose value may name one thing several ways`);
|
|
99
|
-
|
|
101
|
+
// WHAT A LINE CARRIES (relationships-and-labels.md, 2026-10-14) is fields of this row, by name.
|
|
102
|
+
if (l.carries != null && (!Array.isArray(l.carries) || l.carries.some((f) => typeof f !== "string" || !f))) refuse(`object ${name}: link ${ln}: carries lists fields of this row each line keeps ([role])`);
|
|
103
|
+
for (const k of Object.keys(l)) if (!["type", "to", "match", "when", "alike", "carries"].includes(k)) say(`object ${name}: link ${ln}: "${k}" is not a word here`);
|
|
100
104
|
continue;
|
|
101
105
|
}
|
|
102
106
|
if (!Array.isArray(l.between) || !l.between.length || l.between.some((f) => typeof f !== "string")) refuse(`object ${name}: link ${ln}: between is a list of the fields whose equal values make one line of rows`);
|
|
@@ -160,6 +164,13 @@ export function propsFindings(name, ownProps, parentProps = null, base = null, f
|
|
|
160
164
|
if (raw.type === "array" && !isRecord(raw.items)) say(`object ${name}: prop "${k}" is an array and carries no items: an array says the shape of one element, in the same grammar one level down (README 4c)`);
|
|
161
165
|
if (raw.answeredBy != null && (!Array.isArray(raw.answeredBy) || !raw.answeredBy.length || raw.answeredBy.some((d) => typeof d !== "string" || !d.trim()))) say(`object ${name}: prop "${k}": answeredBy is a list of the document kinds that may answer it, e.g. [offering-memorandum, side-letter]`);
|
|
162
166
|
if (raw.answeredBy != null && raw.input !== true) say(`object ${name}: prop "${k}" says answeredBy but not input: true; only a field read from documents is answered by one`);
|
|
167
|
+
// A FIELD A TABLE CAN FILL (pipelines/tables.md, 2026-10-12): `standard` is its id in the org's
|
|
168
|
+
// field list, `wordings` the words documents print for it, matched exactly after lower case.
|
|
169
|
+
if (raw.standard != null && (typeof raw.standard !== "string" || !raw.standard.trim())) say(`object ${name}: prop "${k}": standard is the field's id in the org's field list, one word (OFST452010)`);
|
|
170
|
+
if (raw.wordings != null && (!Array.isArray(raw.wordings) || !raw.wordings.length || raw.wordings.some((w) => typeof w !== "string" || !w.trim()))) say(`object ${name}: prop "${k}": wordings is a list of the words documents print for this field, e.g. [management fee, mgmt fee]`);
|
|
171
|
+
if (raw.pattern != null) { try { if (typeof raw.pattern !== "string" || !raw.pattern.trim()) throw 0; new RegExp(raw.pattern); } catch { say(`object ${name}: prop "${k}": pattern is the regular expression a value must match, e.g. ^[A-Z]{2}[A-Z0-9]{9}[0-9]$; a value that does not match is never saved`); } }
|
|
172
|
+
if (raw.format != null && raw.format !== "date" && raw.format !== "country") say(`object ${name}: prop "${k}": format is date, country, or nothing (a date is written yyyy-mm-dd; a country is held by its one name from ISO 3166, "UK" saved as United Kingdom)`);
|
|
173
|
+
if ((raw.standard != null || raw.wordings != null) && raw.input !== true) say(`object ${name}: prop "${k}" says standard or wordings but not input: true; only a field read from documents is filled from a table`);
|
|
163
174
|
}
|
|
164
175
|
// FILLED FROM DOCUMENTS, EVERY FIELD SAYS WHICH (proved-before-built.md, ruled 2026-10-07): an
|
|
165
176
|
// object one of whose fields names the documents that answer it is filled from documents, so
|
|
@@ -313,7 +324,7 @@ export const PIPELINE_READ_KEYS = new Set(["each", "sourceUrl", "sourceId", "con
|
|
|
313
324
|
const DROPPED_MAKE_KEYS = ["partsOf", "by", "under", "when", "from", "any", "index"];
|
|
314
325
|
|
|
315
326
|
/** What an object may say: under `each`, how many and what it holds; made once per pack, how many and from which rows. */
|
|
316
|
-
const ITEM_OBJECT_KEYS = new Set(["cardinality", "any", "parts", "where", "per", "read"]);
|
|
327
|
+
const ITEM_OBJECT_KEYS = new Set(["cardinality", "any", "parts", "where", "per", "read", "tables"]);
|
|
317
328
|
const FIELD = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
318
329
|
|
|
319
330
|
/**
|
|
@@ -390,7 +401,11 @@ export function pipelineFindings(name, file, fileName = "pipeline.yaml") {
|
|
|
390
401
|
}
|
|
391
402
|
if (made.includes(o)) refuse(`pipeline ${name}: ${at}.${o} is made above already; one entry makes an object`);
|
|
392
403
|
const allowed = ITEM_OBJECT_KEYS;
|
|
393
|
-
for (const k of Object.keys(spec)) if (!allowed.has(k)) refuse(`pipeline ${name}: ${at}.${o}: "${k}" is not a word here; an object says cardinality, any, parts, where, per and
|
|
404
|
+
for (const k of Object.keys(spec)) if (!allowed.has(k)) refuse(`pipeline ${name}: ${at}.${o}: "${k}" is not a word here; an object says cardinality, any, parts, where, per, read and tables (${see})`);
|
|
405
|
+
if ("tables" in spec && (!isRecord(spec.tables) || ("whose" in spec.tables && (!isRecord(spec.tables.whose) || typeof spec.tables.whose.node !== "string" || !spec.tables.whose.node)))) refuse(`pipeline ${name}: ${at}.${o}: tables is a record; its whose names the node that says which row a table is about: tables: { whose: { node: OpenAIDecision, config: { ... } } } (pipelines/tables.md)`);
|
|
406
|
+
if (isRecord(spec.tables) && "labels" in spec.tables && (!isRecord(spec.tables.labels) || typeof spec.tables.labels.node !== "string" || !spec.tables.labels.node)) refuse(`pipeline ${name}: ${at}.${o}: tables.labels names the node that proposes a field for a label no rule matched: tables: { labels: { node: OpenAIDecision, config: { ... } } } (pipelines/tables.md)`);
|
|
407
|
+
if (isRecord(spec.tables) && "allocations" in spec.tables && (typeof spec.tables.allocations !== "string" || !spec.tables.allocations)) refuse(`pipeline ${name}: ${at}.${o}: tables.allocations names the line an allocation table draws to each fund it holds: tables: { allocations: allocatesTo } (pipelines/tables.md 3c)`);
|
|
408
|
+
if (isRecord(spec.tables) && "boards" in spec.tables && (!Array.isArray(spec.tables.boards) || !spec.tables.boards.length || !spec.tables.boards.every((b) => typeof b === "string" && b))) refuse(`pipeline ${name}: ${at}.${o}: tables.boards names the lines a board list may draw, each to whose board it is: tables: { boards: [directorOf, worksAt] } (pipelines/tables.md 3d)`);
|
|
394
409
|
if ("read" in spec && (!isRecord(spec.read) || typeof spec.read.node !== "string" || !spec.read.node)) refuse(`pipeline ${name}: ${at}.${o}: read names the node that reads the pages: read: { node: BeamEndpoint, config: { ... } } (${see})`);
|
|
395
410
|
if ("read" in spec && spec.per !== "page") refuse(`pipeline ${name}: ${at}.${o}: read is how an object written per page is read; say per: page beside it (${see})`);
|
|
396
411
|
if ("per" in spec && spec.per !== "page") refuse(`pipeline ${name}: ${at}.${o}: per says page, the only unit an object is written per; there are no sections (page-store.md) (${see})`);
|
|
@@ -467,6 +482,70 @@ export function pipelineFolderFindings(name, { file, config, test }, { nodeTypes
|
|
|
467
482
|
}
|
|
468
483
|
|
|
469
484
|
/** The first error's message. */
|
|
485
|
+
// ── Layouts ─────────────────────────────────────────────────────────────────────────────────────────
|
|
486
|
+
/**
|
|
487
|
+
* A LAYOUT NAMES NO DOCUMENT (docs/unoverse/data/pipelines/document-map.md, owner 2026-10-21, seeing a
|
|
488
|
+
* draft carry "EAM B.V." and "TL-X"). A layout is the map of a document TYPE: it speaks in the type's
|
|
489
|
+
* structure and wording, never in a fund's, a firm's, an index's or a ticker's name. Names belong on
|
|
490
|
+
* records. Refused here, so a layout that fits one house's documents is never loaded.
|
|
491
|
+
*/
|
|
492
|
+
/** A legal form as one word of a name, in any jurisdiction's spelling: the mark of a firm's or a fund's name. */
|
|
493
|
+
const LEGAL_FORM_WORD = /^(?:Ltd|Limited|LLC|LLP|L\.?P\.?|LP|plc|PLC|Inc\.?|Corp\.?|Co\.?|GmbH|AG|S\.?A\.?|S\.?C\.?A\.?|S\.?p\.?A\.?|SpA|B\.?V\.?|BV|N\.?V\.?|NV|S\.?à\.?r\.?l\.?|SARL|Sàrl|Pte\.?|Pty\.?|KGaA|KG|ApS|AB|AS|Oy|SE|SAS|SL|SRL|Srl|V)\.?$/;
|
|
494
|
+
const LAYOUT_TEXT_KEYS = new Set(["pattern", "after", "heading", "text", "row", "table", "say", "describe", "trim", "split"]);
|
|
495
|
+
const LAYOUT_NAME_KEYS = new Set(["names", "sameAs", "neverMerge", "aliases"]);
|
|
496
|
+
/** Every capitalised run of two or more words in a string, regex syntax and escapes aside. */
|
|
497
|
+
function capitalisedRuns(str) {
|
|
498
|
+
// Regex syntax is not words: character classes, counts, escapes and group openers go before the words are read.
|
|
499
|
+
const plain = String(str).replace(/\(\?<?[!=][^)]*\)/g, " ").replace(/\[[^\]]*\]/g, " ").replace(/\{[^}]*\}/g, " ").replace(/\\[A-Za-z]/g, " ").replace(/\(\?[:!=<]?/g, " ").replace(/[\[\]()|^$?*+{}.\\]/g, " ").replace(/\s+/g, " ");
|
|
500
|
+
return [...plain.matchAll(/(?:\b[A-Z][\w'&.-]*(?: (?:of|de|di|du|des|and|&) )?\s?){2,}/g)].map((m) => m[0].trim()).filter((r) => r.split(/\s+/).length >= 2);
|
|
501
|
+
}
|
|
502
|
+
/** A ticker or an identifier spelled out: letters and digits run together ("LU0000000000", "ABCDEF LX", "X1AA"), or an ISIN shape. */
|
|
503
|
+
const LITERAL_CODE = /\b(?:[A-Z]{2}[A-Z0-9]{9}\d|[A-Z]{4,}\s[A-Z]{2}|[A-Z]+\d+[A-Z]+|TL-[A-Z]\d*)\b/;
|
|
504
|
+
/**
|
|
505
|
+
* The same inside a finder that reads any case (`case: any`, 2026-10-24): there capitals are the type's wording as printed
|
|
506
|
+
* ("A SUB-FUND OF THE"), so a word of four capitals then one of two is a ticker only when the two stand alone ("ABCDEF LX");
|
|
507
|
+
* a code with digits or an identifier's shape is refused as everywhere.
|
|
508
|
+
*/
|
|
509
|
+
const LITERAL_CODE_ANY_CASE = /\b(?:[A-Z]{2}[A-Z0-9]{9}\d|[A-Z]+\d+[A-Z]+|TL-[A-Z]\d*)\b|(?<![A-Za-z][\s-]?)\b[A-Z]{4,}\s[A-Z]{2}\b(?![\s-]?[A-Za-z])/;
|
|
510
|
+
export function layoutFindings(name, file, fileName = `${name}.yaml`) {
|
|
511
|
+
const out = [];
|
|
512
|
+
const refuse = (msg) => out.push({ file: fileName, msg, refuses: true });
|
|
513
|
+
if (!isRecord(file)) return [{ file: fileName, msg: `layout ${name}: ${fileName} must be a record`, refuses: true }];
|
|
514
|
+
const walk = (v, path, anyCase = false) => {
|
|
515
|
+
if (Array.isArray(v)) { v.forEach((x, i) => walk(x, `${path}[${i}]`, anyCase)); return; }
|
|
516
|
+
if (isRecord(v)) {
|
|
517
|
+
// A FINDER THAT READS ANY CASE (`case: any`): its own strings are wording, capitals and all; a record beneath it is its own.
|
|
518
|
+
const own = v.case === "any";
|
|
519
|
+
for (const [k, x] of Object.entries(v)) {
|
|
520
|
+
if (LAYOUT_NAME_KEYS.has(k)) refuse(`layout ${name}: "${k}" at ${path} lists names; a layout names no document, aliases live on records (document-map.md, 2026-10-21)`);
|
|
521
|
+
else if (k === "map" && isRecord(x)) { for (const [from, to] of Object.entries(x)) for (const t of [from, String(to)]) check(t, `${path}.map`); }
|
|
522
|
+
else walk(x, path ? `${path}.${k}` : k, own && typeof x === "string");
|
|
523
|
+
}
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
if (typeof v === "string") { const key = path.split(/[.[]/).pop()?.replace("]", ""); if (LAYOUT_TEXT_KEYS.has(key)) check(v, path, anyCase); }
|
|
527
|
+
};
|
|
528
|
+
const check = (str, path, anyCase = false) => {
|
|
529
|
+
// BY STRUCTURE, NEVER BY A WORD LIST (owner 2026-10-24: a list of a document type's words grew from one org's documents).
|
|
530
|
+
// A name shows itself two ways: a capitalised run that ends in a legal form and holds a word that is not one
|
|
531
|
+
// ("Example Asset Management B.V."; an alternation of legal forms alone is pattern syntax), and a `never` pattern that
|
|
532
|
+
// is plain words with no regular-expression structure, which can only be one name. Wording a pattern matches or maps
|
|
533
|
+
// ("No Distribution", "Swiss Paying Agent") is the type's own and carries no name.
|
|
534
|
+
const plain = String(str).replace(/\\[A-Za-z]/g, " ");
|
|
535
|
+
for (const run of capitalisedRuns(plain)) {
|
|
536
|
+
const words = run.split(/\s+/).filter(Boolean);
|
|
537
|
+
const last = words[words.length - 1] ?? "";
|
|
538
|
+
// A lone capital letter is a legal form's initial once its dots are gone ("S A", "B V"), never a word of a name.
|
|
539
|
+
const ownWords = words.filter((w) => !LEGAL_FORM_WORD.test(w) && !/^[A-Z]$/.test(w) && !/^(?:of|de|di|du|des|and|&)$/i.test(w));
|
|
540
|
+
if (LEGAL_FORM_WORD.test(last) && ownWords.length >= 1) refuse(`layout ${name}: "${run}" at ${path} reads like a name (a legal form ends it); a layout names no document (document-map.md, 2026-10-21)`);
|
|
541
|
+
}
|
|
542
|
+
if (/(^|\.)never\[\d+\]\.pattern$/.test(path) && !/[\\^$.*+?()[\]{}|]/.test(str) && /[A-Z]/.test(str)) refuse(`layout ${name}: "${str.slice(0, 60)}" at ${path} reads like a name (plain words with no structure); a never rule is structural (document-map.md, 2026-10-21)`);
|
|
543
|
+
if ((anyCase ? LITERAL_CODE_ANY_CASE : LITERAL_CODE).test(str.replace(/\[[^\]]*\]|\{[^}]*\}|\\[A-Za-z]/g, " "))) refuse(`layout ${name}: "${str.slice(0, 60)}" at ${path} spells out a code or ticker; a layout names no document (document-map.md, 2026-10-21)`);
|
|
544
|
+
};
|
|
545
|
+
walk(file, "");
|
|
546
|
+
return out;
|
|
547
|
+
}
|
|
548
|
+
|
|
470
549
|
export function firstError(findings) {
|
|
471
550
|
const f = findings.find((x) => !x.level || x.level === "error");
|
|
472
551
|
return f ? f.msg : null;
|