Skip to content

feat: add addi-decisioning plugin with validating-decisioning-e2e-tests skill - #47

Closed
mcsanchez-addi wants to merge 1 commit into
Factory-AI:masterfrom
mcsanchez-addi:feat/add-addi-decisioning-plugin
Closed

feat: add addi-decisioning plugin with validating-decisioning-e2e-tests skill#47
mcsanchez-addi wants to merge 1 commit into
Factory-AI:masterfrom
mcsanchez-addi:feat/add-addi-decisioning-plugin

Conversation

@mcsanchez-addi

Copy link
Copy Markdown

What

Adds a new plugin addi-decisioning that ships the validating-decisioning-e2e-tests skill.

Given a Notion page URL that lists Decisioning E2E test scenarios (rows with application-id, expected Offers result, and allyName), the skill:

  1. Extracts every row from the Notion page via the Notion MCP.
  2. Queries originations_v3_sas.legacy_loan_application on the staging Aurora cluster through a local port-forward (localhost:15432) using AWS RDS IAM auth.
  3. Evaluates each case against a fixed rulebook:
    • APR bands: STANDARD_BELOW_USURY (< 0.3), LBL_BAND (> 0.4), ZERO (= 0/null).
    • Guarantee: FGA, FGA 0.00 (rate=0/null), NONE.
    • Learning population: LP, non-LP.
    • IDV tokens (HARD_IDV, SOFT_IDV, PHONE_VERIFICATION, EMAIL_VERIFICATION, HIGH_SCRUTINY, VALIDATION_CALL) — allyName presence only.
    • Rejections: REJECTED_BY_HARDCUTS / REJECTED_BY_POLICY (status must be NULL or REJECTED).
    • allyName substring check on the raw JSONB.
  4. Prints a per-row Case | Application ID | Expected | Status | Verdict table plus a failure breakdown.
  5. On explicit user confirmation, writes the ✅ / ❌ verdict back into the Notion Result column via notion-update-page.

Why

Every Decisioning deploy today requires manually clicking through ~12 Notion rows per phase and running JSONB lookups by hand. This skill turns the whole batch into a single command, standardizes the ruleset (APR bands, FGA vs NONE guarantee, LP/non-LP, IDV tokens, rejection statuses), and produces an auditable verdict per row.

Layout

plugins/addi-decisioning/
├── .factory-plugin/plugin.json
├── README.md
└── skills/
    └── validating-decisioning-e2e-tests/
        └── SKILL.md
skills/validating-decisioning-e2e-tests -> ../plugins/addi-decisioning/skills/validating-decisioning-e2e-tests

Follows the same shape as every other plugin (security-engineer, debugging, code-review, etc.). Registered in .factory-plugin/marketplace.json under category qa and cross-linked from the root README.md.

Safety

  • Read-only DB access — never issues INSERT/UPDATE/DELETE.
  • Never edits Notion without explicit user confirmation — presents the verdict table first.
  • Never persists the RDS IAM token — passed inline via PGPASSWORD and unset after the query.
  • Fails loud on missing/expired token — asks the user for a fresh one instead of falling back to other credentials.

Install / Invoke

droid plugin marketplace add https://github.com/Factory-AI/factory-plugins
droid plugin install addi-decisioning@factory-plugins

Auto-activates when the user pastes a decisioning-e2e-quickpay-* Notion URL, or explicit via /validating-decisioning-e2e-tests.

Testing done

  • Ran end-to-end against the Phase 2 (12 cases) and Phase 3 (10 cases) Notion pages on staging. Produced correct pass/fail verdicts; edge cases (missing loan/creditCheck nodes for REJECTED_BY_* scenarios, FGA 0.00 interpretation) are exercised in the rulebook.
  • The skill previously lived in the AdelanteFinancialHoldings/platform monorepo under ai-native-backend-jvm/.agents/skills/ and is being upstreamed here unchanged.

@andriperalt andriperalt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Update CODEOWNERS so that Decisioning team owns the plugin

…ts skill

Adds a new Addi-specific plugin under `plugins/addi-decisioning/` that ships
the `validating-decisioning-e2e-tests` skill. Given a Notion page URL that
lists decisioning E2E test scenarios, the skill queries the staging
`legacy_loan_application` JSONB rows over a local port-forward using AWS RDS
IAM auth, applies a fixed rulebook (APR bands, guarantee provider/rate,
learning population, IDV tokens, rejection statuses, allyName presence), and
prints a per-row verdict table before optionally writing the results back
into the Notion `Result` column.

- New plugin metadata + README under `plugins/addi-decisioning/`.
- SKILL.md under `plugins/addi-decisioning/skills/validating-decisioning-e2e-tests/`.
- Top-level `skills/validating-decisioning-e2e-tests` symlink following the
  same pattern as every other skill in this marketplace.
- Registered in `.factory-plugin/marketplace.json` with category `qa`.
- Cross-linked from the root `README.md`.

Read-only against the DB. Never edits Notion without explicit user
confirmation. Never persists the RDS IAM token.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@mcsanchez-addi
mcsanchez-addi force-pushed the feat/add-addi-decisioning-plugin branch from 3d88746 to ac6c9b9 Compare September 4, 2026 14:55
@mcsanchez-addi

Copy link
Copy Markdown
Author

Done in ac6c9b9 — added .github/CODEOWNERS assigning plugins/addi-decisioning/ and the top-level skill symlink to @AdelanteFinancialHoldings/decisioning-approvers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why are you leaving this here outside the plugin?

@mcsanchez-addi

Copy link
Copy Markdown
Author

Closing in favor of https://github.com/AdelanteFinancialHoldings/factory-addi-plugins/pull/39 — Addi is landing this plugin in the org-internal marketplace instead.

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