Skip to content
Merged
11 changes: 6 additions & 5 deletions .github/workflows/julia-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow is managed by gh actions-lock.

Check warning on line 1 in .github/workflows/julia-ci.yml

View workflow job for this annotation

GitHub Actions / Hypatia neurosymbolic scan

[hypatia] Job `test` in julia-ci.yml has no `timeout-minutes:` declaration. Default is 6 hours — a stuck codeload fetch or runner hang can burn budget. Add `timeout-minutes: 10` (or proportional).

Check warning on line 1 in .github/workflows/julia-ci.yml

View workflow job for this annotation

GitHub Actions / Hypatia neurosymbolic scan

[hypatia] Job `jet` in julia-ci.yml has no `timeout-minutes:` declaration. Default is 6 hours — a stuck codeload fetch or runner hang can burn budget. Add `timeout-minutes: 10` (or proportional).

Check warning on line 1 in .github/workflows/julia-ci.yml

View workflow job for this annotation

GitHub Actions / Hypatia neurosymbolic scan

[hypatia] Job `fmt` in julia-ci.yml has no `timeout-minutes:` declaration. Default is 6 hours — a stuck codeload fetch or runner hang can burn budget. Add `timeout-minutes: 10` (or proportional).
# SPDX-License-Identifier: MPL-2.0
# CoprocessorRuntime — Julia CI (julia-library archetype)
#
Expand All @@ -24,7 +24,7 @@
contents: read

jobs:
fmt:

Check warning on line 27 in .github/workflows/julia-ci.yml

View workflow job for this annotation

GitHub Actions / Hypatia neurosymbolic scan

[hypatia] workflow .github/workflows/julia-ci.yml:27 job `fmt` has no `timeout-minutes:` — defaults to 360 min on hang
name: Format (JuliaFormatter)
runs-on: ubuntu-latest
steps:
Expand All @@ -38,20 +38,20 @@
using Pkg
Pkg.add("JuliaFormatter")
using JuliaFormatter
for f in filter(isfile, Iterators.flatten((
for f in filter(f -> isfile(f) && endswith(f, ".jl"), collect(Iterators.flatten((
[joinpath("src", x) for x in readdir("src")],
[joinpath("test", x) for x in readdir("test") if x != "cases"],
[joinpath("test", "cases", x) for x in readdir(joinpath("test", "cases"))],
)))
))))
text = read(f, String)
formatted = JuliaFormatter.format_string(text)
formatted = JuliaFormatter.format_text(text)
if text != formatted
@error "not formatted" file=f
exit(1)
end
end'

jet:

Check warning on line 54 in .github/workflows/julia-ci.yml

View workflow job for this annotation

GitHub Actions / Hypatia neurosymbolic scan

[hypatia] workflow .github/workflows/julia-ci.yml:54 job `jet` has no `timeout-minutes:` — defaults to 360 min on hang
name: Static analysis (JET)
runs-on: ubuntu-latest
steps:
Expand All @@ -66,15 +66,16 @@
using Pkg
Pkg.add("JET")
using JET
JET.test_package(path=".", julia_version="1")'
using CoprocessorRuntime
JET.test_package(CoprocessorRuntime)'

test:

Check warning on line 72 in .github/workflows/julia-ci.yml

View workflow job for this annotation

GitHub Actions / Hypatia neurosymbolic scan

[hypatia] workflow .github/workflows/julia-ci.yml:72 job `test` has no `timeout-minutes:` — defaults to 360 min on hang
name: Test (Test + Aqua)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
julia: ["1.9", "1"]
julia: ["1.10", "1"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v7.0.1
Expand Down
2 changes: 1 addition & 1 deletion .machine_readable/ai/PLACEHOLDERS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ surfaces any left unfilled.
|---|---|---|---|
| `CoprocessorRuntime` | Package / module name (slug) | `my-project` | docs/onboarding/QUICKSTART-MAINTAINER.adoc |
| `{{DESCRIPTION}}` | Short repo description (forge metadata) | `A tool for X` | .github/settings.yml |
| `Julia (1.9+)` | Language / toolchain stack | `Idris2 + Zig` | docs/onboarding/QUICKSTART-DEV.adoc |
| `Julia (1.10+)` | Language / toolchain stack | `Idris2 + Zig` | docs/onboarding/QUICKSTART-DEV.adoc |
| `julia --project=. -e 'using Pkg; Pkg.instantiate()'` | Build command | `just build` | docs/onboarding/QUICKSTART-DEV.adoc |
| `julia --project=. -e 'using Pkg; Pkg.test()'` | Test command | `just test` | docs/onboarding/QUICKSTART-DEV.adoc |
| `src/` | Build artefact output path | `build/` | docs/onboarding/QUICKSTART-MAINTAINER.adoc |
Expand Down
35 changes: 33 additions & 2 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,54 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning].
(Hyperpolymath.jl cannot be pushed from this session).
* `docs/status/HYPATIA-GATE.adoc` — why the CodeRabbit compare has no
merge-base, and which CI reds this tree can actually fix.
* `.github/workflows/julia-ci.yml` (format / JET / Test+Aqua on 1.9 and 1).
* `.github/workflows/julia-ci.yml` (format / JET / Test+Aqua on 1.10 and 1).

==== Changed

* *Breaking:* the minimum Julia is now 1.10 (`julia = "1.10"` in `[compat]`),
and CI's oldest leg is 1.10. The 1.9 leg could not run: `setup-julia`
installed 1.9.4 and the runner could not load its `libopenlibm.so`, so the
leg failed before any test and the repository claimed a version CI never
tested.

* `docs/onboarding/QUICKSTART-DEV.adoc` states Julia 1.10+, matching the floor.

==== Fixed

* `julia-ci.yml` Format step: it called `filter` over an uncollected
`Iterators.Flatten` (a `MethodError`), used `format_string` (not in
JuliaFormatter 2), and read every file in `src/`, including
`src/README.adoc`, which is not Julia. It now collects the list, uses
`format_text`, and checks only `*.jl` files.
* `ONDClaim` and `LaunchPlan` now have typed inner constructors. The default
ones accepted `Any` and converted to the field types, which JET 0.13 on Julia
1.13 reported as five possible errors (`convert` into `Vector{Symbol}` and
`Vector{Endpoint}`), so the JET job was red on the "1" runner. Callers that
already pass the declared types (`observe_null`, `launch_plan`, the tests)
are unaffected; a direct call with a different vector type, such as
`Vector{Any}`, is now a `MethodError` at the call instead of a conversion.
* `julia-ci.yml` JET step: it passed `path=` and `julia_version=`, which
`JET.test_package` does not take; it now passes the package module.
* Seven files that JuliaFormatter flagged are formatted (the syntax tree of
each is identical before and after).
* `.github/dependabot.yml` listed cargo, mix, npm and pip, none of which this
repository has a manifest for, so every weekly Dependabot run for them failed
(8 of the last 10 dynamic runs). Those four are removed and the `julia`
ecosystem is added for `Project.toml`; the `github-actions` entry and its
codeql-action hold are unchanged.

* Reverted Dependabot's `codeql-action` 4.38.1 pin to v4.38.0
(`b96794f`), which is what `actions.lock` already recorded. 4.38.1 is
blocked estate-wide (nexia-list#100) and was the `startup_failure` on
PR #1.
* Reverted `haskell-actions/setup` v2.12.1 → v2.12.0 to match the lock.
* Hypatia caller now passes `secrets: inherit`. This does not cure a
hypatia@HEAD build failure (estate-wide after hypatia#863).
* `Knowledge`, `Belief`, `WarrantOnly` and `Unsound` are now exported. The
README, the wiring doc and the receipts tests all write
`warrant=WarrantOnly` unqualified, but only the enum type `WarrantKind`
was exported, so `Pkg.test()` failed with
`UndefVarError: WarrantOnly not defined` (42 passed, 1 errored; now 46
of 46 pass).

==== Inherited from template

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
test = ["Test", "Aqua"]

[compat]
julia = "1.9"
julia = "1.10"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the developer guide to require Julia 1.10

When a developer follows docs/onboarding/QUICKSTART-DEV.adoc:11, the guide still advertises Julia 1.9+, but this compatibility change makes package instantiation fail on Julia 1.9 before the documented setup or tests can run. Update the guide's version requirement (including its template reminder on line 4) alongside the new floor.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid. Fixed in 74d08b1: docs/onboarding/QUICKSTART-DEV.adoc (line 4 template reminder and line 11) and the matching record in .machine_readable/ai/PLACEHOLDERS.adoc now say Julia 1.10+. A changelog line follows in the next commit.


Generated by Claude Code

Test = "1.9"
Aqua = "0.8"
4 changes: 2 additions & 2 deletions docs/onboarding/QUICKSTART-DEV.adoc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: CC-BY-SA-4.0
// Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
// Template: QUICKSTART-DEV.adoc — clone → build → test → PR
// Replace rsr-template-repo, julia --project=. -e 'using Pkg; Pkg.instantiate()', julia --project=. -e 'using Pkg; Pkg.test()', Julia (1.9+) with actuals
// Replace rsr-template-repo, julia --project=. -e 'using Pkg; Pkg.instantiate()', julia --project=. -e 'using Pkg; Pkg.test()', Julia (1.10+) with actuals
= rsr-template-repo — Quick Start for Developers
:toc:
:toclevels: 2

== Tech Stack

Julia (1.9+)
Julia (1.10+)

== Set Up Development Environment

Expand Down
31 changes: 19 additions & 12 deletions src/Choreography.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ struct LaunchPlan
endpoints::Vector{Endpoint}
grade::ResourceGrade
loss::EchoResidue

# Typed inner constructor (see `ONDClaim`): ill-typed input is rejected
# at the boundary instead of deep inside `convert`.
function LaunchPlan(
global_name::Symbol,
endpoints::Vector{Endpoint},
grade::ResourceGrade,
loss::EchoResidue,
)
new(global_name, endpoints, grade, loss)
end
end

function launch_plan(
Expand All @@ -51,13 +62,13 @@ function project(plan::LaunchPlan, role::Role)
local_eps = Endpoint[e for e in plan.endpoints if typeof(e.role) === typeof(role)]
injective = plan.loss.map.injective
(
role=role,
endpoints=local_eps,
grade=plan.grade,
loss=plan.loss,
grade_eq=injective,
warrant_bound=injective ? :degenerate_base : :open,
kcut=:open,
role = role,
endpoints = local_eps,
grade = plan.grade,
loss = plan.loss,
grade_eq = injective,
warrant_bound = injective ? :degenerate_base : :open,
kcut = :open,
)
end

Expand Down Expand Up @@ -89,9 +100,5 @@ protocol would be the Protocol Squisher claim that `hub_ceiling` refutes.
Callers who need a backend use AcceleratorGate selection, not a hub.
"""
function universal_hub_allowed()
throw(
HubCeilingRefusal(
"hub_ceiling: no universal coprocessor adapter",
),
)
throw(HubCeilingRefusal("hub_ceiling: no universal coprocessor adapter"))
end
59 changes: 47 additions & 12 deletions src/CoprocessorRuntime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,53 @@ close_session!(s)
"""
module CoprocessorRuntime

export Role, HostRole, DeviceRole,
CoprocessorKind, CPUKind, GPUKind, NPUKind, TPUKind, FPGAKind, QPUKind,
DSPKind, UnknownKind,
Session, open_session, close_session!, isopen,
ResourceGrade, tropical_alt, tropical_seq, dominates,
TransferMap, EchoResidue, injective_transfer, collapsing_transfer,
WarrantKind, LaunchReceipt, issue_receipt, host_may_claim,
CNOClaim, ONDClaim, reset_session!, observe_null,
InverseMeta, inversion_of, irreversible,
Endpoint, LaunchPlan, launch_plan, project, projected_grade,
universal_hub_allowed, HubCeilingRefusal,
kind_label
export Role,
HostRole,
DeviceRole,
CoprocessorKind,
CPUKind,
GPUKind,
NPUKind,
TPUKind,
FPGAKind,
QPUKind,
DSPKind,
UnknownKind,
Session,
open_session,
close_session!,
isopen,
ResourceGrade,
tropical_alt,
tropical_seq,
dominates,
TransferMap,
EchoResidue,
injective_transfer,
collapsing_transfer,
WarrantKind,
Knowledge,
Belief,
WarrantOnly,
Unsound,
LaunchReceipt,
issue_receipt,
host_may_claim,
CNOClaim,
ONDClaim,
reset_session!,
observe_null,
InverseMeta,
inversion_of,
irreversible,
Endpoint,
LaunchPlan,
launch_plan,
project,
projected_grade,
universal_hub_allowed,
HubCeilingRefusal,
kind_label

include("Kinds.jl")
include("Grades.jl")
Expand Down
16 changes: 14 additions & 2 deletions src/Nullity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ struct ONDClaim
observer::Symbol
residue::Vector{Symbol}
status::Symbol

# Typed inner constructor: the default one accepts `Any` and converts to
# the field types, which lets ill-typed input fail deep inside `Base`
# (and JET report five "possible errors" through `convert`).
function ONDClaim(
secret_region::Symbol,
observer::Symbol,
residue::Vector{Symbol},
status::Symbol,
)
new(secret_region, observer, residue, status)
end
end

"""
Expand Down Expand Up @@ -74,8 +86,8 @@ Construct an OND claim. Callers must list out-of-scope observables in
function observe_null(
secret::Symbol,
observer::Symbol;
residue::Vector{Symbol}=Symbol[],
status::Symbol=:unproved,
residue::Vector{Symbol} = Symbol[],
status::Symbol = :unproved,
)
status in (:unproved, :model_checked) ||
throw(ArgumentError("OND status must be :unproved or :model_checked, got $status"))
Expand Down
14 changes: 5 additions & 9 deletions src/Receipts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,14 @@ end

function issue_receipt(
session::Session;
standpoint::Symbol=:host,
warrant::WarrantKind=WarrantOnly,
claim::AbstractString="",
sound::Bool=false,
standpoint::Symbol = :host,
warrant::WarrantKind = WarrantOnly,
claim::AbstractString = "",
sound::Bool = false,
)
isopen(session) || throw(ArgumentError("session $(session.id) is closed"))
if standpoint === :device && warrant === Knowledge && !sound
throw(
ArgumentError(
"device Knowledge without a soundness check is smuggling",
),
)
throw(ArgumentError("device Knowledge without a soundness check is smuggling"))
end
LaunchReceipt(session.id, standpoint, warrant, String(claim), sound)
end
Expand Down
4 changes: 2 additions & 2 deletions src/Sessions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _session_counter = Ref{UInt64}(UInt64(0))
An opened coprocessor session. Opening a session does not allocate device
memory and does not prove the device exists. It is a host-side handle.
"""
mutable struct Session{K <: CoprocessorKind}
mutable struct Session{K<:CoprocessorKind}
id::UInt64
kind::K
role::Role
Expand All @@ -24,7 +24,7 @@ Base.isopen(s::Session) = s.open
Mint a host-side session handle. `role` is this endpoint's choreographic
projection (almost always `HostRole` in Julia).
"""
function open_session(kind::K; role::Role=HostRole()) where {K <: CoprocessorKind}
function open_session(kind::K; role::Role = HostRole()) where {K<:CoprocessorKind}
_session_counter[] += UInt64(1)
Session{K}(_session_counter[], kind, role, true)
end
Expand Down
18 changes: 9 additions & 9 deletions test/cases/receipts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

@testset "epistemic receipts" begin
s = open_session(NPUKind())
r = issue_receipt(s; warrant=WarrantOnly, claim="kernel returned")
r = issue_receipt(s; warrant = WarrantOnly, claim = "kernel returned")
@test !host_may_claim(r)
fact = issue_receipt(
s;
standpoint=:host,
warrant=Knowledge,
claim="host saw flag",
sound=true,
standpoint = :host,
warrant = Knowledge,
claim = "host saw flag",
sound = true,
)
@test host_may_claim(fact)
@test_throws ArgumentError issue_receipt(
s;
standpoint=:device,
warrant=Knowledge,
claim="smuggled",
sound=false,
standpoint = :device,
warrant = Knowledge,
claim = "smuggled",
sound = false,
)
close_session!(s)
@test_throws ArgumentError issue_receipt(s)
Expand Down
2 changes: 1 addition & 1 deletion test/cases/sessions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@test isopen(s)
close_session!(s)
@test_throws ArgumentError reset_session!(s)
ond = observe_null(:weights, :host; residue=[:thermal, :em_sidechannel])
ond = observe_null(:weights, :host; residue = [:thermal, :em_sidechannel])
@test ond.status === :unproved
@test ond.residue == [:thermal, :em_sidechannel]
@test irreversible(:reduce).inverse === nothing
Expand Down
Loading