parseProbe MUST read @section lines and key=value lines into a record of sections, MUST accept lines ending in a carriage return, and MUST skip blank lines and lines before any section.
Enforced (check): .github: cd commons/machine-probe && bun run verify — suite/observation.test.ts
toObserved MUST give a typed observation from the sections, with unknown for a security setting the probe did not give, numbers as numbers, the administrators sorted and the ports in order, and MUST refuse a probe that gave no time, because an observation with no time is not evidence.
Enforced (check): .github: cd commons/machine-probe && bun run verify — suite/observation.test.ts
observedState MUST give keyed records of the system, the security settings, the software and the ports, and MUST NOT hold the time of the observation, the version of the probe or a counter that changes on its own, so that two observations of a machine that did not change are equal.
Enforced (check): .github: cd commons/machine-probe && bun run verify — suite/observation.test.ts
observe MUST give the observation of a machine sent facts, unreachable where the command did not run or the ssh client could not reach it (status 255), refused where the probe ended with another status, and unreadable where what it printed is not facts; and query MUST refuse a query that is not one SELECT before sending anything, and give the rows of osquery as text.
Enforced (check): .github: cd commons/machine-probe && bun run verify — suite/observation.test.ts
Given the output of a real probe on Ubuntu, When it is read, Then the family is ubuntu, the version 24.04 and the packages are counted, per FR-001 and FR-002.
Given a probe output with no time, When it is read, Then it is refused, per FR-002.
Given two observations that differ only in time, When their keyed records are compared, Then they are equal, per FR-003.
Given a command that ends with 255, When the machine is observed, Then the error is unreachable and never an observation, per FR-004.