Skip to content

Conversation

@bplatz
Copy link
Contributor

@bplatz bplatz commented Oct 21, 2025

Centralizes index metadata access patterns that were previously scattered across multiple modules and removes dead code from the commit workflow.

Removes 'index' from being written to commits going forward to focus on a single source of truth in nameservice. Currently index-t/address are embedded in commit so just dissoc from write for now, but in the future it should be held in a separate data structure outside of the commit that will hold other nameservice info.

Key changes:

  • New index.metadata namespace: Provides canonical functions (index-metadata, index-address, index-t) for extracting index metadata from commits or JSON-LD
  • Removed dead code: Deleted unused use-latest-index function from commit_data.cljc
  • Removed duplicate index-t: Eliminated duplicate function from commit_data.cljc in favor of centralized implementation

Foundation for future work:
This refactoring prepares the codebase to migrate from storing index metadata in commits to using the nameservice as the system of record. The nameservice already tracks index address, index t, and status fields and is the only thing used, index metadata is already ignored in commits.

Future work will update callers to accept nameservice metadata to extract latest index, eliminating the need to duplicate index metadata in commit structures.

@bplatz bplatz requested a review from a team October 21, 2025 14:35
(go-try
(let [commit-jsonld (commit-data/->json-ld commit)
(let [commit-jsonld (-> (commit-data/->json-ld commit)
(dissoc "index"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now we broadcast new indexes by publishing a new commit that includes an updated index map. I agree that we shouldn't overload these methods and that the latest commit and latest index should live in different data structures on the nameservice.

Does this pr add another way to publish new indexes since the index information is now stripped from the commit document?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was already ignored in the commit -- during load it gets it from the nameservice. So the commit index reference is not used at all.

@bplatz bplatz marked this pull request as draft October 24, 2025 15:54
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.

3 participants