Skip to content

Commit f998611

Browse files
Merge branch 'main' into docs/typescript-exemption-table
2 parents 29966ca + 663fc30 commit f998611

49 files changed

Lines changed: 1658 additions & 472 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
#
55
# Replace hyperpolymath with your GitHub username or team
66

7-
# Default owners for everything
8-
* @hyperpolymath
9-
7+
# Default owners for everything
8+
109
# Security-sensitive files require explicit review
1110
SECURITY.md @hyperpolymath
12-
.github/workflows/ @hyperpolymath
1311
Trustfile.a2ml @hyperpolymath
14-
.machine_readable/ @hyperpolymath
12+
.machine_readable/ @hyperpolymath

.github/DISCUSSION_TEMPLATE/cartridge-proposal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ body:
55
attributes:
66
value: |
77
Proposing a new cartridge for the Ayo (community) menu? Tell us about it!
8-
Cartridges follow the three-layer stack: Idris2 ABI + Zig FFI + V-lang Adapter.
8+
Cartridges follow the stack: Idris2 ABI + Zig FFI, served by the Elixir adapter.
99
See docs/DEVELOPERS.md for the full guide.
1010
- type: input
1111
attributes:

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3333

3434
- name: Initialize CodeQL
35-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4
35+
uses: github/codeql-action/init@5e316336eb4f107009e477d4bfbfff13d7250fae # v4
3636
with:
3737
languages: ${{ matrix.language }}
3838
build-mode: ${{ matrix.build-mode }}
3939

4040
- name: Perform CodeQL Analysis
41-
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4
41+
uses: github/codeql-action/analyze@5e316336eb4f107009e477d4bfbfff13d7250fae # v4
4242
with:
4343
category: "/language:${{ matrix.language }}"

.github/workflows/container-publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ jobs:
4444
fi
4545
4646
- name: Log in to GitHub Container Registry
47+
env:
48+
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
REGISTRY_USER: ${{ github.actor }}
4750
run: |
48-
echo "${{ secrets.GITHUB_TOKEN }}" | \
49-
podman login ghcr.io -u "${{ github.actor }}" --password-stdin
51+
echo "$REGISTRY_TOKEN" | \
52+
podman login ghcr.io -u "$REGISTRY_USER" --password-stdin
5053
5154
- name: Log in to Docker Hub
5255
if: steps.dockerhub.outputs.available == 'true'

.github/workflows/dogfood-gate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
3939
- name: Validate A2ML manifests
4040
if: steps.detect.outputs.count > 0
41-
uses: hyperpolymath/a2ml-validate-action@b2f28c39491c0d1ff131b8fb9e197bfea79e411e # main
41+
uses: hyperpolymath/a2ml-validate-action@86c6da6d2e9c8c07adaff2737ca7d4b5f7d793af # main
4242
with:
4343
path: '.'
4444
strict: 'false'
@@ -86,7 +86,7 @@ jobs:
8686
8787
- name: Validate K9 contracts
8888
if: steps.detect.outputs.k9_count > 0
89-
uses: hyperpolymath/k9-validate-action@f985acb62d1ed46a4b3434dc6cb148dad95cf62d # main
89+
uses: hyperpolymath/k9-validate-action@cfa7f92f6bed88e706a481f7f520e4580d7b9599 # main
9090
with:
9191
path: '.'
9292
strict: 'false'

.github/workflows/e2e.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,10 @@ jobs:
4747
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4848

4949
- name: Install Zig
50-
uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d7b4f723a50dea1f3608 # v2
50+
uses: goto-bus-stop/setup-zig@9566bb3e8749893055694249726756f25e099b30 # v2
5151
with:
5252
version: 0.15.0
5353

54-
- name: Install V
55-
run: |
56-
git clone --depth 1 https://github.com/vlang/v /tmp/vlang
57-
cd /tmp/vlang && make && sudo cp v /usr/local/bin/
58-
5954
- name: Install Deno
6055
uses: denoland/setup-deno@5fae568d37c3b73e0e4ca63d4e2c4e324a2b3497 # v2
6156
with:
@@ -71,10 +66,6 @@ jobs:
7166
[ -f "$cart/build.zig" ] && (cd "$cart" && zig build) || true
7267
done
7368
74-
- name: Build V adapter
75-
run: |
76-
cd adapter/v && v -o boj-server . || echo "V adapter build attempted"
77-
7869
- name: Run E2E full test suite
7970
run: bash tests/e2e_full.sh
8071

@@ -97,7 +88,7 @@ jobs:
9788
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9889

9990
- name: Install Zig
100-
uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d7b4f723a50dea1f3608 # v2
91+
uses: goto-bus-stop/setup-zig@9566bb3e8749893055694249726756f25e099b30 # v2
10192
with:
10293
version: 0.15.0
10394

@@ -131,7 +122,7 @@ jobs:
131122
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
132123

133124
- name: Install Zig
134-
uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d7b4f723a50dea1f3608 # v2
125+
uses: goto-bus-stop/setup-zig@9566bb3e8749893055694249726756f25e099b30 # v2
135126
with:
136127
version: 0.15.0
137128

.github/workflows/hypatia-scan.yml

Lines changed: 95 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# Hypatia Neurosymbolic CI/CD Security Scan
33
name: Hypatia Security Scan
44

@@ -10,19 +10,31 @@ on:
1010
schedule:
1111
- cron: '0 0 * * 0' # Weekly on Sunday
1212
workflow_dispatch:
13+
# Estate guardrail: cancel superseded runs so re-pushes don't pile up
14+
# queued runs across the estate. Safe here because this workflow only
15+
# performs read-only checks/lint/test/scan with no publish or mutation.
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
1319

1420
permissions:
1521
contents: read
16-
security-events: read # Hypatia queries Dependabot alerts via the GraphQL API
22+
# security-events: read lets the built-in GITHUB_TOKEN query this
23+
# repo's own Dependabot alerts via the Hypatia DependabotAlerts rule
24+
# (DA001-DA004). Without this, `scan_from_path` gets HTTP 403 and
25+
# the rule silently returns no findings.
26+
# See 007-lang/audits/audit-dependabot-automation-gap-2026-04-17.md.
27+
security-events: read
28+
# pull-requests: write lets the advisory "Comment on PR with findings"
29+
# step post its summary. Without it the built-in GITHUB_TOKEN gets
30+
# "Resource not accessible by integration" and (absent continue-on-error)
31+
# hard-fails the scan — exactly what the gate-decoupling design forbids.
32+
pull-requests: write
1733

1834
jobs:
1935
scan:
2036
name: Hypatia Neurosymbolic Analysis
2137
runs-on: ubuntu-latest
22-
env:
23-
# Hypatia's CLI calls `gh api` for Dependabot alert lookups; without this
24-
# env var it logs "Dependabot alerts unavailable: GITHUB_TOKEN not set".
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2638

2739
steps:
2840
- name: Checkout repository
@@ -31,35 +43,39 @@ jobs:
3143
fetch-depth: 0 # Full history for better pattern analysis
3244

3345
- name: Setup Elixir for Hypatia scanner
34-
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.18.2
46+
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.18.2
3547
with:
3648
elixir-version: '1.19.4'
3749
otp-version: '28.3'
3850

3951
- name: Clone Hypatia
4052
run: |
41-
HYPATIA_DIR="${GITHUB_WORKSPACE}/../hypatia"
42-
if [ ! -d "$HYPATIA_DIR" ]; then
43-
git clone --depth 1 https://github.com/hyperpolymath/hypatia.git "$HYPATIA_DIR"
53+
if [ ! -d "$HOME/hypatia" ]; then
54+
git clone https://github.com/hyperpolymath/hypatia.git "$HOME/hypatia"
4455
fi
45-
echo "HYPATIA_DIR=$HYPATIA_DIR" >> "$GITHUB_ENV"
4656
4757
- name: Build Hypatia scanner (if needed)
4858
run: |
49-
cd "$HYPATIA_DIR"
50-
if [ ! -f hypatia ] && [ ! -f hypatia-v2 ]; then
51-
echo "Building hypatia-v2 scanner..."
52-
mix deps.get --quiet
59+
cd "$HOME/hypatia"
60+
if [ ! -f hypatia ]; then
61+
echo "Building hypatia scanner..."
62+
mix deps.get
5363
mix escript.build
5464
fi
5565
5666
- name: Run Hypatia scan
5767
id: scan
68+
env:
69+
# Pass the built-in Actions token through to Hypatia so the
70+
# DependabotAlerts rule can query this repo's own alerts.
71+
# For cross-repo scanning (fleet-coordinator scan-supervised),
72+
# a PAT with `security_events` scope is required instead.
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5874
run: |
5975
echo "Scanning repository: ${{ github.repository }}"
6076
61-
# Run scanner
62-
HYPATIA_FORMAT=json "$HYPATIA_DIR/hypatia-cli.sh" scan . > hypatia-findings.json
77+
# Run scanner (exits non-zero when findings exist — suppress to continue)
78+
HYPATIA_FORMAT=json "$HOME/hypatia/hypatia-cli.sh" scan . --exit-zero > hypatia-findings.json || true
6379
6480
# Count findings
6581
FINDING_COUNT=$(jq '. | length' hypatia-findings.json 2>/dev/null || echo 0)
@@ -81,33 +97,81 @@ jobs:
8197
echo "- Medium: $MEDIUM" >> $GITHUB_STEP_SUMMARY
8298
8399
- name: Upload findings artifact
84-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
100+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
85101
with:
86102
name: hypatia-findings
87103
path: hypatia-findings.json
88104
retention-days: 90
89105

90106
- name: Submit findings to gitbot-fleet (Phase 2)
91107
if: steps.scan.outputs.findings_count > 0
108+
# Phase 2 is the collaborative LEARNING side-channel ("bots share
109+
# findings via gitbot-fleet"), not the security gate. The gate is
110+
# the baseline-aware "Check for critical or high-severity issues"
111+
# step below. A fleet-side regression (e.g. the submit script being
112+
# moved/removed) must NEVER hard-fail every consuming repo's scan.
113+
# Same reasoning as the "Comment on PR with findings" step.
114+
# See hyperpolymath/hypatia#213 (gate decoupling) and the exit-127
115+
# estate-wide breakage when gitbot-fleet/scripts/submit-finding.sh
116+
# no longer existed on the default branch.
117+
continue-on-error: true
92118
env:
119+
# All GitHub context values surface as env vars so the run
120+
# block never interpolates `${{ … }}` inline (closes the
121+
# workflow_audit/unsafe_curl_payload + actions_expression_injection
122+
# findings).
93123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
FLEET_PUSH_TOKEN: ${{ secrets.HYPATIA_DISPATCH_PAT }}
125+
FLEET_DISPATCH_TOKEN: ${{ secrets.HYPATIA_DISPATCH_PAT }}
94126
GITHUB_REPOSITORY: ${{ github.repository }}
95127
GITHUB_SHA: ${{ github.sha }}
128+
FINDINGS_COUNT: ${{ steps.scan.outputs.findings_count }}
96129
run: |
97-
echo "📤 Submitting ${{ steps.scan.outputs.findings_count }} findings to gitbot-fleet..."
130+
echo "📤 Submitting $FINDINGS_COUNT findings to gitbot-fleet..."
98131
99-
# Clone gitbot-fleet to temp directory
132+
# Clone gitbot-fleet to temp directory. A clone failure (network,
133+
# repo gone) is non-fatal: learning submission is best-effort.
100134
FLEET_DIR="/tmp/gitbot-fleet-$$"
101-
git clone https://github.com/hyperpolymath/gitbot-fleet.git "$FLEET_DIR"
135+
if ! git clone --depth 1 https://github.com/hyperpolymath/gitbot-fleet.git "$FLEET_DIR"; then
136+
echo "::warning::Could not clone gitbot-fleet — skipping Phase 2 learning submission (non-fatal)."
137+
exit 0
138+
fi
102139
103-
# Run submission script
104-
bash "$FLEET_DIR/scripts/submit-finding.sh" hypatia-findings.json
140+
# The submission script's location in gitbot-fleet has drifted
141+
# before (it was absent from the default branch, which exit-127'd
142+
# every consuming repo's scan). Probe known locations rather than
143+
# hard-coding one path, and skip gracefully if none is present.
144+
SUBMIT_SCRIPT=""
145+
for cand in \
146+
"$FLEET_DIR/scripts/submit-finding.sh" \
147+
"$FLEET_DIR/scripts/submit_finding.sh" \
148+
"$FLEET_DIR/bin/submit-finding.sh" \
149+
"$FLEET_DIR/submit-finding.sh"; do
150+
if [ -f "$cand" ]; then
151+
SUBMIT_SCRIPT="$cand"
152+
break
153+
fi
154+
done
155+
156+
if [ -z "$SUBMIT_SCRIPT" ]; then
157+
echo "::warning::gitbot-fleet submit-finding script not found at any known path — skipping Phase 2 learning submission (non-fatal). Findings are still uploaded as an artifact and gated below."
158+
rm -rf "$FLEET_DIR"
159+
exit 0
160+
fi
161+
162+
# Run submission script. Pass the findings path as ABSOLUTE —
163+
# the script cd's into its own working dir before reading the
164+
# file, so a relative path would resolve to the wrong place.
165+
# A submission-script failure is logged but non-fatal.
166+
if bash "$SUBMIT_SCRIPT" "$GITHUB_WORKSPACE/hypatia-findings.json"; then
167+
echo "✅ Finding submission complete"
168+
else
169+
echo "::warning::gitbot-fleet submission script exited non-zero — Phase 2 learning submission skipped (non-fatal)."
170+
fi
105171
106172
# Cleanup
107173
rm -rf "$FLEET_DIR"
108174
109-
echo "✅ Finding submission complete"
110-
111175
- name: Check for critical issues
112176
if: steps.scan.outputs.critical > 0
113177
run: |
@@ -152,6 +216,11 @@ jobs:
152216
153217
- name: Comment on PR with findings
154218
if: github.event_name == 'pull_request' && steps.scan.outputs.findings_count > 0
219+
# Advisory only — posting findings as a PR comment must never gate
220+
# the scan (hypatia#213 gate decoupling). Belt-and-braces alongside
221+
# the pull-requests: write permission above: a token/API hiccup or
222+
# a fork PR (read-only token) skips the comment, not the check.
223+
continue-on-error: true
155224
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v7
156225
with:
157226
script: |
@@ -182,4 +251,4 @@ jobs:
182251
repo: context.repo.repo,
183252
issue_number: context.issue.number,
184253
body: comment
185-
});
254+
});

.github/workflows/instant-sync.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Trigger Propagation
19-
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v3
19+
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
2020
with:
2121
token: ${{ secrets.FARM_DISPATCH_TOKEN }}
2222
repository: hyperpolymath/.git-private-farm
2323
event-type: propagate
2424
client-payload: |-
2525
{
26-
"repo": "${{ github.event.repository.name }}",
27-
"ref": "${{ github.ref }}",
28-
"sha": "${{ github.sha }}",
26+
"repo": ${{ toJSON(github.event.repository.name) }},
27+
"ref": ${{ toJSON(github.ref) }},
28+
"sha": ${{ toJSON(github.sha) }},
2929
"forges": ""
3030
}
3131
3232
- name: Confirm
33-
run: echo "::notice::Propagation triggered for ${{ github.event.repository.name }}"
33+
env:
34+
REPO_NAME: ${{ github.event.repository.name }}
35+
run: echo "::notice::Propagation triggered for ${REPO_NAME}"

.github/workflows/lsp-dap-bsp.yml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -91,34 +91,6 @@ jobs:
9191
cd "$GITHUB_WORKSPACE"
9292
done
9393
94-
adapter-check:
95-
name: V-lang Adapter Check
96-
runs-on: ubuntu-latest
97-
steps:
98-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
99-
- name: Install V-lang
100-
run: |
101-
sudo apt-get update && sudo apt-get install -y libgc-dev
102-
git clone --depth=1 https://github.com/vlang/v
103-
cd v && make && sudo ./v symlink
104-
- name: Check LSP/DAP/BSP adapters
105-
run: |
106-
for cart in lsp-mcp dap-mcp bsp-mcp; do
107-
echo "=== Checking $cart adapter ==="
108-
adapter_dir="cartridges/$cart/adapter"
109-
if [ ! -d "$adapter_dir" ]; then
110-
echo "ERROR: $adapter_dir missing"
111-
exit 1
112-
fi
113-
v_files=$(find "$adapter_dir" -name '*.v' | wc -l)
114-
if [ "$v_files" -eq 0 ]; then
115-
echo "ERROR: No .v files in $adapter_dir"
116-
exit 1
117-
fi
118-
v check "$adapter_dir"/*.v 2>&1 || { echo "ERROR: V check failed for $cart"; exit 1; }
119-
echo " V-lang check passed ($v_files files)"
120-
done
121-
12294
panel-validation:
12395
name: Panel Manifest Validation
12496
runs-on: ubuntu-latest
@@ -153,7 +125,7 @@ jobs:
153125
completeness:
154126
name: Cartridge Completeness Check
155127
runs-on: ubuntu-latest
156-
needs: [abi-check, ffi-build, adapter-check, panel-validation]
128+
needs: [abi-check, ffi-build, panel-validation]
157129
steps:
158130
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
159131
- name: Verify triadic structure

0 commit comments

Comments
 (0)