@unispechq/unispec-core 0.1.0 → 0.1.1

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.
@@ -1,74 +1,74 @@
1
- name: CI & Publish UniSpec Core
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- tags:
8
- - "unispec-core-v*"
9
- pull_request:
10
- branches:
11
- - main
12
-
13
- jobs:
14
- ci:
15
- name: CI (install & pack)
16
- runs-on: ubuntu-latest
17
-
18
- steps:
19
- - name: Checkout repo
20
- uses: actions/checkout@v4
21
-
22
- - name: Use Node.js
23
- uses: actions/setup-node@v4
24
- with:
25
- node-version: 20
26
-
27
- - name: Install dependencies
28
- run: |
29
- if [ -f package-lock.json ]; then
30
- npm ci
31
- else
32
- npm install
33
- fi
34
-
35
- - name: Run tests (if defined)
36
- run: |
37
- if npm run | grep -q " test"; then
38
- npm test
39
- else
40
- echo "No test script defined, skipping tests"
41
- fi
42
-
43
- - name: Verify package can be packed
44
- run: npm pack --dry-run
45
-
46
- publish:
47
- name: Publish to npm
48
- needs: ci
49
- runs-on: ubuntu-latest
50
- if: startsWith(github.ref, 'refs/tags/unispec-core-v')
51
-
52
- steps:
53
- - name: Checkout repo
54
- uses: actions/checkout@v4
55
-
56
- - name: Use Node.js with npm registry
57
- uses: actions/setup-node@v4
58
- with:
59
- node-version: 20
60
- registry-url: https://registry.npmjs.org
61
- scope: "@unispechq"
62
-
63
- - name: Install dependencies
64
- run: |
65
- if [ -f package-lock.json ]; then
66
- npm ci
67
- else
68
- npm install
69
- fi
70
-
71
- - name: Publish @unispechq/unispec-core to npm
72
- env:
73
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
74
- run: npm publish --access public
1
+ name: CI & Publish UniSpec Core
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - "unispec-core-v*"
9
+ pull_request:
10
+ branches:
11
+ - main
12
+
13
+ jobs:
14
+ ci:
15
+ name: CI (install & pack)
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - name: Checkout repo
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Use Node.js
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: 20
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ if [ -f package-lock.json ]; then
30
+ npm ci
31
+ else
32
+ npm install
33
+ fi
34
+
35
+ - name: Run tests (if defined)
36
+ run: |
37
+ if npm run | grep -q " test"; then
38
+ npm test
39
+ else
40
+ echo "No test script defined, skipping tests"
41
+ fi
42
+
43
+ - name: Verify package can be packed
44
+ run: npm pack --dry-run
45
+
46
+ publish:
47
+ name: Publish to npm
48
+ needs: ci
49
+ runs-on: ubuntu-latest
50
+ if: startsWith(github.ref, 'refs/tags/unispec-core-v')
51
+
52
+ steps:
53
+ - name: Checkout repo
54
+ uses: actions/checkout@v4
55
+
56
+ - name: Use Node.js with npm registry
57
+ uses: actions/setup-node@v4
58
+ with:
59
+ node-version: 20
60
+ registry-url: https://registry.npmjs.org
61
+ scope: "@unispechq"
62
+
63
+ - name: Install dependencies
64
+ run: |
65
+ if [ -f package-lock.json ]; then
66
+ npm ci
67
+ else
68
+ npm install
69
+ fi
70
+
71
+ - name: Publish @unispechq/unispec-core to npm
72
+ env:
73
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
74
+ run: npm publish --access public
package/.windsurfrules CHANGED
@@ -1,138 +1,138 @@
1
- # WindSurf Rules for `unispec-core`
2
- # ---------------------------------
3
- # This ruleset defines how AI assistants, contributors, and reviewers must
4
- # interact with the UniSpec Core Engine repository.
5
- # The Core Engine provides validation, parsing, normalization, diffing,
6
- # and conversion logic for UniSpec specifications.
7
-
8
- repository:
9
- name: "unispec-core"
10
- description: "Runtime implementation of the UniSpec Core Engine (loader, validator, normalizer, diff engine, converters, shared types). This repository contains only the Core Engine used by other UniSpec platform components (CLI, Registry, Portal, adapters, SDKs)."
11
- visibility: public
12
- criticality: core
13
-
14
- goals:
15
- - Implement the runtime mechanics of the UniSpec format defined in `unispec-spec`.
16
- - Provide parsing, validation, normalization, and diffing for UniSpec documents.
17
- - Provide reusable shared types and utilities for CLI, adapters, registry, and portal.
18
- - Ensure strict alignment with the specification and JSON Schemas.
19
- - Consume organization-wide context through MCP GitHub server without violating boundaries.
20
- - Remain lightweight, stable, deterministic, and fully spec-compliant.
21
-
22
- assistant_instructions:
23
- allowed_actions:
24
- - Read and reference content from other UniSpec repositories via MCP GitHub.
25
- - Generate and update logic within this repository related to:
26
- - parsing UniSpec documents,
27
- - JSON Schema validation,
28
- - normalization,
29
- - diffing,
30
- - conversions (OpenAPI, GraphQL SDL, WebSocket models),
31
- - shared types and interfaces.
32
- - Suggest architectural improvements to core modules.
33
- - Assist in writing documentation, API descriptions, comments, and design notes.
34
- - Validate behavior using actual spec files from `unispec-spec`.
35
-
36
- forbidden_actions:
37
- - Modify any files in external repositories.
38
- - Introduce changes to the UniSpec language itself (belongs to `unispec-spec`).
39
- - Implement features that are not grounded in the official spec.
40
- - Add framework-specific or platform-specific logic (belongs to adapters).
41
- - Add server code, API endpoints, frontend components, or CLI commands.
42
- - Introduce non-deterministic behavior or global mutable state.
43
- - Modify specification version numbers (belongs to `unispec-spec`).
44
-
45
- escalation_policy:
46
- - Any behavior that deviates from the official UniSpec spec must require maintainer confirmation.
47
- - If MCP data reveals discrepancies between spec and code, assistant must warn and suggest alignment.
48
- - For potentially breaking API changes, assistant must halt and request maintainer approval.
49
-
50
- context_model:
51
- mcp_github_usage:
52
- allowed:
53
- - Access organization repositories for context (read-only).
54
- - Inspect:
55
- - UniSpec format (`unispec-spec`)
56
- - CLI behavior (`unispec-platform`)
57
- - Adapters (`unispec-js-adapters`, `unispec-python-adapters`)
58
- - Registry and Portal APIs
59
- - Use cross-repo information to ensure Core Engine behavior matches platform expectations.
60
- forbidden:
61
- - Editing or mutating files in other repositories.
62
- - Making assumptions not supported by spec.
63
- - Introducing coupling that makes core depend on implementation details.
64
- behaviors:
65
- - Treat external repos purely as reference sources.
66
- - Maintain strict alignment with the spec repo.
67
- - Do not derive new behaviors not defined by the spec.
68
-
69
- file_structure:
70
- required_directories:
71
- src: "Source code for the Core Engine logic"
72
- src/loader: "Spec loader and YAML/JSON reading utilities"
73
- src/validator: "Schema validation logic using official UniSpec JSON Schemas"
74
- src/normalizer: "Canonical normalization of UniSpec documents"
75
- src/diff: "Diff engine and breaking change detection"
76
- src/converters: "Converters for OpenAPI, GraphQL, WebSocket, etc."
77
- src/types: "Shared public-facing TypeScript types/interfaces"
78
- docs: "Developer documentation and design notes"
79
-
80
- required_files:
81
- - "README.md"
82
- - "package.json"
83
- - "src/index.ts"
84
- - "src/types/index.ts"
85
-
86
- content_guidelines:
87
- code_requirements:
88
- - Must be deterministic, pure, and side-effect-free where possible.
89
- - Must strictly follow the UniSpec JSON Schema definitions.
90
- - Must use official schemas from `unispec-spec` (via MCP reference or local import).
91
- - Should be modular, composable, and testable.
92
- - Must not depend on frameworks (Express, Nest, FastAPI, etc).
93
- - Must not include platform logic (Registry/Portal).
94
-
95
- documentation:
96
- - All modules must have clear API descriptions and rationale.
97
- - Example inputs and outputs should reference real UniSpec examples.
98
- - Must reflect the latest UniSpec specification.
99
-
100
- testing:
101
- - Core behavior must be validated using examples from `unispec-spec/examples`.
102
- - All changes must include tests for validation, normalization, diffing, and conversions.
103
- - Tests must cover edge cases and backward compatibility.
104
-
105
- versioning_policy:
106
- rules:
107
- - Core versioning follows the platform, not the spec.
108
- - Breaking API changes require:
109
- - Maintainer approval
110
- - Minor versions may add new converters or metadata fields if spec permits.
111
- - Patch versions fix issues, improve accuracy, or correct types.
112
-
113
- pull_request_rules:
114
- - PRs must describe:
115
- - intent,
116
- - expected behavior,
117
- - impact on users,
118
- - compatibility implications.
119
- - PRs affecting validation, types, or normalization must include:
120
- - tests,
121
- - updated docs,
122
- - verification against real examples.
123
- - Schema-dependent logic must be checked against `unispec-spec` via MCP.
124
-
125
- tone_and_style:
126
- - Code and docs must be clean, consistent, and professional.
127
- - Naming conventions must follow spec terminology.
128
- - No noisy logs, no temporary/debug code.
129
-
130
- license:
131
- - Must remain open-source.
132
- - Core engine logic must be available for public use.
133
-
134
- notes:
135
- - This repository implements the *mechanics* of UniSpec, not the language definition.
136
- - The UniSpec format itself lives in `unispec-spec`.
137
- - Adapters, CLI, Registry, and Portal depend on core — keep APIs stable and predictable.
138
- - MCP GitHub context may be used for reasoning but not for cross-repo modifications.
1
+ # WindSurf Rules for `unispec-core`
2
+ # ---------------------------------
3
+ # This ruleset defines how AI assistants, contributors, and reviewers must
4
+ # interact with the UniSpec Core Engine repository.
5
+ # The Core Engine provides validation, parsing, normalization, diffing,
6
+ # and conversion logic for UniSpec specifications.
7
+
8
+ repository:
9
+ name: "unispec-core"
10
+ description: "Runtime implementation of the UniSpec Core Engine (loader, validator, normalizer, diff engine, converters, shared types). This repository contains only the Core Engine used by other UniSpec platform components (CLI, Registry, Portal, adapters, SDKs)."
11
+ visibility: public
12
+ criticality: core
13
+
14
+ goals:
15
+ - Implement the runtime mechanics of the UniSpec format defined in `unispec-spec`.
16
+ - Provide parsing, validation, normalization, and diffing for UniSpec documents.
17
+ - Provide reusable shared types and utilities for CLI, adapters, registry, and portal.
18
+ - Ensure strict alignment with the specification and JSON Schemas.
19
+ - Consume organization-wide context through MCP GitHub server without violating boundaries.
20
+ - Remain lightweight, stable, deterministic, and fully spec-compliant.
21
+
22
+ assistant_instructions:
23
+ allowed_actions:
24
+ - Read and reference content from other UniSpec repositories via MCP GitHub.
25
+ - Generate and update logic within this repository related to:
26
+ - parsing UniSpec documents,
27
+ - JSON Schema validation,
28
+ - normalization,
29
+ - diffing,
30
+ - conversions (OpenAPI, GraphQL SDL, WebSocket models),
31
+ - shared types and interfaces.
32
+ - Suggest architectural improvements to core modules.
33
+ - Assist in writing documentation, API descriptions, comments, and design notes.
34
+ - Validate behavior using actual spec files from `unispec-spec`.
35
+
36
+ forbidden_actions:
37
+ - Modify any files in external repositories.
38
+ - Introduce changes to the UniSpec language itself (belongs to `unispec-spec`).
39
+ - Implement features that are not grounded in the official spec.
40
+ - Add framework-specific or platform-specific logic (belongs to adapters).
41
+ - Add server code, API endpoints, frontend components, or CLI commands.
42
+ - Introduce non-deterministic behavior or global mutable state.
43
+ - Modify specification version numbers (belongs to `unispec-spec`).
44
+
45
+ escalation_policy:
46
+ - Any behavior that deviates from the official UniSpec spec must require maintainer confirmation.
47
+ - If MCP data reveals discrepancies between spec and code, assistant must warn and suggest alignment.
48
+ - For potentially breaking API changes, assistant must halt and request maintainer approval.
49
+
50
+ context_model:
51
+ mcp_github_usage:
52
+ allowed:
53
+ - Access organization repositories for context (read-only).
54
+ - Inspect:
55
+ - UniSpec format (`unispec-spec`)
56
+ - CLI behavior (`unispec-platform`)
57
+ - Adapters (`unispec-js-adapters`, `unispec-python-adapters`)
58
+ - Registry and Portal APIs
59
+ - Use cross-repo information to ensure Core Engine behavior matches platform expectations.
60
+ forbidden:
61
+ - Editing or mutating files in other repositories.
62
+ - Making assumptions not supported by spec.
63
+ - Introducing coupling that makes core depend on implementation details.
64
+ behaviors:
65
+ - Treat external repos purely as reference sources.
66
+ - Maintain strict alignment with the spec repo.
67
+ - Do not derive new behaviors not defined by the spec.
68
+
69
+ file_structure:
70
+ required_directories:
71
+ src: "Source code for the Core Engine logic"
72
+ src/loader: "Spec loader and YAML/JSON reading utilities"
73
+ src/validator: "Schema validation logic using official UniSpec JSON Schemas"
74
+ src/normalizer: "Canonical normalization of UniSpec documents"
75
+ src/diff: "Diff engine and breaking change detection"
76
+ src/converters: "Converters for OpenAPI, GraphQL, WebSocket, etc."
77
+ src/types: "Shared public-facing TypeScript types/interfaces"
78
+ docs: "Developer documentation and design notes"
79
+
80
+ required_files:
81
+ - "README.md"
82
+ - "package.json"
83
+ - "src/index.ts"
84
+ - "src/types/index.ts"
85
+
86
+ content_guidelines:
87
+ code_requirements:
88
+ - Must be deterministic, pure, and side-effect-free where possible.
89
+ - Must strictly follow the UniSpec JSON Schema definitions.
90
+ - Must use official schemas from `unispec-spec` (via MCP reference or local import).
91
+ - Should be modular, composable, and testable.
92
+ - Must not depend on frameworks (Express, Nest, FastAPI, etc).
93
+ - Must not include platform logic (Registry/Portal).
94
+
95
+ documentation:
96
+ - All modules must have clear API descriptions and rationale.
97
+ - Example inputs and outputs should reference real UniSpec examples.
98
+ - Must reflect the latest UniSpec specification.
99
+
100
+ testing:
101
+ - Core behavior must be validated using examples from `unispec-spec/examples`.
102
+ - All changes must include tests for validation, normalization, diffing, and conversions.
103
+ - Tests must cover edge cases and backward compatibility.
104
+
105
+ versioning_policy:
106
+ rules:
107
+ - Core versioning follows the platform, not the spec.
108
+ - Breaking API changes require:
109
+ - Maintainer approval
110
+ - Minor versions may add new converters or metadata fields if spec permits.
111
+ - Patch versions fix issues, improve accuracy, or correct types.
112
+
113
+ pull_request_rules:
114
+ - PRs must describe:
115
+ - intent,
116
+ - expected behavior,
117
+ - impact on users,
118
+ - compatibility implications.
119
+ - PRs affecting validation, types, or normalization must include:
120
+ - tests,
121
+ - updated docs,
122
+ - verification against real examples.
123
+ - Schema-dependent logic must be checked against `unispec-spec` via MCP.
124
+
125
+ tone_and_style:
126
+ - Code and docs must be clean, consistent, and professional.
127
+ - Naming conventions must follow spec terminology.
128
+ - No noisy logs, no temporary/debug code.
129
+
130
+ license:
131
+ - Must remain open-source.
132
+ - Core engine logic must be available for public use.
133
+
134
+ notes:
135
+ - This repository implements the *mechanics* of UniSpec, not the language definition.
136
+ - The UniSpec format itself lives in `unispec-spec`.
137
+ - Adapters, CLI, Registry, and Portal depend on core — keep APIs stable and predictable.
138
+ - MCP GitHub context may be used for reasoning but not for cross-repo modifications.