Skip to content

feat(event): score TDT mention links with precision and recall - #66

Merged
seonghobae merged 7 commits into
mainfrom
agent/event-link-detection
Aug 25, 2026
Merged

feat(event): score TDT mention links with precision and recall#66
seonghobae merged 7 commits into
mainfrom
agent/event-link-detection

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

#45 remains preferred merge (0007) but is only locally blocked: hourly re-drafted it; this cycle marked it ready again. Exact-head required checks were cancelled by the draft and are re-queuing. No qualifying independent APPROVE (CodeRabbit COMMENTED only). #38 must not leapfrog #45.

Next no-0008 gap: TDT link-detection precision/recall in existing event_core (does not recreate TDT/CHRONOS crates, does not wait on #48/#49/#53/#65, and does not allocate 0008).

  • refuse_event_link_as_instance / refuse_event_link_as_transition never promote a detected pair
  • EventLinkPair refuses self-links and normalizes pair order
  • event_link_precision and event_link_recall fail closed on empty sets
  • Computed RMSE of known link targets is lower under calibrated scores than under an always-link detector

Test plan

  • RED: link_detection_contract failed with E0432/E0599
  • cargo test -p event_core --offline
  • cargo clippy -p event_core --all-targets --offline -- -D warnings
  • cargo test --workspace --offline
  • python3 scripts/validate_documentation.py and check_docstrings.py
  • exact-head required Checks (do not treat queued evidence as passed)

Do not self-approve or merge. Prefer merge #45 when exact-head required checks and a qualifying independent APPROVE exist. Do not allocate 0008.


Open in Devin Review

Keep detected same-event pairs distinct from promoted instances and
state transitions, and require computed precision, recall, and RMSE
against known-truth pair sets.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 42 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bb6c5b97-30ee-4f09-838c-10e93886b01f

📥 Commits

Reviewing files that changed from the base of the PR and between c1c47d1 and 80592e3.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • DOCUMENTATION.md
  • crates/event_core/src/error.rs
  • crates/event_core/src/lib.rs
  • crates/event_core/src/link.rs
  • crates/event_core/tests/link_detection_contract.rs
  • docs/TRACEABILITY.md
  • docs/adr/0016-tdt-chronos-event-intelligence-boundary.md
  • docs/adr/README.md
  • docs/research/event-link-detection-calibration.md
  • docs/validation/temporal-event-foundation.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	CHANGELOG.md
#	DOCUMENTATION.md
#	docs/TRACEABILITY.md
@seonghobae
seonghobae marked this pull request as ready for review August 20, 2026 10:25
@seonghobae

Copy link
Copy Markdown
Contributor Author

Reviewed and integrated current protected main without force-push.

Current head: 633d41c

Verification at this exact head:

  • cargo fmt --all -- --check
  • cargo test -p event_core --offline (5 unit, crate contract, 5 link-detection, 4 mention/instance, doctests)
  • cargo clippy -p event_core --all-targets --offline -- -D warnings
  • python3 scripts/check_workspace_contract.py
  • python3 scripts/check_docstrings.py
  • python3 scripts/validate_documentation.py
  • git diff --check

The link contract remains fail-closed: self-links and empty metric denominators reject, mention links cannot become instances or state transitions, and precision/recall are computed from normalized known-truth pairs. Please run protected current-head Checks and obtain the required independent approval before normal merge.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Current-head review refresh for 633d41c:

  • The TDT mention-link contract measures pair precision and recall against known truth, keeps mention identity separate from event instances, and refuses link-to-instance or link-to-transition promotion.
  • git diff --check, documentation validation, workspace contract, docstring contract, and cargo fmt --all -- --check passed locally.
  • All hosted exact-head checks, including Rust tests, PostgreSQL integration, coverage, security scans, and Strix, pass.
  • No new actionable defect was found at this exact head; no approval is being self-issued.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head review receipt: current-main conflict repair was completed and pushed at 380be3f33f798cc8648a9dc9f24b85011f9e0468. Local proof: Rust fmt, full offline workspace tests, workspace clippy -D warnings, documentation validator, workspace contract, git diff --check, CodeGraph sync, and CodeReviewGraph update. Please evaluate this exact SHA with independent Noema/OpenCode review; current-head required Checks remain authoritative before merge. @cwl-noema-review @opencode-agent

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae enabled auto-merge (squash) August 24, 2026 00:58
@opencode-agent
opencode-agent Bot disabled auto-merge August 24, 2026 00:59
devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae enabled auto-merge August 24, 2026 07:28
@github-actions
github-actions Bot disabled auto-merge August 24, 2026 08:18
Union of CHANGELOG/DOCUMENTATION rows; event_core error-variant and
module/export union keeping link, intelligence, and first-story surfaces;
ADR 0016 maturity consolidated to one statement; ADR index deduped to one
0016 row with combined wording; APA register keeps Allan et al. (1998)
before Allen (1983); ledger keeps link precision/recall row and main's
nested-ICC membership row.
@seonghobae
seonghobae enabled auto-merge August 25, 2026 02:00

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 3 new potential issues.

Open in Devin Review

Comment thread registered_agents.json
Comment on lines +167 to +174
fn counted_rate(numerator: usize, denominator: usize) -> Result<f64, EventError> {
let numerator = u32::try_from(numerator).map_err(|_| EventError::InvalidWirePayload)?;
let denominator = u32::try_from(denominator).map_err(|_| EventError::InvalidWirePayload)?;
if denominator == 0 {
return Err(EventError::InvalidWirePayload);
}
Ok(f64::from(numerator) / f64::from(denominator))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Empty-set precision/recall fails closed by design

event_link_precision errors on empty recovered set and event_link_recall errors on empty truth set, via the denominator==0 guard in counted_rate. This is a deliberate fail-closed choice matching the doctoring note and tests, not a defect.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread docs/TRACEABILITY.md
Comment on lines +36 to +37
| evidence-bounded LLM interpretation | ADR 0010/0012; PRD | `tepp_api` router plus future `interpretation_gateway` | partial |
| evidence-bounded LLM interpretation | ADR 0010/0012; PRD | `tepp_api` router implemented-main plus future `interpretation_gateway` | partial |

@devin-ai-integration devin-ai-integration Bot Aug 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Duplicate traceability rows for LLM interpretation

The change adds two near-identical 'evidence-bounded LLM interpretation' rows in docs/TRACEABILITY.md, differing only in wording ('router plus future' vs 'router implemented-main plus future'). The duplication looks unintentional and mirrors similar duplicate rows already present in the doc.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@github-actions
github-actions Bot disabled auto-merge August 25, 2026 02:03
# Conflicts:
#	DOCUMENTATION.md
#	crates/event_core/src/error.rs
#	docs/TRACEABILITY.md
#	docs/adr/0016-tdt-chronos-event-intelligence-boundary.md
#	docs/research/standards-and-literature.md

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

Open in Devin Review

Comment thread crates/event_core/src/error.rs
Comment thread docs/adr/0016-tdt-chronos-event-intelligence-boundary.md
# Conflicts:
#	CHANGELOG.md
#	DOCUMENTATION.md
#	crates/event_core/src/error.rs
#	docs/TRACEABILITY.md
#	docs/adr/0016-tdt-chronos-event-intelligence-boundary.md
#	docs/adr/README.md
#	docs/validation/temporal-event-foundation.md
@seonghobae
seonghobae merged commit 546ca2a into main Aug 25, 2026
17 of 25 checks passed

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

Open in Devin Review

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Pre-existing fused error-message tuple

The UnknownFirstStoryLabel entry is already fused with EventTrackIsNotEventInstance into a four-element tuple in the merge-base, the same defect as the newly introduced one. The test array was already structurally broken; fixing it in the same pass would restore both message assertions.

(Refers to this code)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +146 to +148
(
EventError::UnknownEventLinkLabel,
"unknown event link label",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Link-label error test fused with first-story case

The added UnknownEventLinkLabel test entry never closes its tuple, so it absorbs the following FirstStoryIsNotEventInstance entry into one four-element tuple. The array now mixes tuple shapes and the message checks for both error variants no longer run.

Suggested change
(
EventError::UnknownEventLinkLabel,
"unknown event link label",
(
EventError::UnknownEventLinkLabel,
"unknown event link label",
),
(
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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