This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Repository navigation
Add a Clockify platform lens - #24
Merged
Merged
Conversation
Phase A of the timesheet plugin's Project/Person enrichment (ontola/atomic-plugins#4): migrates clockifyProjection out of atomic-plugins' integrations/clockify/localthought.ts, where it lived as a locally-duplicated implementation against a type triple structurally identical to but not derived from this repo's own FetchedPlatform/FetchedRecord/Term contract. Mirrors the github-issues/google-calendar platform-lenses layout (lens/{types, projection}.ts, an index re-export) rather than extending the duplicate in place. clockifyProjection's start/end-interval behavior is unchanged. Adds resolveClockifyReferences, a pure function matching each time entry's projectid/userid against project/member records fetched in the same batch -- the counterpart, at the lens layer, to the projectId/userId references localthought/overlays' Clockify crud-causality overlay now declares via CRUD Causality 0.3.0 (pondersource/openapi-extensions#24). It resolves identity only, same as that spec's Reference Object; allocating or writing an Atomic resource for the referenced project or member -- and fetching project/member in the first place -- stays with whichever layer owns identity and durable state for the imported table, not this lens. pnpm lint / test / build all pass; 9 new tests, 114 total. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cng3r2ijbx8fBVZjLsEdH9
This was referenced Sep 21, 2026
2 of 3 tasks
michielbdejong
added a commit
to ontola/atomic-server
that referenced
this pull request
Sep 21, 2026
Phase A of the timesheet plugin's Project/Person enrichment (ontola/atomic-plugins#4): integrations/clockify/localthought.ts duplicated a FetchedPlatform/FetchedRecord/Term type triple structurally identical to devonian's own, instead of importing it -- unlike the Google Calendar/GitHub Issues LocalThought platforms, which already do. clockifyProjection now lives in devonian/platform-lenses/clockify (localthought/devonian#24) alongside a new resolveClockifyReferences, matching each time entry's projectid/userid against project/member records fetched in the same batch. This module keeps only what's genuinely plugin-specific: the rolling look-back window / query builder. No public export of this module changes -- ClockifyLocalThought.tsx's imports (CLOCKIFY_APP, CLOCKIFY_PLATFORM, clockifyFields, clockifyImportQuery, clockifyProjection, defaultClockifySelection, LOOKBACK_OPTIONS, ClockifySelection, LookbackDays) all still resolve, several of them now re-exported rather than declared locally. Needs browser/data-browser/package.json's pinned devonian commit bumped once localthought/devonian#24 merges, before this actually resolves -- same pin-then-bump pattern as localthought/overlays' catalog.json. Left unbumped here rather than pointing it at an unmerged branch; full pnpm install/build wasn't run for the same reason (it would only prove the *old*, still-duplicated behavior). Claude-Session: https://claude.ai/code/session_01Cng3r2ijbx8fBVZjLsEdH9 Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase A of the timesheet plugin's Project/Person enrichment (ontola/atomic-plugins#4). Adds
platform-lenses/clockify/, mirroring thegithub-issues/google-calendarlayout (lens/{types,projection}.ts, anindex.tsre-export).clockifyProjectionpreviously lived only inatomic-plugins'integrations/clockify/localthought.ts, as a locally-duplicated implementation against a type triple structurally identical to but not derived from this repo'sFetchedPlatform/FetchedRecord/Termcontract. This migrates it here unchanged (same start/end-interval derivation, same break/running-timer handling) rather than continuing to extend the duplicate in place.What's new
resolveClockifyReferences: a pure function matching each time entry'sprojectid/useridagainstproject/memberrecords fetched in the same batch — the lens-layer counterpart to theprojectId/userIdreferences localthought/overlays' Clockify crud-causality overlay now declares via CRUD Causality 0.3.0 (CRUD Causality: cross-resource references (foreign keys) pondersource/openapi-extensions#24, merged). It resolves identity only, the same way that spec's Reference Object does: a raw id with no matching record in the batch is a dangling reference (not fetched — archived, paginated out, etc.), reported as such rather than treated as an error.AtomicIdentityMap/AtomicLens(or equivalent), and stays with whichever layer owns identity and durable state for the imported table — this lens stays passive, perdocs/atomic-data.md's "Passive platform lenses" contract (no dataset access, no identity lookups).Verification
pnpm install --frozen-lockfile,pnpm lint,pnpm test,pnpm buildall pass — 9 new tests (start/end derivation, break/running-timer skipping, project/member passthrough, reference resolution including the dangling case), 114 total, 0 new lint warnings.Follow-up needed elsewhere
browser/data-browser/package.jsoninontola/atomic-serverpinsdevonianto a specific commit (github:localthought/devonian#fb415ef...), soplatform-lenses/clockifywon't be reachable there until that pin is bumped to a commit onmainthat includes this PR — same two-step pattern aslocalthought/overlays'catalog.jsonpin. Left that bump for a follow-up once this merges, rather than pointing it at an unmerged branch.🤖 Generated with Claude Code
https://claude.ai/code/session_01Cng3r2ijbx8fBVZjLsEdH9
Generated by Claude Code