Skip to content

Commit f75b4f1

Browse files
Run 4: authority-first integrity + CI signature verification
1 parent ccc541a commit f75b4f1

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,29 @@ jobs:
111111
exit 0
112112
fi
113113
114-
# Defensive: do not allow both (avoids ambiguity)
115-
if [ -f "AUTHORITY.json" ] && [ -f "INTENT.json" ]; then
116-
echo "ERROR: Both AUTHORITY.json and INTENT.json present. Remove INTENT.json."
114+
if { [ -f "AUTHORITY.json" ] || [ -f "AUTHORITY_CONTRACT.json" ]; } && [ -f "INTENT.json" ]; then
115+
echo "ERROR: Authority contract present alongside INTENT.json. Remove INTENT.json."
117116
exit 2
118117
fi
119118
120-
# Run gate (may exit non-zero)
121119
set +e
122120
node -e "require('./src/gate-run4').runGate({ intentPath: process.env.CONTRACT_PATH, registryPath: process.env.SURFACE_REGISTRY_PATH || 'surface_registry.yaml', bootstrapLockPath: process.env.BOOTSTRAP_LOCK_PATH || 'bootstrap.lock', meaningOutPath:'meaning.json' })"
123121
GATE_RC=$?
124122
set -e
125123
126124
echo "Gate exit code: $GATE_RC"
127-
exit $GATE_RC
125+
if [ $GATE_RC -ne 0 ]; then
126+
exit $GATE_RC
127+
fi
128+
129+
# HARD ASSERT: meaning.json must be valid JSON
130+
if [ ! -s meaning.json ]; then
131+
echo "ERROR: meaning.json missing or empty after gate."
132+
ls -la || true
133+
exit 2
134+
fi
135+
136+
node -e "JSON.parse(require('fs').readFileSync('meaning.json','utf8')); console.log('meaning.json is valid JSON');"
128137
129138
- name: Import signing key (GPG)
130139
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }}

0 commit comments

Comments
 (0)