Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
64cfbf7
chore: remove informal/ from main
Xinze-Li-Moqian May 27, 2026
8b9c2c9
Merge pull request #39 from MathNetwork/chore/remove-informal-from-main
Xinze-Li-Moqian May 27, 2026
4c77144
Merge pull request #43 from MathNetwork/development
Xinze-Li-Moqian May 27, 2026
7a5c46d
Merge pull request #45 from MathNetwork/development
Xinze-Li-Moqian May 27, 2026
8d9b297
chore: remove all non-facade code from main
Xinze-Li-Moqian May 27, 2026
8e6eb85
Merge pull request #49 from MathNetwork/chore/clean-main
Xinze-Li-Moqian May 27, 2026
39bd03e
chore: strip main to Hypergraph definition + linters only
Xinze-Li-Moqian May 27, 2026
84ac686
Merge pull request #52 from MathNetwork/chore/minimal-main
Xinze-Li-Moqian May 27, 2026
48e32aa
chore: add pre-push hook + update CONTRIBUTING.md
Xinze-Li-Moqian May 27, 2026
fffbecd
Merge pull request #53 from MathNetwork/chore/pre-push-hook
Xinze-Li-Moqian May 27, 2026
8b3cc83
refactor: remove BDF naming from Hypergraph definition
Xinze-Li-Moqian May 27, 2026
718baed
Merge pull request #54 from MathNetwork/chore/remove-bdf-naming
Xinze-Li-Moqian May 27, 2026
a83ad8c
refactor: replace Hypergraph code with design spec only
Xinze-Li-Moqian May 27, 2026
8fd5c83
Merge pull request #56 from MathNetwork/chore/spec-only-basic
Xinze-Li-Moqian May 27, 2026
6fb88fd
docs(readme): sync with spec-only main
Xinze-Li-Moqian May 27, 2026
fffa07c
Merge pull request #57 from MathNetwork/docs/readme-sync
Xinze-Li-Moqian May 27, 2026
0dff96b
chore: clean docs, add phase-1 checklist
Xinze-Li-Moqian May 27, 2026
3e69f60
Merge pull request #59 from MathNetwork/chore/clean-docs
Xinze-Li-Moqian May 27, 2026
78a219c
docs(milestones): add two-layer Astrolabe architecture to phase-1
Xinze-Li-Moqian May 27, 2026
a8a3c5b
Merge pull request #60 from MathNetwork/docs/phase1-astrolabe
Xinze-Li-Moqian May 27, 2026
7db8388
docs(spec): update Basic.lean with two-layer Astrolabe architecture
Xinze-Li-Moqian May 27, 2026
c2c1f7c
Merge pull request #61 from MathNetwork/docs/basic-spec-update
Xinze-Li-Moqian May 27, 2026
3e340e9
docs(milestones): three-layer architecture spec with definitions
Xinze-Li-Moqian May 27, 2026
06c6adc
Merge pull request #62 from MathNetwork/docs/phase1-definitions
Xinze-Li-Moqian May 27, 2026
7a790fa
feat: add AstroNerve Layer 0 structure (#58)
Xinze-Li-Moqian May 27, 2026
fe1ca5c
feat: Layer 0 AstroNerve + AstroNet, separate Demo/ (#58)
Xinze-Li-Moqian May 27, 2026
166538b
feat(ci): add demo coverage + demo build checks to lint.sh
Xinze-Li-Moqian May 27, 2026
a34c63c
Merge pull request #63 from MathNetwork/feat/58-astronerve
Xinze-Li-Moqian May 27, 2026
b327688
chore: rename AstroCore → Astrolabe
Xinze-Li-Moqian May 27, 2026
3f4d7ac
Merge pull request #65 from MathNetwork/chore/rename-astrolabe
Xinze-Li-Moqian May 27, 2026
64715c0
feat(astrolabe): depth filtration, cycle detection, standard methods
Xinze-Li-Moqian May 27, 2026
b45d8e4
Merge pull request #66 from MathNetwork/feat/astrolabe-methods
Xinze-Li-Moqian May 27, 2026
0299bb3
feat(astrolabe): add SCC, canReach, printCycles
Xinze-Li-Moqian May 27, 2026
8c637c8
Merge pull request #67 from MathNetwork/feat/64-astro-widget
Xinze-Li-Moqian May 27, 2026
6cf1907
chore: clean site to match spec-only main
Xinze-Li-Moqian May 27, 2026
167eb27
Merge pull request #68 from MathNetwork/chore/clean-site
Xinze-Li-Moqian May 27, 2026
4873c0d
feat: doc-gen4 integration + docstrings (#69)
Xinze-Li-Moqian May 28, 2026
4a7b476
Merge pull request #70 from MathNetwork/feat/69-verso-docs
Xinze-Li-Moqian May 28, 2026
9321b0a
chore: drop development branch, simplify to feature → main (#74)
Xinze-Li-Moqian May 28, 2026
663ddae
merge: sync development with main
Xinze-Li-Moqian May 28, 2026
3338af3
chore: restore branch strategy (feat → development → main)
Xinze-Li-Moqian May 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 15 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,32 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
# Enforce branch strategy (ADR 0007):
# PR to main → source must be development
# PR to development → source must be feat/fix/chore/docs/refactor
- name: Check branch strategy
run: |
TARGET="${{ github.base_ref }}"
SOURCE="${{ github.head_ref }}"
# Feature branches → development only
if [[ "$SOURCE" =~ ^(feat|fix|chore|docs|refactor)/ && "$TARGET" != "development" ]]; then
echo "::error::Feature branches must target development, not $TARGET."
exit 1
fi
# PRs to main → must come from development
if [[ "$TARGET" == "main" && "$SOURCE" != "development" ]]; then
echo "::error::PRs to main must come from the development branch."
echo "Workflow: feature branch → development → main"
echo "::error::PRs to main must come from development."
exit 1
fi
if [[ "$TARGET" == "development" && ! "$SOURCE" =~ ^(feat|fix|chore|docs|refactor)/ ]]; then
echo "✓ branch strategy OK: $SOURCE → $TARGET"

- name: Check branch naming
run: |
SOURCE="${{ github.head_ref }}"
if [[ "$SOURCE" == "development" ]]; then exit 0; fi
if [[ ! "$SOURCE" =~ ^(feat|fix|chore|docs|refactor)/ ]]; then
echo "::error::Branch '$SOURCE' does not follow naming convention."
echo "Must start with: feat/, fix/, chore/, docs/, or refactor/"
exit 1
fi
echo "✓ branch strategy OK: $SOURCE → $TARGET"
echo "✓ branch naming OK: $SOURCE"

- name: Check PR title
run: |
Expand Down
13 changes: 7 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ enforcement lives in CI and the Lean type system, not here.

## Enforced automatically

- **Docstring tags** — `**Math.**` / `**Eng.**` / `**Mixed.**`
on public declarations (`Util/Linter/MathTag.lean`).
- **Docstring required** — every public declaration must have a
`/-- ... -/` docstring (`Util/Linter/DocstringRequired.lean`).
- **No `import Mathlib`** — full import banned; Lean syntax linter
`Util/Linter/ImportBan.lean` enforces at build time.
- **Build green** — `lake build` must pass.
- **Branch protection** — `main` and `development` both protected;
- **Branch protection** — `main` and `development` protected;
no direct push, PRs only.
- **Branch strategy** — PRs to `main` must come from `development`.
PRs to `development` must come from `feat/`/`fix/`/`chore/`/
`docs/`/`refactor/` branches. CI enforces.
- **Branch strategy** — feature branches (`feat/`/`fix/`/`chore/`/
`docs/`/`refactor/`) → `development` → `main`. CI enforces.
- **Branch naming** — branches must start with `feat/`/`fix/`/`chore/`/
`docs/`/`refactor/`. CI enforces.
- **PR title** — must match `type(scope): summary`. CI enforces.

## Conventions (not yet automated)
Expand Down
3 changes: 2 additions & 1 deletion lean/ProofAtlas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Copyright (c) 2026 MathNetwork. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: MathNetwork
-/
import ProofAtlas.Util.Linter
import ProofAtlas.Util.Linter.MathTag
import ProofAtlas.Util.Linter.ImportBan
import ProofAtlas.Astrolabe.Nerve
import ProofAtlas.Astrolabe.Net
import ProofAtlas.Hypergraph.Basic
Expand Down
37 changes: 19 additions & 18 deletions lean/ProofAtlas/Astrolabe/Nerve.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Copyright (c) 2026 MathNetwork. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: MathNetwork
-/
import ProofAtlas.Util.Linter

/-!
# AstroNerve — a node in a content-addressable hypergraph
Expand All @@ -12,9 +11,9 @@ Identity is computed from record + refs (Merkle property).
Each reference carries an abstract role tag.
-/

/-- A node in a content-addressable hypergraph.
`refs`: ordered references with role tags. `record`: content.
Identity computed from record + refs via `identify`. -/
-- Two fields: refs (ordered references with roles) and record (content).
-- Id, Role, Record are abstract types. identify computes id from
-- record + refs — content-addressing by construction.
structure AstroNerve {Id : Type} {Role : Type} {Record : Type}
(identify : Record → Array (Role × Id) → Id) where
refs : Array (Role × Id)
Expand All @@ -26,42 +25,43 @@ namespace AstroNerve
variable {Id : Type} {Role : Type} {Record : Type}
{identify : Record → Array (Role × Id) → Id}

/-- Compute identity from record + refs. Not stored — always derived. -/
-- Compute identity from record + refs. Not stored — always derived.
def id (n : AstroNerve identify) : Id := identify n.record n.refs

/-- Number of references this nerve has. -/
-- Number of references this nerve has.
def width (n : AstroNerve identify) : Nat := n.refs.size

/-- True if the nerve has no references (an atom / leaf node). -/
-- True if the nerve has no references (an atom / leaf node).
def isAtom (n : AstroNerve identify) : Bool := n.refs.isEmpty

/-- All referenced ids, in order, without roles. -/
-- All referenced ids, in order, without roles.
def refIds (n : AstroNerve identify) : Array Id := n.refs.map (·.2)

/-- All roles, in order, without ids. -/
-- All roles, in order, without ids.
def refRoles (n : AstroNerve identify) : Array Role := n.refs.map (·.1)

/-- Does this nerve reference a given id? -/
-- Does this nerve reference a given id?
def containsRef [BEq Id] (n : AstroNerve identify) (i : Id) : Bool :=
n.refs.any (fun ref => ref.2 == i)

/-- Get the i-th ref. Returns `none` if out of bounds. -/
-- Get the i-th ref (returns Option to handle out-of-bounds).
def refAt (n : AstroNerve identify) (i : Nat) : Option (Role × Id) :=
n.refs[i]?

/-- Add a ref at the end. Returns a new nerve with a new id. -/
-- Add a ref at the end. Returns a new nerve (new id, Merkle property).
def pushRef (n : AstroNerve identify) (ref : Role × Id) : AstroNerve identify :=
{ refs := n.refs.push ref, record := n.record }

/-- Remove the last ref. Returns a new nerve with a new id. -/
-- Remove the last ref. Returns a new nerve (new id).
def popRef (n : AstroNerve identify) : AstroNerve identify :=
{ refs := n.refs.pop, record := n.record }

/-- Keep only refs matching a predicate. Returns a new nerve. -/
-- Keep only refs matching a predicate. Returns a new nerve (new id).
def filterRefs (n : AstroNerve identify) (p : (Role × Id) → Bool) : AstroNerve identify :=
{ refs := n.refs.filter p, record := n.record }

/-- Swap two refs by index. Returns a new nerve with a new id. -/
-- Swap two refs by index. Returns a new nerve (new id).
-- Panics if indices out of bounds.
def swapRefs [Inhabited Role] [Inhabited Id]
(n : AstroNerve identify) (i j : Nat) : AstroNerve identify :=
let a := n.refs
Expand All @@ -70,17 +70,18 @@ def swapRefs [Inhabited Role] [Inhabited Id]
let a := a.set! j tmp
{ refs := a, record := n.record }

/-- Reverse the order of all refs. Returns a new nerve. -/
-- Reverse the order of all refs. Returns a new nerve (new id).
def reverseRefs (n : AstroNerve identify) : AstroNerve identify :=
{ refs := n.refs.reverse, record := n.record }

/-- Replace ref at position i. Returns a new nerve with a new id. -/
-- Replace ref at position i. Returns a new nerve (new id).
-- Panics if index out of bounds.
def setRef (n : AstroNerve identify) (i : Nat) (ref : Role × Id) : AstroNerve identify :=
{ refs := n.refs.set! i ref, record := n.record }

end AstroNerve

/-- Show nerve as `Nerve(id=..., width=N)`. -/
-- ToString: show nerve as "Nerve(id=..., width=N)".
instance {Id Role Record : Type} {identify : Record → Array (Role × Id) → Id}
[ToString Id] : ToString (AstroNerve identify) where
toString n := s!"Nerve(id={n.id}, width={n.width})"
Loading
Loading