Skip to content

v2.0.0: intel map describes the business model, not its plumbing

Choose a tag to compare

@cclabsnz cclabsnz released this 11 Oct 11:02
· 8 commits to main since this release

intel map now describes the org a Salesforce architect would recognise. It used to count every
pair of objects any Apex class or flow touched, test classes included, and to treat User,
RecordType and Share objects as peers of the business model. On a real Health Cloud sandbox it
reported 212 objects and 2,171 coupled pairs in 57 domains. This release reports 95 business
objects and 620 couplings in 17 domains, and states the rest as what those objects depend on.

This is a major because graph-fragment.json changes shape and meaning (docs/RELEASE.md).
If you read it:

  • couples edges join business objects only. For an unchanged org, expect fewer pairs and
    different endpoints.
  • Pairs with an actor, record type, setup object, configuration, event or reference data are
    new uses edges, each carrying attrs.roles.
  • Each touched object's role and its evidence arrive as attrs.orgintel.objectRole once
    merged, together with new map.objectRoles.* and map.apexClasses.tests coverage entries.

If you import the package, IntelContext.orgInfo is now OrgInfo | null. The HTML report of a
run with no roles decided is unchanged, byte for byte.

Changed

  • intel map classifies objects from platform evidence, and only business pairs are
    couplings.
    Each object this run touches gets a role from sf-core's classifyObject, decided
    from what the platform reports, never from its name:

    • describeGlobal's parent entity, plus layout and trigger capability;
    • the EntityDefinition sharing model;
    • what the OwnerId, CreatedById and RecordTypeId fields point at;
    • whether production automation only reads the object.

    What that changes:

    • Companions fold into their parent. AccountShare counts as Account.
    • Pairs with an actor, a record type, setup, configuration, an event or reference data are
      written as uses edges instead of couples, and the report states them in a new "What the
      business objects depend on" section.
    • Each object's role and its evidence are contributed as attrs.orgintel.objectRole.
    • A refused fact read degrades to unclassified, recorded under map.objectRoles.*. An
      unclassified object stays among the couplings.

    On a real Health Cloud sandbox, together with the test-class fix below, the map went from 212
    objects and 2,171 coupled pairs in 57 domains to 95 objects and 620 pairs in 17 domains, with
    User and RecordType out of the backbones. Expect couples counts, domains and backbones to
    change for an unchanged org.
    Specified in docs/OBJECT_ROLES_SPEC.md.

Fixed

  • Apex test classes are no longer analysed as production automation. A test class inserts
    fixture data for many objects at once, so its object references are not couplings in the running
    org. On a real Health Cloud sandbox 445 classes were tests, and excluding them took the map from
    2,171 coupled pairs to 1,231. A class is a test when the platform marks it so (the SymbolTable's
    IsTest annotation or testMethod modifier, or an @isTest class declaration in the body),
    never by name. Test classes are listed but not analysed, and reported once in the notes and as a
    map.apexClasses.tests coverage entry. Expect apexClassesAnalyzed and every coupling count
    to drop
    for an unchanged org.

  • "Top process backbones" in the terminal summary lists the heaviest couplings. It printed the
    first eight edges in id order, which on a real org meant weight-1 pairs whose names sorted first.

  • intel map and intel anatomy run for a user without View Setup and Configuration. Every
    command read Organization first, and the platform refuses that object to such a user, so the
    tool stopped before reading anything. That ruled out running it as the restricted users whose
    view of an org it exists to describe. Both commands now take the org id from the connection's
    auth info, name the org by its id, and say why in the run's notes. intel probe and
    intel discover report edition and sandbox status, which cannot be guessed, so they still
    stop, now naming the missing permission instead of printing the platform's bare
    sObject type 'Organization' is not supported. IntelContext.orgInfo is now OrgInfo | null.

  • intel anatomy reads Sites again. From 0.3.0 the channels collector queried
    SELECT Name, SiteName, Status FROM Site. Site has no SiteName column (the field belongs to
    RemoteProxy), so the read was refused with INVALID_FIELD on every org, and the channels band
    reported a failed read even where the org had sites. It now reads Name, MasterLabel and
    Status: MasterLabel is the label shown as the channel name, and Name, the site's unique
    technical name, keys the site.* node. The unit fixture had invented the missing column, which
    is how this shipped green; the new test's mock refuses any column Site does not have, as the
    org does. Found by running View A against a live org.

  • graph-fragment.json now marks what intel map dropped. The fragment hardcoded an empty
    coverage, so every drop the run detected reached the terminal and the HTML report and stopped
    there. Merged with intel anatomy's census, a refused FlowDefinitionView read looked the same
    as an org with no active flows: analysed.flows: 0 and nothing to explain it. Each drop is now
    also a coverage.unavailable entry, the same wiring anatomy-fragment.json already had.
    failed means the read was tried and refused. deferred means it was never tried.

    Scope Reason When
    map.flows failed the flow listing was refused
    map.flows.managed deferred managed-package flows, whose metadata is never requested
    map.flows.metadata failed one entry per flow whose metadata was refused, empty or unparseable
    map.flows.subflows deferred referenced subflows that were never retrieved, so their touches are not inherited
    map.apexClasses failed the class listing was refused
    map.apexClasses.unreadable failed classes with neither a readable body nor a SymbolTable
    map.apexTriggers failed the trigger listing was refused
    map.apexTriggers.unresolvedObject failed one entry per trigger whose object could not be resolved
    map.automationCounts.<field> failed a refused automation query, so that count is an unmeasured 0 on every object
    map.recordCounts deferred the sweep was capped by --max-node-counts
    map.recordCounts failed 90-day counts that were refused and fell back to 0
    map.objects failed the sObject catalog was refused

    Entries are sorted by scope, then reason, then detail, so the bytes stay stable across runs
    even though flow metadata is fetched concurrently. A run that drops nothing still writes an
    empty coverage.

  • Two silent fallbacks in intel map are now reported. A refused 90-day record count was
    stored as 0 with no note anywhere. A refused sObject catalog read meant running with no
    known-object set, which pushes every Apex class onto the regex fallback, also without a note.
    Both now appear in the run's notes and in the fragment's coverage.