Skip to main content

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.

Metadata

Release files for viva-workspace 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viva-workspace 0.1.0
File Size Uploaded
viva_workspace-0.1.0.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for viva-workspace 0.1.0
File Interpreter ABI Platform
viva_workspace-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / viva_workspace-0.1.0.tar.gz

Download URL viva_workspace-0.1.0.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c4590046c59941f34c57762b94a60a4668600a7e02ebd0c571cc63857fa0d147
BLAKE2b-256 checksum
How to use checksums
101b421b457d938c05e5b9c68679ec8336dd5b6d0c8740de8718da18bcd2f6bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / viva_workspace-0.1.0-py3-none-any.whl

Download URL viva_workspace-0.1.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65a6af3509d82b099e17a29c397c88b091f562155c26a3f5e39150a0ba99c80d
BLAKE2b-256 checksum
How to use checksums
20af68a62db7cd60269e9c76e63166e5b9deb13269cdbd82840ec4888e93d615
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page