sx-gitea Phase 4: issues — content-document bodies + relations graph (TDD, 360/360)

lib/gitea/issues.sx: issues as kv records (zero-padded per-repo
numbering, title/author/state, sorted label+assignee sets, Markdown
body, comment thread). Bodies and comments are content-on-sx documents:
content/from-markdown -> block doc -> content/html for pages, with the
round-trip law asserted in the suite. The issue graph (issue->repo
parent, author origin, assignee member, label link, commenter reply) is
DERIVED into lib/relations facts and rebuilt on fact change — same
pattern as the acl db, so deleting a repo can never dangle edges.

Views: open/closed/by-label/by-assignee; graph queries: repo-issue-nodes,
user-authored, user-assigned, label-issues, issue-participants.

Web: issues list + issue page (rendered HTML body + comments), JSON API:
create (any authenticated reader), comment, close/reopen (author or
write), label/assignee management (write). All read-gated like the rest.

Infra: gitea/route-packs registry — wire/issues append their routes at
load; gitea/app serves all packs. repo-delete! now purges collab/issue/
issue-seq rows too (ghost-state regression tested). Conformance runner
gains per-suite extra modules; the issues suite loads relations +
smalltalk + content (~5s).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 13:53:21 +00:00
parent 83a8a2f8db
commit d96529effe
8 changed files with 1423 additions and 33 deletions

View File

@@ -19,11 +19,14 @@ fi
VERBOSE="${1:-}"
# suite name | pass counter | fail counter | failures list
# suite name | pass counter | fail counter | failures list | extra modules (;-sep)
ISSUES_EXTRAS="lib/relations/schema.sx;lib/relations/engine.sx;lib/relations/api.sx;lib/smalltalk/tokenizer.sx;lib/smalltalk/parser.sx;lib/guest/reflective/class-chain.sx;lib/smalltalk/runtime.sx;lib/guest/reflective/env.sx;lib/smalltalk/eval.sx;lib/content/block.sx;lib/content/doc.sx;lib/content/render.sx;lib/content/api.sx;lib/content/meta.sx;lib/content/text.sx;lib/content/section.sx;lib/content/table.sx;lib/content/markdown.sx;lib/content/md-import.sx;lib/gitea/issues.sx"
SUITES=(
"repo|gitea-repo-pass|gitea-repo-fail|gitea-repo-fails"
"access|gitea-access-pass|gitea-access-fail|gitea-access-fails"
"wire|gitea-wire-pass|gitea-wire-fail|gitea-wire-fails"
"repo|gitea-repo-pass|gitea-repo-fail|gitea-repo-fails|"
"access|gitea-access-pass|gitea-access-fail|gitea-access-fails|"
"wire|gitea-wire-pass|gitea-wire-fail|gitea-wire-fails|"
"issues|gitea-issues-pass|gitea-issues-fail|gitea-issues-fails|$ISSUES_EXTRAS"
)
OUT_JSON="lib/gitea/scoreboard.json"
@@ -75,13 +78,16 @@ MODULES=(
)
run_suite() {
local suite=$1 passvar=$2 failvar=$3 failsvar=$4
local suite=$1 passvar=$2 failvar=$3 failsvar=$4 extras=$5
local file="lib/gitea/tests/${suite}.sx"
local TMP
TMP=$(mktemp)
{
echo "(epoch 1)"
for M in "${MODULES[@]}"; do echo "(load \"$M\")"; done
if [ -n "$extras" ]; then
for M in ${extras//;/ }; do echo "(load \"$M\")"; done
fi
echo "(epoch 2)"
echo "(load \"${file}\")"
echo "(epoch 3)"
@@ -122,8 +128,8 @@ TOTAL_FAIL=0
echo "Running sx-gitea conformance suite..." >&2
for entry in "${SUITES[@]}"; do
IFS='|' read -r s passvar failvar failsvar <<< "$entry"
read -r p f < <(run_suite "$s" "$passvar" "$failvar" "$failsvar")
IFS='|' read -r s passvar failvar failsvar extras <<< "$entry"
read -r p f < <(run_suite "$s" "$passvar" "$failvar" "$failsvar" "$extras")
SUITE_PASS[$s]=$p
SUITE_FAIL[$s]=$f
TOTAL_PASS=$((TOTAL_PASS + p))
@@ -136,7 +142,7 @@ done
printf ' "suites": {\n'
first=1
for entry in "${SUITES[@]}"; do
IFS='|' read -r s _ _ _ <<< "$entry"
IFS='|' read -r s _ _ _ _ <<< "$entry"
if [ $first -eq 0 ]; then printf ',\n'; fi
printf ' "%s": {"pass": %d, "fail": %d}' "$s" "${SUITE_PASS[$s]}" "${SUITE_FAIL[$s]}"
first=0
@@ -154,7 +160,7 @@ done
printf '| Suite | Pass | Fail | Total |\n'
printf '|-------|-----:|-----:|------:|\n'
for entry in "${SUITES[@]}"; do
IFS='|' read -r s _ _ _ <<< "$entry"
IFS='|' read -r s _ _ _ _ <<< "$entry"
p=${SUITE_PASS[$s]}
f=${SUITE_FAIL[$s]}
printf '| %s | %d | %d | %d |\n' "$s" "$p" "$f" "$((p+f))"