Repetita Gravity

Every concept has a natural home.

Inspiration

Long documents often repeat the same concept in different words. We commonly respond by asking an AI system to rewrite the document repeatedly, hoping the repetition will disappear.

That process is time-consuming and unreliable. A rewrite may shorten the document while also removing evidence, qualifications, exceptions, context, or distinctions that should remain.

Many repetition tools focus on repeated wording or surface similarity. Repetita Gravity asks a more consequential question:

When meaning recurs, where does that concept properly belong, and how can the repetition be consolidated without damaging the surrounding reasoning or losing unique substance?

This problem affects almost every kind of writing: legal submissions, technical specifications, architecture documents, research papers, business reports, emails, stories, and personal letters.

The consequence is not merely verbosity. Repetition can fragment reasoning, weaken emphasis, obscure evidence, and make every subsequent rewrite less stable.

What it does

Repetita Gravity is a general post-generation control process for long-form documents, demonstrated through a compact OpenAI Build Week application.

It is designed to operate between AI-assisted drafting and final delivery.

It treats every recurring concept as having semantic mass. The section with the greatest functional competence becomes that concept's Logical Gravity Centre.

The complete treatment is drawn toward that centre, but other occurrences are not deleted mechanically.

Necessary summaries remain. Evidence stays beside its evidentiary record. Qualifications and exceptions are preserved. Intentional structural repetition remains untouched. Only accidental semantic redundancy becomes eligible for consolidation.

The central innovation is not repetition detection. It is loss-controlled semantic redistribution.

Before changing a passage, Repetita Gravity separates:

  • duplicated semantic payload that may be transferred;
  • unique residual payload that must remain;
  • the passage's local communicative function;
  • evidence, numbers, qualifications, limitations, and exceptions;
  • grammatical dependencies that could break after subtraction.

It then performs two complementary operations:

  1. Donor repair — reconstructs the passage from which duplicated meaning was removed, preserving its remaining substance, grammar, and local function.
  2. Receiver accretion — integrates every unique contribution into the Logical Gravity Centre without concatenating sentences or creating new repetition.

The purpose is not simply to produce a shorter document. It is to improve the distribution of its concepts while preserving its substantive meaning.

The application returns three separate artefacts:

  • the immutable original document;
  • the complete revised document;
  • an auditable Gravity Report explaining what moved, what remained, and why.

The revised output can be inspected against the original, copied, or downloaded as a text file.

How it works

The application exposes the complete processing chain:

  1. Read the document and identify its structure.
  2. Build a Conservation Ledger containing every original semantic unit.
  3. Map recurrence families using lexical, conceptual, structural, and contextual signals.
  4. Classify each occurrence according to its semantic relation, local function, and possible editorial treatment.
  5. Locate Logical Gravity Centres using functional competence, completeness, coherence, and disruption risk.
  6. Plan redistribution one recurrence family at a time.
  7. Run an atomic Gravity Pass that either commits safely or rolls back, producing the complete revised document.
  8. Verify conservation against both the preceding state and the immutable original.
  9. Generate a Gravity Report explaining what moved, what remained, and why, while exposing the Original, Revised, and Compare views together with copy and download controls.

Occurrences may be classified as:

  • intentional structural recurrence;
  • necessary functional recurrence;
  • supporting evidence;
  • accidental semantic redundancy;
  • partial semantic overlap;
  • distinct function;
  • cross-reference candidate;
  • human review required.

No original semantic unit may disappear silently.

Every claim, fact, item of evidence, qualification, limitation, exception, consequence, and recommendation must receive an explicit final disposition.

When the available evidence does not justify automatic consolidation, Repetita Gravity fails closed. The occurrence remains protected and is referred for semantic or human review.

Adaptive processing

The same strategy cannot be applied to both a short email and a document containing hundreds of pages.

Repetita Gravity therefore evaluates:

  • document length;
  • estimated token use;
  • section complexity;
  • number of recurrence families;
  • recurrence density;
  • dispersion across sections;
  • cross-family dependencies;
  • semantic risk.

These measurements determine whether the document can be processed as a whole or requires structural segmentation. They also establish an adaptive pass limit.

The pass count is a safety boundary, not a mandatory number of rewrites. Processing may stop early when the document becomes stable, continue when unresolved dispersion remains, or stop immediately when further consolidation would create more risk than benefit.

Why it matters

A naive repetition remover can shorten a document while making it worse.

It may delete a qualification, detach evidence from its source, leave a pronoun without an antecedent, collapse two genuinely different functions into one, or overload the receiving paragraph with disconnected material.

Repetita Gravity is intended for circumstances in which reducing repetition is less important than proving that nothing material was lost.

This makes the methodology relevant to legal, regulatory, compliance, policy, consulting, technical, academic, professional, creative, and personal writing.

Its governing principle is simple:

Resolve redundancy without producing disruption.

Verification and certification

Every proposed transformation is treated as an isolated transaction.

A transaction can be committed only when the system verifies that:

  • every original semantic unit remains accounted for;
  • no protected evidence is lost;
  • no number, qualification, limitation, or exception disappears;
  • donor passages remain grammatically and logically complete;
  • transferred content reaches the correct Logical Gravity Centre;
  • cross-references resolve correctly;
  • no new semantic redundancy is introduced;
  • the complete revised document has been generated successfully.

Python performs deterministic reconciliation against the Conservation Ledger and the immutable original document.

The final state:

VERIFIED BY REPETITA GRAVITY

is displayed only when every required formal and semantic gate passes.

Otherwise, the report states:

NOT YET VERIFIED

and identifies the unresolved conditions.

Built with Codex and GPT-5.6

Luca Arrighi defined the underlying problem, gravity model, Conservation Ledger, donor-receiver distinction, isolated family transactions, risk-ordered processing, and adaptive stopping principle.

Codex and GPT-5.6 Sol helped translate that methodology into:

  • an executable Python implementation;
  • structured semantic contracts;
  • a recurrence graph;
  • Logical Gravity Centre scoring;
  • atomic commit and rollback logic;
  • independent conservation gates;
  • adversarial regression tests;
  • a compact browser workflow for human inspection.

GPT-5.6 is used for bounded semantic decisions that cannot be established safely through lexical comparison alone, including:

  • recurrence adjudication;
  • residual-payload analysis;
  • local-function classification;
  • donor repair;
  • receiver accretion;
  • whole-document semantic review.

Its output remains a proposal until the independent verification layer accepts it.

The bundled fictional demonstration runs without an API key or paid account. Versioned GPT-5.6 reference decisions are replayed only for the exact hash-bound sample, after which Python independently repeats every conservation check.

For unfamiliar input without live model access, the application remains conservative and exposes unresolved decisions instead of manufacturing certainty.

What makes it different

Repetita Gravity is not a grammar checker, paraphraser, summariser, or duplicate-word detector.

It keeps four separate questions distinct:

  1. Is substantive meaning recurring?
  2. Does each occurrence perform a necessary local function?
  3. Where does the complete treatment most properly belong?
  4. Can the content be redistributed without semantic loss?

Similarity is evidence of possible recurrence. It is never permission to delete.

Repetita Gravity is also substantially different from ProofRail, the author's other Build Week project.

ProofRail operates temporally across successive revisions and prevents accepted decisions from regressing.

Repetita Gravity operates spatially inside a single document and controls where recurring concepts receive their principal treatment.

What we learned

Safe consolidation requires a separation between detection and editorial authority.

A trustworthy system must:

  • preserve provenance through every transformation;
  • distinguish duplicated payload from unique residual content;
  • repair both donor and receiving contexts;
  • preserve intentional and functionally necessary recurrence;
  • verify the reconstructed document independently from the component that proposed the rewrite.

The desired result is not simply a shorter document.

It is a document in which every concept has a defensible location, together with a report capable of demonstrating how it arrived there.

What's next

Future development may include:

  • multilingual semantic analysis;
  • calibrated embedding models;
  • labelled evaluation corpora;
  • privacy-preserving document processing;
  • preservation of complex document formatting;
  • collaborative human-review queues;
  • cross-chunk verification for very large documents;
  • optional live GPT-5.6 adjudication through the Responses API;
  • integrations with AI writing systems, document editors, and professional drafting workflows.

The long-term objective is to make Repetita Gravity a post-generation control process that language models can apply between drafting and delivery:

Generate. Consolidate. Verify. Deliver.

Built With

Share this project:

Updates