Skip to content

Extend profile service to include the profile logic - #344

Draft
SharonStrats wants to merge 2 commits into
stagingfrom
feat/profile-logic
Draft

SharonStrats wants to merge 2 commits into
stagingfrom
feat/profile-logic

Conversation

@SharonStrats

@SharonStrats SharonStrats commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Just trying it out we can decide not to use it.

Prompt: Created 2 docs and pointed copilot to them, one for the best
strategies for working with data in solidos and another to all the problems
I found with the profile mutations. Told it copy the logic in profile-pane for
mutations to solid-logic, extend the profile service and expose these methods.
After that performed many cleanup tasks to simply/cleanup the code even further.

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>

Copilot AI 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.

🟡 Changes recommended

Several mutation paths can lose profile data, ignore supplied fields, or fail to update supported RDF representations.

9 open findings
What changed in this PR

Extends profile logic with typed read and mutation APIs for profile sections, backed by shared RDF utilities and comprehensive tests.

Changes:

  • Adds profile selectors, mutation services, and public types.
  • Supports RDF lists, legacy profile formats, ordering, and metadata normalization.
  • Adds broad profile-section test coverage and shared container/URI utilities.
File Description
test/​profileSocialRead.test.ts Tests social-account reading.
test/​profileResumeSelectors.test.ts Tests resume selection and ordering.
test/​profileReadLogic.test.ts Tests singleton profile reads.
test/​profileProjectSelectors.test.ts Tests project loading and selection.
test/​profile-social-presenter.test.ts Tests social presentation.
test/​profile-social-mutations.test.ts Tests social writes and ordering.
test/​profile-skills-mutations.test.ts Tests skill reads and writes.
test/​profile-resume-mutations.test.ts Tests resume mutations.
test/​profile-projects-mutations.test.ts Tests project mutations.
test/​profile-languages-mutations.test.ts Tests language formats and mutations.
test/​profile-heading-presenter.test.ts Tests heading presentation.
test/​profile-heading-mutations.test.ts Tests heading mutations.
test/​profile-heading-id-node.test.ts Tests heading ID-node creation.
test/​profile-education-mutations.test.ts Tests education operations.
test/​profile-cv-presenter.test.ts Tests CV presentation.
test/​profile-contact-info-mutations.test.ts Tests contact operations.
test/​profile-bio-mutations.test.ts Tests biography operations.
src/​util/​utils.ts Adds HTTP URI helpers.
src/​util/​containerLogic.ts Adds idempotent container assurance.
src/​types.ts Expands profile service interfaces.
src/​profile/​texts.ts Defines profile error messages.
src/​profile/​sections/​social/​types.ts Defines social models.
src/​profile/​sections/​social/​selectors.ts Presents social accounts.
src/​profile/​sections/​social/​read.ts Adds canonical social reader.
src/​profile/​sections/​social/​mutations.ts Implements social mutations.
src/​profile/​sections/​social/​helpers.ts Adds social metadata helpers.
src/​profile/​sections/​skills/​types.ts Defines skill models.
src/​profile/​sections/​skills/​selectors.ts Reads profile skills.
src/​profile/​sections/​skills/​mutations.ts Implements skill mutations.
src/​profile/​sections/​shared/​types.ts Defines shared mutation types.
src/​profile/​sections/​shared/​text.ts Adds text normalization helpers.
src/​profile/​sections/​shared/​rdfMutationHelpers.ts Adds RDF update utilities.
src/​profile/​sections/​shared/​rdfList.ts Adds RDF-list expansion.
src/​profile/​sections/​shared/​projectCommunityNodes.ts Resolves community project nodes.
src/​profile/​sections/​shared/​profileVocabularies.ts Centralizes profile vocabularies.
src/​profile/​sections/​shared/​mutationErrors.ts Wraps mutation errors.
src/​profile/​sections/​shared/​idNodeFactory.ts Generates profile ID nodes.
src/​profile/​sections/​resume/​types.ts Defines resume models.
src/​profile/​sections/​resume/​selectors.ts Reads and sorts roles.
src/​profile/​sections/​resume/​mutations.ts Implements resume mutations.
src/​profile/​sections/​projects/​types.ts Defines project models.
src/​profile/​sections/​projects/​selectors.ts Loads and presents projects.
src/​profile/​sections/​projects/​mutations.ts Implements project mutations.
src/​profile/​sections/​languages/​types.ts Defines language models.
src/​profile/​sections/​languages/​selectors.ts Reads language formats.
src/​profile/​sections/​languages/​normalization.ts Normalizes language identifiers.
src/​profile/​sections/​languages/​mutations.ts Implements ordered language writes.
src/​profile/​sections/​heading/​types.ts Defines heading models.
src/​profile/​sections/​heading/​selectors.ts Presents profile headings.
src/​profile/​sections/​heading/​mutations.ts Implements heading mutations.
src/​profile/​sections/​education/​types.ts Defines education models.
src/​profile/​sections/​education/​selectors.ts Reads education records.
src/​profile/​sections/​education/​mutations.ts Implements education mutations.
src/​profile/​sections/​contactInfo/​types.ts Defines contact models.
src/​profile/​sections/​contactInfo/​selectors.ts Reads contact information.
src/​profile/​sections/​contactInfo/​rdfBuilders.ts Builds contact RDF statements.
src/​profile/​sections/​contactInfo/​mutations.ts Implements contact mutations.
src/​profile/​sections/​bio/​types.ts Defines biography models.
src/​profile/​sections/​bio/​selectors.ts Reads biography details.
src/​profile/​sections/​bio/​mutations.ts Implements biography mutations.
src/​profile/​profileMutationService.ts Coordinates profile writes.
src/​profile/​profileLogic.ts Exposes profile reads and mutations.
src/​profile/​ontology/​social/​accounts.ts Defines social account metadata.
src/​index.ts Exports the profile API.
src/​acl/​accessControlSubjects.ts Exports origin URL detection.
package-lock.json Updates the toolkit lock entry.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/profile/sections/shared/rdfList.ts
Comment on lines +178 to +184
const existingRows: SocialRow[] = presentSocial(subject, store).accounts.map((account) => ({
name: trimText(account.name),
icon: trimText(account.icon),
homepage: trimText(account.homepage),
sourceNode: account.sourceNode.value,
status: 'existing'
}))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

existingRows now comes from the canonical getSocialAccounts reader instead of presentSocial;
unnamed accounts are retained individually;
existing account types are preserved when no recognized social option is available;
existing metadata is not discarded during an empty mutation or reorder.

Comment thread src/profile/sections/contactInfo/rdfBuilders.ts
Comment thread src/profile/sections/heading/mutations.ts
: (normalized.startsWith('http://') || normalized.startsWith('https://'))
? sym(normalized)
: literal(normalized)
replacePredicateStatements(store, subject, ns.vcard('hasPhoto'), doc, deletions, insertions, nextObject)

@SharonStrats SharonStrats Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

did the following

  • Image selection now gives canonical vcard:hasPhoto precedence.
  • Updating imageSrc removes supported legacy predicates:
    • sioc:avatar
    • foaf:img
    • vcard:logo
    • vcard:photo
    • foaf:depiction
  • The new image is written only as vcard:hasPhoto.
  • Removing imageSrc clears both canonical and legacy image predicates.
    leaving this open in case this isn't how we want to handle it.

Comment thread src/profile/sections/languages/mutations.ts
Comment thread src/profile/sections/projects/mutations.ts
Comment on lines +85 to +87
if (!resumeData.orgName && !resumeData.orgType && !resumeData.orgLocation && !resumeData.orgHomePage) {
return []
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed this, but still want to think abou tit so not resolving it.

Comment thread src/profile/sections/resume/mutations.ts
Prompt: Move the selection for profile pane to solid-logic profile
service.

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>
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.

2 participants