yarramate 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/dist/adapter-mapping.d.ts +40 -0
  4. package/dist/adapter-mapping.js +200 -0
  5. package/dist/adapters/graphify-cli.d.ts +3 -0
  6. package/dist/adapters/graphify-cli.js +127 -0
  7. package/dist/adapters/graphify-entry.d.ts +1 -0
  8. package/dist/adapters/graphify-entry.js +1 -0
  9. package/dist/adapters/graphify.d.ts +23 -0
  10. package/dist/adapters/graphify.js +47 -0
  11. package/dist/adapters/likec4-cli.d.ts +3 -0
  12. package/dist/adapters/likec4-cli.js +662 -0
  13. package/dist/adapters/likec4-export.d.ts +25 -0
  14. package/dist/adapters/likec4-export.js +204 -0
  15. package/dist/adapters/likec4-kind-mapping.d.ts +22 -0
  16. package/dist/adapters/likec4-kind-mapping.js +60 -0
  17. package/dist/adapters/likec4-prepare.d.ts +28 -0
  18. package/dist/adapters/likec4-prepare.js +154 -0
  19. package/dist/adapters/likec4-project.d.ts +58 -0
  20. package/dist/adapters/likec4-project.js +176 -0
  21. package/dist/adapters/likec4.d.ts +4 -0
  22. package/dist/adapters/likec4.js +4 -0
  23. package/dist/architecture-state.d.ts +22 -0
  24. package/dist/architecture-state.js +63 -0
  25. package/dist/check-command.d.ts +2 -0
  26. package/dist/check-command.js +232 -0
  27. package/dist/cli-support.d.ts +24 -0
  28. package/dist/cli-support.js +81 -0
  29. package/dist/cli.d.ts +4 -0
  30. package/dist/cli.js +575 -0
  31. package/dist/compiler.d.ts +66 -0
  32. package/dist/compiler.js +940 -0
  33. package/dist/core-contract.d.ts +43 -0
  34. package/dist/core-contract.js +162 -0
  35. package/dist/evidence.d.ts +58 -0
  36. package/dist/evidence.js +161 -0
  37. package/dist/graph.d.ts +2 -0
  38. package/dist/graph.js +37 -0
  39. package/dist/index.d.ts +11 -0
  40. package/dist/index.js +9 -0
  41. package/dist/profile.d.ts +30 -0
  42. package/dist/profile.js +162 -0
  43. package/dist/projection.d.ts +42 -0
  44. package/dist/projection.js +183 -0
  45. package/dist/reconciliation.d.ts +26 -0
  46. package/dist/reconciliation.js +47 -0
  47. package/dist/source-document.d.ts +24 -0
  48. package/dist/source-document.js +80 -0
  49. package/dist/workspace.d.ts +29 -0
  50. package/dist/workspace.js +114 -0
  51. package/docs/CONSUMING-YARRAMATE.md +145 -0
  52. package/package.json +110 -0
  53. package/schema/yarramate-adapter-mapping.schema.json +59 -0
  54. package/schema/yarramate-check-result.schema.json +92 -0
  55. package/schema/yarramate-core-contract.schema.json +132 -0
  56. package/schema/yarramate-diagnostic-result.schema.json +64 -0
  57. package/schema/yarramate-document.schema.json +168 -0
  58. package/schema/yarramate-evidence-report.schema.json +73 -0
  59. package/schema/yarramate-evidence.schema.json +92 -0
  60. package/schema/yarramate-graph-v2.schema.json +170 -0
  61. package/schema/yarramate-likec4-check-result.schema.json +50 -0
  62. package/schema/yarramate-likec4-diagnostic-result.schema.json +69 -0
  63. package/schema/yarramate-likec4-generated-project-v2.schema.json +100 -0
  64. package/schema/yarramate-likec4-generated-project.schema.json +76 -0
  65. package/schema/yarramate-likec4-kind-mapping.schema.json +65 -0
  66. package/schema/yarramate-likec4-project.schema.json +160 -0
  67. package/schema/yarramate-profile.schema.json +113 -0
  68. package/schema/yarramate-projection-result.schema.json +177 -0
  69. package/schema/yarramate-projection.schema.json +126 -0
  70. package/schema/yarramate-reconciliation-report.schema.json +90 -0
  71. package/schema/yarramate-state-comparison.schema.json +61 -0
  72. package/schema/yarramate-workspace.schema.json +55 -0
  73. package/skills/yarramate-architecture/SKILL.md +135 -0
  74. package/skills/yarramate-architecture/agents/openai.yaml +4 -0
  75. package/skills/yarramate-architecture/references/journey-checklists.md +57 -0
  76. package/skills/yarramate-architecture/references/native-authoring.md +167 -0
@@ -0,0 +1,43 @@
1
+ import type { Diagnostic, WorkspaceSource } from './compiler.js';
2
+ export interface CoreContractFormat {
3
+ readonly id: string;
4
+ readonly schema: string;
5
+ readonly packageExport: string;
6
+ }
7
+ export interface CoreContractCommand {
8
+ readonly name: 'init' | 'add' | 'connect' | 'check' | 'compile' | 'view' | 'context' | 'compare' | 'evidence';
9
+ readonly binary: 'yarramate';
10
+ readonly machineFormat?: string;
11
+ }
12
+ export interface CoreContract {
13
+ readonly format: 'yarramate/core-contract/v1';
14
+ readonly id: string;
15
+ readonly version: string;
16
+ readonly packageManifest: string;
17
+ readonly formats: readonly CoreContractFormat[];
18
+ readonly commands: readonly CoreContractCommand[];
19
+ readonly guarantees: readonly string[];
20
+ readonly exclusions: readonly string[];
21
+ }
22
+ export type CoreContractLoadResult = {
23
+ readonly ok: true;
24
+ readonly contract: CoreContract;
25
+ } | {
26
+ readonly ok: false;
27
+ readonly diagnostics: readonly Diagnostic[];
28
+ };
29
+ export interface CoreContractSurface {
30
+ readonly files: readonly string[];
31
+ readonly packageManifestValid: boolean;
32
+ readonly packageExports: Readonly<Record<string, string>>;
33
+ readonly packageBinaries: readonly string[];
34
+ readonly schemas?: Readonly<Record<string, {
35
+ readonly ok: false;
36
+ } | {
37
+ readonly ok: true;
38
+ readonly format?: string;
39
+ readonly validSchema?: boolean;
40
+ }>>;
41
+ }
42
+ export declare function loadCoreContract(source: WorkspaceSource): CoreContractLoadResult;
43
+ export declare function checkCoreContract(source: WorkspaceSource, surface: CoreContractSurface): CoreContractLoadResult;
@@ -0,0 +1,162 @@
1
+ import Ajv2020Module from 'ajv/dist/2020.js';
2
+ import { LineCounter, parseDocument } from 'yaml';
3
+ import { diagnosticOrder, loadSourceDocument, locateSourcePath, } from './source-document.js';
4
+ import coreContractSchema from '../schema/yarramate-core-contract.schema.json' with {
5
+ type: 'json'
6
+ };
7
+ const Ajv2020 = Ajv2020Module.default;
8
+ const validateCoreContract = new Ajv2020({ allErrors: true }).compile(coreContractSchema);
9
+ export function loadCoreContract(source) {
10
+ const loaded = loadSourceDocument(source, validateCoreContract, 'Core contract');
11
+ if (!loaded.ok)
12
+ return loaded;
13
+ const { value, yaml, lineCounter } = loaded.document;
14
+ const diagnostics = [];
15
+ const formatIds = new Set();
16
+ value.formats.forEach((format, index) => {
17
+ if (formatIds.has(format.id)) {
18
+ diagnostics.push({
19
+ severity: 'error',
20
+ code: 'YMC101',
21
+ message: `Core contract format "${format.id}" is declared more than once`,
22
+ ...locateSourcePath(source.path, yaml, lineCounter, ['formats', index, 'id'], `/formats/${index}/id`),
23
+ });
24
+ }
25
+ formatIds.add(format.id);
26
+ });
27
+ const commandNames = new Set();
28
+ value.commands.forEach((command, index) => {
29
+ if (commandNames.has(command.name)) {
30
+ diagnostics.push({
31
+ severity: 'error',
32
+ code: 'YMC102',
33
+ message: `Core contract command "${command.name}" is declared more than once`,
34
+ ...locateSourcePath(source.path, yaml, lineCounter, ['commands', index, 'name'], `/commands/${index}/name`),
35
+ });
36
+ }
37
+ commandNames.add(command.name);
38
+ if (command.machineFormat !== undefined &&
39
+ !formatIds.has(command.machineFormat)) {
40
+ diagnostics.push({
41
+ severity: 'error',
42
+ code: 'YMC103',
43
+ message: `Command "${command.name}" references undeclared machine format "${command.machineFormat}"`,
44
+ ...locateSourcePath(source.path, yaml, lineCounter, ['commands', index, 'machineFormat'], `/commands/${index}/machineFormat`),
45
+ });
46
+ }
47
+ });
48
+ return diagnostics.length === 0
49
+ ? { ok: true, contract: value }
50
+ : { ok: false, diagnostics: diagnostics.sort(diagnosticOrder) };
51
+ }
52
+ export function checkCoreContract(source, surface) {
53
+ const loaded = loadCoreContract(source);
54
+ if (!loaded.ok)
55
+ return loaded;
56
+ const lineCounter = new LineCounter();
57
+ const yaml = parseDocument(source.source, { lineCounter });
58
+ const files = new Set(surface.files);
59
+ const binaries = new Set(surface.packageBinaries);
60
+ const diagnostics = [];
61
+ if (!files.has(loaded.contract.packageManifest)) {
62
+ diagnostics.push({
63
+ severity: 'error',
64
+ code: 'YMC204',
65
+ message: `Package manifest "${loaded.contract.packageManifest}" does not exist`,
66
+ ...locateSourcePath(source.path, yaml, lineCounter, ['packageManifest'], '/packageManifest'),
67
+ });
68
+ }
69
+ else if (!surface.packageManifestValid) {
70
+ diagnostics.push({
71
+ severity: 'error',
72
+ code: 'YMC205',
73
+ message: `Package manifest "${loaded.contract.packageManifest}" is not a valid JSON object`,
74
+ ...locateSourcePath(source.path, yaml, lineCounter, ['packageManifest'], '/packageManifest'),
75
+ });
76
+ }
77
+ diagnostics.push(...loaded.contract.formats.flatMap((format, index) => {
78
+ const missingSchema = files.has(format.schema)
79
+ ? []
80
+ : [
81
+ {
82
+ severity: 'error',
83
+ code: 'YMC201',
84
+ message: `Schema file "${format.schema}" does not exist`,
85
+ ...locateSourcePath(source.path, yaml, lineCounter, ['formats', index, 'schema'], `/formats/${index}/schema`),
86
+ },
87
+ ];
88
+ const schemaSurface = surface.schemas?.[format.schema];
89
+ const invalidSchema = files.has(format.schema) &&
90
+ schemaSurface !== undefined &&
91
+ !schemaSurface.ok
92
+ ? [
93
+ {
94
+ severity: 'error',
95
+ code: 'YMC206',
96
+ message: `Schema file "${format.schema}" is not valid JSON`,
97
+ ...locateSourcePath(source.path, yaml, lineCounter, ['formats', index, 'schema'], `/formats/${index}/schema`),
98
+ },
99
+ ]
100
+ : [];
101
+ const mismatchedFormat = files.has(format.schema) &&
102
+ schemaSurface?.ok === true &&
103
+ schemaSurface.format !== format.id
104
+ ? [
105
+ {
106
+ severity: 'error',
107
+ code: 'YMC207',
108
+ message: schemaSurface.format === undefined
109
+ ? `Schema file "${format.schema}" does not declare contracted format "${format.id}"`
110
+ : `Schema file "${format.schema}" declares format "${schemaSurface.format}" instead of "${format.id}"`,
111
+ ...locateSourcePath(source.path, yaml, lineCounter, ['formats', index, 'id'], `/formats/${index}/id`),
112
+ },
113
+ ]
114
+ : [];
115
+ const invalidJsonSchema = files.has(format.schema) &&
116
+ schemaSurface?.ok === true &&
117
+ schemaSurface.validSchema === false
118
+ ? [
119
+ {
120
+ severity: 'error',
121
+ code: 'YMC208',
122
+ message: `Schema file "${format.schema}" is not valid JSON Schema 2020-12`,
123
+ ...locateSourcePath(source.path, yaml, lineCounter, ['formats', index, 'schema'], `/formats/${index}/schema`),
124
+ },
125
+ ]
126
+ : [];
127
+ const expected = `./${format.schema}`;
128
+ const invalidExport = !surface.packageManifestValid
129
+ ? []
130
+ : surface.packageExports[format.packageExport] === expected
131
+ ? []
132
+ : [
133
+ {
134
+ severity: 'error',
135
+ code: 'YMC202',
136
+ message: `Package export "${format.packageExport}" does not resolve to "${format.schema}"`,
137
+ ...locateSourcePath(source.path, yaml, lineCounter, ['formats', index, 'packageExport'], `/formats/${index}/packageExport`),
138
+ },
139
+ ];
140
+ return [
141
+ ...missingSchema,
142
+ ...invalidSchema,
143
+ ...mismatchedFormat,
144
+ ...invalidJsonSchema,
145
+ ...invalidExport,
146
+ ];
147
+ }));
148
+ loaded.contract.commands.forEach((command, index) => {
149
+ if (surface.packageManifestValid &&
150
+ !binaries.has(command.binary)) {
151
+ diagnostics.push({
152
+ severity: 'error',
153
+ code: 'YMC203',
154
+ message: `Package binary "${command.binary}" is not declared`,
155
+ ...locateSourcePath(source.path, yaml, lineCounter, ['commands', index, 'binary'], `/commands/${index}/binary`),
156
+ });
157
+ }
158
+ });
159
+ return diagnostics.length === 0
160
+ ? loaded
161
+ : { ok: false, diagnostics: diagnostics.sort(diagnosticOrder) };
162
+ }
@@ -0,0 +1,58 @@
1
+ import type { Diagnostic, SemanticGraph, WorkspaceSource } from './compiler.js';
2
+ export type EvidenceResult = 'confirmed' | 'contradicted' | 'unknown' | 'not-observed';
3
+ export interface EvidenceLocator {
4
+ readonly uri: string;
5
+ readonly message?: string;
6
+ }
7
+ export type EvidenceObservation = {
8
+ readonly subject: string;
9
+ readonly result: EvidenceResult;
10
+ readonly evidence: EvidenceLocator;
11
+ } | {
12
+ readonly claim: string;
13
+ readonly result: EvidenceResult;
14
+ readonly evidence: EvidenceLocator;
15
+ };
16
+ export interface EvidenceDocument {
17
+ readonly format: 'yarramate/evidence/v1';
18
+ readonly id: string;
19
+ readonly version: string;
20
+ readonly provider: string;
21
+ readonly observations: readonly EvidenceObservation[];
22
+ }
23
+ export interface EvidenceReport {
24
+ readonly format: 'yarramate/evidence-report/v1';
25
+ readonly evidence: string;
26
+ readonly provider: string;
27
+ readonly summary: {
28
+ readonly confirmed: number;
29
+ readonly contradicted: number;
30
+ readonly unknown: number;
31
+ readonly notObserved: number;
32
+ };
33
+ readonly observations: readonly EvidenceObservation[];
34
+ }
35
+ export type EvidenceLoadResult = {
36
+ readonly ok: true;
37
+ readonly evidence: EvidenceDocument;
38
+ } | {
39
+ readonly ok: false;
40
+ readonly diagnostics: readonly Diagnostic[];
41
+ };
42
+ export type EvidenceEvaluationResult = {
43
+ readonly ok: true;
44
+ readonly report: EvidenceReport;
45
+ } | {
46
+ readonly ok: false;
47
+ readonly diagnostics: readonly Diagnostic[];
48
+ };
49
+ export type EvidenceWorkspaceEvaluationResult = {
50
+ readonly ok: true;
51
+ readonly reports: readonly EvidenceReport[];
52
+ } | {
53
+ readonly ok: false;
54
+ readonly diagnostics: readonly Diagnostic[];
55
+ };
56
+ export declare function loadEvidence(source: WorkspaceSource): EvidenceLoadResult;
57
+ export declare function evaluateEvidence(graph: SemanticGraph, evidence: EvidenceDocument): EvidenceEvaluationResult;
58
+ export declare function evaluateEvidenceWorkspace(graph: SemanticGraph, evidenceDocuments: readonly EvidenceDocument[]): EvidenceWorkspaceEvaluationResult;
@@ -0,0 +1,161 @@
1
+ import Ajv2020Module from 'ajv/dist/2020.js';
2
+ import { diagnosticOrder, loadSourceDocument, locateSourcePath, } from './source-document.js';
3
+ import evidenceSchema from '../schema/yarramate-evidence.schema.json' with {
4
+ type: 'json'
5
+ };
6
+ const Ajv2020 = Ajv2020Module.default;
7
+ const validateEvidenceSchema = new Ajv2020({ allErrors: true }).compile(evidenceSchema);
8
+ const evidenceLocations = new WeakMap();
9
+ const observationTarget = (observation) => 'subject' in observation ? observation.subject : observation.claim;
10
+ export function loadEvidence(source) {
11
+ const loaded = loadSourceDocument(source, validateEvidenceSchema, 'Evidence');
12
+ if (!loaded.ok)
13
+ return loaded;
14
+ const { value, yaml, lineCounter } = loaded.document;
15
+ const orderedObservations = value.observations
16
+ .map((observation, authoredIndex) => ({
17
+ authoredIndex,
18
+ observation: {
19
+ ...('subject' in observation
20
+ ? { subject: observation.subject }
21
+ : { claim: observation.claim }),
22
+ result: observation.result,
23
+ evidence: {
24
+ uri: observation.evidence.uri,
25
+ ...(observation.evidence.message === undefined
26
+ ? {}
27
+ : { message: observation.evidence.message }),
28
+ },
29
+ },
30
+ }))
31
+ .sort((left, right) => observationTarget(left.observation).localeCompare(observationTarget(right.observation)));
32
+ const evidence = {
33
+ format: value.format,
34
+ id: value.id,
35
+ version: value.version,
36
+ provider: value.provider,
37
+ observations: orderedObservations.map(({ observation }) => observation),
38
+ };
39
+ evidenceLocations.set(evidence, {
40
+ id: locateSourcePath(source.path, yaml, lineCounter, ['id'], '/id'),
41
+ observations: orderedObservations.map(({ observation, authoredIndex }) => {
42
+ const field = 'subject' in observation ? 'subject' : 'claim';
43
+ return locateSourcePath(source.path, yaml, lineCounter, ['observations', authoredIndex, field], `/observations/${authoredIndex}/${field}`);
44
+ }),
45
+ });
46
+ return { ok: true, evidence };
47
+ }
48
+ export function evaluateEvidence(graph, evidence) {
49
+ const subjectIds = new Set(graph.subjects.map(({ id }) => id));
50
+ const claimIds = new Set(graph.claims.map(({ id }) => id));
51
+ const locations = evidenceLocations.get(evidence)?.observations ?? [];
52
+ const diagnostics = [];
53
+ const seenTargets = new Set();
54
+ for (const [index, observation] of evidence.observations.entries()) {
55
+ const location = locations[index] ?? {
56
+ path: `${evidence.id}.evidence.yaml`,
57
+ pointer: `/observations/${index}/${'subject' in observation ? 'subject' : 'claim'}`,
58
+ line: 1,
59
+ column: 1,
60
+ };
61
+ if ('subject' in observation &&
62
+ !subjectIds.has(observation.subject)) {
63
+ diagnostics.push({
64
+ severity: 'error',
65
+ code: 'YM801',
66
+ message: `Evidence subject "${observation.subject}" does not exist`,
67
+ ...location,
68
+ });
69
+ }
70
+ if ('claim' in observation && !claimIds.has(observation.claim)) {
71
+ diagnostics.push({
72
+ severity: 'error',
73
+ code: 'YM802',
74
+ message: `Evidence claim "${observation.claim}" does not exist`,
75
+ ...location,
76
+ });
77
+ }
78
+ const target = observationTarget(observation);
79
+ const targetKey = `${'subject' in observation ? 'subject' : 'claim'}:${target}`;
80
+ if (seenTargets.has(targetKey)) {
81
+ diagnostics.push({
82
+ severity: 'error',
83
+ code: 'YM803',
84
+ message: `Evidence target "${target}" is evaluated more than once`,
85
+ ...location,
86
+ });
87
+ }
88
+ seenTargets.add(targetKey);
89
+ }
90
+ if (diagnostics.length > 0) {
91
+ return {
92
+ ok: false,
93
+ diagnostics: diagnostics.sort(diagnosticOrder),
94
+ };
95
+ }
96
+ const summary = {
97
+ confirmed: 0,
98
+ contradicted: 0,
99
+ unknown: 0,
100
+ notObserved: 0,
101
+ };
102
+ for (const observation of evidence.observations) {
103
+ if (observation.result === 'not-observed') {
104
+ summary.notObserved += 1;
105
+ }
106
+ else {
107
+ summary[observation.result] += 1;
108
+ }
109
+ }
110
+ return {
111
+ ok: true,
112
+ report: {
113
+ format: 'yarramate/evidence-report/v1',
114
+ evidence: `${evidence.id}@${evidence.version}`,
115
+ provider: evidence.provider,
116
+ summary,
117
+ observations: evidence.observations,
118
+ },
119
+ };
120
+ }
121
+ export function evaluateEvidenceWorkspace(graph, evidenceDocuments) {
122
+ const ordered = [...evidenceDocuments].sort((left, right) => {
123
+ const identityOrder = `${left.id}@${left.version}`.localeCompare(`${right.id}@${right.version}`);
124
+ if (identityOrder !== 0)
125
+ return identityOrder;
126
+ const leftPath = evidenceLocations.get(left)?.id.path ?? '';
127
+ const rightPath = evidenceLocations.get(right)?.id.path ?? '';
128
+ return leftPath.localeCompare(rightPath);
129
+ });
130
+ const diagnostics = [];
131
+ const reports = [];
132
+ const seenIdentities = new Set();
133
+ for (const evidence of ordered) {
134
+ const identity = `${evidence.id}@${evidence.version}`;
135
+ if (seenIdentities.has(identity)) {
136
+ const location = evidenceLocations.get(evidence)?.id ?? {
137
+ path: `${evidence.id}.evidence.yaml`,
138
+ pointer: '/id',
139
+ line: 1,
140
+ column: 1,
141
+ };
142
+ diagnostics.push({
143
+ severity: 'error',
144
+ code: 'YM804',
145
+ message: `Evidence document "${identity}" is declared more than once`,
146
+ ...location,
147
+ });
148
+ }
149
+ seenIdentities.add(identity);
150
+ const evaluation = evaluateEvidence(graph, evidence);
151
+ if (evaluation.ok) {
152
+ reports.push(evaluation.report);
153
+ }
154
+ else {
155
+ diagnostics.push(...evaluation.diagnostics);
156
+ }
157
+ }
158
+ return diagnostics.length === 0
159
+ ? { ok: true, reports }
160
+ : { ok: false, diagnostics: diagnostics.sort(diagnosticOrder) };
161
+ }
@@ -0,0 +1,2 @@
1
+ import type { SemanticGraph } from './compiler.js';
2
+ export declare function serializeSemanticGraph(graph: SemanticGraph): string;
package/dist/graph.js ADDED
@@ -0,0 +1,37 @@
1
+ const compareText = (left, right) => left.localeCompare(right);
2
+ const canonicalClaim = (claim) => ({
3
+ id: claim.id,
4
+ subject: claim.subject,
5
+ predicate: claim.predicate,
6
+ object: 'ref' in claim.object
7
+ ? { ref: claim.object.ref }
8
+ : { value: claim.object.value },
9
+ origin: claim.origin,
10
+ source: {
11
+ document: claim.source.document,
12
+ path: claim.source.path,
13
+ pointer: claim.source.pointer,
14
+ line: claim.source.line,
15
+ column: claim.source.column,
16
+ },
17
+ });
18
+ export function serializeSemanticGraph(graph) {
19
+ const canonical = {
20
+ format: 'yarramate/graph/v2',
21
+ profiles: [...graph.profiles].sort(compareText),
22
+ documents: [...graph.documents]
23
+ .sort((left, right) => compareText(left.id, right.id) ||
24
+ compareText(left.source, right.source))
25
+ .map(({ id, source }) => ({ id, source })),
26
+ subjects: [...graph.subjects]
27
+ .sort((left, right) => compareText(left.id, right.id) ||
28
+ compareText(left.type, right.type))
29
+ .map(({ id, type }) => ({ id, type })),
30
+ claims: [...graph.claims]
31
+ .sort((left, right) => compareText(left.id, right.id) ||
32
+ compareText(left.subject, right.subject) ||
33
+ compareText(left.predicate, right.predicate))
34
+ .map(canonicalClaim),
35
+ };
36
+ return `${JSON.stringify(canonical, null, 2)}\n`;
37
+ }
@@ -0,0 +1,11 @@
1
+ export { compileWorkspace, compileWorkspaceWithProfileContext, } from './compiler.js';
2
+ export { serializeSemanticGraph } from './graph.js';
3
+ export { checkCoreContract, loadCoreContract, type CoreContract, type CoreContractCommand, type CoreContractFormat, type CoreContractLoadResult, type CoreContractSurface, } from './core-contract.js';
4
+ export { compareArchitectureStates, type StateComparison, type StateComparisonIssue, type StateComparisonResult, } from './architecture-state.js';
5
+ export { loadWorkspaceManifest, type ResolvedWorkspace, type WorkspaceManifest, type WorkspaceManifestResult, } from './workspace.js';
6
+ export { evaluateEvidence, evaluateEvidenceWorkspace, loadEvidence, type EvidenceDocument, type EvidenceEvaluationResult, type EvidenceLoadResult, type EvidenceLocator, type EvidenceObservation, type EvidenceReport, type EvidenceResult, type EvidenceWorkspaceEvaluationResult, } from './evidence.js';
7
+ export { reconcileEvidenceReports, type ReconciliationFinding, type ReconciliationReport, } from './reconciliation.js';
8
+ export type { CompilationResult, ContextualCompilationResult, Diagnostic, GraphClaim, GraphSource, SemanticGraph, ResolvedProfileContext, WorkspaceSource, } from './compiler.js';
9
+ export { evaluateProjection, loadProjection, renderProjectionMarkdown, } from './projection.js';
10
+ export { loadAdapterMapping, validateAdapterMapping, validateAdapterMappings, type AdapterMapping, type AdapterMappingLoadResult, type AdapterMappingValidationResult, type AdapterMappingsValidationResult, type AdapterSubjectMapping, } from './adapter-mapping.js';
11
+ export type { LifecycleStatus, ProjectionDefinition, ProjectionLoadResult, ProjectionResult, } from './projection.js';
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export { compileWorkspace, compileWorkspaceWithProfileContext, } from './compiler.js';
2
+ export { serializeSemanticGraph } from './graph.js';
3
+ export { checkCoreContract, loadCoreContract, } from './core-contract.js';
4
+ export { compareArchitectureStates, } from './architecture-state.js';
5
+ export { loadWorkspaceManifest, } from './workspace.js';
6
+ export { evaluateEvidence, evaluateEvidenceWorkspace, loadEvidence, } from './evidence.js';
7
+ export { reconcileEvidenceReports, } from './reconciliation.js';
8
+ export { evaluateProjection, loadProjection, renderProjectionMarkdown, } from './projection.js';
9
+ export { loadAdapterMapping, validateAdapterMapping, validateAdapterMappings, } from './adapter-mapping.js';
@@ -0,0 +1,30 @@
1
+ export declare const layers: readonly ["motivation", "strategy", "business", "application", "technology", "physical", "implementation", "composite"];
2
+ export declare const aspects: readonly ["motivation", "active-structure", "behavior", "passive-structure", "composite"];
3
+ export type Layer = (typeof layers)[number];
4
+ export type Aspect = (typeof aspects)[number];
5
+ export interface ConceptKind {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ readonly layer: Layer;
9
+ readonly aspect: Aspect;
10
+ /**
11
+ * A compatibility pointer, not a claim of standards conformance.
12
+ * Exact external identifiers can be added after licensing review.
13
+ */
14
+ readonly inspiredBy: string;
15
+ }
16
+ export declare const conceptKinds: readonly ConceptKind[];
17
+ export declare const relationshipKinds: readonly ["composition", "aggregation", "assignment", "realization", "serving", "access", "influence", "association", "triggering", "flow", "specialization"];
18
+ export type RelationshipKind = (typeof relationshipKinds)[number];
19
+ export interface RelationshipPolicy {
20
+ readonly id: RelationshipKind;
21
+ readonly intent: string;
22
+ readonly sourceAspects?: readonly Aspect[];
23
+ readonly targetAspects?: readonly Aspect[];
24
+ }
25
+ /**
26
+ * Safe, intentionally broad semantic constraints. A future licensed
27
+ * compatibility package may layer an exact external relationship matrix over
28
+ * these native YarraMate rules.
29
+ */
30
+ export declare const relationshipPolicies: readonly RelationshipPolicy[];