From b73f2554cfe78f55a67c298a82794cf0c91270db Mon Sep 17 00:00:00 2001 From: jellespijker Date: Thu, 4 Jun 2026 12:47:43 +0200 Subject: [PATCH] [UC-3697] Setup pre-commit and agentic enablement for CuraFormulaeEngine --- .github/CODEOWNERS | 17 + .github/PULL_REQUEST_TEMPLATE.md | 6 + .github/copilot-instructions.md | 22 + .../accessibility-auditor.instructions.md | 16 + .../code-reviewer.instructions.md | 30 + .../gha-helper.instructions.md | 34 + .../pr-assistant.instructions.md | 60 + .../testing-automation.instructions.md | 16 + .github/dependabot.yml | 23 + .github/services/account-api.yaml | 164 + .github/services/account-frontend.yaml | 36 + .github/services/account-worker.yaml | 115 + .github/services/lab.env | 26 + .github/services/production.env | 25 + .github/services/staging.env | 25 + .github/workflows/build.yaml | 52 + .github/workflows/combine.yaml | 8 + .github/workflows/dependabot.yaml | 15 + .github/workflows/deploy.yaml | 53 + .github/workflows/lab-delete.yaml | 33 + .github/workflows/lab-deploy.yaml | 40 + .github/workflows/pull-request.yaml | 80 + .github/workflows/test.yaml | 69 + .pre-commit-config.yaml | 66 + .talismanrc | 42 + AGENTS.md | 130 + apps/cmdline_parser/cmdline_parser.cpp | 67 +- include/cura-formulae-engine/ast/ast.h | 201 +- .../ast/binary_expr/add_expr.h | 17 +- .../ast/binary_expr/and_expr.h | 17 +- .../ast/binary_expr/binary_expr.h | 33 +- .../ast/binary_expr/div_expr.h | 17 +- .../ast/binary_expr/mod_expr.h | 17 +- .../ast/binary_expr/mul_expr.h | 17 +- .../ast/binary_expr/or_expr.h | 17 +- .../ast/binary_expr/pow_expr.h | 13 +- .../ast/binary_expr/sub_expr.h | 17 +- .../ast/comp_chain_expr.h | 77 +- .../cura-formulae-engine/ast/condition_expr.h | 33 +- include/cura-formulae-engine/ast/expr_ptr.h | 48 +- .../ast/fn_application_expr.h | 42 +- include/cura-formulae-engine/ast/index_expr.h | 31 +- .../ast/list_comprehension_expr.h | 57 +- include/cura-formulae-engine/ast/list_expr.h | 37 +- .../ast/primary_expr/bool_expr.h | 8 +- .../ast/primary_expr/float_expr.h | 8 +- .../ast/primary_expr/int_expr.h | 8 +- .../ast/primary_expr/none_expr.h | 13 +- .../ast/primary_expr/primary_expr.h | 57 +- .../ast/primary_expr/string_expr.h | 10 +- include/cura-formulae-engine/ast/slice_expr.h | 40 +- include/cura-formulae-engine/ast/tuple_expr.h | 35 +- .../ast/unary_expr/neg_expr.h | 18 +- .../ast/unary_expr/not_expr.h | 18 +- .../ast/unary_expr/unary_expr.h | 30 +- .../cura-formulae-engine/ast/variable_expr.h | 24 +- include/cura-formulae-engine/config.h | 12 +- include/cura-formulae-engine/env/abs.h | 3 +- include/cura-formulae-engine/env/all.h | 3 +- include/cura-formulae-engine/env/any.h | 5 +- include/cura-formulae-engine/env/env.h | 3 +- include/cura-formulae-engine/env/float_fn.h | 3 +- include/cura-formulae-engine/env/int_fn.h | 3 +- include/cura-formulae-engine/env/len.h | 3 +- include/cura-formulae-engine/env/map.h | 3 +- include/cura-formulae-engine/env/math_atan.h | 3 +- include/cura-formulae-engine/env/math_ceil.h | 3 +- include/cura-formulae-engine/env/math_cos.h | 3 +- .../cura-formulae-engine/env/math_degrees.h | 3 +- include/cura-formulae-engine/env/math_floor.h | 3 +- include/cura-formulae-engine/env/math_log.h | 3 +- .../cura-formulae-engine/env/math_radians.h | 3 +- include/cura-formulae-engine/env/math_sin.h | 3 +- include/cura-formulae-engine/env/math_sqrt.h | 3 +- include/cura-formulae-engine/env/math_tan.h | 3 +- include/cura-formulae-engine/env/max.h | 3 +- include/cura-formulae-engine/env/min.h | 3 +- include/cura-formulae-engine/env/round.h | 3 +- include/cura-formulae-engine/env/str.h | 3 +- include/cura-formulae-engine/env/sum.h | 3 +- include/cura-formulae-engine/eval.h | 178 +- .../parser/bool_grammar.h | 31 +- .../parser/expr_grammar.h | 35 +- .../parser/list_comprehension_grammar.h | 85 +- .../parser/list_grammar.h | 51 +- .../parser/math_expr_grammar.h | 152 +- .../parser/nested_grammar.h | 10 +- .../parser/none_grammar.h | 11 +- .../parser/number_grammar.h | 29 +- .../parser/parens_grammar.h | 36 +- include/cura-formulae-engine/parser/parser.h | 10 +- .../parser/string_grammar.h | 88 +- .../parser/variable_grammar.h | 18 +- ...cation_grammar_or_array_indexing_grammar.h | 235 +- src/ast/ast.cpp | 122 +- src/ast/binary_expr/add_expr.cpp | 22 +- src/ast/binary_expr/and_expr.cpp | 22 +- src/ast/binary_expr/binary_expr.cpp | 78 +- src/ast/binary_expr/div_expr.cpp | 22 +- src/ast/binary_expr/mod_expr.cpp | 22 +- src/ast/binary_expr/mul_expr.cpp | 22 +- src/ast/binary_expr/or_expr.cpp | 22 +- src/ast/binary_expr/pow_expr.cpp | 14 +- src/ast/binary_expr/sub_expr.cpp | 22 +- src/ast/comp_chain_expr.cpp | 399 +- src/ast/condition_expr.cpp | 78 +- src/ast/expr_ptr.cpp | 46 +- src/ast/fn_application_expr.cpp | 128 +- src/ast/index_expr.cpp | 75 +- src/ast/list_comprehension_expr.cpp | 302 +- src/ast/list_expr.cpp | 99 +- src/ast/primary_expr/string_expr.cpp | 8 +- src/ast/slice_expr.cpp | 270 +- src/ast/tuple_expr.cpp | 99 +- src/ast/unary_expr/neg_expr.cpp | 21 +- src/ast/unary_expr/not_expr.cpp | 21 +- src/ast/unary_expr/unary_expr.cpp | 53 +- src/ast/variable_expr.cpp | 44 +- src/env/abs.cpp | 42 +- src/env/all.cpp | 26 +- src/env/any.cpp | 26 +- src/env/env.cpp | 64 +- src/env/float_fn.cpp | 46 +- src/env/int_fn.cpp | 70 +- src/env/len.cpp | 25 +- src/env/map.cpp | 58 +- src/env/math_atan.cpp | 32 +- src/env/math_ceil.cpp | 39 +- src/env/math_cos.cpp | 32 +- src/env/math_degrees.cpp | 16 +- src/env/math_floor.cpp | 47 +- src/env/math_log.cpp | 81 +- src/env/math_radians.cpp | 16 +- src/env/math_sin.cpp | 47 +- src/env/math_sqrt.cpp | 47 +- src/env/math_tan.cpp | 47 +- src/env/max.cpp | 61 +- src/env/min.cpp | 61 +- src/env/round.cpp | 77 +- src/env/str.cpp | 55 +- src/env/sum.cpp | 41 +- src/eval.cpp | 1085 ++-- src/parser/parser.cpp | 22 +- tests/parser.cpp | 4581 +++++++++-------- 144 files changed, 6545 insertions(+), 5492 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/copilot-instructions.md create mode 100644 .github/copilot-instructions/accessibility-auditor.instructions.md create mode 100644 .github/copilot-instructions/code-reviewer.instructions.md create mode 100644 .github/copilot-instructions/gha-helper.instructions.md create mode 100644 .github/copilot-instructions/pr-assistant.instructions.md create mode 100644 .github/copilot-instructions/testing-automation.instructions.md create mode 100644 .github/dependabot.yml create mode 100644 .github/services/account-api.yaml create mode 100644 .github/services/account-frontend.yaml create mode 100644 .github/services/account-worker.yaml create mode 100644 .github/services/lab.env create mode 100644 .github/services/production.env create mode 100644 .github/services/staging.env create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/combine.yaml create mode 100644 .github/workflows/dependabot.yaml create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/lab-delete.yaml create mode 100644 .github/workflows/lab-deploy.yaml create mode 100644 .github/workflows/pull-request.yaml create mode 100644 .github/workflows/test.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 .talismanrc create mode 100644 AGENTS.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..893994f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,17 @@ +# Generally we can assume these file extensions belongs to a group of developers +*.scss @Stardust_frontend +*.tsx @Stardust_frontend +*.js @Stardust_frontend +*.html @Stardust_frontend +*.py @Stardust_backend + +# These root files are very specific to development environments +/docker-compose.yml @Stardust_devops +Dockerfile @Stardust_devops +/*.md @Stardust + +# These directories are about: frontend, backend and github administration +/frontend/ @Stardust_frontend +/backend/ @Stardust_backend +/.github/ @Stardust_devops +/secrets/ @Stardust_devops diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7ec0e36 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,6 @@ +Jira ticket: UC-XXX + +- [ ] Describe the changes that were made and why +- [ ] Add screenshot +- [ ] Unit tests +- [ ] E2E tests diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..cb300c1 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,22 @@ +# GitHub Copilot Custom Instructions + +Welcome! This configuration coordinates our multi-role coding assistant system to ensure that all generated code, documentation, and tests comply with UltiMaker Digital Factory's rigorous engineering quality standards for the **stardust-account** (Cura Cloud identity and login portal) stack. + +## Role-Based Personas + +Depending on the context of your query, please adopt one of our 5 specialized development personas: + +1. **[PR Assistant](.github/copilot-instructions/pr-assistant.instructions.md):** Focuses on managing branch tracking, bracketed Jira commit naming standards, and generating structured, descriptive pull request details. +2. **[GHA Helper](.github/copilot-instructions/gha-helper.instructions.md):** Focuses on building secure, optimized, and cached GitHub Actions pipelines. +3. **[Code Reviewer](.github/copilot-instructions/code-reviewer.instructions.md):** Focuses on reviewing architectural patterns (SOLID, DRY, KISS), checking for static bugs or lints, and enforcing compact files (around 300 lines, max 400 is acceptable, but prefer smaller). +4. **[Accessibility Auditor](.github/copilot-instructions/accessibility-auditor.instructions.md):** Focuses on reviewing and generating WCAG 2.1 AA compliant UI templates, keyboard navigation, and landmark groupings for our SSO and account portal pages. +5. **[Testing Automation](.github/copilot-instructions/testing-automation.instructions.md):** Focuses on pytest async tests, Jest unit assertions, and non-flaky browser automation with Cypress. + +--- + +## Strategic Principles + +- **Future AI Optimization:** Write clean, modular files (around 300 lines, max 400 is acceptable, but prefer smaller) with single-responsibility structures. This keeps context sizes minimal, limits token overhead, and reduces compilation time for succeeding AI agents. +- **Secure by Design:** Actively mitigate OWASP Top 10 vulnerabilities (NoSQL injection, insecure endpoints). Secure user credentials (argon2/bcrypt), handle MFA/TOTP safely, and never log/expose PII. +- **Experimental Guardrails:** Never commit manual tests, scratch files, or test scripts. All experiment work belongs in the gitignored `scratch/` directory. +- **Design Tokens Compliance:** Align frontend logic strictly with token values mapped in `DESIGN.md` (HSL colors, typography scales, layout rhythm). \ No newline at end of file diff --git a/.github/copilot-instructions/accessibility-auditor.instructions.md b/.github/copilot-instructions/accessibility-auditor.instructions.md new file mode 100644 index 0000000..69e214d --- /dev/null +++ b/.github/copilot-instructions/accessibility-auditor.instructions.md @@ -0,0 +1,16 @@ +# Role: Accessibility Auditor (Copilot Instruction) + +You are the Accessibility Auditor. Your primary directive is to ensure that all user interface modifications, components, and templates in the **stardust-account** login, SSO, and profile management portal conform to WCAG 2.1 AA guidelines. + +## 1. Core Structural Semantic Audit + +- Verify that logical landmark tags (`
`, `