Skip to content

Commit 3618634

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/confident-shannon-xf0Td
# Conflicts: # .machine_readable/6a2/META.a2ml # .machine_readable/6a2/STATE.a2ml # .machine_readable/6a2/anchor/ANCHOR.a2ml # .machine_readable/ECOSYSTEM.a2ml
2 parents f553c7b + b185a63 commit 3618634

10 files changed

Lines changed: 207 additions & 38 deletions

File tree

.github/SECURITY.md

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,6 @@ Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
44
-->
55
# Security Policy
66

7-
<!--
8-
============================================================================
9-
TEMPLATE INSTRUCTIONS (delete this block before publishing)
10-
============================================================================
11-
Replace all {{PLACEHOLDER}} values with your information:
12-
{{PROJECT_NAME}} - Your project name
13-
{{OWNER}} - GitHub username or org (e.g., hyperpolymath)
14-
{{REPO}} - Repository name
15-
{{SECURITY_EMAIL}} - Security contact email
16-
{{PGP_FINGERPRINT}} - Your PGP key fingerprint (40 chars, no spaces)
17-
{{PGP_KEY_URL}} - URL to your public PGP key
18-
{{WEBSITE}} - Your website/domain
19-
{{CURRENT_YEAR}} - Current year for copyright
20-
21-
Optional: Remove sections that don't apply (e.g., PGP if you don't use it)
22-
============================================================================
23-
-->
247

258
We take security seriously. We appreciate your efforts to responsibly disclose vulnerabilities and will make every effort to acknowledge your contributions.
269

@@ -44,7 +27,7 @@ We take security seriously. We appreciate your efforts to responsibly disclose v
4427

4528
The preferred method for reporting security vulnerabilities is through GitHub's Security Advisory feature:
4629

47-
1. Navigate to [Report a Vulnerability](https://github.com/{{OWNER}}/{{REPO}}/security/advisories/new)
30+
1. Navigate to [Report a Vulnerability](https://github.com/hyperpolymath/nextgen-typing/security/advisories/new)
4831
2. Click **"Report a vulnerability"**
4932
3. Complete the form with as much detail as possible
5033
4. Submit — we'll receive a private notification
@@ -62,19 +45,19 @@ If you cannot use GitHub Security Advisories, you may email us directly:
6245

6346
| | |
6447
|---|---|
65-
| **Email** | {{SECURITY_EMAIL}} |
66-
| **PGP Key** | [Download Public Key]({{PGP_KEY_URL}}) |
67-
| **Fingerprint** | `{{PGP_FINGERPRINT}}` |
48+
| **Email** | j.d.a.jewell@open.ac.uk |
49+
| **PGP Key** | [Download Public Key](https://github.com/hyperpolymath/nextgen-typing/security/advisories) |
50+
| **Fingerprint** | `not published — use GitHub Security Advisories for encrypted reports` |
6851

6952
```bash
7053
# Import our PGP key
71-
curl -sSL {{PGP_KEY_URL}} | gpg --import
54+
curl -sSL https://github.com/hyperpolymath/nextgen-typing/security/advisories | gpg --import
7255

7356
# Verify fingerprint
74-
gpg --fingerprint {{SECURITY_EMAIL}}
57+
gpg --fingerprint j.d.a.jewell@open.ac.uk
7558

7659
# Encrypt your report
77-
gpg --armor --encrypt --recipient {{SECURITY_EMAIL}} report.txt
60+
gpg --armor --encrypt --recipient j.d.a.jewell@open.ac.uk report.txt
7861
```
7962

8063
> **⚠️ Important:** Do not report security vulnerabilities through public GitHub issues, pull requests, discussions, or social media.
@@ -207,7 +190,7 @@ If we cannot reach agreement on disclosure timing, we default to 90 days from yo
207190

208191
The following are within scope for security research:
209192

210-
- This repository (`{{OWNER}}/{{REPO}}`) and all its code
193+
- This repository (`hyperpolymath/nextgen-typing`) and all its code
211194
- Official releases and packages published from this repository
212195
- Documentation that could lead to security issues
213196
- Build and deployment configurations in this repository
@@ -326,7 +309,7 @@ Recognition includes:
326309
To stay informed about security updates:
327310

328311
- **Watch this repository**: Click "Watch" → "Custom" → Select "Security alerts"
329-
- **GitHub Security Advisories**: Published at [Security Advisories](https://github.com/{{OWNER}}/{{REPO}}/security/advisories)
312+
- **GitHub Security Advisories**: Published at [Security Advisories](https://github.com/hyperpolymath/nextgen-typing/security/advisories)
330313
- **Release notes**: Security fixes noted in [CHANGELOG](CHANGELOG.md)
331314

332315
### Update Policy
@@ -352,7 +335,7 @@ To stay informed about security updates:
352335

353336
## Security Best Practices
354337

355-
When using {{PROJECT_NAME}}, we recommend:
338+
When using nextgen-typing, we recommend:
356339

357340
### General
358341

@@ -374,8 +357,8 @@ When using {{PROJECT_NAME}}, we recommend:
374357

375358
## Additional Resources
376359

377-
- [Our PGP Public Key]({{PGP_KEY_URL}})
378-
- [Security Advisories](https://github.com/{{OWNER}}/{{REPO}}/security/advisories)
360+
- [Our PGP Public Key](https://github.com/hyperpolymath/nextgen-typing/security/advisories)
361+
- [Security Advisories](https://github.com/hyperpolymath/nextgen-typing/security/advisories)
379362
- [Changelog](CHANGELOG.md)
380363
- [Contributing Guidelines](CONTRIBUTING.md)
381364
- [CVE Database](https://cve.mitre.org/)
@@ -387,8 +370,8 @@ When using {{PROJECT_NAME}}, we recommend:
387370

388371
| Purpose | Contact |
389372
|---------|---------|
390-
| **Security issues** | [Report via GitHub](https://github.com/{{OWNER}}/{{REPO}}/security/advisories/new) or {{SECURITY_EMAIL}} |
391-
| **General questions** | [GitHub Discussions](https://github.com/{{OWNER}}/{{REPO}}/discussions) |
373+
| **Security issues** | [Report via GitHub](https://github.com/hyperpolymath/nextgen-typing/security/advisories/new) or j.d.a.jewell@open.ac.uk |
374+
| **General questions** | [GitHub Discussions](https://github.com/hyperpolymath/nextgen-typing/discussions) |
392375
| **Other enquiries** | See [README](README.md) for contact information |
393376

394377
---
@@ -403,8 +386,8 @@ This security policy may be updated from time to time. Significant changes will
403386

404387
---
405388

406-
*Thank you for helping keep {{PROJECT_NAME}} and its users safe.* 🛡️
389+
*Thank you for helping keep nextgen-typing and its users safe.* 🛡️
407390

408391
---
409392

410-
<sub>Last updated: {{CURRENT_YEAR}} · Policy version: 1.0.0</sub>
393+
<sub>Last updated: 2026 · Policy version: 1.0.0</sub>

.machine_readable/6a2/AGENTIC.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "2026-04-11"
9+
last-updated = "2026-06-12"
1010

1111
[agent-permissions]
1212
can-edit-source = true

.machine_readable/6a2/ECOSYSTEM.a2ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "2026-06-05"
9+
last-updated = "2026-06-12"
1010

1111
[project]
1212
name = "nextgen-typing"
@@ -21,6 +21,7 @@ projects = [
2121
{ name = "katagoria", relationship = "coordinates", notes = "Research upstream of the pipeline. Type theory prototypes before promotion to production. Repository created 2026-04-11." },
2222
{ name = "typell", relationship = "coordinates", notes = "TypeLL verification kernel. Open-ended progressive type safety. Powers PanLL port 7800." },
2323
{ name = "typed-wasm", relationship = "coordinates", notes = "TypeLL applied to WasmGC memory safety + aggregate library for AffineScript/Ephapax." },
24+
{ name = "echo-types", relationship = "integrated", notes = "Fiber-based structured-loss formalization integrated into the typesystem (#33, 2026-06-12)." },
2425
{ name = "panll", relationship = "downstream-consumer", notes = "eNSAID reference env. TypeLL runs inside PanLL. Not owned by nextgen-typing." },
2526
{ name = "nextgen-languages/affinescript", relationship = "co-product", notes = "Compiles to typed WasmGC. TypeLL grounds its type system." },
2627
{ name = "nextgen-languages/ephapax", relationship = "co-product", notes = "Compiles to typed WasmGC. TypeLL grounds its dyadic linear/affine system." },

.machine_readable/6a2/NEUROSYM.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "2026-04-11"
9+
last-updated = "2026-06-12"
1010

1111
[hypatia-config]
1212
scan-enabled = true

.machine_readable/6a2/PLAYBOOK.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "2026-04-11"
9+
last-updated = "2026-06-12"
1010

1111
[deployment]
1212
# method = "gitops" # gitops | manual | ci-triggered

.machine_readable/6a2/STATE.a2ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ actions = [
7171

7272
[maintenance-status]
7373
last-run-utc = "2026-06-12T00:00:00Z"
74-
last-result = "governance-checkpoint"
74+
last-result = "pass" # CRG Grade C: dogfood-gate, hypatia-scan, static-analysis-gate green (READINESS.md); governance checkpoint 2026-06-12
7575
open-warnings = 0
7676
open-failures = 0
77+
recent-activity = "2026-05-30 CI/governance hardening: reusable-workflow wrappers (scorecard, secret-scanner, mirror, rust-ci, hypatia-scan), SHA repinning to live commits, stale ReScript fixture removal, tech-debt audit findings recorded."
7778

7879
[recent-activity]
7980
events = [
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
-- SPDX-License-Identifier: MPL-2.0
3+
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
4+
--
5+
-- =====================================================================
6+
-- EchoTyping — echo-types integrated into the type-theory pipeline
7+
-- =====================================================================
8+
--
9+
-- This module wires the hyperpolymath/echo-types library (the canonical,
10+
-- mechanised formalisation of *fiber-based structured loss*) into the
11+
-- nextgen-typing verification layer. The thesis is concrete:
12+
--
13+
-- The pipeline's information-LOSING typing operations — affine
14+
-- weakening (AffineScript: linear ⊑ affine) and refinement erasure
15+
-- (surface type ⇒ kernel type) — are not ad-hoc. Each is an instance
16+
-- of echo-types' `Echo f y := Σ A (λ x → f x ≡ y)`, the proof-relevant
17+
-- record of *which* inputs a non-injective map collapses together.
18+
--
19+
-- By depending on echo-types here, the type system and its formalisation
20+
-- share ONE mechanised notion of structured loss rather than two drifting
21+
-- definitions. Every theorem below is machine-checked under
22+
-- `--safe --without-K`, zero postulates, against the real echo-types
23+
-- source (registered in ~/.agda/libraries as `echo-types`).
24+
--
25+
-- See:
26+
-- * echo-types `EchoLinear.agda` (linear/affine modes; `weaken`)
27+
-- * echo-types `EchoResidue.agda` (`no-section-collapse-to-residue`)
28+
-- * echo-types `Echo.agda` (the fiber type itself)
29+
-- * nextgen-typing main chain: katagoria → typell → typed-wasm → PanLL
30+
-- (AffineScript & Ephapax cross-language calls go via typed-wasm).
31+
32+
module EchoTyping where
33+
34+
open import Echo using (Echo; echo-intro)
35+
open import EchoCharacteristic using (echo-true; echo-false; echo-true≢echo-false)
36+
open import EchoLinear
37+
using ( Mode; linear; affine; LEcho; weaken
38+
; weaken-collapses-distinction; no-section-weaken
39+
; affine-canonical; affine-all-equal
40+
; _≤m_; linear≤linear; linear≤affine; affine≤affine
41+
; degradeMode; degradeMode-comp )
42+
43+
open import Data.Product.Base using (Σ; _,_; _×_; proj₁; proj₂)
44+
open import Data.Empty using (⊥)
45+
open import Relation.Nullary using (¬_)
46+
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl)
47+
48+
49+
-- =====================================================================
50+
-- § 1. Affine weakening (AffineScript subtyping) is structured loss.
51+
-- =====================================================================
52+
--
53+
-- AffineScript types are affine: a `linear` value (used exactly once)
54+
-- may be subsumed to an `affine` value (used at most once). That
55+
-- subsumption FORGETS the linearity obligation. echo-types models the
56+
-- two modes as `LEcho linear` / `LEcho affine` and the subsumption as
57+
-- `weaken`. We re-export the load-bearing facts under typing names so a
58+
-- silent upstream change to echo-types trips this module.
59+
60+
-- The subtyping coercion linear ⊑ affine.
61+
affine-weakening : LEcho linear LEcho affine
62+
affine-weakening = weaken
63+
64+
-- Two distinct linear typings become indistinguishable once weakened:
65+
-- the type system cannot tell them apart at affine mode.
66+
affine-subtyping-forgets :
67+
affine-weakening echo-true ≡ affine-weakening echo-false
68+
affine-subtyping-forgets = weaken-collapses-distinction
69+
70+
-- No type checker can recover the linear typing from an affine one:
71+
-- the weakening coercion has NO section. This is the formal statement
72+
-- that affine subtyping is irreversibly information-losing.
73+
affine-subtyping-irreversible :
74+
¬ (Σ (LEcho affine LEcho linear)
75+
(λ reify e reify (affine-weakening e) ≡ e))
76+
affine-subtyping-irreversible = no-section-weaken
77+
78+
-- At affine mode every witness is equal: the linearity evidence is gone
79+
-- (affine typing is proof-irrelevant in its residue).
80+
affine-typing-proof-irrelevant : (e₁ e₂ : LEcho affine) e₁ ≡ e₂
81+
affine-typing-proof-irrelevant = affine-all-equal
82+
83+
-- The subsumption order on modes, and its echo-types degradation action.
84+
subsume : {m₁ m₂ : Mode} m₁ ≤m m₂ LEcho m₁ LEcho m₂
85+
subsume = degradeMode
86+
87+
-- Subtyping is coherent: coercing in two steps agrees with the direct
88+
-- coercion (degradation composes). Type inferred from echo-types so the
89+
-- pipeline inherits coherence rather than re-proving it.
90+
subsume-coherent = degradeMode-comp
91+
92+
93+
-- =====================================================================
94+
-- § 2. Refinement erasure is a fiber (the Echo of erasure).
95+
-- =====================================================================
96+
--
97+
-- A surface type system carries refinements (`pos`, `even`) that the
98+
-- typed-wasm / kernel layer erases to a single base type. Erasure is
99+
-- the lossy classifier; its Echo at the kernel type records WHICH
100+
-- surface refinement was discarded. This is a self-contained worked
101+
-- example: it builds the fiber, not merely re-exports it.
102+
103+
data SurfaceTy : Set where
104+
nat : SurfaceTy -- the base type
105+
pos : SurfaceTy -- refinement: a positive nat
106+
even : SurfaceTy -- refinement: an even nat
107+
108+
data KernelTy : Set where
109+
Nat : KernelTy
110+
111+
-- The kernel forgets all refinements: a non-injective erasure.
112+
erase : SurfaceTy KernelTy
113+
erase _ = Nat
114+
115+
-- The structured loss of erasure at `Nat`: which surface type erased here.
116+
ErasedFrom : KernelTy Set
117+
ErasedFrom k = Echo erase k
118+
119+
-- `pos` and `even` are distinct surface typings whose Echoes both live
120+
-- over the SAME kernel type — the refinement is lost in the codomain but
121+
-- retained in the fiber.
122+
echo-from-pos : ErasedFrom Nat
123+
echo-from-pos = echo-intro erase pos
124+
125+
echo-from-even : ErasedFrom Nat
126+
echo-from-even = echo-intro erase even
127+
128+
-- Distinct surface refinements really are distinct (the loss is real).
129+
surface-distinct : pos ≢ even
130+
surface-distinct ()
131+
132+
-- Erasure is non-injective, witnessed concretely: two surface types that
133+
-- erase to one kernel type yet are not equal. `Echo erase Nat` is the
134+
-- object the kernel would need to invert erasure — and cannot, in
135+
-- general, by the same no-section argument as affine weakening.
136+
erasure-non-injective :
137+
Σ SurfaceTy (λ s₁ Σ SurfaceTy (λ s₂
138+
(erase s₁ ≡ erase s₂) × (s₁ ≢ s₂)))
139+
erasure-non-injective = pos , even , refl , surface-distinct
140+
141+
142+
-- =====================================================================
143+
-- § 3. Headline pins (these names are the public typing API of Echo).
144+
-- =====================================================================
145+
--
146+
-- TP-ECHO-1 : affine subtyping forgets a distinction (§1)
147+
-- TP-ECHO-2 : affine subtyping is irreversible (no section)(§1)
148+
-- TP-ECHO-3 : refinement erasure is non-injective (§2)
149+
--
150+
-- A green typecheck of this module is the proof that the pipeline's
151+
-- structured-loss typing operations are exactly echo-types echoes.
152+
153+
TP-ECHO-1 : affine-weakening echo-true ≡ affine-weakening echo-false
154+
TP-ECHO-1 = affine-subtyping-forgets
155+
156+
TP-ECHO-2 :
157+
¬ (Σ (LEcho affine LEcho linear)
158+
(λ reify e reify (affine-weakening e) ≡ e))
159+
TP-ECHO-2 = affine-subtyping-irreversible
160+
161+
TP-ECHO-3 :
162+
Σ SurfaceTy (λ s₁ Σ SurfaceTy (λ s₂
163+
(erase s₁ ≡ erase s₂) × (s₁ ≢ s₂)))
164+
TP-ECHO-3 = erasure-non-injective

verification/proofs/agda/Properties.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# OPTIONS --safe --without-K #-}
12
-- SPDX-License-Identifier: MPL-2.0
23
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
34
--
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
-- SPDX-License-Identifier: MPL-2.0
3+
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
4+
--
5+
-- Aggregator for the nextgen-typing Agda verification layer.
6+
-- A single `agda Verification.agda` typechecks the whole set under
7+
-- `--safe --without-K`. EchoTyping wires in hyperpolymath/echo-types
8+
-- (registered as the `echo-types` Agda library; see nextgen-typing.agda-lib).
9+
--
10+
-- Named `Verification` rather than `All` to avoid a module-name clash
11+
-- with echo-types' own top-level `All` (a dependency on the include path).
12+
13+
module Verification where
14+
15+
open import Properties
16+
open import EchoTyping
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: nextgen-typing
2+
include: .
3+
depend: standard-library echo-types

0 commit comments

Comments
 (0)