Skip to content

t27b coverage: real tests for 9 function cards in specs/functions (morph to ton) #8283

Closed

Description

@gHashTag

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:

  1. ID is <domain>-<object>-<verb>, with DOMAIN from the README's vocabulary as its first part.
  2. TRIGGER decides the rest. An event function has an EVENT and CRON = "", and its canonical EVENT names the same three parts as ID (<domain>/<object>.<verb>). A cron function has a five-field CRON, EVENT = "" and no LEGACY_EVENTS.
  3. ON_FAILURE, PROBE_RESULT, CONTROL and every SIDE_EFFECTS value come from their vocabularies; no side effect is listed twice. KIND, REPO and TZ are as the schema states.
  4. SAFE_PROBE agrees with PROBE_RESULT. "" means no probe was sent (skipped, or not-deployed with GUARD = unknown). A JSON object means the probe reached the function (COMPLETED, or FAILED-at-guard with a named GUARD).
  5. SERVICE is file: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 bless of the branch run;
  • the signed lane receipts compare as IMPROVED_ONLY.

User Scenarios

  • Given the 9 function cards in specs/functions lack test, invariant, or bench blocks, When t27c test-report runs, 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, When t27c test-report and t27b run, 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, or bench block with runtime asserts
  • FR-002: Tests MUST verify ID follows <domain>-<object>-<verb> with DOMAIN from specs/functions/README.md vocabulary (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 TRIGGER rules: event functions have EVENT matching <domain>/<object>.<verb> and empty CRON; cron functions have five-field CRON, empty EVENT, and no LEGACY_EVENTS
  • FR-004: Tests MUST verify ON_FAILURE, PROBE_RESULT, CONTROL, and every SIDE_EFFECTS value come from their declared vocabularies with no duplicate side effects
  • FR-005: Tests MUST verify KIND, REPO, and TZ conform to the schema in specs/functions/README.md
  • FR-006: Tests MUST verify SAFE_PROBE agrees with PROBE_RESULT per specification (empty means no probe sent; JSON object means probe reached function)
  • FR-007: Tests MUST verify SERVICE is file:line format
  • FR-008: All 9 cards MUST pass under t27c test-report with 0 vacuous passes
  • FR-009: All 9 cards MUST pass under t27b with 0 vacuous passes
  • FR-010: Each card MUST be sealed after tests pass
  • FR-011: Ledger rows that change MUST originate from bless of 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions