Skip to content

facts-lock.sh harvests no identifiers from BRDs that use name keys, then check reports "agree with all 0 frozen fact(s)" #519

Closed

Description

@AlvinnYeo

File: bin/facts-lock.sh lines 91-95 (KEYED), 100-116 (walk), 249-256 (check summary) · Toolkit: eec646e · Found: 21 Oct 2026, while running the parallel-BRD freeze step

Summary

facts-lock.sh build freezes an identifier only when it sits under one of these keys (lowercased):
operationid, operationids, operation, entity, entityname, targetentity, aggregate, page, pagename,
pageid (plus *_CODE_SET tokens anywhere). BRDs whose arrays of objects carry the identifier as name
(domainEntities[].name, microflows[].name, pages[].name) give it nothing to harvest. The lock is written with
"facts": {}, and check then prints:

facts-lock: 8 BRD(s) agree with all 0 frozen fact(s)
exit 0

That reads as a pass. Nothing was compared. A later BRD that respells an entity, page or microflow will not be caught,
which is the job the script exists for (its header: N agents re-deriving the same identifiers).

The toolkit disagrees with itself on the key

  • tests/wave2/test-facts-lock.sh:45,50 fixtures use domainEntities[].entity.
  • bin/coverage-check.sh:172 documents pointer cells as /domainEntities/0/name, and enumerates leaves that way
    (:220-222).

So a BRD that satisfies coverage-check.sh can be invisible to facts-lock.sh.

Reproduce

mkdir -p P/analysis/x/knowledge-base/brd
echo '{"id":"F001","domainEntities":[{"name":"PaymentPlan"}],"pages":[{"name":"PaymentPlan_Overview"}]}' > P/analysis/x/knowledge-base/brd/F001-a.brd.json
echo '{"id":"F002","domainEntities":[{"name":"Paymentplan"}],"pages":[{"name":"PaymentPlan_Overview"}]}' > P/analysis/x/knowledge-base/brd/F002-b.brd.json
bin/facts-lock.sh P build
  facts-lock: 0 fact(s) frozen across 0 namespace(s), from 2 BRD(s)          exit 0
bin/facts-lock.sh P check
  facts-lock: 2 BRD(s) agree with all 0 frozen fact(s)                      exit 0

Same two files with every "name" key renamed to "entity" (run in a second scratch folder):

bin/facts-lock.sh Q build
  facts-lock: 1 fact(s) frozen across 1 namespace(s), from 2 BRD(s)
  CONFLICT  entities/paymentplan — 2 spellings, nothing frozen:
      PaymentPlan    F001-a.brd.json
      Paymentplan    F002-b.brd.json                                         exit 1

Same content, same disagreement; only the key name differs. (Run 21 Oct 2026 in $TMPDIR, toolkit eec646e.)

Expected

  1. Names under name inside the BRD's identifier-bearing arrays are harvested, into a namespace named for the array
    (entities for domainEntities, pages for pages, microflows for microflows, operations for
    integrations).
  2. A build or check that freezes or compares 0 facts over N > 0 BRDs is not reported as agreement. Say
    "0 identifiers found under any known key in N BRD(s): the lock is empty and check proves nothing", and exit
    non-zero (or 3, "nothing measured"), so a gate cannot count it as green.

Suggested fix (ranked)

  1. In walk(), carry the parent array's key: when the current key is name and the parent is one of
    domainEntities, entities, pages, microflows, nanoflows, integrations, harvest it into that
    namespace. Keeps the "identifiers only, no prose" rule: still len <= 80 and no spaces.
  2. Add the empty-lock guard to build and check (expected point 2).
  3. Add a fixture with name-keyed BRDs to test-facts-lock.sh, and one asserting that an empty harvest is not "agree".

How to retest

The two-file repro above: expect CONFLICT entities/paymentplan after the fix, and an empty-lock warning (not
"agree") on any corpus where nothing was harvested.

Activity

  1. MendixMau commented on Oct 26, 2026

    @MendixMau
    Owner

    Shipped in #578 (squash a088b4e) as warn-only, the maintainer's earlier lean: name-keyed identifiers are listed as WARN lines, never frozen, and exit codes are unchanged. Promoting them to frozen facts / CONFLICT is on the roadmap: #579.


    Generated by Claude Code

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions