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.
Files changed (74) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/COX_FILE_FORMAT_SPECIFICATION_v1.0.md +40 -200
  3. package/FINALIZATION.md +50 -0
  4. package/LocalAppManager/Dashboard/analytics_sidebar_panels/analytics_sidebar_panels.cox +56 -0
  5. package/LocalAppManager/Dashboard/analytics_sidebar_panels/analytics_sidebar_panels_screenshot.placeholder.txt +1 -0
  6. package/LocalAppManager/Dashboard/dashboard.cox +62 -0
  7. package/LocalAppManager/Dashboard/dashboard_screenshot.placeholder.txt +1 -0
  8. package/LocalAppManager/Dashboard/left_navigation_sidebar/left_navigation_sidebar.cox +56 -0
  9. package/LocalAppManager/Dashboard/left_navigation_sidebar/left_navigation_sidebar_screenshot.placeholder.txt +1 -0
  10. package/LocalAppManager/Dashboard/projects_grid_cards/projects_grid_cards.cox +56 -0
  11. package/LocalAppManager/Dashboard/projects_grid_cards/projects_grid_cards_screenshot.placeholder.txt +1 -0
  12. package/LocalAppManager/Dashboard/top_header_stats_bar/top_header_stats_bar.cox +56 -0
  13. package/LocalAppManager/Dashboard/top_header_stats_bar/top_header_stats_bar_screenshot.placeholder.txt +1 -0
  14. package/MANIFEST.in +20 -0
  15. package/README.md +67 -154
  16. package/bin/cox-protocol.js +23 -97
  17. package/cox_protocol/__init__.py +2 -0
  18. package/cox_protocol/__main__.py +3 -0
  19. package/cox_protocol/compiler.py +273 -0
  20. package/cox_protocol/cox_cli.py +146 -0
  21. package/cox_protocol/cox_lib.py +599 -0
  22. package/cox_protocol/package_target.py +262 -0
  23. package/cox_protocol/react_target.py +306 -0
  24. package/cox_protocol/scaffold.py +56 -0
  25. package/cox_protocol/schemas/cox.component.v1.schema.json +180 -0
  26. package/cox_protocol/schemas/cox.crop_metadata.v1.schema.json +83 -0
  27. package/cox_protocol/schemas/cox.manifest.v1.schema.json +172 -0
  28. package/cox_protocol/schemas/cox.page.v1.schema.json +242 -0
  29. package/cox_protocol/schemas/cox.protocol.v1.schema.json +38 -0
  30. package/cox_protocol/starter/README.md +7 -0
  31. package/cox_protocol/starter/manifest.cox +26 -0
  32. package/cox_protocol/starter/page/action_button/action_button.cox +34 -0
  33. package/cox_protocol/starter/page/action_button/reference.svg +1 -0
  34. package/cox_protocol/starter/page/page.cox +39 -0
  35. package/cox_protocol/starter/page/reference.svg +1 -0
  36. package/editor-support/vscode/CHANGELOG.md +6 -0
  37. package/editor-support/vscode/README.md +2 -1
  38. package/editor-support/vscode/package.json +3 -3
  39. package/editor-support/vscode/snippets/cox-common.json +1 -1
  40. package/editor-support/vscode/snippets/cox-component.json +2 -1
  41. package/editor-support/vscode/snippets/cox-crop-metadata.json +1 -1
  42. package/editor-support/vscode/snippets/cox-manifest.json +1 -1
  43. package/editor-support/vscode/snippets/cox-page.json +2 -1
  44. package/editor-support/vscode/snippets/cox-protocol.json +1 -1
  45. package/examples/quickstart/README.md +7 -0
  46. package/examples/quickstart/manifest.cox +26 -0
  47. package/examples/quickstart/page/action_button/action_button.cox +34 -0
  48. package/examples/quickstart/page/action_button/reference.svg +1 -0
  49. package/examples/quickstart/page/page.cox +39 -0
  50. package/examples/quickstart/page/reference.svg +1 -0
  51. package/guides/contract-demo.md +24 -0
  52. package/guides/npm-installation.md +16 -287
  53. package/manifest.cox +7 -4
  54. package/package.json +30 -14
  55. package/protocols/recursive_decomposition_protocol.cox +8 -8
  56. package/pyproject.toml +17 -6
  57. package/schemas/cox.component.v1.schema.json +17 -4
  58. package/schemas/cox.crop_metadata.v1.schema.json +1 -1
  59. package/schemas/cox.manifest.v1.schema.json +1 -1
  60. package/schemas/cox.page.v1.schema.json +17 -4
  61. package/schemas/cox.protocol.v1.schema.json +1 -1
  62. package/scripts/check_distribution.py +87 -0
  63. package/scripts/demo.py +62 -0
  64. package/scripts/package-vscode.mjs +12 -0
  65. package/scripts/release_check.py +86 -0
  66. package/tests/conftest.py +21 -0
  67. package/tests/test_cli_and_typescript.py +123 -0
  68. package/tests/test_compiler.py +279 -0
  69. package/tests/test_validation.py +215 -0
  70. package/tools/__init__.py +2 -2
  71. package/tools/cox_cli.py +2 -123
  72. package/tools/cox_lib.py +2 -558
  73. package/tools/package_target.py +2 -214
  74. 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
- vsce package --out ../../build/vscode/cox-language-support-1.1.0.vsix
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.1.0",
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": "vsce package --out ../../build/vscode/cox-language-support-1.1.0.vsix"
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
+ }
@@ -9,4 +9,4 @@
9
9
  ],
10
10
  "description": "Insert the common COX v1.0 document header"
11
11
  }
12
- }
12
+ }
@@ -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
+ }
@@ -20,4 +20,4 @@
20
20
  ],
21
21
  "description": "Insert a COX crop metadata skeleton"
22
22
  }
23
- }
23
+ }
@@ -36,4 +36,4 @@
36
36
  ],
37
37
  "description": "Insert a COX manifest skeleton"
38
38
  }
39
- }
39
+ }
@@ -31,6 +31,7 @@
31
31
  " Components: []",
32
32
  "Interactions:",
33
33
  " Visible: []",
34
+ " UserSpecified: []",
34
35
  " Inferred: []",
35
36
  " Intended: []",
36
37
  " Recommended: []",
@@ -41,4 +42,4 @@
41
42
  ],
42
43
  "description": "Insert a COX page specification skeleton"
43
44
  }
44
- }
45
+ }
@@ -13,4 +13,4 @@
13
13
  ],
14
14
  "description": "Insert a COX protocol document skeleton"
15
15
  }
16
- }
16
+ }
@@ -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.