Skip to content

emrg: journal_prompt — citation authenticity verification + >=100 references gate - #1116

Merged
argszero merged 1 commit into
masterfrom
feature/journal-citation-integrity
Sep 10, 2026
Merged

emrg: journal_prompt — citation authenticity verification + >=100 references gate#1116
argszero merged 1 commit into
masterfrom
feature/journal-citation-integrity

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Implements host rant 2026-09-10T11:28:43: the journal task prompt (emrg/server/journal_prompt.md) gains two citation requirements — citation authenticity verification (anti-fabrication) and a ≥100-reference threshold (with in-text coverage).

Rationale from the rant: the prompt previously had only scattered anti-fabrication wording ("Do not fabricate data or citations") and a minimum-3-comparison requirement — no systematic citation verification flow and no volume bar.

Changes

Author side — Submission quality bar (now 13 items):

  • emrg: fix remaining bare excepts on wait_closed() and add registry tests #12 Citation authenticity verification (mandatory): every reference must be verified against a real external record before submitting. DOI present → Crossref works/<doi> and compare title/authors/year; no DOI → title search via Crossref query.bibliographic or the arXiv API. Results are written to papers/issue-<N>/reference-check.md (per-entry: key → method → result → real record found) and submitted with the manuscript. Unverifiable entries must be deleted or replaced — never submitted.
  • emrg: add bash_tool and base tool tests #13 ≥100 references, all genuinely cited: a hard, level-independent threshold (case studies included). Bib entries never cited in the body are padding and do not count. Stacks with emrg: fix dead 256-color branch in style_to_sgr, add test #3 to form the citation gradient: 3 comparisons (floor) → 100 references (volume) → authenticity verification (quality).
  • Manuscript layout now lists reference-check.md as a committed artifact.

Editor side — Review quality bar (now 13 items):

Wiring / consistency:

  • Citation verification row added to both review comment templates (editor + author Phase Review-Other), mirroring the Significance check duplication: sampled <n> / fabricated <m> / unverifiable <k> — total references <T> (≥100 required), uncited entries <u>.
  • Editor Phase A triage (completeness step) now verifies the citation gate (≥100 + coverage + reference-check.md present) before moving to in-review; the independent spot-check still happens at review time.
  • Common Rules emrg: consolidate duplicate SessionMemoryStore imports in daemon.py #8 extended so the bar is visible outside the phase sections.
  • Verification method is kept declarative (API endpoints + judgement criteria only, no embedded scripts), per the existing session guidance on keeping prompt files declarative.

Tests

5 new content guards in tests/test_journal_prompt.py (18 total in that file):

  • test_editor_review_bar_requires_citation_authenticity_check
  • test_reference_count_threshold_and_in_text_coverage
  • test_author_side_citation_integrity_requirements
  • test_citation_gate_wired_into_triage_and_common_rules
  • test_citation_verification_row_in_both_review_templates (asserts template parity == 2)

Verification

  • uv run pytest tests/ -q1241 passed, 1 skipped (Agent.md count synced 1237 → 1242 collected)
  • uv run python -c "from emrg.client.app import run_client" → import OK
  • uv run python -m emrg --help → CLI OK
  • Jinja2 render check for both roles (editor / author) → renders cleanly, both carry the Citation verification row
  • Both quality-bar lists verified for continuous numbering (1–13) with no duplicates

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260910-114658

Reviewed 0acd344 against a729e3a (3 files, +68/−3) and independently verified the branch content (not the working tree).

Rant coverage (2026-09-10T11:28:43) — both requirements land at every requested anchor:

  • Author-side Submission quality bar #12: mandatory verification of every reference before submitting (DOI → Crossref works/<doi> title/authors/year compare; no DOI → query.bibliographic title search or arXiv), results written to papers/issue-<N>/reference-check.md and shipped with the manuscript; unverifiable entries deleted/replaced.
  • Author-side #13: ≥100 references, each genuinely cited in the body (padding entries excluded), hard level-independent threshold incl. case studies; explicitly stacked with #3 into the citation gradient.
  • Editor-side Review quality bar #12/#13: independent spot-check (never trusting the author's self-report, ≥1 DOI-less sample) with a fabricated/unverifiable citation as a stand-alone REJECT basis; plus count + in-text coverage check.
  • Review comment template row added to both templates (parity verified == 2), the triage completeness step carries the citation gate, and Common Rules #8 is synced so the bar is visible outside the phase sections.

Verification performed:

  • Both quality-bar lists re-extracted from the committed blob → numbered 1–13, continuous, no duplicates; the existing 11 items' semantics are untouched (pure appends).
  • Verification method kept declarative (API endpoints + judgement criteria only, no embedded scripts) — matches the rant's explicit instruction.
  • 5 new content guards, including count-based template-parity assertions; uv run pytest tests/ -q green locally (1241 passed / 1 skipped); Agent.md count synced 1237 → 1242.
  • Jinja2 renders cleanly for both editor and author roles with the new row present.
  • CI: test pass (1m59s) + test-windows pass (3m2s) on head 0acd344.

No blocking issues found. LGTM 1/3 (author cycle 20260910-113202 excluded).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260910-115454

Re-review of 0acd344 (head unchanged since LGTM 1/3) — content independently re-verified against the current branch head, not the working tree.

Re-verification (fresh this cycle, from origin/feature/journal-citation-integrity):

  • Editor Review quality bar re-extracted → numbered [1..13] continuous: True
  • Author Submission quality bar re-extracted → numbered [1..13] continuous: True
  • Citation verification row count == 2 (editor + author review templates — parity holds)
  • Crossref DOI endpoint (api.crossref.org/works/<doi>) present; declarative style preserved (no embedded scripts)
  • reference-check.md referenced 4× — the authenticity report is wired as a committed submission artifact
  • Diff vs a729e3a: 3 files, +68/−3 (prompt + tests + Agent.md count sync)

CI (head 0acd344): test pass (1m59s) + test-windows pass (3m2s); PR MERGEABLE / CLEAN.

No blocking issues. Still satisfies rant 2026-09-10T11:28:43 (both requirements at every requested anchor: author bar #12/#13, editor bar #12/#13, both review templates, triage gate, Common Rules #8). LGTM 2/3.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260910-120201

Third independent review of 0acd344 (head unchanged since LGTM 1/3) — content re-verified from the committed branch blob, not the working tree.

Independent verification (fresh this cycle, isolated detached worktree at 0acd344):

Check Result
Editor Review quality bar numbered [1..13] continuous: True
Author Submission quality bar numbered [1..13] continuous: True
Citation verification review-template rows (raw) 2 — parity across editor + author templates holds
Per-role Jinja2 render (editor / author) both OK (26090 / 32256 chars), 1 citation row each — no render errors
Crossref refs DOI endpoint api.crossref.org/works/<doi> + query.bibliographic title search + arXiv fallback all present
reference-check.md wiring referenced 4×, declared as a shipped submission artifact
PR-branch test suite tests/test_journal_prompt.py18 passed (5 new guards, incl. count-based template-parity assertion)
Branch collection 1242 tests collected (matches the synced Agent.md count)
CI on head test pass (1m59s) + test-windows pass (3m2s) — PR MERGEABLE / CLEAN

Rant coverage (2026-09-10T11:28:43) — both requirements land at every requested anchor: author bar #12 (mandatory per-reference verification → reference-check.md, delete/replace unverifiable entries) and #13 (≥100 references, each genuinely cited, hard level-independent threshold); editor bar #12 (independent spot-check, never trusting the author's self-report, ≥1 DOI-less sample; fabrication alone justifies REJECT) and #13 (count + in-text coverage); citation gate wired into triage; Common Rules #8 synced.

Style check: the verification method stays declarative (API endpoints + judgement criteria), with no embedded ad-hoc scripts — exactly as the rant requires. Existing bar items are untouched (pure appends).

Housekeeping: local uv.lock churn from the test run was reverted; all verification artifacts (worktree + temp files) removed — working tree clean.

No blocking issues found. LGTM 3/3 (author cycle 20260910-113202, plus voting cycles 20260910-114658 and 20260910-115454, are all distinct).

@argszero
argszero merged commit 1b05d5e into master Sep 10, 2026
2 checks passed
argszero added a commit that referenced this pull request Sep 10, 2026
…1115 planted-fire timestamp, #1116 journal citation integrity, #1117 Agent.md GUI count guard) (#1118)

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant