instructions_gate: CLOSED-ITEMS.md is the third register source
gates / gates (push) Failing after 17s

Compressing a finished row out of OPEN-ITEMS.md into CLOSED-ITEMS.md is the
documented housekeeping act. The gate read only OPEN-ITEMS.md and ROADMAP.md, so
the first compression (ef6ac6f) turned every citation of a compressed item into
'a reference to nothing' and failed CI on the next push, in felhom-controller,
for a rule file nobody had touched.

CLOSED-ITEMS.md now answers 'does this ID exist', and answers 'closed' for the
rows it owns. OPEN-ITEMS.md stays the sole authority on OPENNESS: a row it
already claims as open is not overridden.

Both controls still convict: an ID present nowhere fails, and a citation claiming
a closed item is still open fails.
This commit is contained in:
2026-08-22 13:15:52 +02:00
parent f2edf7e545
commit e18668f9e1
+19 -1
View File
@@ -482,6 +482,12 @@ def register_state(workspace_root):
base = os.path.join(workspace_root, "felhom.eu", "documentation", "backlog") base = os.path.join(workspace_root, "felhom.eu", "documentation", "backlog")
reg = os.path.join(base, "OPEN-ITEMS.md") reg = os.path.join(base, "OPEN-ITEMS.md")
hist = os.path.join(base, "ROADMAP.md") hist = os.path.join(base, "ROADMAP.md")
# CLOSED-ITEMS.md is the third source, and it is not optional. Compressing a finished row out of
# OPEN-ITEMS.md into it is the DOCUMENTED housekeeping act — and on 2026-08-22 (commit ef6ac6f)
# the first such compression turned every citation of a compressed item into "a reference to
# nothing", failing CI on the next push for a file nobody had touched. The register did not
# break; the gate's idea of where the register lives did.
closed = os.path.join(base, "CLOSED-ITEMS.md")
if not os.path.exists(reg): if not os.path.exists(reg):
return None return None
@@ -491,6 +497,10 @@ def register_state(workspace_root):
if os.path.exists(hist): if os.path.exists(hist):
with io_open(hist) as fh: with io_open(hist) as fh:
hist_text = fh.read() hist_text = fh.read()
closed_text = ""
if os.path.exists(closed):
with io_open(closed) as fh:
closed_text = fh.read()
state = {} state = {}
for line in reg_text.split("\n"): for line in reg_text.split("\n"):
@@ -518,9 +528,17 @@ def register_state(workspace_root):
state[m.group(1)] = "closed" state[m.group(1)] = "closed"
break break
# A row that OWNS a line in CLOSED-ITEMS.md is CLOSED — but only if OPEN-ITEMS.md did not
# already claim it as open work. OPEN-ITEMS.md stays the authority on openness; this file only
# answers "does this ID exist at all", and answers "closed" for the ones it holds.
for line in closed_text.split("\n"):
m = re.match(r"\|\s*\*\*(R-\d+[a-z]?)\*\*\s*\|", line)
if m and m.group(1) not in state:
state[m.group(1)] = "closed"
mentioned = set(re.findall(r"\bR-\d+[a-z]?\b", reg_text)) | set( mentioned = set(re.findall(r"\bR-\d+[a-z]?\b", reg_text)) | set(
re.findall(r"\bR-\d+[a-z]?\b", hist_text) re.findall(r"\bR-\d+[a-z]?\b", hist_text)
) ) | set(re.findall(r"\bR-\d+[a-z]?\b", closed_text))
for item in mentioned: for item in mentioned:
state.setdefault(item, "historical") state.setdefault(item, "historical")
return state return state