Last updated: 2026-11-13
A factual excerpt can fit a time limit while dropping the qualifications that make it fair. Context Cut checks a proposed cut against reviewer-authored context requirements and returns a timecoded repair, or explains why no permitted cut fits.
This repository contains a working offline Python CLI, source and tests, locked dependencies, an inspectable Relate database, and draft submission materials. It is not a submitted Devpost entry. The sample and walkthrough are explicitly scripted and synthetic, not a live model-driven agent or rendered video.
A creator has a reviewed longer recording and wants a Short that keeps a particular statement. A reviewer has identified which source passages must accompany each statement occurrence. Context Cut searches whole source spans in their original order, preserving the exact focal occurrence and all requirements activated by the resulting selection.
In the supplied example, a short battery-life claim needs attribution, test conditions and an independent-testing caveat. A compact context option introduces a warranty claim, which activates its own exclusion requirement. A similar caveat about a different test does not count.
The output is an ordered cut list with original text, millisecond source intervals, changes and structured reasons. Passing means compliance with the supplied constraints, not factual accuracy, annotation completeness, audience comprehension, audiovisual continuity or permission to publish.
- Mode: A native single-file
.rldatabase, opened throughrelate-db==1.0.0in Python. - Why this mode: The reviewer can receive a small self-contained case and inspect its constraints and accepted decision after the original process ends. No database server, cloud account or model connection is required to run the application.
- What the graph models: Source spans express specific claim occurrences; occurrences require obligations; approved bundles cover those obligations and need ordered source spans. Snapshots retain exact versions. A decision records its full request, selected spans and bundle witnesses.
- Operational graph use: Checking and planning reconstruct and validate those relationships from Relate. The finite solver evaluates every focal-containing selection using graph-derived constraints. Stored verdict flags and a decorative graph are not substitutes for those queries.
Python supplies input validation, finite search, ranking, hashing and export. Relate supplies the embedded relationship store, queries and transactions. Recursive SQL could also represent these relationships; no exclusive algorithm or performance advantage is claimed.
The included owned synthetic store is examples/power-bank/case.rl. Its companion cut.md, cuts.csv, cut.json and manifest.json show the accepted 18-second fixture result. This directory is an application packet and intentionally contains exactly those five files.
The source fixture and reference request/proposal hashes are included in src/context_cut/fixtures/. The .rl sample is deliberately included despite the general database ignore rule. It contains only synthetic text and fixture labels, not production data or credentials.
Requires Python 3.12 or later and uv. Execution has been tested on Apple Silicon macOS with Python 3.15.2, not certified on every supported wheel platform. Initial setup normally downloads ordinary package dependencies; the bundle does not include a full dependency wheelhouse. Application operations afterward are offline.
From a fresh clone or extracted bundle root, first verify the pristine payload inventory:
python3 -I tools/verify_bundle.pyThen install:
UV_CACHE_DIR=.uv-cache uv sync --locked --python python3Inspect the included graph and independently recompute its stored decision:
.venv/bin/python -I -m context_cut inspect --case examples/power-bank/case.rl --decision-id demo_compactExpected status: DECISION_VALID. The selected spans are s02, s07, s08, with total duration 18,000 ms under a 25,000 ms budget.
Verify the packet's file hashes and cross-file consistency separately:
.venv/bin/python -I -m context_cut verify-packet --packet examples/power-bankExpected status: PACKET_VALID. This command does not open Relate or authenticate a reviewer. The inspect command above performs semantic graph reconstruction.
mkdir -p .runtime/tmp.venv/bin/python -I -m context_cut demo --fixture power-bank --out .runtime/demoThe output directory must be new; choose a new path for another run. The command imports a real graph, checks the original selection, runs all three bounded searches, records a fixture decision, exports a new packet and invokes a separate inspector process.
| Requested budget | Result | Top-ranked duration |
|---|---|---|
| 35 seconds | FEASIBLE, 22 permitted selections | 30 seconds |
| 25 seconds | FEASIBLE, 7 permitted selections | 18 seconds |
| 17 seconds | INFEASIBLE, minimum is 18 seconds | None |
The original excerpt returns CONSTRAINTS_UNMET. The full demo returns DEMO_COMPLETED. These are actual deterministic application operations, not a model transcript. The generated readable cut is .runtime/demo/packet/cut.md.
mkdir -p .runtime/tmpTMPDIR="$PWD/.runtime/tmp" PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -I -m unittest discover -s tests -vThe implementation has 83 acceptance/regression tests, including a separately implemented finite-search oracle, seeded mutation checks, graph corruption, transaction recovery, decision binding, portable inspection, packet tampering and restricted tool aliases. Validation notes distinguish the original development/wheel tests from this bundle's relocated-source checks with an existing locked environment, not a fresh install.
The standard-library bundle verifier shown before setup checks the pristine payload inventory and digests without installing the app. It ignores only root .git metadata, including a worktree-style .git file. Run it on a fresh clone or extraction before installation or browsing inside the folder in Finder: macOS may add .DS_Store, which this exact-inventory check reports as an extra file. Installing or running the project also creates local .venv, cache and demo files. Verify a new pristine clone or extraction if you need to check the source bundle again. The manifest's prepared-local-not-submitted stage identifies the prepared source payload; it is not a Devpost status check or evidence of submission.
The file manifest is a consistency check, not a signature or protection against rewriting the whole bundle. Relate's .rl consistency manifest likewise does not authenticate a reviewer.
After packages are cached, environment synchronization can be tested with network access disabled:
UV_CACHE_DIR=.uv-cache uv sync --locked --offline- At most twelve whole spans from one reviewed transcript section, with original order preserved. No transcription, rewriting, rendering, frame-rate conversion or publication.
- Context bundles qualify an exact occurrence and must be contiguous in the selected sequence. Repair-added spans activate their own occurrences.
- The complete finite search ranks by changed-span count, added-span count, duration and source-index tuple. The top three are returned only after complete search; interruption is not infeasibility.
- Pending review blocks a passing result. New annotations create an immutable snapshot and cannot inherit an earlier proposal's approval silently.
- Operator acceptance/rejection is separate from the three read-only application tools. Actor labels are not authenticated identities; there is no operating-system sandbox or tamper-proof ledger.
- One writable native store owner and owner-thread Python operations. Independent inspection follows writer closure. Browser
.rlinterchange and long-lived native Node ownership are not included. - Input JSON is limited to 1 MiB; packet text to 8 MiB; native cases to 64 MiB for this MVP. Relate's live graph is RAM-resident and the project is experimental Neo4j Labs software.
- Paths are conservative about symlink components. On macOS use resolved
/private/tmp/...or/private/var/...rather than their/tmpor/varaliases for packet operations.
Full contracts and implemented module boundaries are in SPEC.md. The annotation-plus-planning workflow has not yet been compared with a real editor's ordinary checklist, and there is no claim of validated demand or prize probability.
- Draft project story and metadata
- AI assistance and third-party disclosure
- 90–120 second recording plan, not a recorded or uploaded video
- Submission readiness checklist
Source repository: owenisas/context-cut. A Devpost draft has its title and tagline saved; it is not submitted. No demo-video URL or gallery thumbnail is supplied. The actual form requires a YouTube/Vimeo video URL, and remaining entry materials and attestations are recorded in the checklist.
Source and owned synthetic fixtures are under the MIT license. Third-party dependencies retain their own licenses. Repository publication does not include a Devpost submission, new terms acceptance or video upload.