130. Base slot 13 starts with the firmware's own clock, and the build timestamp proves it¶
This one fell out of drawing screens. Section 129's variant walk asks which state variable a screen program switches on, so that a person can be told when a screen looks the way it does, and the answer on a Harmony One was mostly "variable 35", with nine variables switched on in total and none of them named by base slot 0. Looking at what base slot 13 says about those nine is what opened this.
Section 60 read a base slot 13 record as a range and two of its fields as first and second without
being able to say what either meant. Section 120 then found that first of CurrentActivityState is
the idle value, the one no binding writes. This is the general reading: first is the value the
variable holds when the config is generated, and second is its maximum. For the activity variable
those coincide, because nothing is running when a config is compiled, which is why the narrower
reading worked.
The first seven records are the clock, and they are stamped rather than computed¶
| index | what it holds | maximum |
|---|---|---|
| 0 | second | 59 |
| 1 | minute | 59 |
| 2 | hour | 23 |
| 3 | day of the month, 0 for the 1st, section 322 | 30 |
| 4 | day of the week, where 0 is a Sunday, section 322 | 6 |
| 5 | month, zero based | 11 |
| 6 | year since 2000 | that year plus one |
Every field of every one of them equals the corresponding field of the config's own build timestamp, base slot 3's eleven byte record from section 21, in all 21 containers of the corpus: four Harmony One configs, three arch 14, two arch 9 user configs, six arch 8, and the safe mode and firmware embedded containers as well. Seven fields and seven maxima each, no exceptions, and there is no freedom left in the assignment: a wrong one shows up immediately as a second that is not the second.
Two independent things hold it up. Section 74 had already read three of these out of a different
language: action list opcode 0x07 band 0xF8 steps a date held in state variables 3, 5 and 6, which
is exactly the day, month and year above, established from the firmware without looking at a config.
Corrected by section 322. This said the weekday's zero is a Saturday, from base slot 3's own epoch, 1 January 2000. Both records count the weekday from Sunday and the day from 0, which is the same pair of bytes as the old reading on every container, because that reading took each date a day early. The agreement between the two records stands; what they agree on is a Sunday.
What that changes¶
A writer stamps these, it does not copy them. This is the same rail as base slot 3's timestamp, section 111, and it now covers seven more fields: an arch 12 remote sets its clock from base slot 3 at every boot, and a config carried over with its old state records also carries a stale seconds, minute and hour into the running remote. Reproducing them byte for byte is right for a round trip test and wrong for a save, which is the second place in this format where those two come apart.
They must not be reused for anything else, which section 74 said of 3, 5 and 6 and which now
applies to 0, 1, 2 and 4 as well. Base slot 0 names none of the seven in any container, which is the
structural sign that they belong to the firmware rather than to the generator, and the same is true of
state variable 35 on a Harmony One: 36 of its 46 switch uses read that variable, its range is 0 to 1,
and it has no transitions at all, so nothing in the config ever writes it. What it means is visible
rather than derived, and the variant view is what made it visible: the two arms of those pages differ
in exactly one label, the footer that says either "Activities" or "Current Activity".
FIRMWARE_STATE_VARIABLES in packages/codec/src/inventory.ts is the table, describeChoices uses it
to name a screen's condition, and the test walks the corpus asserting all seven against the timestamp.
Writing them is eight values, not seven, and the eighth was found by implementing the rail¶
The stamping exists now, clockStateEdits in packages/codec/src/edit.ts, and building it turned up
one thing reading could not: the year's maximum has to move with the year. Six of the seven maxima
are constants, 59, 59, 23, 30, 6 and 11 in all nineteen containers of the accounting corpus, and the
year's is that year plus one, which is in the table above. So a save that stamped only the seven
first fields would leave a config declaring a value outside a variable's own range as soon as it is
saved more than a year after it was built: one_config is a year record of 23 with a maximum of 24, and
saving it today writes 26 into a range that stops at 24.
That is a rail from the format's own rule and not from an observed failure, which is the weaker kind and is marked as such here: nothing has watched a remote mishandle a state variable that sits past its declared maximum. What makes it worth doing anyway is that the alternative is a file that contradicts a table this project published, and the cost is two bytes.
Two things the same work settled, both negatives. The seven records' transitions are structural,
not date derived: every container in the corpus carries the same skeleton, one transition each on the
minute, hour, day and month records and none on the second, weekday and year, with the register machine
operands 0xF202, 0xF205 and 0xF206 identical everywhere and only the 0x7F operands, which name
a base slot 10 list, differing per config. So a save leaves them alone. And a base slot 13 whose first
six maxima are not those constants is refused rather than stamped, on the same reasoning as
refusing a base slot 3 that holds no readable clock record: whatever it is, it is not the clock, and
overwriting it would be writing into a structure we have misidentified. The year's maximum is
deliberately exempt from that check, because repairing it is the point.
CLOCK_STATE_MAXIMA in packages/codec/src/sections.ts is the table, the rules are two entries in
FIELD_RULES, and packages/codec/test/edit.test.ts asserts a save moves both clocks and nothing
else, that the stamped records read back through stateRecords as the moment asked for, that a 2030
save of a 2023 config comes out as 30 with a maximum of 31, and that one moved maximum makes the whole
stamp refuse.
Section 129 | the archive | section 131. Section 130 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.