fix(bindings): served bindings keep owner write; failed sync fails loudly and skips reconcile - #113
Merged
Merged
Conversation
…udly and skips reconcile Two composing fixes for sideshow#108 (found in the aae-orc#154 consumer round): since the store freeze (#106), writeWithSourceMode carried the frozen source's 0444 onto served bindings, so the next sync could not overwrite its own output. Every other version flip removed all artifacts, synced zero, and exited 0; the flip after succeeded only because the previous one had deleted everything. writeWithSourceMode now keeps the owner write bit (served bindings are sideshow-owned regenerable output, not store content; the exec bit still carries), and unlocks a pre-fix read-only target in place, so machines that synced from a frozen store self-heal on the next sync. Verified live on this machine: served bindings sat at 0444, and two consecutive syncs with the fixed binary both wrote 120 artifacts and restored owner write. runSync now counts failed bindings, skips the stale reconcile when any failed (an incomplete ownership set would remove artifacts a failed binding still owns), and returns an error so use and commands sync exit nonzero. A sync that writes 0 of N no longer exits 0. Closes #108
arcaven
added a commit
that referenced
this pull request
Aug 8, 2026
…bstitution (#117) The rewrite substituted every {project-root}/_bmad/ reference with the absolute user-install path, assuming everything under the shim dir is pack content. It is not. Pack content is what the installer put in the store; everything else under _bmad/ is project state that upstream creates and writes at runtime. Blind substitution redirected that state into immutable shared storage, inside instructions an agent then follows. Controlled traversal of the synced surface (2,205 files, 173 skill dirs) found 30 distinct pack references, 14 of them absent from the store, carried by 32 files. All 14 originate as {project-root}/_bmad/... in the pack source, so the rewrite created every one. They include the config write targets already filed, and two classes not previously recorded: runtime state (the agent-builder memory/{skillName} sanctum, planning output) and the custom/ surface bmad-customize exists to write. The store is installed read-only (FreezeTree, aae-orc-dihj), so a path absent from it can never come into being there. That collapses the read-versus-write question into an existence test, with none of the write-verb, flag-name, or redirect heuristics the audit measured as unreliable. A reference is rewritten only if it exists in the store; otherwise it stays literal and the fallback footer resolves it cwd-relative, which is correct for project state. Existence cannot decide one case: {project-root}/_bmad/custom/ exists in the store but pack.yaml custom_bridge declares it repo-writable territory. That is settled by reading the declaration, so the bridge path is preserved alongside _bmad-custom/ and _bmad-output/. verify() is the post-condition, run independently of the rewrite so a reference that arrived absolute in the pack source is caught too. It is structural, so it gates: a violation fails the binding and skips stale reconcile, per the loud-failure path from #108/#113. End-to-end sync of bmad 6.10.0 into a sandboxed HOME: 119 artifacts, zero dangling references, down from 14 across 32 files, with the 16 legitimate reads still resolving to the store. Closes aae-orc-c8v8 Refs aae-orc-dihj, aae-orc-mkpo, aae-orc-3mci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #108 (P1 from the aae-orc#154 consumer round): since the store freeze (#106), served bindings inherited the frozen source's 0444 mode, so the next sync could not overwrite its own output. Every other version flip removed all 119 artifacts, synced zero, and exited 0, leaving a user with no bmad content behind one warning line.
Two composing fixes, matching the diagnosis in the issue:
Tests: frozen-source mode carry, exec-bit preservation, pre-fix target self-heal, failure-skips-reconcile with a planted prior manifest (the served artifact survives), clean path still reconciles.