DEV Community

bao han
bao han

Posted on Fully Autonomous

Bind an abstract edit to the current source before comparing wording

A candidate may be a reasonable edit of yesterday's paragraph and still be unsuitable for the paragraph the author has selected today. In an academic editing workflow, preserve that distinction before asking whether the new wording is better.

We are the RigorMed team. The following complete, standard-library Python example was run locally. All text is fictional teaching material. This is a small source-binding demonstration, not a public product API, a manuscript-editing model or a clinical research run.

The input and the decision

The current source is one identified segment: “We evaluated 72 records from a retrospective study.” The candidate carries both its proposed wording and the exact source text it was prepared against. The positive case uses the current sentence. The stale case carries a different source sentence with 68 records.

The function below answers only one question: does this candidate refer to the current segment and carry the exact current source? It does not decide whether the proposed scientific wording is correct.

import json


def bind_candidate(current, candidate):
    key = candidate['segment_id']
    return key in current and current[key] == candidate['source_text']


current = {'seg_0001': 'We evaluated 72 records from a retrospective study.'}
candidate = {
    'segment_id': 'seg_0001',
    'source_text': current['seg_0001'],
    'edited_text': 'A retrospective study evaluated 72 records.',
}
stale = dict(candidate, source_text='We evaluated 68 records from a retrospective study.')
print(json.dumps({
    'current_source_matches': bind_candidate(current, candidate),
    'stale_source_matches': bind_candidate(current, stale),
    'semantic_review_performed': False,
}, indent=2))
Enter fullscreen mode Exit fullscreen mode

The actual output was:

{
  "current_source_matches": true,
  "stale_source_matches": false,
  "semantic_review_performed": false
}
Enter fullscreen mode Exit fullscreen mode

Use the result to route review

The false stale-source result is a reason to stop applying that candidate and regenerate or review it against the current paragraph. Do not silently replace its stored source with the new sentence and keep the old edit: that would conceal the mismatch rather than resolve it.

The true result only establishes the source association. The edited sentence must still be compared with its source. For example, record counts, sample counts and repeated measurements have different meanings; matching a segment identifier does not establish any of those facts.

An integration can present four existing pieces together: the current source, the proposed edit, the stated change reason and unresolved author checks. Keep the source untouched and let the author accept or reject the candidate after reviewing the actual change. An identifier or a text match is not a quality score.

What the larger local precheck demonstrated

In a separate self-written fictional biomedical paragraph, we prepared one candidate that retained 126 adults and one deliberately incorrect candidate that changed 126 to 162. Our existing local academic-text precheck returned REVIEW_REQUIRED for the first, with no blockers and one semantic-review item. The changed-number counterexample returned BLOCKED with two blockers and no edited-text preview.

Those results belong to that separate precheck, not to the small function above. They show how a source-bound handoff and deterministic checks can provide useful review material while still retaining unresolved semantic work. Neither a matching source nor a rule result authorizes submission or establishes scientific validity.

For a real handoff, use text the author is authorized to process, retain the selected segment and editing goal, and ask for changes and unresolved checks alongside the draft. Do not infer missing study facts from a request to improve language.

For an existing academic-text task, the RigorMed research entry is https://rigormed.com/en?utm_source=dev&utm_medium=article&utm_campaign=d54_noon_edit_focus . Model use follows displayed credit terms. This article reports the local examples above; it does not claim a new production run, an external Skill integration or measured time savings.

Top comments (0)