Skip to content

ci: smoke-test that the compiled CLI embeds the rules-version hash #542

Closed

Description

@nc9

Follow-up from a review of the rule-cache key change. The rules-version hash is computed by a Bun macro at build time, and nothing checks that a compiled squirrel binary actually embeds it rather than computing it at runtime.

Acceptance Criteria

  • A CI step builds the CLI binary and asserts the embedded rules-version hash equals the one computed from the source tree
  • Changing a rule source file changes the embedded hash (the step proves it with a scratch edit, or a unit test of the macro input set)

Activity

  1. added
    P3
    size: S
    on Oct 7, 2026
  2. nc9 commented on Oct 11, 2026

    @nc9
    ContributorAuthor

    Checked against 0.0.108 and current main (ad95fb2): criterion 1 STILL TRUE. Criterion 2 is covered by unit tests.

    • Criterion 1: the "Compile CLI" job (.github/workflows/ci.yml, build:) only runs bun run build. No step inspects the compiled binary for the hash.
    • Criterion 2: apps/cli/tests/audit/rules-fingerprint.test.ts already tests the macro's input set. The hash moves when a rule's code changes, when a rule file is added and when the lockfile changes, and it ignores test files. "is inlined as a sha-256 of this checkout" compares RULES_VERSION with fingerprintRuleSources() under bun test, but not inside a compiled binary.
    • Spot check on the released 0.0.108 binary: it does not contain the string rules fingerprint: source not found, which rules-fingerprint.ts would carry if the fingerprint ran at runtime. That fits the macro being inlined at build time, but it is a manual check, not the CI assertion this issue asks for.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3choresize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions