Skip to content

fix: terminal-only deletion and visibility-only Experiment restoration - #1641

Open
Cedric Vidal (cedricvidal) wants to merge 442 commits into
integration/taxonomyfrom
cedricvidal-experiment-deletion-and-restore
Open

Cedric Vidal (cedricvidal) wants to merge 442 commits into
integration/taxonomyfrom
cedricvidal-experiment-deletion-and-restore

Conversation

@cedricvidal

@cedricvidal Cedric Vidal (cedricvidal) commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Stacked directly on #1031 (cedricvidal-microsoft/gepa-scope-adapter, verified at 1a9891cc3dd220e999dd8c56ecf61cf6519305e9). Intended dependency order: #1031 → this fix → #1640. This branch does not depend on #1640-only types or hydrated response helpers. Retargeting #1640 and native stack insertion are intentionally left to the coordinator.

  • Reject nonterminal single/bulk run deletion and Experiment cascades with explicit 409 identities before known-conflict membership changes. Check exact member attempts, handler/report work, publication and freeze intents; allow terminal success/failure/finished outcomes and empty Experiments without work. Guard final writes against retry, work claims, report insert/release ABA races, and delayed cascade repairs.
  • Restore only operation-owned children and visibility. Preserve statuses/outcomes, exact attempts, artifacts, reports and history; never cancel, restart, resume, or roll an execution during restoration. Unexpected vector drift is an explicit blocker. Successful restoration atomically removes the lifecycle object, tombstone and execution freeze; active/no-conflicting-intent restoration is a no-op.
  • Return the normal Experiment resource on completed/no-op restore (200), progress only while pending (202), with bounded cascade writes. Handle concurrent completion in Portal/CLI and the lifecycle endpoint. Keep deleting/deleted/restoring as display-only overrides; align Portal labels/filter counts/sorting and preserve canonical machine-readable readiness.

The narrow report-publication version/IDs, trigger-completion acknowledgement and child operation-id fences are operation bookkeeping, not a generic locking/cancellation framework or new processing states. No new collection, index, migration, compatibility layer, runtime prompt, or paid model work.

Demos

Before

Not recorded in this dedicated worktree. The previous behavior retained a completed restored lifecycle badge, hid Delete, and returned only operation progress.

After

Live terminal-only deletion and visibility-only restoration walkthrough on the integrated #1640 stack. The recording uses the retained corrected nine-run calendar Experiment after all coding, taxonomy, report publication, and readout work settled. Two reversible cycles preserved the exact execution, attempt, revision, report, request/run outcomes, taxonomy artifact hashes, and typed readout URLs, and left the Experiment active and visible.

pr1641-deletion-restore-walkthrough.mp4

Testing

399 focused tests passed (365 backend/shared/scheduler/CLI + 34 Portal). Coverage includes terminal/nonterminal outcomes, aggregate failure with active children, mixed bulk preflight, report publication/retry contention, delayed delete repair, exact provenance, visibility-only round trips, vector drift without rollover, concurrent completion, 200/202 responses, no-wait clients, display-only filters/counts/sorting, and returning Delete.

Passed — 15 files, 365 tests:

pnpm exec vitest run apps/api/src/experiment-lifecycle.test.ts apps/api/src/routes/experiments.test.ts apps/api/src/endpoints.test.ts apps/api/src/experiment-coordinator.test.ts apps/api/src/experiment-membership.test.ts apps/api/src/openapi/openapi.test.ts apps/scheduler/src/handler-dispatcher.test.ts packages/shared/src/experiments packages/shared/src/schemas/run-state.test.ts apps/cli/src/commands/experiment.test.ts apps/cli/src/cli-commands.test.ts --reporter=dot

Passed — 5 files, 34 tests:

NODE_OPTIONS=--no-experimental-webstorage pnpm exec vitest run apps/portal/src/lib/experiments.test.ts apps/portal/src/pages/ExperimentDetail.test.tsx apps/portal/src/pages/ExperimentDetail.play.test.tsx apps/portal/src/pages/ExperimentsList.test.tsx apps/portal/src/pages/ExperimentsList.play.test.tsx --reporter=dot

The environment uses Node 25.8.1; the invocation-only webstorage flag avoids its native localStorage collision with happy-dom. No repository tooling or timeouts were changed to work around that environment issue.

Each command below passed:

pnpm --filter shared build
pnpm --filter api build
pnpm --filter scheduler build
pnpm --filter cli build
pnpm --filter portal exec tsc -b
pnpm --filter portal build
pnpm --filter portal build-storybook
pnpm --filter api generate:openapi
pnpm exec vitest run apps/api/src/openapi/openapi.test.ts apps/api/src/routes/experiments.test.ts --reporter=dot
git diff --check

The final OpenAPI recheck passed 48 tests. Production Portal and Storybook builds emitted bundle-size warnings; no build failures. Integrated live runtime verification used the existing Compose project and retained corrected Experiment f2998d7f-2b14-4f08-8f29-d10dd865caf2: all nine exact runs were terminal/succeeded, all taxonomy artifacts and publication acknowledgements were settled, and two supported Portal delete/restore cycles each returned the same execution f5bb9d39-647f-48c9-ac83-a7f613bfc28f, attempt 2, revision, report, exact run outcomes, taxonomy SHA values, and typed readout URLs.

Documentation and compatibility

Updated Experiment architecture, Experiment user/CLI guidance, and the generated OpenAPI snapshot.

Intentional undeployed contract change: completed/already-active restore now returns 200 with the normal resource, pending restore returns 202 progress, and completed restoration has no persisted restored phase. Lifecycle polling can return the normal active resource after completion. Single/bulk run and Experiment deletion now reject unfinished work. Portal and CLI are adapted in this PR. No migration or backwards-compatibility layer is needed; dependency manifests and lockfiles are unchanged.

Checklist

  • If Portal features changed, keep CLI capabilities in sync.
  • If Portal components changed, update their Storybook stories.
  • If database changes require a migration, include up() / down() and keep it CosmosDB-compatible.
  • If dependencies changed, update the lockfile and regenerate NOTICE / NOTICE-REVIEW.txt with pnpm notice as needed.
  • Video showing the behavior before the suggested change
  • Video showing the behavior after the suggested change

Migration and dependency-notice items are N/A (undeployed stack, no index/collection/dependency changes). The live integration walkthrough and reversible preservation evidence are now attached; this PR intentionally remains a draft.

Locally inherit the exact validated taxonomy guidance parent without publishing or changing PR metadata.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d0c36bff-9146-4622-aaf0-858de5876813
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 92d03055-789e-48b7-9a44-6de5b357f486
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4b4a63b3-29db-4d12-888f-051592682640
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3d995fd8-10c6-477c-b1d4-27ba9b2d762a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a1387f4c-83dd-48cb-9e8c-07398fefd60e
Prepare the Experiment lifecycle branch locally with the validated guidance-only #1516 parent while preserving lifecycle instructions and the live Icons residual.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9dab2dcc-d695-4b4f-9858-0ec01f2b7b56
Integrate exact prepared 1517 parent 6ae17ce without rewriting history. Preserve Experiment/readout static prompt families alongside the standalone Taxonome SDK family.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Record the exact history-preserving merge of prepared 1517 parent 6ae17ce, additive static-prompt conflict resolutions, parent-relative diff contract, zero model calls, and current source/config hashes without replacing frozen experiment fingerprints.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9ed7b459-4ebc-4313-892c-fc5f23d5bf70
Reuse Node styleText and Commander help styling from the Scope CLI. Keep stdout machine-readable, color only interactive diagnostics/help/progress, honor NO_COLOR/FORCE_COLOR/CI, and make pnpm --silent taxonome the documented demo command.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Record the dependency-free styleText/Commander color policy, pnpm --silent taxonome invocation, TTY/NO_COLOR/FORCE_COLOR/CI behavior, offline validation, zero model calls, and unchanged frozen evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9ed7b459-4ebc-4313-892c-fc5f23d5bf70
Retain both histories without changing the existing tree so shared guidance is no longer repeated in the Portal Copilot PR diff.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 247f20c6-3a7e-4bba-87b6-1d59045656da
Add explicit deterministic-handler plugins, scope ATIF normalization, dynamic schemas, v2 optimization/readout contracts, and a runnable custom handler project while preserving frozen spike evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Record the implementation commit/tree, versioned contracts, zero-call validation matrix, current source hashes, and unchanged frozen 256-call evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9ed7b459-4ebc-4313-892c-fc5f23d5bf70
Build the example plugin into a unique test-owned project-local directory, use it for process tests, and clean it afterward without touching pre-existing demo output.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Use TypeScript transpileModule to emit the trusted process-test plugin into a unique project-local directory, so clean unit jobs need neither example dist nor taxonomy-evaluation declarations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ed7b459-4ebc-4313-892c-fc5f23d5bf70
Declare the deterministic handler output schema/type, preserve unattributed retry evidence as indeterminate, and add a disjoint custom prompt corpus with direct Taxonome run/eval/optimize examples.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Record the real custom prompt run, held-out baseline, bounded Ax artifact, artifact replay, full built-in taxonomy run, deterministic readout, and exact 11-call ledger delta separately from the frozen 256-call snapshot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Append the separate 11-call YAML prompt demo accounting and evidence lineage while keeping the original 256-call snapshot and historical artifacts unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ed7b459-4ebc-4313-892c-fc5f23d5bf70
Add a separately versioned opaque-identity corpus, verify the exact production prompt projection excludes case metadata and outcome-coded IDs, and mark the first 11-call demo as historical ID-confounded evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Record the opaque-identity run, held-out baseline, bounded artifact, replay, built-in taxonomy run, deterministic readout, and exact 11-call delta without modifying either earlier evidence packet.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Append the separately versioned opaque-ID control, cumulative 278/500 accounting, zero instruction-proposal outcome, and explicit correction of the first demo's identity confound.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ed7b459-4ebc-4313-892c-fc5f23d5bf70
Use subject-and-role paths for current trajectories, expected judgments, original-prompt results, optimized artifacts, and optimized-prompt results; expose an offline handler unit-test command distinct from model-backed eval.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Explain that eval scores detector output against gold, counts case executions, makes fresh calls only when model execution is reached, and never caches answers through artifact restore.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Move the built-in Timeout implementation and tests under src/handlers/timeout while preserving scope/timeout-v1 behavior and root package exports.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4f3fac40-e7d2-469e-adc2-ef1648ba9310
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
@github-actions github-actions Bot added the area: infrastructure Cloud resources, hosting, networking, and shared infrastructure. label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #729

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
4270 4262 0 8 0 0 0 2m55s

🎉 All tests passed!

Github Test Reporter

Validate the exact sampled identity and bounded excerpt, not whether the prose is a literal substring. Keep correction of invalid references within the existing three attempts.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #737

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
4279 4271 0 8 0 0 0 2m50s

🎉 All tests passed!

Github Test Reporter

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e767814e-3331-4a7e-ae96-15207b53ac9c
@cedricvidal
Cedric Vidal (cedricvidal) changed the base branch from cedricvidal-microsoft/gepa-scope-adapter to integration/taxonomy December 3, 2026 22:16
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #772

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
4281 4273 0 8 0 0 0 2m57s

🎉 All tests passed!

Github Test Reporter

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: api Scope REST API, run orchestration, SSE streaming, and endpoints. area: cli Scope command-line interface and terminal workflows. area: infrastructure Cloud resources, hosting, networking, and shared infrastructure. area: portal Scope web portal, pages, and user-facing components. area: scheduler language: javascript Work involving JavaScript code, tooling, or dependencies. topic: reliability Availability, fault tolerance, recovery, and consistent operation. topic: testing Test coverage, test infrastructure, and validation quality. topic: ui Portal, visual presentation, layout, and interface components. type: bug Incorrect behavior or a regression that needs fixing. type: documentation Documentation additions, corrections, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant