@odavl/guardian 0.1.0-rc1

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 (56) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +21 -0
  3. package/README.md +141 -0
  4. package/bin/guardian.js +690 -0
  5. package/flows/example-login-flow.json +36 -0
  6. package/flows/example-signup-flow.json +44 -0
  7. package/guardian-contract-v1.md +149 -0
  8. package/guardian.config.json +54 -0
  9. package/guardian.policy.json +12 -0
  10. package/guardian.profile.docs.yaml +18 -0
  11. package/guardian.profile.ecommerce.yaml +17 -0
  12. package/guardian.profile.marketing.yaml +18 -0
  13. package/guardian.profile.saas.yaml +21 -0
  14. package/package.json +69 -0
  15. package/policies/enterprise.json +12 -0
  16. package/policies/saas.json +12 -0
  17. package/policies/startup.json +12 -0
  18. package/src/guardian/attempt-engine.js +454 -0
  19. package/src/guardian/attempt-registry.js +227 -0
  20. package/src/guardian/attempt-reporter.js +507 -0
  21. package/src/guardian/attempt.js +227 -0
  22. package/src/guardian/auto-attempt-builder.js +283 -0
  23. package/src/guardian/baseline-reporter.js +143 -0
  24. package/src/guardian/baseline-storage.js +285 -0
  25. package/src/guardian/baseline.js +492 -0
  26. package/src/guardian/behavioral-signals.js +261 -0
  27. package/src/guardian/breakage-intelligence.js +223 -0
  28. package/src/guardian/browser.js +92 -0
  29. package/src/guardian/cli-summary.js +141 -0
  30. package/src/guardian/crawler.js +142 -0
  31. package/src/guardian/discovery-engine.js +661 -0
  32. package/src/guardian/enhanced-html-reporter.js +305 -0
  33. package/src/guardian/failure-taxonomy.js +169 -0
  34. package/src/guardian/flow-executor.js +374 -0
  35. package/src/guardian/flow-registry.js +67 -0
  36. package/src/guardian/html-reporter.js +414 -0
  37. package/src/guardian/index.js +218 -0
  38. package/src/guardian/init-command.js +139 -0
  39. package/src/guardian/junit-reporter.js +264 -0
  40. package/src/guardian/market-criticality.js +335 -0
  41. package/src/guardian/market-reporter.js +305 -0
  42. package/src/guardian/network-trace.js +178 -0
  43. package/src/guardian/policy.js +357 -0
  44. package/src/guardian/preset-loader.js +148 -0
  45. package/src/guardian/reality.js +547 -0
  46. package/src/guardian/reporter.js +181 -0
  47. package/src/guardian/root-cause-analysis.js +171 -0
  48. package/src/guardian/safety.js +248 -0
  49. package/src/guardian/scan-presets.js +60 -0
  50. package/src/guardian/screenshot.js +152 -0
  51. package/src/guardian/sitemap.js +225 -0
  52. package/src/guardian/snapshot-schema.js +266 -0
  53. package/src/guardian/snapshot.js +327 -0
  54. package/src/guardian/validators.js +323 -0
  55. package/src/guardian/visual-diff.js +247 -0
  56. package/src/guardian/webhook.js +206 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # CHANGELOG
2
+
3
+ ## 0.1.0-rc1 (2025-12-23)
4
+
5
+ ### Added
6
+
7
+ - CLI with commands for reality testing, attempts, and baselines
8
+ - Reality testing engine with Playwright browser automation
9
+ - Baseline save/check and regression detection
10
+ - Preset policies (startup, saas, enterprise)
11
+ - HTML and JSON reports with evidence artifacts
12
+
13
+ ### Known Issues
14
+
15
+ - Website build currently fails on ESLint (react/no-unescaped-entities) in website/app/page.tsx
16
+ - One non-critical test failure in phase2 (flow executor constructor)
17
+
18
+ ### Status
19
+
20
+ Public Preview (GitHub-only)
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2025 ODAVL
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,141 @@
1
+ # 🛡️ ODAVL Guardian — Market Reality Testing Engine
2
+
3
+ Guardian tests your product before the market does — it runs real-browser checks to catch broken flows early and produces evidence you can trust.
4
+
5
+ ---
6
+
7
+ ## Public Preview
8
+
9
+ - Distribution: GitHub-only (no npm publish yet)
10
+ - Scope: CLI usage from source
11
+
12
+ ---
13
+
14
+ ## Requirements
15
+
16
+ - Node.js 18+
17
+ - npm
18
+ - Playwright browsers (Chromium)
19
+
20
+ Install browsers once per machine:
21
+
22
+ ```bash
23
+ npx playwright install --with-deps chromium
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Install from Source
29
+
30
+ ```bash
31
+ # Clone the repository
32
+ git clone https://github.com/ODAVL/odavl-guardian.git
33
+ cd odavl-guardian
34
+
35
+ # Install dependencies
36
+ npm install
37
+
38
+ # Install Playwright browsers (Chromium)
39
+ npx playwright install --with-deps chromium
40
+ ```
41
+
42
+ Quick try:
43
+
44
+ ```bash
45
+ # Quick reality check with startup policy (from source)
46
+ node bin/guardian.js protect https://example.com
47
+
48
+ # Full reality snapshot with artifacts
49
+ node bin/guardian.js reality --url https://example.com --artifacts ./artifacts
50
+ ```
51
+
52
+ ---
53
+
54
+ ## CLI Commands
55
+
56
+ Use the CLI from source during Public Preview:
57
+
58
+ ```text
59
+ node bin/guardian.js init # Initialize Guardian in the current directory
60
+ node bin/guardian.js protect <url> # Quick reality check using the startup preset
61
+ node bin/guardian.js presets # List available policy presets
62
+ node bin/guardian.js attempt [...] # Execute a single attempt
63
+ node bin/guardian.js reality [...] # Full market reality snapshot
64
+ node bin/guardian.js baseline save [...] # Save a named baseline
65
+ node bin/guardian.js baseline check [...] # Check current run against a baseline
66
+ ```
67
+
68
+ Examples:
69
+
70
+ ```bash
71
+ node bin/guardian.js reality --url https://example.com --policy preset:saas --artifacts ./artifacts
72
+ node bin/guardian.js baseline save --url "http://127.0.0.1:3000?mode=ok" --name ok-baseline --baseline-dir guardian-baselines --artifacts artifacts
73
+ node bin/guardian.js baseline check --url "http://127.0.0.1:3000?mode=ok" --name ok-baseline --baseline-dir guardian-baselines --artifacts artifacts --junit artifacts/junit.xml
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Artifacts
79
+
80
+ - Market report: artifacts/market-run-*/market-report.html
81
+ - Snapshot JSON: artifacts/market-run-*/snapshot.json
82
+ - Attempt reports: artifacts/market-run-*/`<attempt-id>`/attempt-report.*
83
+ - Playwright trace: artifacts/market-run-*/trace.zip (when enabled)
84
+ - JUnit XML: artifacts/junit.xml (when requested)
85
+
86
+ ---
87
+
88
+ ## Exit Codes
89
+
90
+ ```text
91
+ 0 READY # Safe to proceed
92
+ 1 DO_NOT_LAUNCH # Critical issue or insufficient confidence
93
+ 2 TOOL_ERROR # Guardian crashed or misconfigured
94
+ ```
95
+
96
+ ---
97
+
98
+ ## CI Integration (Minimal)
99
+
100
+ ```yaml
101
+ name: Guardian Reality Check
102
+ on: [push, pull_request]
103
+
104
+ jobs:
105
+ guardian:
106
+ runs-on: ubuntu-latest
107
+ steps:
108
+ - uses: actions/checkout@v4
109
+ - uses: actions/setup-node@v4
110
+ with:
111
+ node-version: '18'
112
+
113
+ - run: npm ci
114
+ - run: node bin/guardian.js reality --url https://staging.example.com --max-pages 25
115
+
116
+ - uses: actions/upload-artifact@v4
117
+ with:
118
+ name: guardian-report
119
+ path: artifacts/market-run-*/market-report.html
120
+ ```
121
+
122
+ ---
123
+
124
+ ## Docs & Specs
125
+
126
+ - Contract: [guardian-contract-v1.md](guardian-contract-v1.md)
127
+ - Engine docs: [docs/guardian](docs/guardian)
128
+
129
+ ---
130
+
131
+ ## Status & Known Issues
132
+
133
+ - Public Preview (GitHub-only). CLI usage is via source: see [bin/guardian.js](bin/guardian.js).
134
+ - Website subproject build has an ESLint rule failure (react/no-unescaped-entities). Not required for CLI usage.
135
+ - Tests: most suites pass; see [CHANGELOG.md](CHANGELOG.md) for current failures/regressions, if any.
136
+
137
+ ---
138
+
139
+ ## License
140
+
141
+ Licensed under the MIT License. See [LICENSE](LICENSE) for details.