viva-workspace
The single source of truth for workspace-layout logic shared by
vivarium-workbench, viva-superpowers, and v2ecoli.
Before this package those three repos each reimplemented the same concepts —
~12 study-directory resolvers, ~6 root-walkers, and a hand-synced vendored copy
of workspace_paths.py — with three subtly conflicting semantics. This package
consolidates them into one dependency-light module so the layout is defined once.
Why dependency-light
vivarium-workbench is deliberately AI-free (all AI lives in
viva-superpowers). To be safe for the workbench to depend on, this package uses
stdlib + pyyaml only — no process_bigraph / bigraph_schema, no web
framework, no AI deps.
Public API
from viva_workspace import (
WorkspacePaths, # load workspace.yaml (mtime-memoized) + derived dirs
find_workspace_root, # the one root-walker (walk up for workspace.yaml)
study_dir, # ONE layout-map-aware study resolver (nested + flat)
canonical_outcomes, # the LOCKED canonical-run outcome selection
package_slug, # canonical viva_<slug> (with pbg_<slug> compat shim)
)
Layout map
WorkspacePaths reads an optional layout: map from workspace.yaml. A missing
key falls back to the flat default (studies -> studies/); a workspace with no
layout: block keeps the classic flat layout. To nest research dirs:
layout:
studies: workspace/studies
investigations: workspace/investigations
reports: workspace/reports
study_dir(root_or_paths, slug) honors that map for both nested
(workspace/studies/<slug>) and flat (studies/<slug>) layouts with no hardcoded
literal, searching flat-first then nested, and returning the canonical write
location for a not-yet-created study (pass must_exist=True to require existence).
Canonical outcomes
canonical_outcomes(study_spec) returns exactly ONE run's outcomes: the run
flagged canonical: true if any (last wins), else the newest completed run by
timestamp, else the last run. It is not a last-run-wins merge — an older
canonical: true run correctly overrides a newer completed one.
Package naming
package_slug(name) returns the canonical viva_<slug>. During the pbg -> viva
migration window, resolve_package_dir(root, name) returns an existing
pbg_<slug>/ directory if the canonical viva_<slug>/ is absent.
Status
Local-only. Not yet published; consumers still ship their own copies until this is released and they migrate.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file viva_workspace-0.1.0.tar.gz.
File metadata
- Download URL: viva_workspace-0.1.0.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4590046c59941f34c57762b94a60a4668600a7e02ebd0c571cc63857fa0d147
|
|
| MD5 |
9f5f5d06663c832f29dd6e5123ed32b0
|
|
| BLAKE2b-256 |
101b421b457d938c05e5b9c68679ec8336dd5b6d0c8740de8718da18bcd2f6bd
|
Provenance
The following attestation bundles were made for viva_workspace-0.1.0.tar.gz:
Publisher:
release.yml on vivarium-collective/viva-workspace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
viva_workspace-0.1.0.tar.gz -
Subject digest:
c4590046c59941f34c57762b94a60a4668600a7e02ebd0c571cc63857fa0d147 - Sigstore transparency entry: 2372321544
- Sigstore integration time:
-
Permalink:
vivarium-collective/viva-workspace@c927f36aaf7b6927930762295325c0f89b5867cd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/vivarium-collective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c927f36aaf7b6927930762295325c0f89b5867cd -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file viva_workspace-0.1.0-py3-none-any.whl.
File metadata
- Download URL: viva_workspace-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65a6af3509d82b099e17a29c397c88b091f562155c26a3f5e39150a0ba99c80d
|
|
| MD5 |
749341c33ec2bc37b05135caafc4e174
|
|
| BLAKE2b-256 |
20af68a62db7cd60269e9c76e63166e5b9deb13269cdbd82840ec4888e93d615
|
Provenance
The following attestation bundles were made for viva_workspace-0.1.0-py3-none-any.whl:
Publisher:
release.yml on vivarium-collective/viva-workspace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
viva_workspace-0.1.0-py3-none-any.whl -
Subject digest:
65a6af3509d82b099e17a29c397c88b091f562155c26a3f5e39150a0ba99c80d - Sigstore transparency entry: 2372321593
- Sigstore integration time:
-
Permalink:
vivarium-collective/viva-workspace@c927f36aaf7b6927930762295325c0f89b5867cd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/vivarium-collective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c927f36aaf7b6927930762295325c0f89b5867cd -
Trigger Event:
workflow_dispatch
-
Statement type: