rachnasutra 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +22 -2
  2. package/CITATION.cff +2 -2
  3. package/Dockerfile +9 -0
  4. package/README.gu.md +35 -0
  5. package/README.md +14 -12
  6. package/ROADMAP.md +8 -1
  7. package/case-studies/clean-blog/fixes.diff +152 -152
  8. package/dist/audit.js +24 -6
  9. package/dist/browser.js +147 -0
  10. package/dist/cli.js +117 -17
  11. package/dist/report.js +23 -0
  12. package/dist/rules.js +176 -0
  13. package/dist/tw-color.js +36 -0
  14. package/docs/cli-reference.md +1 -1
  15. package/docs/compatibility.md +1 -1
  16. package/docs/status.md +13 -6
  17. package/documents/rachnasutra/00-overview.md +4 -4
  18. package/documents/rachnasutra/02-functional-specification.md +6 -6
  19. package/documents/rachnasutra/03-architecture.md +1 -1
  20. package/documents/rachnasutra/04-technical-reference.md +2 -2
  21. package/documents/rachnasutra/05-user-guide.md +1 -1
  22. package/documents/rachnasutra/06-audit-rules-reference.md +46 -1
  23. package/documents/rachnasutra/10-testing-and-evidence.md +22 -21
  24. package/documents/rachnasutra/11-deployment-and-ci.md +26 -6
  25. package/documents/rachnasutra/12-roadmap-and-status.md +13 -11
  26. package/documents/rachnasutra/13-maintainer-handbook.md +1 -1
  27. package/documents/rachnasutra/15-rule-examples.md +456 -0
  28. package/documents/rachnasutra/16-validation-and-benchmarks.md +3 -3
  29. package/examples/prime-session-example.md +2 -2
  30. package/fixtures/rule-cases.mjs +85 -70
  31. package/llms.txt +4 -3
  32. package/package.json +7 -2
  33. package/samples/broken-ui/latest.html +42 -30
  34. package/samples/broken-ui/latest.json +39 -14
  35. package/samples/broken-ui/latest.md +24 -13
  36. package/samples/broken-ui/latest.sarif +48 -10
  37. package/samples/good-ui/latest.html +1 -1
  38. package/samples/good-ui/latest.json +3 -3
  39. package/samples/good-ui/latest.md +2 -2
@@ -2,9 +2,9 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "tool": {
4
4
  "name": "rachnasutra",
5
- "version": "0.4.0"
5
+ "version": "0.5.1"
6
6
  },
7
- "generatedAt": "2026-11-05T19:28:05.857Z",
7
+ "generatedAt": "2026-11-06T19:46:25.862Z",
8
8
  "root": "<project>\\fixtures\\intentionally-broken-ui",
9
9
  "mode": "static",
10
10
  "filesScanned": 2,
@@ -324,6 +324,31 @@
324
324
  },
325
325
  {
326
326
  "id": "RS-0013",
327
+ "rule": "RS-A11Y-019",
328
+ "category": "accessibility",
329
+ "title": "email field has no autocomplete attribute",
330
+ "severity": "medium",
331
+ "confidence": "medium",
332
+ "criterion": "WCAG 2.2: 1.3.5 Identify Input Purpose",
333
+ "user_impact": "Browsers and password managers cannot fill the field, and users retype personal data.",
334
+ "recommended_fix": "Add autocomplete=\"email\".",
335
+ "verification": "Re-run the audit, then use the browser autofill menu on the field.",
336
+ "limitations": "Only type=email and type=tel are checked. Other personal fields need a human look.",
337
+ "file": "index.html",
338
+ "line": 16,
339
+ "evidence": [
340
+ {
341
+ "path": "index.html",
342
+ "line": 16,
343
+ "excerpt": "<input type=\"email\" placeholder=\"Email\">"
344
+ }
345
+ ],
346
+ "platform": "web",
347
+ "status": "review-required",
348
+ "fingerprint": "d5a33ed3df42"
349
+ },
350
+ {
351
+ "id": "RS-0014",
327
352
  "rule": "RS-MOT-001",
328
353
  "category": "motion",
329
354
  "title": "Animations or transitions exist but no prefers-reduced-motion handling",
@@ -348,7 +373,7 @@
348
373
  "fingerprint": "cd7575536288"
349
374
  },
350
375
  {
351
- "id": "RS-0014",
376
+ "id": "RS-0015",
352
377
  "rule": "RS-RESP-002",
353
378
  "category": "responsive",
354
379
  "title": "Fixed width 1200px can overflow narrow viewports",
@@ -373,7 +398,7 @@
373
398
  "fingerprint": "3c2677a99757"
374
399
  },
375
400
  {
376
- "id": "RS-0015",
401
+ "id": "RS-0016",
377
402
  "rule": "RS-RESP-003",
378
403
  "category": "responsive",
379
404
  "title": "No responsive CSS found (media/container queries, clamp, grid auto-fit, flex-wrap)",
@@ -397,7 +422,7 @@
397
422
  "fingerprint": "9c3dab4b3bd7"
398
423
  },
399
424
  {
400
- "id": "RS-0016",
425
+ "id": "RS-0017",
401
426
  "rule": "RS-A11Y-009",
402
427
  "category": "accessibility",
403
428
  "title": "Heading level skips from h1 to h3",
@@ -422,7 +447,7 @@
422
447
  "fingerprint": "99a3c7a78030"
423
448
  },
424
449
  {
425
- "id": "RS-0017",
450
+ "id": "RS-0018",
426
451
  "rule": "RS-A11Y-015",
427
452
  "category": "accessibility",
428
453
  "title": "No main landmark",
@@ -447,7 +472,7 @@
447
472
  "fingerprint": "5fc1dc510c8b"
448
473
  },
449
474
  {
450
- "id": "RS-0018",
475
+ "id": "RS-0019",
451
476
  "rule": "RS-CONT-001",
452
477
  "category": "content",
453
478
  "title": "Vague link text \"click here\"",
@@ -472,7 +497,7 @@
472
497
  "fingerprint": "ab30e71ba71e"
473
498
  },
474
499
  {
475
- "id": "RS-0019",
500
+ "id": "RS-0020",
476
501
  "rule": "RS-PERF-001",
477
502
  "category": "performance",
478
503
  "title": "Image has no explicit width and height",
@@ -496,7 +521,7 @@
496
521
  "fingerprint": "d1c68f89d33e"
497
522
  },
498
523
  {
499
- "id": "RS-0020",
524
+ "id": "RS-0021",
500
525
  "rule": "RS-VIS-001",
501
526
  "category": "visual",
502
527
  "title": "Very small text (10px)",
@@ -521,7 +546,7 @@
521
546
  "fingerprint": "545e07e35298"
522
547
  },
523
548
  {
524
- "id": "RS-0021",
549
+ "id": "RS-0022",
525
550
  "rule": "RS-TRUST-001",
526
551
  "category": "trust",
527
552
  "title": "Urgency or scarcity wording needs review",
@@ -549,7 +574,7 @@
549
574
  {
550
575
  "category": "accessibility (static)",
551
576
  "state": "partial",
552
- "checks": 15,
577
+ "checks": 22,
553
578
  "detail": "Source patterns and measured literal colour contrast only. Keyboard, screen-reader and axe runtime checks were not run."
554
579
  },
555
580
  {
@@ -643,12 +668,12 @@
643
668
  "bySeverity": {
644
669
  "critical": 0,
645
670
  "high": 8,
646
- "medium": 7,
671
+ "medium": 8,
647
672
  "low": 5,
648
673
  "info": 1
649
674
  },
650
675
  "byCategory": {
651
- "accessibility": 14,
676
+ "accessibility": 15,
652
677
  "motion": 1,
653
678
  "responsive": 2,
654
679
  "content": 1,
@@ -657,6 +682,6 @@
657
682
  "trust": 1
658
683
  },
659
684
  "confirmed": 13,
660
- "reviewRequired": 8
685
+ "reviewRequired": 9
661
686
  }
662
687
  }
@@ -1,15 +1,15 @@
1
1
  # RachnaSutra AI - UI/UX audit report
2
2
 
3
- - Generated: 2026-11-05T19:28:05.857Z
3
+ - Generated: 2026-11-06T19:46:25.862Z
4
4
  - Mode: static (read-only, no network, no model)
5
5
  - Root: `<project>\fixtures\intentionally-broken-ui`
6
6
  - Files scanned: 2 (.html: 1, .css: 1)
7
- - Tool: rachnasutra 0.4.0
7
+ - Tool: rachnasutra 0.5.1
8
8
 
9
9
  ## Executive summary
10
10
 
11
- 21 finding(s): 0 critical, 8 high, 7 medium, 5 low, 1 info.
12
- 13 confirmed by deterministic pattern or measurement; 8 need human or runtime review.
11
+ 22 finding(s): 0 critical, 8 high, 8 medium, 5 low, 1 info.
12
+ 13 confirmed by deterministic pattern or measurement; 9 need human or runtime review.
13
13
 
14
14
  This is a static review. It does not certify WCAG conformance and gives no quality score, because large areas were not evaluated (see Coverage).
15
15
 
@@ -177,7 +177,18 @@ This is a static review. It does not certify WCAG conformance and gives no quali
177
177
  - Verify: Measure the rendered bounding box in a browser at the target viewport.
178
178
  - Limitations: Padding may enlarge the real target; selector-name match is heuristic.
179
179
 
180
- ### RS-0013 - Animations or transitions exist but no prefers-reduced-motion handling
180
+ ### RS-0013 - email field has no autocomplete attribute
181
+
182
+ - Rule: RS-A11Y-019 | Category: accessibility | Severity: **medium** | Confidence: medium | Status: review-required
183
+ - Criterion: WCAG 2.2: 1.3.5 Identify Input Purpose
184
+ - Location: `index.html:16`
185
+ - Evidence: `<input type="email" placeholder="Email">`
186
+ - User impact: Browsers and password managers cannot fill the field, and users retype personal data.
187
+ - Fix: Add autocomplete="email".
188
+ - Verify: Re-run the audit, then use the browser autofill menu on the field.
189
+ - Limitations: Only type=email and type=tel are checked. Other personal fields need a human look.
190
+
191
+ ### RS-0014 - Animations or transitions exist but no prefers-reduced-motion handling
181
192
 
182
193
  - Rule: RS-MOT-001 | Category: motion | Severity: **medium** | Confidence: high | Status: confirmed
183
194
  - Criterion: WCAG 2.2: 2.3.3 Animation from Interactions (AAA, best practice)
@@ -188,7 +199,7 @@ This is a static review. It does not certify WCAG conformance and gives no quali
188
199
  - Verify: Enable "reduce motion" in the OS and confirm motion stops.
189
200
  - Limitations: Motion may be handled in JavaScript; only CSS was scanned.
190
201
 
191
- ### RS-0014 - Fixed width 1200px can overflow narrow viewports
202
+ ### RS-0015 - Fixed width 1200px can overflow narrow viewports
192
203
 
193
204
  - Rule: RS-RESP-002 | Category: responsive | Severity: **medium** | Confidence: medium | Status: review-required
194
205
  - Criterion: WCAG 2.2: 1.4.10 Reflow
@@ -199,7 +210,7 @@ This is a static review. It does not certify WCAG conformance and gives no quali
199
210
  - Verify: Render at 320x568 and confirm no horizontal scroll.
200
211
  - Limitations: A parent container or media query may constrain the element; not rendered.
201
212
 
202
- ### RS-0015 - No responsive CSS found (media/container queries, clamp, grid auto-fit, flex-wrap)
213
+ ### RS-0016 - No responsive CSS found (media/container queries, clamp, grid auto-fit, flex-wrap)
203
214
 
204
215
  - Rule: RS-RESP-003 | Category: responsive | Severity: **medium** | Confidence: medium | Status: review-required
205
216
  - Location: `styles.css:1`
@@ -209,7 +220,7 @@ This is a static review. It does not certify WCAG conformance and gives no quali
209
220
  - Verify: Render at 320, 390, 768, 1024 and 1440 widths and review each screenshot.
210
221
  - Limitations: CSS frameworks (Tailwind, Bootstrap) supply responsive rules not visible in source CSS.
211
222
 
212
- ### RS-0016 - Heading level skips from h1 to h3
223
+ ### RS-0017 - Heading level skips from h1 to h3
213
224
 
214
225
  - Rule: RS-A11Y-009 | Category: accessibility | Severity: **low** | Confidence: medium | Status: review-required
215
226
  - Criterion: WCAG 2.2: 1.3.1 Info and Relationships
@@ -220,7 +231,7 @@ This is a static review. It does not certify WCAG conformance and gives no quali
220
231
  - Verify: Inspect the heading outline in the browser accessibility tree.
221
232
  - Limitations: Heading order across included partials is not visible to a single-file scan.
222
233
 
223
- ### RS-0017 - No main landmark
234
+ ### RS-0018 - No main landmark
224
235
 
225
236
  - Rule: RS-A11Y-015 | Category: accessibility | Severity: **low** | Confidence: medium | Status: review-required
226
237
  - Criterion: WCAG 2.2: 1.3.1 Info and Relationships, 2.4.1 Bypass Blocks
@@ -231,7 +242,7 @@ This is a static review. It does not certify WCAG conformance and gives no quali
231
242
  - Verify: Check landmarks with a screen-reader landmark list or the browser accessibility tree.
232
243
  - Limitations: A shared layout file may provide <main> for this page.
233
244
 
234
- ### RS-0018 - Vague link text "click here"
245
+ ### RS-0019 - Vague link text "click here"
235
246
 
236
247
  - Rule: RS-CONT-001 | Category: content | Severity: **low** | Confidence: high | Status: confirmed
237
248
  - Criterion: WCAG 2.2: 2.4.4 Link Purpose (In Context)
@@ -242,7 +253,7 @@ This is a static review. It does not certify WCAG conformance and gives no quali
242
253
  - Verify: Re-run the audit; review the page link list.
243
254
  - Limitations: Surrounding context may make the purpose clear to sighted users.
244
255
 
245
- ### RS-0019 - Image has no explicit width and height
256
+ ### RS-0020 - Image has no explicit width and height
246
257
 
247
258
  - Rule: RS-PERF-001 | Category: performance | Severity: **low** | Confidence: medium | Status: review-required
248
259
  - Location: `index.html:11`
@@ -252,7 +263,7 @@ This is a static review. It does not certify WCAG conformance and gives no quali
252
263
  - Verify: Measure CLS in a lab run (Lighthouse) before and after; compare field data if available.
253
264
  - Limitations: CSS elsewhere may already reserve the space; not measured at runtime.
254
265
 
255
- ### RS-0020 - Very small text (10px)
266
+ ### RS-0021 - Very small text (10px)
256
267
 
257
268
  - Rule: RS-VIS-001 | Category: visual | Severity: **low** | Confidence: high | Status: confirmed
258
269
  - Criterion: WCAG 2.2: 1.4.4 Resize Text (readability)
@@ -263,7 +274,7 @@ This is a static review. It does not certify WCAG conformance and gives no quali
263
274
  - Verify: View on a real phone at normal distance.
264
275
  - Limitations: Context (legal footers, labels) may justify small text; this is a readability signal.
265
276
 
266
- ### RS-0021 - Urgency or scarcity wording needs review
277
+ ### RS-0022 - Urgency or scarcity wording needs review
267
278
 
268
279
  - Rule: RS-TRUST-001 | Category: trust | Severity: **info** | Confidence: low | Status: review-required
269
280
  - Location: `index.html:19`
@@ -6,7 +6,7 @@
6
6
  "tool": {
7
7
  "driver": {
8
8
  "name": "RachnaSutra AI",
9
- "version": "0.4.0",
9
+ "version": "0.5.1",
10
10
  "informationUri": "https://github.com/shahvatsalofficial/rachnasutra",
11
11
  "rules": [
12
12
  {
@@ -152,6 +152,17 @@
152
152
  "criterion": "WCAG 1.3.1, 2.4.1"
153
153
  }
154
154
  },
155
+ {
156
+ "id": "RS-A11Y-019",
157
+ "name": "EmailOrTelephoneFieldHasNoAutocomplete",
158
+ "shortDescription": {
159
+ "text": "Email or telephone field has no autocomplete"
160
+ },
161
+ "properties": {
162
+ "category": "accessibility",
163
+ "criterion": "WCAG 1.3.5"
164
+ }
165
+ },
155
166
  {
156
167
  "id": "RS-RESP-002",
157
168
  "name": "FixedWidthCanOverflowNarrowViewports",
@@ -553,6 +564,33 @@
553
564
  "id": "RS-0012"
554
565
  }
555
566
  },
567
+ {
568
+ "ruleId": "RS-A11Y-019",
569
+ "level": "warning",
570
+ "message": {
571
+ "text": "email field has no autocomplete attribute. Fix: Add autocomplete=\"email\"."
572
+ },
573
+ "partialFingerprints": {
574
+ "rachnasutra": "d5a33ed3df42"
575
+ },
576
+ "locations": [
577
+ {
578
+ "physicalLocation": {
579
+ "artifactLocation": {
580
+ "uri": "index.html"
581
+ },
582
+ "region": {
583
+ "startLine": 16
584
+ }
585
+ }
586
+ }
587
+ ],
588
+ "properties": {
589
+ "confidence": "medium",
590
+ "status": "review-required",
591
+ "id": "RS-0013"
592
+ }
593
+ },
556
594
  {
557
595
  "ruleId": "RS-MOT-001",
558
596
  "level": "warning",
@@ -577,7 +615,7 @@
577
615
  "properties": {
578
616
  "confidence": "high",
579
617
  "status": "confirmed",
580
- "id": "RS-0013"
618
+ "id": "RS-0014"
581
619
  }
582
620
  },
583
621
  {
@@ -604,7 +642,7 @@
604
642
  "properties": {
605
643
  "confidence": "medium",
606
644
  "status": "review-required",
607
- "id": "RS-0014"
645
+ "id": "RS-0015"
608
646
  }
609
647
  },
610
648
  {
@@ -631,7 +669,7 @@
631
669
  "properties": {
632
670
  "confidence": "medium",
633
671
  "status": "review-required",
634
- "id": "RS-0015"
672
+ "id": "RS-0016"
635
673
  }
636
674
  },
637
675
  {
@@ -658,7 +696,7 @@
658
696
  "properties": {
659
697
  "confidence": "medium",
660
698
  "status": "review-required",
661
- "id": "RS-0016"
699
+ "id": "RS-0017"
662
700
  }
663
701
  },
664
702
  {
@@ -685,7 +723,7 @@
685
723
  "properties": {
686
724
  "confidence": "medium",
687
725
  "status": "review-required",
688
- "id": "RS-0017"
726
+ "id": "RS-0018"
689
727
  }
690
728
  },
691
729
  {
@@ -712,7 +750,7 @@
712
750
  "properties": {
713
751
  "confidence": "high",
714
752
  "status": "confirmed",
715
- "id": "RS-0018"
753
+ "id": "RS-0019"
716
754
  }
717
755
  },
718
756
  {
@@ -739,7 +777,7 @@
739
777
  "properties": {
740
778
  "confidence": "medium",
741
779
  "status": "review-required",
742
- "id": "RS-0019"
780
+ "id": "RS-0020"
743
781
  }
744
782
  },
745
783
  {
@@ -766,7 +804,7 @@
766
804
  "properties": {
767
805
  "confidence": "high",
768
806
  "status": "confirmed",
769
- "id": "RS-0020"
807
+ "id": "RS-0021"
770
808
  }
771
809
  },
772
810
  {
@@ -793,7 +831,7 @@
793
831
  "properties": {
794
832
  "confidence": "low",
795
833
  "status": "review-required",
796
- "id": "RS-0021"
834
+ "id": "RS-0022"
797
835
  }
798
836
  }
799
837
  ]
@@ -23,7 +23,7 @@ a:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-of
23
23
  <body>
24
24
  <main>
25
25
  <h1>RachnaSutra AI audit report</h1>
26
- <p class="muted">Static mode &middot; read-only &middot; 2026-11-05T19:28:06.609Z &middot; rachnasutra 0.4.0</p>
26
+ <p class="muted">Static mode &middot; read-only &middot; 2026-11-06T19:46:26.797Z &middot; rachnasutra 0.5.1</p>
27
27
  <h2>How to read this</h2>
28
28
  <ul>
29
29
  <li><strong>Confirmed</strong> means the tool saw this in the file. Fix it.</li>
@@ -2,9 +2,9 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "tool": {
4
4
  "name": "rachnasutra",
5
- "version": "0.4.0"
5
+ "version": "0.5.1"
6
6
  },
7
- "generatedAt": "2026-11-05T19:28:06.609Z",
7
+ "generatedAt": "2026-11-06T19:46:26.797Z",
8
8
  "root": "<project>\\fixtures\\good-ui",
9
9
  "mode": "static",
10
10
  "filesScanned": 2,
@@ -26,7 +26,7 @@
26
26
  {
27
27
  "category": "accessibility (static)",
28
28
  "state": "partial",
29
- "checks": 15,
29
+ "checks": 22,
30
30
  "detail": "Source patterns and measured literal colour contrast only. Keyboard, screen-reader and axe runtime checks were not run."
31
31
  },
32
32
  {
@@ -1,10 +1,10 @@
1
1
  # RachnaSutra AI - UI/UX audit report
2
2
 
3
- - Generated: 2026-11-05T19:28:06.609Z
3
+ - Generated: 2026-11-06T19:46:26.797Z
4
4
  - Mode: static (read-only, no network, no model)
5
5
  - Root: `<project>\fixtures\good-ui`
6
6
  - Files scanned: 2 (.html: 1, .css: 1)
7
- - Tool: rachnasutra 0.4.0
7
+ - Tool: rachnasutra 0.5.1
8
8
 
9
9
  ## Executive summary
10
10