Skip to content

Commit 435d223

Browse files
Merge pull request #15 from signalprism/run5-canon-architecture
Merge Description Stabilize DevWedge execution boundary architecture (v0.2.0) This merge finalizes the canonical repository structure and CI enforcement pipeline for Execution Boundary Interpretation. The runtime now deterministically interprets pull request mutations, evaluates declared authority, and emits signed meaning artifacts describing the CI decision. Key changes Execution Boundary Runtime consolidated runtime under boundary/github-action/src/runtime removed legacy gate-run* implementation paths standardized boundary interpretation entrypoint Governance Model Canon bundle integration for pinned governance context DevOps Domain Pack for mutation classification and authority mapping contract-first authority resolution (AUTHORITY_CONTRACT.json preferred) Deterministic CI Enforcement mutation classification from registry-driven catalog authority comparison (required vs declared) fail-closed boundary decision logic Artifacts run-scoped interpretation artifacts meaning.json mutation_report.json artifact signing and verification support Repository Structure canonical layout for Canon, Domain Pack, boundary runtime, and schemas cleaned legacy files and paths improved README with interpretation flow and architecture overview Result The repository now demonstrates the DevWedge: a minimal execution boundary that interprets GitHub pull requests before CI execution. This release establishes the foundation for the broader Signal & Prism interpretive control plane.
2 parents ed35f45 + 6d9bcfb commit 435d223

65 files changed

Lines changed: 7184 additions & 7000 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
- uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0
15+
1516
- name: Ensure origin/main exists
1617
shell: bash
1718
run: |
1819
git fetch --no-tags origin main
1920
git rev-parse origin/main
20-
2121
2222
- name: Skip until Node scaffold exists
2323
run: |
@@ -38,55 +38,47 @@ jobs:
3838
npm install
3939
fi
4040
41-
- run: npm run package
41+
- name: Build packaged action
42+
run: npm run build
4243

4344
- name: Verify bundle
4445
run: test -f dist/index.js
4546

46-
# -------------------------------
47-
# Run 4 Gate + Signature Binding
48-
# -------------------------------
49-
50-
- name: Select contract source (authority-first)
47+
- name: Select contract source
5148
shell: bash
5249
run: |
5350
set -euo pipefail
5451
55-
# Prefer AUTHORITY.json (new)
56-
if [ -f "AUTHORITY.json" ]; then
57-
echo "CONTRACT_PATH=AUTHORITY.json" >> $GITHUB_ENV
52+
if [ -f "examples/hello-world/AUTHORITY.json" ]; then
53+
echo "CONTRACT_PATH=examples/hello-world/AUTHORITY.json" >> $GITHUB_ENV
5854
echo "CONTRACT_KIND=authority" >> $GITHUB_ENV
5955
exit 0
6056
fi
6157
62-
# Back-compat: AUTHORITY_CONTRACT.json (current repo reality)
63-
if [ -f "AUTHORITY_CONTRACT.json" ]; then
64-
echo "CONTRACT_PATH=AUTHORITY_CONTRACT.json" >> $GITHUB_ENV
58+
if [ -f "examples/hello-world/AUTHORITY_CONTRACT.json" ]; then
59+
echo "CONTRACT_PATH=examples/hello-world/AUTHORITY_CONTRACT.json" >> $GITHUB_ENV
6560
echo "CONTRACT_KIND=authority" >> $GITHUB_ENV
6661
echo "WARN: Using AUTHORITY_CONTRACT.json. Consider renaming to AUTHORITY.json."
6762
exit 0
6863
fi
6964
70-
# Legacy support: INTENT.json (old)
71-
if [ -f "INTENT.json" ]; then
72-
echo "CONTRACT_PATH=INTENT.json" >> $GITHUB_ENV
65+
if [ -f "examples/hello-world/INTENT.json" ]; then
66+
echo "CONTRACT_PATH=examples/hello-world/INTENT.json" >> $GITHUB_ENV
7367
echo "CONTRACT_KIND=intent" >> $GITHUB_ENV
7468
echo "WARN: Using legacy INTENT.json. Migrate to AUTHORITY.json."
7569
exit 0
7670
fi
7771
78-
# No contract present
7972
if [ "${{ github.event_name }}" = "pull_request" ]; then
8073
echo "ERROR: Missing contract file. Provide AUTHORITY.json (preferred) or INTENT.json (legacy)."
8174
exit 2
8275
fi
8376
84-
# For push runs: do NOT invent a contract silently.
85-
echo "No contract file on push; gate will be skipped."
77+
echo "No contract file on push; boundary interpretation will be skipped."
8678
echo "CONTRACT_PATH=" >> $GITHUB_ENV
8779
echo "CONTRACT_KIND=none" >> $GITHUB_ENV
8880
89-
- name: Produce diff scope (stable)
81+
- name: Produce diff scope
9082
shell: bash
9183
run: |
9284
set -euo pipefail
@@ -101,39 +93,47 @@ jobs:
10193
fi
10294
ls -la diff.txt
10395
104-
- name: Run Gate (Run 4)
96+
- name: Run Boundary Interpretation
10597
shell: bash
10698
run: |
10799
set -euo pipefail
108100
109101
if [ "${CONTRACT_KIND}" = "none" ]; then
110-
echo "Skipping gate (no contract on push)."
102+
echo "Skipping boundary interpretation (no contract on push)."
111103
exit 0
112104
fi
113105
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."
116-
exit 2
117-
fi
118-
119106
set +e
120-
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' })"
107+
INTENT_PATH="${CONTRACT_PATH}" \
108+
AUTHORITY_CONTRACT_PATH="${CONTRACT_PATH}" \
109+
REGISTRY_PATH=".prism/surface_registry.yaml" \
110+
BOOTSTRAP_LOCK_PATH=".prism/bootstrap.lock" \
111+
MEANING_OUT_PATH="out/meaning.json" \
112+
MUTATION_REPORT_OUT_PATH="out/mutation_report.json" \
113+
node dist/index.js
121114
GATE_RC=$?
122115
set -e
123116
124-
echo "Gate exit code: $GATE_RC"
117+
echo "Boundary exit code: $GATE_RC"
125118
if [ $GATE_RC -ne 0 ]; then
126119
exit $GATE_RC
127120
fi
128121
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
122+
if [ ! -s out/meaning.json ]; then
123+
echo "ERROR: out/meaning.json missing or empty after boundary interpretation."
124+
ls -la out || true
125+
exit 2
126+
fi
127+
128+
node -e "JSON.parse(require('fs').readFileSync('out/meaning.json','utf8')); console.log('out/meaning.json is valid JSON');"
129+
130+
if [ ! -s out/mutation_report.json ]; then
131+
echo "ERROR: out/mutation_report.json missing or empty after boundary interpretation."
132+
ls -la out || true
133133
exit 2
134134
fi
135135
136-
node -e "JSON.parse(require('fs').readFileSync('meaning.json','utf8')); console.log('meaning.json is valid JSON');"
136+
node -e "JSON.parse(require('fs').readFileSync('out/mutation_report.json','utf8')); console.log('out/mutation_report.json is valid JSON');"
137137
138138
- name: Import signing key (GPG)
139139
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }}
@@ -153,17 +153,17 @@ jobs:
153153
154154
if [ "${CONTRACT_KIND}" = "authority" ]; then
155155
node scripts/hash-and-attach-integrity.js \
156-
--artifact meaning.json \
156+
--artifact out/meaning.json \
157157
--authority "${CONTRACT_PATH}" \
158158
--diff diff.txt \
159-
--out meaning.with-integrity.json \
159+
--out out/meaning.with-integrity.json \
160160
--ci-run-id "${GITHUB_RUN_ID}"
161161
else
162162
node scripts/hash-and-attach-integrity.js \
163-
--artifact meaning.json \
163+
--artifact out/meaning.json \
164164
--intent "${CONTRACT_PATH}" \
165165
--diff diff.txt \
166-
--out meaning.with-integrity.json \
166+
--out out/meaning.with-integrity.json \
167167
--ci-run-id "${GITHUB_RUN_ID}"
168168
fi
169169
@@ -178,10 +178,10 @@ jobs:
178178
fi
179179
180180
node scripts/sign-artifact.js \
181-
--artifact meaning.with-integrity.json \
182-
--out meaning.signed.json \
183-
--sig-out artifact.sig \
184-
--pubkey-out pubkey.asc \
181+
--artifact out/meaning.with-integrity.json \
182+
--out out/meaning.signed.json \
183+
--sig-out out/artifact.sig \
184+
--pubkey-out out/pubkey.asc \
185185
--gpg-fpr "${{ secrets.PRISM_GPG_FPR }}"
186186
187187
- name: Verify signed interpretation artifact
@@ -196,17 +196,17 @@ jobs:
196196
197197
if [ "${CONTRACT_KIND}" = "authority" ]; then
198198
node scripts/verify-interpretation-artifact.js \
199-
--artifact meaning.signed.json \
199+
--artifact out/meaning.signed.json \
200200
--authority "${CONTRACT_PATH}" \
201201
--diff diff.txt \
202-
--pubkey pubkey.asc
202+
--pubkey out/pubkey.asc
203203
else
204204
node scripts/verify-interpretation-artifact.js \
205-
--artifact meaning.signed.json \
205+
--artifact out/meaning.signed.json \
206206
--intent "${CONTRACT_PATH}" \
207207
--allow-intent-hash \
208208
--diff diff.txt \
209-
--pubkey pubkey.asc
209+
--pubkey out/pubkey.asc
210210
fi
211211
212212
- name: Stage artifacts for upload
@@ -215,9 +215,10 @@ jobs:
215215
run: |
216216
set -euo pipefail
217217
mkdir -p out_artifacts
218-
cp -f meaning.with-integrity.json meaning.signed.json artifact.sig pubkey.asc diff.txt meaning.json mutation_report.json out_artifacts/ 2>/dev/null || true
219-
cp -f INTENT.json out_artifacts/ 2>/dev/null || true
220-
cp -f AUTHORITY.json out_artifacts/ 2>/dev/null || true
218+
cp -f out/meaning.json out/meaning.with-integrity.json out/meaning.signed.json out/mutation_report.json out/artifact.sig out/pubkey.asc diff.txt out_artifacts/ 2>/dev/null || true
219+
cp -f examples/hello-world/INTENT.json out_artifacts/ 2>/dev/null || true
220+
cp -f examples/hello-world/AUTHORITY.json out_artifacts/ 2>/dev/null || true
221+
cp -f examples/hello-world/AUTHORITY_CONTRACT.json out_artifacts/ 2>/dev/null || true
221222
222223
- name: Upload signed artifacts
223224
if: ${{ always() }}

.github/workflows/enforce.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Run Execution Boundary Interpretation
1717
uses: ./
1818
with:
19-
intent_path: "AUTHORITY_CONTRACT.json"
19+
intent_path: "examples/hello-world/AUTHORITY_CONTRACT.json"
2020
fail_on: "scope,file_count,deletions,renames,moves"
2121
env:
2222
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/prism-gate.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
name: Prism
1+
name: Prism Gate
22

33
on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7-
# allows you to run it manually from Actions tab
87
workflow_dispatch:
98

10-
# gives the badge a status on default branch
119
push:
1210
branches: [main]
1311
paths:
1412
- ".prism/**"
15-
- "canon_bundle/**"
16-
- "src/**"
13+
- "canon/**"
14+
- "boundary/**"
1715
- "dist/**"
16+
- "domain-pack/**"
1817
- ".github/workflows/prism-gate.yml"
19-
- "AUTHORITY_CONTRACT.json"
18+
- "examples/hello-world/**"
2019

2120
jobs:
2221
prism:
@@ -33,14 +32,22 @@ jobs:
3332
- name: Run Prism Gate (local)
3433
uses: ./
3534
env:
36-
INTENT_PATH: "AUTHORITY_CONTRACT.json"
35+
INTENT_PATH: "examples/hello-world/AUTHORITY_CONTRACT.json"
3736
REGISTRY_PATH: ".prism/surface_registry.yaml"
3837
BOOTSTRAP_LOCK_PATH: ".prism/bootstrap.lock"
39-
MEANING_OUT_PATH: "meaning.json"
38+
MEANING_OUT_PATH: "out/meaning.json"
39+
MUTATION_REPORT_OUT_PATH: "out/mutation_report.json"
4040

4141
- name: Upload meaning artifact
4242
if: always()
4343
uses: actions/upload-artifact@v4
4444
with:
4545
name: meaning-artifact
46-
path: meaning.json
46+
path: out/meaning.json
47+
48+
- name: Upload mutation report
49+
if: always()
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: mutation-report
53+
path: out/mutation_report.json

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,14 @@ meaning.json
88
*.swx
99
*~
1010
.DS_Store
11+
# Prism local run artifacts
12+
.prism/runs/
13+
14+
# Local generated interpretation/signing artifacts
15+
artifact.sig
16+
diff.txt
17+
meaning.signed.json
18+
meaning.with-integrity.json
19+
pubkey.asc
20+
out/
21+
mutation_report.json

.prism/runs/fd9373c-1772007425256/mutation_report.json

Lines changed: 0 additions & 47 deletions
This file was deleted.

.prism/runs/fd9373c-1772007838156/mutation_report.json

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)