Skip to content

merge_audit: read the deleted drafts of an embedded bundle - #14

Closed
vbanas wants to merge 2 commits into
vsov:mainfrom
vbanas:fix-embedded-draft-recovery
Closed

vbanas wants to merge 2 commits into
vsov:mainfrom
vbanas:fix-embedded-draft-recovery

Conversation

@vbanas

@vbanas vbanas commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

recover_drafts read each draft with git show <sha>:<draft>.md from the bundle root. In <rev>:<path> git reads from the repository root, so in an --embed bundle (a subdirectory of the corpus repository) every read failed and recover_drafts returned ('git', {}). merge-audit used the mapping and called every group unverifiable; release-check checked only the state, so under acceptance.dissent: required (the --embed default) its recoverability check passed without reading a single draft.

  • recover_drafts reads <sha>:./<draft>.md, relative to the bundle root, the form update.py already uses for corpus reads.
  • release-check keeps the mapping and reports E_REL_DISSENT_UNVERIFIABLE when any draft of a merge group is missing from it, as merge-audit already does. No new codes.
  • schism.md: the blind-first git show uses the same ./ form.
  • smoke.sh: an installed-artifact negative on a bundle made with okfy init --embed. merge-audit must read both drafts, and release-check must refuse a merge_map draft that no commit holds. The first assertion fails on the previous wheel, the second with only the path fix applied.

The other sites the issue names do not reach a bundle-relative path in an embedded bundle today. validate.ledger_prefix_check runs git only when the bundle root holds .git, so an embedded bundle gets W_LEDGER_UNVERIFIABLE (documented: no repository of its own). memory.events_at_head is called only after that check reports rewritten, which needs .git at the bundle root, where the bare HEAD:<path> form is correct.

Fixes #11, #13.

recover_drafts read each draft with `git show <sha>:<draft>.md` from
the bundle root. In `<rev>:<path>` git reads <path> from the repository
root, so in an --embed bundle (a subdirectory of the corpus repository)
every read failed and recover_drafts returned ('git', {}). merge-audit
used the mapping and called every group unverifiable; release-check
checked only the state, so under acceptance.dissent: required (the
--embed default) its recoverability check passed without reading a
single draft.

- recover_drafts reads `<sha>:./<draft>.md`, relative to the bundle
  root, the form update.py already uses for corpus reads.
- release-check keeps the mapping and reports
  E_REL_DISSENT_UNVERIFIABLE when any draft of a merge group is
  missing from it, as merge-audit already does. No new codes.
- schism.md: the blind-first `git show` uses the same `./` form.
- smoke.sh: an installed-artifact negative on a bundle made with
  `okfy init --embed`. merge-audit must read both drafts, and
  release-check must refuse a merge_map draft that no commit holds.
  The first assertion fails on the previous wheel, the second with
  only the path fix applied.

The other sites the issue names do not reach a bundle-relative path in
an embedded bundle today. validate.ledger_prefix_check runs git only
when the bundle root holds .git, so an embedded bundle gets
W_LEDGER_UNVERIFIABLE (documented: no repository of its own).
memory.events_at_head is called only after that check reports
rewritten, which needs .git at the bundle root, where the bare
`HEAD:<path>` form is correct.

Fixes vsov#11.
vsov#13 reports the same two defects as vsov#11, plus a third way to
reach the gate gap: a draft committed with frontmatter that does not
parse. recover_drafts leaves it out of the mapping, merge-audit calls
its group unverifiable, and release-check passed it. The previous
commit already fails it closed (the gate counts every draft missing
from the mapping, whatever the reason), but only a draft that no
commit held was tested.

- The NEG embed step commits a third draft, gamma-bad, whose title
  does not parse, and proves it is in the commit before the deletion.
- The unparsed draft and the never-committed one are each checked on
  their own copy of the corpus, because the ledger only grows: once
  one is in the merge map, the other could not turn the gate red by
  itself. Each refusal must name its draft.
- Both assertions fail with only the path fix applied; the step fails
  earlier, at merge-audit, on the previous wheel.

Fixes vsov#13.
vsov pushed a commit that referenced this pull request Nov 4, 2026
- merge_audit: the drafts-deletion lookup walks every merged line
  (--full-history --date-order), and lists a merge commit that itself
  deletes drafts/ (--diff-merges=first-parent --no-patch). Before, a
  merge commit could hide the deletion (unreachable-ref) or make the
  audit read the previous run's drafts.
- merge_audit: drafts are read as <commit>:./<draft>.md, so a bundle
  made with `okfy init --embed` reads them.
- release-check: under acceptance.dissent: required, any merge-group
  draft that cannot be read or parsed fails with
  E_REL_DISSENT_UNVERIFIABLE, naming the draft.
- smoke.sh: NEG embed; reference-bundle.sh: two merged-history checks.
- Retrieval and federation code digests unchanged.

Contributed by @vbanas in #12 and #14, with one
neighbouring case (a merge that deletes drafts/) added here.

Co-authored-by: vbanas <val.banas@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vsov

vsov commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Thanks @vbanas — integrated into 49a0c9d with your authorship, together with #12. Closing rather than merging because the public repo is an export.

One note: the private unit suite had a stale-adjudication test whose fixture added a merge-map draft no commit ever held. Your gate change correctly refused it as unverifiable before the staleness check ran. We fixed the fixture, not the gate. Your reachability claim for validate.ledger_prefix_check / memory.events_at_head in embedded bundles checked out (both are gated on <bundle>/.git).

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.

In an embedded bundle, recover_drafts reports git while reading no draft, so release-check's dissent recoverability check passes vacuously

2 participants