Skip to content

[codex] add python workspace run tracking#14

Merged
ashione merged 1 commit intomainfrom
codex/python-workspace-runstore
Apr 1, 2026
Merged

[codex] add python workspace run tracking#14
ashione merged 1 commit intomainfrom
codex/python-workspace-runstore

Conversation

@ashione
Copy link
Copy Markdown
Owner

@ashione ashione commented Apr 1, 2026

What changed

This PR adds a Python-side workspace layer for tracked local runs and artifact indexing.

Key changes:

  • add python_api/velaria/workspace/ with paths, run_store, artifact_index, and types
  • extend python_api/velaria_cli.py with:
    • run start/show/status/cleanup
    • artifacts list/preview
    • tracked adapters for csv-sql, vector-search, and stream-sql-once
  • add Python binding support for DataFrame.explain() and StreamingQuery.snapshot_json()
  • add a Bazel sync target and helper script to copy the built native extension back into the source checkout
  • update regression scripts, docs, AGENTS guidance, and the user skill
  • add tests for workspace run persistence, artifact indexing, CLI contract failures, and stream progress persistence

Why it changed

The repo needed a minimal local workspace model for agent/skill invocation:

  • every execution should have a stable run_id
  • run metadata, explain, progress, logs, and artifacts should land in a local run directory
  • artifacts should be queryable through a lightweight local index
  • CLI failure paths must stay machine-readable for automation

Impact

User-facing behavior:

  • tracked runs now persist under VELARIA_HOME or ~/.velaria
  • artifacts can be listed and previewed through the CLI
  • streaming runs now persist native progress snapshots line by line
  • cleanup now skips active runs by default
  • CLI error paths return JSON instead of Python tracebacks on stdout

Implementation constraints preserved:

  • kernel checkpoint semantics are unchanged
  • SQLite is only used for metadata and small previews, not as a result engine
  • workspace persistence keeps the native explain/progress contract unchanged

Root cause

Previously the Python ecosystem layer did not provide a persistent workspace abstraction for local execution history, and the CLI only supported immediate command output. That made agent-oriented local traceability, artifact discovery, and machine-readable status inspection incomplete.

Validation

Passed:

  • uv run --project python_api python -m unittest python_api.tests.test_artifact_index
  • uv run --project python_api python -m unittest python_api.tests.test_python_cli_contract
  • uv run --project python_api python -m unittest python_api.tests.test_workspace_runs
  • uv run --project python_api python -m unittest python_api.tests.test_streaming_v05
  • ./scripts/build_py_cli_executable.sh /tmp/velaria-cli-fix-dist velaria-cli-fix
  • previously in this branch flow: core/python/experimental/stream observability regression scripts passed before the final docs-only updates

@ashione ashione marked this pull request as ready for review April 1, 2026 13:57
@ashione ashione merged commit 2684f4b into main Apr 1, 2026
3 checks passed
@ashione ashione deleted the codex/python-workspace-runstore branch April 1, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant