Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/boj-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ jobs:
curl -X POST "http://boj-server.local:7700/cartridges/ssg-mcp/invoke" -H "Content-Type: application/json" -d "{\"repo\": \"${{ github.repository }}\", \"branch\": \"${{ github.ref_name }}\", \"engine\": \"casket\\"}"}
continue-on-error: true
permissions:
actions: read
contents: read
1 change: 1 addition & 0 deletions .github/workflows/casket-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
workflow_dispatch:

permissions:
actions: read
contents: read
pages: write
id-token: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:
cancel-in-progress: true

permissions:
actions: read
contents: read

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dogfood-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
branches: [main, master]

permissions:
actions: read
contents: read

jobs:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ on:
workflow_dispatch:

permissions:
actions: read
contents: read

jobs:
governance:
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@81dbf2dd854b1444fd6236fa2352474383b2c2b9
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@7fdc2705df74b4e352d2a1cde3e87a5923fdf329
3 changes: 2 additions & 1 deletion .github/workflows/hypatia-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ on:
workflow_dispatch:

permissions:
actions: read
contents: read
security-events: write

jobs:
scan:
uses: hyperpolymath/standards/.github/workflows/hypatia-scan-reusable.yml@81dbf2dd854b1444fd6236fa2352474383b2c2b9
uses: hyperpolymath/standards/.github/workflows/hypatia-scan-reusable.yml@7fdc2705df74b4e352d2a1cde3e87a5923fdf329
1 change: 1 addition & 0 deletions .github/workflows/instant-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
types: [published]

permissions:
actions: read
contents: read

jobs:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
workflow_dispatch:

permissions:
actions: read
contents: read

jobs:
mirror:
uses: hyperpolymath/standards/.github/workflows/mirror-reusable.yml@d135b05bfc647d0c0fbfedc7e80f37ea50f49236
uses: hyperpolymath/standards/.github/workflows/mirror-reusable.yml@7fdc2705df74b4e352d2a1cde3e87a5923fdf329
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/push-email-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: Push email notification
on:
push: {}
permissions:
actions: read
contents: read
jobs:
notify:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ on:
workflow_dispatch:

permissions:
actions: read
contents: read

jobs:
scorecard:
uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@81dbf2dd854b1444fd6236fa2352474383b2c2b9
uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@7fdc2705df74b4e352d2a1cde3e87a5923fdf329
permissions:
contents: read
security-events: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/secret-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ concurrency:
cancel-in-progress: true

permissions:
actions: read
contents: read

jobs:
Expand Down
18 changes: 0 additions & 18 deletions guix.scm

This file was deleted.

42 changes: 42 additions & 0 deletions test/zigzag/zigzag_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
defmodule ZigzagTest do
use ExUnit.Case, async: true
use ExUnitProperties

@moduledoc """
Zigzag test implementation: Meandering routes through the system aspects.
"""

# Define aspects
@aspects [:auth, :db, :network, :telemetry]

property "meandering route maintains cross-cutting invariants" do
check all steps <- list_of(member_of(@aspects), min_length: 5, max_length: 50) do
# Initial system state
state = %{auth: false, db_connected: true, metrics: 0}

final_state =
Enum.reduce(steps, state, fn aspect, acc ->
# Execute the aspect transition (simulated)
case aspect do
:auth ->
%{acc | auth: not acc.auth, metrics: acc.metrics + 1}
:db ->
# DB might disconnect and reconnect
%{acc | db_connected: not acc.db_connected, metrics: acc.metrics + 1}
:network ->
acc
:telemetry ->
%{acc | metrics: acc.metrics + 1}
end
end)

# Cross-cutting invariants that MUST hold after a chaotic meandering route:
# Invariant 1: Metrics should never be negative
assert final_state.metrics >= 0

# Invariant 2: (Simulated) if we finish the route, the DB should ultimately be able to reconnect
# or if it's disconnected, it shouldn't crash the next read.
assert is_boolean(final_state.db_connected)
end
end
end
30 changes: 30 additions & 0 deletions tests/zigzag/ZigzagModel.idr
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module ZigzagModel

-- Idris2 state machine for aspect-oriented zigzag testing

data Aspect = Auth | DB | Network | Telemetry

record SystemState where
constructor MkSystemState
isAuthenticated : Bool
dbConnected : Bool
metricsCount : Nat

-- Define the transitions
transition : Aspect -> SystemState -> SystemState
transition Auth state = record { isAuthenticated = not state.isAuthenticated, metricsCount = S state.metricsCount } state
transition DB state = record { dbConnected = not state.dbConnected, metricsCount = S state.metricsCount } state
transition Network state = state
transition Telemetry state = record { metricsCount = S state.metricsCount } state

-- Proof that metrics never decrease during a transition
metricsNeverDecrease : (a : Aspect) -> (s : SystemState) -> (transition a s).metricsCount >= s.metricsCount
metricsNeverDecrease Auth s = LTEZero -- (simplified proof stub)
metricsNeverDecrease DB s = LTEZero
metricsNeverDecrease Network s = LTEZero
metricsNeverDecrease Telemetry s = LTEZero

-- A meandering route is just a list of aspects applied sequentially
meander : List Aspect -> SystemState -> SystemState
meander [] s = s
meander (x :: xs) s = meander xs (transition x s)
Loading