v1.3.0 release: graceful-release fix, quickstart template + demo, documentation accuracy pass

- Fixed: SynthesizerBase subclasses' release/free now dispatch correctly (gated
  synths were hard-freed instead of released).
- New: quickstart project template + LyrebirdQuickstartDemo.
- Docs: every example typechecked or provably illustrative (426->542); ~20
  wrong-API examples fixed; root docs brought under the compile guard.
- Fixed: NRT/Score demo Package.swift build from terminal again.

See RELEASES.md for details.
This commit is contained in:
2026-07-17 14:05:01 -07:00
parent 63d6e0746f
commit 560724d116
149 changed files with 5010 additions and 1029 deletions
+75
View File
@@ -0,0 +1,75 @@
#!/usr/bin/env bash
# check-doc-impact.sh
#
# Reports which docs a diff's public-API changes may have invalidated.
#
# Doc rot is overwhelmingly *caused* by a public-API change, and a review that reads only
# the diff structurally cannot find it — the stale references live in files the diff never
# touches. Every incident in this series has that shape:
# - `engine.add` gained `throws`; 11 examples elsewhere kept calling it without `try`.
# - `LyrebirdFloat` was deleted; 75 references elsewhere outlived it.
# - `maxEventsPerBlock` was added; it reached zero .docc files in the cycle it shipped.
#
# Unlike the other guards this one **reports and never fails**. It cannot tell
# "intentionally unaffected" from "forgotten", and a check that cannot judge must not
# block. It hands `/lyrebird_review` a list to adjudicate.
#
# It deliberately SUPPRESSES references inside fences that check-doc-snippets.sh already
# typechecks — re-reporting those would bury the references nobody is checking.
#
# Usage:
# bash scripts/check-doc-impact.sh # default: origin/main...HEAD
# (three-dot: merge-base relative, matching /lyrebird_review's branch.diff)
# bash scripts/check-doc-impact.sh <git-range> # e.g. main..HEAD, abc123~1..abc123
#
# Exit 0 always (advisory). Fast — no build required.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
if [[ $# -gt 1 ]]; then
echo "usage: $0 [<git-range>|--self-test]" >&2
exit 2
fi
# --self-test regresses the DETECTION logic against this repo's own history: the real
# commits that caused the real incidents. The first version of this tool silently reported
# "no doc impact" for `public init` changes — i.e. for the very incident it cites — and
# nothing caught that but a review. These assertions would have.
if [[ "${1:-}" == "--self-test" ]]; then
fail=0
check() { # <range> <expected-substring> <what>
# No pipe into `grep -q`. Under `set -o pipefail`, grep exits on its first match,
# the writer upstream dies of SIGPIPE, and the pipeline reports failure — so a
# PASSING assertion looks like a failure. It bit twice here (once with python3
# upstream, once with printf), and only for the largest report, because a small
# writer finishes before grep exits. Match in-shell instead.
local out
out="$(python3 "$ROOT/scripts/doc_impact.py" "$ROOT" "$1" 2>&1 || true)"
if [[ "$out" == *"$2"* ]]; then
echo " ok $3"
else
echo " FAIL $3 — expected to see '$2'" >&2
fail=1
fi
}
echo "[self-test] detection, against the commits that caused the real incidents:"
# f4b5be6 converted engine.add to throwing; 11 doc examples then kept calling it
# without `try` for months.
check "f4b5be6~1..f4b5be6" "SynthesisEngine.add" "throwing-ness change on a public func"
# da9edab added maxEventsPerBlock to SynthesisEngine.init — a multi-line `public init`,
# the shape the first version of this tool was completely blind to.
check "da9edab~1..da9edab" "SynthesisEngine.init" "public init parameter added (multi-line)"
check "da9edab~1..da9edab" "maxEventsPerBlock" "new public property reported"
# A docs-only diff must stay quiet — a tool that cries wolf gets ignored.
check "9aa2513~1..9aa2513" "no public declarations" "docs-only diff reports nothing"
if [[ "$fail" -ne 0 ]]; then
echo "[self-test] FAILED" >&2
exit 1
fi
echo "[self-test] OK"
exit 0
fi
RANGE="${1:-origin/main...HEAD}"
python3 "$ROOT/scripts/doc_impact.py" "$ROOT" "$RANGE"
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
# check-doc-snippets.sh
#
# Doc-example guard: proves the ```swift examples in the DocC catalog and the /// doc
# comments still compile against the real API.
#
# Nothing else does this. `swift build` never sees a code fence, and check-docc.sh only
# validates symbol LINKS. So examples rot silently, and have:
# - `engine.add(...)` became throwing; 11 doc examples kept calling it without `try`.
# - `LyrebirdFloat` was deleted; 75 references outlived it, including
# `@UIParam var amplitude: LyrebirdFloat = 0.5`, which cannot compile.
# Both are type errors, so typechecking the fences catches them.
#
# Each fence is generated into a throwaway .swift under $(mktemp -d) — nothing is written
# to the working tree — wrapped in `@MainActor func _fence_N()` and preceded by
# `#sourceLocation`, so a failure points at the ORIGINAL markdown file and line.
#
# The set of checked fences is recorded in scripts/doc-snippets-manifest.txt. It is
# produced by asking the COMPILER which fences compile (--classify), not by hand-annotating
# 900 fences. Fences that compile under no preamble self-exclude — that is how iOS-only
# examples, Package.swift manifest snippets, and pseudo-code drop out with no skip list.
#
# Usage:
# bash scripts/check-doc-snippets.sh # CI/default: typecheck the recorded set
# bash scripts/check-doc-snippets.sh --classify # re-record which fences are checkable
#
# Run manually or from CI. Requires a prior `swift build` (it typechecks against the built
# module). Deliberately NOT in .githooks/pre-commit — that hook is fast by design.
#
# Exit 0 = every recorded example still compiles.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
MODE="check"
SHRINK=""
case "${1:-}" in
--classify)
MODE="classify"
if [[ "${2:-}" == "--allow-shrink" ]]; then SHRINK="--allow-shrink"
elif [[ $# -gt 1 ]]; then echo "usage: $0 --classify [--allow-shrink]" >&2; exit 2; fi
;;
"")
if [[ $# -gt 0 ]]; then echo "usage: $0 [--classify [--allow-shrink]]" >&2; exit 2; fi
;;
*) echo "usage: $0 [--classify [--allow-shrink]]" >&2; exit 2 ;;
esac
WORK="$(mktemp -d)"
trap 'rm -rf "$WORK"' EXIT
echo "[1/2] Building the module the examples typecheck against..."
(cd "$ROOT" && swift build) > /dev/null
if [[ "$MODE" == "classify" ]]; then
echo "[2/2] Asking the compiler which fences compile (slow — tries each preamble)..."
python3 "$ROOT/scripts/doc_snippets.py" classify "$ROOT" "$WORK" $SHRINK
echo " Commit scripts/doc-snippets-manifest.txt."
else
echo "[2/2] Typechecking the recorded doc examples..."
python3 "$ROOT/scripts/doc_snippets.py" check "$ROOT" "$WORK"
fi
+183
View File
@@ -0,0 +1,183 @@
#!/usr/bin/env bash
# check-docc.sh
#
# DocC documentation guard: blocks NEW documentation warnings (broken symbol links,
# ambiguous references, article/symbol collisions) from landing.
#
# DocC symbol links pin a symbol's FULL signature — `Score/toMusicXMLString(divisions:)`
# stops resolving the moment a parameter is added. Nothing in `swift build` or `swift test`
# checks this, so links rot silently: a sweep in 2026-07 found ~84 accumulated warnings,
# including a link broken by the change that added `maxEventsPerBlock` to
# `SynthesisEngine.init` in the same cycle it shipped.
#
# This is a RATCHET: a baseline is committed at scripts/docc-warnings-baseline.txt and the
# check fails only on warnings that are NOT in it. The backlog has since been cleared, so the
# baseline is EMPTY and any new warning fails. The baseline may only shrink — prefer fixing a
# link over re-baselining it.
#
# Usage:
# bash scripts/check-docc.sh # CI/default: fail on new warnings
# bash scripts/check-docc.sh --update-baseline # accept current warnings as the baseline
# bash scripts/check-docc.sh --strict # require ZERO warnings (goal state)
#
# Covers every consumer-facing catalog: LyrebirdSynth and LyrebirdUI.
#
# Run manually or from CI. Takes ~60s (DocC extracts symbol graphs). Deliberately NOT in
# .githooks/pre-commit — that hook is fast by design.
#
# Exit 0 = no new warnings.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
BASELINE="$ROOT/scripts/docc-warnings-baseline.txt"
# Every catalog that ships to consumers. LyrebirdUI was unguarded until phase 238 —
# check-docc.sh only built LyrebirdSynth, so its warnings were invisible.
# The LiveCompile sub-package is deliberately excluded: it is a dev-only package with
# no swift-docc-plugin dependency, so its one catalog file cannot be built from here.
TARGETS=("LyrebirdSynth" "LyrebirdUI")
if [[ $# -gt 1 ]]; then
echo "usage: $0 [--update-baseline|--strict] (one option at a time)" >&2
exit 2
fi
MODE="check"
case "${1:-}" in
--update-baseline) MODE="update" ;;
--strict) MODE="strict" ;;
"") ;;
*) echo "usage: $0 [--update-baseline|--strict]" >&2; exit 2 ;;
esac
CURRENT="$(mktemp)"
RAW="$(mktemp)"
CURRENT_RAW="$(mktemp)"
trap 'rm -f "$CURRENT" "$RAW" "$CURRENT_RAW"' EXIT
normalise() {
LC_ALL=C awk '
function flush() {
if (pending) { print msg " :: (no source location)"; pending = 0 }
}
!docc && /Building documentation for/ { docc = 1; next }
!docc { next }
# Flush first: two consecutive `warning:` lines would otherwise drop the earlier one.
/^warning:/ { flush(); msg = $0; sub(/^warning: /, "", msg); pending = 1; next }
pending && /^[[:space:]]*--> / {
loc = $0
sub(/^[[:space:]]*--> /, "", loc)
sub(/:[0-9]+:[0-9]+(-[0-9]+:[0-9]+)?$/, "", loc)
print msg " :: " loc
pending = 0
next
}
pending { flush() }
END { flush() }
' "$1"
}
echo "[1/2] Building DocC documentation for ${TARGETS[*]} (~60s)..."
fail_build() {
echo "ERROR: DocC build failed for '$2' ($1)." >&2
echo " Re-run manually to see it:" >&2
echo " swift package generate-documentation --target $2" >&2
tail -25 "$RAW" >&2
exit 1
}
# Warnings do not make the plugin exit non-zero, so we must not treat a clean exit as
# "no problems" — we diff the warning set ourselves below. But we do keep the real exit
# code rather than discarding it, so a hard failure can't masquerade as a pass.
: > "$RAW"
for TARGET in "${TARGETS[@]}"; do
ONE="$(mktemp)"
DOCC_EXIT=0
(cd "$ROOT" && swift package generate-documentation --target "$TARGET" 2>&1) > "$ONE" || DOCC_EXIT=$?
# NB: `cmd && fail_build` would abort under `set -e` whenever the test is false, so each
# check is an explicit `if`.
if [[ "$DOCC_EXIT" -ne 0 ]]; then
cat "$ONE" >> "$RAW"; rm -f "$ONE"; fail_build "exit code $DOCC_EXIT" "$TARGET"
fi
if ! grep -q "Finished extracting symbol information" "$ONE"; then
cat "$ONE" >> "$RAW"; rm -f "$ONE"; fail_build "symbol extraction never finished" "$TARGET"
fi
# A hard diagnostic can be emitted *after* extraction succeeds (e.g. a convert-stage
# failure), in which case the marker is present and the exit code may still be 0.
if grep -qE "^error:" "$ONE"; then
cat "$ONE" >> "$RAW"; rm -f "$ONE"; fail_build "DocC emitted error: diagnostics" "$TARGET"
fi
# Normalise THIS target's log immediately. The awk below latches on the first
# "Building documentation for" banner and never resets, so normalising a concatenation
# of both targets would scan the second target's pre-banner SwiftPM build warnings as
# if they were DocC diagnostics — the exact thing the awk comment says must not happen.
normalise "$ONE" >> "$CURRENT_RAW"
rm -f "$ONE"
done
LC_ALL=C sort -u "$CURRENT_RAW" > "$CURRENT"
COUNT=$(wc -l < "$CURRENT" | tr -d ' ')
echo "[2/2] Comparing $COUNT distinct warning(s) against the baseline..."
if [[ "$MODE" == "update" ]]; then
# Enforce the shrink-only invariant rather than merely asserting it: refuse to record
# a warning the current baseline doesn't already contain.
if [[ -f "$BASELINE" ]]; then
ADDED="$(LC_ALL=C comm -23 "$CURRENT" "$BASELINE")"
if [[ -n "$ADDED" ]]; then
echo "REFUSED: --update-baseline would ADD $(printf '%s\n' "$ADDED" | wc -l | tr -d ' ') warning(s):" >&2
printf '%s\n' "$ADDED" | sed 's/^/ + /' >&2
echo >&2
echo "The baseline may only shrink. Fix these, or if the addition is genuinely" >&2
echo "intended, delete the baseline first and re-run to re-record from scratch." >&2
exit 1
fi
fi
cp "$CURRENT" "$BASELINE"
echo "OK: baseline updated — $COUNT warning(s) recorded at scripts/docc-warnings-baseline.txt"
echo " Commit it."
exit 0
fi
if [[ "$MODE" == "strict" ]]; then
if [[ "$COUNT" -eq 0 ]]; then
echo "OK: zero DocC warnings."
exit 0
fi
echo "FAIL (--strict): $COUNT DocC warning(s):" >&2
sed 's/^/ /' "$CURRENT" >&2
exit 1
fi
if [[ ! -f "$BASELINE" ]]; then
echo "ERROR: no baseline at $BASELINE" >&2
echo " Create it with: bash scripts/check-docc.sh --update-baseline" >&2
exit 1
fi
# No `|| true`: a comm failure (e.g. a baseline sorted under a different collation) must
# surface rather than silently produce bogus NEW/FIXED sets.
NEW="$(LC_ALL=C comm -23 "$CURRENT" "$BASELINE")"
FIXED="$(LC_ALL=C comm -13 "$CURRENT" "$BASELINE")"
if [[ -n "$FIXED" ]]; then
echo
echo "Nice — $(printf '%s\n' "$FIXED" | wc -l | tr -d ' ') baselined warning(s) are now fixed:"
printf '%s\n' "$FIXED" | sed 's/^/ - /'
echo "Tighten the ratchet: bash scripts/check-docc.sh --update-baseline"
fi
if [[ -n "$NEW" ]]; then
echo >&2
echo "FAIL: $(printf '%s\n' "$NEW" | wc -l | tr -d ' ') NEW DocC warning(s) not in the baseline:" >&2
printf '%s\n' "$NEW" | sed 's/^/ + /' >&2
echo >&2
echo "Most likely cause: a symbol link pins a signature that just changed — DocC links" >&2
echo "carry the FULL parameter list, so adding one parameter breaks every link to it." >&2
echo "Fix the link (preferred), or, if intentional:" >&2
echo " bash scripts/check-docc.sh --update-baseline" >&2
exit 1
fi
echo "OK: no new DocC warnings ($COUNT baselined, 0 new)."
+542
View File
@@ -0,0 +1,542 @@
CLAUDE.md 0 32f17b53fdca9658 none
CLAUDE.md 4 484fda136104c034 none
INSTALLATION_AND_USAGE.md 6 6ee5041ca9018275 none
INSTALLATION_AND_USAGE.md 7 8a7f2353f90dea3e none
LYREBIRD_START_HERE.md 3 c0653ad6f9dc0f5b none
LYREBIRD_START_HERE.md 4 3d0d1e2673fda229 none
README.md 0 1d7c7c19c5a6d112 none
README.md 1 3190dd60b6a8f7f8 none
README.md 3 4bd7e864af2f05fd none
Sources/Lyrebird/AudioDrivers/CoreAudioDriver.swift 0 2b7f04ec486a9a5d none
Sources/Lyrebird/Buffers/WavetableSet.swift 0 d2f7469591d6a837 none
Sources/Lyrebird/Capture/ScopeCapture.swift 0 08174c110eb5680b engine
Sources/Lyrebird/Diagnostics/LyrebirdMessageCenter.swift 0 42a857719bcee2d7 none
Sources/Lyrebird/Distributions/DistributionKind.swift 0 2a1e9a086e0c422c none
Sources/Lyrebird/Distributions/DistributionKind.swift 1 1b07e366d4f75991 none
Sources/Lyrebird/Distributions/DistributionKind.swift 10 0b0e260759dce132 none
Sources/Lyrebird/Distributions/DistributionKind.swift 11 5cea682c322e1122 none
Sources/Lyrebird/Distributions/DistributionKind.swift 12 26b417a01398b71e none
Sources/Lyrebird/Distributions/DistributionKind.swift 13 0771ebb69f8b308a none
Sources/Lyrebird/Distributions/DistributionKind.swift 14 ceebbafe746e05e1 none
Sources/Lyrebird/Distributions/DistributionKind.swift 15 750aa38dee0ea884 none
Sources/Lyrebird/Distributions/DistributionKind.swift 2 6b50d55ec0c3bfe6 none
Sources/Lyrebird/Distributions/DistributionKind.swift 3 e902f961ec883fd5 none
Sources/Lyrebird/Distributions/DistributionKind.swift 4 41c858812cc0b0c6 none
Sources/Lyrebird/Distributions/DistributionKind.swift 5 c628bc260b645cc3 none
Sources/Lyrebird/Distributions/DistributionKind.swift 6 83ef880ef6425869 none
Sources/Lyrebird/Distributions/DistributionKind.swift 7 265e5411a59ddbb4 none
Sources/Lyrebird/Distributions/DistributionKind.swift 8 e3943ce9ec214707 none
Sources/Lyrebird/Distributions/DistributionKind.swift 9 1e0c8da8462107b4 none
Sources/Lyrebird/Engine/SynthesisEngine.swift 0 072f8c4c1262497d synth
Sources/Lyrebird/Envelopes/Envelope.swift 0 e5201eda70635b3d none
Sources/Lyrebird/Envelopes/Envelope.swift 1 0e61b95d912322c6 none
Sources/Lyrebird/Envelopes/EnvelopeCurve.swift 0 fb423e40910088bb none
Sources/Lyrebird/GeneratorCore/Generator.swift 0 fe6dc1a5999a3d22 none
Sources/Lyrebird/GeneratorCore/GeneratorArray.swift 0 1420e89a6b21dffd member
Sources/Lyrebird/GeneratorCore/GeneratorArray.swift 2 f5bb675fe268dc3e member
Sources/Lyrebird/GeneratorCore/GeneratorTypes.swift 1 f256a6e42e205f13 none
Sources/Lyrebird/Generators/Core/ConstantGeneratorInput.swift 0 fefe8d3a1dc803b3 none
Sources/Lyrebird/Generators/Demand/Demand.swift 0 1300a7eeeb89557e member
Sources/Lyrebird/Generators/Demand/DemandRandom.swift 0 80569ebd9f1ab831 none
Sources/Lyrebird/Generators/Demand/DemandSequence.swift 0 64229cef78d7a012 none
Sources/Lyrebird/Generators/Demand/DemandSeries.swift 0 42430f47a34a6331 none
Sources/Lyrebird/Generators/Envelopes/EnvelopeGen.swift 0 1fd95b3fc77e7778 none
Sources/Lyrebird/Generators/Envelopes/ExponentialLine.swift 0 5cb566febf6f0366 none
Sources/Lyrebird/Generators/Envelopes/Line.swift 0 6b9b1473ac3d85a9 none
Sources/Lyrebird/Generators/Envelopes/RateRamp.swift 0 bc2bed71b83a9870 none
Sources/Lyrebird/Generators/Filters/Klank.swift 0 1c63ee8ff411b865 none
Sources/Lyrebird/Generators/Filters/ResonatorBank.swift 0 fb579569ef5bad4d none
Sources/Lyrebird/Generators/KarplusStrong/GatedKarplusStrong.swift 0 7a8903cc8eb16bbc none
Sources/Lyrebird/Generators/KarplusStrong/KarplusStrong.swift 0 3143cd37fd029bf0 none
Sources/Lyrebird/Generators/Modulation/Chorus.swift 0 b879d4c596c50498 member
Sources/Lyrebird/Generators/Modulation/Flanger.swift 0 16663d2c964db043 none
Sources/Lyrebird/Generators/Modulation/FrequencyShifter.swift 0 1f919ebbdd131ed5 member
Sources/Lyrebird/Generators/Modulation/Phaser.swift 0 b7080f81f05473d9 none
Sources/Lyrebird/Generators/Noise/ClipNoise.swift 1 8668af8485eafcd9 none
Sources/Lyrebird/Generators/Noise/Dust.swift 1 4b9c3892f656240d none
Sources/Lyrebird/Generators/Noise/Dust2.swift 1 d57abb40a38e83a1 none
Sources/Lyrebird/Generators/Noise/LFLineNoise.swift 0 9d40ed5ab0cfc992 none
Sources/Lyrebird/Generators/Noise/LFStepNoise.swift 0 b0f30d8d7438e62d none
Sources/Lyrebird/Generators/Oscillators/Impulse.swift 1 c8c6813e3605ed4e none
Sources/Lyrebird/Generators/Oscillators/Klang.swift 0 bceea3936b6583ae none
Sources/Lyrebird/Generators/Oscillators/OscTable.swift 0 85d07fe1ad1d7c44 none
Sources/Lyrebird/Generators/Oscillators/Phasor.swift 0 904f189fabd5ca66 none
Sources/Lyrebird/Generators/Oscillators/WavetableMorph.swift 0 fc9d081a8eab9f25 none
Sources/Lyrebird/Generators/PhysicalModels/BowedString.swift 0 bd65c13635a96678 none
Sources/Lyrebird/Generators/PhysicalModels/Clarinet.swift 0 96d4c678c8532996 none
Sources/Lyrebird/Generators/PhysicalModels/Flute.swift 0 08856aa4ee5e96c3 none
Sources/Lyrebird/Generators/PhysicalModels/ScannedSynthesizer.swift 0 997ca605f0f876bb none
Sources/Lyrebird/Generators/Random/Jitter.swift 0 e930a5c89820fa3b none
Sources/Lyrebird/Generators/Spectral/SpectralComplexClosure.swift 0 5853364f5b61efa7 none
Sources/Lyrebird/Generators/TemporalDemand/DemandTemporalTendency.swift 0 cf4c8d2e98134200 none
Sources/Lyrebird/Generators/TemporalDemand/DemandTemporalTendency.swift 2 6bcba3e38196e422 none
Sources/Lyrebird/Generators/TemporalDemand/TimedDemand.swift 0 3be52d0fcdb0978d member
Sources/Lyrebird/Generators/Triggers/PulseCount.swift 0 561ad7bb82de7688 none
Sources/Lyrebird/Generators/Triggers/SampleAndHold.swift 0 48a0e21d45508814 none
Sources/Lyrebird/Generators/Triggers/Schmidt.swift 0 44243a00e3434f42 none
Sources/Lyrebird/Generators/Triggers/SignalChanged.swift 0 67a7f213eeb76c9a member
Sources/Lyrebird/Generators/Triggers/Stepper.swift 0 04e8df28077cae12 none
Sources/Lyrebird/Generators/Triggers/Trig.swift 0 c7e074b328a65d37 none
Sources/Lyrebird/Generators/Triggers/Trig1.swift 0 84bd7b1df2649b4d none
Sources/Lyrebird/Generators/Triggers/TriggeredDelay.swift 0 0f3a99a1c5053bc9 none
Sources/Lyrebird/Generators/UI/Mouse.swift 0 799f2275ebcea3d4 none
Sources/Lyrebird/Generators/UI/Mouse.swift 1 039be4cc2c34a50c none
Sources/Lyrebird/Lyrebird.docc/BufferGuide.md 0 90ede4ba66fcb057 none
Sources/Lyrebird/Lyrebird.docc/BufferGuide.md 8 2e9a12e3e5d1a07d none
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 0 7aa0d214382e2c02 none
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 1 5cd736102f495bef member
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 2 e930b2cf84464f71 none
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 3 7a9f2e9037c1ec87 member
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 4 b4c24ae1cb75b6b0 none
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 5 125834bbb3abbdeb none
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 6 6d418c1dedea1fb5 none
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 7 1420e89a6b21dffd member
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 8 5882de3452d3fb30 member
Sources/Lyrebird/Lyrebird.docc/BusSystem.md 9 cc5d8bc8a747befc engine
Sources/Lyrebird/Lyrebird.docc/DiagnosticsGuide.md 10 dc9b6d6a6320a78c engine
Sources/Lyrebird/Lyrebird.docc/DiagnosticsGuide.md 2 42a857719bcee2d7 none
Sources/Lyrebird/Lyrebird.docc/DiagnosticsGuide.md 3 4f36c6bd97e3df32 none
Sources/Lyrebird/Lyrebird.docc/DiagnosticsGuide.md 4 f1c7f9029c6f48ea none
Sources/Lyrebird/Lyrebird.docc/DiagnosticsGuide.md 8 8efe9dc71d2dd8dd engine
Sources/Lyrebird/Lyrebird.docc/DiagnosticsGuide.md 9 a0ccfaf1137b9c84 engine
Sources/Lyrebird/Lyrebird.docc/EngineSetup.md 0 cfce51934da66872 none
Sources/Lyrebird/Lyrebird.docc/EngineSetup.md 1 6a365ef4f437a5f0 engine
Sources/Lyrebird/Lyrebird.docc/EngineSetup.md 2 f4d72dca55661e7f engine
Sources/Lyrebird/Lyrebird.docc/EngineSetup.md 3 3d81a4c501cf0801 engine
Sources/Lyrebird/Lyrebird.docc/EngineSetup.md 4 a38631489360cb29 synth
Sources/Lyrebird/Lyrebird.docc/ExternalIntegrations.md 11 7c3f5a8ca6843d7c none
Sources/Lyrebird/Lyrebird.docc/ExternalIntegrations.md 16 eb6b30f4ccb8e64e none
Sources/Lyrebird/Lyrebird.docc/GeneratorInputProvider.md 0 4c4d459fe4fcad42 none
Sources/Lyrebird/Lyrebird.docc/GeneratorInputProvider.md 2 d7d870f1040a1e06 none
Sources/Lyrebird/Lyrebird.docc/Generators/BusIO.md 0 45ae3598285709f3 none
Sources/Lyrebird/Lyrebird.docc/Generators/BusIO.md 1 be2f131af87600f4 engine
Sources/Lyrebird/Lyrebird.docc/Generators/Delays.md 0 7e589fb8235a0812 none
Sources/Lyrebird/Lyrebird.docc/Generators/Delays.md 1 28fededcac68f99a none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 0 ac7dc0ef75441afc none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 10 782c1e1cd96abe9e none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 12 1729b16074b42795 none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 13 73f9d6baa370e29c none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 14 980c79ff1418a854 none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 2 de1fd78ec170f2b4 none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 4 228c8e107086d449 none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 5 7dd91064dfa465a1 none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 6 01ccefdc0cc33d51 none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 7 02191117197987b4 none
Sources/Lyrebird/Lyrebird.docc/Generators/Envelopes.md 8 9215d60a959d736d none
Sources/Lyrebird/Lyrebird.docc/Generators/Filters.md 0 361dfca5c647ff11 none
Sources/Lyrebird/Lyrebird.docc/Generators/Filters.md 1 6ed78f78570febc9 none
Sources/Lyrebird/Lyrebird.docc/Generators/Filters.md 2 459a08fd500be60b none
Sources/Lyrebird/Lyrebird.docc/Generators/Filters.md 3 0f19e91cac25b5aa none
Sources/Lyrebird/Lyrebird.docc/Generators/Filters.md 4 7864452b71adb21f none
Sources/Lyrebird/Lyrebird.docc/Generators/Filters.md 5 b10166e68573a1d1 none
Sources/Lyrebird/Lyrebird.docc/Generators/Filters.md 6 93c96da1198855be none
Sources/Lyrebird/Lyrebird.docc/Generators/Filters.md 7 5f630bb777205eb2 none
Sources/Lyrebird/Lyrebird.docc/Generators/GeneratorProtocol.md 1 7d3dc8f1d5bcbd7d none
Sources/Lyrebird/Lyrebird.docc/Generators/GeneratorProtocol.md 2 4714d4e720583ffc none
Sources/Lyrebird/Lyrebird.docc/Generators/GeneratorProtocol.md 3 f71ca8fda2040cc5 none
Sources/Lyrebird/Lyrebird.docc/Generators/GeneratorProtocol.md 4 773f27ae678e198f none
Sources/Lyrebird/Lyrebird.docc/Generators/GeneratorProtocol.md 5 a7b66ad0f87286ca none
Sources/Lyrebird/Lyrebird.docc/Generators/GeneratorProtocol.md 6 9f9c5bf26b6125da none
Sources/Lyrebird/Lyrebird.docc/Generators/GeneratorProtocol.md 7 eb124cfa6d8dcd55 none
Sources/Lyrebird/Lyrebird.docc/Generators/GeneratorProtocol.md 8 86b6d8bf0044739d member
Sources/Lyrebird/Lyrebird.docc/Generators/GranularSynthesis.md 0 4bf16cb9971c578b none
Sources/Lyrebird/Lyrebird.docc/Generators/GranularSynthesis.md 2 db9929c71a8cf86d none
Sources/Lyrebird/Lyrebird.docc/Generators/GranularSynthesis.md 3 d9a6046e9bf8c748 none
Sources/Lyrebird/Lyrebird.docc/Generators/GranularSynthesis.md 4 52ab9af454e0e059 none
Sources/Lyrebird/Lyrebird.docc/Generators/GranularSynthesis.md 5 673b2c5e927acf0c member
Sources/Lyrebird/Lyrebird.docc/Generators/MultiChannel.md 0 06096b9800463297 member
Sources/Lyrebird/Lyrebird.docc/Generators/MultiChannel.md 1 08e247ae6b98bf62 none
Sources/Lyrebird/Lyrebird.docc/Generators/MultiChannel.md 2 1420e89a6b21dffd member
Sources/Lyrebird/Lyrebird.docc/Generators/MultiChannel.md 3 c236ce1721f2c418 none
Sources/Lyrebird/Lyrebird.docc/Generators/MultiChannel.md 4 a81e672386fe67cb member
Sources/Lyrebird/Lyrebird.docc/Generators/MultiChannel.md 5 9b2c9c5b04541e72 member
Sources/Lyrebird/Lyrebird.docc/Generators/MultiChannel.md 6 68dc038b6c3799b2 member
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 0 2651a0953886278d none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 1 f44fd6b6b89e563a none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 10 67cb2b1572fd997c none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 2 3c0daba7d84eccf0 none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 3 504905d70406280a none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 4 508bc35ac0209bda none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 5 215fc8b36b8a96e7 none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 6 9d6f724ef6e3a3b2 none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 7 7198512eff2b24dd none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 8 4c6251d538c199e8 none
Sources/Lyrebird/Lyrebird.docc/Generators/MusicalMath.md 9 6c6d8f1283ec4a59 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 0 88db18751b293c9d none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 1 40a98ae89be46d08 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 10 b3a9dbe06711f276 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 11 bddbe233e2e18858 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 12 76f5f880eafea60c none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 13 11cc46f5b912c372 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 14 fa7c756e579b82ad none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 15 988bf705c7346aa6 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 16 fc5bc75b98fe1a57 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 18 b81d00558cb37e98 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 19 0232a298a2a2b0a2 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 2 902788477d67e7f4 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 20 7a60adceda659349 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 21 40032ac7e94523bc none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 22 4171ba1205938634 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 23 87aa3bcefaf4d561 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 25 d065e42fafcb9ad8 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 26 8de8ff842a9df0f4 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 3 67cc75d3eb9457c8 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 4 f8ee2300f36e16b0 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 5 febd88cf16c258dd none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 6 1cadbc5e52b0ed19 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 7 8ff89983448bf1e4 none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 8 d9220f1546ebb2fa none
Sources/Lyrebird/Lyrebird.docc/Generators/Noise.md 9 0d0d88baf0522e3b none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 0 5e374f2d8e6842a8 engine
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 1 2d985fb1ece74508 none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 10 6e4b5615982879fe none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 2 965d1f5b45908273 none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 3 6f3679531bce16b3 none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 4 f69a0a6bf7365329 none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 5 d1c434cc7472bf73 none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 6 5780db427ab5ff0b none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 7 4c62ee3b6a66e360 none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 8 e6cb1b7cdb00a5ff none
Sources/Lyrebird/Lyrebird.docc/Generators/Oscillators.md 9 0c6b0a806e531556 none
Sources/Lyrebird/Lyrebird.docc/Generators/PitchShifting.md 0 5d63321493a92c39 member
Sources/Lyrebird/Lyrebird.docc/Generators/PitchShifting.md 1 07e9ddbc44a36284 member
Sources/Lyrebird/Lyrebird.docc/Generators/PitchShifting.md 4 dd98140756c3c8d8 member
Sources/Lyrebird/Lyrebird.docc/Generators/Random.md 0 cc95e06fd12973f4 none
Sources/Lyrebird/Lyrebird.docc/Generators/Random.md 1 50232291f7abecfb none
Sources/Lyrebird/Lyrebird.docc/Generators/Random.md 4 c467fbb949178f83 none
Sources/Lyrebird/Lyrebird.docc/Generators/Random.md 6 d18fc03ca399efdf none
Sources/Lyrebird/Lyrebird.docc/Generators/Routing.md 0 b14ae22dab6320cc none
Sources/Lyrebird/Lyrebird.docc/Generators/Routing.md 1 b5367503a5d7c3a7 none
Sources/Lyrebird/Lyrebird.docc/Generators/ScannedSynthesis.md 0 e1fdcae028f192af none
Sources/Lyrebird/Lyrebird.docc/Generators/SignalAnalysis.md 1 2b36defe6f3204ec member
Sources/Lyrebird/Lyrebird.docc/Generators/SignalAnalysis.md 2 b779551cb10c56ba none
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralClosures.md 0 844c249098403026 member
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralClosures.md 1 ceee5b5ebf1a6b14 none
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralFeatures.md 1 055210b549d308d7 none
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralFeatures.md 10 07a094aa5f393697 none
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralFeatures.md 11 71f3ad20f04189fb none
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralFeatures.md 2 2993d918140abc8e none
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralFeatures.md 3 43382fb38155a917 none
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralFeatures.md 5 6543d77db54b83a0 member
Sources/Lyrebird/Lyrebird.docc/Generators/SpectralFeatures.md 6 bb7291a30904f9bb none
Sources/Lyrebird/Lyrebird.docc/Generators/Triggers.md 0 293dc184e8fffcc4 none
Sources/Lyrebird/Lyrebird.docc/Generators/Triggers.md 1 3941d415fa91b577 none
Sources/Lyrebird/Lyrebird.docc/Generators/Triggers.md 2 907b30561e161442 none
Sources/Lyrebird/Lyrebird.docc/Generators/Triggers.md 3 b811daa52e8d3ea5 none
Sources/Lyrebird/Lyrebird.docc/Generators/Waveshaping.md 0 9a0282cce32f11e1 none
Sources/Lyrebird/Lyrebird.docc/Generators/Waveshaping.md 1 de527653ab215b42 none
Sources/Lyrebird/Lyrebird.docc/Generators/Waveshaping.md 2 e49e6a69a3858ce4 none
Sources/Lyrebird/Lyrebird.docc/Generators/WritingGenerators.md 10 e6d2fd831566f756 none
Sources/Lyrebird/Lyrebird.docc/Generators/WritingGenerators.md 2 2134b4cd357e4387 none
Sources/Lyrebird/Lyrebird.docc/Generators/WritingGenerators.md 4 b4dc205b9aa5fc5a none
Sources/Lyrebird/Lyrebird.docc/GettingStarted.md 0 3ab248f11418d799 none
Sources/Lyrebird/Lyrebird.docc/GettingStarted.md 1 45ba41d51b1116b5 none
Sources/Lyrebird/Lyrebird.docc/GettingStarted.md 2 df30c1eb8663478c synth
Sources/Lyrebird/Lyrebird.docc/Lyrebird.md 0 34c2d1c25110eceb synth
Sources/Lyrebird/Lyrebird.docc/MultiCore.md 1 8c645d659f87c9e7 none
Sources/Lyrebird/Lyrebird.docc/NRTGuide.md 0 5493b7be98c51e79 none
Sources/Lyrebird/Lyrebird.docc/NRTGuide.md 10 2d0a41bdf5b1bbd8 none
Sources/Lyrebird/Lyrebird.docc/NRTGuide.md 3 57055bce2aa6f5fb none
Sources/Lyrebird/Lyrebird.docc/NRTGuide.md 5 dc6b71ed419451b4 engine
Sources/Lyrebird/Lyrebird.docc/NRTGuide.md 7 56fe93c4aadaa2f1 none
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 0 815cb08026882611 none
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 1 9716d7f4e3ac93d4 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 10 6304a6c07b4a8446 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 11 9c61ebfee958750c engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 12 5788eb949f9e6777 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 13 f5bbf9040ac44c20 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 14 25647d805cb30c75 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 15 78073d05d689970c engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 16 b1b1c56644db312d engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 2 baabcf2eae7d5586 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 3 1d38bc731d255ef4 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 4 ab98a01396e5ab4d engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 5 d282aff2b4570253 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 6 a9b70eba6705b741 engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 7 0acefe6b24312c5c none
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 8 c0d3579c162c202a engine
Sources/Lyrebird/Lyrebird.docc/NodeTree.md 9 5c85ab1809d899b3 engine
Sources/Lyrebird/Lyrebird.docc/ParameterInputs.md 0 d31f119c2f2c873c none
Sources/Lyrebird/Lyrebird.docc/ParameterInputs.md 1 6320b52dca1af028 none
Sources/Lyrebird/Lyrebird.docc/ParameterInputs.md 6 6b933bd11ae2b8d3 engine
Sources/Lyrebird/Lyrebird.docc/PolyphonicVoices.md 1 9baae05324ee9c36 engine
Sources/Lyrebird/Lyrebird.docc/ProcessSystem.md 31 16ac8c55fec10e72 none
Sources/Lyrebird/Lyrebird.docc/ProjectSystem.md 1 5ca73171977bcda7 none
Sources/Lyrebird/Lyrebird.docc/ProjectSystem.md 2 bd3f90eb47fd6006 none
Sources/Lyrebird/Lyrebird.docc/REPLGuide.md 0 44e28203300162fe none
Sources/Lyrebird/Lyrebird.docc/RoutineTask.md 0 97969b7e340a3fad none
Sources/Lyrebird/Lyrebird.docc/RoutineTask.md 14 86a37ee4afa1de70 none
Sources/Lyrebird/Lyrebird.docc/RoutineTask.md 16 62b70fad58edb312 engine
Sources/Lyrebird/Lyrebird.docc/RoutineTask.md 2 925a5e2121afa5e3 engine
Sources/Lyrebird/Lyrebird.docc/Scheduling.md 0 2c95d843ffa87129 none
Sources/Lyrebird/Lyrebird.docc/Scheduling.md 2 f6081f955c94e613 engine
Sources/Lyrebird/Lyrebird.docc/Scheduling.md 3 049528e1f8912810 engine
Sources/Lyrebird/Lyrebird.docc/Scheduling.md 5 8e91c35375d795eb engine
Sources/Lyrebird/Lyrebird.docc/Scheduling.md 9 15f3cfae937f2008 engine
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 0 f41092f3c058d2eb none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 1 f42090dc6da74f2d none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 10 14f878a2fed65cd9 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 11 aa6a739ff60a6581 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 12 ec47480060d53231 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 13 eca3fca08d345ae9 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 14 4cd81d2ba300821c none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 15 836bddbc769badaf none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 16 6b72f1aa786f444b none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 17 a5909902dccd6cbf none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 18 40fb45a2c5232904 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 19 a2c78b723acf8a59 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 2 73d13dca613f3e86 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 20 d46c1c879738e083 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 21 e0260887dc16b283 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 22 86951e8fc8d48fdf none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 23 ae481c5f2a771561 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 24 726a2e340e47d796 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 25 0530fd712651407a none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 26 73a95a5366cf5ef8 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 27 2ec345a775ebd2cc none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 28 6293b852690285da none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 29 2ddb641b803fe56f none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 3 526500da617b8923 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 30 87820e6db3c510a3 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 31 4c57a2674639ae9d engine
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 32 5019ff8132bfe627 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 33 2f9e253ff51bb0c7 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 34 10b0c4c8f14d7f51 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 35 3de345d96d425902 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 36 add06e7373354514 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 37 e05b99db1c4b0202 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 38 10297d60f7b5884f none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 4 d3fc9de39083e190 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 5 1a90158f511bc948 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 6 ed7a76219b9b3f8d none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 7 3a0514a64ec2ba34 none
Sources/Lyrebird/Lyrebird.docc/ScoreSystem.md 9 47ceb25ee0e59507 none
Sources/Lyrebird/Lyrebird.docc/SendTrigger.md 1 6481072bcb9329bc member
Sources/Lyrebird/Lyrebird.docc/SendTrigger.md 2 0ea4e661f5d7c8fa member
Sources/Lyrebird/Lyrebird.docc/SendTrigger.md 3 a01398c24c880631 member
Sources/Lyrebird/Lyrebird.docc/SendTrigger.md 4 e24183d622844323 member
Sources/Lyrebird/Lyrebird.docc/StepSequencer.md 2 df00a6506d8abdd4 none
Sources/Lyrebird/Lyrebird.docc/StepSequencer.md 6 1749827efa252249 none
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 0 d90d5145fd5541ad none
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 1 08d9f0ee7b3c7992 engine
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 2 4296c6b6fcf8abd6 none
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 3 b26cf7c5e627c948 none
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 4 15635472d4738cbd engine
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 5 690223894127de94 member
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 6 3b18a72aa4d9e288 engine
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 7 108b4839ec159fe9 engine
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 8 7b1e85d8f12244c6 none
Sources/Lyrebird/Lyrebird.docc/SynthesizerProtocol.md 9 a0da9ac96bfbb0ad member
Sources/Lyrebird/Lyrebird.docc/Targets.md 0 81b40cbafc6f2d80 none
Sources/Lyrebird/Lyrebird.docc/Targets.md 1 611af51e70b6320e none
Sources/Lyrebird/Lyrebird.docc/TemporalDemand.md 11 574238961fd9963a member
Sources/Lyrebird/Lyrebird.docc/ValueComputable.md 1 4cea770f713b0467 none
Sources/Lyrebird/Lyrebird.docc/ValueComputable.md 2 6cb85b7d4fd43e4d none
Sources/Lyrebird/Lyrebird.docc/ValueComputable.md 3 ae659e6f93ec62bf none
Sources/Lyrebird/Lyrebird.docc/ValueComputable.md 5 8ff73fe92444595b none
Sources/Lyrebird/Lyrebird.docc/ValueComputable.md 7 793610d280b17746 none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 1 d31eed3f96418eed none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 10 85364442f2f45b58 none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 11 bd2cc3de34f4f8bc none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 12 4d858c55bae2db0c none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 3 641fa7bcc23e320f none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 4 1f7231597842778d none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 7 2377a8e91aa79356 none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 8 97ace9967b193479 none
Sources/Lyrebird/Lyrebird.docc/WavetableFill.md 9 68d9db4fab65af3b none
Sources/Lyrebird/Math/CollectionRandomPick.swift 0 f4e2abca5d69e50f none
Sources/Lyrebird/Math/CollectionRandomPick.swift 2 0b8f33eb50066078 none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 0 fa45a0237956d0ed none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 1 1697dfeb0ff3bdc7 none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 2 0c89ab6bab17fd38 none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 3 02f2e56c325c0c7f none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 4 0ed12cba2d54fb0c none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 5 c93b09a35c5656b6 none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 6 1e2f63b9517d115d none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 7 63878da5cac0b38e none
Sources/Lyrebird/OSC/OSCClient.swift 0 fd200fc7a209f81d none
Sources/Lyrebird/Scheduling/LyrebirdTask.swift 1 ca99def354fe2f0a engine
Sources/Lyrebird/Score/Glissando.swift 0 673ddef8256aa6b3 none
Sources/Lyrebird/Score/NoteDisplay.swift 0 f706dacb94d58307 none
Sources/Lyrebird/Score/PageLayout.swift 0 4da6cad3a431bf7d none
Sources/Lyrebird/Score/Score.swift 0 20cf6b9b0a19332f none
Sources/Lyrebird/Score/Score.swift 1 2778ff7e54cf0c9a none
Sources/Lyrebird/Score/ScoreBuilder.swift 0 5bcc09e8811bc947 none
Sources/Lyrebird/Score/ScoreElement.swift 0 ab5c948cecdbe6ea none
Sources/Lyrebird/Score/ScoreElement.swift 1 05fe27b9b5f65098 none
Sources/Lyrebird/Score/ScoreElement.swift 2 d15f2af25ecd8d8d none
Sources/Lyrebird/Score/ScoreElement.swift 3 a5909902dccd6cbf none
Sources/Lyrebird/Score/ScoreElementDSL.swift 0 254efc849aca8d65 none
Sources/Lyrebird/Score/ScoreElementDSL.swift 1 ab5c948cecdbe6ea none
Sources/Lyrebird/Score/ScoreElementDSL.swift 2 a9da6e01ce97db1d none
Sources/Lyrebird/Score/ScoreElementDSL.swift 3 57fbc2d18b9fb254 none
Sources/Lyrebird/Score/ScoreElementDSL.swift 4 4369f10f4757afac none
Sources/Lyrebird/Score/ScoreElementDSL.swift 5 c853daf835f10ca9 none
Sources/Lyrebird/Score/ScoreElementDSL.swift 7 a5909902dccd6cbf none
Sources/Lyrebird/Score/ScoreGenerative.swift 0 37b9127db753387e none
Sources/Lyrebird/Score/ScoreGenerative.swift 1 2a3207b15b57c6ff none
Sources/Lyrebird/Score/ScoreGenerative.swift 2 0142e28cf93a74d4 none
Sources/Lyrebird/Score/ScoreSectionBuilder.swift 0 d347ede04b874896 none
Sources/Lyrebird/Score/ScoreTimeline.swift 0 08de47e74386b097 none
Sources/Lyrebird/Score/ScoreTimeline.swift 1 8d40584a2741ab3c none
Sources/Lyrebird/Score/Theory/Pitch+MapIntoRange.swift 0 09ce97f5d987adde none
Sources/Lyrebird/Synthesizer/SynthesizerBase.swift 0 52e6dbd304cdb52b none
Sources/Lyrebird/Synthesizer/SynthesizerBase.swift 8 5882de3452d3fb30 member
Sources/Lyrebird/TemporalStream/Algorithms/TemporalTendency.swift 0 c710ddd78ba4c51f none
Sources/Lyrebird/TemporalStream/Algorithms/TemporalTendency.swift 2 da1b4e7b74d72598 none
Sources/LyrebirdUI/LyrebirdUI.docc/GUISystem.md 0 a7c7ea54be39417e none
Sources/LyrebirdUI/MouseTracker.swift 0 5b5368aaa517dfa7 none
docs/diagnostics-guide.md 10 dc9b6d6a6320a78c engine
docs/diagnostics-guide.md 2 42a857719bcee2d7 none
docs/diagnostics-guide.md 3 4f36c6bd97e3df32 none
docs/diagnostics-guide.md 4 f1c7f9029c6f48ea none
docs/diagnostics-guide.md 8 8efe9dc71d2dd8dd engine
docs/diagnostics-guide.md 9 a0ccfaf1137b9c84 engine
docs/engine/bus-system.md 0 7aa0d214382e2c02 none
docs/engine/bus-system.md 4 1420e89a6b21dffd member
docs/engine/bus-system.md 5 5882de3452d3fb30 member
docs/engine/multi-engine-host.md 1 10672b6a8d764ee0 none
docs/engine/scheduling.md 0 2c95d843ffa87129 none
docs/engine/scheduling.md 5 18f17a73ca3ff9ae none
docs/engine/synthesis-engine.md 1 a5fd826f8cdc7143 engine
docs/engine/synthesis-engine.md 5 b86ed5cdad961753 engine
docs/engine/synthesis-engine.md 7 420a077205369626 engine
docs/engine/synthesis-engine.md 8 17aeb564649952e4 engine
docs/protocols/generator.md 0 759d4352212759f3 none
docs/protocols/generator.md 2 a0f4ffb20378c07d none
docs/protocols/generator.md 3 0f13c732d11665c0 none
docs/protocols/generator.md 4 bfcfdc0fbe2b7f02 none
docs/protocols/generator.md 5 cd3bb2c5f84aef7b none
docs/protocols/generator.md 8 4b06ad03b1915bcc none
docs/protocols/generator.md 9 88a37051e0864bf5 member
docs/protocols/node-tree.md 0 57eff05be0324c06 none
docs/protocols/node-tree.md 11 9f8ae5512294a862 engine
docs/protocols/node-tree.md 12 637800bd963ea053 engine
docs/protocols/node-tree.md 14 4d81ee5e6123ef7a none
docs/protocols/node-tree.md 16 729034382c79439e none
docs/protocols/node-tree.md 17 997ca49f51729c08 engine
docs/protocols/node-tree.md 18 aefeb0ccc074107f engine
docs/protocols/node-tree.md 8 c0d3579c162c202a engine
docs/protocols/synthesizer.md 1 38a0a449b97f87e9 engine
docs/protocols/synthesizer.md 5 f227e2d6af6a6d1f engine
docs/protocols/synthesizer.md 6 73d2d9960aae5bde none
docs/protocols/synthesizer.md 9 7e299b8752fd0259 engine
docs/protocols/writing-generators.md 0 645a650c346742bc none
docs/protocols/writing-generators.md 14 1fbc9b4f31c8402f none
docs/protocols/writing-generators.md 30 bed091517e71e904 member
docs/protocols/writing-generators.md 32 b7f667e131c9f25e none
docs/protocols/writing-generators.md 4 8e72b23fa35d889e none
docs/protocols/writing-generators.md 7 4111ea6677a75b39 none
docs/stdlib/buffer-io-generators.md 1 8c9dec549a35bbdd none
docs/stdlib/buffer-io-generators.md 18 6cf770a2a54c8be4 none
docs/stdlib/dynamics.md 1 596edc15f919b9d2 none
docs/stdlib/dynamics.md 10 39990cca834ef94b none
docs/stdlib/dynamics.md 11 5d1c9341b961abf3 none
docs/stdlib/dynamics.md 3 18e5f09cf5013cc9 member
docs/stdlib/generators.md 10 0d0d88baf0522e3b none
docs/stdlib/generators.md 107 c5ce3d51f57142aa none
docs/stdlib/generators.md 11 629f3ca37b259db8 none
docs/stdlib/generators.md 12 902788477d67e7f4 none
docs/stdlib/generators.md 120 565f622549fd3c38 none
docs/stdlib/generators.md 123 1dd6b5c06b6ae556 none
docs/stdlib/generators.md 124 5dcaf7fb2afc8dc2 none
docs/stdlib/generators.md 126 411d623132b2b06c none
docs/stdlib/generators.md 129 c28dc931674491ee engine
docs/stdlib/generators.md 13 67cc75d3eb9457c8 none
docs/stdlib/generators.md 137 13470432dc7e4bd8 engine
docs/stdlib/generators.md 138 6105618f7bf5ea7a engine
docs/stdlib/generators.md 139 5c99a5185ecff98d engine
docs/stdlib/generators.md 14 f8ee2300f36e16b0 none
docs/stdlib/generators.md 140 087425f3135c84ff engine
docs/stdlib/generators.md 16 1cadbc5e52b0ed19 none
docs/stdlib/generators.md 161 5bd373d66ce35eba none
docs/stdlib/generators.md 17 1c7e9c58cf70ac8b none
docs/stdlib/generators.md 18 62bb868ca02fccba none
docs/stdlib/generators.md 31 674976c5b3d7e9dc none
docs/stdlib/generators.md 33 6196c99aa22cfbfd none
docs/stdlib/generators.md 34 58f37f05cdc8511b none
docs/stdlib/generators.md 35 767c7e181286481f none
docs/stdlib/generators.md 47 0b03884f890b5438 none
docs/stdlib/generators.md 48 b1b1c7300f8f9abf none
docs/stdlib/generators.md 49 44090861a5f3f0ab none
docs/stdlib/generators.md 5 fe5eeb6b8c9468bc none
docs/stdlib/generators.md 50 a5a4ceae4e8d0f04 member
docs/stdlib/generators.md 53 11b583d435ae3fec none
docs/stdlib/generators.md 56 4b324b59c6e2d036 engine
docs/stdlib/generators.md 58 f03496e55afd8c09 member
docs/stdlib/generators.md 6 6f95f2595f21269d none
docs/stdlib/generators.md 63 4f73f9175480bb9d none
docs/stdlib/generators.md 64 c95aba6700244981 none
docs/stdlib/generators.md 65 1ad8a7a4bcf35578 none
docs/stdlib/generators.md 66 3e128c4a0c0ed44f none
docs/stdlib/generators.md 68 e68b3297e3811b06 none
docs/stdlib/generators.md 7 e0fc33b99cfbfad3 none
docs/stdlib/generators.md 70 4058bd1e443015c3 none
docs/stdlib/generators.md 77 5b5368aaa517dfa7 none
docs/stdlib/generators.md 78 ec2d381f2bb9b8ed none
docs/stdlib/generators.md 79 d7340b239481a865 none
docs/stdlib/generators.md 8 88db18751b293c9d none
docs/stdlib/generators.md 81 73a12cfe64ff0f69 none
docs/stdlib/generators.md 83 380ed79e0cdee46c none
docs/stdlib/generators.md 84 5293eff3b9430f29 none
docs/stdlib/generators.md 85 da9268f81a456ea6 none
docs/stdlib/generators.md 86 9bf9cf3a6a2db438 none
docs/stdlib/generators.md 87 dea487b351e98274 none
docs/stdlib/generators.md 89 4fd57872628e530e none
docs/stdlib/generators.md 9 d9220f1546ebb2fa none
docs/stdlib/generators.md 90 f65e4bbe38e99cc8 none
docs/stdlib/generators.md 91 c69991ded1dd3d6a none
docs/stdlib/generators.md 92 e014ebea17d7fc65 none
docs/stdlib/generators.md 93 c92ba501869bd44a none
docs/stdlib/generators.md 94 8af8941e718f5611 none
docs/stdlib/generators.md 95 17567f7a1d480962 none
docs/stdlib/generators.md 96 f321afc74caaf987 none
docs/stdlib/generators.md 97 1fa567c7e6d9eda1 none
docs/stdlib/granular.md 0 a2b73804b66ffb4e none
docs/stdlib/multichannel.md 1 08e247ae6b98bf62 none
docs/stdlib/multichannel.md 2 1420e89a6b21dffd member
docs/stdlib/multichannel.md 5 9b2c9c5b04541e72 member
docs/stdlib/multichannel.md 6 86ff3731cb40db44 member
docs/stdlib/multichannel.md 9 62f150dc0bc1ac52 none
docs/stdlib/spectral.md 10 7e4f2246272631b6 none
docs/stdlib/spectral.md 11 80ade877fe55c93c none
docs/stdlib/spectral.md 12 1e5622b9ff2d417c none
docs/stdlib/spectral.md 13 4a6e2c34c0fdd159 none
docs/stdlib/spectral.md 14 69846e49e60a1b33 none
docs/stdlib/spectral.md 15 5f627228cd88dc52 none
docs/stdlib/theory.md 0 81b40cbafc6f2d80 none
docs/stdlib/theory.md 1 c79682d1251dca8c none
docs/stdlib/theory.md 10 9b7a20fb67cf11b5 none
docs/stdlib/theory.md 11 7b55db418e2fd810 none
docs/stdlib/theory.md 12 ef04b6fad4fb619c none
docs/stdlib/theory.md 13 22ec71ab4ab216c2 none
docs/stdlib/theory.md 14 b692b2a994f8abd6 none
docs/stdlib/theory.md 16 5ed769201e546f53 none
docs/stdlib/theory.md 17 6138d80eb48a7ebb none
docs/stdlib/theory.md 18 2d93fd543f06f4f6 none
docs/stdlib/theory.md 19 32fc4a2ac9e9fa55 engine
docs/stdlib/theory.md 2 c6387e0a2dd5a004 none
docs/stdlib/theory.md 3 1f72e3e30bfede51 none
docs/stdlib/theory.md 5 a2712d404ae54624 none
docs/stdlib/theory.md 6 0e50b8c55a3060b3 none
docs/stdlib/theory.md 7 cb778d54e742c021 none
docs/stdlib/theory.md 8 ac601091423d2985 none
docs/stdlib/theory.md 9 74dda0c11f3d34c4 none
docs/tooling/cli-guide.md 0 1407c405647e96de none
docs/tooling/cli-guide.md 1 5173fda0e36a5213 none
docs/tooling/midi-clock-sync.md 0 526a3779a15793c6 none
docs/tooling/nrt-guide.md 0 046617aa0016f750 none
docs/tooling/nrt-guide.md 14 f06ebc900acda570 none
docs/tooling/nrt-guide.md 4 11c60dfed731ac6c none
docs/tooling/nrt-guide.md 7 5b70d42bbb32382d engine
docs/tooling/nrt-guide.md 9 7a2bd7072c940754 none
docs/tooling/project-system.md 1 f4208870a115401f none
docs/tooling/project-system.md 3 491d32c269a92cbf none
docs/tooling/repl.md 0 28355170a44f09cd none
docs/tooling/routine-task.md 1 13ef865253b3351c none
docs/tooling/routine-task.md 11 b95b191b847d061e engine
docs/tooling/routine-task.md 9 be652d2b3b6f274f none
docs/tooling/targets.md 0 81b40cbafc6f2d80 none
docs/tooling/targets.md 1 611af51e70b6320e none
docs/ui/gui-system.md 0 4b0e892ca2593cf1 none
docs/ui/gui-system.md 1 35476e25ce32f68f none
+354
View File
@@ -0,0 +1,354 @@
#!/usr/bin/env python3
"""doc_impact.py — report which docs a diff's public-API changes may have invalidated.
Driven by scripts/check-doc-impact.sh; not meant to be run directly.
Why this exists: doc rot is overwhelmingly *caused* by a public-API change, and a review
that reads only the diff structurally cannot find it — the stale references live in files
the diff never touches. Every incident in this series has that shape:
- `engine.add` gained `throws`; 11 examples elsewhere kept calling it without `try`.
- `LyrebirdFloat` was deleted; 75 references elsewhere outlived it.
- `maxEventsPerBlock` was added; it reached zero `.docc` files in the cycle it shipped.
The review agent already carries an instruction to grep for stale forms when a signature
changes. It demonstrably under-delivers — the same review that added that instruction then
missed `LyrebirdInt` inside a fence whose adjacent lines the diff edited. Prose guidance
asks a reviewer to remember; this reports the candidates mechanically.
**This tool reports; it does not judge.** It cannot tell "intentionally unaffected" from
"forgotten", so it never fails a build. It hands the review agent a list to adjudicate.
"""
import re
import subprocess
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
import doc_snippets as ds
# Matching declarations by regex against DIFF LINES does not work, and the failure is
# silent. `init` has no identifier to capture; CLAUDE.md *mandates* multi-line signatures
# for >=2 parameters, so an added parameter arrives as a bare continuation line
# (`+ q: any ValidGeneratorInput,`) that no declaration pattern matches; and
# `public private(set) var` / `public required init` / members of a `public extension`
# never match at all. The first version of this tool dropped every one of those — it
# reported "no doc impact" for exactly the `SynthesisEngine.init` change it cites as its
# own motivation.
#
# So: take the changed LINE RANGES from the diff, parse the file for declarations with
# their full spans and nesting-aware owners, and intersect. A change anywhere inside a
# declaration's signature counts as touching it, however it is formatted.
DECL_LINE = re.compile(
r"^\s*(?:@\w+(?:\([^)]*\))?\s+)*" # attributes
r"(?:(?:public|open|internal|private|fileprivate)"
r"(?:\(set\))?\s+)*" # access, incl. private(set)
r"(?:(?:static|final|class|override|mutating|required|convenience|"
r"nonisolated|dynamic|lazy|weak|unowned|indirect)\s+)*"
r"(func|var|let|init|subscript|typealias|enum|struct|class|protocol|actor|case)\b"
r"\s*([A-Za-z_]\w*)?"
)
TYPE_DECL = re.compile(
r"^\s*(?:(?:public|open|internal|private|fileprivate)\s+)*"
r"(?:final\s+)?(?:class|struct|enum|extension|protocol|actor)\s+([A-Za-z_]\w*)"
)
IS_PUBLIC = re.compile(r"\b(?:public|open)\b")
def changed_lines(root: Path, rng: str) -> dict[str, set[int]]:
"""New-side line numbers touched by the diff, per file."""
proc = subprocess.run(["git", "diff", "-U0", "--no-color", rng, "--", "*.swift"],
cwd=root, capture_output=True, text=True)
if proc.returncode != 0:
raise RuntimeError(f"git diff {rng} failed: {proc.stderr.strip()}")
out: dict[str, set[int]] = {}
cur = ""
HUNK = re.compile(r"^@@ -\S+ \+(\d+)(?:,(\d+))? @@")
for line in proc.stdout.split("\n"):
if line.startswith("+++ b/"):
cur = line[6:]
continue
m = HUNK.match(line)
if m and cur:
s = int(m.group(1)); n = int(m.group(2) or 1)
out.setdefault(cur, set()).update(range(s, s + n))
return out
def removed_decls(root: Path, rng: str) -> set[str]:
"""Names of public declarations the diff DELETED — they no longer exist to be parsed,
but doc references to them are exactly the `LyrebirdFloat` case."""
proc = subprocess.run(["git", "diff", "--no-color", rng, "--", "*.swift"],
cwd=root, capture_output=True, text=True)
if proc.returncode != 0:
raise RuntimeError(f"git diff {rng} failed: {proc.stderr.strip()}")
names: set[str] = set()
for line in proc.stdout.split("\n"):
if not line.startswith("-") or line.startswith("---"):
continue
body = line[1:]
if not IS_PUBLIC.search(body):
continue
m = DECL_LINE.match(body)
if m and m.group(2):
names.add(m.group(2))
return names
def end_rev(rng: str) -> str:
"""The revision a range ends at. The diff's new-side line numbers refer to the file as
it exists THERE, not in the working tree — parsing the working tree for a historical
range reads unrelated lines and reports the wrong declarations."""
for sep in ("...", ".."):
if sep in rng:
right = rng.split(sep, 1)[1].strip()
return right or "HEAD"
return rng.strip() or "HEAD"
def read_at(root: Path, rev: str, rel: str) -> "str | None":
"""File content at `rev`. Falls back to the working tree when rev is the working tree."""
proc = subprocess.run(["git", "show", f"{rev}:{rel}"], cwd=root,
capture_output=True, text=True)
if proc.returncode == 0:
return proc.stdout
f = root / rel
return f.read_text() if f.exists() else None
def file_decls(text: str) -> list[tuple[str, str, int, int]]:
"""Public declarations in a file as (label, kind, start_line, end_line).
Tracks an owner stack by brace depth, so a member of the codebase's canonical
`enum Foo { public final class Audio { … } }` shape is labelled `Foo.Audio.init`
rather than the outer `Foo.init` that git's hunk header would suggest.
"""
lines = text.split("\n")
out: list[tuple[str, str, int, int]] = []
stack: list[tuple[str, int]] = [] # (type name, brace depth at which it opened)
depth = 0
public_scope: list[bool] = [] # is the enclosing type public?
i = 0
while i < len(lines):
raw = lines[i]
line = raw.split("//")[0]
stripped = line.strip()
tm = TYPE_DECL.match(line)
if tm:
stack.append((tm.group(1), depth))
public_scope.append(bool(IS_PUBLIC.search(line)))
else:
dm = DECL_LINE.match(line)
# Only a direct member of the type is API. Without this depth test, a `let`
# inside a function body (`let dropped: UInt64 = …`) is reported as public API
# simply because the function lives in a public type.
at_member_depth = (depth == stack[-1][1] + 1) if stack else (depth == 0)
# A member is API if it says so, or if it sits in a public extension/protocol —
# where members carry no access keyword of their own.
if dm and at_member_depth and (IS_PUBLIC.search(line)
or (public_scope and public_scope[-1])):
kind, name = dm.group(1), dm.group(2)
if kind in ("class", "struct", "enum", "protocol", "actor"):
pass # handled by TYPE_DECL
else:
label = ".".join(n for n, _ in stack)
label = f"{label}.{name or kind}" if label else (name or kind)
# Span the whole signature: multi-line inits are the norm here.
end = i
if "(" in line:
bal = line.count("(") - line.count(")")
while bal > 0 and end + 1 < len(lines):
end += 1
nxt = lines[end].split("//")[0]
bal += nxt.count("(") - nxt.count(")")
out.append((label, kind, i + 1, end + 1))
i = end
line = lines[end].split("//")[0]
depth += line.count("{") - line.count("}")
while stack and depth <= stack[-1][1]:
stack.pop()
if public_scope:
public_scope.pop()
i += 1
return out
def changed_api(root: Path, rng: str) -> dict[str, set[str]]:
"""Public declarations added/removed/modified by the diff, as {label: {kinds}}."""
found: dict[str, set[str]] = {}
touched = changed_lines(root, rng)
rev = end_rev(rng)
for rel, lns in touched.items():
text = read_at(root, rev, rel)
if text is None:
continue # file deleted at rev — caught by removed_decls
for label, kind, start, end in file_decls(text):
if any(start <= n <= end for n in lns):
found.setdefault(label, set()).add(kind)
for name in removed_decls(root, rng):
found.setdefault(name, set()).add("removed")
return found
def doc_files(root: Path) -> list[Path]:
out: list[Path] = []
for pat in ("Sources/**/*.md", "Sources/**/*.swift", "docs/**/*.md"):
out += sorted(root.glob(pat))
return [f for f in out
if not str(f.relative_to(root)).startswith(("docs/00-", "docs/01-"))]
def load_corpus(root: Path, files: list[Path]) -> list[tuple[str, bool, list[str]]]:
"""Read every doc file once. The previous version re-read all ~1450 files for each
changed declaration, against this tool's "fast, no build required" promise."""
out: list[tuple[str, bool, list[str]]] = []
for f in files:
try:
out.append((str(f.relative_to(root)), f.suffix == ".swift", f.read_text().split("\n")))
except Exception:
continue
return out
def references(corpus: list[tuple[str, bool, list[str]]], name: str,
kinds: set[str]) -> list[tuple[str, int, str]]:
"""Doc references to `name`, restricted to CODE-SHAPED mentions.
Matching the bare word is hopeless: `add` is also English, and a word-boundary search
for it returns 1329 hits, almost all prose ("must add the same two-line extension").
That is the signal-to-noise failure that sank the corpus-wide identifier lint — a
reviewer handed 1329 candidates checks none of them.
So a reference must look like code:
- a call `add(` / `.add(`
- a symbol link ``Engine/add(_:)``
- a code span `add`
Only doc CONTENT is searched — `///` comments and markdown — never live Swift code,
which the compiler already checks.
"""
n = re.escape(name)
if kinds & {"func", "init", "subscript"}:
pat = re.compile(rf"(?:\b|\.){n}\s*\(") # a call or a signature link
else:
pat = re.compile(rf"`[^`]*\b{n}\b[^`]*`|\.{n}\b|(?:\b|\.){n}\s*[(=:]")
hits: list[tuple[str, int, str]] = []
for rel, is_swift, lines in corpus:
for i, ln in enumerate(lines, 1):
if is_swift and "///" not in ln:
continue # live code, not documentation
if pat.search(ln):
hits.append((rel, i, ln.strip()[:90]))
return hits
def covered_ranges(root: Path) -> dict[str, list[tuple[int, int]]]:
"""Line ranges of fences that `check-doc-snippets.sh` already typechecks.
References inside these are deliberately suppressed: the compile guard verifies them on
every run, so re-reporting them buries the references nobody is checking. This tool's
value is precisely the complement — uncovered fences and prose.
"""
man = root / "scripts/doc-snippets-manifest.txt"
if not man.exists():
return {}
recorded: set[str] = set()
for line in man.read_text().split("\n"):
if not line.strip():
continue
parts = line.split("\t")
if len(parts) != 4:
# This tool is advisory and must never fail. A malformed manifest degrades it to
# "suppress nothing", which is noisier but still correct.
continue
f, o, h, _ = parts
recorded.add(f"{f}\t{o}\t{h}")
out: dict[str, list[tuple[int, int]]] = {}
for fence in ds.collect(root):
if ds.key(fence) in recorded:
start = fence["line"]
end = start + fence["body"].count("\n")
out.setdefault(fence["file"], []).append((start, end))
return out
def is_covered(covered: dict[str, list[tuple[int, int]]], path: str, line: int) -> bool:
return any(a <= line <= b for a, b in covered.get(path, []))
def main(root: Path, rng: str) -> int:
api = changed_api(root, rng)
if not api:
print("OK: the diff changes no public declarations — no doc impact to review.")
return 0
corpus = load_corpus(root, doc_files(root))
covered = covered_ranges(root)
print(f"Public declarations touched by {rng}: {len(api)}\n")
undocumented: list[str] = []
total = 0
suppressed = 0
for label in sorted(api):
kinds = "/".join(sorted(api[label]))
member = label.split(".")[-1]
hits = references(corpus, member, api[label])
gated = [h for h in hits if is_covered(covered, h[0], h[1])]
hits = [h for h in hits if not is_covered(covered, h[0], h[1])]
suppressed += len(gated)
if not hits and not gated:
undocumented.append(f"{label} ({kinds})")
continue
if not hits:
print(f" {label} [{kinds}] — all {len(gated)} reference(s) sit in fences the "
f"compile guard already checks. Nothing to review.")
print()
continue
total += len(hits)
print(f" {label} [{kinds}] — {len(hits)} UNGATED doc reference(s)"
+ (f" ({len(gated)} more already compile-checked)" if gated else "") + ":")
# Grouped by file, not a flat sample. For a common member name a flat list is
# hundreds of lines and a reviewer checks none of them; the file list is what you
# actually act on.
byfile: dict[str, list[tuple[int, str]]] = {}
for path, line, text in hits:
byfile.setdefault(path, []).append((line, text))
for path in sorted(byfile, key=lambda k: (-len(byfile[k]), k)):
entries = byfile[path]
print(f" {path} ({len(entries)})")
for line, text in entries[:2]:
print(f" :{line} {text}")
if len(entries) > 2:
print(f" … {len(entries) - 2} more in this file")
print()
if undocumented:
print("Changed public API with NO doc reference anywhere:")
for u in undocumented:
print(f" - {u}")
print(" (New API this shape reached zero .docc files when `maxEventsPerBlock` shipped.")
print(" Is it genuinely internal-facing, or is documentation missing?)")
print()
if total == 0 and not undocumented:
print("OK: every doc reference to the changed API sits in a fence the compile guard "
"already checks.")
return 0
print(f"REVIEW REQUIRED: {total} ungated doc reference(s) to {len(api)} changed "
f"declaration(s); {suppressed} further reference(s) suppressed because the compile "
f"guard already covers them.")
print("Each is a candidate, not a defect — confirm it was updated, or is unaffected.")
print("This tool reports; it cannot tell the difference, so it never fails.")
print("Note: a member name is matched across types (a changed `add` also matches")
print("`group.add(`), so qualify by the owning type shown above when judging.")
return 0
if __name__ == "__main__":
if len(sys.argv) != 3:
print("run via scripts/check-doc-impact.sh", file=sys.stderr)
sys.exit(2)
sys.exit(main(Path(sys.argv[1]), sys.argv[2]))
+413
View File
@@ -0,0 +1,413 @@
#!/usr/bin/env python3
"""doc_snippets.py — extract ```swift fences from the docs and typecheck them.
Driven by scripts/check-doc-snippets.sh; not meant to be run directly.
Why this exists: nothing compiles the ~1450 swift fences in the DocC catalog and the ///
doc comments, so examples rot silently. `engine.add(...)` became throwing and 11 examples
kept calling it without `try` for months; `LyrebirdFloat` was deleted and 75 references
outlived it. Both are type errors — so typechecking the fences catches them.
Mechanism:
- Each fence becomes one generated .swift file: hoisted imports, then the body inside
`@MainActor func _fence_N() { ... }`. Everything lives in the function so that two
fences declaring the same helper type can't collide at file scope.
- `#sourceLocation` is emitted before the body, so swiftc diagnostics point at the
ORIGINAL markdown file and line rather than the generated file.
- Classification typechecks each fence in its OWN invocation (parallelised): batching is
unsound, because a parse error in one file aborts swiftc before later files are reached.
A fence that compiles under NONE of the preambles self-excludes — that is how iOS-only
examples, Package.swift manifest snippets, and pseudo-code drop out without a skip list.
"""
import concurrent.futures as cf
import hashlib
import os
import re
import subprocess
import sys
from pathlib import Path
# Body text substituted ahead of a fence, keyed by preamble name. `none` is the bare case.
# Capped deliberately: if a fence needs a fifth preamble, that is a signal the doc should
# be rewritten to stand on its own rather than a signal to grow this table.
_MY_SYNTH = (
"final class MySynth: SynthesizerBase {\n"
" override func build() { output(bus: 0, source: OscSin.Audio(freq: 440.0) * 0.2) }\n"
"}\n"
)
_ENGINE = (
"let engine: SynthesisEngine = SynthesisEngine("
"blockSize: 512, sampleRate: 44100, numOutputChannels: 2, "
"numInputChannels: 0, driver: OfflineDriver())\n"
)
# Tried IN ORDER, least-invasive first: a preamble that declares a name the fence also
# declares makes the fence fail, so the narrowest match must win. A fence that defines its
# own `MySynth` is caught by `none`; one that defines its own engine but uses `MySynth` is
# caught by `synth`; one that uses both is caught by `engine`.
#
# Capped deliberately. If a fence needs a fifth preamble, that is a signal the DOC should
# be rewritten to stand on its own — which is the actual goal — not a signal to grow this.
PREAMBLES: dict[str, str] = {
"none": "",
"synth": _MY_SYNTH,
"engine": _MY_SYNTH + _ENGINE + "let synth: MySynth = MySynth()\n_ = (engine, synth)\n",
# `member` maps to no prefix text — it is a WRAPPER, handled via MEMBER_PREAMBLES
# below; this entry exists only so the classify loop iterates it in order.
# `member` is structurally different: it is not a prefix but a WRAPPER. Many fences are
# the body of `build()` lifted out of its class — they call `output(bus:source:)` /
# `addOutputGenerator`, which are SynthesizerBase members and exist in no other context.
# `output` was by far the biggest single blocker among unchecked fences.
"member": "",
}
# Preambles whose body must be wrapped in a SynthesizerBase subclass rather than a function.
MEMBER_PREAMBLES: set[str] = {"member"}
FENCE_MD = re.compile(r"^\s*```\s*swift\s*$")
FENCE_END = re.compile(r"^\s*```\s*$")
def extract_from_markdown(path: Path) -> list[dict]:
"""Fences in a .md file. `line` is 1-based and points at the first body line."""
out: list[dict] = []
lines = path.read_text().split("\n")
i = 0
while i < len(lines):
if FENCE_MD.match(lines[i]):
start = i + 1
body: list[str] = []
i += 1
while i < len(lines) and not FENCE_END.match(lines[i]):
body.append(lines[i])
i += 1
out.append({"line": start + 1, "body": "\n".join(body)})
i += 1
return out
def extract_from_swift(path: Path) -> list[dict]:
"""Fences inside `/// ` doc comments. The `/// ` prefix is stripped from each line."""
out: list[dict] = []
lines = path.read_text().split("\n")
i = 0
while i < len(lines):
stripped = re.sub(r"^\s*///\s?", "", lines[i]) if "///" in lines[i] else None
if stripped is not None and FENCE_MD.match(stripped):
start = i + 1
body: list[str] = []
i += 1
while i < len(lines):
cur = lines[i]
if "///" not in cur:
break
inner = re.sub(r"^\s*///\s?", "", cur)
if FENCE_END.match(inner):
break
body.append(inner)
i += 1
out.append({"line": start + 1, "body": "\n".join(body)})
i += 1
return out
def collect(root: Path) -> list[dict]:
"""Every swift fence in the doc corpus, tagged with its file and per-file ordinal."""
fences: list[dict] = []
targets: list[Path] = []
for pat in ("Sources/**/*.md", "Sources/**/*.swift", "docs/**/*.md", "*.md"):
targets += sorted(root.glob(pat))
# Root-level docs that narrate history or plans rather than API usage — same
# rationale as the docs/00- / docs/01- skip below.
skip_root = {"PLAN.md", "DOC_UPDATE_PLAN.md", "RELEASES.md"}
for f in targets:
rel = str(f.relative_to(root))
# Planning archives narrate history, including APIs that no longer exist.
if rel.startswith(("docs/00-", "docs/01-")) or rel in skip_root:
continue
found = extract_from_swift(f) if f.suffix == ".swift" else extract_from_markdown(f)
for ordinal, fence in enumerate(found):
fences.append({"file": rel, "ordinal": ordinal, **fence})
return fences
def generate(fence: dict, preamble: str, outdir: Path, index: int, remap: bool) -> Path:
"""Write one generated .swift for a fence.
Imports must sit at file scope, so they are hoisted — but each hoisted line is left
behind as a BLANK line rather than deleted, which keeps every remaining body line at
its original offset so `#sourceLocation` stays exact regardless of where in the fence
the import appeared.
The wrapper is `throws` so a correct `try engine.add(...)` compiles; a MISSING `try`
still errors ("call can throw but is not marked with 'try'"), which is the point.
The body is wrapped in a `@MainActor` function: doc examples are language-side code,
and a nonisolated wrapper would false-positive on every `@MainActor` `engine.add`.
Wrapping everything (including type declarations, which Swift allows locally) also
means two fences declaring the same helper name cannot collide at file scope.
`remap` controls `#sourceLocation`. With it, diagnostics point at the original
markdown — great for a human, but it also means swiftc no longer attributes an error
to the generated file, so classification could not tell WHICH fence failed. Classify
therefore runs with remap=False and checks run with remap=True.
"""
body_lines = fence["body"].split("\n")
# Only the LEADING import run is hoisted. Scanning the whole body would also match an
# `import` line inside a Swift multi-line string literal (the scaffolder/exporter docs
# show generated source) and blank it out of the literal.
lead = 0
for i, l in enumerate(body_lines):
s = l.strip()
if s.startswith("import "):
lead = i + 1
elif s and not s.startswith("//"):
break
imports = [l.strip() for l in body_lines[:lead] if l.strip().startswith("import ")]
rest = ["" if (i < lead and l.strip().startswith("import ")) else l
for i, l in enumerate(body_lines)]
head = ["import LyrebirdSynth"] + [i for i in imports if i != "import LyrebirdSynth"]
if preamble in MEMBER_PREAMBLES:
# The fence is a `build()` body: wrap it in a subclass so SynthesizerBase members
# (`output(bus:source:)`, `addOutputGenerator`) resolve. `build()` is @MainActor via
# the base, and is not throwing — a `try` inside such a fence will correctly fail.
open_lines = [f"final class DocSynth_{index}: SynthesizerBase {{",
" override func build() {"]
close_lines = [" }", "}"]
else:
open_lines = [f"@MainActor func _fence_{index}() throws {{", PREAMBLES[preamble]]
close_lines = ["}"]
src = head + open_lines
if remap:
src.append(f'#sourceLocation(file: "{fence["file"]}", line: {fence["line"]})')
src.append("\n".join(rest))
if remap:
src.append("#sourceLocation()")
src += close_lines
p = outdir / f"fence_{index}.swift"
p.write_text("\n".join(src) + "\n")
return p
def _swiftc(files: list[Path], root: Path, sdk: str, modules: Path):
cmd = [
"xcrun", "swiftc", "-typecheck", "-swift-version", "6",
"-I", str(modules), "-I", str(root / "Sources/LyrebirdC"),
"-sdk", sdk, "-target", host_triple(),
] + [str(f) for f in files]
proc = subprocess.run(cmd, capture_output=True, text=True)
return proc.returncode, proc.stderr + proc.stdout
def typecheck_batch(files: list[Path], root: Path, sdk: str, modules: Path):
"""Typecheck every file in ONE invocation. Fast, and sound when it comes back clean:
no diagnostics at all means swiftc processed the whole set.
NOT sound for deciding which individual file failed — a parse error in one file aborts
the run before later files are reached, so absence of a diagnostic does not prove a
file compiles. Use typecheck_each for that.
"""
if not files:
return 0, ""
return _swiftc(files, root, sdk, modules)
def typecheck_each(files: list[Path], root: Path, sdk: str, modules: Path) -> set[str]:
"""Typecheck each file on its own, in parallel. Returns the set of paths that failed.
One invocation per file is the only sound way to classify: batching lets an early
parse error mask every file after it (observed — an invalid Package.swift snippet
aborted the run and silently marked ~1450 unreached fences as 'compiling').
"""
failed: set[str] = set()
if not files:
return failed
with cf.ThreadPoolExecutor(max_workers=os.cpu_count() or 8) as ex:
futs = {ex.submit(_swiftc, [f], root, sdk, modules): f for f in files}
for fut in cf.as_completed(futs):
code, _ = fut.result()
if code != 0:
failed.add(str(futs[fut]))
return failed
def sdk_path() -> str:
proc = subprocess.run(["xcrun", "--show-sdk-path"], capture_output=True, text=True)
out = proc.stdout.strip()
if proc.returncode != 0 or not out:
raise RuntimeError(
"xcrun --show-sdk-path failed; refusing to continue. Without an SDK every fence "
"would fail to typecheck, which classify would record as 'nothing is checkable' "
"and check would then pass trivially forever.")
return out
def modules_dir(root: Path) -> Path:
"""Locate the built module dir rather than hardcoding an architecture.
A hardcoded arm64 path silently resolves to nothing on an Intel host, which degrades
into the same empty-manifest false OK as a missing SDK.
"""
proc = subprocess.run(["swift", "build", "--show-bin-path"], cwd=root,
capture_output=True, text=True)
if proc.returncode == 0 and proc.stdout.strip():
d = Path(proc.stdout.strip()) / "Modules"
if d.is_dir():
return d
raise RuntimeError("could not locate the built Modules dir; run `swift build` first")
def host_triple() -> str:
machine = subprocess.run(["uname", "-m"], capture_output=True, text=True).stdout.strip()
arch = "arm64" if machine == "arm64" else "x86_64"
return f"{arch}-apple-macosx15.0"
def body_hash(body: str) -> str:
"""Short content hash of a fence body."""
return hashlib.sha256(body.encode()).hexdigest()[:16]
def key(f: dict) -> str:
"""Manifest identity: file + ordinal + CONTENT HASH.
The hash is load-bearing, not decoration. Keying on position alone means inserting a
fence shifts every later ordinal while each recorded key still resolves — so the
staleness check never fires and the harness silently typechecks a DIFFERENT fence
under the preamble recorded for the old one, reporting OK either way. A hash mismatch
is treated exactly like a missing fence: re-classify.
"""
return f"{f['file']}\t{f['ordinal']}\t{body_hash(f['body'])}"
def cmd_classify(root: Path, outdir: Path, manifest: Path, allow_shrink: bool = False) -> int:
"""Ask the compiler which fences compile, and under which preamble.
Nobody annotates ~1450 fences by hand: a fence is checkable iff it typechecks. Anything
that compiles under NONE of the preambles self-excludes — that is how iOS-only examples,
Package.swift manifest snippets and pseudo-code drop out with no skip list.
"""
fences = collect(root)
print(f" {len(fences)} swift fence(s) found")
modules = modules_dir(root)
sdk = sdk_path()
classified: dict[str, str] = {}
remaining = list(enumerate(fences))
for pre in PREAMBLES:
if not remaining:
break
d = outdir / pre
d.mkdir(parents=True, exist_ok=True)
gen: dict[str, tuple] = {}
for idx, fence in remaining:
p = generate(fence, pre, d, idx, remap=False)
gen[str(p)] = (idx, fence)
failed = typecheck_each([Path(p) for p in gen], root, sdk, modules)
passed = [(i, f) for p, (i, f) in gen.items() if p not in failed]
for _, f in passed:
classified[key(f)] = pre
print(f" preamble '{pre}': {len(passed)} of {len(remaining)} compile")
remaining = [(i, f) for p, (i, f) in gen.items() if p in failed]
print(f" unclassifiable (left unchecked): {len(remaining)}")
# Refuse a silent coverage drop. `check` tells the user to re-classify when it fails,
# so without this a real breakage could be "resolved" by quietly checking less.
if manifest.exists() and not allow_shrink:
previous = len([l for l in manifest.read_text().split("\n") if l.strip()])
if len(classified) < previous:
print(f"REFUSED: coverage would drop from {previous} to {len(classified)} fence(s).",
file=sys.stderr)
print(" A doc example probably broke — fix it rather than un-recording it.",
file=sys.stderr)
print(" If the drop is intended (an example was deliberately removed):",
file=sys.stderr)
print(" bash scripts/check-doc-snippets.sh --classify --allow-shrink",
file=sys.stderr)
return 1
manifest.write_text("\n".join(f"{k}\t{v}" for k, v in sorted(classified.items())) + "\n")
print(f"OK: recorded {len(classified)} checkable fence(s) in {manifest.name}")
return 0
def cmd_check(root: Path, outdir: Path, manifest: Path) -> int:
"""Typecheck exactly the fences the manifest records as checkable."""
if not manifest.exists():
print(f"ERROR: no manifest at {manifest}", file=sys.stderr)
print(" Create it with: bash scripts/check-doc-snippets.sh --classify", file=sys.stderr)
return 1
recorded: dict[str, str] = {}
for line in manifest.read_text().split("\n"):
if not line.strip():
continue
parts = line.split("\t")
if len(parts) != 4:
print(f"ERROR: malformed manifest line: {line!r}", file=sys.stderr)
print(" Re-run: bash scripts/check-doc-snippets.sh --classify", file=sys.stderr)
return 1
f, o, h, pre = parts
recorded[f"{f}\t{o}\t{h}"] = pre
fences = {key(f): f for f in collect(root)}
missing = [k for k in recorded if k not in fences]
if missing:
# A hard failure, not a warning: a recorded fence that no longer matches means the
# manifest is stale, and continuing would silently check fewer examples than the
# manifest claims — the guard would report OK while protecting nothing.
print(f"FAIL: {len(missing)} recorded fence(s) no longer match the docs.", file=sys.stderr)
print(" A fence was edited, moved, inserted or deleted. The manifest is keyed", file=sys.stderr)
print(" on content, so this is drift — not necessarily breakage.", file=sys.stderr)
for m in missing[:8]:
f, o, h = m.split("\t")
print(f" - {f} (fence #{o})", file=sys.stderr)
print("", file=sys.stderr)
print(" Re-run: bash scripts/check-doc-snippets.sh --classify", file=sys.stderr)
return 1
modules = modules_dir(root)
sdk = sdk_path()
files: list[Path] = []
outdir.mkdir(parents=True, exist_ok=True)
for i, (k, pre) in enumerate(sorted(recorded.items())):
if k not in fences:
continue
files.append(generate(fences[k], pre, outdir, i, remap=True))
code, out = typecheck_batch(files, root, sdk, modules)
errs = [l for l in out.split("\n") if re.match(r"^\S.*?:\d+:\d+: error:", l)]
if code != 0:
if not errs:
# swiftc failed but we could not parse its diagnostics — show them raw rather
# than printing a confusing "0 example(s) no longer compile".
print("FAIL: swiftc reported a failure we could not parse:", file=sys.stderr)
print(out[-3000:], file=sys.stderr)
return 1
print(f"FAIL: {len(errs)} doc example(s) no longer compile:", file=sys.stderr)
for e in errs[:40]:
print(f" {e}", file=sys.stderr)
print("", file=sys.stderr)
print("Each location above is the ORIGINAL doc file and line — fix the example there.",
file=sys.stderr)
print("If an example is intentionally no longer checkable, re-run --classify.", file=sys.stderr)
return 1
print(f"OK: {len(files)} doc example(s) still compile.")
return 0
if __name__ == "__main__":
if len(sys.argv) < 4:
print("run via scripts/check-doc-snippets.sh", file=sys.stderr)
sys.exit(2)
_mode, _root, _out = sys.argv[1], Path(sys.argv[2]), Path(sys.argv[3])
_shrink = "--allow-shrink" in sys.argv[4:]
_man = _root / "scripts/doc-snippets-manifest.txt"
try:
sys.exit(cmd_classify(_root, _out, _man, _shrink) if _mode == "classify"
else cmd_check(_root, _out, _man))
except RuntimeError as e:
print(f"ERROR: {e}", file=sys.stderr)
sys.exit(1)
View File