Add rule authoring/editing UI backed by the rule-drafts API#403
Draft
julietshen wants to merge 2 commits into
Draft
Add rule authoring/editing UI backed by the rule-drafts API#403julietshen wants to merge 2 commits into
julietshen wants to merge 2 commits into
Conversation
New ui-api blueprint for authoring SML rule drafts from the UI: - /rule-drafts/source, /validate, /vocabulary, /submit, /pending, /parse-into-builder, all gated by a new CAN_EDIT_RULE_DRAFTS ability - Drafts are spliced into the engine's loaded sources and re-run through the same AST validation the engine uses, both on validate and again server-side on submit - Submission routes through a RuleSubmissionBackend Protocol selected by OSPREY_RULES_SUBMISSION_BACKEND: github (opens a PR via the REST API, supports GitHub Enterprise), local (writes to a mounted rules dir), and null (fail-fast default so an unconfigured install never writes) - Adopter docs for the env vars in docs/user/manage.md Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VZ4RQtuHCCgurfpjfPXXAM
New RuleEditorPage at /rules/new and /rules/edit?path=<file>: - Rule Builder view: form-based conditions and outcomes compiled to SML client-side, with vocabulary (features, UDFs, effects) fetched from the engine; falls back to a plain Code Editor view for any SML the builder subset can't represent (decided via /parse-into-builder) - Live validation against the engine's AST validator with a 600ms debounce, structured inline errors, and a missing-imports quick fix - Submit posts the draft to /rule-drafts/submit and surfaces the resulting review URL; RulesPage gains an Add rule button, per-rule Edit links, and a pending-drafts banner fed by /rule-drafts/pending Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VZ4RQtuHCCgurfpjfPXXAM
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Stacked on #402. Review that first; this PR's diff will show #402's commits until it merges.
Adds a RuleEditorPage at
/rules/newand/rules/edit?path=<file>, built on the rule-drafts API./rule-drafts/parse-into-builder; files outside the builder's subset fall back to the Code Editor./rule-drafts/submitand surfaces the review URL returned by the configured backend./rule-drafts/pending(soft-fails when no backend is configured).Security/correctness hardening in the SML generator: backslashes and newlines are escaped (not just quotes) before interpolation, the rule name is constrained to an SML identifier before it reaches the generated file and the submit gate, and switching between Builder and Code Editor now carries content across so a tab flip can't submit stale or empty source.
Checklist
pnpm run typecheck,pnpm run lint(0 errors),pnpm run format:checkpassCHANGELOG.md