@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.
- package/CHANGELOG.md +66 -0
- package/CONTRIBUTING.md +15 -0
- package/LICENSE +17 -0
- package/README.md +284 -0
- package/SECURITY.md +26 -0
- package/biome.json +25 -0
- package/demo-validate.gif +0 -0
- package/dist/cli-findings.d.ts +23 -0
- package/dist/cli-findings.d.ts.map +1 -0
- package/dist/cli-findings.js +88 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +341 -0
- package/dist/edgeConfigCodeGenerator.d.ts +55 -0
- package/dist/edgeConfigCodeGenerator.d.ts.map +1 -0
- package/dist/edgeConfigCodeGenerator.js +249 -0
- package/dist/exportPipeline.d.ts +23 -0
- package/dist/exportPipeline.d.ts.map +1 -0
- package/dist/exportPipeline.js +65 -0
- package/dist/golden-bundle.d.ts +21 -0
- package/dist/golden-bundle.d.ts.map +1 -0
- package/dist/golden-bundle.js +166 -0
- package/dist/graphPredicates.d.ts +10 -0
- package/dist/graphPredicates.d.ts.map +1 -0
- package/dist/graphPredicates.js +33 -0
- package/dist/hostPort.d.ts +12 -0
- package/dist/hostPort.d.ts.map +1 -0
- package/dist/hostPort.js +39 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/ir-lint.d.ts +11 -0
- package/dist/ir-lint.d.ts.map +1 -0
- package/dist/ir-lint.js +16 -0
- package/dist/ir-normalize.d.ts +48 -0
- package/dist/ir-normalize.d.ts.map +1 -0
- package/dist/ir-normalize.js +81 -0
- package/dist/ir-structural.d.ts +40 -0
- package/dist/ir-structural.d.ts.map +1 -0
- package/dist/ir-structural.js +267 -0
- package/dist/lint-graph.d.ts +40 -0
- package/dist/lint-graph.d.ts.map +1 -0
- package/dist/lint-graph.js +133 -0
- package/dist/lint-rules.d.ts +40 -0
- package/dist/lint-rules.d.ts.map +1 -0
- package/dist/lint-rules.js +290 -0
- package/dist/nodeExpress.d.ts +2 -0
- package/dist/nodeExpress.d.ts.map +1 -0
- package/dist/nodeExpress.js +528 -0
- package/dist/openapi-structural.d.ts +26 -0
- package/dist/openapi-structural.d.ts.map +1 -0
- package/dist/openapi-structural.js +82 -0
- package/dist/openapi-to-ir.d.ts +26 -0
- package/dist/openapi-to-ir.d.ts.map +1 -0
- package/dist/openapi-to-ir.js +131 -0
- package/dist/pythonFastAPI.d.ts +2 -0
- package/dist/pythonFastAPI.d.ts.map +1 -0
- package/dist/pythonFastAPI.js +664 -0
- package/dist/validate-drift.d.ts +54 -0
- package/dist/validate-drift.d.ts.map +1 -0
- package/dist/validate-drift.js +184 -0
- package/dist/yamlToIr.d.ts +14 -0
- package/dist/yamlToIr.d.ts.map +1 -0
- package/dist/yamlToIr.js +39 -0
- package/docs/CONCEPT_ADOPTION_AND_LIMITS.md +47 -0
- package/docs/CUSTOM_RULES.md +87 -0
- package/docs/ENGINEERING_NOTES.md +42 -0
- package/docs/IR_CONTRACT.md +54 -0
- package/docs/STRUCTURAL_VS_SEMANTIC_VALIDATION.md +86 -0
- package/fixtures/demo-direct-db-layered.json +37 -0
- package/fixtures/demo-direct-db-violation.json +22 -0
- package/fixtures/ecommerce-with-warnings.json +89 -0
- package/fixtures/invalid-cycle.json +15 -0
- package/fixtures/invalid-edge-unknown-node.json +14 -0
- package/fixtures/minimal-graph.json +14 -0
- package/fixtures/minimal-graph.yaml +13 -0
- package/fixtures/payment-retry-demo.json +43 -0
- package/llms.txt +99 -0
- package/package.json +84 -0
- package/schemas/archrad-ir-graph-v1.schema.json +67 -0
- package/scripts/DEMO_GIF_STORYBOARD.md +100 -0
- package/scripts/GIF_RECORDING_STEP_BY_STEP.md +125 -0
- package/scripts/README_DEMO_RECORDING.md +314 -0
- package/scripts/SOCIAL_POST_DRIFT_AND_INGESTION.md +17 -0
- package/scripts/golden-path-demo.ps1 +25 -0
- package/scripts/golden-path-demo.sh +23 -0
- package/scripts/invoke-drift-check.ps1 +16 -0
- package/scripts/record-demo-drift.tape +50 -0
- package/scripts/record-demo-payment-retry.tape +36 -0
- package/scripts/record-demo-validate.tape +34 -0
- package/scripts/record-demo.tape +33 -0
- package/scripts/run-demo-drift-sequence.ps1 +45 -0
- 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"
|