Add rag-eval module: retrieval metrics, golden dataset and a JUnit regression gate

hit@k, recall@k, precision@k, MRR and nDCG@k in plain Java with their edge
cases pinned by tests, a 30-question graded golden dataset over a 40-passage
runbook, a paired bootstrap, and a gate (baseline + tolerance + no new misses)
shown failing on a tokenizer that drops digits. BM25, a hashed-trigram vector
(not a neural embedding) and RRF; no model, no network. Java 25, JUnit 6.1.3.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7F47n8shUHpexxavn
This commit is contained in:
Ankur
2026-11-25 13:20:18 +05:30
co-authored by Claude Sonnet 5.5
parent 0bb301d361
commit 98ed878675
43 changed files with 1385 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
p01 To reset a forgotten password, open the sign-in page, choose Forgot password and enter your work email. A reset link is emailed and stays valid for 30 minutes.
p02 Resetting two-factor authentication requires a helpdesk ticket. An agent verifies your identity by video call before removing the registered authenticator.
p03 After five failed sign-in attempts the account is locked for 15 minutes. Locked accounts unlock automatically and no ticket is needed.
p04 On Windows, install the VPN client from the software portal, import the profile file and connect to the gateway vpn-eu.example.net. Error VPN-619 means the profile has expired.
p05 On macOS the VPN client needs its system extension approved in System Settings under Privacy and Security before the first connection. Without approval the tunnel never starts.
p06 Split tunnelling sends only corporate subnets through the VPN. Internet traffic uses your local connection, which keeps video calls fast.
p07 Production databases are backed up nightly at 02:00 UTC and retained for 35 days. Weekly full backups are kept for one year.
p08 To restore a database, open a restore request naming the backup timestamp and the target instance. A restore into the production instance needs approval from the data owner.
p09 Error E-4012 during a backup means the snapshot volume ran out of space. Expand the volume or delete expired snapshots, then rerun the job.
p10 Deployments to production run through the release pipeline. A change needs one approving review and a green build before the deploy button is enabled.
p11 To roll back a release, redeploy the previous tagged version from the pipeline. Database migrations are not reverted automatically.
p12 No production deployments happen during a change freeze, which is announced in the engineering channel. Emergency fixes need director approval.
p13 If the primary database fails, the replica is promoted automatically within about 60 seconds. Applications reconnect through the cluster endpoint, not the instance address.
p14 Error E-5003, too many connections, means the pool exceeds the server limit of 200. Reduce the pool size per instance or add a connection pooler.
p15 Replica lag above 30 seconds raises an alert. Long-running reports on the replica are the usual cause; move them to the analytics cluster.
p16 TLS certificates are issued for 90 days and renewed automatically 30 days before expiry. A renewal failure alert means the DNS challenge record is missing.
p17 Mobile apps pin the intermediate certificate. Changing the certificate authority requires an app release before the switch.
p18 The public API allows 600 requests per minute per key. Requests beyond that receive HTTP 429 with a Retry-After header.
p19 To raise a rate limit, file a request with the expected traffic and the business reason. Increases above 3000 requests per minute need architecture review.
p20 API keys should be rotated every 90 days. Rotation creates a second key so clients can switch without downtime, and the old key is revoked after 7 days.
p21 Invoices are generated on the first day of each month and emailed to the billing contact. Payment terms are 30 days.
p22 Refunds for annual plans are prorated by unused full months. Monthly plans are not refunded.
p23 Upgrading a plan takes effect immediately and the price difference is prorated for the rest of the billing period.
p24 The on-call engineer acknowledges a page within 5 minutes. With no acknowledgement the page escalates to the secondary and then to the engineering manager.
p25 Sev1 means a customer-facing outage or data loss, Sev2 is major degradation and Sev3 is minor impact with a workaround. Sev1 requires a status page update within 15 minutes.
p26 A blameless postmortem is written within five working days of a Sev1 or Sev2 incident and reviewed in the weekly operations meeting.
p27 Application logs are kept hot for 14 days and archived for one year. Audit logs are kept for seven years.
p28 Do not log email addresses, card numbers or access tokens. The log pipeline masks card numbers, but other personal data passes through unchanged.
p29 Customers can request an export of their personal data. The export is produced within 30 days and delivered as a zip of JSON files.
p30 Deleting an account removes personal data within 30 days. Backups age out on their normal schedule, so deleted data can persist in backups for up to 35 days.
p31 New laptops are ordered through the IT portal. Delivery takes five working days and developers can choose between a 14-inch and a 16-inch model.
p32 Report a lost or stolen laptop to security immediately. The device is wiped remotely and disk encryption makes the data unreadable.
p33 Expenses under 50 euros need no receipt. Larger expenses require a receipt uploaded within 30 days.
p34 Annual leave requests are submitted in the HR system and approved by your manager. Leave of more than ten consecutive days also needs approval from the department head.
p35 Feature flags are managed in the flag console. A flag must have an owner and an expiry date, and flags past their expiry are reported weekly.
p36 Canary releases send 5 percent of traffic to the new version for 30 minutes. If the error rate rises above 1 percent the pipeline aborts the rollout.
p37 Messages that fail processing five times go to the dead-letter queue. Inspect the dead-letter queue daily; messages are deleted after 14 days.
p38 The shared cache evicts keys with a least-recently-used policy once memory reaches 80 percent. Keys without a TTL are never expired on their own.
p39 DNS records have a TTL of 300 seconds. Lower the TTL to 60 seconds a day before a planned migration.
p40 Secrets live in the vault, never in source control. A secret found in a repository must be rotated immediately, even if the commit is removed.
1 p01 To reset a forgotten password, open the sign-in page, choose Forgot password and enter your work email. A reset link is emailed and stays valid for 30 minutes.
2 p02 Resetting two-factor authentication requires a helpdesk ticket. An agent verifies your identity by video call before removing the registered authenticator.
3 p03 After five failed sign-in attempts the account is locked for 15 minutes. Locked accounts unlock automatically and no ticket is needed.
4 p04 On Windows, install the VPN client from the software portal, import the profile file and connect to the gateway vpn-eu.example.net. Error VPN-619 means the profile has expired.
5 p05 On macOS the VPN client needs its system extension approved in System Settings under Privacy and Security before the first connection. Without approval the tunnel never starts.
6 p06 Split tunnelling sends only corporate subnets through the VPN. Internet traffic uses your local connection, which keeps video calls fast.
7 p07 Production databases are backed up nightly at 02:00 UTC and retained for 35 days. Weekly full backups are kept for one year.
8 p08 To restore a database, open a restore request naming the backup timestamp and the target instance. A restore into the production instance needs approval from the data owner.
9 p09 Error E-4012 during a backup means the snapshot volume ran out of space. Expand the volume or delete expired snapshots, then rerun the job.
10 p10 Deployments to production run through the release pipeline. A change needs one approving review and a green build before the deploy button is enabled.
11 p11 To roll back a release, redeploy the previous tagged version from the pipeline. Database migrations are not reverted automatically.
12 p12 No production deployments happen during a change freeze, which is announced in the engineering channel. Emergency fixes need director approval.
13 p13 If the primary database fails, the replica is promoted automatically within about 60 seconds. Applications reconnect through the cluster endpoint, not the instance address.
14 p14 Error E-5003, too many connections, means the pool exceeds the server limit of 200. Reduce the pool size per instance or add a connection pooler.
15 p15 Replica lag above 30 seconds raises an alert. Long-running reports on the replica are the usual cause; move them to the analytics cluster.
16 p16 TLS certificates are issued for 90 days and renewed automatically 30 days before expiry. A renewal failure alert means the DNS challenge record is missing.
17 p17 Mobile apps pin the intermediate certificate. Changing the certificate authority requires an app release before the switch.
18 p18 The public API allows 600 requests per minute per key. Requests beyond that receive HTTP 429 with a Retry-After header.
19 p19 To raise a rate limit, file a request with the expected traffic and the business reason. Increases above 3000 requests per minute need architecture review.
20 p20 API keys should be rotated every 90 days. Rotation creates a second key so clients can switch without downtime, and the old key is revoked after 7 days.
21 p21 Invoices are generated on the first day of each month and emailed to the billing contact. Payment terms are 30 days.
22 p22 Refunds for annual plans are prorated by unused full months. Monthly plans are not refunded.
23 p23 Upgrading a plan takes effect immediately and the price difference is prorated for the rest of the billing period.
24 p24 The on-call engineer acknowledges a page within 5 minutes. With no acknowledgement the page escalates to the secondary and then to the engineering manager.
25 p25 Sev1 means a customer-facing outage or data loss, Sev2 is major degradation and Sev3 is minor impact with a workaround. Sev1 requires a status page update within 15 minutes.
26 p26 A blameless postmortem is written within five working days of a Sev1 or Sev2 incident and reviewed in the weekly operations meeting.
27 p27 Application logs are kept hot for 14 days and archived for one year. Audit logs are kept for seven years.
28 p28 Do not log email addresses, card numbers or access tokens. The log pipeline masks card numbers, but other personal data passes through unchanged.
29 p29 Customers can request an export of their personal data. The export is produced within 30 days and delivered as a zip of JSON files.
30 p30 Deleting an account removes personal data within 30 days. Backups age out on their normal schedule, so deleted data can persist in backups for up to 35 days.
31 p31 New laptops are ordered through the IT portal. Delivery takes five working days and developers can choose between a 14-inch and a 16-inch model.
32 p32 Report a lost or stolen laptop to security immediately. The device is wiped remotely and disk encryption makes the data unreadable.
33 p33 Expenses under 50 euros need no receipt. Larger expenses require a receipt uploaded within 30 days.
34 p34 Annual leave requests are submitted in the HR system and approved by your manager. Leave of more than ten consecutive days also needs approval from the department head.
35 p35 Feature flags are managed in the flag console. A flag must have an owner and an expiry date, and flags past their expiry are reported weekly.
36 p36 Canary releases send 5 percent of traffic to the new version for 30 minutes. If the error rate rises above 1 percent the pipeline aborts the rollout.
37 p37 Messages that fail processing five times go to the dead-letter queue. Inspect the dead-letter queue daily; messages are deleted after 14 days.
38 p38 The shared cache evicts keys with a least-recently-used policy once memory reaches 80 percent. Keys without a TTL are never expired on their own.
39 p39 DNS records have a TTL of 300 seconds. Lower the TTL to 60 seconds a day before a planned migration.
40 p40 Secrets live in the vault, never in source control. A secret found in a repository must be rotated immediately, even if the commit is removed.