Skip to content

Contextual API - #972

Merged
isXander merged 7 commits into
mainfrom
feat/fact-domains
Aug 21, 2026
Merged

Contextual API#972
isXander merged 7 commits into
mainfrom
feat/fact-domains

Conversation

@isXander

Copy link
Copy Markdown
Owner

Rewritten APIs for Trigger Effect and Guides, now under one unified contextual domain / fact / rule system.

Using mostly-vanilla predicates, facts can be defined in resource packs, querying game-state such as held items, hit result, etc.

The guides are now highly contextual, for example, when looking at a villager L2 would be annotated by "Trade" instead of the default "Interact".

Because facts can be data-driven, third party mods and servers can integrate with Controlify without code.

@isXander
isXander requested a balanced review from Copilot August 21, 2026 15:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

📖 Documentation preview

Preview: https://pr-972-controlify.isxander.workers.dev

Updated for 094a8621c88b7ca520aac40e5e15839a3cc1ad51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 114 out of 114 changed files in this pull request and generated 12 comments.

Suppressed comments (5)

src/main/java/dev/isxander/controlify/contextual/RuleSetManager.java:144

  • Same logging issue here: the caught exception is currently being used to fill the '{}' placeholder, so you lose the stack trace in logs. Put placeholder args first and pass the Throwable last.
    src/main/java/dev/isxander/controlify/contextual/ContextualDomainImpl.java:129
  • The exception is being passed as a formatting parameter, so the stack trace is dropped. Swap the argument order so the domain id fills the '{}' placeholder and the Throwable is last.
    src/main/java/dev/isxander/controlify/contextual/ContextualDomainImpl.java:159
  • Same logging issue: the Throwable is currently treated as a message argument, so you won't get a stack trace in logs. Pass the domain id first and the exception last.
    src/main/java/dev/isxander/controlify/contextual/ContextualDomainImpl.java:186
  • This warn log also passes the exception as a placeholder argument, which drops the stack trace. Put the fact/domain arguments first and the Throwable last.
    src/main/java/dev/isxander/controlify/driver/sdl/SDLCommonDriver.java:195
  • Typo in exception message: "require it's already closed" should be "when it's already closed".

Comment on lines +104 to +110
CUtil.LOGGER.error(
"Failed to load contextual {} rules for domain '{}' from pack '{}'; skipping this layer",
e,
this.directory,
domainId,
ruleSetResource.sourcePackId()
);
Comment thread src/main/java/dev/isxander/controlify/virtualmouse/VirtualMouseHandler.java Outdated
Comment thread src/main/java/dev/isxander/controlify/utils/JsonTreeParser.java Outdated
Comment thread src/main/java/dev/isxander/controlify/utils/DummyMixinTarget.java Outdated
Comment thread src/main/java/dev/isxander/controlify/screenop/ScreenProcessor.java Outdated
Comment thread src/main/java/dev/isxander/controlify/contextual/Rule.java Outdated
Comment thread src/main/java/dev/isxander/controlify/driver/sdl/SDLCommonDriver.java Outdated
Comment thread src/main/java/dev/isxander/controlify/Controlify.java Outdated
Comment on lines +103 to +108
CUtil.LOGGER.error(
"Failed to load contextual facts for domain '{}' from pack '{}'; skipping this layer",
e,
this.id,
resource.sourcePackId()
);
@isXander
isXander merged commit 0ede093 into main Aug 21, 2026
8 checks passed
@isXander
isXander deleted the feat/fact-domains branch August 21, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants