Scan your whole stack
Are you using lacing?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.0.124
lacing was last scanned on 23 Nov 2026 at version 0.0.124. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.0.124 LATEST | 23 Nov 2026 | No rules fired |
| 0.0.123 | 23 Nov 2026 | No rules fired |
| 0.0.122 | 23 Nov 2026 | No rules fired |
| 0.0.121 | 23 Nov 2026 | Not shown |
| 0.0.120 | 23 Nov 2026 | Not shown |
Findings for v0.0.124. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.0.124; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A standoff, interval-keyed annotation system for time-based media (audio, video, speech, music), usable for any 1-D interval domain. The core is a MutableMapping[TimeInterval, list[Annotation]] facade with rational time, ELAN-style tier stereotypes, and Allen's interval algebra. Load a Praat TextGrid, query it, write it back out as WebVTT, and keep it in memory, SQLite or Postgres.
pip install lacing
Status: Phase 0–2 complete. In the box: the data model; in-memory, SQLite and Postgres stores; thirteen round-trip adapters (Praat TextGrid, WebVTT, SubRip, LRC, ASS/SSA, W3C Web Annotation,
.annotSQLite, ELAN EAF, JAMS, Label Studio JSON, OpenTimelineIO, Podcasting 2.0 transcript and chapters); a body-schema registry with JSON Schema export and migrations; inter-annotator agreement metrics; alacingCLI; a FastAPI HTTP server (REST CRUD, ETag, import/export, op-log,/state-attime-travel); an MCP server (10 tools); a processor registry with optional Arq integration; and opt-in OpenTelemetry. A frontend is on the roadmap (seemisc/docs/Lacing Development Roadmap.md).
pip install 'lacing[textgrid]' # + Praat TextGrid support (praatio)
pip install 'lacing[eaf]' # + ELAN EAF support (pympi-ling)
pip install 'lacing[jams]' # + JAMS (MIR annotation) support
pip install 'lacing[postgres]' # + PostgresStore (psycopg + GiST + EXCLUDE)
pip install 'lacing[server]' # + FastAPI HTTP server
pip install 'lacing[mcp]' # + MCP server (agents as first-class clients)
pip install 'lacing[arq]' # + Arq background workers (Redis-backed)
pip install 'lacing[otio]' # + OpenTimelineIO adapter
pip install 'lacing[otel]' # + OpenTelemetry instrumentation
from lacing.adapters import textgrid, webvtt, web_annotation # registers each
from lacing.adapters import load, dump
# Load a Praat TextGrid → an in-memory store keyed by interval
store = load("speech.TextGrid", rate=1000)
# Query overlaps using Allen's relations
from lacing.time import RationalTime, TimeInterval
window = TimeInterval(RationalTime(500, 1000), RationalTime(1500, 1000))
for ann in store.intersects(window):
print(ann.tier, ann.body["text"])
for ann in store.during(window): # strictly inside the window
...
# Save out as WebVTT
dump(store, "speech.vtt", format="webvtt")
# Or as W3C Web Annotation JSON-LD
dump(store, "speech.jsonld", format="web_annotation")
Some tier shapes recur often enough to deserve a friendly builder. lacing.tracks.subtitle is the first: a (sections, lines, words) trio over one audio asset, with float-second times and the Annotation / MediaRef / Provenance plumbing hidden:
from lacing import MemoryStore
from lacing.tracks.subtitle import SubtitleBuilder, SubtitleTrack
store = MemoryStore()
with SubtitleBuilder(store, asset_id="song/audio.mp3") as b:
b.section("intro", 0.0, 12.5)
b.section("verse_1", 12.5, 35.0)
b.line(
"I came down to the river",
12.5,
16.2,
section="verse_1",
line_index=0,
words=[
("I", 12.5, 12.7),
("came", 12.7, 13.0, 0.95), # optional confidence
("down", 13.0, 13.3),
],
)
track = SubtitleTrack(store, asset_id="song/audio.mp3")
track.lines_in(15.0, 17.0) # lines overlapping the window
track.words_in(12.5, 13.5) # words overlapping the window
track.sections_covering(20.0) # sections containing this instant
The facade reuses at_tier / by_tier under the hood; anything you can build with it could also be hand-built with the raw API. Body schemas (annot://schema/song-section/v1, lyric-line/v1, word/v1) are lacing built-in bodies, registered on import: sections and lines keep any extra fields you pass, words use the strict word/v1.
lacing/
├── time.py RationalTime + TimeInterval — rational, half-open, never float
├── model.py Annotation envelope + Reference union + Provenance (PROV-O subset)
├── tier.py Tier + 5 ELAN tier stereotypes + constraint validator
├── allen.py 13 Allen relations + intersects + relate + composition
├── digest.py annotation_value_digest — content digest for freshness / early cutoff
├── store/
│ ├── base.py IntervalAnnotationStore (MutableMapping facade)
│ ├── memory.py MemoryStore over `intervaltree`
│ ├── mapping.py MappingStore — persisted to any injected MutableMapping (dict, dol JsonFiles, an app's store)
│ ├── sqlite.py SqliteStore — persistent backend + .annot file format
│ └── postgres.py PostgresStore — int8range + GiST + per-tier EXCLUDE
├── adapters/
│ ├── textgrid.py Praat .TextGrid (interval + point tiers)
│ ├── webvtt.py .vtt subtitles/captions
│ ├── srt.py .srt SubRip subtitles
│ ├── lrc.py .lrc lyrics, plain and enhanced (word timing)
│ ├── podcast_transcript.py Podcasting 2.0 podcast:transcript JSON (.transcript.json)
│ ├── podcast_chapters.py Podcasting 2.0 podcast:chapters JSON (.chapters.json)
│ ├── ass.py .ass/.ssa subtitles: styles, override tags, \k karaoke
│ ├── web_annotation.py W3C Web Annotation Data Model (JSON-LD)
│ ├── annot.py .annot SQLite portable file format (lossless)
│ ├── eaf.py ELAN EAF (4 stereotypes verbatim)
│ └── jams.py JAMS (Music Information Retrieval) — namespaces → tiers
├── cli.py `lacing` CLI: convert, query, validate, list-formats
├── quality.py Cohen's κ, Krippendorff's α, interval IoU, boundary IoU
├── schema.py Body schema registry + JSON Schema export + migrations
├── bodies/ Built-in body schemas (word, named-entity, ...)
└── server/ FastAPI HTTP server (Phase 2)
├── app.py create_app(); ready-to-run `app` for uvicorn
├── deps.py dependency-injection (store factory)
├── etag.py ETag computation + If-Match parsing
└── routers/ REST endpoints: annotations, tiers, adapters, meta
RationalTime(value: int, rate: int). Wire format {v, r}. Never floats.(asset_id, interval); source is immutable.Annotation.body: dict validated by body_schema_uri (semver).NONE, TIME_SUBDIVISION, INCLUDED_IN, SYMBOLIC_SUBDIVISION, SYMBOLIC_ASSOCIATION.was_generated_by, was_attributed_to, was_derived_from, generated_at_time. generated_at_time is wall-clock (RationalTime.now()); tick 0 is UNKNOWN_GENERATED_AT, never the epoch — consumers read it as unverifiable, not oldest.The full reasoning lives in misc/docs/ — four design docs covering annotation systems generally, backend architecture, frontend UI, and an OSS deep-dive of what to build on. The synthesized plan is in misc/docs/Lacing Development Roadmap.md.
from uuid import uuid4
from lacing import (
Annotation,
MediaRef,
MemoryStore,
Provenance,
RationalTime,
TimeInterval,
Tier,
)
store = MemoryStore()
store.add_tier(Tier("words"))
store.add(
Annotation(
id=uuid4(),
tier="words",
reference=MediaRef(
asset_id="blake3:abc123",
interval=TimeInterval.from_seconds("0.0", "0.5", rate=1000),
),
body={"text": "hello"},
body_schema_uri="annot://schema/word/v1",
provenance=Provenance(
was_generated_by="user:thor",
was_attributed_to="thor",
generated_at_time=RationalTime.now(),
),
)
)
from lacing.allen import AllenRelation
from lacing.time import RationalTime, TimeInterval
w = TimeInterval(RationalTime(0, 1000), RationalTime(500, 1000))
list(store.intersects(w)) # any overlap
list(store.during(w)) # strictly inside w
list(store.contains(w)) # strictly contains w
list(store.relate(w, [AllenRelation.MEETS])) # ends at w.start
from lacing.store import SqliteStore
# Open or create a .annot file (SQLite under the hood)
store = SqliteStore("project.annot")
store.add_tier(...)
store.add(...) # writes go straight to disk
store.set_meta("project", "demo")
# Same MutableMapping + Allen-relation interface as MemoryStore
for ann in store.intersects(window):
...
store.close()
The .annot file is the recommended portable handoff format — single-file SQLite, Git-trackable, lossless round-trip with MemoryStore.
Already keep your data in a mapping (a dict, a dol JsonFiles, an app's store)? Hand it over and there is no second persistence path:
from lacing.store import MappingStore
store = MappingStore(
my_mapping
) # one key per annotation id -> its JSON; tiers under one reserved key
store.add(...) # writes through to my_mapping
store = MappingStore(my_mapping) # reopening sees the same annotations and tiers
Single writer, no cross-process locking (unlike SqliteStore). Pass codec=JSON_BYTES_CODEC for a mapping that stores bytes.
For multi-user / production scale, the same facade is available over PostgreSQL:
from lacing.store import PostgresStore
from lacing.tier import Tier
store = PostgresStore("postgresql://localhost/myproject", rate=1000)
# Per-tier non-overlap is enforced declaratively by the database — try to
# add an overlapping annotation in this tier and Postgres rejects the insert.
store.add_tier(Tier("speakers"), enforce_no_overlap=True)
The Postgres backend uses int8range + GiST (sub-millisecond overlap queries at million-row scale) and exposes the same Allen-relation methods. Times are normalized to a project-wide rate stored in meta.
After pip install -e . the lacing command is on your PATH:
lacing list-formats # show registered adapters
lacing convert speech.TextGrid speech.annot # convert between formats
lacing query speech.annot --start 1.0 --end 5.0 --rate 1000 # JSON-lines
lacing validate speech.annot # parse + summary
Every annotation has a body: dict validated against the schema named by its body_schema_uri (e.g., annot://schema/named-entity/v2). Register your own with a Pydantic v2 model:
from pydantic import BaseModel, Field
from lacing.schema import register_body_schema, register_migration, validate, migrate
class WordBodyV1(BaseModel):
model_config = {"frozen": True, "extra": "forbid"}
text: str = Field(...)
speaker: str | None = None
register_body_schema("annot://schema/word/v1", WordBodyV1)
# Validate at runtime:
validate({"text": "hello"}, "annot://schema/word/v1")
# Register a forward migration v1 -> v2:
@register_migration(schema_name="word", from_version=1, to_version=2)
def _v1_to_v2(body: dict) -> dict:
return {**body, "lemma": None}
# Migrate stored data:
migrated = migrate(
{"text": "ran"}, from_uri="annot://schema/word/v1", to_uri="annot://schema/word/v2"
)
Export every registered schema to JSON Schema (the upstream for downstream Zod codegen):
from lacing.schema import export_json_schemas
export_json_schemas("./schema/") # writes <name>/v<N>.json + index.json
Built-in body schemas live under lacing/bodies/ (word, named-entity). They register themselves on import.
pip install 'lacing[server]'
uvicorn lacing.server:app --reload
By default the server starts with an in-memory SqliteStore. Wire your own backend (e.g., a PostgresStore or an .annot file) via FastAPI's dependency-override:
from lacing.server import create_app
from lacing.server.deps import get_store
from lacing.store import SqliteStore
store = SqliteStore("project.annot", check_same_thread=False)
app = create_app()
app.dependency_overrides[get_store] = lambda: store
The REST surface (Phase 2.0):
GET /health
GET /tiers list
POST /tiers create or update
GET /tiers/{name} get one
POST /annotations create (returns ETag)
GET /annotations list with optional ?tier&start&end&relation&rate
GET /annotations/{id} get one (returns ETag)
PATCH /annotations/{id} partial update; If-Match required
DELETE /annotations/{id}
POST /import?format=webvtt upload a file in any registered format
GET /export?format=eaf dump store as a file
GET /formats list registered adapters
GET /schemas list registered body_schema_uris
GET /schemas/{uri} JSON Schema for a URI
GET /meta, PUT /meta/{key} key/value metadata
GET /oplog list mutations (filterable by clock)
GET /oplog/latest-clock current Lamport clock value
GET /state-at?clock=N replay log to clock N → snapshot
Every mutation gets a Lamport clock returned in the X-Lacing-Clock response header. The op-log + /state-at endpoint give you full time-travel debug — pick any past clock value and reconstruct exactly what the system saw.
from lacing.oplog import InMemoryOpLog
from lacing.server.mcp import build_mcp_server
from lacing.store import SqliteStore
store = SqliteStore("project.annot", check_same_thread=False)
oplog = InMemoryOpLog()
server = build_mcp_server(store, oplog)
server.run() # stdio transport by default
Tools registered (all take seconds — no need to construct rational-time wire dicts): add_annotation, query_annotations, get_annotation, delete_annotation, accept_ai_suggestion, add_tier, list_tiers, list_formats, latest_clock, state_at. The MCP server shares the same store + oplog as the FastAPI app, so a human edit via REST and an agent edit via MCP land in the same op-log with the same Lamport clock.
accept_ai_suggestion returns two records — {"annotation": …, "review": …} — because a review is two facts, not one. The reviewed annotation keeps its id and its provenance: it was still generated by the agent, so was_generated_by / was_attributed_to are left alone and only confidence moves to 1.0 / 0.0. The human's decision becomes its own standoff approval review annotation on the review tier, pointing at what it judged (AnnotationRef, no interval), attributed to the reviewer and stamped with the review time. Rewriting the agent's provenance in place — which is what this used to do — erased the one record proving the annotation was ever AI-generated (lacing#18).
The review carries no interval on purpose: a verdict about a whole annotation has no position of its own on the media timeline, so it stays out of untiered interval queries and out of every timeline export. Giving it the reviewed annotation's interval would put a blank cue at that annotation's exact timestamps in WebVTT, an empty interval in a TextGrid tier, and an asset-less item in a Web Annotation collection — one per accept.
lacing has three digests answering three different questions. Picking the wrong one is a silent correctness bug, so they are named apart:
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.