Repository navigation
Extend profile service to include the profile logic - #344
SharonStrats wants to merge 2 commits into
Conversation
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>
There was a problem hiding this comment.
🟡 Changes recommended
Several mutation paths can lose profile data, ignore supplied fields, or fail to update supported RDF representations.
9 open findings
RDF list traversal can loop indefinitely on cycles · New Lossy social presenter drops unnamed accounts and metadata · New Phone updates retain stale direct telephone links · New Heading mutations silently ignore additional operations · New Legacy image predicates prevent image updates and deletion · New Language proficiency is not serialized · New Blank-node community deletion becomes a no-op · New Public-ID-only organizations are discarded · New Blank-node role updates leave stale memberships · New
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.
| 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' | ||
| })) |
There was a problem hiding this comment.
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.
| : (normalized.startsWith('http://') || normalized.startsWith('https://')) | ||
| ? sym(normalized) | ||
| : literal(normalized) | ||
| replacePredicateStatements(store, subject, ns.vcard('hasPhoto'), doc, deletions, insertions, nextObject) |
There was a problem hiding this comment.
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.
| if (!resumeData.orgName && !resumeData.orgType && !resumeData.orgLocation && !resumeData.orgHomePage) { | ||
| return [] | ||
| } |
There was a problem hiding this comment.
fixed this, but still want to think abou tit so not resolving it.
eb1c8c8 to
0015a37
Compare
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>
0015a37 to
7f861e8
Compare


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