Repository navigation
Conversation
recover_drafts read every draft at one commit, the parent of the newest commit that deleted drafts/, so only the last consolidation run's drafts could be read. /okfy:update merges new drafts into existing concepts, so a merge group then holds drafts of two runs: merge-audit called it unverifiable, and since 49a0c9d release-check refuses it under acceptance.dissent: required with E_REL_DISSENT_UNVERIFIABLE. The newest deletion of each draft's own path is not enough either: a draft id is not unique across runs. Re-extraction reuses ids, and two branches can each extract and delete the same id with different content when only one of their rows maps it. - One git log over drafts/ (--name-only -z, with --no-renames and --relative) maps each draft path to the commits that deleted it, newest first. Output it cannot parse fails closed as git-error. - A draft belongs to the last ledger row whose merge_map names it, the rule merge_groups applies. A row's drafts are read at the parent of the newest commit that deleted all of them. If no one commit did, each is read at the newest deletion of its own path. - An explicit --ref still overrides the lookup for every draft. - merge-audit --json adds refs, {draft id: commit it was read at}. ref is set only when every draft shares one commit and is null otherwise, so nothing reads all drafts at one wrong commit. The header lists each commit: "state: ok (refs 2b1aabc, 16da77a)". - smoke.sh: a NEG runs step. run-1 deletes its drafts in two commits, run-2 grows the group, and a merged side branch deletes an id that run-2 maps. It fails on the previous wheel (2 of 3 drafts unreadable), with the newest deletion per path (the side branch's draft is read), and without the piecemeal fallback. - USAGE-merge-audit.md and schism.md: the per-run lookup, and the blind-first read uses each draft's own entry in refs. Fixes vsov#15.
Contributor
Author
|
@vsov Please, take a look when You will have time. Thank You in advance, |
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 #15.
Problem
recover_draftsread every draft at one commit: the parent of the newest committhat deleted
drafts/. So only the last consolidation run's drafts could be read./okfy:updatemerges new drafts into existing concepts, so the merge group thenholds drafts from two runs.
merge-auditreported such groups as unverifiable.Since 49a0c9d,
release-checkalso refuses them underacceptance.dissent: requiredwith
E_REL_DISSENT_UNVERIFIABLE.Reading each draft at the newest deletion of its own path doesn't fix it: a draft id
is not unique across runs. Re-extraction reuses ids. Two branches can each extract and
delete the same id with different content when only one branch's row maps it.
Change
git logoverdrafts/(--name-only -z, plus--no-renamesand--relative) maps each draft path to the commits that deleted it, newest first.It keeps the existing
--full-history --date-order --diff-merges=first-parent.If its output can't be parsed, the lookup fails closed as
git-error.whose
merge_mapnames it, the "later row wins" rulemerge_groupsalreadyapplies. A row's drafts are read at the parent of the newest commit that deleted
all of them. That commit is the row's consolidation, or a re-extraction that
deleted the same drafts again. A draft that no commit deleted doesn't count
toward "all". If no single commit deleted them all (piecemeal deletion), each
draft is read at the newest deletion of its own path.
--refstill overrides the lookup for every draft.merge-audit --jsonaddsrefs, mapping each draft id to the commit it wasread at. I keyed it by draft rather than run id (as the issue sketched) for two
reasons: one run id can cover several rows, and the piecemeal fallback can put
drafts of one row at different commits.
refkeeps its old value when everydraft shares one commit, and is
nullotherwise. Naming one commit for all ofthem would send a reader (or the
schismpass) to the wrong drafts. The textheader lists each commit:
state: ok (refs 2b1aabc, 16da77a).USAGE-merge-audit.mddescribes the per-run lookup and the manualcommand. In
schism.md, the blind-firstgit showuses each draft's own entryin
refs. The--refhelp is updated too.No new codes or states.
recover_draftskeeps its signature._resolve_refis gone(replaced by
_commit/_deletions), in case private tests call it.Tests
scripts/smoke.shhas a newNEG runsstep on a standalone bundle:maps, with other content and no ledger row.
The step requires
merge-auditto read all three group drafts, each at its ownrun's commit, with
ref: null. It also requiresrelease-checkto reachE_REL_DISSENT_UNADJUDICATEDwithoutE_REL_DISSENT_UNVERIFIABLE. It fails:update-01/xis read from the side branch;The full
smoke.shpasses, including the reference bundle's merged and rerunchecks and
NEG embed.ruff checkpasses incore. I also checked these by hand:a merge commit that itself deletes
drafts/; draft ids with spaces and non-ASCIIcharacters; shallow clones (
unreachable-ref); a non-git bundle (git-error); anexplicit or bad
--ref.Not included: the optional hardening from the issue (recording each draft's blob id
in
input_hashes).