Object RepoConsistencyCheck
-
- All Implemented Interfaces:
public class RepoConsistencyCheckRepo-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-amreactor builds can find it).Plugin SDK versions — every in-repo
browser4-plugin.jsondeclares a literalsdkVersionequal 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.
-
-
Field Summary
Fields Modifier and Type Field Description public final static RepoConsistencyCheckINSTANCE
-
Method Summary
Modifier and Type Method Description final ValidationResultcheck(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 BooleanisPluginManifestPath(Path path)Whether path is an in-repo plugin manifest worth scanning: a file named browser4-plugin.jsonthat is NOT inside build output (target/) or hidden directories (.git,.worktrees,.claude, ...).-
-
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-repoMETA-INF/browser4-plugin.json, checked forsdkVersion== VERSIONstaticModuleMap- 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 directionsmoduleMapSource- raw ModuleMap.
-
isPluginManifestPath
final Boolean isPluginManifestPath(Path path)
Whether path is an in-repo plugin manifest worth scanning: a file named
browser4-plugin.jsonthat 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.
-
-
-
-