Orchestrata Ultimate › Plans › briefs › 2026-10-13-adr-0102-rebaseline-mechanism-and-foreign-register-refusal
Brief: ADR-0102 rules 1 and 3 — the re-baseline reaches the three overwritten nodes, and the sync refuses a foreign register
Source: plans/briefs/2026-10-13-adr-0102-rebaseline-mechanism-and-foreign-register-refusal.md at 8a2cb42ad · last changed 2026-10-13 · first committed 2026-10-13 · 51 lines.
Prose pending.
Plan text
Brief: ADR-0102 rules 1 and 3 — the re-baseline reaches the three overwritten nodes, and the sync refuses a foreign register
Date: 2026-10-13 · DESIGN_WAIVER: ADR-0102 (Accepted 2026-10-13 21:12: re-baseline graph nodes ADR-0035, ADR-0036 and ADR-0041 from this repository's records under ADR-0102's authority; the sync refuses a foreign page or directory until a project key exists) and ADR-0096 (Accepted: --rebaseline-id with --authority, logged) · Executor: Kimi in worktree /home/mohamed/workspace/orchestrata-ultimate-worktrees/adr-0102-rebaseline on branch fix/adr-0102-rebaseline-and-refusal off origin/master 9447d4fcc · Design settled below; if a fork appears, STOP and report.
GOAL: scripts/check_adr_graph_sync.py reports no violation across all ids after three logged re-baselines, and scripts/sync_architecture_to_graph.py refuses to read any register that is not this repository's.
VERIFIED (coordinator, origin/master 9447d4fcc, run at 21:14 on 2026-10-13):
scripts/sync_architecture_to_graph.py:rebaseline_adr(writer, adr_dir, adr_label, authority) -> strL316;rebaseline_first_capture_run(writer, wiki_path, adr_dir, authority)L400; flags--rebaseline-id ADR-NNNN,--authority ADR-NNNN,--rebaseline-first-capture,--adrs [PATH],--repo-adrs [DIR]. Writer methods:ArchitectureWriter.rebaseline_architecture_decision(project, padded_id, *, authority, title, status, date, context, decision, alternatives, consequences)(src/orchestrata_ultimate/knowledge_graph/architecture_writer.pyL905) andrebaseline_first_capture(...)L979. The log line shape (changed today at 3437157b0):REBASELINED: <project>:ADR-NNNN <before10> -> <after10> under ADR-NNNN; testtests/scripts/test_sync_rebaseline_log_line.py.- Observed refusals with
--authority ADR-0102(ADR-0102 Accepted in docs and synced):REFUSED: ADR-0035 is 'Proposed' in docs, not Accepted; the same for ADR-0036;REFUSED: expected exactly one docs/adr file for ADR-0041(this repository's ADR-0041 exists only on the wiki pageprojects/orchestrata-ultimate/decisions.md, title "Ruleset engine — per-surface immutable versions, named compositions (F1)"). - The graph today:
orchestrata-ultimate:ADR-0035andADR-0036hold codetools' Accepted bodies;ADR-0041holds codetools' title and body;check_adr_graph_sync.pyprints three title DRIFT rows andFAIL — 3 violation(s) across 127 id(s). The script's own words: it never writes. - ADR-0102 Decision rule 1 names exactly these three ids and their sources (0035 and 0036 from
docs/adr/, 0041 from the wiki project register); rule 3 names the refusal.
FILES (repo-relative): Modify:
- scripts/sync_architecture_to_graph.py —
(a)
--rebaseline-idaccepts a docs record of any status when the authority ADR's Decision text names that id (parse the authority's docs file; refuse withREFUSED: ADR-0102 does not name ADR-NNNNotherwise); the written node carries the docs record's own status (Proposed stays Proposed). The existing Accepted-only path is unchanged for authorities that do not name the id. (b)--rebaseline-idfor an id with no docs file re-baselines from the wiki register entry (## ADR-NNNN:heading, its**Status:**line and body) when the authority names it; refuse as today otherwise. (c) Foreign-register refusal:--adrs PATHmust resolve under$WIKI_ROOT/projects/orchestrata-ultimate/and--repo-adrs DIRunder this repository's root; anything else exits 2 withREFUSED: foreign register <path>; ADR-0102 rule 3: no sync of another project's ADRs until a project key exists. The check runs before any graph write. Create: - tests/scripts/test_sync_rebaseline_under_authority.py — real Memgraph (the test node the existing sync tests use), a scratch project key or scratch ids the existing tests already use for isolation: a Proposed docs id named by a scratch authority re-baselines and logs
REBASELINED:; the same id with an authority that does not name it is refused with the exact message; a wiki-only id named by the authority re-baselines from the wiki entry. - tests/scripts/test_sync_refuses_foreign_register.py —
--adrs /var/tmp/ct-0102/foreign/decisions.mdand--repo-adrs /var/tmp/ct-0102/foreign/adreach exit 2 with the refusal before any write (assert the graph node count is unchanged). Read-only: docs/adr/0102-.md, 0096-.md, 0098-*.md, scripts/check_adr_graph_sync.py, tests/scripts/test_sync_rebaseline_log_line.py, tests/scripts/test_sync_adrs_pointer_entries.py.
THEN, the repair itself (the slice's acceptance, a real graph write under the ruling): from the worktree, after the tests are green,
direnv exec <worktree> uv run python scripts/sync_architecture_to_graph.py --adrs $WIKI_ROOT/projects/orchestrata-ultimate/decisions.md --repo-adrs docs/adr --rebaseline-id ADR-0035 --authority ADR-0102, the same for ADR-0036 and ADR-0041, then scripts/check_adr_graph_sync.py. Record the three REBASELINED: lines and the check's summary line verbatim in your hand-back.
CONSTRAINTS:
- Read Python through the AST toolkit (
scripts/serialize_codebase_ast.py source <qualified_name>); plain text tools on.pyare blocked here. Markdown with any tool. direnv exec /home/mohamed/workspace/orchestrata-ultimate-worktrees/adr-0102-rebaseline uv run …for everything; tests observed:timeout 300 direnv exec <worktree> uv run python -m pytest <modules> -p orchestrata_ultimate.core.threading.pytest_live_observer -q --basetemp=/var/tmp/ct-0102/v(mkdir -p first). No mocks, no monkeypatch, no skips (RUL-002), no xdist (RUL-001). Never re-run an unchanged red.- Never re-baseline any id other than the three ADR-0102 names; never touch the codetools wiki page or directory.
- Real pre-commit on commit, no
--no-verify; commits by Mohamed, stage by name, no attribution lines; never commitplans/ast-*.json,docs/CODEBASE_MAP*.md,.claude/.
DONE WHEN:
- The two new tests and
tests/scripts/test_sync_rebaseline_log_line.pyplustest_sync_adrs_pointer_entries.pyare green, observed. - The three re-baselines ran and
check_adr_graph_sync.pyprintsOK — <N> id(s) examined, no drift or collisions detected. - ruff and mypy clean on the script and tests;
git status --shortempty; one commit naming ADR-0102 rules 1 and 3.
VERIFY: the pytest summary line; the three REBASELINED: lines; the check's summary line; git log --oneline -1.
Report back with those observed outputs and anything that stopped you.
Coordinator amendment (2026-10-13 21:45, after the builder's fork report)
Fork reported by the builder: the rule-3 refusal, applied in every mode before any write, turns 11 existing tests red (5 in tests/scripts/test_sync_architecture_to_graph.py, 6 in tests/scripts/test_sync_repo_adrs.py) because their scratch registers live in pytest's tmp_path, outside both allowed roots.
Ruling (coordinator; this executes ADR-0102 rule 3 as written and opens no new decision): the builder's option (1).
- The refusal stays unqualified and runs in every mode (dry-run included) before any write. Allowed roots, for both
--adrsand--repo-adrs: this repository's root (resolved from the script's own location,Path(__file__).resolve().parents[1]) and$WIKI_ROOT/projects/orchestrata-ultimate/(WIKI_ROOTas_default_adrs_pathalready reads it, default~/workspace/knowledge-wiki). A path under either root is admitted; resolve symlinks on both sides before comparing. - The 11 tests move their scratch registers under
<repo>/tmp/<test-id>/(the.gitignoreentrytmp/at line 169 already ignores that directory at any depth), created per test and removed in teardown; their assertions are unchanged.tests/scripts/test_sync_architecture_to_graph.pyandtests/scripts/test_sync_repo_adrs.pyjoin the Modify list for this relocation only. tests/scripts/test_sync_refuses_foreign_register.pykeeps/var/tmp/ct-0102/foreign/...as its foreign paths and adds one case: the exact 20:21 command shape (--adrs <scratch>/projects/codetools/decisions.md --repo-adrs <scratch>/docs/adr, with scratch copies outside both roots) exits 2 with the refusal before any write.- Options (2) and (3) rejected: each leaves the 20:21 command legal in some mode, which is what rule 3 forbids.