fraclab-sdk 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl

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.
CHANGELOG.md ADDED
@@ -0,0 +1,50 @@
1
+ # Changelog
2
+
3
+ ## 0.1.2
4
+
5
+ ### Validation System Upgrade
6
+ - **InputSpec strict validation**:
7
+ - `json_schema_extra` whitelist enforcement (unknown keys → ERROR, `x_*` prefix → WARNING for extensions)
8
+ - `show_when` canonical operators only: `equals`, `not_equals`, `gt`, `gte`, `lt`, `lte`, `in`, `not_in`
9
+ - Operator aliases (`eq`, `neq`, `nin`) emit WARNING and normalize to canonical form
10
+ - snake_case field path detection with camelCase fix suggestions (UI compatibility)
11
+ - JSON Schema path resolution with `$ref`, `allOf`, `anyOf/oneOf` handling (Pydantic v2 patterns)
12
+ - `enum_labels` must match enum values exactly (missing/extra keys → ERROR)
13
+ - Leaf fields missing `title` emit WARNING
14
+ - **OutputContract policy checks**:
15
+ - Schema structure validation per kind (`frame`, `object`, `blob`, `scalar`)
16
+ - `dimensions` cannot overlap with owner-level keys (`stageId`, `wellId`, `platformId`)
17
+ - `groupPath` depth limit warning (max 4 levels)
18
+ - Invariants validation: dataset references must exist, `sameOwner` level must match
19
+ - Relations validation: dataset/field references must exist, blob/scalar cannot have field relations
20
+ - **Algorithm signature validation**:
21
+ - `main.py` must exist with top-level `run` function
22
+ - `async def run` not supported (sandbox limitation)
23
+ - Exactly 1 positional parameter required (no `*args`, `**kwargs`, keyword-only args)
24
+ - **Export page integration**:
25
+ - Cached validation with mtime-based invalidation (avoids re-running on every rerender)
26
+ - Status badges for InputSpec, OutputContract, Algorithm
27
+ - Validation details expander with fix suggestions for snake_case issues
28
+ - Export blocked when validation errors exist
29
+
30
+ ### Other Changes
31
+ - Export page: Replace "File Status" with "Validation Status" as the primary integrity check; File Inspector in expander (expanded by default); Revalidate button inline with status badges.
32
+ - Schema/Output Edit pages: Show warnings even when validation passes; fix incorrect path passed to `validate_output_contract`.
33
+ - Single .py file import: Now creates full template structure (`schema/`, `dist/`) matching "Create New Algorithm".
34
+ - Algorithm scaffold: Now creates `dist/output_contract.json` template.
35
+ - Flatten exported algorithm zip structure (no top-level version folder in Workbench export).
36
+ - Manifest defaults: add `requires.sdk`, `repository`, `homepage`, `license` to scaffolds and bundled examples.
37
+ - Workbench Run/Results pages prompt users to use the InputSpec/OutputSpec editor Validate actions when UI or artifacts are missing.
38
+ - Workbench pages default sidebar to expanded to avoid being trapped when the Streamlit toolbar is hidden.
39
+ - Keep Streamlit toolbar visible (deploy button hidden) so the sidebar toggle is always accessible.
40
+ - Force sidebar to stay visible via CSS so navigation is always reachable.
41
+ - Hide the sidebar collapse control to keep navigation fixed open.
42
+
43
+ ## 0.1.1
44
+ - Package the Streamlit Workbench inside `fraclab_sdk` with the `fraclab-workbench` entrypoint; optional `workbench` extra pulls UI deps.
45
+ - Restore core scientific deps to the base install (numpy/pandas/scipy/matplotlib/fastapi/rich) while keeping Workbench UI deps optional.
46
+ - Add manifest defaults for `requires.sdk`, `repository`, `homepage`, `license`, and embed the SDK version constant for templating.
47
+ - Update bundled example manifests to include the new metadata fields.
48
+
49
+ ## 0.1.0
50
+ - Initial public SDK release with snapshots, algorithm library, run manager, CLI, and devkit tooling.
README.md CHANGED
@@ -890,6 +890,8 @@ $ fraclab-sdk run tail f9e8d7c6
890
890
  $ fraclab-sdk run tail f9e8d7c6 --stderr
891
891
  ```
892
892
 
893
+ > Workbench 提示:结果页面会展示本次运行的输出目录路径(含 `_logs` 日志),即使运行失败也能点开路径定位调试。
894
+
893
895
  #### 6. 运行目录结构
894
896
 
895
897
  执行完成后,`~/.fraclab/runs/<run_id>/` 目录结构:
fraclab_sdk/__init__.py CHANGED
@@ -7,6 +7,7 @@ from fraclab_sdk.results import ResultReader
7
7
  from fraclab_sdk.run import RunManager, RunMeta, RunResult, RunStatus
8
8
  from fraclab_sdk.selection.model import SelectionModel
9
9
  from fraclab_sdk.snapshot import SnapshotHandle, SnapshotLibrary, SnapshotMeta
10
+ from fraclab_sdk.version import __version__
10
11
 
11
12
  __all__ = [
12
13
  # Config
@@ -31,4 +32,6 @@ __all__ = [
31
32
  "RunStatus",
32
33
  # Results
33
34
  "ResultReader",
35
+ # Package metadata
36
+ "__version__",
34
37
  ]
@@ -9,6 +9,10 @@ This module provides tools for:
9
9
  from fraclab_sdk.devkit.compile import compile_algorithm
10
10
  from fraclab_sdk.devkit.export import export_algorithm_package
11
11
  from fraclab_sdk.devkit.validate import (
12
+ ValidationIssue,
13
+ ValidationResult,
14
+ ValidationSeverity,
15
+ validate_algorithm_signature,
12
16
  validate_bundle,
13
17
  validate_inputspec,
14
18
  validate_output_contract,
@@ -18,6 +22,10 @@ from fraclab_sdk.devkit.validate import (
18
22
  __all__ = [
19
23
  "compile_algorithm",
20
24
  "export_algorithm_package",
25
+ "ValidationSeverity",
26
+ "ValidationIssue",
27
+ "ValidationResult",
28
+ "validate_algorithm_signature",
21
29
  "validate_bundle",
22
30
  "validate_inputspec",
23
31
  "validate_output_contract",