Repository navigation
Run governance rules to a fixed point in the reasoner worker (RULES step) - #5
Merged
Merged
Conversation
Semi-naive evaluation over selected graphs of the working dataset, with solutions spooled to a bounded file, conclusions applied in large write transactions, one witness per derived fact in a provenance graph, an explanation API with path reconstruction, and admission limits for rules, passes, new facts and spool. OpenMetadata's starter rules are test fixtures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5 of OpenMetadata's reasoning inside the Fuseki image design, worker side: a
RULESstep that runs OpenMetadata's governance CONSTRUCT bundles to a fixed point over a working TDB2 dataset. No job plan runs it yet; the REFRESH slice (capture → LOAD → CLASSIFY → RULES → COMPACT) wires it in. It runs today throughbin/reasoner runwith a step file.Included
RuleCompiler) on Jena algebra, independent of OpenMetadata: the same monotonic, finite subset as OpenMetadata'sFixedPointRuleCheck(no OPTIONAL, MINUS, NOT EXISTS, BOUND, EXISTS outside a top-level FILTER conjunct, nondeterministic functions, subqueries, aggregates, SERVICE, blank nodes in templates, template variables bound only by BIND). Stricter at this trust boundary: GRAPH/FROM/FROM NAMED refused (rules read the selected union), only SPARQL built-ins,fn:and XSD casts callable (extension and property functions off, sincejava:/apf:run code), and size bounds. One bad rule rejects the bundle asINVALID_RULESwith every problem listed.SemiNaiveAgreementTestchecks the result against naive iteration on random graphs.Explanations.explainreturns a fact as ASSERTED, DERIVED or ABSENT, with premises explained recursively, property-path premises rebuilt as a shortest chain, EXISTS answered with one match, and every cut marked truncated.maxRules256,maxRulePatterns64,maxPasses64,maxNewFacts10,000,000,maxSpoolBytes4 GiB — fixed, since heap does not grow with facts (276k triples → 158k facts at 27 MiB peak after GC; 552k → 317k at 43 MiB).PASS_BUDGET,FACT_BUDGET,SPOOL_BUDGET); the launcher andWorkerStagemap it toLIMIT_EXCEEDEDwith the limit as subject. A step that does not converge writes no run record.Tests
mvn -B -ntp verify: 173 unit + 7 integration tests.RulesStepTestports OpenMetadata's starter rules (unchanged copies inreasoner/src/test/resources/rules/): schema tag → table → column, table domain → columns, two-hop PII through lineage from an inherited tag; a three-rule chain gives the same facts and pass count in all 6 orders; symmetric and mutually deriving rules terminate; deleting a premise and recomputing retracts a lineage cycle while a column with a second support keeps its tag; each budget ends INCOMPLETE and cleans up.WorkerProcessITruns the starter bundle through the real launcher, plus a 275,893-triple lineage catalog at 512m heap (157,805 facts, 8 passes, ~25 s locally; asserts < 120 s and < 256 MiB).mvn -B -ntp verify: 240 unit + 11 integration tests.Not yet
The REFRESH job plan and the module's admission check with
RuleCompiler; an EXPLAIN step for governance facts; a RULES case in the image smoke test. After an INCOMPLETE run the output graphs are partial; only the missing run record marks the dataset as unpublishable, which the snapshot slice enforces.Seen while testing:
TimeBudgetTest.anExplanationEndsIncompleteAtItsDeadlinehung once under heavy machine load in HermiTReasoner.isEntailed, which ignored the interrupt (pre-existing; passed on rerun and on the base commit). A follow-up should give HermiT anindividualTaskTimeoutfrom the remaining budget or callReasoner.interrupt()from the watchdog.