Skip to content

Release and install the v0.1.0 multi-harness bundle - #17

Open
kossoy wants to merge 1 commit into
mainfrom
feat/dev-workflow-1-5-release-and-install-the-v010-multi-harne
Open

kossoy wants to merge 1 commit into
mainfrom
feat/dev-workflow-1-5-release-and-install-the-v010-multi-harne

Conversation

@kossoy

@kossoy kossoy commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Refs #5

What

  • Bind a full source commit to the deterministic bundle checksum and retained upstream attribution via a release.json binding (build_multiharness_bundle.py --commit --release).
  • Add scripts/deliver.sh: the stable, approval-gated delivery entrypoint. Targets and credentials are resolved only from the approved runtime environment; no private endpoint, host path, or secret is embedded.
  • Install only the intended linked skills into the three roots pinned by a dev-workflow/install-targets-v1 document, recording the before-state; roll back by removing only the links this delivery created and confirming the prior state returns.
  • Fail closed before any mutation when a pinned target is missing.

Verification

./scripts/verify-outcome.sh (84 tests, gate green). New coverage:

  • Release binding + verification from an isolated exact-SHA materialization (tests/test_multiharness_bundle.py).
  • Fail-closed missing-target, harmless fixture install across all three roots, and rollback reconciliation, including the scripts/deliver.sh entrypoint driven end-to-end against a self-contained fixture repo (tests/test_deliver.py).

Note

Medium Risk
Delivery mutates live harness skill directories under runtime-supplied paths; safeguards (approval gate, release verification, fail-closed targets, atomic rollback) reduce but do not eliminate misconfiguration or partial-environment risk.

Overview
Adds release and delivery for the deterministic multi-harness bundle: a source commit can be bound to the portable manifest checksum and upstream attribution via release.json, and an approval-gated path can install linked skills into all three harness roots with journaling and rollback.

Release binding: build_multiharness_bundle.py accepts paired --commit and --release to emit or verify a v0.1.0 descriptor (full SHA, bundle SHA256 over the canonical manifest, upstream metadata). verify-outcome.sh now exercises write/verify and cross-checks manifests from an isolated git archive of the same SHA.

Delivery: New dev_workflow/deliver.py validates dev-workflow/install-targets-v1, requires every pinned root to exist before any write, installs via existing install_selection across codex/claude/opencode with all-or-nothing rollback on failure, and records delivery-state.json (before snapshot, delivered skills, optional release). scripts/deliver.sh gates on DEV_WORKFLOW_DELIVER_APPROVED=1, materializes the exact SHA twice to build and independently verify the bundle, then calls deliver_selection.py; --rollback uninstalls only this delivery’s links and asserts the prior skill listing is restored.

README documents the release and env-driven delivery contract. Tests cover release binding edge cases and delivery fail-closed, partial-failure rollback, and end-to-end deliver.sh against a fixture repo.

Reviewed by Cursor Bugbot for commit abe6506. Bugbot is set up for automated code reviews on this repo. Configure here.

Greptile Summary

This change adds release-bound, approval-gated delivery and rollback for Codex, Claude, and OpenCode. Focused delivery exercises found three recoverability failures: a journal write error leaves installed links without a usable rollback record, a rollback that fails partway cannot be retried to completion, and a valid historical source revision cannot be delivered because its bundle builder does not accept the new release arguments.

The originally anticipated current-checkout verification mismatch for historical revisions was disproved: the historical delivery run exits earlier, when the materialized historical builder rejects --commit and --release.

Confidence Score: 2/5

Do not merge until failed delivery and rollback can reliably restore all harness roots, and historical revision handling has a defined compatible behavior.

Three independent delivery reliability failures were reproduced with isolated filesystem and Git-backed executions, including successful control runs where applicable.

Files Needing Attention: dev_workflow/deliver.py needs atomic or recoverable journal handling and resumable rollback behavior; scripts/deliver.sh needs an explicit compatibility boundary or compatible builder strategy for DEV_WORKFLOW_SOURCE_SHA.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex posted a P1 finding proof and provided an executable reproduction for normal and failed journal delivery, plus control and failure outputs to validate rollback behavior.
  • T-Rex supplied an executable rollback retry reproduction and its accompanying output to demonstrate the retry path.
  • T-Rex delivered a Git-based reproduction for current and historical source SHA delivery, along with focused output and a historical failure log for validation.
  • T-Rex documented a general-contract-validation scenario for journal failure rollback, including exact failure output and reproducible scripts.
  • T-Rex documented a source-SHA repro suite showing current and historical deliveries, including before-and-after control captures.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (3)

  1. General comment

    P1 Journal write failure leaves delivered links without a recoverable rollback receipt

    • Bug
      • After install_selection completes for every harness, an OSError from journal directory creation or state_path.write_text propagates without uninstalling the delivered links. Since no regular delivery-state.json exists, rollback_selection raises before it knows the targets or before-state. The focused reproduction observed retained grill-me and grilling links in codex, claude, and opencode after the failed rollback.
    • Cause
      • The all-or-nothing cleanup handler covers only lines 91-101 (harness installation). Journal creation/writing at lines 112-115 is outside that handler, while rollback requires the journal at lines 122-124.
    • Fix
      • Wrap journal persistence in cleanup that uninstalls the completed delivery on failure (and validates restoration), or durably create an adequate rollback receipt before mutating harness roots; ensure persistence failure cannot return with unreconciled links.

    T-Rex Ran code and verified through T-Rex

  2. General comment

    P1 Rollback retry cannot progress after a later harness uninstall fails

    • Bug
      • With registry order codex, claude, opencode, a modified claude owned file causes the first rollback to remove codex then fail at claude. The delivery journal remains, but the next rollback starts at codex again and raises FileNotFoundError because its receipt was removed. opencode remains installed and is never attempted.
    • Cause
      • rollback_selection unconditionally calls uninstall_selection for every harness in registry order at lines 137-138. It neither records completed root removals in the delivery state nor treats a previously completed uninstall as an idempotent rollback step.
    • Fix
      • Make rollback progress durable and retryable: persist per-harness completion before proceeding (or otherwise reconcile an absent receipt only when its before-state is restored), skip completed harnesses on retry, and retain the journal until every harness is reconciled.

    T-Rex Ran code and verified through T-Rex

  3. General comment

    P1 Historical DEV_WORKFLOW_SOURCE_SHA values cannot be delivered after the release-contract change

    • Bug
      • The materializable parent revision 39ebcb803d8faac6a5df7340f7a65b9dd07e7cce contains scripts/build_multiharness_bundle.py, but its CLI accepts only --output or --verify. The current entrypoint archives that revision and invokes its builder with --commit and --release, producing exit 2. Exact output: build_multiharness_bundle.py: error: unrecognized arguments: --commit 39ebcb803d8faac6a5df7340f7a65b9dd07e7cce --release /tmp/.../release.json. Thus approved delivery fails for this valid historical source SHA.
    • Cause
      • scripts/deliver.sh materializes and executes the selected revision's builder at lines 67-68, while unconditionally requiring the release-aware CLI introduced only in the PR commit. The proposed lines 77-82 current-checkout verification mismatch is not reached.
    • Fix
      • Either restrict DEV_WORKFLOW_SOURCE_SHA to commits that contain the release-aware builder contract and fail with an explicit compatibility message, or build/verify release metadata with a stable current versioned tool that can support historical bundle formats. Document the supported source-SHA compatibility boundary.

    T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
### Issue 1
dev_workflow/deliver.py:112-115
**Journal persistence strands installations**

If persisting `delivery-state.json` fails after all harness installs complete, the error escapes without removing the installed links. A subsequent rollback requires that journal and rejects its absence before it can identify or reconcile the target roots. This leaves the delivered links installed in every harness while the command reports failure. Either write a durable rollback record before mutating roots, or clean up the completed installs if journal persistence fails.

### Issue 2
dev_workflow/deliver.py:137-138
**Rollback retries cannot progress after a partial failure**

Rollback uninstalls harnesses in order but does not record completed removals. If a later uninstall fails, an earlier harness has already had its receipt removed. Retrying starts again at that harness, raises because its receipt is missing, and never reaches the harnesses still installed. Persist rollback progress or make completed uninstalls safely idempotent so a retry can reconcile every root.

### Issue 3
scripts/deliver.sh:67-68
**Historical source revisions cannot satisfy the builder contract**

`DEV_WORKFLOW_SOURCE_SHA` materializes and executes the selected revision's bundle builder, but the entrypoint always passes the new `--commit` and `--release` arguments. A valid materializable revision from before this release contract rejects those arguments and exits before delivery. Restrict the variable to revisions supporting this builder interface with a clear compatibility error, or use a stable builder that can produce and verify the selected revision's bundle format.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat: release and approval-gated multi-h..." | Re-trigger Greptile

Greptile also left 3 inline comments on this PR.

Bind a full source commit to the deterministic bundle checksum and retained
upstream attribution via release.json, and add scripts/deliver.sh as the
stable approval-gated delivery entrypoint. Delivery resolves the three
harness roots from a runtime-supplied install-targets-v1 document, verifies
the release checksum from an isolated exact-SHA materialization, installs only
the linked skills while recording the before-state, and fails closed on a
missing target. Rollback removes only the links delivery created and confirms
the prior state is restored.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit abe6506. Configure here.

Comment thread dev_workflow/deliver.py
state_dir.mkdir(parents=True, exist_ok=True)
state_path.write_text(
json.dumps(journal, indent=2, sort_keys=True) + "\n", encoding="utf-8"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Journal written after live installs

High Severity

deliver_selection installs into every pinned root before it creates state_dir or writes delivery-state.json. A crash, interrupt, or write error after those installs leaves the skills in place with no journal, so --rollback cannot run and a retry collides with leftover receipts.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit abe6506. Configure here.

Comment thread dev_workflow/deliver.py
if current != list(before[harness]):
raise ValueError(f"rollback did not restore the prior state for {harness!r}")

state_path.unlink()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Rollback cannot resume after failure

High Severity

rollback_selection fully uninstalls each harness before reconciling the before-state, and the install exception path uninstalls completed roots the same way. After a later failure, earlier receipts are already gone while the journal remains, so a retry cannot resume and some roots can stay installed.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit abe6506. Configure here.

Comment thread dev_workflow/deliver.py
Comment on lines +112 to +115
state_dir.mkdir(parents=True, exist_ok=True)
state_path.write_text(
json.dumps(journal, indent=2, sort_keys=True) + "\n", encoding="utf-8"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Journal persistence strands installations

If persisting delivery-state.json fails after all harness installs complete, the error escapes without removing the installed links. A subsequent rollback requires that journal and rejects its absence before it can identify or reconcile the target roots. This leaves the delivered links installed in every harness while the command reports failure. Either write a durable rollback record before mutating roots, or clean up the completed installs if journal persistence fails.

Artifacts

Executable reproduction for normal and failed journal delivery

  • Builds temporary targets, runs a normal delivery/rollback control, then forces only the delivery journal write to fail before attempting rollback; it demonstrates the failed journal strands links.

Control output showing normal journal-backed rollback succeeds

  • Runs the executable reproduction in normal mode; it shows the journal is created and rollback removes the installed links from all three harnesses.

Failure output showing missing journal blocks rollback

  • Runs the executable reproduction with a forced journal write error; it shows rollback rejects the missing journal and all installed links remain.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: dev_workflow/deliver.py
Line: 112-115

Comment:
**Journal persistence strands installations**

If persisting `delivery-state.json` fails after all harness installs complete, the error escapes without removing the installed links. A subsequent rollback requires that journal and rejects its absence before it can identify or reconcile the target roots. This leaves the delivered links installed in every harness while the command reports failure. Either write a durable rollback record before mutating roots, or clean up the completed installs if journal persistence fails.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread dev_workflow/deliver.py
Comment on lines +137 to +138
for harness in HARNESS_REGISTRY:
removed[harness] = list(uninstall_selection(resolved[harness], harness))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Rollback retries cannot progress after a partial failure

Rollback uninstalls harnesses in order but does not record completed removals. If a later uninstall fails, an earlier harness has already had its receipt removed. Retrying starts again at that harness, raises because its receipt is missing, and never reaches the harnesses still installed. Persist rollback progress or make completed uninstalls safely idempotent so a retry can reconcile every root.

Artifacts

Executable rollback retry reproduction source

  • This self-contained Python script delivers to all harness roots, forces a later Claude uninstall validation failure, retries rollback, and asserts the resulting partial state.

Rollback retry reproduction output

  • This captured command output shows the first rollback removes Codex before failing at Claude, while the retry fails on Codex's missing receipt and leaves OpenCode installed.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: dev_workflow/deliver.py
Line: 137-138

Comment:
**Rollback retries cannot progress after a partial failure**

Rollback uninstalls harnesses in order but does not record completed removals. If a later uninstall fails, an earlier harness has already had its receipt removed. Retrying starts again at that harness, raises because its receipt is missing, and never reaches the harnesses still installed. Persist rollback progress or make completed uninstalls safely idempotent so a retry can reconcile every root.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread scripts/deliver.sh
Comment on lines +67 to +68
python3 "$work/scripts/build_multiharness_bundle.py" \
--output "$bundle" --commit "$sha" --release "$release" >/dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Historical source revisions cannot satisfy the builder contract

DEV_WORKFLOW_SOURCE_SHA materializes and executes the selected revision's bundle builder, but the entrypoint always passes the new --commit and --release arguments. A valid materializable revision from before this release contract rejects those arguments and exits before delivery. Restrict the variable to revisions supporting this builder interface with a clear compatibility error, or use a stable builder that can produce and verify the selected revision's bundle format.

Artifacts

Executable Git-based reproduction for current and historical source SHA delivery

  • The executed shell repro creates isolated targets, invokes the delivery entrypoint for HEAD and a materializable parent, and asserts the historical failure happens before lines 77-82; the takeaway is that the proposed verification-stage mismatch is not reached.

Output of the focused current-versus-historical source SHA reproduction

  • This captured command output shows the current source delivering successfully and the historical source rejecting release arguments with exit 2; the takeaway is that the actual failure is in the historical builder invocation.

Historical source SHA delivery failure

  • This captured historical delivery run exits 2 because its materialized bundle builder does not recognize `--commit` and `--release`; the takeaway is that no bundle is built and lines 77-82 do not execute.

Current source SHA delivery control

  • This captured control run exits 0 after delivering grilling and grill-me to codex, claude, and opencode; the takeaway is that the current release-aware source contract works.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/deliver.sh
Line: 67-68

Comment:
**Historical source revisions cannot satisfy the builder contract**

`DEV_WORKFLOW_SOURCE_SHA` materializes and executes the selected revision's bundle builder, but the entrypoint always passes the new `--commit` and `--release` arguments. A valid materializable revision from before this release contract rejects those arguments and exits before delivery. Restrict the variable to revisions supporting this builder interface with a clear compatibility error, or use a stable builder that can produce and verify the selected revision's bundle format.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@kossoy

kossoy commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Hand-over note, 2026-11-17. The Maestro daemon is switched off for good; session dev-workflow-1, which opened this PR on 2026-09-02, will not continue it and nothing automated will act here again. State: head abe6506, mergeable, 5 unresolved review threads (2 High from cursor, 3 P1 from greptile) on the deliver/rollback journal logic in dev_workflow/deliver.py and scripts/deliver.sh. Issue #5 stays open. The branch also exists on Forgejo; no local worktree remains. Owner decision needed: fix the five findings and merge, or close.

@kossoy

kossoy commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Parked 2026-11-21: already up to date with main, checks green; resumes when the project is reactivated.

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