Repository navigation
t27b coverage: real tests for 9 function cards in specs/functions (morph to ton) #8283
Description
Part of #6063 (t27b coverage), which is item C10 of #6488 ("coverage counted without vacuous passes").
What is wrong
On the t27b lab, 18 function cards of specs/functions pass vacuously (0 runtime asserts) under the reference and t27b: they have no test, invariant or bench block, which also breaks L4 TESTABILITY. This issue covers the other 9 in file order: morph-images-generate, neuro-image-generate, payment-ai-server-process, reels-ai-callback, reels-ai-generate, reels-loop-generate, render-avatar-video-run, robokassa-unclaimed-watch, ton-pending-watch.
What the tests check
specs/functions/README.md states the schema of a function card and the rules its generator enforces. The tests hold each card to them:
IDis<domain>-<object>-<verb>, withDOMAINfrom the README's vocabulary as its first part.TRIGGERdecides the rest. An event function has anEVENTandCRON = "", and its canonicalEVENTnames the same three parts asID(<domain>/<object>.<verb>). A cron function has a five-fieldCRON,EVENT = ""and noLEGACY_EVENTS.ON_FAILURE,PROBE_RESULT,CONTROLand everySIDE_EFFECTSvalue come from their vocabularies; no side effect is listed twice.KIND,REPOandTZare as the schema states.SAFE_PROBEagrees withPROBE_RESULT.""means no probe was sent (skipped, ornot-deployedwithGUARD = unknown). A JSON object means the probe reached the function (COMPLETED, orFAILED-at-guardwith a namedGUARD).SERVICEisfile:line.
Cards that break rule 1 (see #7911) keep rules 2 to 5 and skip rule 1.
Earlier attempt
See #6890: an open PR of an earlier attempt that adds tests to 7 of these 9 cards. Its tests restate each constant, which this lane rules out; it is superseded, not built on.
Done when
- each card has these tests, passing under the reference (
t27c test-report, 0 vacuous) and under t27b; - each is sealed;
- the ledger rows that move come from
blessof the branch run; - the signed lane receipts compare as IMPROVED_ONLY.
User Scenarios
- Given the 9 function cards in
specs/functionslacktest,invariant, orbenchblocks, Whent27c test-reportruns, Then each card passes vacuously with 0 runtime asserts - Given tests are added to each of the 9 cards per the schema rules in
specs/functions/README.md, Whent27c test-reportandt27brun, Then all 9 cards pass with non-vacuous asserts under both runners - Given all tests pass non-vacuously, When the branch is blessed and lane receipts are compared, Then ledger rows move from the bless run and receipts show IMPROVED_ONLY
Requirements
- FR-001: Each of the 9 function cards MUST have at least one
test,invariant, orbenchblock with runtime asserts - FR-002: Tests MUST verify
IDfollows<domain>-<object>-<verb>withDOMAINfromspecs/functions/README.mdvocabulary (cards noted in Five cards break their directory's schema, two carry non-ASCII (found by the #6063 test lane) #7911 exempt rule 1 only) - FR-003: Tests MUST verify
TRIGGERrules: event functions haveEVENTmatching<domain>/<object>.<verb>and emptyCRON; cron functions have five-fieldCRON, emptyEVENT, and noLEGACY_EVENTS - FR-004: Tests MUST verify
ON_FAILURE,PROBE_RESULT,CONTROL, and everySIDE_EFFECTSvalue come from their declared vocabularies with no duplicate side effects - FR-005: Tests MUST verify
KIND,REPO, andTZconform to the schema inspecs/functions/README.md - FR-006: Tests MUST verify
SAFE_PROBEagrees withPROBE_RESULTper specification (empty means no probe sent; JSON object means probe reached function) - FR-007: Tests MUST verify
SERVICEisfile:lineformat - FR-008: All 9 cards MUST pass under
t27c test-reportwith 0 vacuous passes - FR-009: All 9 cards MUST pass under
t27bwith 0 vacuous passes - FR-010: Each card MUST be sealed after tests pass
- FR-011: Ledger rows that change MUST originate from
blessof the branch run - FR-012: Signed lane receipts MUST compare as IMPROVED_ONLY
Boundary
- specs/functions/morph-images-generate.t27
- specs/functions/neuro-image-generate.t27
- specs/functions/payment-ai-server-process.t27
- specs/functions/reels-ai-callback.t27
- specs/functions/reels-ai-generate.t27
- specs/functions/reels-loop-generate.t27
- specs/functions/render-avatar-video-run.t27
- specs/functions/robokassa-unclaimed-watch.t27
- specs/functions/ton-pending-watch.t27
- specs/functions/README.md
Activity
specs(functions): real tests for 9 function cards, morph to ton (Closes