@rasensio/aidlc 1.16.0 → 1.17.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/README.md +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/compliance.d.ts +36 -0
- package/dist/commands/compliance.d.ts.map +1 -0
- package/dist/commands/compliance.js +275 -0
- package/dist/commands/compliance.js.map +1 -0
- package/dist/commands/constitution.d.ts +26 -0
- package/dist/commands/constitution.d.ts.map +1 -0
- package/dist/commands/constitution.js +145 -0
- package/dist/commands/constitution.js.map +1 -0
- package/dist/commands/cost.d.ts.map +1 -1
- package/dist/commands/cost.js +54 -35
- package/dist/commands/cost.js.map +1 -1
- package/dist/commands/doctor.js +7 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/gate.d.ts.map +1 -1
- package/dist/commands/gate.js +13 -0
- package/dist/commands/gate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +119 -10
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/metrics.d.ts.map +1 -1
- package/dist/commands/metrics.js +6 -1
- package/dist/commands/metrics.js.map +1 -1
- package/dist/commands/review.d.ts +2 -27
- package/dist/commands/review.d.ts.map +1 -1
- package/dist/commands/review.js +10 -166
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +7 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/transition.d.ts.map +1 -1
- package/dist/commands/transition.js +24 -1
- package/dist/commands/transition.js.map +1 -1
- package/dist/compile/adapters/claude-code.d.ts.map +1 -1
- package/dist/compile/adapters/claude-code.js +2 -1
- package/dist/compile/adapters/claude-code.js.map +1 -1
- package/dist/compile/adapters/codex.d.ts +22 -1
- package/dist/compile/adapters/codex.d.ts.map +1 -1
- package/dist/compile/adapters/codex.js +61 -27
- package/dist/compile/adapters/codex.js.map +1 -1
- package/dist/compile/adapters/cursor.d.ts.map +1 -1
- package/dist/compile/adapters/cursor.js +2 -19
- package/dist/compile/adapters/cursor.js.map +1 -1
- package/dist/compile/adapters/kiro.d.ts.map +1 -1
- package/dist/compile/adapters/kiro.js +1 -19
- package/dist/compile/adapters/kiro.js.map +1 -1
- package/dist/compile/adapters/windsurf.d.ts.map +1 -1
- package/dist/compile/adapters/windsurf.js +2 -1
- package/dist/compile/adapters/windsurf.js.map +1 -1
- package/dist/compile/guidance-install.d.ts +16 -19
- package/dist/compile/guidance-install.d.ts.map +1 -1
- package/dist/compile/guidance-install.js +26 -111
- package/dist/compile/guidance-install.js.map +1 -1
- package/dist/compile/layer-install.d.ts +122 -0
- package/dist/compile/layer-install.d.ts.map +1 -0
- package/dist/compile/layer-install.js +195 -0
- package/dist/compile/layer-install.js.map +1 -0
- package/dist/compile/loaders.d.ts +14 -0
- package/dist/compile/loaders.d.ts.map +1 -1
- package/dist/compile/loaders.js +23 -18
- package/dist/compile/loaders.js.map +1 -1
- package/dist/compile/skill-format.d.ts +39 -0
- package/dist/compile/skill-format.d.ts.map +1 -0
- package/dist/compile/skill-format.js +50 -0
- package/dist/compile/skill-format.js.map +1 -0
- package/dist/compliance/check.d.ts +79 -0
- package/dist/compliance/check.d.ts.map +1 -0
- package/dist/compliance/check.js +224 -0
- package/dist/compliance/check.js.map +1 -0
- package/dist/compliance/config.d.ts +91 -0
- package/dist/compliance/config.d.ts.map +1 -0
- package/dist/compliance/config.js +173 -0
- package/dist/compliance/config.js.map +1 -0
- package/dist/compliance/findings.d.ts +70 -0
- package/dist/compliance/findings.d.ts.map +1 -0
- package/dist/compliance/findings.js +132 -0
- package/dist/compliance/findings.js.map +1 -0
- package/dist/compliance/gate-criterion.d.ts +87 -0
- package/dist/compliance/gate-criterion.d.ts.map +1 -0
- package/dist/compliance/gate-criterion.js +168 -0
- package/dist/compliance/gate-criterion.js.map +1 -0
- package/dist/compliance/install.d.ts +135 -0
- package/dist/compliance/install.d.ts.map +1 -0
- package/dist/compliance/install.js +291 -0
- package/dist/compliance/install.js.map +1 -0
- package/dist/compliance/report.d.ts +144 -0
- package/dist/compliance/report.d.ts.map +1 -0
- package/dist/compliance/report.js +347 -0
- package/dist/compliance/report.js.map +1 -0
- package/dist/compliance/resolver.d.ts +65 -0
- package/dist/compliance/resolver.d.ts.map +1 -0
- package/dist/compliance/resolver.js +176 -0
- package/dist/compliance/resolver.js.map +1 -0
- package/dist/compliance/schema.d.ts +74 -0
- package/dist/compliance/schema.d.ts.map +1 -0
- package/dist/compliance/schema.js +474 -0
- package/dist/compliance/schema.js.map +1 -0
- package/dist/compliance/types.d.ts +140 -0
- package/dist/compliance/types.d.ts.map +1 -0
- package/dist/compliance/types.js +29 -0
- package/dist/compliance/types.js.map +1 -0
- package/dist/constitution/check.d.ts +22 -0
- package/dist/constitution/check.d.ts.map +1 -0
- package/dist/constitution/check.js +89 -0
- package/dist/constitution/check.js.map +1 -0
- package/dist/constitution/docx.d.ts +51 -0
- package/dist/constitution/docx.d.ts.map +1 -0
- package/dist/constitution/docx.js +157 -0
- package/dist/constitution/docx.js.map +1 -0
- package/dist/constitution/entries.d.ts +27 -0
- package/dist/constitution/entries.d.ts.map +1 -0
- package/dist/constitution/entries.js +65 -0
- package/dist/constitution/entries.js.map +1 -0
- package/dist/constitution/extract.d.ts +34 -0
- package/dist/constitution/extract.d.ts.map +1 -0
- package/dist/constitution/extract.js +117 -0
- package/dist/constitution/extract.js.map +1 -0
- package/dist/constitution/snapshot.d.ts +47 -0
- package/dist/constitution/snapshot.d.ts.map +1 -0
- package/dist/constitution/snapshot.js +159 -0
- package/dist/constitution/snapshot.js.map +1 -0
- package/dist/constitution/statements.d.ts +37 -0
- package/dist/constitution/statements.d.ts.map +1 -0
- package/dist/constitution/statements.js +64 -0
- package/dist/constitution/statements.js.map +1 -0
- package/dist/constitution/types.d.ts +80 -0
- package/dist/constitution/types.d.ts.map +1 -0
- package/dist/constitution/types.js +9 -0
- package/dist/constitution/types.js.map +1 -0
- package/dist/core/gate.d.ts +10 -0
- package/dist/core/gate.d.ts.map +1 -1
- package/dist/core/gate.js.map +1 -1
- package/dist/core/paths.d.ts +48 -0
- package/dist/core/paths.d.ts.map +1 -0
- package/dist/core/paths.js +57 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/types.d.ts +12 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/cost/hooks/registry.d.ts +44 -0
- package/dist/cost/hooks/registry.d.ts.map +1 -0
- package/dist/cost/hooks/registry.js +66 -0
- package/dist/cost/hooks/registry.js.map +1 -0
- package/dist/cost/pin.d.ts +63 -0
- package/dist/cost/pin.d.ts.map +1 -0
- package/dist/cost/pin.js +95 -0
- package/dist/cost/pin.js.map +1 -0
- package/dist/cost/providers/claude-code.d.ts +9 -2
- package/dist/cost/providers/claude-code.d.ts.map +1 -1
- package/dist/cost/providers/claude-code.js +10 -5
- package/dist/cost/providers/claude-code.js.map +1 -1
- package/dist/cost/providers/codex.d.ts +107 -0
- package/dist/cost/providers/codex.d.ts.map +1 -0
- package/dist/cost/providers/codex.js +283 -0
- package/dist/cost/providers/codex.js.map +1 -0
- package/dist/cost/providers/index.d.ts.map +1 -1
- package/dist/cost/providers/index.js +6 -0
- package/dist/cost/providers/index.js.map +1 -1
- package/dist/cost/rates.d.ts.map +1 -1
- package/dist/cost/rates.js +14 -0
- package/dist/cost/rates.js.map +1 -1
- package/dist/cost/report.d.ts +23 -1
- package/dist/cost/report.d.ts.map +1 -1
- package/dist/cost/report.js +26 -5
- package/dist/cost/report.js.map +1 -1
- package/dist/cost/sessions.d.ts +10 -1
- package/dist/cost/sessions.d.ts.map +1 -1
- package/dist/cost/sessions.js +10 -2
- package/dist/cost/sessions.js.map +1 -1
- package/dist/cost/sync.d.ts.map +1 -1
- package/dist/cost/sync.js +190 -5
- package/dist/cost/sync.js.map +1 -1
- package/dist/doctor/migrations/compliance-pack-drift.d.ts +62 -0
- package/dist/doctor/migrations/compliance-pack-drift.d.ts.map +1 -0
- package/dist/doctor/migrations/compliance-pack-drift.js +255 -0
- package/dist/doctor/migrations/compliance-pack-drift.js.map +1 -0
- package/dist/doctor/migrations/index.d.ts.map +1 -1
- package/dist/doctor/migrations/index.js +11 -0
- package/dist/doctor/migrations/index.js.map +1 -1
- package/dist/doctor/migrations/legacy-cost-hooks.d.ts.map +1 -1
- package/dist/doctor/migrations/legacy-cost-hooks.js +7 -4
- package/dist/doctor/migrations/legacy-cost-hooks.js.map +1 -1
- package/dist/doctor/migrations/missing-cost-shim.d.ts.map +1 -1
- package/dist/doctor/migrations/missing-cost-shim.js +5 -4
- package/dist/doctor/migrations/missing-cost-shim.js.map +1 -1
- package/dist/doctor/migrations/outdated-cost-hooks.d.ts.map +1 -1
- package/dist/doctor/migrations/outdated-cost-hooks.js +7 -4
- package/dist/doctor/migrations/outdated-cost-hooks.js.map +1 -1
- package/dist/doctor/runner.js +14 -0
- package/dist/doctor/runner.js.map +1 -1
- package/dist/doctor/types.d.ts +35 -3
- package/dist/doctor/types.d.ts.map +1 -1
- package/dist/menu/roster.d.ts.map +1 -1
- package/dist/menu/roster.js +5 -0
- package/dist/menu/roster.js.map +1 -1
- package/dist/metrics/report.d.ts.map +1 -1
- package/dist/metrics/report.js +11 -2
- package/dist/metrics/report.js.map +1 -1
- package/dist/review/findings-parser.d.ts +92 -0
- package/dist/review/findings-parser.d.ts.map +1 -0
- package/dist/review/findings-parser.js +196 -0
- package/dist/review/findings-parser.js.map +1 -0
- package/dist/setup/setup-compute.d.ts +10 -15
- package/dist/setup/setup-compute.d.ts.map +1 -1
- package/dist/setup/setup-compute.js +39 -0
- package/dist/setup/setup-compute.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance pack validation.
|
|
3
|
+
*
|
|
4
|
+
* The whole pack is validated before any part of it is installed, and every
|
|
5
|
+
* problem is collected rather than the first one thrown. A pack with one
|
|
6
|
+
* malformed control installs nothing — a partially installed pack is worse than
|
|
7
|
+
* an absent one, because it looks like a working install.
|
|
8
|
+
*
|
|
9
|
+
* Absence is never a default. Every field named in the schema must be present, so
|
|
10
|
+
* an omitted `reviewed_by` cannot quietly read as "reviewed", and an omitted
|
|
11
|
+
* `kind` cannot quietly read as `checked-only`.
|
|
12
|
+
*
|
|
13
|
+
* Two bounds exist for one reason: **pack text becomes instructions an agent
|
|
14
|
+
* executes.** Control text is rendered into a review prompt, and a constraint
|
|
15
|
+
* layer is copied to disk and read on every phase. Both are bounded in length and
|
|
16
|
+
* both reject `{{` placeholder syntax, because placeholder resolution runs the
|
|
17
|
+
* guidance pass before the glossary pass deliberately — so a `{{glossary:...}}`
|
|
18
|
+
* inside a layer body would expand when inlined. Bounding the input closes that at
|
|
19
|
+
* the source rather than relying on the delivery mechanism to make it unreachable.
|
|
20
|
+
*
|
|
21
|
+
* Requirements: compliance-packs/AC-1, AC-2, AC-3, AC-4, AC-5, AC-7, AC-65, AC-105
|
|
22
|
+
*/
|
|
23
|
+
import type { Pack } from './types.js';
|
|
24
|
+
/**
|
|
25
|
+
* Maximum characters in any single control prose field.
|
|
26
|
+
*
|
|
27
|
+
* Sized to hold a full regime clause and its fail condition comfortably while
|
|
28
|
+
* ruling out a smuggled instruction block. The shipped SOC 2 pack's longest field
|
|
29
|
+
* is well under half of this.
|
|
30
|
+
*/
|
|
31
|
+
export declare const MAX_CONTROL_FIELD_CHARS = 1000;
|
|
32
|
+
/** Maximum characters across all of a pack's control text. */
|
|
33
|
+
export declare const MAX_PACK_CONTROL_CHARS = 40000;
|
|
34
|
+
/** Maximum characters in a single constraint-layer body. */
|
|
35
|
+
export declare const MAX_LAYER_BODY_CHARS = 20000;
|
|
36
|
+
/** Maximum characters across all of a pack's constraint-layer bodies. */
|
|
37
|
+
export declare const MAX_PACK_LAYER_CHARS = 60000;
|
|
38
|
+
/**
|
|
39
|
+
* The notice a pack with `reviewed_by: null` must carry in its constraint text.
|
|
40
|
+
*
|
|
41
|
+
* Matched case-insensitively as a substring, so a pack may word the surrounding
|
|
42
|
+
* sentence freely. Held in three places — here, the report generator, and a doctor
|
|
43
|
+
* check — because a notice that lives only in installed text can be edited away
|
|
44
|
+
* permanently, since a locally edited layer is preserved forever by design.
|
|
45
|
+
*/
|
|
46
|
+
export declare const UNREVIEWED_NOTICE = "not been reviewed by a compliance practitioner";
|
|
47
|
+
/** The raw text of a pack, as read from disk by the resolver. */
|
|
48
|
+
export interface PackSources {
|
|
49
|
+
/** Pack directory name, which the metadata's `id` must match. */
|
|
50
|
+
id: string;
|
|
51
|
+
/** Contents of `pack.yaml`. */
|
|
52
|
+
packYaml: string;
|
|
53
|
+
/** Contents of `controls.yaml`. */
|
|
54
|
+
controlsYaml: string;
|
|
55
|
+
/** Layer file name → body, for every layer the pack registers. */
|
|
56
|
+
layerBodies: Map<string, string>;
|
|
57
|
+
}
|
|
58
|
+
/** Outcome of validating a pack. Every problem, not just the first. */
|
|
59
|
+
export type PackValidation = {
|
|
60
|
+
ok: true;
|
|
61
|
+
pack: Pack;
|
|
62
|
+
} | {
|
|
63
|
+
ok: false;
|
|
64
|
+
errors: string[];
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Validate a whole pack from its raw sources.
|
|
68
|
+
*
|
|
69
|
+
* Pure: takes text, returns a verdict, touches no filesystem. The resolver does
|
|
70
|
+
* the reading and the containment checks; this decides whether the content is
|
|
71
|
+
* usable. Nothing is installed unless this returns `ok`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function validatePack(sources: PackSources): PackValidation;
|
|
74
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/compliance/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAKV,IAAI,EAIL,MAAM,YAAY,CAAC;AAMpB;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,8DAA8D;AAC9D,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C,4DAA4D;AAC5D,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,QAAS,CAAC;AA6B3C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,mDAAmD,CAAC;AAgUlF,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAExF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,cAAc,CAoHjE"}
|
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance pack validation.
|
|
3
|
+
*
|
|
4
|
+
* The whole pack is validated before any part of it is installed, and every
|
|
5
|
+
* problem is collected rather than the first one thrown. A pack with one
|
|
6
|
+
* malformed control installs nothing — a partially installed pack is worse than
|
|
7
|
+
* an absent one, because it looks like a working install.
|
|
8
|
+
*
|
|
9
|
+
* Absence is never a default. Every field named in the schema must be present, so
|
|
10
|
+
* an omitted `reviewed_by` cannot quietly read as "reviewed", and an omitted
|
|
11
|
+
* `kind` cannot quietly read as `checked-only`.
|
|
12
|
+
*
|
|
13
|
+
* Two bounds exist for one reason: **pack text becomes instructions an agent
|
|
14
|
+
* executes.** Control text is rendered into a review prompt, and a constraint
|
|
15
|
+
* layer is copied to disk and read on every phase. Both are bounded in length and
|
|
16
|
+
* both reject `{{` placeholder syntax, because placeholder resolution runs the
|
|
17
|
+
* guidance pass before the glossary pass deliberately — so a `{{glossary:...}}`
|
|
18
|
+
* inside a layer body would expand when inlined. Bounding the input closes that at
|
|
19
|
+
* the source rather than relying on the delivery mechanism to make it unreachable.
|
|
20
|
+
*
|
|
21
|
+
* Requirements: compliance-packs/AC-1, AC-2, AC-3, AC-4, AC-5, AC-7, AC-65, AC-105
|
|
22
|
+
*/
|
|
23
|
+
import { parse as parseYaml } from 'yaml';
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Bounds and vocabularies
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
/**
|
|
28
|
+
* Maximum characters in any single control prose field.
|
|
29
|
+
*
|
|
30
|
+
* Sized to hold a full regime clause and its fail condition comfortably while
|
|
31
|
+
* ruling out a smuggled instruction block. The shipped SOC 2 pack's longest field
|
|
32
|
+
* is well under half of this.
|
|
33
|
+
*/
|
|
34
|
+
export const MAX_CONTROL_FIELD_CHARS = 1000;
|
|
35
|
+
/** Maximum characters across all of a pack's control text. */
|
|
36
|
+
export const MAX_PACK_CONTROL_CHARS = 40_000;
|
|
37
|
+
/** Maximum characters in a single constraint-layer body. */
|
|
38
|
+
export const MAX_LAYER_BODY_CHARS = 20_000;
|
|
39
|
+
/** Maximum characters across all of a pack's constraint-layer bodies. */
|
|
40
|
+
export const MAX_PACK_LAYER_CHARS = 60_000;
|
|
41
|
+
/** Placeholder syntax, rejected anywhere in pack text. */
|
|
42
|
+
const PLACEHOLDER_RE = /\{\{/;
|
|
43
|
+
/** A fenced code block, rejected in control prose. */
|
|
44
|
+
const FENCE_RE = /(^|\n)\s*```/;
|
|
45
|
+
/** Pack and layer slugs: lowercase alphanumeric with interior hyphens. */
|
|
46
|
+
const SLUG_RE = /^[a-z][a-z0-9-]*$/;
|
|
47
|
+
/** A regime control id, e.g. `CC8.1`. Deliberately not regime-specific beyond shape. */
|
|
48
|
+
const CONTROL_ID_RE = /^[A-Z]{1,4}[0-9]+(\.[0-9]+)?$/;
|
|
49
|
+
const CONTROL_KINDS = ['evidenced', 'checked-only'];
|
|
50
|
+
const CHECK_KINDS = ['agent', 'mechanical'];
|
|
51
|
+
const SEVERITIES = ['critical', 'major', 'minor', 'info'];
|
|
52
|
+
const ENTITLEMENTS = ['unrestricted'];
|
|
53
|
+
const EXCLUSION_REASONS = ['organizational', 'not-yet-built'];
|
|
54
|
+
const PHASES = [
|
|
55
|
+
'ideation',
|
|
56
|
+
'requirements',
|
|
57
|
+
'design',
|
|
58
|
+
'implementation',
|
|
59
|
+
'testing',
|
|
60
|
+
'deployment',
|
|
61
|
+
'maintenance',
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* The notice a pack with `reviewed_by: null` must carry in its constraint text.
|
|
65
|
+
*
|
|
66
|
+
* Matched case-insensitively as a substring, so a pack may word the surrounding
|
|
67
|
+
* sentence freely. Held in three places — here, the report generator, and a doctor
|
|
68
|
+
* check — because a notice that lives only in installed text can be edited away
|
|
69
|
+
* permanently, since a locally edited layer is preserved forever by design.
|
|
70
|
+
*/
|
|
71
|
+
export const UNREVIEWED_NOTICE = 'not been reviewed by a compliance practitioner';
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
// Small helpers
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
/** Accumulates problems so a pack is reported whole rather than first-error-only. */
|
|
76
|
+
class Problems {
|
|
77
|
+
list = [];
|
|
78
|
+
add(message) {
|
|
79
|
+
this.list.push(message);
|
|
80
|
+
}
|
|
81
|
+
/** Require a non-empty string at `where`. Returns it, or null having recorded why. */
|
|
82
|
+
str(value, where) {
|
|
83
|
+
if (typeof value !== 'string') {
|
|
84
|
+
this.add(`${where}: expected a string, got ${describe(value)}`);
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
if (value.trim() === '') {
|
|
88
|
+
this.add(`${where}: must not be empty`);
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Require one of `allowed`.
|
|
95
|
+
*
|
|
96
|
+
* Reports the permitted values even when the field is absent or the wrong type.
|
|
97
|
+
* "expected a string, got nothing" tells a content author that something is
|
|
98
|
+
* missing but not what to write there, and the vocabulary is the whole point of
|
|
99
|
+
* an enumerated field.
|
|
100
|
+
*/
|
|
101
|
+
oneOf(value, where, allowed) {
|
|
102
|
+
if (typeof value !== 'string' || value.trim() === '') {
|
|
103
|
+
this.add(`${where}: expected one of ${allowed.join(', ')}, got ${describe(value)}`);
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
if (!allowed.includes(value)) {
|
|
107
|
+
this.add(`${where}: expected one of ${allowed.join(', ')}, got '${value}'`);
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
/** Bound a prose field's length and reject smuggled syntax. */
|
|
113
|
+
prose(value, where, max, opts = {}) {
|
|
114
|
+
if (value.length > max) {
|
|
115
|
+
this.add(`${where}: ${value.length} characters exceeds the ${max}-character limit`);
|
|
116
|
+
}
|
|
117
|
+
if (PLACEHOLDER_RE.test(value)) {
|
|
118
|
+
this.add(`${where}: must not contain '{{' placeholder syntax`);
|
|
119
|
+
}
|
|
120
|
+
if (!opts.allowFences && FENCE_RE.test(value)) {
|
|
121
|
+
this.add(`${where}: must not contain a fenced code block`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/** A short, safe description of an unexpected value — never its contents. */
|
|
126
|
+
function describe(value) {
|
|
127
|
+
if (value === null)
|
|
128
|
+
return 'null';
|
|
129
|
+
if (value === undefined)
|
|
130
|
+
return 'nothing';
|
|
131
|
+
if (Array.isArray(value))
|
|
132
|
+
return 'a list';
|
|
133
|
+
return typeof value;
|
|
134
|
+
}
|
|
135
|
+
/** Parse YAML, returning null rather than throwing. */
|
|
136
|
+
function parseObject(raw, where, problems) {
|
|
137
|
+
let parsed;
|
|
138
|
+
try {
|
|
139
|
+
parsed = parseYaml(raw);
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
problems.add(`${where}: is not valid YAML (${err.message})`);
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
146
|
+
problems.add(`${where}: expected a mapping, got ${describe(parsed)}`);
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return parsed;
|
|
150
|
+
}
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
// Field validators
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
/** Validate `pack.yaml`. `expectedId` is the directory name it must match. */
|
|
155
|
+
function validateMeta(raw, expectedId, problems) {
|
|
156
|
+
const where = 'pack.yaml';
|
|
157
|
+
// Every field is required. `reviewed_by` is checked separately because null is
|
|
158
|
+
// a legitimate value there and `str` would reject it.
|
|
159
|
+
const id = problems.str(raw.id, `${where}: id`);
|
|
160
|
+
const regime = problems.str(raw.regime, `${where}: regime`);
|
|
161
|
+
const version = problems.str(raw.version, `${where}: version`);
|
|
162
|
+
const entitlement = problems.oneOf(raw.entitlement, `${where}: entitlement`, ENTITLEMENTS);
|
|
163
|
+
if (id !== null && !SLUG_RE.test(id)) {
|
|
164
|
+
problems.add(`${where}: id '${id}' must be a lowercase slug`);
|
|
165
|
+
}
|
|
166
|
+
if (id !== null && id !== expectedId) {
|
|
167
|
+
problems.add(`${where}: id '${id}' does not match the pack directory '${expectedId}'`);
|
|
168
|
+
}
|
|
169
|
+
if (!Array.isArray(raw.industries)) {
|
|
170
|
+
problems.add(`${where}: industries: expected a list, got ${describe(raw.industries)}`);
|
|
171
|
+
}
|
|
172
|
+
else if (raw.industries.length === 0) {
|
|
173
|
+
problems.add(`${where}: industries: must name at least one industry, or ['any']`);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
for (const [i, value] of raw.industries.entries()) {
|
|
177
|
+
const s = problems.str(value, `${where}: industries[${i}]`);
|
|
178
|
+
if (s !== null && !SLUG_RE.test(s)) {
|
|
179
|
+
problems.add(`${where}: industries[${i}]: '${s}' must be a lowercase slug`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// Absent is not null. An omitted field must not read as an unreviewed draft,
|
|
184
|
+
// and must not read as a reviewed one either.
|
|
185
|
+
if (!('reviewed_by' in raw)) {
|
|
186
|
+
problems.add(`${where}: reviewed_by: required — use null for an unreviewed draft`);
|
|
187
|
+
}
|
|
188
|
+
else if (raw.reviewed_by !== null && typeof raw.reviewed_by !== 'string') {
|
|
189
|
+
problems.add(`${where}: reviewed_by: expected a string or null, got ${describe(raw.reviewed_by)}`);
|
|
190
|
+
}
|
|
191
|
+
else if (typeof raw.reviewed_by === 'string' && raw.reviewed_by.trim() === '') {
|
|
192
|
+
problems.add(`${where}: reviewed_by: use null rather than an empty string`);
|
|
193
|
+
}
|
|
194
|
+
if (id === null || regime === null || version === null || entitlement === null)
|
|
195
|
+
return null;
|
|
196
|
+
if (!Array.isArray(raw.industries))
|
|
197
|
+
return null;
|
|
198
|
+
return {
|
|
199
|
+
id,
|
|
200
|
+
regime,
|
|
201
|
+
version,
|
|
202
|
+
industries: raw.industries.filter((v) => typeof v === 'string'),
|
|
203
|
+
entitlement,
|
|
204
|
+
reviewed_by: (raw.reviewed_by ?? null),
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/** Validate one control entry. */
|
|
208
|
+
function validateControl(raw, index, problems) {
|
|
209
|
+
const where = `controls.yaml: controls[${index}]`;
|
|
210
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
|
|
211
|
+
problems.add(`${where}: expected a mapping, got ${describe(raw)}`);
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
const r = raw;
|
|
215
|
+
const id = problems.str(r.id, `${where}: id`);
|
|
216
|
+
const label = id === null ? where : `controls.yaml: control ${id}`;
|
|
217
|
+
if (id !== null && !CONTROL_ID_RE.test(id)) {
|
|
218
|
+
problems.add(`${label}: id '${id}' is not a control id (expected e.g. CC8.1)`);
|
|
219
|
+
}
|
|
220
|
+
const kind = problems.oneOf(r.kind, `${label}: kind`, CONTROL_KINDS);
|
|
221
|
+
const checkKind = problems.oneOf(r.check_kind, `${label}: check_kind`, CHECK_KINDS);
|
|
222
|
+
const severity = problems.oneOf(r.severity, `${label}: severity`, SEVERITIES);
|
|
223
|
+
const requires = problems.str(r.requires, `${label}: requires`);
|
|
224
|
+
const lookAt = problems.str(r.look_at, `${label}: look_at`);
|
|
225
|
+
const failsWhen = problems.str(r.fails_when, `${label}: fails_when`);
|
|
226
|
+
for (const [value, field] of [
|
|
227
|
+
[requires, 'requires'],
|
|
228
|
+
[lookAt, 'look_at'],
|
|
229
|
+
[failsWhen, 'fails_when'],
|
|
230
|
+
]) {
|
|
231
|
+
if (value !== null)
|
|
232
|
+
problems.prose(value, `${label}: ${field}`, MAX_CONTROL_FIELD_CHARS);
|
|
233
|
+
}
|
|
234
|
+
if (!Array.isArray(r.phases)) {
|
|
235
|
+
problems.add(`${label}: phases: expected a list, got ${describe(r.phases)}`);
|
|
236
|
+
}
|
|
237
|
+
else if (r.phases.length === 0) {
|
|
238
|
+
problems.add(`${label}: phases: must name at least one lifecycle phase`);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
for (const [i, value] of r.phases.entries()) {
|
|
242
|
+
problems.oneOf(value, `${label}: phases[${i}]`, PHASES);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// The evidence rule, and the reason it is a rule: a checked-only control has no
|
|
246
|
+
// evidence, so letting it name an artifact is how a check becomes an attestation.
|
|
247
|
+
if (kind === 'evidenced') {
|
|
248
|
+
const artifact = problems.str(r.evidence_artifact, `${label}: evidence_artifact`);
|
|
249
|
+
if (artifact !== null) {
|
|
250
|
+
problems.prose(artifact, `${label}: evidence_artifact`, MAX_CONTROL_FIELD_CHARS);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else if (kind === 'checked-only' && r.evidence_artifact !== undefined) {
|
|
254
|
+
problems.add(`${label}: evidence_artifact is not allowed on a checked-only control — ` +
|
|
255
|
+
`the lifecycle trail evidences that the check ran, never that the control operates`);
|
|
256
|
+
}
|
|
257
|
+
// A mechanical control must carry something the check can actually apply.
|
|
258
|
+
if (checkKind === 'mechanical') {
|
|
259
|
+
const pattern = problems.str(r.pattern, `${label}: pattern`);
|
|
260
|
+
if (pattern !== null) {
|
|
261
|
+
try {
|
|
262
|
+
new RegExp(pattern);
|
|
263
|
+
}
|
|
264
|
+
catch (err) {
|
|
265
|
+
problems.add(`${label}: pattern is not a valid regular expression (${err.message})`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
else if (checkKind === 'agent' && r.pattern !== undefined) {
|
|
270
|
+
problems.add(`${label}: pattern is only meaningful on a mechanical control`);
|
|
271
|
+
}
|
|
272
|
+
if (r.references !== undefined) {
|
|
273
|
+
const references = problems.str(r.references, `${label}: references`);
|
|
274
|
+
if (references !== null) {
|
|
275
|
+
problems.prose(references, `${label}: references`, MAX_CONTROL_FIELD_CHARS);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (id === null ||
|
|
279
|
+
kind === null ||
|
|
280
|
+
checkKind === null ||
|
|
281
|
+
severity === null ||
|
|
282
|
+
requires === null ||
|
|
283
|
+
lookAt === null ||
|
|
284
|
+
failsWhen === null ||
|
|
285
|
+
!Array.isArray(r.phases)) {
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
id,
|
|
290
|
+
kind,
|
|
291
|
+
check_kind: checkKind,
|
|
292
|
+
phases: r.phases.filter((p) => PHASES.includes(p)),
|
|
293
|
+
requires,
|
|
294
|
+
look_at: lookAt,
|
|
295
|
+
fails_when: failsWhen,
|
|
296
|
+
severity,
|
|
297
|
+
...(typeof r.pattern === 'string' && { pattern: r.pattern }),
|
|
298
|
+
...(typeof r.evidence_artifact === 'string' && { evidence_artifact: r.evidence_artifact }),
|
|
299
|
+
...(typeof r.references === 'string' && { references: r.references }),
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
/** Validate one exclusion entry. */
|
|
303
|
+
function validateExclusion(raw, index, problems) {
|
|
304
|
+
const where = `controls.yaml: excluded[${index}]`;
|
|
305
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
|
|
306
|
+
problems.add(`${where}: expected a mapping, got ${describe(raw)}`);
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
const r = raw;
|
|
310
|
+
const id = problems.str(r.id, `${where}: id`);
|
|
311
|
+
if (id !== null && !CONTROL_ID_RE.test(id)) {
|
|
312
|
+
problems.add(`${where}: id '${id}' is not a control id (expected e.g. CC1.1)`);
|
|
313
|
+
}
|
|
314
|
+
const reason = problems.oneOf(r.reason, `${where}: reason`, EXCLUSION_REASONS);
|
|
315
|
+
if (r.note !== undefined) {
|
|
316
|
+
const note = problems.str(r.note, `${where}: note`);
|
|
317
|
+
if (note !== null)
|
|
318
|
+
problems.prose(note, `${where}: note`, MAX_CONTROL_FIELD_CHARS);
|
|
319
|
+
}
|
|
320
|
+
if (id === null || reason === null)
|
|
321
|
+
return null;
|
|
322
|
+
return { id, reason, ...(typeof r.note === 'string' && { note: r.note }) };
|
|
323
|
+
}
|
|
324
|
+
/** Validate one layer registration from `pack.yaml`. */
|
|
325
|
+
function validateLayer(raw, index, problems) {
|
|
326
|
+
const where = `pack.yaml: layers[${index}]`;
|
|
327
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
|
|
328
|
+
problems.add(`${where}: expected a mapping, got ${describe(raw)}`);
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
const r = raw;
|
|
332
|
+
const name = problems.str(r.name, `${where}: name`);
|
|
333
|
+
const file = problems.str(r.file, `${where}: file`);
|
|
334
|
+
if (name !== null && !SLUG_RE.test(name)) {
|
|
335
|
+
problems.add(`${where}: name '${name}' must be a lowercase slug`);
|
|
336
|
+
}
|
|
337
|
+
// Containment is checked by the loader against real directories, using the one
|
|
338
|
+
// exported `isContainedRelative`. Here we only reject shapes that can never be
|
|
339
|
+
// valid, so a bad registration fails before any path is built from it.
|
|
340
|
+
//
|
|
341
|
+
// The rejected value is deliberately NOT echoed: it is untrusted data that may
|
|
342
|
+
// be an absolute path, and every message this module emits has to stay free of
|
|
343
|
+
// them (AC-7). The field label is enough to locate the problem.
|
|
344
|
+
const containable = file !== null && !file.startsWith('/') && !file.includes('..');
|
|
345
|
+
if (file !== null && !containable) {
|
|
346
|
+
problems.add(`${where}: file must be a relative name inside the pack, with no '..' segment`);
|
|
347
|
+
}
|
|
348
|
+
// Declared rather than inferred: pack layers are delivered by pointer whatever
|
|
349
|
+
// their size, so a small layer cannot be inlined into an emitted skill.
|
|
350
|
+
if (r.always_pointer !== true) {
|
|
351
|
+
problems.add(`${where}: always_pointer must be true — pack layers are never inlined`);
|
|
352
|
+
}
|
|
353
|
+
// An out-of-bounds registration yields no layer at all. Returning one anyway
|
|
354
|
+
// would carry the bad name into the body check, whose message names the file —
|
|
355
|
+
// which is how an absolute path reached an error message.
|
|
356
|
+
if (name === null || file === null || !containable)
|
|
357
|
+
return null;
|
|
358
|
+
return { name, file, always_pointer: true };
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Validate a whole pack from its raw sources.
|
|
362
|
+
*
|
|
363
|
+
* Pure: takes text, returns a verdict, touches no filesystem. The resolver does
|
|
364
|
+
* the reading and the containment checks; this decides whether the content is
|
|
365
|
+
* usable. Nothing is installed unless this returns `ok`.
|
|
366
|
+
*/
|
|
367
|
+
export function validatePack(sources) {
|
|
368
|
+
const problems = new Problems();
|
|
369
|
+
const metaRaw = parseObject(sources.packYaml, 'pack.yaml', problems);
|
|
370
|
+
const controlsRaw = parseObject(sources.controlsYaml, 'controls.yaml', problems);
|
|
371
|
+
const meta = metaRaw ? validateMeta(metaRaw, sources.id, problems) : null;
|
|
372
|
+
// Layers
|
|
373
|
+
const layers = [];
|
|
374
|
+
if (metaRaw) {
|
|
375
|
+
if (!Array.isArray(metaRaw.layers)) {
|
|
376
|
+
problems.add(`pack.yaml: layers: expected a list, got ${describe(metaRaw.layers)}`);
|
|
377
|
+
}
|
|
378
|
+
else if (metaRaw.layers.length === 0) {
|
|
379
|
+
problems.add('pack.yaml: layers: a pack must register at least one constraint layer');
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
for (const [i, raw] of metaRaw.layers.entries()) {
|
|
383
|
+
const layer = validateLayer(raw, i, problems);
|
|
384
|
+
if (layer)
|
|
385
|
+
layers.push(layer);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
// Controls
|
|
390
|
+
const controls = [];
|
|
391
|
+
const exclusions = [];
|
|
392
|
+
if (controlsRaw) {
|
|
393
|
+
if (!Array.isArray(controlsRaw.controls)) {
|
|
394
|
+
problems.add(`controls.yaml: controls: expected a list, got ${describe(controlsRaw.controls)}`);
|
|
395
|
+
}
|
|
396
|
+
else if (controlsRaw.controls.length === 0) {
|
|
397
|
+
problems.add('controls.yaml: controls: a pack must declare at least one control');
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
for (const [i, raw] of controlsRaw.controls.entries()) {
|
|
401
|
+
const control = validateControl(raw, i, problems);
|
|
402
|
+
if (control)
|
|
403
|
+
controls.push(control);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (!Array.isArray(controlsRaw.excluded)) {
|
|
407
|
+
problems.add(`controls.yaml: excluded: expected a list, got ${describe(controlsRaw.excluded)}`);
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
for (const [i, raw] of controlsRaw.excluded.entries()) {
|
|
411
|
+
const exclusion = validateExclusion(raw, i, problems);
|
|
412
|
+
if (exclusion)
|
|
413
|
+
exclusions.push(exclusion);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
// A control id must not be both covered and excluded — that is a claim and its
|
|
418
|
+
// retraction in one file, and whichever a reader trusts is a coin flip.
|
|
419
|
+
const controlIds = new Set(controls.map((c) => c.id));
|
|
420
|
+
for (const exclusion of exclusions) {
|
|
421
|
+
if (controlIds.has(exclusion.id)) {
|
|
422
|
+
problems.add(`controls.yaml: ${exclusion.id} is both covered and excluded`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
for (const [ids, label] of [
|
|
426
|
+
[controls.map((c) => c.id), 'controls'],
|
|
427
|
+
[exclusions.map((e) => e.id), 'excluded'],
|
|
428
|
+
]) {
|
|
429
|
+
const seen = new Set();
|
|
430
|
+
for (const id of ids) {
|
|
431
|
+
if (seen.has(id))
|
|
432
|
+
problems.add(`controls.yaml: ${label}: ${id} appears more than once`);
|
|
433
|
+
seen.add(id);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
// Layer bodies: bounded, placeholder-free, and — when the pack is an unreviewed
|
|
437
|
+
// draft — carrying the notice. Fenced blocks are allowed in a layer body, which
|
|
438
|
+
// is prose an agent reads, but placeholders are not.
|
|
439
|
+
let totalLayerChars = 0;
|
|
440
|
+
let noticeFound = false;
|
|
441
|
+
for (const layer of layers) {
|
|
442
|
+
const body = sources.layerBodies.get(layer.file);
|
|
443
|
+
if (body === undefined) {
|
|
444
|
+
problems.add(`pack.yaml: layer '${layer.name}' registers ${layer.file}, which is missing`);
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
totalLayerChars += body.length;
|
|
448
|
+
problems.prose(body, `${layer.file}`, MAX_LAYER_BODY_CHARS, { allowFences: true });
|
|
449
|
+
if (body.toLowerCase().includes(UNREVIEWED_NOTICE))
|
|
450
|
+
noticeFound = true;
|
|
451
|
+
}
|
|
452
|
+
if (totalLayerChars > MAX_PACK_LAYER_CHARS) {
|
|
453
|
+
problems.add(`pack layer bodies total ${totalLayerChars} characters, exceeding the ${MAX_PACK_LAYER_CHARS}-character limit`);
|
|
454
|
+
}
|
|
455
|
+
const totalControlChars = controls.reduce((sum, c) => sum + c.requires.length + c.look_at.length + c.fails_when.length, 0);
|
|
456
|
+
if (totalControlChars > MAX_PACK_CONTROL_CHARS) {
|
|
457
|
+
problems.add(`pack control text totals ${totalControlChars} characters, exceeding the ${MAX_PACK_CONTROL_CHARS}-character limit`);
|
|
458
|
+
}
|
|
459
|
+
// The first of the notice's three enforcement points. The other two are the
|
|
460
|
+
// report generator, which emits it from code, and a doctor check for the case
|
|
461
|
+
// where someone edits it out of an installed layer.
|
|
462
|
+
if (meta && meta.reviewed_by === null && layers.length > 0 && !noticeFound) {
|
|
463
|
+
problems.add(`pack.yaml: reviewed_by is null, so a constraint layer must state that the control text has ` +
|
|
464
|
+
`'${UNREVIEWED_NOTICE}'`);
|
|
465
|
+
}
|
|
466
|
+
if (problems.list.length > 0 || meta === null) {
|
|
467
|
+
return {
|
|
468
|
+
ok: false,
|
|
469
|
+
errors: problems.list.length > 0 ? problems.list : ['pack.yaml: could not be validated'],
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
return { ok: true, pack: { meta, controls, exclusions, layers } };
|
|
473
|
+
}
|
|
474
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/compliance/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAc1C,8EAA8E;AAC9E,0BAA0B;AAC1B,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM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