@company-semantics/contracts 0.0.6 → 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 (3) hide show
  1. package/index.ts +15 -1
  2. package/package.json +20 -1
  3. package/system/index.ts +91 -0
package/index.ts CHANGED
@@ -9,7 +9,10 @@
9
9
  * until they are proven stable.
10
10
  */
11
11
 
12
- // Intent categories - the semantic "what kind of concern"
12
+ /**
13
+ * Intent categories - the semantic "what kind of concern"
14
+ * @see LANGUAGE_INVARIANTS.md for language-level invariants
15
+ */
13
16
  export type IntentCategory = 'safety' | 'privacy' | 'correctness' | 'cost'
14
17
 
15
18
  // Confidence levels - shared vocabulary for certainty
@@ -17,3 +20,14 @@ export type InsightConfidence = 'low' | 'medium' | 'high'
17
20
 
18
21
  // Invariant enforcement phases (4.0 Observe → 4.1 Stabilize → 4.2 Enforce)
19
22
  export type InvariantPhase = 'observe' | 'stabilize' | 'enforce'
23
+
24
+ // System snapshot types (Living ASCII Diagram)
25
+ // @see docs/LIVING_ASCII_DIAGRAM_SPEC.md
26
+ export type {
27
+ FeatureStatus,
28
+ SystemCapability,
29
+ SystemLayer,
30
+ SystemCapabilityManifest,
31
+ SystemSnapshotMeta,
32
+ SystemSnapshot,
33
+ } from './system/index.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,9 +15,28 @@
15
15
  "types": "./index.ts",
16
16
  "files": [
17
17
  "index.ts",
18
+ "system/",
18
19
  "README.md"
19
20
  ],
20
21
  "publishConfig": {
21
22
  "access": "public"
23
+ },
24
+ "scripts": {
25
+ "typecheck": "tsc --noEmit",
26
+ "lint:md": "markdownlint-cli2 '**/*.md' '#node_modules'",
27
+ "lint:json": "node -e \"JSON.parse(require('fs').readFileSync('package.json'))\"",
28
+ "prepare": "husky"
29
+ },
30
+ "packageManager": "pnpm@10.25.0",
31
+ "devDependencies": {
32
+ "husky": "^9",
33
+ "lint-staged": "^15",
34
+ "markdownlint-cli2": "^0.17",
35
+ "typescript": "^5"
36
+ },
37
+ "lint-staged": {
38
+ "*.ts": "tsc --noEmit",
39
+ "*.md": "markdownlint-cli2",
40
+ "package.json": "node -e \"JSON.parse(require('fs').readFileSync('package.json'))\""
22
41
  }
23
42
  }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * System Snapshot Types
3
+ *
4
+ * Schema for the Living ASCII System Diagram feature.
5
+ * These types define the contract between:
6
+ * - company-semantics (generates snapshots)
7
+ * - company-semantics-site (renders snapshots)
8
+ *
9
+ * @see docs/LIVING_ASCII_DIAGRAM_SPEC.md
10
+ */
11
+
12
+ /**
13
+ * Feature maturity status.
14
+ * Displayed as markers in the ASCII diagram:
15
+ * [*] prod
16
+ * [~] experimental
17
+ * [ ] disabled
18
+ */
19
+ export type FeatureStatus = 'prod' | 'experimental' | 'disabled'
20
+
21
+ /**
22
+ * A single capability within a system layer.
23
+ */
24
+ export interface SystemCapability {
25
+ /** Unique identifier (e.g., 'entity_extraction') */
26
+ id: string
27
+ /** Human-readable label (e.g., 'Entity Extraction') */
28
+ label: string
29
+ /** Current maturity status */
30
+ status: FeatureStatus
31
+ /** Display order within layer (lower = higher) */
32
+ order: number
33
+ }
34
+
35
+ /**
36
+ * A logical layer in the system architecture.
37
+ */
38
+ export interface SystemLayer {
39
+ /** Unique identifier (e.g., 'semantics') */
40
+ id: string
41
+ /** Display label (e.g., 'SEMANTIC PROCESSING') */
42
+ label: string
43
+ /** Whether this layer is active */
44
+ enabled: boolean
45
+ /** Capabilities within this layer */
46
+ features: SystemCapability[]
47
+ }
48
+
49
+ /**
50
+ * Full system capability manifest.
51
+ * This is the TypeScript representation of capabilities.yaml
52
+ */
53
+ export interface SystemCapabilityManifest {
54
+ /** Manifest format version */
55
+ version: number
56
+ /** Schema version string (e.g., '1.0') */
57
+ schema_version: string
58
+ /** Ordered list of system layers */
59
+ layers: SystemLayer[]
60
+ }
61
+
62
+ /**
63
+ * Metadata accompanying a generated snapshot.
64
+ */
65
+ export interface SystemSnapshotMeta {
66
+ /** Metadata format version */
67
+ version: number
68
+ /** ISO 8601 timestamp of generation */
69
+ snapshotDate: string
70
+ /** Git commit SHA of source */
71
+ commitSha: string
72
+ /** Schema version used for generation */
73
+ schemaVersion: string
74
+ /** Visibility level (always 'public' for now) */
75
+ visibility: 'public'
76
+ /** SHA256 checksum of the ASCII content */
77
+ checksum?: string
78
+ }
79
+
80
+ /**
81
+ * Complete snapshot bundle (ASCII + metadata).
82
+ * Used when fetching/importing into the site.
83
+ */
84
+ export interface SystemSnapshot {
85
+ /** Raw ASCII diagram content */
86
+ ascii: string
87
+ /** Snapshot metadata */
88
+ meta: SystemSnapshotMeta
89
+ /** Optional explanation markdown */
90
+ explanation?: string
91
+ }