Skip to content

fix(longitudinal): reconcile unique Commons observation identity with main - #289

Closed
seonghobae wants to merge 10 commits into
mainfrom
fix/longitudinal-record-identity-main-20260821
Closed

seonghobae wants to merge 10 commits into
mainfrom
fix/longitudinal-record-identity-main-20260821

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Why

Protected main treats observation_record_ref as the opaque Commons identity of one immutable longitudinal observation, while the current LongitudinalObservationSet only enforces uniqueness of the Gyeot source tuple (enrollment_ref, source_system_ref, source_observation_ref). Two distinct source observations can therefore reuse one Commons record identity and both be accepted. That is a data-integrity defect and conflicts with the repository's immutable product-identity direction.

Historical PR #262 contains the same narrow domain fix but is based at 503a4e640eeba0f5e126fa4c4078d8d21aebb93b, one protected-main commit behind current 4499d9c0889c082487ddbd7fd8d0d5d18257995d. The intervening #251 integration touches scoring/runtime files (src/lib.rs, src/scoring_engine.rs, tests/scoring_engine_adapter_contract.rs, tests/session_http_framing.rs) and does not overlap this longitudinal source/test slice. Historical checks, reviews, and resolved threads on #262 nevertheless do not transfer to a new exact head.

Current-main TDD lineage

  • RED 3d8e198b16026765ebd5a43c923cbe9b2183aaee adds the focused identity-collision contract directly on current protected main. Against current-main source it references the missing ObservationIdentityConflict behavior and therefore cannot compile/pass by construction; no local execution claim is made.
  • GREEN feeaab354ad6aa78c288183e46d7c0995b4ab51f applies the narrow domain guard. The final source blob c7fbd40e17d294826fc5d70ef0ee6951f3ff1b67 and regression-test blob a09ba88cb530d73ea9bd757665d92123296bac95 are byte-identical to the corresponding final, reviewed blobs on fix(longitudinal): reject reused Commons observation identities #262 while this branch preserves direct ancestry from current protected main.

What

  • Reject a distinct source observation that attempts to reuse an already accepted observation_record_ref.
  • Preserve exact source replay semantics: an exact replay still returns the first immutable record; same-source/different-evidence remains IdempotencyConflict.
  • Expose a distinct ObservationIdentityConflict error so operators can distinguish a Commons record-identity collision from source idempotency conflict.
  • Preserve the accepted record after a rejected collision; the regression contract retries the original observation and proves the original source identity remains authoritative.

Gyeot remains the collection owner and TEPP remains the temporal/multilevel/multiple-membership analysis owner. This PR does not add persistence, HTTP, scoring, psychometric kernels, or cross-service database access.

Documentation reconciliation

The predecessor also changed docs/TRACEABILITY.md with text explicitly naming active PR #262. That stale active-PR statement is intentionally not copied verbatim. The canonical traceability row will be reconciled on this current landing vehicle so it identifies this PR as IMPLEMENTED_ON_ACTIVE_PR without promoting the behavior to protected-main truth before merge.

Supersession

This is the current-protected-main landing vehicle for #262. Once this PR is confirmed open at an unchanged exact head and current base, #262 should remain closed rather than rebased or merged as a competing writer lane.

Acceptance

Do not merge until the unchanged final exact head passes Runtime CI, exact line/branch coverage, rustfmt/Clippy/rustdoc, security/SAST/SBOM/provenance, zero valid unresolved findings, and qualifying independent non-author review where required. Pending, queued, skipped, cancelled, stale, predecessor, synthetic, or model-only evidence is not passing. Never self-approve.


Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 6 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: 824550ef-9f42-4321-a6fc-a38381dc8c26

📥 Commits

Reviewing files that changed from the base of the PR and between 5f0a534 and ba028e6.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • docs/TRACEABILITY.md
  • src/longitudinal_observation.rs
  • tests/longitudinal_observation_record_identity.rs

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.

@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: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Copy link
Copy Markdown
Contributor Author

Updated exact head 5c795974babe4246980290f4658e1584aae9a059 after review: the identity-collision invariant is now recorded in docs/TRACEABILITY.md and CHANGELOG.md as active-PR evidence, while protected-main and persistence boundaries remain accurately marked. Local exact-head validation passed: identity/time tests 1/1 + 1/1, documentation/traceability contracts 10/10 + 1/1, fmt, clippy -D warnings, rustdoc -D warnings, and git diff --check. Current protected workflows are queued/pending; no approval or merge is inferred.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 6500c81d6ea7ec633d21c7b15906d0e7c89e53f3.

  • Head SHA: 6500c81d6ea7ec633d21c7b15906d0e7c89e53f3

  • Workflow run: 32700326072

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (2 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (2 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: TRACEABILITY.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: TRACEABILITY.md"]
  R2 --> V2["docs review"]
  Evidence --> S3["Test: longitudinal_observation_record_identity.rs"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: longitudinal_observation_record_identity.rs"]
  R3 --> V3["targeted test run"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 6500c81d6ea7ec633d21c7b15906d0e7c89e53f3
  • Workflow run: 32700326072
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 6500c81d6ea7ec633d21c7b15906d0e7c89e53f3.

  • Head SHA: 6500c81d6ea7ec633d21c7b15906d0e7c89e53f3

  • Workflow run: 32700326072

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (2 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (2 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: TRACEABILITY.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: TRACEABILITY.md"]
  R2 --> V2["docs review"]
  Evidence --> S3["Test: longitudinal_observation_record_identity.rs"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: longitudinal_observation_record_identity.rs"]
  R3 --> V3["targeted test run"]
Loading

devin-ai-integration[bot]

This comment was marked as resolved.

@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 CHANGELOG.md

### Added
- Active PR #287 rejects padded or otherwise noncanonical published narrative, style-mapping, interpretation-unit, and approved-selection references before deterministic rendering. Numeric score authority and the protected-main narrative boundary are unchanged; this is active-PR evidence only and not a release claim.
- Merged #289 rejects reuse of a Commons observation-record identity by a distinct longitudinal source observation once integrated; exact source replay remains idempotent, and a rejected collision does not replace accepted evidence.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changelog marks the current unmerged PR as merged

The Added entry leads with Merged #289, but this is the open PR under review, and the traceability row edited in the same change labels it **Active PR #289** (docs/TRACEABILITY.md:51). Representing an active PR as protected-main implementation contradicts the documentation-status rule.

Suggested change
- Merged #289 rejects reuse of a Commons observation-record identity by a distinct longitudinal source observation once integrated; exact source replay remains idempotent, and a rejected collision does not replace accepted evidence.
- Active PR #289 rejects reuse of a Commons observation-record identity by a distinct longitudinal source observation once integrated; exact source replay remains idempotent, and a rejected collision does not replace accepted evidence.
Open in Devin Review

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

Comment thread CHANGELOG.md
### Added
- Active PR #287 rejects padded or otherwise noncanonical published narrative, style-mapping, interpretation-unit, and approved-selection references before deterministic rendering. Numeric score authority and the protected-main narrative boundary are unchanged; this is active-PR evidence only and not a release claim.
- Merged #289 rejects reuse of a Commons observation-record identity by a distinct longitudinal source observation once integrated; exact source replay remains idempotent, and a rejected collision does not replace accepted evidence.
- Merged #287 rejected padded or otherwise noncanonical published narrative, style-mapping, interpretation-unit, and approved-selection references before deterministic rendering. Numeric score authority and the protected-main narrative boundary are unchanged.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changelog and traceability disagree on #287 status

This entry relabels #287 as Merged #287, but the traceability row still calls the same work **Active PR #287** (docs/TRACEABILITY.md:35). The two docs contradict each other on whether #287 is protected-main implementation.

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