Literate source for Python scripts and the weaveback-graph prototype.
Tangle pass: dir = "scripts/", gen = "scripts/", << >> delimiters.
install.py
Cross-platform installer. Downloads the current split binaries from GitHub
releases (or builds them from source with --source). With --diagrams it
also installs a JDK for PlantUML rendering.
// <<@ >>=
#!/usr/bin/env python3
"""
install.py — weaveback installer
Installs the public weaveback binaries from GitHub releases (or builds them
from source). With --diagrams, also installs a JDK so you can use
--plantuml-jar.
Usage:
python3 install.py [options]
--diagrams Also install JDK (for PlantUML diagram rendering)
--source Build from source instead of downloading a release
--prefix DIR Install binary to DIR
default: ~/.local/bin (Unix)
%LOCALAPPDATA%\\Programs\\weaveback (Windows)
--version VER Install a specific release tag (default: latest)
"""
=
# ── Output helpers ─────────────────────────────────────────────────────────────
return
return is not None
=
return
=
=
= 0
= :
+=
= * 100 //
# ── Platform detection ─────────────────────────────────────────────────────────
= # 'Linux', 'Darwin', 'Windows'
= # 'x86_64', 'aarch64', 'AMD64', ...
=
= None
=
=
=
, , =
=
=
=
pass
=
break
== :
=
== :
=
break
return
# ── System dependency tables ───────────────────────────────────────────────────
=
== :
== :
== :
== :
== :
== :
== :
== :
return
=
return
=
# ── Binary installation ────────────────────────────────────────────────────────
=
= +
"""Return the preferred release asset type for this platform, or None."""
, = ,
return
return None # no macOS binaries yet
return
return None
= f + \
return
# Arch: prefer AUR
=
return
=
return
=
=
=
=
= /
= /
= /
= /
== :
= f
= / f
=
= / f
= /
=
= False
# type: ignore[import-untyped]
=
, =
=
=
# ── Verify ────────────────────────────────────────────────────────────────────
=
= True
=
= False
= False
return
# ── Main ──────────────────────────────────────────────────────────────────────
=
return / /
return / /
=
=
= or
=
=
// @
gliner_experiment.py
Experimental script: uses the GLiNER NLP model to extract semantic entities (constraints, intents, dependencies) from architecture documentation.
// <<@ >>=
# scripts/gliner_experiment.py
# Load GLiNER model (using a widely supported base model for verification)
=
# Path to architecture docs
=
return
=
# Semantic labels based on "Intent and Constraint" extraction
=
# Process in smaller chunks (paragraphs) for higher precision
=
=
# Lower threshold for exploration, but we'll print confidence
=
=
=
=
=
# Keep highest score for each unique text
=
# Sort by confidence
=
// @
weaveback-graph
A prototype knowledge-graph explorer for the weaveback workspace using the
real-ladybug graph database.
pyproject.toml
// <<@file weaveback-graph/pyproject.toml>>=
[project]
name = "weaveback-graph"
version = "0.1.0"
description = "Add your description here"
authors = [
{ name = "giannifer7", email = "gianni.ferrarotti@gmail.com" }
]
requires-python = ">=3.14"
dependencies = [
"real-ladybug>=0.15.2",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
// @
.python-version
// <<@file weaveback-graph/.python-version>>= 3.14 // @
src/weaveback_graph/init.py
// <<@ -///>>=
return
// @
src/weaveback_graph/py.typed
PEP 561 marker file — empty, signals that this package ships type stubs.
// <<@file weaveback-graph/src/weaveback_graph/py.typed>>= // @
src/weaveback_graph/main.py
// <<@ -///>>=
"""Define the Project Knowledge Graph schema."""
# Node Tables
# Relationship Tables
"""Populate the graph by scanning Weaveback workspace."""
= /
return
# 1. Add Crates
=
# 2. Add Files owned by Crate
= /
=
# 3. Simple dependency modeling (hardcoded for this example)
=
"""Run example Cypher queries to show the graph's power."""
=
=
=
=
=
# Robust cleanup
=
=
# Find project root reliably
=
=
=
// @