Within Cap, Measuring Nothing

Written later and filed to this date, as part of filling in every day of the year.

What. The loop has one number with veto power: upkeep. Its charter sets a cap on how many hours a week the system may cost me, and when upkeep goes over the cap the next cycle may only prune or harden. The drift report that enforces it printed, for two weeks in July, the line 0h this week vs cap, within cap. The hours came from four hand-kept logs (time, habits, goals, expenses) that the report had classified as fresh. All four were empty.

When it was noticed. On the sixteenth of July, by a session that had opened the report to wire up something unrelated: a set of falsifiers the charter names, conditions under which I would have to admit the loop was not working, which until then had no code evaluating them. Reading the report’s output as a whole rather than for the one line it needed, the session saw four stores marked fresh and knew they could not be.

The cause. Freshness was read as the newest date anywhere in the file. Each of the four logs had been scaffolded with an HTML comment describing its own grammar, and that comment carried a date: the day a demo seed had been archived, the second of July. For fourteen days that comment was the newest date in four files that had no other dates in them. Fourteen days was also the freshness window. Sixteen minus two is fourteen, and the check was at most fourteen, so the sixteenth was the last day the stores could read fresh. On the seventeenth they would have flipped to stale on their own, the report would have gone amber, and the defect would have stayed in the code, waiting for the next scaffold comment with a date in it.

The fix. Strip HTML comments before reading dates. The workspace already had a function for that, built earlier in the summer for the same class of bug in a different parser, and the fix was to call it. The demo check, which compares bytes, stays on the raw file: it is an equality test, not a date read. The report now distinguishes two states that had been one: a measured number against the cap, and UNMEASURED, with the cap named as unenforceable until the time log is real. Zero hours and no hours are different findings, and only one of them is good news.

What guards it now. Two regression tests pin the exact scaffold shape that fooled the reader, so a grammar comment with a date in it cannot count as an entry again. The five falsifiers the session came to build are evaluated on every run, with a dated clock each, and a fired one lands at the top of the decision queue above everything else. And the same session’s notes record the family this bug belongs to: parsers that read documentation examples as records. Three members by then. The HTML comment is where this workspace keeps its grammar, and a comment is still text to a regular expression.


← all writing