Skip to content

Phase 1: ADR 0111, upstream re-pull - #1915

Merged
neuromechanist merged 27 commits into
feature/issue-1046-epic-upstream-freshnessfrom
feature/issue-1907-phase1-adr-0111
Oct 24, 2026
Merged

neuromechanist merged 27 commits into
feature/issue-1046-epic-upstream-freshnessfrom
feature/issue-1907-phase1-adr-0111

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Adds ADR 0111 (an upstream re-pull is a reviewed delta on a release branch), its index entry, and append-only amendments to ADRs 0006, 0060, 0089, 0091 and 0093. The ADR fixes the mechanism for epic #1046: N.0.0 is a pure mirror with upstream winning conflicts, corrections replay as N.0.1, state lives in upstream_repulls, the upstream tag lives on dataset_versions, discovery stays id-only, and the Worker may merge only a machine-clean re-pull PR (narrowing ADR 0093 for that class).

Closes #1907

Part of epic #1046

Test plan

  • bun test test/adr-index.unit.test.ts (8 pass)
  • bun run lint and bun run typecheck
  • amendments are additions only (git diff --numstat)

Record the re-pull decisions of epic #1046 (Phase 1, #1907): a
reviewed delta on release/vN.0.0, N.0.0 a pure mirror with
corrections replayed as N.0.1, upstream_repulls state, the tag on
dataset_versions, default-off switches and daily caps, and the one
PR class the Worker may merge, narrowing ADR 0093.

Index entry added. Tested: bun test test/adr-index.unit.test.ts
(8 pass, 0 fail).
Append dated 2026-10-23 amendments pointing at ADR 0111: 0006
(major is the mirror, N.0.1 replays corrections), 0093 (narrowed
for re-pull PRs only), 0089 (delta-path scrub, no forward-fix
hold), 0091 (new and changed recordings only), 0060 (policy
re-applied as a function). Existing text unchanged.

Tested: ADR index test 8 pass, lint and typecheck clean.
A correction is an unexplained path, so the machine-clean rule already
excludes N.0.1; say so. Docs only, index test not affected.
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR1915

Version: 0.10.24-PR1915.cb2e873
Commit: cb2e873


🤖 Updated on each push.

Define unexplained path once (conflicts and corrections are its two
kinds), separate delta paths from upstream-changed paths, add the
delete-versus-modify and both-added cases, and use "zero unexplained
paths" everywhere. Docs only.
A change recorded in the ADR 0085 privacy ledger is carried by N.0.0,
and a plan that would revert one refuses; the window consequence now
holds only for ledger-recorded and deterministic-rule corrections.
Docs only.
N.0.1 targets main, merges only after N.0.0 is merged and tagged,
and is synthesized again on the new main because both squash-merge.
upstream_repulls records both pull requests on one row, the open
release PR refusal ignores the own N.0.1, and --abandon is refused
after the merge. Docs only.
The scrub, annex policy and date normalization run on delta paths
before the copy as well as before the commit, since a copied object
is anonymously readable by key (ADR 0089). ADR 0111, the 0089 and
0060 amendments and the index say so. Docs only.
The Worker merges only a re-pull PR the automatic path opened
(origin automatic on its row), never one an administrator opened,
and machine clean adds an ADR 0107 review that is not declined.
Not yet verified says what stays open about 0107. Docs only.
Quote only ADR 0093's approval sentences, which stand; say that ADR
0107 already partially supersedes 0093 and that 0111 narrows only the
merge for automatic re-pull PRs. The 0093 amendment adds the screen
requirement for an administrator's re-pull merge and the AGENTS.md
follow-up. Docs only.
The upstream-moved guard applies only when origin/main records a tag
and a version has been released; an unreleased import is retried at
the discovered tag, and an unrecorded tag never trips it. Unknown is
stored as source_version NULL, so "set" means a known tag. Docs only.
ADR 0086 exempts xx from the identifier screen, so an xx re-pull is
never machine clean and is merged by an administrator; the Worker's
merge therefore has no staging rehearsal. Docs only.
The import route is POST /admin/datasets/import (403 outside
production, then 409); discovery parses latestTag and nothing reads
it; drop the ADR 0016 citation; the reconcile and stamp re-arm are
new behavior, not an existing callback; .log.rmet versionIds and the
tag on merge join Not yet verified. Docs only.
Each 2026-10-23 amendment and ADR 0111 itself now says the behavior
is designed in ADR 0111 and not yet built, in future tense, so a
reader of one ADR alone does not take it as live. The ADR 0091
amendment uses the agreed wording. Docs only.
Edit the lines that contradicted ADR 0111: the starting-point refusal
becomes a classification, the three-way rules, the 2.0.1 stack, the
machine definition of clean, the scrub order, state columns, the
#993 guard, NULL for unknown, xx, and the stated facts. The note that
the ADR wins stays. Docs only.
Add the 0111 entry to the load-bearing ADR list, after 0109 (the
last entry, which follows 0099 in this checkout); 0109's closing
period becomes a comma. Nothing else in AGENTS.md changes. Docs only.
Move the sentence that holds the Worker's merge call until the ruleset check back under the machine-clean rule, where the xx paragraph had displaced it. Docs only.
State N.0.1's timing once: its pull request opens at patch_synthesized
on the new main after N.0.0 is merged and tagged, and the patch_*
columns stay NULL until then. The open-release-PR clause, the one-row
rationale, the index and the design record follow. Docs only.
--abandon before N.0.0 merges ends the row abandoned; after it, it
closes only N.0.1's pull request and ends the row patch_declined, a
new terminal state, and a pull request found closed unmerged does the
same. The open item about it is removed. Docs only.
Machine clean now needs a stored ADR 0107 review of the head whose
verdict is pass; any other verdict, or none, is not clean, since
unknown is never clean (ADRs 0053, 0054). The 0093 amendment, index
and design record follow; only the can-a-re-pull-pass question stays
open. Docs only.
A ledger line whose action is not import-scrubbed (name checked in
src/lib/import-scrub.ts and scripts/scrub/ledger.ts) is a recorded
correction; a dataset with one refuses any plan with an unexplained
path, with no override. The open item is removed and the design
record gains the rule. Docs only.
The #993 guard's "records a tag" means sourceSnapshotOf finds one in origin/main's dataset_description.json, so legacy entries that carry the tag only in a DOI or URL count. Docs only.
Define both tags right after the decision headline, where they are first used, instead of only in decision 10. Docs only.
When main moved since the plan, --execute plans again and stops for review of the new digest rather than going on. Docs only.
Delta paths are fixed from the pre-scrub plan, so the scrub that runs on them cannot change which paths they are. Docs only.
Gate G5 now says the first Worker merges run with REPULL_DAILY_MERGE_CAP=1, in ADR 0111's consequences and the design record, which also records that the Worker's merge has no staging rehearsal. Docs only.
Final read-through fixes: --abandon closes what exists, the xx
exception is named where pr-reviews requires the screen, the N.0.1
window ends at an administrator's merge, the importer consequence
matches the narrowed guard, and the index entry follows the NULL
rule, the two caps and the ledger rule. Docs only.
2.0.1 is no longer stacked by branch, so its Version is described as the next patch. Docs only.
@neuromechanist
neuromechanist merged commit ef7e3aa into feature/issue-1046-epic-upstream-freshness Oct 24, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/issue-1907-phase1-adr-0111 branch October 24, 2026 05:41

This branch was previously deployed

1 inactive deployment
npm — cb2e8731 Deployed Oct 24, 2026 by neuromechanist via publish #3825
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