From 6aa2b8dc3e92d775cd3a1ab4ce6d90a91aff4a17 Mon Sep 17 00:00:00 2001 From: krishanraja Date: Thu, 26 Nov 2026 15:30:45 +0000 Subject: [PATCH] Standards check-in: a ruled lineage's evolution carries the ruled words An evolution takes its parent's decided words: his latest amendment from the database. For the no-prediction lineage (bold_predictions, predictions_committed and their weekly evolutions) his 24 Nov amendment quotes his words after the statement, while config/floor-rulings.json keeps the statement alone and tests/floor_rulings_test.py holds every group in the lineage to it. On 26 Nov bold_predictions_e261126 copied the amendment and the check-in pull request #994 went red on that test. ruled_words() now gives such an evolution the ruling's statement. Co-Authored-By: Claude Opus 5.5 --- now-notes/2026-11-26-checkin-ruled-lineage.md | 3 +++ scripts/standards_checkin.py | 14 +++++++++++++- tests/standards_checkin_test.py | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 now-notes/2026-11-26-checkin-ruled-lineage.md diff --git a/now-notes/2026-11-26-checkin-ruled-lineage.md b/now-notes/2026-11-26-checkin-ruled-lineage.md new file mode 100644 index 000000000..c70690964 --- /dev/null +++ b/now-notes/2026-11-26-checkin-ruled-lineage.md @@ -0,0 +1,3 @@ +Status: The standards check-in gives a new evolution in the no-prediction lineage (bold_predictions, predictions_committed) the ruled statement from config/floor-rulings.json, not his database amendment, which quotes his words after it; on 26 Nov bold_predictions_e261126 copied the amendment and tests/floor_rulings_test.py refused the check-in pull request #994. +Next: Let #994 carry the ruled words for bold_predictions_e261126 and merge itself. +North Star check (2026-11-26): holds. diff --git a/scripts/standards_checkin.py b/scripts/standards_checkin.py index f4bb8be01..61ae30ec1 100644 --- a/scripts/standards_checkin.py +++ b/scripts/standards_checkin.py @@ -85,6 +85,18 @@ def decided_words(group, db_group): return group.get('never_beneath') +def ruled_words(key, rulings=None): + """The ruled statement for a group in a ruled lineage (config/floor-rulings.json "retired" groups: bold_predictions, + predictions_committed and their weekly evolutions), else None. His 24 Nov amendment in the database quotes his words + after the statement; the ruling keeps the statement alone, and tests/floor_rulings_test.py holds every group in the + lineage to it (26 Nov: the check-in's bold_predictions_e261126 copied the amendment and that test went red).""" + import floor_rulings + group = ((floor_rulings.load_rulings() if rulings is None else rulings).get('retired') or {}).get('groups') or {} + if group.get('statement') and floor_rulings.in_lineage(key, group.get('lineage') or []): + return group['statement'] + return None + + def prune(floor, groups): """Take out of the grouping every standard the floor no longer holds, in place, and return them as {id: where}. The Rejections engine retires a standard when a newer one supersedes it: on 18 Nov the floor dropped @@ -162,7 +174,7 @@ def propose(floor, groups, db_groups, week_of): parent = by_key[b['parent']] evolves[key] = b['parent'] entry = {'key': key, 'title': plain(f'{parent["title"]} (evolution, week of {week_of})')[:120], - 'never_beneath': plain(decided_words(parent, db_groups.get(b['parent']))), + 'never_beneath': plain(ruled_words(key) or decided_words(parent, db_groups.get(b['parent']))), 'check': plain(parent['check']), 'members': members, 'evolves': b['parent']} else: theme = str(first.get('theme') or 'other').replace('_', ' ') diff --git a/tests/standards_checkin_test.py b/tests/standards_checkin_test.py index 80d9425fc..69bb0afef 100644 --- a/tests/standards_checkin_test.py +++ b/tests/standards_checkin_test.py @@ -55,6 +55,24 @@ def test_a_proposed_group_never_carries_a_long_dash(self): merged = dict(groups, groups=groups['groups'] + new) self.assertEqual(standards_checkin.floor_group.check(floor, merged), []) + def test_an_evolution_in_a_ruled_lineage_carries_the_ruled_words(self): + # 26 Nov: bold_predictions_e261126 copied his database amendment, which quotes his words after the statement, + # and tests/floor_rulings_test.py refused it; the ruling's statement is what every group in the lineage carries. + import floor_rulings + statement = floor_rulings.load_rulings()['retired']['groups']['statement'] + floor = {'standards': { + 's0000000001': {'theme': 'close', 'never_beneath': 'An insight.', 'check_before_delivery': 'Read.'}, + 's0000000002': {'theme': 'close', 'never_beneath': 'A question.', 'check_before_delivery': 'Read.'}, + 's0000000003': {'theme': 'close', 'never_beneath': 'An open end.', 'check_before_delivery': 'Read.'}}} + groups = {'groups': [{'key': 'bold_predictions', 'title': 'No predictions', 'never_beneath': statement, + 'check': 'Read the close.', 'members': ['s0000000001', 's0000000002']}], + 'operating': {'title': 'Ops', 'members': []}} + db = {'bold_predictions': {'status': 'approved', 'amendment': statement + ' (Krish, 2026-11-24: "his words").'}} + new, _ = standards_checkin.propose(floor, groups, db, '2026-11-26') + self.assertEqual([g['key'] for g in new], ['bold_predictions_e261126']) + self.assertEqual(new[0]['never_beneath'], statement) + self.assertIsNone(standards_checkin.ruled_words('covers_e261126')) + if __name__ == '__main__': unittest.main()