Skip to content

feat: add typed experiment ledger - #32

Open
divo12 wants to merge 3 commits into
freshfrom
ao/openflywheel-6/experiment-ledger
Open

feat: add typed experiment ledger#32
divo12 wants to merge 3 commits into
freshfrom
ao/openflywheel-6/experiment-ledger

Conversation

@divo12

@divo12 divo12 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • add strict immutable experiment-attempt contracts and a record_experiment MCP tool
  • persist idempotent, bounded artifacts under .workspace/experiments/ while reusing the hardened local artifact publisher
  • require newly prepared agent programs to ledger every terminal admit/reject decision

Verification

  • uv run ruff format --check on all changed Python files
  • uv run ruff check src tests plugins/openflywheel/scripts/mcp_server.py
  • uv run mypy src tests plugins/openflywheel/scripts/mcp_server.py
  • uv run pytest --cov=ofw --cov-report=term-missing --cov-fail-under=90 -q — 187 passed, 2 skipped, 95.40% coverage
  • uvx --from radon radon cc -s -a src tests plugins/openflywheel/scripts/mcp_server.py — average A; changed ledger functions at 5 or below
  • all three skill validators and plugin validation

Scope and follow-ups

  • existing prepared workspaces keep their generated PROGRAM.md; the ledger instruction applies to newly prepared workspaces
  • listing, summaries, dashboards, and search-tree scheduling remain out of scope

Summary by cubic

Previously, terminal experiment decisions were not persisted. This adds a typed, immutable, idempotent ledger under .workspace/experiments/ and requires newly prepared agent programs to call record_experiment; existing prepared workspaces keep their generated PROGRAM.md.

Changes

  • Admitted attempts require verifier receipts, cost, and latency; rejected attempts require a reason and may omit unavailable evidence.
  • Artifacts store references and aggregate measurements only, never Langfuse trace payloads.
  • Reuses a hardened local artifact publisher for failure and experiment artifacts with bounded writes, workspace checks, and conflict detection.
  • Adds strict typed contracts and fail-closed validation for attempts and MCP input.
  • Agents stop if recording fails instead of committing an unledgered change.

Written for commit 12244ef. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 15 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/openflywheel/.codex-plugin/plugin.json">

<violation number="1" location="plugins/openflywheel/.codex-plugin/plugin.json:14">
P1: Installed plugin instances still launch an MCP commit that does not expose `record_experiment`, so this new description advertises an unavailable feature. Update `.mcp.json` to pin a release containing the ledger tool.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread plugins/openflywheel/.codex-plugin/plugin.json Outdated
Comment thread src/ofw/evaluation/experiment_ledger.py
Comment thread src/ofw/evaluation/experiment_ledger.py
Comment thread src/ofw/evaluation/experiment_ledger.py Outdated
Comment thread tests/test_experiment_ledger.py
Comment thread src/ofw/evaluation/local_workspace.py
Comment thread src/ofw/evaluation/local_workspace.py Outdated
Comment thread src/ofw/evaluation/local_workspace.py Outdated
@divo12
divo12 force-pushed the ao/openflywheel-6/experiment-ledger branch from bb96a6a to 12244ef Compare September 2, 2026 10:28
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