@company-semantics/contracts 0.6.0 → 0.8.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 CHANGED
@@ -25,6 +25,11 @@ import type { IntentCategory, InsightConfidence } from '@company-semantics/contr
25
25
  - Frontend-only extensions
26
26
  - Implementation details
27
27
 
28
+ ## Package Format
29
+
30
+ This package intentionally exports TypeScript source.
31
+ It does not emit `.d.ts` files. Consumers are expected to compile TS.
32
+
28
33
  ## Versioning
29
34
 
30
35
  Follows semver:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,33 +9,44 @@
9
9
  "type": "module",
10
10
  "exports": {
11
11
  ".": {
12
- "types": "./index.ts"
13
- }
12
+ "types": "./src/index.ts",
13
+ "default": "./src/index.ts"
14
+ },
15
+ "./schemas/guard-result.schema.json": "./schemas/guard-result.schema.json"
14
16
  },
15
- "types": "./index.ts",
17
+ "types": "./src/index.ts",
16
18
  "files": [
17
- "index.ts",
18
- "system/",
19
- "README.md"
19
+ "src",
20
+ "schemas"
20
21
  ],
21
22
  "publishConfig": {
22
23
  "access": "public"
23
24
  },
24
25
  "scripts": {
25
- "typecheck": "tsc --noEmit",
26
+ "typecheck": "tsc -b --noEmit",
26
27
  "lint:md": "markdownlint-cli2 '**/*.md' '#node_modules'",
27
28
  "lint:json": "node -e \"JSON.parse(require('fs').readFileSync('package.json'))\"",
28
- "prepare": "husky"
29
+ "prepare": "husky",
30
+ "guard:decision": "npx tsx scripts/ci/decision-guard.ts",
31
+ "guard:decision:json": "npx tsx scripts/ci/decision-guard.ts --json",
32
+ "guard:export": "npx tsx scripts/ci/export-guard.ts",
33
+ "guard:export:json": "npx tsx scripts/ci/export-guard.ts --json",
34
+ "guard:vocabulary": "npx tsx scripts/ci/vocabulary-guard.ts",
35
+ "guard:vocabulary:json": "npx tsx scripts/ci/vocabulary-guard.ts --json",
36
+ "guard:test": "vitest run scripts/ci/__tests__"
29
37
  },
30
38
  "packageManager": "pnpm@10.25.0",
31
39
  "devDependencies": {
40
+ "@types/node": "^25.0.3",
32
41
  "husky": "^9",
33
42
  "lint-staged": "^15",
34
43
  "markdownlint-cli2": "^0.17",
35
- "typescript": "^5"
44
+ "tsx": "^4.21.0",
45
+ "typescript": "^5",
46
+ "vitest": "^4.0.16"
36
47
  },
37
48
  "lint-staged": {
38
- "*.ts": "tsc --noEmit",
49
+ "*.ts": "bash -c 'tsc -b --noEmit'",
39
50
  "*.md": "markdownlint-cli2",
40
51
  "package.json": "node -e \"JSON.parse(require('fs').readFileSync('package.json'))\""
41
52
  }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://company-semantics.dev/schemas/guard-result.json",
4
+ "title": "Guard Result",
5
+ "description": "JSON output envelope for CI guard --json mode. schemaVersion reflects the JSON schema version, not the guard tool version.",
6
+ "type": "object",
7
+ "required": ["tool", "schemaVersion", "timestamp", "results"],
8
+ "properties": {
9
+ "tool": {
10
+ "type": "string",
11
+ "description": "The guard tool name (e.g., 'architecture-guard', 'vocabulary-guard')"
12
+ },
13
+ "schemaVersion": {
14
+ "type": "string",
15
+ "description": "Schema version (not tool version). Bump on breaking schema changes.",
16
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
17
+ },
18
+ "timestamp": {
19
+ "type": "string",
20
+ "format": "date-time",
21
+ "description": "ISO 8601 timestamp of when the guard ran"
22
+ },
23
+ "results": {
24
+ "type": "object",
25
+ "description": "Flat structure: all errors/warnings from all tiers are aggregated here",
26
+ "required": ["errors", "warnings"],
27
+ "properties": {
28
+ "errors": {
29
+ "type": "array",
30
+ "items": { "$ref": "#/definitions/GuardMessage" }
31
+ },
32
+ "warnings": {
33
+ "type": "array",
34
+ "items": { "$ref": "#/definitions/GuardMessage" }
35
+ }
36
+ }
37
+ }
38
+ },
39
+ "definitions": {
40
+ "GuardMessage": {
41
+ "type": "object",
42
+ "required": ["file", "message"],
43
+ "properties": {
44
+ "file": {
45
+ "type": "string",
46
+ "description": "Path to the file with the issue"
47
+ },
48
+ "message": {
49
+ "type": "string",
50
+ "description": "Human-readable description of the issue"
51
+ },
52
+ "line": {
53
+ "type": "number",
54
+ "description": "Optional line number (when available)"
55
+ },
56
+ "rule": {
57
+ "type": "string",
58
+ "description": "Optional rule identifier (when available)"
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Diagram Specification Types (v0.4.0)
2
+ * Diagram Specification Types (v0.6.0)
3
3
  *
4
4
  * Tree-based semantic model for system diagrams.
5
5
  * These types define MEANING, not presentation.
@@ -8,6 +8,14 @@
8
8
  * - No render hints — renderers decide presentation independently
9
9
  * - parentId creates hierarchy (tree structure), not edges
10
10
  * - Graphs can be rendered as ASCII, SVG, canvas, or any future format
11
+ * - meta is opaque — engine interprets, contracts stay neutral
12
+ *
13
+ * v0.6.0 changes:
14
+ * - meta is now Record<string, unknown> (opaque, engine-interpreted)
15
+ * - Removed DiagramMeta and DiagramTiming (moved to engine)
16
+ *
17
+ * v0.5.0 changes:
18
+ * - Added 'feedback' and 'async' edge relations
11
19
  *
12
20
  * v0.4.0 changes:
13
21
  * - 'layer' kind renamed to 'group'
@@ -29,8 +37,10 @@ export type DiagramNodeKind = 'group' | 'feature' | 'artifact'
29
37
  /**
30
38
  * The semantic relationship between nodes.
31
39
  * Note: 'contains' removed in v0.4.0 — hierarchy now via parentId
40
+ *
41
+ * v0.5.0: Added 'feedback' and 'async' for richer flow semantics
32
42
  */
33
- export type DiagramEdgeRelation = 'flows_to' | 'depends_on'
43
+ export type DiagramEdgeRelation = 'flows_to' | 'depends_on' | 'feedback' | 'async'
34
44
 
35
45
  /**
36
46
  * A node in the diagram graph.
@@ -51,6 +61,8 @@ export interface DiagramNode {
51
61
  focusable?: boolean
52
62
  /** Feature maturity status (only for 'feature' nodes) */
53
63
  status?: FeatureStatus
64
+ /** Opaque metadata — engine interprets, contracts stay neutral */
65
+ meta?: Record<string, unknown>
54
66
  }
55
67
 
56
68
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * System Diagram Types (v0.4.0)
2
+ * System Diagram Types (v0.6.0)
3
3
  *
4
4
  * Schema for the Living ASCII System Diagram feature.
5
5
  * These types define the contract between:
@@ -11,6 +11,8 @@
11
11
  * - Client displays pre-rendered ASCII
12
12
  * - Snapshots pushed via CI automation
13
13
  *
14
+ * v0.6.0: meta is now opaque (Record<string, unknown>), engine interprets
15
+ *
14
16
  * @see docs/LIVING_ASCII_DIAGRAM_SPEC.md
15
17
  */
16
18
 
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "strict": true,
7
+ "noEmit": true,
8
+ "composite": true,
9
+ "skipLibCheck": true
10
+ },
11
+ "include": ["**/*.ts"],
12
+ "exclude": ["**/*.test.ts", "**/*.spec.ts"]
13
+ }
File without changes
File without changes