Skip to content

refactor(api): name JSON-LD node identity explicitly - #462

Draft
seonghobae wants to merge 4 commits into
mainfrom
fix/jsonld-node-semantic-identifier
Draft

refactor(api): name JSON-LD node identity explicitly#462
seonghobae wants to merge 4 commits into
mainfrom
fix/jsonld-node-semantic-identifier

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Owner and reuse boundary

ContextualWisdomLab/TEPP owns the versioned analytical-artifact export contract in tepp_api. JsonLdExport exposed the primary node identity as a bare Rust field/constructor parameter id, even though sibling export identities are already qualified (artifact_id, snapshot_id, graph_id). Organization-wide search found no ContextualWisdomLab source consumer accessing JsonLdExport.id; modular consumers use the versioned serialized artifact boundary.

TDD / repair

  • RED commit 47e7ec5cd923a5e6ea2a2b0da735a92daf3b3ff3 adds an external crate regression that requires JsonLdExport.node_id while verifying the v1 wire still contains "id" and never "node_id".
  • JsonLdExport now uses node_id in Rust source and constructor/validation logic.
  • #[serde(rename = "id")] keeps serialization and deserialization compatible with the existing v1 wire key.
  • deny_unknown_fields, contract version, non-empty validation, digest semantics, export authorization, and all psychometric/temporal/scientific computation remain unchanged.
  • This does not silently turn the v1 key into JSON-LD @id; that would require a separate versioned interoperability decision.

Documentation / traceability

  • docs/doctoring/jsonld-node-semantic-identifier.md records the Analytical Artifact Export bounded context, compatibility invariant, RED/GREEN boundary, and APA 7 references to identifier-comprehension research and the W3C JSON-LD 1.1 Recommendation.
  • docs/connectors/naruon-artifact-consumer.md now states that Rust uses node_id while v1 consumers continue to receive id.

Exact identity

  • protected base: main@1bc02f580cf48e1d39da239f0e818453437c31c3
  • branch: fix/jsonld-node-semantic-identifier
  • exact head at PR creation: c1b7d627167dd7636d2975cc41cec050a5e477ba

Release / migration boundary

No database migration or serialized wire-version bump is required because the persisted/network key is unchanged. tepp_api is publish = false; the source field rename is repository-owned and no organization source consumer was found using the removed field spelling. A release/version change must wait for the repository's normal release contract and exact protected-head evidence.

Merge gate

Fresh exact-head Rust tests, 100% authored line/branch coverage, docs/security/supply-chain checks, current reviews, and any central required workflows are merge authority. Do not transfer predecessor/base/model-only evidence, self-approve, force-push, or bypass ordinary protection.


Devin Review

Summary by CodeRabbit

  • 변경 사항

    • JSON-LD 내보내기의 노드 식별자 필드명이 의미를 더 명확히 전달하도록 개선되었습니다.
    • 기존 v1 JSON 형식의 "id" 키와의 호환성이 유지됩니다.
    • 직렬화 및 역직렬화 과정에서 노드 식별자가 올바르게 보존됩니다.
  • 문서

    • 식별자 명명 규칙, 버전별 와이어 계약 및 JSON-LD 호환성 관련 설명을 보강했습니다.
    • 관련 결정 사항과 참고 자료를 추가했습니다.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 3fb7ff2b-762d-480b-b14a-e627a222596a

📥 Commits

Reviewing files that changed from the base of the PR and between 1bc02f5 and c1b7d62.

📒 Files selected for processing (4)
  • crates/tepp_api/src/export.rs
  • crates/tepp_api/tests/jsonld_semantic_identifier.rs
  • docs/connectors/naruon-artifact-consumer.md
  • docs/doctoring/jsonld-node-semantic-identifier.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

JsonLdExport의 Rust 필드명을 node_id로 변경했습니다. Serde 매핑으로 v1 JSON 키 "id"를 유지했습니다. 회귀 테스트와 결정 문서가 소스 계약 및 와이어 호환성을 검증하고 설명합니다.

Changes

JSON-LD 식별자 계약

Layer / File(s) Summary
JsonLdExport API 계약
crates/tepp_api/src/export.rs
JsonLdExport 필드와 생성자 매개변수를 node_id로 변경했습니다. 빈 값 검증도 node_id를 대상으로 수행합니다. Serde 직렬화 키는 "id"로 유지합니다.
v1 와이어 호환성 검증
crates/tepp_api/tests/jsonld_semantic_identifier.rs
Rust 필드 접근, "id" JSON 키 직렬화, node_id 역직렬화 왕복을 검증하는 통합 테스트를 추가했습니다.
식별자 계약 문서화
docs/connectors/naruon-artifact-consumer.md, docs/doctoring/jsonld-node-semantic-identifier.md
Rust 필드명과 v1 와이어 키의 구분을 문서화했습니다. JSON-LD 1.1 참고자료와 명명 결정 사항을 추가했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to c1b7d

The Rust API now names the JSON-LD node identity explicitly as node_id while existing v1 consumers continue receiving id, with validation and serialization behavior unchanged. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 JSON-LD 노드 식별자의 명시적 이름 변경이라는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/jsonld-node-semantic-identifier

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 bugs or issues to report.

Devin Review

@seonghobae
seonghobae enabled auto-merge (squash) September 1, 2026 14:07
@seonghobae
seonghobae marked this pull request as draft September 1, 2026 16:30
auto-merge was automatically disabled September 1, 2026 16:30

Pull request was converted to draft

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