Object RepoConsistencyCheck

  • All Implemented Interfaces:

    
    public class RepoConsistencyCheck
    
                        

    Repo-governance consistency checks for Browser4 self-development.

    coding.validate(type="repo-consistency") verifies the invariants that keep the build coherent when an agent adds/removes modules or bumps versions:

    • VERSION — the repo VERSION file exists and is a plausible X.Y.Z(-SNAPSHOT).

    • Root pom — the root aggregator <project> version matches VERSION.

    • BOM — browser4-dependencies (the BOM) version matches VERSION.

    • Module registration — every <module> in the default <modules> block resolves to a real directory; and every on-disk module directory is registered somewhere in the root pom (so -am reactor builds can find it).

    • Plugin SDK versions — every in-repo browser4-plugin.json declares a literal sdkVersion equal to VERSION, or a build-injected placeholder (${project.version}, substituted by browser4-pdk resource filtering); bundled plugins therefore always match the SDK they are built with. Literal drift from VERSION is an error.

    Pure string/regex analysis plus an existence callback — zero dependencies, no network, no Maven invocation. Testable without a real checkout.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final ValidationResult check(String versionContent, String rootPom, String bomPom, Function1<String, Boolean> moduleExists, List<String> onDiskModuleDirs, List<String> pluginManifestContents, List<String> staticModuleMap, List<String> liveModuleDirs, Map<String, List<String>> staticDependents, Function1<String, Set<String>> liveDependentsOf, String moduleMapSource) Run the consistency checks.
      final Boolean isPluginManifestPath(Path path) Whether path is an in-repo plugin manifest worth scanning: a file named browser4-plugin.json that is NOT inside build output (target/) or hidden directories (.git, .worktrees, .claude, ...).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • check

         final ValidationResult check(String versionContent, String rootPom, String bomPom, Function1<String, Boolean> moduleExists, List<String> onDiskModuleDirs, List<String> pluginManifestContents, List<String> staticModuleMap, List<String> liveModuleDirs, Map<String, List<String>> staticDependents, Function1<String, Set<String>> liveDependentsOf, String moduleMapSource)

        Run the consistency checks.

        Parameters:
        versionContent - content of the repo VERSION file (null when absent)
        rootPom - content of the root aggregator pom.
        bomPom - content of browser4-dependencies/pom.
        moduleExists - callback: does the module directory exist on disk?
        onDiskModuleDirs - top-level module directories found on disk (containing a pom.
        pluginManifestContents - contents of every in-repo META-INF/browser4-plugin.json, checked for sdkVersion == VERSION
        staticModuleMap - the static ModuleMap.MODULES snapshot (optional); when provided together with liveModuleDirs, modules found in the live pom scan but missing from the snapshot are reported as errors (drift)
        liveModuleDirs - module directories found in the live pom scan (optional)
        staticDependents - the static ModuleMap.DEPENDENTS snapshot (optional)
        liveDependentsOf - reverse-edge lookup on the live pom graph: returns the modules that directly depend on String (optional); when both are provided, per-module reverse edges are compared as sets in both directions
        moduleMapSource - raw ModuleMap.
      • isPluginManifestPath

         final Boolean isPluginManifestPath(Path path)

        Whether path is an in-repo plugin manifest worth scanning: a file named browser4-plugin.json that is NOT inside build output (target/) or hidden directories (.git, .worktrees, .claude, ...). Hidden dirs may hold other branches' checkouts (worktrees) whose manifests must not be judged against this checkout's VERSION.