Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
15dbc83
feat: port to latest gno and interrealm v2 (cross(cur))
davd-gzl Jun 3, 2026
60c4bf0
feat: repoint avl to p/samcrew/avl fork for topaz-1 (original package…
zxxma Jul 18, 2026
4b6175c
ci: vendor the dependency closure so the build stops depending on a l…
zxxma Jul 20, 2026
6c817e8
ci: close the provenance guard's blind spots and add upstream attribu…
zxxma Jul 20, 2026
ad971e5
Merge pull request #68 from samouraiworld/chore/vendor-dep-closure
zxxma Jul 20, 2026
7a18b35
fix(daocond,basedao): a guaranteed render panic, a permanent DAO bric…
zxxma Jul 20, 2026
e40fdbc
fix(basedao,daokit): bind the DAO's identity to its own live realm
zxxma Jul 20, 2026
eee13ee
fix(basedao): reject empty member ids
davd-gzl Jul 20, 2026
8c8ef04
fix(daokit,daocond,basedao): settle three permanent mistakes in the e…
zxxma Jul 20, 2026
94c3a3a
docs: correct every call form the freeze would otherwise publish wrong
zxxma Jul 20, 2026
9609253
fix(basedao): reject empty role names, and never substitute one into …
zxxma Jul 20, 2026
bf4ad9e
fix(docs): make the frozen examples actually build, and keep them tha…
zxxma Jul 20, 2026
41c6ea3
chore: pin the toolchain to topaz-1's own ref and regenerate vendored/
zxxma Jul 20, 2026
5297251
fix(daokit): stop reading a proposal from moving it, and close the re…
zxxma Jul 20, 2026
0c5d034
fix(basedao,daokit): gate private extensions on the DAO's own realm, …
zxxma Jul 20, 2026
201a67c
fix(basedao): stop a DAO takeover from being as cheap as adding a member
zxxma Jul 20, 2026
01e63c8
docs(daokit,daodemo): pin InstantExecute as same-realm, and warn wher…
zxxma Jul 20, 2026
de510ee
fix(basedao): conjoin the migration condition instead of replacing it
zxxma Jul 20, 2026
45a9151
docs(daokit,basedao): say what Private actually protects
zxxma Jul 20, 2026
6d29025
fix(daokit,basedao): resolve the lifecycle inconsistencies review fou…
zxxma Jul 20, 2026
ab9a315
docs(daokit): pin what makes an action's rendering trustworthy (gnoda…
zxxma Jul 20, 2026
1eabd78
Revert "remove exported UpdateStatus", keeping the invariant that mak…
zxxma Jul 20, 2026
6525958
Merge pull request #69 from samouraiworld/fix/dao-caller-identity
zxxma Jul 20, 2026
391e097
Merge pull request #70 from samouraiworld/freeze/exported-surface
zxxma Jul 20, 2026
221c0c1
Merge pull request #71 from samouraiworld/chore/repin-gnoversion-topaz
zxxma Jul 20, 2026
0eb8518
Merge pull request #72 from samouraiworld/fix/proposal-lifecycle-and-…
zxxma Jul 20, 2026
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
51 changes: 51 additions & 0 deletions .github/scripts/check-readme-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# The READMEs ship with the frozen package, so a sample that does not build is as
# permanent as a wrong signature — and both "Complete Example" blocks did not
# build. gno/r/readme_*_example compile them and run their init, but that only
# means anything while they still say what the README says. This re-extracts each
# block and diffs it, so the two cannot drift apart silently.
set -euo pipefail

extract() { # <markdown> <package>
python3 -c '
import re, sys
md, pkg = sys.argv[1], sys.argv[2]
for b in re.findall(r"```go\n(.*?)```", open(md).read(), re.S):
if "func init(cur realm)" in b and "basedao.New" in b:
sys.stdout.write(b.replace("package my_dao", "package " + pkg))
break
else:
sys.exit("no Complete Example block found in " + md)
' "$1" "$2"
}

check() { # <markdown> <fixture> <package>
local md="$1" fixture="$2" pkg="$3"
extract "$md" "$pkg" > /tmp/readme-extracted.gno
if [[ ! -s /tmp/readme-extracted.gno ]]; then
echo "ERROR: extracted nothing from $md — the block markers changed"
return 1
fi
# The fixture carries a header comment the README does not; drop everything
# before its package clause. Done in python because BSD and GNU sed disagree
# about the range-with-block form.
python3 -c '
import sys
lines = open(sys.argv[1]).read().split("\n")
for i, l in enumerate(lines):
if l.startswith("package "):
sys.stdout.write("\n".join(lines[i:]))
break
else:
sys.exit("no package clause in " + sys.argv[1])
' "$fixture" > /tmp/readme-fixture.gno
if ! diff -u /tmp/readme-extracted.gno /tmp/readme-fixture.gno; then
echo "ERROR: $md's Complete Example no longer matches $fixture."
echo "They are compiled together on purpose. Update both."
return 1
fi
echo "OK: $md matches $fixture"
}

check README.md gno/r/readme_root_example/sample.gno readme_root_example
check gno/p/basedao/README.md gno/r/readme_basedao_example/sample.gno readme_basedao_example
28 changes: 25 additions & 3 deletions .github/workflows/gno-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,38 @@ jobs:
gno-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v5
with:
go-version-file: go.mod
cache-key-suffix: gno

- name: Lint gno
run: make lint
# The build must resolve every dependency from vendored/ — see vendored/README.md.
# A `gno: downloading` line means the closure is incomplete and the build has
# silently gone back to fetching from a mutable testnet, which is what kept CI
# red from 2026-06-04. Fail loudly rather than depend on the network again.
- name: Lint gno (and assert the build is hermetic)
env:
# A warm module cache short-circuits the fetch BEFORE the "downloading"
# line is printed, which would silently disable the check below. Force a
# cold cache so the guard always has something to observe.
GNOHOME: ${{ runner.temp }}/gnohome-lint
run: |
set -o pipefail
# Capture the status rather than letting errexit abort here: on a real
# failure we still want to report WHY, and the missing-package advice
# below is written for exactly the case where make lint fails.
rc=0
make lint 2>&1 | tee /tmp/lint.out || rc=$?
if grep -q 'gno: downloading' /tmp/lint.out; then
echo "ERROR: the build fetched dependencies from the network:"
grep 'gno: downloading' /tmp/lint.out
echo "Add the missing packages to vendored/ (see vendored/README.md)."
exit 1
fi
exit $rc

- name: gno mod tidy
run: make gno-mod-tidy
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/gno-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ jobs:
cache-key-suffix: gno

- name: Test gno
run: make test
run: make test

# The READMEs ship with the frozen package, so a sample that does not
# build is as permanent as a wrong signature. See the script for why.
- name: README examples match their compiled fixtures
run: ./.github/scripts/check-readme-examples.sh
177 changes: 177 additions & 0 deletions .github/workflows/vendored-provenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: Vendored Provenance

on:
push:
branches:
- main
pull_request:
merge_group:

# vendored/ removes the network from the build, but only helps if what is vendored
# is genuinely the upstream source at the pinned compiler version. This job proves
# that byte-for-byte in BOTH directions, so vendored/ cannot drift from GNOVERSION
# unnoticed — which would reintroduce exactly the version skew vendoring exists to
# eliminate.
jobs:
vendored-provenance:
name: Vendored matches gno@GNOVERSION
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# GNOVERSION comes from the checked-out tree, so on a fork PR it is
# attacker-controlled. Validate it is a bare hex sha and pass it through the
# environment — never interpolate it into a run: block, where a value
# containing a quote could break out of the command.
- name: Read and validate the pinned GNOVERSION
id: pin
run: |
set -euo pipefail
# tail -1, not head -1: make uses last-assignment-wins, so a second
# GNOVERSION= line is what the build would actually use.
ref="$(sed -n 's/^GNOVERSION=//p' Makefile | tail -1 | tr -d '[:space:]')"
if [[ ! "$ref" =~ ^[0-9a-f]{7,40}$ ]]; then
echo "ERROR: GNOVERSION is not a bare hex sha: '$ref'"
exit 1
fi
echo "ref=$ref" >> "$GITHUB_OUTPUT"
echo "GNOVERSION=$ref"

- name: Fetch gnolang/gno at the pinned ref
env:
GNO_REF: ${{ steps.pin.outputs.ref }}
run: |
set -euo pipefail
git clone --filter=blob:none --no-checkout https://github.com/gnolang/gno /tmp/gno
git -C /tmp/gno checkout --quiet "$GNO_REF" -- examples

# Files that are deliberately NOT upstream. Anything added here weakens the
# guard, so each entry states why it is exempt.
- name: No symlinks may enter vendored/
run: |
set -euo pipefail
# `find -type f` silently skips symlinks, but the gno loader follows them,
# so a symlinked .gno would be compiled while the byte-comparison below
# never saw it. Refuse them outright rather than try to resolve them.
links="$(find vendored -type l)"
if [[ -n "$links" ]]; then
echo "ERROR: vendored/ contains symlinks, which the byte-comparison cannot verify:"
printf '%s\n' "$links"
exit 1
fi
echo "no symlinks in vendored/"

- name: Every vendored file must be byte-identical to upstream
env:
GNO_REF: ${{ steps.pin.outputs.ref }}
run: |
set -euo pipefail
drift=0
checked=0
skipped=0
# `! -type d` rather than `-type f`, so anything that is neither a regular
# file nor a directory is surfaced instead of silently skipped.
while IFS= read -r f; do
rel="${f#vendored/}"
case "$rel" in
# The fork is deliberately NOT upstream: topaz-1's stdlib avl Get is
# single-value while this codebase calls the two-value form. Its own
# provenance is guarded in samouraiworld/samcrew-deployer against
# upstream f3d5a5d13. See vendored/README.md.
gno.land/p/samcrew/avl/*) skipped=$((skipped + 1)); continue ;;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Critical: the exemption is a directory prefix, but the compiler resolves a package by the module line in its gnomod.toml. A directory under the exempt prefix can therefore claim any package path and become what the build compiles, while the job reports no drift and lint stays clean.

repro
# from a local clone of samouraiworld/gnodaokit:
gh pr checkout 65 -R samouraiworld/gnodaokit
go build -o /tmp/gno-topaz github.com/gnolang/gno/gnovm/cmd/gno@fc40526511474e40b8a66419f5ba28255085bc08

git clone --filter=blob:none --no-checkout https://github.com/gnolang/gno /tmp/gnoup
git -C /tmp/gnoup checkout --quiet fc40526511474e40b8a66419f5ba28255085bc08 -- examples

# A shadow package under the exempt prefix, claiming piechart's path. Its Render
# drops the title parameter, so whichever copy compiles is observable.
mkdir -p vendored/gno.land/p/samcrew/avl/shadow
printf 'module = "gno.land/p/samcrew/piechart"\ngno = "0.9"\n' > vendored/gno.land/p/samcrew/avl/shadow/gnomod.toml
sed 's|^func Render(slices \[\]PieSlice, title string) string {|func Render(slices []PieSlice) string {\n\ttitle := "SHADOWED"|' \
  vendored/gno.land/p/samcrew/piechart/piechart.gno > vendored/gno.land/p/samcrew/avl/shadow/piechart.gno

# The workflow's own byte-comparison loop.
drift=0; checked=0
while IFS= read -r f; do
  rel="${f#vendored/}"
  case "$rel" in
    gno.land/p/samcrew/avl/*) continue ;;
    README.md|NOTICE|LICENSE.md) continue ;;
  esac
  checked=$((checked + 1))
  if [ ! -f "/tmp/gnoup/examples/$rel" ]; then echo "MISSING UPSTREAM: $rel"; drift=$((drift+1));
  elif ! cmp -s "$f" "/tmp/gnoup/examples/$rel"; then echo "DRIFT: $rel"; drift=$((drift+1)); fi
done < <(find vendored ! -type d)
echo "provenance: checked $checked, drift $drift"

/tmp/gno-topaz lint ./gno/...

rm -rf vendored/gno.land/p/samcrew/avl/shadow /tmp/gnoup
provenance: checked 118, drift 0
gno/p/basedao/view_members_page.gno:40:35: too many arguments in call to piechart.Render
	have ([]piechart.PieSlice, string)
	want ([]piechart.PieSlice) (code=gnoTypeCheckError)

Provenance passes, and the compile error is against the shadow's signature, so the shadow is what the build resolved. Keep the signature identical and the substitution is silent: with a byte-copy of piechart parked there, provenance reports the same drift 0, lint ./gno/... exits 0 and test ./gno/p/basedao is ok.

# Our own documentation and attribution, not upstream source.
README.md|NOTICE|LICENSE.md) skipped=$((skipped + 1)); continue ;;
esac
checked=$((checked + 1))
if [[ ! -f "/tmp/gno/examples/$rel" ]]; then
echo "MISSING UPSTREAM: $rel is not in examples/ at the pinned ref"
drift=$((drift + 1))
elif ! cmp -s "$f" "/tmp/gno/examples/$rel"; then
echo "DRIFT: $rel differs from upstream"
diff -u "/tmp/gno/examples/$rel" "$f" | head -20 || true
drift=$((drift + 1))
fi
done < <(find vendored ! -type d)

# A vacuous pass would be worse than a failure: if the find ever stops
# matching, this job would go green while checking nothing at all.
if [[ $checked -eq 0 ]]; then
echo "ERROR: no vendored files were checked — the layout or the glob changed"
exit 1
fi

# The reverse direction. The loop above only sees files that EXIST here,
# so deleting one is invisible to it — and a silently truncated package
# still lints clean. Walk upstream's copy of every vendored package and
# require each file to be present.
missing=0
while IFS= read -r pkgdir; do
rel="${pkgdir#vendored/}"
case "$rel" in gno.land/p/samcrew/avl*) continue ;; esac
[[ -d "/tmp/gno/examples/$rel" ]] || continue
# Only compare directories we actually vendored as PACKAGES. Walking
# intermediate namespace dirs (gno.land, gno.land/p, gno.land/r) would
# demand every upstream file at that level — files we deliberately
# never vendored — and report them all as deletions.
if [[ -z "$(find "$pkgdir" -maxdepth 1 -name '*.gno' -print -quit)" ]]; then
continue
fi
while IFS= read -r uf; do
urel="${uf#/tmp/gno/examples/}"
if [[ ! -f "vendored/$urel" ]]; then
echo "DELETED: vendored/$urel exists upstream but not here"
missing=$((missing + 1))
fi
done < <(find "/tmp/gno/examples/$rel" -maxdepth 1 -type f)
done < <(find vendored -type d)

echo "checked $checked file(s), skipped $skipped (fork + docs), drift $drift, deleted $missing"
if [[ $drift -gt 0 || $missing -gt 0 ]]; then
echo "ERROR: vendored/ has drifted from gno@$GNO_REF"
echo "Either regenerate vendored/ (see vendored/README.md) or revert the edit."
exit 1
fi

# Keeps the two avl roles from being confused.
#
# The stdlib p/nt/avl/v0 is here only because svg.Canvas.Style is a
# *nt/avl/v0.Tree; the data-structure role belongs to the p/samcrew/avl fork,
# whose Get is two-value. GNOVERSION is now topaz-1's own ref, so the vendored
# stdlib copy matches the chain and a misuse fails the build directly — this
# gate exists to say WHY it failed, and to keep the boundary from widening by
# accident. When the pin was older than the chain, this was the only thing
# standing between a green build and a failed AddPackage.
- name: The stdlib-avl boundary must stay limited to NewTree
run: |
set -euo pipefail
uses="$(grep -rhoE 'ntavl\.[A-Za-z_]+' gno/ --include='*.gno' | sort -u)"
if [[ -z "$uses" ]]; then
echo "no ntavl usage found — the alias was removed, which is fine"
exit 0
fi
echo "ntavl usage: $uses"
unexpected="$(printf '%s\n' "$uses" | grep -vx 'ntavl.NewTree' || true)"
if [[ -n "$unexpected" ]]; then
echo "ERROR: gnodaokit uses the stdlib avl beyond NewTree:"
printf '%s\n' "$unexpected"
echo "The stdlib avl is vendored only for the svg.Canvas.Style ABI; its Get"
echo "is single-value on topaz-1 and here. Use gno.land/p/samcrew/avl for"
echo "data structures — that is the fork with the two-value Get."
exit 1
fi
echo "stdlib avl boundary is limited to NewTree, as required"

- name: The fork must expose the two-value Get this codebase calls
run: |
set -euo pipefail
tree="vendored/gno.land/p/samcrew/avl/tree.gno"
if [[ ! -f "$tree" ]]; then
echo "ERROR: the vendored p/samcrew/avl fork is missing"
exit 1
fi
if ! grep -qE 'func \(tree \*Tree\) Get\(key string\) \(value any, exists bool\)' "$tree"; then
echo "ERROR: vendored p/samcrew/avl no longer exposes the two-value Get:"
grep -nE 'func \(tree \*Tree\) Get\(' "$tree" || true
exit 1
fi
echo "p/samcrew/avl exposes the two-value Get, as this codebase requires"
Comment on lines +164 to +177

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The fork is checked only by grepping its Get signature, so a change to the read path every member, role and proposal lookup goes through passes every gate. vendored/README.md:36 names samouraiworld/samcrew-deployer as the guard that pins the fork; that repository is private, so a reader of this one cannot verify the claim either.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GNOVERSION=4e80c37e8d1870aa5d3b01966ed4c5dfa18a7566
GNOVERSION=fc40526511474e40b8a66419f5ba28255085bc08
GNO=go run github.com/gnolang/gno/gnovm/cmd/gno@${GNOVERSION}

.PHONY: dev
Expand Down
Loading
Loading