==================================================
 STORYGEN AI — STORY EXPORT
==================================================
Story ID:           29
Title:              Contract Management Solution v1 via File upload
Owner:              Salil Mhatre - Associate Director <salil@lithan.com>
App Type:           Agentic AI App
Input Type:         file
Status:             features_generated
Source File:        Contract Management Solution v1 via Story Builder.pdf
Created:            2026-04-29 10:08:45 UTC
Updated:            2026-04-30 01:37:50 UTC
Features Generated: 2026-04-29 10:10:24 UTC
Total Clusters:     8
Total Features:     18

--- ORIGINAL INPUT ---

KC
Karen Corporal - Compliance Manager
Compliance Manager · Apr 29, 2026
Draft Public Edit Generate AI Delete
User Story Feature Specs Questionnaire
Process Overview
PROCESS NAME
Student Contract Execution
BUSINESS DOMAIN
Legal & Compliance
DEPARTMENT
Admission
PROCESS FREQUENCY
Multiple times a day
PROCESS OBJECTIVE
To execute student contracts via the CRM system for learner e-signature, including
dynamic content customisation based on learner profile data extracted from CRM, and
ensure secure storage and archival of signed contract copies for compliance and
record-keeping purposes.
CURRENT PROCESS DESCRIPTION
* Retrieve student details directly from HubSpot CRM, including key attributes such as
age, citizenship, residency status, and course selection. * Apply predefined business
logic rules to automatically evaluate and determine the most suitable funding eligibility
(e.g., government subsidies, grants, or non-funded pricing) based on the learner’s
profile. * Dynamically populate and customise contract content using CRM-extracted
data to ensure accuracy, consistency, and relevance for each learner. * Configure and
maintain multiple contract templates to support different funding types, delivery modes,
and learner categories. * Automatically trigger the appropriate contract template
selection based on funding outcomes and learner segmentation logic. * Enable
automated workflow routing to send contracts for approval and e-signature to multiple
signatories or stakeholders (e.g., learner, compliance, finance) based on predefined
approval rules. * Automate email and system notifications to keep relevant parties
informed at each stage of the contract lifecycle, including creation, approval, signing,
and completion. * Support end-to-end contract generation, including automated creation
of finalised agreements once all required approvals and signatures are completed. *
Ensure signed contracts are securely stored and archived for compliance, audit
readiness, and future retrieval.
Contract Management Solution v1 via Story Builder
Stories / Contract Management Solution v1 via Stor...
New Story
4/29/26, 5:00 PM	Contract Management Solution v1 via Story Builder — AI-Powered App Builder
https://story.claas2saas.com/UserStory/stories/4	1/7


Pain Points & Goals
PAIN POINTS
• Data accuracy and completeness in CRM Incomplete or inconsistent learner data (e.g.,
missing residency status or incorrect citizenship fields) can lead to wrong funding
eligibility decisions and incorrect contract generation. • Complexity of funding rules
logic Funding eligibility rules (age, citizenship, residency, scheme eligibility) can become
complex and difficult to maintain, especially when policies change frequently or have
exceptions. • Template management Maintaining multiple contract templates for different
funding types, delivery modes, and learner segments increases the risk of version
mismatch, duplication, or outdated clauses. • Incorrect template selection risk If
segmentation logic or automation rules are not properly configured, the system may
trigger the wrong contract template, leading to compliance or financial implications. •
Integration dependency between systems Ensuring seamless and reliable
synchronisation with HubSpot CRM, while maintaining flexibility and compatibility for
potential future CRM platforms. • Approval workflow bottlenecks Multiple signatories
(learner, compliance, finance, etc.) can delay turnaround time if approvers do not
respond promptly or if routing rules are not optimised. • Notification overload or gaps
Poorly configured email/notification rules may result in missed alerts or excessive
notifications, reducing efficiency and user responsiveness. • Audit trail and compliance
risk If version control, approval logs, or signed document archiving are not tightly
governed, it may create compliance and audit challenges. • Operational dependency on
rule configuration Small changes in eligibility rules or templates often require technical or
admin intervention, limiting business agility.
DESIRED OUTCOMES
• End-to-end automation of contract generation Contracts are automatically created
using CRM data, reducing manual effort and improving turnaround time. • Accurate and
consistent contract creation Learner contracts are dynamically populated with validated
CRM data, ensuring correctness and reducing human error. • Automated funding
eligibility determination Learner profiles are assessed using predefined rules to ensure
correct and compliant funding allocation. • Standardised yet flexible contract templates
Multiple templates are centrally managed and automatically selected based on funding
type, delivery mode, and learner category. • Seamless multi-party approval and e-
signature workflow Contracts are efficiently routed to learners and internal stakeholders
(e.g., compliance, finance) for approval and signature without delays. • Improved
operational efficiency and turnaround time Reduced manual intervention leads to faster
contract processing from creation to completion. • Reliable system integration with CRM
and contract platform Stable synchronisation with HubSpot (and future CRM systems)
ensures continuous data flow and scalability. • Automated communication and visibility
Relevant stakeholders receive timely notifications at each stage of the contract lifecycle.
• Secure storage and audit-ready archiving Signed contracts are automatically stored in
a structured and secure repository for compliance and easy retrieval. • Automated
reporting and insights generation Real-time and scheduled reports are generated to
provide visibility on contract status, funding distribution, approval timelines, and
operational performance, supporting data-driven decision-making. • Scalable and
future-proof solution The solution can adapt to changes in funding rules, contract
structures, and CRM platforms without major rework.
SUCCESS METRICS
• Contract turnaround time Average time taken from contract generation to final
signature (target: reduced significantly vs baseline). • Automation rate of contract
creation Percentage of contracts generated automatically via CRM-triggered workflows
4/29/26, 5:00 PM	Contract Management Solution v1 via Story Builder — AI-Powered App Builder
https://story.claas2saas.com/UserStory/stories/4	2/7


(target: near full automation). • Funding accuracy rate Percentage of contracts correctly
assigned the appropriate funding type without manual correction or rework. • Template
selection accuracy Percentage of contracts using the correct template based on learner
segmentation and funding logic. • E-signature completion rate Percentage of contracts
successfully completed via e-signature without manual intervention or re-routing. •
Approval cycle time Average time taken for internal stakeholders (compliance, finance,
etc.) to approve contracts. • System integration reliability Uptime and success rate of
data synchronisation between HubSpot (and future CRM systems) and the contract
platform. • Error / exception rate Number of contracts requiring manual correction due to
data, logic, or system issues. • Notification effectiveness Percentage of stakeholders
receiving and acting on notifications within expected timelines. • Document retrieval
time Average time required to locate and retrieve signed contracts from the archive
system. • Reporting accuracy and timeliness Percentage of reports generated correctly
and delivered on schedule without manual intervention. • User satisfaction (internal
stakeholders) Feedback scores from users (e.g., admissions, compliance, finance) on
ease of use and efficiency of the system.
CONSTRAINTS
• Dependence on CRM data quality The accuracy of contract generation and funding
eligibility depends heavily on complete and correct data in HubSpot CRM. • Integration
dependency and system compatibility Current design is dependent on HubSpot
integration, and future CRM changes may require reconfiguration or redevelopment of
data mappings and workflows. • Complexity of funding rules maintenance Frequent
changes in government funding policies or eligibility criteria may require continuous
updates to the business logic engine. • Template governance and version control
Managing multiple contract templates increases the risk of version inconsistencies if
proper governance is not enforced. • System configuration dependency (Juro
workflows) Workflow changes (approvals, routing, templates) may require administrative
or technical updates, limiting full business self-service. • Stakeholder availability for
approvals Contract turnaround is partially dependent on timely responses from learners
and internal approvers (finance, compliance). • Data privacy and compliance
requirements Handling of personal data (age, citizenship, residency) must comply with
PDPA and other regulatory requirements, limiting data usage and storage flexibility. •
Scalability of automation rules As business rules become more complex, maintaining
performance and clarity of logic may become challenging. • Change management and
user adoption Users may require training and adaptation time to fully transition from
manual or semi-manual contract processes to an automated system.
Users & Stakeholders
PRIMARY USERS
• Sales Team Initiates contract creation by triggering student contract in CRM and
ensuring all required learner details are captured correctly. • Admission / Compliance
Team Ensures contract templates, funding rules, and execution processes meet
regulatory and audit requirements. • Learners (Students) Primary external signatories
who review, accept, and electronically sign the student contract.
SECONDARY USERS
• Finance Team Reviews funding eligibility outcomes, validates pricing or subsidy
application, and approves financial-related contract components where required. •
Academic / Programme Team (where applicable) Supports validation of programme-
4/29/26, 5:00 PM	Contract Management Solution v1 via Story Builder — AI-Powered App Builder
https://story.claas2saas.com/UserStory/stories/4	3/7


related details in contracts such as course structure, delivery mode, and intake
information.
ESTIMATED USERS
50
Workflow & Process Steps
PROCESS STEPS
Step 1. Student data capture in CRM Learner information (e.g., age, citizenship,
residency status, course selection) is captured and maintained in HubSpot CRM. Step 2.
Trigger contract creation Once a learner reaches the eligible stage (e.g., gold stage), the
contract workflow is automatically triggered from CRM. Step 3. Funding eligibility
evaluation Business rules are applied to assess the learner profile and determine the
appropriate funding type (e.g., subsidy, grant, or self-funded). Step 4. Template
selection and mapping The system automatically selects the correct contract template
based on funding outcome, delivery mode, and learner category. Step 5. Dynamic
contract generation Contract content is auto-populated using CRM data to ensure
accuracy, consistency, and personalization for each learner. Step 6. Internal review and
approval routing The contract is routed through predefined approval workflows (e.g.,
admission) for validation where required. Step 7. Learner e-signature request The
contract is sent to the learner via email for electronic signature, along with instructions
and notifications. Step 8. Multi-party signature completion Additional required
stakeholders (if applicable) complete their e-signatures in sequence or parallel based on
workflow rules (e.g., parent / guardian). Step 9. Final contract generation Once all
approvals and signatures are completed, the system generates the final executed
contract. Step 10. Secure storage and archival The signed contract is automatically
stored in a secure repository for compliance, audit, and future retrieval. Step 11.
Notification of completion Relevant stakeholders are notified that the contract process
has been completed successfully. Step 12. Reporting and tracking update Contract
status, timelines, and funding details are updated in reporting dashboards for monitoring
and analysis.
DECISION POINTS
Here is the updated Decision Points & Business Rules with your requested changes: •
Learner eligibility determination Business rules evaluate learner attributes (age,
citizenship, residency status, and prior qualifications) to determine eligibility for available
funding schemes. • Funding type assignment Based on eligibility rules, the system
assigns the appropriate funding category (e.g., government subsidy, partial subsidy, or
full fee-paying). • Course and intake validation Ensures the selected course, intake date,
and delivery mode are valid, active, and aligned with approved programme offerings. •
Contract template selection logic Automatically selects the correct contract template
based on a combination of: o Funding type o Course delivery mode (e.g., blended or e-
learning) o Learner category (e.g., local, PR, international) • Pricing and fee calculation
rules Automatically calculates tuition fees based on funding eligibility, subsidies applied,
and any applicable promotional adjustments. • Admission approval routing rules All
contract requests are automatically routed for admission approval before progression to
contract issuance. • Multi-signatory routing rules Defines the required signing parties
and workflow sequence, which may include: o Learner (primary signatory) o Parent or
guardian (mandatory if learner is below legal age threshold, e.g., below 18 years old) •
Exception handling rules Flags cases that do not meet standard criteria for manual
review (e.g., missing documentation, borderline eligibility, or system validation failures).
4/29/26, 5:00 PM	Contract Management Solution v1 via Story Builder — AI-Powered App Builder
https://story.claas2saas.com/UserStory/stories/4	4/7


• Contract finalisation conditions Contract is only marked as complete when all required
approvals and e-signatures (including guardian where applicable) are successfully
captured. • Data validation rules Ensures all mandatory learner and course fields from
CRM are complete and accurate before contract generation proceeds.
APPROVAL WORKFLOWS
• Trigger Contract process is automatically initiated from CRM once learner information
is complete and enrolment is ready (e.g., Gold stage). • Generate Contract System
automatically generates the contract using the appropriate template based on learner
profile, funding eligibility, and course details. • E-Check (Validation) System performs
automated validation of learner data, funding eligibility, and course details to ensure
completeness and accuracy. • Approval Admission Team’s approval is obtained based
on predefined business rules (e.g., funding, pricing, and compliance requirements). •
Sent for Signature Contract is routed for e-signature to the learner, and parent/guardian
(if applicable).
Data & Information
DATA INPUTS
• Learner personal information Full name, date of birth, age, nationality, citizenship,
residency status, identification details (e.g., NRIC/FIN/passport), education level and
work experience. • Contact details Email address, mobile number, residential address,
and emergency contact information. • Course enrolment details Selected
course/programme, intake date, delivery mode (blended or e-learning), schedule, and
study duration. • Funding and eligibility information Age-based eligibility,
citizenship/residency-based funding classification, subsidy type, grant eligibility, and fee
category (e.g., subsidised or full fee-paying). • Guardian/parent details (if applicable)
Name, relationship to learner, identification details (e.g., NRIC/FIN/passport), and contact
information • Contract and billing information Contract type, pricing breakdown, fees
after subsidy, payment terms, and billing schedule. • System-generated metadata CRM
stage (e.g., Gold stage), contract ID, timestamps, workflow status, approval logs, and
audit trail information.
DATA OUTPUTS
• Executed student contracts Fully completed and signed digital contracts (including
learner, and parent/guardian where applicable). • Contract status tracking records Real-
time status updates showing contract progress (e.g., triggered, in approval, pending
signature, completed, archived). • Audit trail and activity logs Detailed logs of all actions
taken, including data changes, approvals, validations, and signature timestamps for
compliance purposes. • Funding eligibility records Documentation of funding decisions,
including eligibility classification, subsidy type applied, and justification rules used. •
Approval records Records of admission and internal approvals, including approver
details, timestamps, and decision outcomes. • Learner contract archive repository
Securely stored final contracts and historical versions for retrieval, audit, and regulatory
inspection. • Operational performance reports Metrics such as contract turnaround time,
approval duration, and processing efficiency. • Automation and workflow reports
Insights into system performance, including automation success rates, failure points, and
exception cases. • Financial and pricing reports Breakdown of fees, subsidies applied,
net payable amounts, and funding utilisation. • Management dashboards Consolidated
views of contract pipeline status, learner enrolment progress, and operational KPIs for
decision-making.
DATA SOURCES
4/29/26, 5:00 PM	Contract Management Solution v1 via Story Builder — AI-Powered App Builder
https://story.claas2saas.com/UserStory/stories/4	5/7


CRM
DATA RETENTION
Retain for a minimum of 7 years for compliance, audit, and dispute resolution purposes.
Integrations & Systems
EXISTING SYSTEMS
HubSpot, Juro, SMS
INTEGRATION REQUIREMENTS
HubSpot, SMS
AI & Automation
AI FEATURES DESIRED
• AI-powered contract status tracking Provides real-time, plain-language updates on
where each contract is in the lifecycle (e.g., “Pending admission approval”, “Awaiting
learner signature”, “Completed and archived”). • AI summary reporting dashboard
Automatically generates weekly or monthly summaries of contract activity, including
volume, completion rates, and bottlenecks. • AI exception and delay alerts Identifies and
highlights contracts that are delayed or stuck in a workflow stage, with simple
explanations of the cause. • Natural language reporting (Ask the system) Allows users to
query status reports in plain English (e.g., “How many contracts are pending approval
this week?”) and receive instant summaries.
AUTOMATION OPPORTUNITIES
• Learner data retrieval from CRM Automatically pull learner details (personal, course,
enrolment stage) from HubSpot once eligibility stage is reached. • Funding eligibility
assessment Auto-apply business rules to determine funding type based on age,
citizenship, residency status, and other criteria. • Contract template selection
Automatically select the correct contract template based on funding outcome, course
type, and learner category. • Contract generation and data population Auto-populate
contracts with learner-specific data to generate a ready-to-review agreement. •
Validation (E-checks) Automatically validate required fields, data completeness, and
eligibility rules before progressing to approval. • Admission and internal approval routing
Automatically route contracts to admission, finance, and compliance approvers based on
predefined rules. • Multi-party e-signature workflow Automatically send contracts for
signature to learners, internal stakeholders, and parent/guardian (if applicable). •
Notifications and reminders Automated alerts for approvals, pending signatures, and
overdue actions to keep the process moving. • Contract status updates Real-time
automatic updates in CRM and contract system as the document progresses through
each stage. • Archiving of signed contracts Automatically store fully executed contracts
in a secure repository with proper tagging and indexing. • Reporting generation
Automated creation of dashboards and reports on contract status, turnaround time,
funding distribution, and bottlenecks.
NEEDS NLP
Yes
NEEDS PREDICTIONS
Yes
NEEDS RECOMMENDATIONS
4/29/26, 5:00 PM	Contract Management Solution v1 via Story Builder — AI-Powered App Builder
https://story.claas2saas.com/UserStory/stories/4	6/7


Yes
Non-Functional Requirements
PLATFORM
Web only
PERFORMANCE
System should support at least 50 simultaneous contract generations and approvals
without performance degradation.
SECURITY
Role based access control
COMPLIANCE
All student contracts for SSG courses must strictly use the “9a_standard-pei-student-
contract-version-4-0” template without any unauthorised changes to mandatory
clauses, structure, or regulatory wording.
REPORTING
• Contract lifecycle dashboard Provides real-time visibility of contracts across all stages
(triggered, validation, approval, signature, completed, archived). • Contract volume and
throughput reports Tracks number of contracts generated, processed, and completed
within a defined period (daily, weekly, monthly). • Approval performance reports Tracks
approval efficiency by department or approver, including bottlenecks and average
response times. • Compliance and audit reports Provides audit-ready records of
contracts, approvals, funding decisions, and system activities aligned with SSG
requirements.
NOTIFICATIONS
• Approval request notifications Automatically notify approvers (admissions, finance,
compliance) when a contract is ready for review and action is required. • Reminder
notifications Automated reminders for pending actions such as outstanding approvals or
unsigned contracts to prevent workflow delays. • Contract completion notification Notify
all relevant parties once the contract is fully signed and successfully executed.
Timeline & Priority
PROJECT PRIORITY
High
EXPECTED GO-LIVE
15 May 2026
Created:Apr29202608:59AMViews:0	StoryID:#4
4/29/26, 5:00 PM	Contract Management Solution v1 via Story Builder — AI-Powered App Builder
https://story.claas2saas.com/UserStory/stories/4	7/7

--- USER STORY ---
# Agentic Student Contract Execution & E-Signature Platform

## Overview
This is an **Agentic AI App** that automates the end-to-end execution of student enrolment contracts for a Private Education Institution. Autonomous agents pull learner data from HubSpot CRM, determine funding eligibility, select and populate the correct contract template, route the document through approvals and multi-party e-signature (via Juro), and archive the executed contract — while keeping humans informed and in the loop only when judgement, exception handling, or regulatory sign-off is required.

## Actors
- **Sales Representative** (human, primary): Captures and maintains learner information in HubSpot; advances the deal to the eligible ("Gold") stage to trigger contract creation.
- **Admission / Compliance Officer** (human, primary): Reviews flagged exceptions, approves contracts where required, and governs templates and funding rules.
- **Finance Officer** (human, secondary): Validates pricing, subsidies, and fee structures when escalated.
- **Academic / Programme Officer** (human, secondary): Validates programme/intake details when flagged.
- **Learner** (human, external): Reviews and e-signs the contract.
- **Parent / Guardian** (human, external, conditional): Co-signs when learner is below 18.
- **Data Intake Agent** (AI): Polls HubSpot for learners reaching Gold stage, retrieves and validates learner data, and flags missing/inconsistent fields.
- **Eligibility & Funding Agent** (AI): Applies business rules (age, citizenship, residency, prior qualifications, course) to determine funding category and tuition fee, with reasoning trace.
- **Template Selection Agent** (AI): Chooses the correct contract template based on funding type, delivery mode, and learner category — enforcing the SSG-mandated `9a_standard-pei-student-contract-version-4-0` template where applicable.
- **Contract Generation Agent** (AI): Dynamically populates the chosen template via Juro, runs an automated E-Check validation pass, and prepares the contract for routing.
- **Approval & Signature Orchestrator Agent** (AI): Routes the contract to the correct approvers and signatories in the correct sequence, sends notifications/reminders via email and SMS, and tracks status.
- **Archival & Compliance Agent** (AI): Stores the executed contract in the secure repository with proper indexing, updates CRM, and writes the audit trail.
- **Insights Agent** (AI, NLP-enabled): Answers natural-language status queries, generates summary dashboards, and proactively raises delay/exception alerts.

## Goals
- Achieve near full automation of student contract generation, signature, and archival.
- Reduce contract turnaround time from CRM trigger to fully executed contract.
- Ensure 100% compliance with SSG and PDPA requirements, including correct template usage.
- Improve funding eligibility accuracy and eliminate manual rework caused by data or template errors.
- Provide real-time, plain-language visibility on contract status to all stakeholders.
- Build a scalable solution that adapts to changing funding rules and future CRM platforms.

## User Story
As an **Admission/Compliance Manager**, I want **autonomous AI agents to generate, validate, route, sign, and archive student contracts using CRM data**, so that **contracts are executed quickly and accurately, compliance and audit obligations are met, and my team only intervenes on genuine exceptions**.

## Detailed Workflow

1. **Trigger detection (Data Intake Agent)** — Continuously monitors HubSpot for learners reaching the "Gold" stage. On detection, retrieves the learner record (personal, contact, course, guardian, funding-related fields).
2. **Data validation (Data Intake Agent)** — Runs completeness and consistency checks on mandatory fields (NRIC/FIN/passport, citizenship, residency, course, intake, guardian if minor). If gaps or inconsistencies are detected, the agent **stops and escalates** to the Sales Rep with a precise list of missing/invalid fields rather than guessing.
3. **Eligibility & funding determination (Eligibility & Funding Agent)** — Applies the rules engine to determine funding category (government subsidy, partial subsidy, self-funded), calculates fees and subsidies, and produces a reasoning trace (which rule fired, which inputs were used). Borderline or unrecognised cases are flagged for Compliance review.
4. **Course & intake validation (Eligibility & Funding Agent)** — Confirms the selected course, intake, and delivery mode are active and approved. Mismatches are routed to the Academic/Programme Officer.
5. **Template selection (Template Selection Agent)** — Chooses the correct contract template based on funding type × delivery mode × learner category. For SSG-funded courses, the agent **must** select `9a_standard-pei-student-contract-version-4-0` and is blocked from modifying mandatory clauses.
6. **Contract generation (Contract Generation Agent)** — Generates the contract in Juro, dynamically populating learner, guardian, course, fee, and funding data. Runs an automated **E-Check** for field completeness, clause integrity, and rule alignment.
7. **Hand-off to humans for approval (Approval & Signature Orchestrator Agent)** — Routes the contract to the Admission Team for approval per business rules; auto-escalates to Finance/Compliance when triggered (e.g., subsidy edge case). Sends contextual notifications with a one-click action link.
8. **E-signature routing** — Once approved, the contract is sent to the Learner for e-signature. If the learner is a minor, the Parent/Guardian is added to the signing sequence. Email and SMS notifications and reminders are auto-dispatched per a defined cadence.
9. **Status tracking & nudges (Insights Agent)** — Detects stalls (e.g., approval pending > X hours, signature pending > Y days) and proactively notifies the responsible party or escalates. Users can ask the agent natural-language questions such as "How many contracts are pending approval this week?" and get an instant answer.
10. **Finalisation (Contract Generation Agent)** — Once all approvals and signatures are captured, generates the final executed PDF contract.
11. **Archival & CRM sync (Archival & Compliance Agent)** — Stores the executed contract in the secure repository, indexed by learner ID, course, intake, and funding type. Updates HubSpot with contract status, links, and key timestamps. Writes the immutable audit trail.
12. **Completion notifications** — All relevant stakeholders (learner, Sales, Admission, Finance) are notified that the contract has been fully executed and archived.
13. **Reporting (Insights Agent)** — Generates real-time dashboards and scheduled summary reports (volume, turnaround, bottlenecks, funding distribution, compliance) and surfaces predictive insights (e.g., contracts likely to miss SLA).

## Acceptance Criteria

**Functional**
- The system automatically retrieves learner data from HubSpot when a deal reaches Gold stage, with no manual trigger required.
- Funding eligibility is determined by the Eligibility & Funding Agent for ≥ 95% of cases without human intervention, with a documented reasoning trace.
- The correct contract template is auto-selected based on funding type, delivery mode, and learner category; SSG-funded contracts always use `9a_standard-pei-student-contract-version-4-0`.
- Contracts are auto-populated, validated via E-Check, and routed for approval and e-signature in Juro without manual handoff.
- Multi-party signing supports learner + parent/guardian (mandatory if learner is < 18) in the correct sequence.
- Email and SMS notifications fire at trigger, approval-needed, signature-needed, reminder, completion, and exception events.
- Executed contracts are archived in a secure repository with retention of at least 7 years.
- Users can query contract status in plain English and receive accurate, real-time answers.
- Dashboards display contract lifecycle, volumes, approval performance, and compliance metrics.

**Agent guardrails, escalation & stop conditions**
- **Stop on incomplete data**: The Data Intake Agent must not generate a contract if any mandatory field is missing or invalid; it escalates to the Sales Rep with a specific gap list.
- **Stop on template ambiguity**: If the Template Selection Agent cannot deterministically select a single template, it escalates to the Admission Team rather than guessing.
- **Stop on regulated template tampering**: Agents are forbidden from modifying mandatory SSG clauses; any attempted deviation halts the workflow and raises a compliance alert.
- **Eligibility confidence threshold**: If the Eligibility & Funding Agent's rule evaluation confidence falls below threshold, or hits a defined exception (borderline age, ambiguous residency), it escalates to Compliance.
- **Human-in-the-loop approval**: Final admission approval is always performed by a human; agents may recommend but not approve.
- **Reasoning trace**: Every agent decision (eligibility, template, routing) must be logged with inputs, rules applied, and timestamp for audit.
- **Stall detection**: Insights Agent must flag any contract idle in a stage beyond defined SLA and notify a human owner.
- **No silent failures**: Any integration error (HubSpot, Juro, SMS) must surface a visible alert to an admin within 5 minutes.
- **PDPA compliance**: Agents access only the fields required for the task; no learner data is sent to external models without approval.

**Non-functional**
- Web platform supports ≥ 50 concurrent contract generations and approvals without degradation.
- Role-based access control governs all human and agent actions.
- Audit logs are immutable and queryable.

## Assumptions & Constraints
- HubSpot is the source of truth for learner data; data quality directly impacts agent accuracy.
- Juro is the contract generation and e-signature platform; SMS gateway handles mobile notifications.
- Funding rules will evolve; the rules engine must be configurable by Compliance with minimal technical involvement.
- Solution must comply with PDPA and SSG regulatory requirements, including mandatory template use.
- Initial deployment scoped to ~50 internal users (Sales, Admission, Compliance, Finance, Programme).
- Target go-live: **15 May 2026**; priority: **High**.
- Future CRMs may replace HubSpot, so agent integrations should be abstracted to ease migration.
- Users will require training and change-management support to transition from semi-manual processes.

--- FEATURE LIST SUMMARY ---
This solution enables a Private Education Institution to autonomously generate, validate, route, sign, and archive student enrolment contracts using AI agents that pull data from HubSpot and orchestrate signing through Juro. Primary actors include the Sales Representative, Admission/Compliance Officer, Finance Officer, Academic/Programme Officer, Learner, and Parent/Guardian, supported by Data Intake, Eligibility & Funding, Template Selection, Contract Generation, Approval & Signature Orchestrator, Archival & Compliance, and Insights agents. The flow runs from CRM trigger detection through eligibility, template selection, e-signature, archival, and reporting. Master Data Configuration holds users, roles, programmes, funding rules, templates, and notification settings. The list contains 18 features covering autonomous contract execution, compliance guardrails, and real-time insights.

Feature Clusters & Features:
• Master Data Configuration
  - 1. User, Role & Access Management — Defines internal users, roles, and permissions for sales, admission, compliance, finance, and programme staff across the platform.
  - 2. Programme, Course & Intake Catalog — Master registry of approved programmes, courses, intakes, and delivery modes referenced during eligibility and contract generation.
  - 3. Funding Rules & Fee Configuration — Configurable rules engine for funding categories, subsidies, and tuition fees maintained by Compliance with minimal IT involvement.
  - 4. Contract Template Library — Repository of approved contract templates including the mandatory SSG `9a_standard-pei-student-contract-version-4-0` template with locked clauses.
  - 5. Notification & SLA Configuration — Central settings for email/SMS templates, reminder cadence, and SLA thresholds used by the orchestration and insights agents.
• CRM Trigger & Data Intake
  - 6. HubSpot Gold-Stage Trigger Detection — Continuously polls HubSpot for deals reaching Gold stage to autonomously initiate the contract execution workflow.
  - 7. Learner Data Validation & Gap Escalation — Validates completeness and consistency of learner data and escalates precise gap lists to the Sales Rep when mandatory fields are missing.
• Eligibility & Funding Determination
  - 8. Automated Funding Eligibility Evaluation — Applies configured rules to determine funding category and fees with a full reasoning trace for audit and review.
  - 9. Course & Intake Validation — Confirms the chosen course, intake, and delivery mode are active and routes mismatches to the Academic/Programme Officer.
  - 10. Compliance Exception Escalation — Flags borderline or low-confidence eligibility cases to the Compliance Officer for human judgement before proceeding.
• Contract Template Selection & Generation
  - 11. Deterministic Template Selection — Selects the correct template based on funding type, delivery mode, and learner category, enforcing SSG-mandated templates.
  - 12. Dynamic Contract Generation & E-Check — Populates the chosen Juro template with learner data and runs automated checks for field completeness and clause integrity.
• Approval Routing
  - 13. Multi-Tier Approval Orchestration — Routes contracts to Admission, Finance, or Compliance approvers per business rules with one-click contextual action links.
• E-Signature Execution
  - 14. Multi-Party E-Signature Routing — Sends contracts for learner and, where required, parent/guardian e-signature via Juro in the correct sequence.
  - 15. Notification & Reminder Dispatch — Fires email and SMS notifications and reminders at trigger, approval, signature, completion, and exception events.
• Archival & CRM Sync
  - 16. Executed Contract Archival — Stores fully executed PDF contracts in a secure repository indexed by learner, course, intake, and funding type with 7-year retention.
  - 17. CRM Update & Immutable Audit Trail — Synchronises contract status and links back to HubSpot and writes immutable audit logs of every agent and human action.
• Insights, Monitoring & Agent Orchestration
  - 18. Natural-Language Insights, Dashboards & Stall Detection — Answers plain-language status queries, surfaces dashboards, and proactively flags SLA breaches and integration failures.

--- FEATURE LIST (18 features across 8 clusters) ---

#1 | Cluster: Master Data Configuration | Feature: User, Role & Access Management
  Description: Central authority for managing human and agent identities, roles, and access permissions across the platform. Ensures every action is governed by RBAC and traceable in the audit log.
  Workflow:
    1. Admin creates user accounts for sales, admission, compliance, finance, programme staff.
    2. Admin assigns roles and permission scopes.
    3. RBAC policy is enforced across UI and APIs.
    4. Agents authenticate using service identities tied to roles.
    5. Access changes are logged for audit.
  Table:       users_roles
  Columns:     id (bigint, pk), full_name (varchar 200), email (varchar 200), role_code (varchar 50), department (varchar 100), is_active (boolean), created_at (timestamp), updated_at (timestamp)
  Actor:       System Administrator
  AI Agent:    None
  ----
#2 | Cluster: Master Data Configuration | Feature: Programme, Course & Intake Catalog
  Description: Master registry of approved programmes, courses, intakes, and delivery modes. Used by agents to validate learner course selection and populate contract terms.
  Workflow:
    1. Programme Officer creates programmes and courses.
    2. Adds intakes with start/end dates and delivery mode.
    3. Marks courses active or inactive.
    4. Catalog is exposed to Eligibility Agent for validation.
    5. Changes are versioned for audit.
  Table:       programme_catalog
  Columns:     id (bigint, pk), programme_code (varchar 50), course_name (varchar 200), intake_code (varchar 50), start_date (date), delivery_mode (varchar 30), is_active (boolean), updated_at (timestamp)
  Actor:       Academic / Programme Officer
  AI Agent:    None
  ----
#3 | Cluster: Master Data Configuration | Feature: Funding Rules & Fee Configuration
  Description: Configurable rules engine driving funding category determination and fee calculation. Allows Compliance to evolve rules without code changes.
  Workflow:
    1. Compliance Officer defines rule conditions (age, citizenship, residency, course).
    2. Maps rules to funding categories and subsidy amounts.
    3. Sets fee schedules per programme and intake.
    4. Activates rule version with effective dates.
    5. Eligibility Agent loads active rule set at runtime.
  Table:       funding_rules
  Columns:     id (bigint, pk), rule_code (varchar 50), conditions_json (json), funding_category (varchar 50), subsidy_amount (decimal 12,2), fee_amount (decimal 12,2), effective_from (date), is_active (boolean)
  Actor:       Admission / Compliance Officer
  AI Agent:    None
  ----
#4 | Cluster: Master Data Configuration | Feature: Contract Template Library
  Description: Repository of approved contract templates with metadata used to deterministically pick the right template. Locked clauses enforce SSG and PDPA compliance.
  Workflow:
    1. Compliance uploads contract templates with metadata (funding type, mode, learner category).
    2. Marks SSG-mandated template `9a_standard-pei-student-contract-version-4-0` and locks mandatory clauses.
    3. Defines merge fields and clause map.
    4. Activates template version.
    5. Template Selection Agent reads catalog deterministically.
  Table:       contract_templates
  Columns:     id (bigint, pk), template_code (varchar 100), funding_type (varchar 50), delivery_mode (varchar 30), learner_category (varchar 50), is_ssg_mandatory (boolean), juro_template_id (varchar 100), version (varchar 20), is_active (boolean)
  Actor:       Admission / Compliance Officer
  AI Agent:    None
  ----
#5 | Cluster: Master Data Configuration | Feature: Notification & SLA Configuration
  Description: Central settings for messaging templates, reminder cadence, and SLA thresholds. Drives consistent notifications and stall detection.
  Workflow:
    1. Admin defines event types (trigger, approval, signature, reminder, exception).
    2. Configures email and SMS templates per event.
    3. Sets SLA thresholds and reminder cadence.
    4. Maps recipients by role.
    5. Configuration is consumed by orchestrator and insights agents.
  Table:       notification_config
  Columns:     id (bigint, pk), event_code (varchar 50), channel (varchar 20), template_body (text), recipient_role (varchar 50), sla_hours (int), reminder_interval_hours (int), is_active (boolean)
  Actor:       System Administrator
  AI Agent:    None
  ----
#6 | Cluster: CRM Trigger & Data Intake | Feature: HubSpot Gold-Stage Trigger Detection
  Description: Continuously detects when a learner deal reaches Gold stage in HubSpot and initiates the autonomous contract workflow without manual intervention.
  Workflow:
    1. Data Intake Agent polls HubSpot for deals at Gold stage.
    2. Retrieves the learner record and associated fields.
    3. Creates a contract execution case in the platform.
    4. Logs trigger event with timestamp.
    5. Hands off to validation step.
  Table:       contract_cases
  Columns:     id (bigint, pk), hubspot_deal_id (varchar 100), learner_id (varchar 100), trigger_at (timestamp), current_stage (varchar 50), status (varchar 30), created_at (timestamp)
  Actor:       Data Intake Agent
  AI Agent:    Data Intake Agent
  ----
#7 | Cluster: CRM Trigger & Data Intake | Feature: Learner Data Validation & Gap Escalation
  Description: Ensures learner data is complete and consistent before contract generation. Stops on incomplete data and escalates a precise gap list to the Sales Rep.
  Workflow:
    1. Agent validates mandatory fields (NRIC/FIN, citizenship, course, guardian if minor).
    2. Runs consistency checks across fields.
    3. If complete, advances case to eligibility stage.
    4. If gaps detected, halts workflow and emails Sales Rep with specific gap list.
    5. Logs validation outcome to audit trail.
  Table:       data_validation_logs
  Columns:     id (bigint, pk), case_id (bigint, fk), field_name (varchar 100), validation_status (varchar 30), error_message (varchar 500), validated_at (timestamp), escalated_to (varchar 100)
  Actor:       Data Intake Agent
  AI Agent:    Data Intake Agent
  ----
#8 | Cluster: Eligibility & Funding Determination | Feature: Automated Funding Eligibility Evaluation
  Description: Applies the configured rules engine to determine funding category and fees with a full reasoning trace. Targets ≥95% straight-through processing without human input.
  Workflow:
    1. Agent loads active funding rule set.
    2. Evaluates learner attributes against rules.
    3. Determines funding category, subsidy, and fee.
    4. Records reasoning trace (rules fired, inputs, confidence).
    5. Advances case or escalates if confidence below threshold.
  Table:       eligibility_decisions
  Columns:     id (bigint, pk), case_id (bigint, fk), funding_category (varchar 50), subsidy_amount (decimal 12,2), fee_amount (decimal 12,2), confidence_score (decimal 5,2), reasoning_trace (json), decided_at (timestamp)
  Actor:       Eligibility & Funding Agent
  AI Agent:    Eligibility & Funding Agent
  ----
#9 | Cluster: Eligibility & Funding Determination | Feature: Course & Intake Validation
  Description: Confirms the selected course, intake, and delivery mode are active and approved. Routes mismatches to the Academic/Programme Officer for resolution.
  Workflow:
    1. Agent compares learner's selected course/intake to active catalog.
    2. Verifies delivery mode is approved.
    3. If valid, advances case.
    4. If mismatch, routes to Programme Officer with details.
    5. Logs the validation result.
  Table:       course_validation_logs
  Columns:     id (bigint, pk), case_id (bigint, fk), course_code (varchar 50), intake_code (varchar 50), delivery_mode (varchar 30), validation_status (varchar 30), assigned_to (varchar 100), validated_at (timestamp)
  Actor:       Eligibility & Funding Agent
  AI Agent:    Eligibility & Funding Agent
  ----
#10 | Cluster: Eligibility & Funding Determination | Feature: Compliance Exception Escalation
  Description: Routes ambiguous or low-confidence eligibility cases to Compliance for human judgement. Ensures regulatory edge cases are never auto-decided by agents.
  Workflow:
    1. Agent detects borderline cases (age, ambiguous residency) or low confidence.
    2. Creates an exception record with context.
    3. Notifies Compliance Officer via email.
    4. Pauses workflow until human decision.
    5. Resumes workflow with Compliance verdict captured in audit trail.
  Table:       compliance_exceptions
  Columns:     id (bigint, pk), case_id (bigint, fk), exception_type (varchar 50), context_json (json), assigned_to (varchar 100), status (varchar 30), resolution_note (text), resolved_at (timestamp)
  Actor:       Admission / Compliance Officer
  AI Agent:    Eligibility & Funding Agent
  ----
#11 | Cluster: Contract Template Selection & Generation | Feature: Deterministic Template Selection
  Description: Selects the correct contract template deterministically based on funding type, delivery mode, and learner category. Halts on ambiguity to prevent silent template errors.
  Workflow:
    1. Agent reads funding type, delivery mode, learner category.
    2. Queries template library for matching active template.
    3. Enforces SSG-mandatory template where applicable.
    4. If multiple or no matches, halts and escalates to Admission Team.
    5. Records selected template_id and reasoning.
  Table:       template_selections
  Columns:     id (bigint, pk), case_id (bigint, fk), template_id (bigint, fk), match_reason (text), is_ssg_locked (boolean), selected_at (timestamp), escalated (boolean)
  Actor:       Template Selection Agent
  AI Agent:    Template Selection Agent
  ----
#12 | Cluster: Contract Template Selection & Generation | Feature: Dynamic Contract Generation & E-Check
  Description: Generates the contract in Juro with dynamic data and validates it through automated E-Check. Prevents tampering with mandatory SSG clauses.
  Workflow:
    1. Agent invokes Juro API with chosen template and merge data.
    2. Populates learner, guardian, course, fee, and funding fields.
    3. Runs E-Check for completeness, clause integrity, rule alignment.
    4. If E-Check fails, raises alert and halts.
    5. If passed, advances to approval routing.
  Table:       generated_contracts
  Columns:     id (bigint, pk), case_id (bigint, fk), juro_contract_id (varchar 100), template_id (bigint, fk), echeck_status (varchar 30), echeck_report (json), generated_at (timestamp)
  Actor:       Contract Generation Agent
  AI Agent:    Contract Generation Agent
  ----
#13 | Cluster: Approval Routing | Feature: Multi-Tier Approval Orchestration
  Description: Routes contracts through human approvers per business rules with contextual notifications. Final admission approval remains a human-in-the-loop decision.
  Workflow:
    1. Orchestrator determines approval chain based on rules.
    2. Sends contract to Admission approver with one-click action link.
    3. Auto-escalates to Finance/Compliance on triggers (e.g., subsidy edge case).
    4. Captures approver decisions and comments.
    5. Advances to e-signature only after all approvals secured.
  Table:       contract_approvals
  Columns:     id (bigint, pk), contract_id (bigint, fk), approver_user_id (bigint, fk), approval_level (varchar 30), decision (varchar 20), comments (text), decided_at (timestamp)
  Actor:       Admission / Compliance Officer
  AI Agent:    Approval & Signature Orchestrator Agent
  ----
#14 | Cluster: E-Signature Execution | Feature: Multi-Party E-Signature Routing
  Description: Routes the approved contract to learners and, when applicable, parents/guardians for e-signature in the correct sequence. Handles minors via mandatory co-signing.
  Workflow:
    1. Orchestrator builds signing sequence (learner first, then guardian if minor).
    2. Sends signature requests via Juro.
    3. Tracks signing status per party.
    4. Triggers reminders per cadence.
    5. On completion, retrieves executed PDF.
  Table:       signature_requests
  Columns:     id (bigint, pk), contract_id (bigint, fk), signer_role (varchar 30), signer_email (varchar 200), signer_phone (varchar 30), sequence_no (int), status (varchar 30), signed_at (timestamp)
  Actor:       Learner / Parent / Guardian
  AI Agent:    Approval & Signature Orchestrator Agent
  ----
#15 | Cluster: E-Signature Execution | Feature: Notification & Reminder Dispatch
  Description: Sends contextual email and SMS notifications and reminders across the contract lifecycle. Ensures stakeholders act promptly without manual chasing.
  Workflow:
    1. Orchestrator listens for workflow events.
    2. Resolves recipients and templates from notification config.
    3. Sends email and SMS through configured gateways.
    4. Schedules reminders per cadence until action taken.
    5. Logs each dispatch with delivery status.
  Table:       notification_log
  Columns:     id (bigint, pk), case_id (bigint, fk), event_code (varchar 50), channel (varchar 20), recipient (varchar 200), status (varchar 30), sent_at (timestamp), error_message (varchar 500)
  Actor:       Approval & Signature Orchestrator Agent
  AI Agent:    Approval & Signature Orchestrator Agent
  ----
#16 | Cluster: Archival & CRM Sync | Feature: Executed Contract Archival
  Description: Stores executed contracts securely with structured indexing and 7-year retention. Provides quick retrieval for audit and compliance reviews.
  Workflow:
    1. Agent retrieves final executed PDF from Juro.
    2. Indexes by learner ID, course, intake, funding type.
    3. Stores in secure repository with 7-year retention policy.
    4. Verifies file integrity (hash check).
    5. Marks case as archived.
  Table:       contract_archive
  Columns:     id (bigint, pk), contract_id (bigint, fk), learner_id (varchar 100), course_code (varchar 50), funding_type (varchar 50), storage_path (varchar 500), file_hash (varchar 128), retention_until (date), archived_at (timestamp)
  Actor:       Archival & Compliance Agent
  AI Agent:    Archival & Compliance Agent
  ----
#17 | Cluster: Archival & CRM Sync | Feature: CRM Update & Immutable Audit Trail
  Description: Synchronises executed contract status back to HubSpot and persists an immutable audit trail of every action. Supports regulatory and internal audits.
  Workflow:
    1. Agent updates HubSpot deal with contract status, archive link, and timestamps.
    2. Writes immutable audit entries for every agent and human action in the case.
    3. Notifies all stakeholders of completion.
    4. Closes the case in workflow.
    5. Surfaces audit log for queryable review.
  Table:       audit_trail
  Columns:     id (bigint, pk), case_id (bigint, fk), actor_type (varchar 30), actor_id (varchar 100), action (varchar 100), payload_json (json), timestamp (timestamp), hash_chain (varchar 128)
  Actor:       Archival & Compliance Agent
  AI Agent:    Archival & Compliance Agent
  ----
#18 | Cluster: Insights, Monitoring & Agent Orchestration | Feature: Natural-Language Insights, Dashboards & Stall Detection
  Description: Provides plain-language status answers, real-time dashboards, predictive SLA alerts, and integration error detection. Keeps stakeholders informed and surfaces issues fast.
  Workflow:
    1. Insights Agent ingests case, approval, signature, and notification data.
    2. Monitors SLA timers and detects stalls or integration errors.
    3. Sends proactive alerts to responsible owners and admins.
    4. Renders dashboards on volume, turnaround, bottlenecks, compliance.
    5. Answers natural-language status questions for users.
  Table:       insights_metrics
  Columns:     id (bigint, pk), metric_code (varchar 50), case_id (bigint, fk), metric_value (decimal 12,2), sla_breached (boolean), alert_sent (boolean), captured_at (timestamp)
  Actor:       Admission / Compliance Officer
  AI Agent:    Insights Agent
  ----

==================================================
 END OF STORY EXPORT
==================================================
