behavguard 0.0.0-stage → 0.8.4
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/.github/workflows/behavguard.yml +91 -0
- package/README.md +150 -2
- package/config/static-gates.example.json +9 -0
- package/dist/analysis-cache.d.ts +3 -0
- package/dist/analysis-cache.js +115 -0
- package/dist/analysis-cache.js.map +1 -0
- package/dist/artifacts.d.ts +32 -0
- package/dist/artifacts.js +170 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +211 -0
- package/dist/cli.js.map +1 -0
- package/dist/comparator.d.ts +21 -0
- package/dist/comparator.js +238 -0
- package/dist/comparator.js.map +1 -0
- package/dist/controller.d.ts +93 -0
- package/dist/controller.js +384 -0
- package/dist/controller.js.map +1 -0
- package/dist/coverage.d.ts +14 -0
- package/dist/coverage.js +134 -0
- package/dist/coverage.js.map +1 -0
- package/dist/database-syntax.d.ts +3 -0
- package/dist/database-syntax.js +117 -0
- package/dist/database-syntax.js.map +1 -0
- package/dist/dependencies.d.ts +10 -0
- package/dist/dependencies.js +249 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/dependency-inputs.d.ts +8 -0
- package/dist/dependency-inputs.js +10 -0
- package/dist/dependency-inputs.js.map +1 -0
- package/dist/effects.d.ts +12 -0
- package/dist/effects.js +263 -0
- package/dist/effects.js.map +1 -0
- package/dist/evidence.d.ts +3 -0
- package/dist/evidence.js +68 -0
- package/dist/evidence.js.map +1 -0
- package/dist/gate.d.ts +46 -0
- package/dist/gate.js +89 -0
- package/dist/gate.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +4 -0
- package/dist/init.js +55 -0
- package/dist/init.js.map +1 -0
- package/dist/model.d.ts +78 -0
- package/dist/model.js +2 -0
- package/dist/model.js.map +1 -0
- package/dist/package-resolution.d.ts +15 -0
- package/dist/package-resolution.js +156 -0
- package/dist/package-resolution.js.map +1 -0
- package/dist/planning.d.ts +35 -0
- package/dist/planning.js +56 -0
- package/dist/planning.js.map +1 -0
- package/dist/runtime-coverage.d.ts +8 -0
- package/dist/runtime-coverage.js +70 -0
- package/dist/runtime-coverage.js.map +1 -0
- package/dist/runtime-protocol.d.ts +33 -0
- package/dist/runtime-protocol.js +2 -0
- package/dist/runtime-protocol.js.map +1 -0
- package/dist/runtime.d.ts +17 -0
- package/dist/runtime.js +215 -0
- package/dist/runtime.js.map +1 -0
- package/dist/scenarios.d.ts +75 -0
- package/dist/scenarios.js +435 -0
- package/dist/scenarios.js.map +1 -0
- package/dist/snapshot.d.ts +6 -0
- package/dist/snapshot.js +103 -0
- package/dist/snapshot.js.map +1 -0
- package/dist/static-analysis.d.ts +61 -0
- package/dist/static-analysis.js +408 -0
- package/dist/static-analysis.js.map +1 -0
- package/dist/static-approvals.d.ts +25 -0
- package/dist/static-approvals.js +54 -0
- package/dist/static-approvals.js.map +1 -0
- package/dist/static-index.d.ts +113 -0
- package/dist/static-index.js +654 -0
- package/dist/static-index.js.map +1 -0
- package/dist/static-project.d.ts +40 -0
- package/dist/static-project.js +236 -0
- package/dist/static-project.js.map +1 -0
- package/dist/values.d.ts +10 -0
- package/dist/values.js +274 -0
- package/dist/values.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +338 -0
- package/dist/worker.js.map +1 -0
- package/docs/adoption-guide.md +365 -0
- package/docs/pilot-evaluation.md +113 -0
- package/docs/pilot-fixtures/ky840.catalog.json +21 -0
- package/docs/pilot-fixtures/ky840.scenarios.json +82 -0
- package/docs/pilot-fixtures/ofetch482.catalog.json +45 -0
- package/docs/pilot-fixtures/ofetch482.scenarios.json +294 -0
- package/package.json +41 -4
- package/scripts/check-pull-request.sh +46 -0
- package/scripts/github-static-approvals.mjs +196 -0
- package/skills/behavguard/SKILL.md +15 -0
- package/templates/github-actions.yml +79 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: BehavGuard
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
pull-requests: read
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
compare:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
timeout-minutes: 10
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
|
15
|
+
with:
|
|
16
|
+
node-version: 26.13.0
|
|
17
|
+
package-manager-cache: false
|
|
18
|
+
|
|
19
|
+
- name: Install the pinned BehavGuard CLI
|
|
20
|
+
run: |
|
|
21
|
+
npm install --prefix "$RUNNER_TEMP/behavguard-tool" \
|
|
22
|
+
--ignore-scripts --no-audit --no-fund \
|
|
23
|
+
--registry https://registry.npmjs.org behavguard@__BEHAVGUARD_VERSION__
|
|
24
|
+
|
|
25
|
+
- name: Collect static approvals
|
|
26
|
+
if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
|
|
27
|
+
env:
|
|
28
|
+
GH_TOKEN: ${{ github.token }}
|
|
29
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
30
|
+
run: |
|
|
31
|
+
node "$RUNNER_TEMP/behavguard-tool/node_modules/behavguard/scripts/github-static-approvals.mjs" \
|
|
32
|
+
collect "$RUNNER_TEMP/behavguard-static-approvals.json"
|
|
33
|
+
|
|
34
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
35
|
+
with:
|
|
36
|
+
fetch-depth: 0
|
|
37
|
+
persist-credentials: false
|
|
38
|
+
|
|
39
|
+
- name: Compare the PR commits
|
|
40
|
+
env:
|
|
41
|
+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
42
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
43
|
+
BASE_REPOSITORY: ${{ github.event.pull_request.base.repo.full_name }}
|
|
44
|
+
HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
|
|
45
|
+
run: |
|
|
46
|
+
export BEHAVGUARD_STATIC_APPROVALS="$RUNNER_TEMP/behavguard-static-approvals.json"
|
|
47
|
+
tool="$RUNNER_TEMP/behavguard-tool/node_modules/behavguard"
|
|
48
|
+
report="$RUNNER_TEMP/behavguard-report.json"
|
|
49
|
+
if [[ -n "$HEAD_REPOSITORY" && "$HEAD_REPOSITORY" == "$BASE_REPOSITORY" ]]; then
|
|
50
|
+
base_setup=$(git -C "$GITHUB_WORKSPACE" ls-tree "$BASE_SHA" -- \
|
|
51
|
+
.behavguard/ci-policy.json .github/workflows/behavguard-check.yml)
|
|
52
|
+
if [[ -z "$base_setup" ]]; then
|
|
53
|
+
echo 'BehavGuard setup PR. Running static analysis until the BASE policy is installed.'
|
|
54
|
+
node "$tool/dist/cli.js" check --repo "$GITHUB_WORKSPACE" \
|
|
55
|
+
--base "$BASE_SHA" --head "$HEAD_SHA" --mode static --format json --report-out "$report"
|
|
56
|
+
exit
|
|
57
|
+
fi
|
|
58
|
+
fi
|
|
59
|
+
bash "$tool/scripts/check-pull-request.sh" "$GITHUB_WORKSPACE" "$report"
|
|
60
|
+
|
|
61
|
+
- name: Upload masked report
|
|
62
|
+
if: always()
|
|
63
|
+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
64
|
+
with:
|
|
65
|
+
name: behavguard-report-${{ github.run_attempt }}
|
|
66
|
+
path: ${{ runner.temp }}/behavguard-report.json
|
|
67
|
+
if-no-files-found: ignore
|
|
68
|
+
retention-days: 14
|
|
69
|
+
|
|
70
|
+
- name: Show static findings
|
|
71
|
+
if: always()
|
|
72
|
+
env:
|
|
73
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
74
|
+
run: |
|
|
75
|
+
report="$RUNNER_TEMP/behavguard-report.json"
|
|
76
|
+
if [ -f "$report" ]; then
|
|
77
|
+
node "$RUNNER_TEMP/behavguard-tool/node_modules/behavguard/scripts/github-static-approvals.mjs" \
|
|
78
|
+
summary "$report"
|
|
79
|
+
fi
|