RulesCraft
Creator: sagasys technology group
RulesCraft is a VS Code extension for editing Oracle Policy Modeling (OPM / OPA) rule documents using embedded WordCraft and GridCraft editors, with local Oracle compilation and validation.
Proof of concept - early alpha. Use at your own risk. This is experimental software, not production-ready or an Oracle-supported replacement for Policy Modeling. Editing, saving, formatting, validation, or navigation may fail or behave unexpectedly. Work on copies, keep independent backups, and review saved documents and compiler results in OPM before relying on them. No warranty or guarantee of correctness is provided.
Basic functionality
- Edit DOCX rules in WordCraft and XLSX rules in GridCraft inside VS Code.
- Apply existing OPM paragraph and cell styles.
- Save documents and validate them with your locally installed Oracle compiler.
- Build an OPM project and revisit errors through build output and VS Code Problems.
- Find cached attribute usages, with proof-first results, formatted previews, and navigation to the source.
- Create a DOCX rule document using your locally installed OPM Word template.
- Open an
.xprj project dashboard with Overview, Validation, and Settings tabs.
- Save and validate open rule documents in that project. Configuration opens Workspace settings by default.
Requirements
- Windows with VS Code 1.85 or later.
- A local Oracle Policy Modeling installation; development/testing used 26B.
- A local OPM project with an
.xprj file and rule documents.
Microsoft Word and Excel are not required for the implemented editing/build workflow. Oracle software and private policy documents are not included.
Install and get started
- In VS Code, open Extensions, select ... > Install from VSIX..., and choose the supplied RulesCraft VSIX. Reload VS Code if prompted.
- Open the folder containing a copy of your OPM project. Trust the workspace only if you trust its contents.
- Open its
.xprj file to show the dashboard. Under Settings > Configure workspace, check Oracle Build Path points to your installed OPMBuild.exe. The default is C:\Program Files (x86)\Oracle\Policy Modeling\26B\bin\OPMBuild.exe.
- Open a DOCX or XLSX rule file. If necessary, use Reopen Editor With... > WordCraft / GridCraft.
- Save your edits, validate the document, or use the dashboard's Save all and validate action. Build OPM compiles saved files.
The Command Palette also provides RulesCraft: Select OPM Project, Open Rule Document in VS Code, Add New Rule Document, and Build Policy Model.
Important alpha limitations
- Save/validate from the dashboard includes only open WordCraft/GridCraft documents inside that project's folder, not every rule document.
- Attribute usage search reads the project's existing
bin XGEN cache. Save and compile in OPM to refresh it. RulesCraft's temporary builds/validation do not update that cache.
- With Oracle Build Path configured, usage search loads Oracle's dependency model on an isolated project snapshot, then reconstructs previews only for candidate documents. Oracle DLLs are resolved beside the configured
OPMBuild.exe; no separate dependency path or Java installation is needed. This currently uses internal Oracle 26B APIs and reports incompatible installations explicitly. The snapshot protects project files from Oracle's implicit metadata writes. Without a configured compiler path, search reports that it used the slower full-cache scan.
- Usage identities include the entity's canonical reference or declared name plus the attribute's base text. Numeric model IDs and document-local attribute IDs are not used to join attributes across documents. Oracle's escaped source control characters are preserved when reading caches; DTDs and external XML entities remain disabled.
- Previews reconstruct cached rule formatting; they are not exact reproductions of all Word/Excel layout features.
- Existing OPM styles are required; arbitrary Office features and complete round-trip fidelity are not guaranteed.
- GridCraft's native Format Painter destination interaction is not wired up; use Paste Special > Formats instead.
- Settings retain their original
opaCraft.* identifiers. Use Workspace scope for project-specific configuration.
- The project dashboard does not rewrite
.xprj XML. Use Open project XML or Reopen Editor With... > Text Editor for direct edits.
Graphics troubleshooting
WordCraft needs a usable WebGPU or WebGL2 device inside VS Code. A graphics driver reset, remote-desktop setup, acceleration settings, or context exhaustion can interrupt an editor even when just one document is open.
If graphics fail before the document loads, use Retry editor or Try WebGL2 in the error panel. For a persistent alternative, set opaCraft.wordRenderer to webgl in Workspace settings, then close and reopen WordCraft. The default auto retains automatic backend selection. Changing the setting does not reload open documents.
If the graphics context is lost during editing, try Save / Ctrl+S and wait for confirmation before closing or restarting. RulesCraft does not automatically reload the editor or discard edits; saving/recovery may not be possible after a GPU failure. Keep independent backups. Diagnostic details appear under View > Output > RulesCraft Graphics. Do not disable hardware acceleration as a blanket fix: the embedded editor still needs a working graphics backend.
Credits
RulesCraft embeds patched WordCraft and GridCraft 0.7.0 runtimes. Their MIT and Apache-2.0 license files are included in the runtime archives. Bundled dependency notices are provided in THIRD-PARTY-NOTICES.txt.
RulesCraft is an independent proof of concept by sagasys technology group. It is not affiliated with or endorsed by Oracle or the upstream editor projects.