cox-protocol-package 1.0.2 → 1.2.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/CHANGELOG.md +22 -0
- package/COX_FILE_FORMAT_SPECIFICATION_v1.0.md +40 -200
- package/FINALIZATION.md +50 -0
- package/LocalAppManager/Dashboard/analytics_sidebar_panels/analytics_sidebar_panels.cox +56 -0
- package/LocalAppManager/Dashboard/analytics_sidebar_panels/analytics_sidebar_panels_screenshot.placeholder.txt +1 -0
- package/LocalAppManager/Dashboard/dashboard.cox +62 -0
- package/LocalAppManager/Dashboard/dashboard_screenshot.placeholder.txt +1 -0
- package/LocalAppManager/Dashboard/left_navigation_sidebar/left_navigation_sidebar.cox +56 -0
- package/LocalAppManager/Dashboard/left_navigation_sidebar/left_navigation_sidebar_screenshot.placeholder.txt +1 -0
- package/LocalAppManager/Dashboard/projects_grid_cards/projects_grid_cards.cox +56 -0
- package/LocalAppManager/Dashboard/projects_grid_cards/projects_grid_cards_screenshot.placeholder.txt +1 -0
- package/LocalAppManager/Dashboard/top_header_stats_bar/top_header_stats_bar.cox +56 -0
- package/LocalAppManager/Dashboard/top_header_stats_bar/top_header_stats_bar_screenshot.placeholder.txt +1 -0
- package/MANIFEST.in +20 -0
- package/README.md +67 -154
- package/bin/cox-protocol.js +23 -97
- package/cox_protocol/__init__.py +2 -0
- package/cox_protocol/__main__.py +3 -0
- package/cox_protocol/compiler.py +273 -0
- package/cox_protocol/cox_cli.py +146 -0
- package/cox_protocol/cox_lib.py +599 -0
- package/cox_protocol/package_target.py +262 -0
- package/cox_protocol/react_target.py +306 -0
- package/cox_protocol/scaffold.py +56 -0
- package/cox_protocol/schemas/cox.component.v1.schema.json +180 -0
- package/cox_protocol/schemas/cox.crop_metadata.v1.schema.json +83 -0
- package/cox_protocol/schemas/cox.manifest.v1.schema.json +172 -0
- package/cox_protocol/schemas/cox.page.v1.schema.json +242 -0
- package/cox_protocol/schemas/cox.protocol.v1.schema.json +38 -0
- package/cox_protocol/starter/README.md +7 -0
- package/cox_protocol/starter/manifest.cox +26 -0
- package/cox_protocol/starter/page/action_button/action_button.cox +34 -0
- package/cox_protocol/starter/page/action_button/reference.svg +1 -0
- package/cox_protocol/starter/page/page.cox +39 -0
- package/cox_protocol/starter/page/reference.svg +1 -0
- package/editor-support/vscode/CHANGELOG.md +6 -0
- package/editor-support/vscode/README.md +2 -1
- package/editor-support/vscode/package.json +3 -3
- package/editor-support/vscode/snippets/cox-common.json +1 -1
- package/editor-support/vscode/snippets/cox-component.json +2 -1
- package/editor-support/vscode/snippets/cox-crop-metadata.json +1 -1
- package/editor-support/vscode/snippets/cox-manifest.json +1 -1
- package/editor-support/vscode/snippets/cox-page.json +2 -1
- package/editor-support/vscode/snippets/cox-protocol.json +1 -1
- package/examples/quickstart/README.md +7 -0
- package/examples/quickstart/manifest.cox +26 -0
- package/examples/quickstart/page/action_button/action_button.cox +34 -0
- package/examples/quickstart/page/action_button/reference.svg +1 -0
- package/examples/quickstart/page/page.cox +39 -0
- package/examples/quickstart/page/reference.svg +1 -0
- package/guides/contract-demo.md +24 -0
- package/guides/npm-installation.md +16 -287
- package/manifest.cox +7 -4
- package/package.json +30 -14
- package/protocols/recursive_decomposition_protocol.cox +8 -8
- package/pyproject.toml +17 -6
- package/schemas/cox.component.v1.schema.json +17 -4
- package/schemas/cox.crop_metadata.v1.schema.json +1 -1
- package/schemas/cox.manifest.v1.schema.json +1 -1
- package/schemas/cox.page.v1.schema.json +17 -4
- package/schemas/cox.protocol.v1.schema.json +1 -1
- package/scripts/check_distribution.py +87 -0
- package/scripts/demo.py +62 -0
- package/scripts/package-vscode.mjs +12 -0
- package/scripts/release_check.py +86 -0
- package/tests/conftest.py +21 -0
- package/tests/test_cli_and_typescript.py +123 -0
- package/tests/test_compiler.py +279 -0
- package/tests/test_validation.py +215 -0
- package/tools/__init__.py +2 -2
- package/tools/cox_cli.py +2 -123
- package/tools/cox_lib.py +2 -558
- package/tools/package_target.py +2 -214
- package/tools/react_target.py +2 -278
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# COX example
|
|
2
|
+
|
|
3
|
+
This starter specifies an intended interface. Its SVG is an illustration, not evidence of a shipped product.
|
|
4
|
+
|
|
5
|
+
Run `cox validate .`, then `cox compile . --target all`. React output is structural scaffolding: supply actual styles, behavior and tests in the consuming app.
|
|
6
|
+
|
|
7
|
+
Change `EvidenceSummary.Intended` to an unknown level such as `Certain` to see a schema diagnostic; restore it and revalidate. `cox verify-package build/package/<project-slug>.zip` checks the archived file inventory.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CoxVersion: '1.0'
|
|
2
|
+
FileType: manifest
|
|
3
|
+
Slug: cox_example
|
|
4
|
+
Schema: cox.manifest.v1
|
|
5
|
+
ProjectName: CoxExample
|
|
6
|
+
PackageName: cox_example.zip
|
|
7
|
+
ProtocolExtension: .cox
|
|
8
|
+
MimeType: application/vnd.cox+yaml
|
|
9
|
+
EntryPoint: manifest.cox
|
|
10
|
+
ReferenceDocs:
|
|
11
|
+
- README.md
|
|
12
|
+
Pages:
|
|
13
|
+
- PageName: Example
|
|
14
|
+
Slug: example
|
|
15
|
+
Folder: page
|
|
16
|
+
PageInstruction: page/page.cox
|
|
17
|
+
PageScreenshotPlaceholder: page/reference.svg
|
|
18
|
+
Components:
|
|
19
|
+
- Slug: action_button
|
|
20
|
+
Folder: page/action_button
|
|
21
|
+
ComponentInstruction: page/action_button/action_button.cox
|
|
22
|
+
ComponentScreenshotPlaceholder: page/action_button/reference.svg
|
|
23
|
+
BuildTargets:
|
|
24
|
+
- json
|
|
25
|
+
- react
|
|
26
|
+
- package
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
CoxVersion: '1.0'
|
|
2
|
+
FileType: component_spec
|
|
3
|
+
Slug: action_button
|
|
4
|
+
Schema: cox.component.v1
|
|
5
|
+
ComponentName: ActionButton
|
|
6
|
+
Role: Primary action
|
|
7
|
+
EvidenceSummary:
|
|
8
|
+
Visible: []
|
|
9
|
+
UserSpecified: []
|
|
10
|
+
Inferred: []
|
|
11
|
+
Intended:
|
|
12
|
+
- Reference illustration describes a proposed interface, not an observed deployed
|
|
13
|
+
product.
|
|
14
|
+
Recommended: []
|
|
15
|
+
VisibleStructure:
|
|
16
|
+
Label: Continue
|
|
17
|
+
Interactions:
|
|
18
|
+
Intended:
|
|
19
|
+
- Activate using pointer, Enter or Space.
|
|
20
|
+
Recommended:
|
|
21
|
+
- Preserve a visible keyboard focus indicator.
|
|
22
|
+
NamingDecision:
|
|
23
|
+
ChosenName: action_button
|
|
24
|
+
Reason: Explicit role in the example brief.
|
|
25
|
+
RejectedAlternatives: []
|
|
26
|
+
AmbiguityRisk: Low
|
|
27
|
+
EvidenceLevel: Intended
|
|
28
|
+
VisualStyle:
|
|
29
|
+
Tokens:
|
|
30
|
+
- color.action
|
|
31
|
+
- space.control
|
|
32
|
+
ImplementationHints:
|
|
33
|
+
- Implement the action only after its behavior is supplied; the compiler emits a structural
|
|
34
|
+
scaffold.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="480" height="240" viewBox="0 0 480 240"><rect width="480" height="240" fill="#f8fafc"/><text x="32" y="48" font-family="sans-serif" font-size="18" fill="#0f172a">COX example: intended interface</text><rect x="32" y="92" width="144" height="48" rx="8" fill="#1d4ed8"/><text x="68" y="122" font-family="sans-serif" font-size="16" fill="white">Continue</text><text x="32" y="192" font-family="sans-serif" font-size="12" fill="#475569">Reference illustration; not a product screenshot.</text></svg>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
CoxVersion: '1.0'
|
|
2
|
+
FileType: page_spec
|
|
3
|
+
Slug: example
|
|
4
|
+
Schema: cox.page.v1
|
|
5
|
+
PageName: Example
|
|
6
|
+
ProjectName: CoxExample
|
|
7
|
+
EvidenceSummary:
|
|
8
|
+
Visible: []
|
|
9
|
+
UserSpecified: []
|
|
10
|
+
Inferred: []
|
|
11
|
+
Intended:
|
|
12
|
+
- Reference illustration describes a proposed interface, not an observed deployed
|
|
13
|
+
product.
|
|
14
|
+
Recommended: []
|
|
15
|
+
VisibleStructure:
|
|
16
|
+
Regions:
|
|
17
|
+
- primary_action
|
|
18
|
+
Interactions:
|
|
19
|
+
Intended:
|
|
20
|
+
- User reviews the proposed action before invoking it.
|
|
21
|
+
NamingDecision:
|
|
22
|
+
ChosenName: Example
|
|
23
|
+
Reason: Explicit role in the example brief.
|
|
24
|
+
RejectedAlternatives: []
|
|
25
|
+
AmbiguityRisk: Low
|
|
26
|
+
EvidenceLevel: Intended
|
|
27
|
+
Layout:
|
|
28
|
+
Desktop: One centered content column.
|
|
29
|
+
Tablet: One centered content column.
|
|
30
|
+
Mobile: One column with comfortable page padding.
|
|
31
|
+
Children:
|
|
32
|
+
Components:
|
|
33
|
+
- Slug: action_button
|
|
34
|
+
Folder: action_button/
|
|
35
|
+
Role: Primary action
|
|
36
|
+
RecursiveDecompositionDecision:
|
|
37
|
+
Complexity: SimplePage
|
|
38
|
+
Reason: One reusable action.
|
|
39
|
+
Action: Bind the action_button component.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="480" height="240" viewBox="0 0 480 240"><rect width="480" height="240" fill="#f8fafc"/><text x="32" y="48" font-family="sans-serif" font-size="18" fill="#0f172a">COX example: intended interface</text><rect x="32" y="92" width="144" height="48" rx="8" fill="#1d4ed8"/><text x="68" y="122" font-family="sans-serif" font-size="16" fill="white">Continue</text><text x="32" y="192" font-family="sans-serif" font-size="12" fill="#475569">Reference illustration; not a product screenshot.</text></svg>
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
- Align release versions with the compiler and validate complete document snippets against canonical schemas.
|
|
6
|
+
- Include UserSpecified interaction evidence in authoring snippets.
|
|
7
|
+
- Use the locked repository packaging toolchain.
|
|
8
|
+
|
|
3
9
|
## 1.1.0
|
|
4
10
|
|
|
5
11
|
- Added installable extension metadata for COX Language Support
|
|
@@ -24,7 +24,8 @@ COX Language Support adds syntax highlighting, editor configuration, and authori
|
|
|
24
24
|
Create a local VSIX package from this folder:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
|
|
27
|
+
npm ci --prefix ../..
|
|
28
|
+
npm run package
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
## Notes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "cox-language-support",
|
|
3
3
|
"displayName": "COX Language Support",
|
|
4
4
|
"description": "Syntax highlighting, snippets, and packaging support for COX files.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"publisher": "charbelmalo",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"preview": true,
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"agent-readable"
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
|
-
"package": "
|
|
34
|
+
"package": "node ../../scripts/package-vscode.mjs"
|
|
35
35
|
},
|
|
36
36
|
"contributes": {
|
|
37
37
|
"languages": [
|
|
@@ -87,4 +87,4 @@
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
}
|
|
90
|
+
}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
" Tokens: []",
|
|
27
27
|
"Interactions:",
|
|
28
28
|
" Visible: []",
|
|
29
|
+
" UserSpecified: []",
|
|
29
30
|
" Inferred: []",
|
|
30
31
|
" Intended: []",
|
|
31
32
|
" Recommended: []",
|
|
@@ -38,4 +39,4 @@
|
|
|
38
39
|
],
|
|
39
40
|
"description": "Insert a COX component specification skeleton"
|
|
40
41
|
}
|
|
41
|
-
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# COX example
|
|
2
|
+
|
|
3
|
+
This starter specifies an intended interface. Its SVG is an illustration, not evidence of a shipped product.
|
|
4
|
+
|
|
5
|
+
Run `cox validate .`, then `cox compile . --target all`. React output is structural scaffolding: supply actual styles, behavior and tests in the consuming app.
|
|
6
|
+
|
|
7
|
+
Change `EvidenceSummary.Intended` to an unknown level such as `Certain` to see a schema diagnostic; restore it and revalidate. `cox verify-package build/package/<project-slug>.zip` checks the archived file inventory.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CoxVersion: '1.0'
|
|
2
|
+
FileType: manifest
|
|
3
|
+
Slug: cox_example
|
|
4
|
+
Schema: cox.manifest.v1
|
|
5
|
+
ProjectName: CoxExample
|
|
6
|
+
PackageName: cox_example.zip
|
|
7
|
+
ProtocolExtension: .cox
|
|
8
|
+
MimeType: application/vnd.cox+yaml
|
|
9
|
+
EntryPoint: manifest.cox
|
|
10
|
+
ReferenceDocs:
|
|
11
|
+
- README.md
|
|
12
|
+
Pages:
|
|
13
|
+
- PageName: Example
|
|
14
|
+
Slug: example
|
|
15
|
+
Folder: page
|
|
16
|
+
PageInstruction: page/page.cox
|
|
17
|
+
PageScreenshotPlaceholder: page/reference.svg
|
|
18
|
+
Components:
|
|
19
|
+
- Slug: action_button
|
|
20
|
+
Folder: page/action_button
|
|
21
|
+
ComponentInstruction: page/action_button/action_button.cox
|
|
22
|
+
ComponentScreenshotPlaceholder: page/action_button/reference.svg
|
|
23
|
+
BuildTargets:
|
|
24
|
+
- json
|
|
25
|
+
- react
|
|
26
|
+
- package
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
CoxVersion: '1.0'
|
|
2
|
+
FileType: component_spec
|
|
3
|
+
Slug: action_button
|
|
4
|
+
Schema: cox.component.v1
|
|
5
|
+
ComponentName: ActionButton
|
|
6
|
+
Role: Primary action
|
|
7
|
+
EvidenceSummary:
|
|
8
|
+
Visible: []
|
|
9
|
+
UserSpecified: []
|
|
10
|
+
Inferred: []
|
|
11
|
+
Intended:
|
|
12
|
+
- Reference illustration describes a proposed interface, not an observed deployed
|
|
13
|
+
product.
|
|
14
|
+
Recommended: []
|
|
15
|
+
VisibleStructure:
|
|
16
|
+
Label: Continue
|
|
17
|
+
Interactions:
|
|
18
|
+
Intended:
|
|
19
|
+
- Activate using pointer, Enter or Space.
|
|
20
|
+
Recommended:
|
|
21
|
+
- Preserve a visible keyboard focus indicator.
|
|
22
|
+
NamingDecision:
|
|
23
|
+
ChosenName: action_button
|
|
24
|
+
Reason: Explicit role in the example brief.
|
|
25
|
+
RejectedAlternatives: []
|
|
26
|
+
AmbiguityRisk: Low
|
|
27
|
+
EvidenceLevel: Intended
|
|
28
|
+
VisualStyle:
|
|
29
|
+
Tokens:
|
|
30
|
+
- color.action
|
|
31
|
+
- space.control
|
|
32
|
+
ImplementationHints:
|
|
33
|
+
- Implement the action only after its behavior is supplied; the compiler emits a structural
|
|
34
|
+
scaffold.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="480" height="240" viewBox="0 0 480 240"><rect width="480" height="240" fill="#f8fafc"/><text x="32" y="48" font-family="sans-serif" font-size="18" fill="#0f172a">COX example: intended interface</text><rect x="32" y="92" width="144" height="48" rx="8" fill="#1d4ed8"/><text x="68" y="122" font-family="sans-serif" font-size="16" fill="white">Continue</text><text x="32" y="192" font-family="sans-serif" font-size="12" fill="#475569">Reference illustration; not a product screenshot.</text></svg>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
CoxVersion: '1.0'
|
|
2
|
+
FileType: page_spec
|
|
3
|
+
Slug: example
|
|
4
|
+
Schema: cox.page.v1
|
|
5
|
+
PageName: Example
|
|
6
|
+
ProjectName: CoxExample
|
|
7
|
+
EvidenceSummary:
|
|
8
|
+
Visible: []
|
|
9
|
+
UserSpecified: []
|
|
10
|
+
Inferred: []
|
|
11
|
+
Intended:
|
|
12
|
+
- Reference illustration describes a proposed interface, not an observed deployed
|
|
13
|
+
product.
|
|
14
|
+
Recommended: []
|
|
15
|
+
VisibleStructure:
|
|
16
|
+
Regions:
|
|
17
|
+
- primary_action
|
|
18
|
+
Interactions:
|
|
19
|
+
Intended:
|
|
20
|
+
- User reviews the proposed action before invoking it.
|
|
21
|
+
NamingDecision:
|
|
22
|
+
ChosenName: Example
|
|
23
|
+
Reason: Explicit role in the example brief.
|
|
24
|
+
RejectedAlternatives: []
|
|
25
|
+
AmbiguityRisk: Low
|
|
26
|
+
EvidenceLevel: Intended
|
|
27
|
+
Layout:
|
|
28
|
+
Desktop: One centered content column.
|
|
29
|
+
Tablet: One centered content column.
|
|
30
|
+
Mobile: One column with comfortable page padding.
|
|
31
|
+
Children:
|
|
32
|
+
Components:
|
|
33
|
+
- Slug: action_button
|
|
34
|
+
Folder: action_button/
|
|
35
|
+
Role: Primary action
|
|
36
|
+
RecursiveDecompositionDecision:
|
|
37
|
+
Complexity: SimplePage
|
|
38
|
+
Reason: One reusable action.
|
|
39
|
+
Action: Bind the action_button component.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="480" height="240" viewBox="0 0 480 240"><rect width="480" height="240" fill="#f8fafc"/><text x="32" y="48" font-family="sans-serif" font-size="18" fill="#0f172a">COX example: intended interface</text><rect x="32" y="92" width="144" height="48" rx="8" fill="#1d4ed8"/><text x="68" y="122" font-family="sans-serif" font-size="16" fill="white">Continue</text><text x="32" y="192" font-family="sans-serif" font-size="12" fill="#475569">Reference illustration; not a product screenshot.</text></svg>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Contract → diagnostic → correction → artifact
|
|
2
|
+
|
|
3
|
+
The reproducible demonstration uses a manifest, one page and one action component. It establishes identity and evidence handling in the implemented COX compiler.
|
|
4
|
+
|
|
5
|
+
After installing the project, run from the source checkout:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python scripts/demo.py --out /tmp/cox-contract-demo
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The directory must be new or empty. The script creates the starter, temporarily changes the component's `Slug` from `action_button` to `action_buton`, captures the actual `BINDING_MISMATCH` error, restores the correct value, validates three documents, compiles all targets into an external directory and verifies the ZIP inventory.
|
|
12
|
+
|
|
13
|
+
Read these artifacts in order:
|
|
14
|
+
|
|
15
|
+
1. `01-invalid-component.cox.txt`: the broken contract.
|
|
16
|
+
2. `02-diagnostic.json`: the real validator output, including file and field.
|
|
17
|
+
3. `03-corrected-component.cox.txt`: the single-field correction.
|
|
18
|
+
4. `04-result.json`: observed result and capability scope.
|
|
19
|
+
5. `build/react/`: typed scaffolding that retains evidence and intended behavior as comments.
|
|
20
|
+
6. `build/package/`: source/artifact ZIP and SHA-256 inventory.
|
|
21
|
+
|
|
22
|
+
The reference SVGs are illustrations of a proposed layout. They are not screenshots of a deployed application. The generated React uses structural `<main>` and `<section>` elements; an implementer supplies the real controls, styling and behavior.
|
|
23
|
+
|
|
24
|
+
This example checks a design-contract binding. It does not inspect rendered UI, evaluate an application's AST, or prove that the intended keyboard interaction has been implemented. A portfolio case study can show the concrete failure/recovery loop and explain these boundaries.
|