Skip to content

archtest: add the emitters layering rule before the first emitter package exists #973

Closed

Description

@OmarAlJarrah

Problem

Invariant 1 keeps emitters from importing compilers, and emitter-design §2 says the import-graph test enforces it. At c387e25c, internal/archtest's rules map has no entry for emitters or any package under it.

A first emitter package that imports compilers/openapi fails TestImportGraph_EveryPackageIsRuledOrExempt, because no rule reaches it. Nothing says which rule to add, though. With the entry "emitters/golang": {ir} or a parent "emitters": {ir}, TestImportGraph_LayeringHolds refuses the compiler import as it should. With an exempt entry, the import passes.

A rule for a directory that does not exist yet is skipped (internal/archtest/arch_test.go), so the entry can land now.

Direction

A proposal:

  • Add "emitters": {"ir"} now, and entries for the contract packages emitter-design §7 names (emitters/plan, policy, naming, manifest, verify) as each is created.
  • State in §7 that an emitter package never goes into exempt.

Done when a planted emitters/golang importing compilers/openapi fails TestImportGraph_LayeringHolds.

Out of scope

Test files, which archtest exempts by design.

Related: #796

Priority: P4, rule 1 (a test that unblocks nothing yet). grep -c '"emitters' internal/archtest/arch_test.go → 0 (morphic @c387e25c).

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P4Refactors, tests, CI, hostile-input hardening, cosmetic diagnostics, other formatstype:testTests only

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions