@archrad/deterministic 0.1.0

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 (93) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/CONTRIBUTING.md +15 -0
  3. package/LICENSE +17 -0
  4. package/README.md +284 -0
  5. package/SECURITY.md +26 -0
  6. package/biome.json +25 -0
  7. package/demo-validate.gif +0 -0
  8. package/dist/cli-findings.d.ts +23 -0
  9. package/dist/cli-findings.d.ts.map +1 -0
  10. package/dist/cli-findings.js +88 -0
  11. package/dist/cli.d.ts +7 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +341 -0
  14. package/dist/edgeConfigCodeGenerator.d.ts +55 -0
  15. package/dist/edgeConfigCodeGenerator.d.ts.map +1 -0
  16. package/dist/edgeConfigCodeGenerator.js +249 -0
  17. package/dist/exportPipeline.d.ts +23 -0
  18. package/dist/exportPipeline.d.ts.map +1 -0
  19. package/dist/exportPipeline.js +65 -0
  20. package/dist/golden-bundle.d.ts +21 -0
  21. package/dist/golden-bundle.d.ts.map +1 -0
  22. package/dist/golden-bundle.js +166 -0
  23. package/dist/graphPredicates.d.ts +10 -0
  24. package/dist/graphPredicates.d.ts.map +1 -0
  25. package/dist/graphPredicates.js +33 -0
  26. package/dist/hostPort.d.ts +12 -0
  27. package/dist/hostPort.d.ts.map +1 -0
  28. package/dist/hostPort.js +39 -0
  29. package/dist/index.d.ts +22 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +21 -0
  32. package/dist/ir-lint.d.ts +11 -0
  33. package/dist/ir-lint.d.ts.map +1 -0
  34. package/dist/ir-lint.js +16 -0
  35. package/dist/ir-normalize.d.ts +48 -0
  36. package/dist/ir-normalize.d.ts.map +1 -0
  37. package/dist/ir-normalize.js +81 -0
  38. package/dist/ir-structural.d.ts +40 -0
  39. package/dist/ir-structural.d.ts.map +1 -0
  40. package/dist/ir-structural.js +267 -0
  41. package/dist/lint-graph.d.ts +40 -0
  42. package/dist/lint-graph.d.ts.map +1 -0
  43. package/dist/lint-graph.js +133 -0
  44. package/dist/lint-rules.d.ts +40 -0
  45. package/dist/lint-rules.d.ts.map +1 -0
  46. package/dist/lint-rules.js +290 -0
  47. package/dist/nodeExpress.d.ts +2 -0
  48. package/dist/nodeExpress.d.ts.map +1 -0
  49. package/dist/nodeExpress.js +528 -0
  50. package/dist/openapi-structural.d.ts +26 -0
  51. package/dist/openapi-structural.d.ts.map +1 -0
  52. package/dist/openapi-structural.js +82 -0
  53. package/dist/openapi-to-ir.d.ts +26 -0
  54. package/dist/openapi-to-ir.d.ts.map +1 -0
  55. package/dist/openapi-to-ir.js +131 -0
  56. package/dist/pythonFastAPI.d.ts +2 -0
  57. package/dist/pythonFastAPI.d.ts.map +1 -0
  58. package/dist/pythonFastAPI.js +664 -0
  59. package/dist/validate-drift.d.ts +54 -0
  60. package/dist/validate-drift.d.ts.map +1 -0
  61. package/dist/validate-drift.js +184 -0
  62. package/dist/yamlToIr.d.ts +14 -0
  63. package/dist/yamlToIr.d.ts.map +1 -0
  64. package/dist/yamlToIr.js +39 -0
  65. package/docs/CONCEPT_ADOPTION_AND_LIMITS.md +47 -0
  66. package/docs/CUSTOM_RULES.md +87 -0
  67. package/docs/ENGINEERING_NOTES.md +42 -0
  68. package/docs/IR_CONTRACT.md +54 -0
  69. package/docs/STRUCTURAL_VS_SEMANTIC_VALIDATION.md +86 -0
  70. package/fixtures/demo-direct-db-layered.json +37 -0
  71. package/fixtures/demo-direct-db-violation.json +22 -0
  72. package/fixtures/ecommerce-with-warnings.json +89 -0
  73. package/fixtures/invalid-cycle.json +15 -0
  74. package/fixtures/invalid-edge-unknown-node.json +14 -0
  75. package/fixtures/minimal-graph.json +14 -0
  76. package/fixtures/minimal-graph.yaml +13 -0
  77. package/fixtures/payment-retry-demo.json +43 -0
  78. package/llms.txt +99 -0
  79. package/package.json +84 -0
  80. package/schemas/archrad-ir-graph-v1.schema.json +67 -0
  81. package/scripts/DEMO_GIF_STORYBOARD.md +100 -0
  82. package/scripts/GIF_RECORDING_STEP_BY_STEP.md +125 -0
  83. package/scripts/README_DEMO_RECORDING.md +314 -0
  84. package/scripts/SOCIAL_POST_DRIFT_AND_INGESTION.md +17 -0
  85. package/scripts/golden-path-demo.ps1 +25 -0
  86. package/scripts/golden-path-demo.sh +23 -0
  87. package/scripts/invoke-drift-check.ps1 +16 -0
  88. package/scripts/record-demo-drift.tape +50 -0
  89. package/scripts/record-demo-payment-retry.tape +36 -0
  90. package/scripts/record-demo-validate.tape +34 -0
  91. package/scripts/record-demo.tape +33 -0
  92. package/scripts/run-demo-drift-sequence.ps1 +45 -0
  93. package/scripts/run-demo-drift-sequence.sh +41 -0
@@ -0,0 +1,45 @@
1
+ # Replay the same steps as record-demo-drift.tape - use while recording with ShareX, OBS, ScreenToGif, etc.
2
+ # (No VHS/ttyd.) From packages/deterministic:
3
+ # powershell -ExecutionPolicy Bypass -File scripts/run-demo-drift-sequence.ps1
4
+ # (or pwsh on PowerShell 7+)
5
+ # Optional: $env:DEMO_DRIFT_PAUSE = "3"
6
+
7
+ $ErrorActionPreference = "Stop"
8
+ $Root = Resolve-Path (Join-Path $PSScriptRoot "..")
9
+ Set-Location $Root
10
+
11
+ $pauseSec = 2
12
+ if ($env:DEMO_DRIFT_PAUSE -match '^\d+$') { $pauseSec = [int]$env:DEMO_DRIFT_PAUSE }
13
+
14
+ if (Test-Path "./out") { Remove-Item -Recurse -Force "./out" }
15
+
16
+ Write-Host "# Deterministic drift: on-disk export vs fresh export from the same IR"
17
+ Start-Sleep -Seconds $pauseSec
18
+
19
+ npm run build
20
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
21
+
22
+ node dist/cli.js export -i fixtures/payment-retry-demo.json -t python -o ./out --skip-host-port-check --skip-ir-lint
23
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
24
+
25
+ Start-Sleep -Seconds $pauseSec
26
+
27
+ Write-Host "# out/app/main.py - tail before tamper (generated, matches IR)"
28
+ Get-Content ./out/app/main.py -Tail 10
29
+ Start-Sleep -Seconds $pauseSec
30
+
31
+ Write-Host "# Tamper: append one line (IR JSON is unchanged)"
32
+ Start-Sleep -Seconds 1
33
+ Add-Content -Path "./out/app/main.py" -Value "`n# Drift introduced`n" -Encoding utf8
34
+
35
+ Write-Host "# Same file - tail after (extra line is the only change)"
36
+ Get-Content ./out/app/main.py -Tail 12
37
+ Start-Sleep -Seconds $pauseSec
38
+
39
+ node dist/cli.js validate-drift -i fixtures/payment-retry-demo.json -t python -o ./out --skip-host-port-check --skip-ir-lint
40
+ # Expected: exit code 1 when drift is detected; continue script for closing caption
41
+ $null = $LASTEXITCODE
42
+
43
+ Start-Sleep -Seconds $pauseSec
44
+
45
+ Write-Host "# Fix: re-export from IR (or revert the file) - then validate-drift is clean again"
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env bash
2
+ # Replay the same steps as record-demo-drift.tape — use while recording with ShareX, OBS, etc.
3
+ # (No VHS/ttyd.) From repo root of this package:
4
+ # bash scripts/run-demo-drift-sequence.sh
5
+ # Optional: DEMO_DRIFT_PAUSE=3 bash scripts/run-demo-drift-sequence.sh
6
+
7
+ set -euo pipefail
8
+ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
9
+ cd "$ROOT"
10
+
11
+ PAUSE="${DEMO_DRIFT_PAUSE:-2}"
12
+
13
+ rm -rf ./out
14
+
15
+ echo "# Deterministic drift: on-disk export vs fresh export from the same IR"
16
+ sleep "$PAUSE"
17
+
18
+ npm run build
19
+ node dist/cli.js export -i fixtures/payment-retry-demo.json -t python -o ./out --skip-host-port-check --skip-ir-lint
20
+
21
+ sleep "$PAUSE"
22
+
23
+ echo "# out/app/main.py — tail before tamper (generated, matches IR)"
24
+ tail -n 10 ./out/app/main.py
25
+ sleep "$PAUSE"
26
+
27
+ echo "# Tamper: append one line (IR JSON is unchanged)"
28
+ sleep 1
29
+ echo '# Drift introduced' >> ./out/app/main.py
30
+
31
+ echo "# Same file — tail after (extra line is the only change)"
32
+ tail -n 12 ./out/app/main.py
33
+ sleep "$PAUSE"
34
+
35
+ set +e
36
+ node dist/cli.js validate-drift -i fixtures/payment-retry-demo.json -t python -o ./out --skip-host-port-check --skip-ir-lint
37
+ set -e
38
+
39
+ sleep "$PAUSE"
40
+
41
+ echo "# Fix: re-export from IR (or revert the file) — then validate-drift is clean again"