Skip to content

seal v2 closure: use module::item is recorded as a missing spec module/item.t27, and the imported module is not in the closure #8351

Closed

Description

@gHashTag

Summary

t27c seal --save from current master (0.5.2, seal v2, #8110) writes a closure for a spec that imports items with use module::item. In that closure each imported item becomes a spec of its own, specs/<module>/<item>.t27, with "spec_hash": "missing". The module the items come from does not appear.

On specs/queen/actors_hw.t27 (#8336) there are 180 use queen::actors::<item> lines. All 180 come out as specs/queen/actors/<item>.t27 entries, each missing, and specs/queen/actors.t27 itself is not listed. A closure with missing entries cannot match a later build, so a verdict that depends on it can never be reused (#8095). And a change to actors.t27, the file that does decide the result, is not part of the identity.

See #5980, #8095.

Reproducer

module UseItem;

use queen::actors::backoff_seconds;

test reads_the_card { assert backoff_seconds(1) == 10; }

Save it as specs/scratch/use_item.t27, then t27c seal --save specs/scratch/use_item.t27. The seal lists specs/queen/actors/backoff_seconds.t27 with "spec_hash": "missing", and does not list specs/queen/actors.t27.

Expected

use a::b::item resolves to the spec of module a::b (specs/a/b.t27), the same resolution test-report --specs-dir already uses, and that spec's hash enters the closure once, however many of its items are imported.

Note

The sibling queen seals on master (queen_QueenTurnStop.json, queen_QueenReviewerSizing.json) are still v1, written by 0.5.0. #8336 keeps a v1 seal for the same reason. Its gen hashes are byte-identical under 0.5.0 and 0.5.2.

User Scenarios

  • Given a spec specs/scratch/use_item.t27 containing use queen::actors::backoff_seconds;, when running t27c seal --save specs/scratch/use_item.t27, then the closure lists specs/queen/actors.t27 with its content hash and does not list any specs/queen/actors/backoff_seconds.t27 entry.

  • Given a spec specs/queen/actors_hw.t27 with 180 use queen::actors::<item> lines, when running t27c seal --save specs/queen/actors_hw.t27, then the closure contains exactly one entry for specs/queen/actors.t27 with its hash, and zero entries for individual items under specs/queen/actors/.

Requirements

  • FR-001: The seal v2 closure generator MUST resolve use a::b::item to the module spec specs/a/b.t27 using the same resolution as test-report --specs-dir.
  • FR-002: The closure MUST include the resolved module spec once with its content hash, regardless of how many items are imported from that module.
  • FR-003: The closure MUST NOT create per-item spec entries (specs/a/b/item.t27) with "spec_hash": "missing" for use imports.
  • FR-004: A change to the module spec file (specs/a/b.t27) MUST change the closure identity so that verdicts depending on it are invalidated.

Success Criteria

  • t27c seal --save specs/scratch/use_item.t27 produces a closure JSON where specs/queen/actors.t27 appears exactly once with a non-"missing" spec_hash and specs/queen/actors/backoff_seconds.t27 does not appear — exit 0
  • t27c seal --save specs/queen/actors_hw.t27 produces a closure JSON containing exactly one entry for specs/queen/actors.t27 and zero entries under specs/queen/actors/ — exit 0
  • Re-running the same seal command on unchanged specs yields byte-identical closure JSON — exit 0
  • After modifying specs/queen/actors.t27, the new closure JSON differs from the previous one — exit 0

Boundary

  • compiler/cli/spec.t27
  • specs/queen/actors.t27
  • specs/queen/actors_hw.t27
  • specs/a/b.t27
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